haodai.js
10 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
JGPmoney = false;
JGPmonth = false;
CompanyType = false;
dgdsMoney= false;
BusinessTime= false;
ApplyOne_yon = false;
UserName = false;
Tel = false;
Email = true;
applyArea = true;
$(document).ready(function() {
HomeIconW();
});
function HomeiptFoc(){
$('.ipt_ts').text('');
}
function HomeSearchYZ(){
var moneyVal = $('#dkMoney').val();
if(moneyVal.length == 0){
$('#money_ts').text('金额别忘了填哦');
}else{
if(!isNaN(moneyVal)){
if (moneyVal < 0 || moneyVal > 6000) {
$('#money_ts').text('只限0~6000万');
JGPmoney = false;
} else {JGPmoney = true;}
} else {
$('#money_ts').text('只填纯数字哟');
JGPmoney = false;
}
}
var monthVal = $('#dkMonth').val();
if(monthVal.length == 0){
$('#month_ts').text('期限别忘了填哦');
}else{
if(!isNaN(monthVal)){
if (monthVal <= 0 || monthVal > 840) {
$('#month_ts').text('只限0~840个月');
JGPmonth = false;
} else {
JGPmonth = true;
}
}else{
$('#month_ts').text('只填纯数字哟');
JGPmoney = false;
}
}
}
function SearchFun(){
HomeSearchYZ();
if (JGPmoney == true && JGPmonth == true) {
var type_id = 1;
var money = $('#dkMoney').val();
var time_dw = $('#time_dw').hasClass('geyue');
var month = $('#dkMonth').val();
var interest = 0;
var give_time = 0;
var bank_type = 9999;
fixed_url = '/money/' + money + '/month/' + month;
var site_url = window.location.host;
var url = "http://" + site_url + '/qitongbao/xindai'+ fixed_url;
window.open(url, "_self");
return false;
}
}
function ProviewTab(obj){
var obj = $(obj);
var td = $('#Proview_tab_tit td');
td.removeClass('show_td');
obj.addClass('show_td');
var num = obj.index();
var con = $('#Proview_tab_con .Proview_tab_c1');
var objcon = con.eq(num);
con.hide();
objcon.show();
var zongHe = $('body').height();
$("html, body").animate({
scrollTop: zongHe
}, 1000);
}
function ApplyOne_yonCK(obj){
var obj = $(obj);
var span = $('.changeOp span');
var objspan = obj.find('span');
span.removeClass('changeYes');
objspan.addClass('changeYes');
$('#ApplyOne_yonTS').text('');
}
function hotkey(){
var hotkeyArr = new Array('','私营企业','个体工商户','公务员/事业单位','大型垄断国企','世界500强企业','上市企业','普通企业','无固定职业');
var hotkey = document.getElementById('CompanySelect').value;
var text = hotkeyArr[hotkey];
document.getElementById('CompanyType').innerHTML = text;
$('#CompanyType').attr('value',hotkey);
}
function HSearchType(){
var SelecteArr = new Array('','私营企业','个体工商户','公务员/事业单位','大型垄断国企','世界500强企业','上市企业','普通企业','无固定职业');
var hotkey = document.getElementById('HSearchTypeLi').value;
var text = SelecteArr[hotkey];
document.getElementById('HSearchType').innerHTML = text;
$('#HSearchType').attr('value',hotkey);
$('#HSearchType').css('color','#333');
}
function BusinessTimeCK(){
$('#BusinessTime').css('color','#333');
var hotkeyArr = new Array('','不足半年','半年','1年','2年','3年','4年','5年以上(含5年)');
var hotkey = document.getElementById('BusinessTimeSelect').value;
var text = hotkeyArr[hotkey];
document.getElementById('BusinessTime').innerHTML = text;
$('#BusinessTime').attr('value',hotkey);
}
function applyOneYZ(){
var c1val = $('#CompanyType').attr('value');
if(c1val == ''){
$('#companyTS').text('请您选择一个');
}else {
CompanyType = true;
}
var c2val = $.trim($('#dgdsMoney').val());
if(c2val == '请输入数字' || c2val == ''){
$('#dgdsTS').text('请输入数字');
dgdsMoney = false;
}else {
dgdsMoney = true;
}
var c3val = $('#BusinessTime').attr('value');
if(c3val == ''){
$('#BusinessTimeTS').text('请您选择一个');
}else {
BusinessTime = true;
}
var c4yon = $('.ApplyOne_yon .changeOp span').hasClass('changeYes');
if(c4yon == false){
$('#ApplyOne_yonTS').text('请您选择一个');
ApplyOne_yon = false;
}else {
ApplyOne_yon = true;
}
}
function applyTwoYZ(){
var UserNameval = $.trim($('#UserName').val());
if(UserNameval == '如:李先生'){
$('#UserNameTS').text('请输入您的姓名');
UserName = false;
}else {
var reg = /[^\u4E00-\u9FA5]+$/;
var boolean = !reg.test(UserNameval);
if (UserNameval.length > 0 && !reg.test(UserNameval)) {
UserName = true;
}else {
UserName = false;
$('#UserNameTS').text('请输入中文');
}
}
var Telval = $.trim($('#UserTel').val());
if(Telval == '用于接收信贷员联系方式'){
Tel = false;
$('#UserTelTS').text('请输入手机号码');
}else {
if(checkMobile(Telval)){
Tel = true;
}else{
Tel = false;
$('#UserTelTS').text('手机号格式不对哦');
}
}
var Emailval = $.trim($('#UserEmail').val());
if(Emailval == '用于获取申请贷款所需材料(可选填)'){
}else {
if(checkEmail(Emailval)){
Email = true;
}else{
Email = false;
$('#UserEmailTS').text('邮件格式不对哦');
}
}
}
function applyThreeYZ(){
var val = $.trim($('#applyArea').val());
var num = val.length;
var count = 140;
if (num > count) {
var yewnum = $(obj).val().substr(0, count)
$('#applyAreaTS').text('不超过140字哦');
applyArea = false;
}else if(num < 5){
$('#applyAreaTS').text('至少五个字,继续加油!');
applyArea = false;
}else {
applyArea = true;
}
}
function ApplyCK(nextName){
if(nextName == 'Applyone'){
applyOneYZ();
if(CompanyType == true && dgdsMoney == true && BusinessTime == true && ApplyOne_yon == true){
window.open('ApplyTwo.html');
}
}else if(nextName == 'Applytwo'){
applyTwoYZ();
if(UserName == true && Tel == true && Email == true){
window.open('ApplyThree.html');
}
}else if(nextName == 'ApplyThree'){
var val = $.trim($('#applyArea').val());
var num = val.length;
if(num > 0){
applyThreeYZ();
if(applyArea == true){
window.open('ApplyFour.html');
}
}else {
window.open('ApplyFour.html');
}
}
}
function hideTS(obj){
$('.ApplyOne_li_ts').text('');
}
function dgdsFoc(obj){
var obj = $(obj);
var vall = obj.val();
var val = $.trim(obj.val());
if(val == '请输入数字'){
obj.css('color','#999');
obj.val('');
}
obj.css('color','#333');
}
function dgdsBlu(obj){
var obj = $(obj);
var vall = obj.val();
var val = $.trim(obj.val());
if(val == ''){
obj.val('请输入数字');
obj.css('color','#999');
}
}
function usernameFoc(obj){
var obj = $(obj);
var vall = obj.val();
var val = $.trim(obj.val());
if(val == '如:李先生'){
obj.css('color','#999');
obj.val('');
}
obj.css('color','#333');
}
function usernameBlu(obj){
var obj = $(obj);
var vall = obj.val();
var val = $.trim(obj.val());
if(val == ''){
obj.val('如:李先生');
obj.css('color','#999');
}
}
function telFoc(obj){
var obj = $(obj);
var vall = obj.val();
var val = $.trim(obj.val());
if(val == '用于接收信贷员联系方式'){
obj.css('color','#999');
obj.val('');
}
obj.css('color','#333');
}
function telBlu(obj){
var obj = $(obj);
var vall = obj.val();
var val = $.trim(obj.val());
if(val == ''){
obj.val('用于接收信贷员联系方式');
obj.css('color','#999');
}
}
function emailFoc(obj){
var obj = $(obj);
var vall = obj.val();
var val = $.trim(obj.val());
if(val == '用于获取申请贷款所需材料(可选填)'){
obj.css('color','#999');
obj.val('');
}
obj.css('color','#333');
}
function emailBlu(obj){
var obj = $(obj);
var vall = obj.val();
var val = $.trim(obj.val());
if(val == ''){
obj.val('用于获取申请贷款所需材料(可选填)');
obj.css('color','#999');
}
}
function applyAreaFoc(obj){
var obj = $(obj);
var applyArea = obj.parents('.applyArea');
obj.text('');
obj.css('color','#333');
applyArea.css('border','1px solid #2babef');
}
function applyAreaBlu(obj){
var obj = $(obj);
var val = $.trim(obj.val());
var length = val.length;
if(length > 0){
obj.css('color','#999');
}else {
obj.css('color','#666');
}
var applyArea = obj.parents('.applyArea');
applyArea.css('border','1px solid #ccc');
}
function checkMobile(s) {
var regu = /^(13[0-9]|14[0-9]|15[0-9]|18[0-9])\d{8}$/;
var re = new RegExp(regu);
if (re.test(s)) {
return true;
}
else {
return false;
}
}
function checkEmail(yx){
var reyx=/^([a-zA-Z0-9_\.\-])+\@(([a-zA-Z0-9_\-])+\.)+([a-zA-Z0-9]{2,4})+$/;
return(reyx.test(yx));
}
function ChangeCity(){
$('#CityChange').toggle();
};
function ChangeCityLi(obj){
var obj = $(obj);
var bojhtml = obj.html();
var Shtml = $('#City').html(bojhtml);
document.getElementById('CityChange').style.display = "none";
}
function ChangeCityTab(obj){
var obj = $(obj);
var alltd = $('#CityChange table td');
alltd.removeClass('SCityTab');
obj.addClass('SCityTab');
var num = obj.index();
var citycon = $('.CityChangeTC_con');
var Tcitycon = $('#CityChangeTC div.CityChangeTC_con').eq(num);
citycon.hide();
Tcitycon.show();
}
function HomeIconW(){
var zongW = $(window).width();
if(zongW == 320){}
}
function SearchTypeLiCK(obj){
var obj = $(obj);
var reval = obj.attr('reval');
if(reval == 0){
$('.moreSearchTC_Nav li').removeClass('show');
obj.addClass('show');
$('.moreSearchTC_Con').hide();
$('#ShopSearchCon').show();
}else if(reval == 1){
$('.moreSearchTC_Nav li').removeClass('show');
obj.addClass('show');
$('.moreSearchTC_Con').hide();
$('#CompanySearchCon').show();
}else if(reval == 2){
$('.moreSearchTC_Nav li').removeClass('show');
obj.addClass('show');
$('.moreSearchTC_Con').hide();
$('#CarSearchCon').show();
}else if(reval == 3){
$('.moreSearchTC_Nav li').removeClass('show');
obj.addClass('show');
$('.moreSearchTC_Con').hide();
$('#HouseSearchCon').show();
}
}
function MoreSearchCK(){
var Msearch = $('#moreSearchTC');
$('#SearchTCZZC').show();
Msearch.show();
}
function MoreSearchBack(){
$('#moreSearchTC').hide();
$('#SearchTCZZC').hide();
}