diff --git a/fangija-zsyf/images/loan-img02.png b/fangija-zsyf/images/loan-img02.png index cf7c3c7..55310fb 100644 Binary files a/fangija-zsyf/images/loan-img02.png and b/fangija-zsyf/images/loan-img02.png differ diff --git a/fangija-zsyf/js/loan/loanInfo.js b/fangija-zsyf/js/loan/loanInfo.js new file mode 100644 index 0000000..6977a27 --- /dev/null +++ b/fangija-zsyf/js/loan/loanInfo.js @@ -0,0 +1,127 @@ +//短信验证类型 +var APPLY_LOAN = "applyLoan"; + +//如果是抵押贷款时候,需要上层页面传入houseId +var houseId; +var _params = {}; + +document.addEventListener('plusready', onPlusReady, false); + +function onPlusReady(){ + var self = plus.webview.currentWebview(); + houseId= self.houseId; + $('#input_city').val(self.city); + $('#input_phoneNumber').val(self.mobile); +} + +function sendLoanCode(){ + var mobile = $("#input_phoneNumber").val(); + if(checkPhoneNum(mobile)){ + timer.start(); + axios.post(BASE_PATH+"/rest/user/sendMobileCode", {mobile: mobile, type: APPLY_LOAN}) + .then(function (response) { + var data = response.data + if(data.code==200){ + $.toast("短信验证码发送成功,请注意查收!") + }else{ + $.toast("验证码发送失败") + timer.cancel() + } + }) + } +} + +function checkPhoneNum(phone){ + var reg = 11 && /^((13|14|15|17|18)[0-9]{1}\d{8})$/; + if(phone==''){ + $.toast("请输入手机号码"); + return false; + }else if(!reg.test(phone)){ + $.toast("手机格式不正确"); + return false; + }else{ + return true; + } +} + +//验证码倒计时 +timer = { + countdown:60, + start:function(){ + countdown = 60 + $(".sendCode").hide() + $(".waiting").empty().append(countdown + " s").show() + timer.down() + }, + down:function(){ + countdown -- + $(".waiting").empty().append(countdown + " s") + if(countdown <= 0){ + $(".sendCode").show() + $(".waiting").hide() + }else{ + setTimeout(timer.down, 1000) + } + }, + cancel:function(){ + countdown = 0 + } +} + +/* 错误提示 */ +$("#next_btn").on("click", function () { + var city = $("#input_city").val(); + var mobile = $("#input_phoneNumber").val(); + var code = $("#input_codeSms").val(); + //申请金额(万元) + var applyMoney = $("#input_price").val(); + //是否接收抵押(0否 1是 根据选择的贷款类型赋值) + var mortgage = $(".checkbox .current").attr('value'); + + if(city == ""){ + $.toast("请选择城市"); + return false; + } + if(!checkPhoneNum(mobile)){ + return false; + } + if(code == ""){ + $.toast("请输入验证码"); + return false; + } + if(applyMoney == ""){ + $.toast("请输入申请金额"); + return false; + } + if(mortgage == undefined || mortgage == ""){ + $.toast("请选择贷款类型"); + return false; + } + //如果贷款类型是房抵押 + if(mortgage == "1"){ + if(houseId == undefined || houseId == ""){ + $.toast("房抵贷类型获取houseId失败"); + return false; + } + } + if(mortgage == "1"){ + _params = {type: 1, city: city, applyMoney: applyMoney, mortgage: mortgage, hid: houseId, mobile: mobile, smsCode: code}; + }else{ + _params = {type: 1, city: city, applyMoney: applyMoney, mortgage: mortgage, mobile: mobile, smsCode: code}; + } + axios.post(BASE_PATH + "/rest/loan/apply", _params).then(function (response) { + var status = response.data.status; + if(status){ + //页面跳转 + //$.toast(response.data.data); + //直接定位到贷款success页面, 调用back()就只用返回一次 + window.location.href = "../../views/loan/loanSuccess.html"; + }else{ + $.toast(response.data.message); + } + }).catch(function (error) { + console.log(error); + }); + + +}); \ No newline at end of file diff --git a/fangija-zsyf/js/user/myHouse.js b/fangija-zsyf/js/user/myHouse.js index 73d725b..914dfc1 100644 --- a/fangija-zsyf/js/user/myHouse.js +++ b/fangija-zsyf/js/user/myHouse.js @@ -126,7 +126,7 @@ function mhAddItems(itemsPerLoad, lastIndex, dataObj, xqOneMonthUpDownRangeMap, }else{ html += "其他"; } - html += "立即申请"; + html += '立即申请'; } $('#myhouse').append(html); } diff --git a/fangija-zsyf/main.html b/fangija-zsyf/main.html index 8ce27a1..1dc0688 100644 --- a/fangija-zsyf/main.html +++ b/fangija-zsyf/main.html @@ -19,7 +19,7 @@ 首页 - + 行情 @@ -48,11 +48,11 @@ localStorage.removeItem("user_token"); localStorage.removeItem("user_token_add_time"); } - document.getElementById("quotations").setAttribute("href", BASE_PATH + '/quotations/index'); + //document.getElementById("quotations").setAttribute("href", BASE_PATH + '/quotations/index'); //document.getElementById("selfInfo").setAttribute("href", BASE_PATH + '/selfInfo/index'); //mui初始化 mui.init(); - var subpages = ['yfindex.html', BASE_PATH + '/quotations/index', 'views/house/houseManageList.html', 'views/user/userInfo.html']; + var subpages = ['yfindex.html', 'views/house/houseDetail.html', 'views/house/houseManageList.html', 'views/user/userInfo.html']; var subpage_style = { top: '0', bottom: '50px', diff --git a/fangija-zsyf/views/component/cityChooseComponent.js b/fangija-zsyf/views/component/cityChooseComponent.js index adf46a0..ef8b95f 100644 --- a/fangija-zsyf/views/component/cityChooseComponent.js +++ b/fangija-zsyf/views/component/cityChooseComponent.js @@ -3,6 +3,7 @@ //var cityChooseOption = {markFocus:0,clickFocus:0} Vue.component('city_choose',{ + props:['city1'], template: '
您的反馈很重要,是我们努力的动力