Merge branch 'YOUFANGAPP1.1' of 192.168.0.27:dev0/youfang-app into YOUFANGAPP1.1

This commit is contained in:
zongzhimin
2018-04-12 09:41:17 +08:00
7 changed files with 1283 additions and 12 deletions
Binary file not shown.

Before

Width:  |  Height:  |  Size: 5.8 KiB

After

Width:  |  Height:  |  Size: 9.0 KiB

+127
View File
@@ -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){
alert(response.data.data+ '===');
$.toast(response.data.data);
//直接定位到贷款success页面, 调用back()就只用返回一次
window.location.href = "../../views/loan/loanSuccess.html";
}else{
$.toast(response.data.message);
}
}).catch(function (error) {
console.log(error);
});
});
+1 -1
View File
@@ -126,7 +126,7 @@ function mhAddItems(itemsPerLoad, lastIndex, dataObj, xqOneMonthUpDownRangeMap,
}else{
html += "<a class='add alert-text-title'><i class='icon icon-houseLevel'></i>其他</a>";
}
html += "<a class='button theme add add01 add01a' href='#'>立即申请</a></li>";
html += '<a class="button theme add add01 add01a" href="#" onclick="gotoLoanApply(\''+result.id+'\', \''+result.city+'\')">立即申请</a></li>';
}
$('#myhouse').append(html);
}
+14 -11
View File
@@ -168,6 +168,7 @@ $(document).on('infinite', '.infinite-scroll-bottom', function() {
}, 1000);
});
//我的收藏查询请求
function selectHouseInfoList(){
axios.get(BASE_PATH + "/rest/index/ourHouseInfoList",
@@ -182,6 +183,18 @@ function selectHouseInfoList(){
var xqOneMonthUpDownRangeMap = resultsMap.xqOneMonthUpDownRangeMap;
var xqPotentialIndexMap = resultsMap.xqPotentialIndexMap;
var houseInfoTotalMap = resultsMap.houseInfoTotalMap;
// 上次加载的序号
lastIndex = $('.list-container li').length;
//登录状态,但没有数据
if(lastIndex == 0 && resultList.length ==0){
//控制显示
$('#page-group-nologin').show();
$('#page-group-login').hide();
}else{
//控制显示
$('#page-group-nologin').hide();
$('#page-group-login').show();
}
if(resultList != null && resultList.length == 0){
// 删除加载提示符
$('.infinite-scroll-preloader').remove();
@@ -201,16 +214,8 @@ function selectHouseInfoList(){
for(var i in resultList){
dataObj.push(resultList[i])
}
// 上次加载的序号
lastIndex = $('.cardInfo').length;
//每次加载添加多少条目
itemsPerLoad = resultList.length;
//登录状态,但没有数据
if(lastIndex == 0 && resultList.length ==0){
//控制显示
$('#page-group-nologin').hide();
$('#page-group-login').show();
}
//请求后对page进行赋值
page = resultsMap.houseInfoPageList.currentPage;
pageSize = resultsMap.houseInfoPageList.limit;
@@ -228,10 +233,8 @@ function checkIsLogin(){
$('#page-group-login').hide();
$('#page-group-nologin').show();
}else{
selectHouseInfoList();
//控制显示
/*$('#page-group-nologin').hide();
$('#page-group-login').show();*/
selectHouseInfoList();
}
}
File diff suppressed because it is too large Load Diff
+68
View File
@@ -0,0 +1,68 @@
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<title>贷款申请</title>
<meta name="viewport" content="initial-scale=1, maximum-scale=1">
<link rel="shortcut icon" href="/favicon.ico">
<meta name="apple-mobile-web-app-capable" content="yes">
<meta name="apple-mobile-web-app-status-bar-style" content="black">
<link rel="stylesheet" href="../../css/sm.css">
<link rel="stylesheet" href="../../css/main.css">
<link rel="stylesheet" href="../../css/theme-orange.css">
<style>
.content{background:url(../../images/bottomBg01.png) no-repeat center bottom #fff;background-size:120%;}
</style>
</head>
<body>
<div class="page-group">
<div class="page page-current">
<header class="bar bar-nav barBorder">
<button class="button button-link button-nav pull-left" onclick="back(),plus.nativeUI.closeWaiting();">
<span class="icon icon-left"></span>
</button>
<h1 class="title">贷款申请</h1>
</header>
<div class="content">
<div class="resultBox">
<img src="../../images/loan-img02.png">
<p style="font-size:1rem;margin-bottom:2rem;">提交成功</p>
<span>我们会在1个工作日内联系您<br>请注意接听来电</span>
</div>
<div class="content-block">
<p><a href="#" class="button button-big button-fill theme" id="return_btn" onclick="back();">返回</a></p>
</div>
</div>
</div>
</div>
<script type="text/javascript" src="../../js/zepto.js" charset="utf-8"></script>
<script>
/* 关闭路由,以实现不同页面之间的相互跳转(仅开发环境需要) */
Zepto = $
$.config = {router: false}
</script>
<script type="text/javascript" src="../../js/beacon_release.js" charset="utf-8"></script>
<script type="text/javascript" src="../../js/vue.js"></script>
<script type="text/javascript" src="../../js/light7-2.js" charset="utf-8"></script>
<script type="text/javascript" src="../../js/cn.js" charset="utf-8"></script>
<script type="text/javascript" src="../../js/mui.min.js" charset="utf-8"></script>
<script type="text/javascript" src="../../config.js"></script>
<script type='text/javascript' src='../../js/common.js' charset='utf-8'></script>
<script type="text/javascript" src="../../js/axios.min.js"></script>
<script type="text/javascript" src="../../js/axiosPlugin.js"></script>
<script type="text/javascript" src="../../js/shara/sharaMine.js" ></script>
<script type="text/javascript" src="../../js/log/log_stat.js" ></script>
<script type="text/javascript" src="../../js/loan/loanInfo.js" ></script>
</body>
</html>
+10
View File
@@ -257,6 +257,9 @@ $(".cardInfo01,.cardInfo02").on("click", function(){
//初始化init
$.init();
//定义个人手机号,贷款页面需要传参数
var _mobile;
var tab = new Vue({
el:"#tab",
data:{
@@ -298,6 +301,11 @@ function gotoUpdatePass(){
clicked('/views/user/updatePass.html',true,false,{},{},function(){})
}
//调整房产申请贷款
function gotoLoanApply(houseId, city){
clicked('/views/loan/loanInfo.html',true,false,{},{houseId: houseId, city: city, mobile: _mobile},function(){})
}
//注册'infinite'事件处理函数
$(document).on('infinite', '.infinite-scroll',function() {
if($("#tabList1").hasClass("active")){
@@ -382,6 +390,8 @@ function selectUserInfo(){
}).then(function (response) {
var result = response.data.data;
var mobile = result.mobile;
//加载个人信息时候为该变量赋值
_mobile = result.mobile;
$('#user_mobile').html(mobile.substring(0,3)+'****'+mobile.substring(7)+'<br><span class="tag"><!--<small>土豪</small>--></span>');
if(result.headImg != null && result.headImg.length > 0){
$('#user_headImg').attr('src', result.headImg);