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

This commit is contained in:
2018-04-18 15:04:20 +08:00
10 changed files with 130 additions and 66 deletions
+1 -2
View File
@@ -478,13 +478,12 @@ input::-webkit-input-placeholder{
.recommend + .cardInfo{border-top:none;} .recommend + .cardInfo{border-top:none;}
.cardInfo01{color:#333;} .cardInfo01{color:#333;}
.cardInfo01 > img{width:100%;height:180px;} .cardInfo01 > img{width:100%;}
.cardInfo01 span{font-size:0.6rem;color:#666;} .cardInfo01 span{font-size:0.6rem;color:#666;}
.cardInfo01 .card-header{padding:0;font-size:0.85rem;} .cardInfo01 .card-header{padding:0;font-size:0.85rem;}
.cardInfo01 .card-content-inner{padding:0;} .cardInfo01 .card-content-inner{padding:0;}
.cardInfo01 .card-footer{padding:0;} .cardInfo01 .card-footer{padding:0;}
.cardInfo01a > img{height:142px;}
.cardInfo01a .card-content-inner .tag{display:block;margin-bottom:0.5rem;} .cardInfo01a .card-content-inner .tag{display:block;margin-bottom:0.5rem;}
.cardInfo01a .card-content-inner .tag small{margin-left:0;margin-right:0.2rem;} .cardInfo01a .card-content-inner .tag small{margin-left:0;margin-right:0.2rem;}
.cardInfo01a .card-footer span{font-size:0.7rem;color:#999;text-align:left;width:50%;} .cardInfo01a .card-footer span{font-size:0.7rem;color:#999;text-align:left;width:50%;}
+1 -9
View File
@@ -11,7 +11,6 @@ axios.interceptors.request.use(function (config) {
return Promise.reject(error); return Promise.reject(error);
}); });
var showTimeOutTime = 0;
// 添加响应拦截器 // 添加响应拦截器
axios.interceptors.response.use(function (response) { axios.interceptors.response.use(function (response) {
try { try {
@@ -22,14 +21,7 @@ axios.interceptors.response.use(function (response) {
return response; return response;
}, function (error) { }, function (error) {
try { try {
if (error.toString().indexOf('timeout') > -1) { if(error=="Error: Network Error" || error.toString().indexOf('timeout') > -1){
var curTime = new Date();
if (curTime - showTimeOutTime > 5000) {
plus.nativeUI.alert("请求超时");
showTimeOutTime = new Date();
}
plus.nativeUI.closeWaiting();
}else if(error=="Error: Network Error"){
if(plus.webview.getWebviewById('error.html')==null){ if(plus.webview.getWebviewById('error.html')==null){
clicked('error.html',true,false,{},{},function(){ clicked('error.html',true,false,{},{},function(){
window.location.reload(); window.location.reload();
+6 -6
View File
@@ -128,12 +128,12 @@ function mhAddItems(itemsPerLoad, lastIndex, dataObj, xqOneMonthUpDownRangeMap,
}else{ }else{
html += "<a class='add alert-text-title'><i class='icon icon-houseLevel'></i>其它</a>"; html += "<a class='add alert-text-title'><i class='icon icon-houseLevel'></i>其它</a>";
} }
html += '<a class="button theme add add01 add01a" href="#" onclick="gotoLoanApply(\''+result.id+'\', \''+result.city+'\')">立即申请</a></li>'; //控制贷款按钮是否可以显示,便于ios版本审核
if(localStorage.getItem("showLoanMenu")!=null && localStorage.getItem("showLoanMenu")=="true"){
html += '<a class="button theme add add01 add01a" href="#" onclick="gotoLoanApply(\''+result.id+'\', \''+result.city+'\')">立即申请</a></li>';
}else{
html += '</li>';
}
} }
$('#myhouse').append(html); $('#myhouse').append(html);
} }
/* 说明-房产等级 */
$(document).on('click','.alert-text-title', function () {
$.alert('房产等级是房屋在城市中的综合评级,由高至低分别为 豪宅、公寓、平房、草屋、山洞共5个级别。', '房产等级');
});
+7 -3
View File
@@ -1,6 +1,5 @@
<!DOCTYPE html> <!DOCTYPE html>
<html> <html>
<head> <head>
<meta charset="utf-8"> <meta charset="utf-8">
<title>Hello MUI</title> <title>Hello MUI</title>
@@ -104,7 +103,6 @@
} }
}); });
} }
// 加载菜单信息,控制是否显示贷款菜单 // 加载菜单信息,控制是否显示贷款菜单
$.ajax({ $.ajax({
type: "GET", type: "GET",
@@ -113,8 +111,14 @@
async : false, async : false,
success: function(data) { success: function(data) {
if(data.status){ if(data.status){
localStorage.setItem("showLoanMenu", data.data.showLoanMenu) //存入localStorage Boolean类型变成String
localStorage.setItem("showLoanMenu", data.data.showLoanMenu);
}else{
localStorage.setItem("showLoanMenu", false);
} }
},
error: function(err) {
localStorage.setItem("showLoanMenu", false);
} }
}) })
@@ -276,9 +276,12 @@ $.config = {router: false}
// evaluate_msg.msg=h.evaluateMsg // evaluate_msg.msg=h.evaluateMsg
if(typeof(h.imgId)!="undefined"&&h.imgId!=null&&$.trim(h.imgId)!=""){ if(typeof(h.imgId)!="undefined"&&h.imgId!=null&&$.trim(h.imgId)!=""){
$("#img").attr("src",BASE_PATH+"/img/"+h.imgId); $("#img").attr("src",BASE_PATH+"/img/"+h.imgId);
$("#img").click(function(){ //控制贷款按钮是否可以显示,便于ios版本审核
clicked('/views/loan/loanInfo.html',true,false,{},{houseId: hid, city: h.city, mobile: ""},function(){}) if(localStorage.getItem("showLoanMenu")!=null && localStorage.getItem("showLoanMenu")=="true"){
}) $("#img").click(function(){
clicked('/views/loan/loanInfo.html',true,false,{},{houseId: hid, city: h.city, mobile: ""},function(){})
})
}
} }
loadingChart(h.city,h.region,h.name,2) loadingChart(h.city,h.region,h.name,2)
//按照时间范围加载数据 //按照时间范围加载数据
+7 -2
View File
@@ -102,7 +102,7 @@
<i class="icon icon-evaluation03"></i> <i class="icon icon-evaluation03"></i>
<span>我要置换</span> <span>我要置换</span>
</div>--> </div>-->
<div onclick="gotoLoanApply()"> <div onclick="gotoLoanApply()" id="gotoLoanApply" style="display: none;">
<i class="icon icon-personal03"></i> <i class="icon icon-personal03"></i>
<span>我要贷款</span> <span>我要贷款</span>
</div> </div>
@@ -333,7 +333,12 @@ var oriName;
function onPlusReady(){ function onPlusReady(){
var self = plus.webview.currentWebview(); var self = plus.webview.currentWebview();
houseId = self.houseId; //type为1时是我的房产 houseId = self.houseId; //type为1时是我的房产
//houseId="106777351102136320"; //控制贷款按钮是否可以显示,便于ios版本审核
if(localStorage.getItem("showLoanMenu")!=null && localStorage.getItem("showLoanMenu")=="true"){
$('#gotoLoanApply').show();
}else{
$('#gotoLoanApply').hide();
}
init(); init();
} }
var baseInfo = new Vue({ var baseInfo = new Vue({
+13 -7
View File
@@ -115,7 +115,7 @@ $.config = {router: false}
<script type="text/javascript" src="../../js/shara/sharaMine.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/log/log_stat.js" ></script>
<script> <script>
//初始化init //初始化init(init方法必须调用,屏蔽后,无线下拉刷新无效果)
$.init(); $.init();
//定义对象 //定义对象
@@ -282,11 +282,6 @@ function gotoLoanApply(houseId, city){
clicked('/views/loan/loanInfo.html',true,false,{},{houseId: houseId, city: city, mobile: ""},function(){}) clicked('/views/loan/loanInfo.html',true,false,{},{houseId: houseId, city: city, mobile: ""},function(){})
} }
//界面加载
$(document).ready(function () {
checkIsLogin();
});
/* 分页构造数据 */ /* 分页构造数据 */
function addItems(itemsPerLoad, lastIndex, dataObj, xqOneMonthUpDownRangeMap, xqPotentialIndexMap, houseInfoTotalMap) { function addItems(itemsPerLoad, lastIndex, dataObj, xqOneMonthUpDownRangeMap, xqPotentialIndexMap, houseInfoTotalMap) {
var html = ''; var html = '';
@@ -371,7 +366,12 @@ function addItems(itemsPerLoad, lastIndex, dataObj, xqOneMonthUpDownRangeMap, xq
}else{ }else{
html += "<a class='add alert-text-title'><i class='icon icon-houseLevel'></i>其它</a>"; html += "<a class='add alert-text-title'><i class='icon icon-houseLevel'></i>其它</a>";
} }
html += '<a class="button theme add add01 add01a" href="#" onclick="gotoLoanApply(\''+result.id+'\', \''+result.city+'\')">立即申请</a></li>'; //控制贷款按钮是否可以显示,便于ios版本审核
if(localStorage.getItem("showLoanMenu")!=null && localStorage.getItem("showLoanMenu")=="true"){
html += '<a class="button theme add add01 add01a" href="#" onclick="gotoLoanApply(\''+result.id+'\', \''+result.city+'\')">立即申请</a></li>';
}else{
html += '</li>';
}
} }
$('.infinite-scroll-bottom .list-container').append(html); $('.infinite-scroll-bottom .list-container').append(html);
} }
@@ -381,6 +381,12 @@ $(document).on('click','.alert-text-title', function () {
$.alert('房产等级是房屋在城市中的综合评级,由高至低分别为 豪宅、公寓、平房、草屋、山洞共5个级别。', '房产等级'); $.alert('房产等级是房屋在城市中的综合评级,由高至低分别为 豪宅、公寓、平房、草屋、山洞共5个级别。', '房产等级');
}); });
document.addEventListener('plusready', onPlusReady, false);
function onPlusReady(){
checkIsLogin();
}
</script> </script>
</body> </body>
+11 -1
View File
@@ -164,6 +164,7 @@ function addManagement(id, houseStatus, liveStatus){
console.log(error); console.log(error);
}); });
} }
//查询房产评估列表AJAX请求 //查询房产评估列表AJAX请求
function selectEvaluateList(){ function selectEvaluateList(){
//先清空列表 //先清空列表
@@ -268,10 +269,13 @@ function constructHtmlContent(results, xqOneMonthUpDownRangeMap, cityAvgPriceMap
return htmlContent; return htmlContent;
} }
//立即评估
function openaddWindow(){ function openaddWindow(){
clicked('/views/house/add.html',true,false,{},{type:1},function(){ clicked('/views/house/add.html',true,false,{},{type:1},function(){
}) })
} }
//评估报告详情
function openReportWindow(id){ function openReportWindow(id){
clicked('/views/evaluate/evaluateReport.html',true,false,{},{hid:id}) clicked('/views/evaluate/evaluateReport.html',true,false,{},{hid:id})
} }
@@ -286,7 +290,13 @@ function checkIsLogin(){
selectEvaluateList(); selectEvaluateList();
} }
} }
checkIsLogin()
document.addEventListener('plusready', onPlusReady, false);
function onPlusReady(){
checkIsLogin();
}
</script> </script>
</body> </body>
+6 -4
View File
@@ -251,7 +251,7 @@ $(document).on('click','.alert-text-title', function () {
$.alert('房产等级是房屋在城市中的综合评级,由高至低分别为 豪宅、公寓、平房、草屋、山洞共5个级别。', '房产等级'); $.alert('房产等级是房屋在城市中的综合评级,由高至低分别为 豪宅、公寓、平房、草屋、山洞共5个级别。', '房产等级');
}); });
//初始化init //初始化init(init方法必须调用,屏蔽后,无线下拉刷新无效果)
$.init(); $.init();
//定义个人手机号,贷款页面需要传参数 //定义个人手机号,贷款页面需要传参数
@@ -416,9 +416,11 @@ function openSettingPage() {
clicked('../setting/setting.html',true,false,{},{},function(){}) clicked('../setting/setting.html',true,false,{},{},function(){})
} }
$(document).ready(function () { document.addEventListener('plusready', onPlusReady, false);
checkIsLogin();
}); function onPlusReady(){
checkIsLogin();
}
</script> </script>
+70 -27
View File
@@ -1538,7 +1538,8 @@ function initNews(page){
axios.get("/rest/news/list", { axios.get("/rest/news/list", {
params: { params: {
city: $("#input_city").text(), city: $("#input_city").text(),
page:page page:page,
deviceId:plus.device.uuid
} }
}) })
.then(function (response) { .then(function (response) {
@@ -1591,44 +1592,85 @@ $("#region").click(function(e){
})*/ })*/
$("body").delegate(".vote01 .icon-light-grey", "click", function () { $("body").delegate(".vote01 .icon-light-grey", "click", function () {
if($(".vote01 .icon-light-grey").attr("class").indexOf("red") > 0){
$.toast("已投票");
return;
}
var id = $(this).attr("data-val"); var id = $(this).attr("data-val");
var voteFavorCount = parseInt($("#voteFavorCount_"+id).text().split("  ")[0].replace("票",""))+1; var voteFavorCount = parseInt($("#voteFavorCount_"+id).text().split("  ")[0].replace("票",""))+1;
var voteNoFavorCount = parseInt($("#voteNoFavorCount_"+id).text().split("  ")[0].replace("票","")); var voteNoFavorCount = parseInt($("#voteNoFavorCount_"+id).text().split("  ")[0].replace("票",""));
var voteFavorCountRate = Math.round((voteFavorCount*100)/(voteFavorCount+voteNoFavorCount)); var voteFavorCountRate = Math.round((voteFavorCount*100)/(voteFavorCount+voteNoFavorCount));
var voteNoFavorCountRate = 100-voteFavorCountRate; var voteNoFavorCountRate = 100-voteFavorCountRate;
$("#voteFavorCount_"+id).text(voteFavorCount+'票 '+voteFavorCountRate+'%'); axios.get("/rest/news/vote", {
$("#voteFavorCountRate_"+id).css("width",voteFavorCountRate+'%'); params: {
$("#voteNoFavorCount_"+id).text(voteNoFavorCount+'票 '+voteNoFavorCountRate+'%'); newsId: id,
$("#voteNoFavorCountRate_"+id).css("width",voteNoFavorCountRate+'%'); type:0,
doVote(id,0); deviceId:plus.device.uuid
}
})
.then(function (response) {
if(!response.data.status){
$.toast(response.data.message);
} else {
if (!response.data.data){
$(".vote01 .icon-light-grey").addClass("icon-light-red");
$(".vote02 .icon-light-grey").removeClass("icon-light-blue");
$("#voteFavorCount_"+id).text(voteFavorCount+'票 '+voteFavorCountRate+'%');
$("#voteFavorCountRate_"+id).css("width",voteFavorCountRate+'%');
$("#voteNoFavorCount_"+id).text(voteNoFavorCount+'票 '+voteNoFavorCountRate+'%');
$("#voteNoFavorCountRate_"+id).css("width",voteNoFavorCountRate+'%');
} else {
$.toast("已投票");
}
}
})
.catch(function (error) {
console.log(error);
$.toast("投票失败,请重试");
});
}); });
$("body").delegate(".vote02 .icon-light-grey", "click", function () { $("body").delegate(".vote02 .icon-light-grey", "click", function () {
if($(".vote01 .icon-light-grey").attr("class").indexOf("blue") > 0){
$.toast("已投票");
return;
}
var id = $(this).attr("data-val"); var id = $(this).attr("data-val");
var voteFavorCount = parseInt($("#voteFavorCount_"+id).text().split("  ")[0].replace("票","")); var voteFavorCount = parseInt($("#voteFavorCount_"+id).text().split("  ")[0].replace("票",""));
var voteNoFavorCount = parseInt($("#voteNoFavorCount_"+id).text().split("  ")[0].replace("票",""))+1; var voteNoFavorCount = parseInt($("#voteNoFavorCount_"+id).text().split("  ")[0].replace("票",""))+1;
var voteFavorCountRate = Math.round((voteFavorCount*100)/(voteFavorCount+voteNoFavorCount)); var voteFavorCountRate = Math.round((voteFavorCount*100)/(voteFavorCount+voteNoFavorCount));
var voteNoFavorCountRate = 100-voteFavorCountRate; var voteNoFavorCountRate = 100-voteFavorCountRate;
$("#voteFavorCount_"+id).text(voteFavorCount+'票 '+voteFavorCountRate+'%');
$("#voteFavorCountRate_"+id).css("width",voteFavorCountRate+'%');
$("#voteNoFavorCount_"+id).text(voteNoFavorCount+'票 '+voteNoFavorCountRate+'%');
$("#voteNoFavorCountRate_"+id).css("width",voteNoFavorCountRate+'%');
doVote(id,1);
});
function doVote(id,flag){
axios.get("/rest/news/vote", { axios.get("/rest/news/vote", {
params: { params: {
newsId: id, newsId: id,
type:flag type:1,
deviceId:plus.device.uuid
} }
}) })
.then(function (response) { .then(function (response) {
if(!response.data.status){
$.toast(response.data.message);
} else {
if (!response.data.data){
$("#voteFavorCount_"+id).text(voteFavorCount+'票 '+voteFavorCountRate+'%');
$("#voteFavorCountRate_"+id).css("width",voteFavorCountRate+'%');
$("#voteNoFavorCount_"+id).text(voteNoFavorCount+'票 '+voteNoFavorCountRate+'%');
$("#voteNoFavorCountRate_"+id).css("width",voteNoFavorCountRate+'%');
$(".vote01 .icon-light-grey").removeClass("icon-light-red");
$(".vote02 .icon-light-grey").addClass("icon-light-blue");
} else {
$.toast("已投票");
}
}
}) })
.catch(function (error) { .catch(function (error) {
console.log(error); console.log(error);
$.toast("投票失败,请重试");
}); });
}
});
function changeRegion(){ function changeRegion(){
axios.get("/rest/index/home", { axios.get("/rest/index/home", {
@@ -1863,11 +1905,20 @@ function addItems(number, lastIndex) {
voteNoFavorCountRate = 100-voteFavorCountRate; voteNoFavorCountRate = 100-voteFavorCountRate;
} }
var colorClass = "icon-light-grey";
var colorClass2 = "icon-light-grey";
if (dataObj[i].vote) {
if (dataObj[i].voteType == 0) {
colorClass = "icon-light-grey icon-light-red";
} else {
colorClass2 = "icon-light-grey icon-light-blue";
}
}
html += '<div class="card cardInfo cardInfo03"><div class="card-header">'+dataObj[i].title+ html += '<div class="card cardInfo cardInfo03"><div class="card-header">'+dataObj[i].title+
'</div><div class="card-content"><div class="card-content-inner row"><div class="vote01 col-50">'+ '</div><div class="card-content"><div class="card-content-inner row"><div class="vote01 col-50">'+
'<i class="icon icon-light-grey" data-val="'+dataObj[i].id+'"></i><span>'+dataObj[i].voteFavorText+'</span>'+ '<i class="icon '+colorClass+'" data-val="'+dataObj[i].id+'"></i><span>'+dataObj[i].voteFavorText+'</span>'+
'<font style="width:'+voteFavorCountRate+'%;" id="voteFavorCountRate_'+dataObj[i].id+'"></font><label id="voteFavorCount_'+dataObj[i].id+'">'+voteFavorCount+'票&nbsp;&nbsp;'+voteFavorCountRate+'%</label></div>'+ '<font style="width:'+voteFavorCountRate+'%;" id="voteFavorCountRate_'+dataObj[i].id+'"></font><label id="voteFavorCount_'+dataObj[i].id+'">'+voteFavorCount+'票&nbsp;&nbsp;'+voteFavorCountRate+'%</label></div>'+
'<div class="vote02 col-50"><i class="icon icon-light-grey" data-val="'+dataObj[i].id+'"></i><span>'+dataObj[i].voteNoFavorText+'</span>'+ '<div class="vote02 col-50"><i class="icon '+colorClass2+'" data-val="'+dataObj[i].id+'"></i><span>'+dataObj[i].voteNoFavorText+'</span>'+
'<font style="width:'+voteNoFavorCountRate+'%;" id="voteNoFavorCountRate'+dataObj[i].id+'"></font><label id="voteNoFavorCount_'+dataObj[i].id+'">'+voteNoFavorCount+'票&nbsp;&nbsp;'+voteNoFavorCountRate+'%</label></div><em>V.S</em></div></div></div>'; '<font style="width:'+voteNoFavorCountRate+'%;" id="voteNoFavorCountRate'+dataObj[i].id+'"></font><label id="voteNoFavorCount_'+dataObj[i].id+'">'+voteNoFavorCount+'票&nbsp;&nbsp;'+voteNoFavorCountRate+'%</label></div><em>V.S</em></div></div></div>';
} }
} }
@@ -2668,15 +2719,7 @@ function openDistWindow(city, region, name){
} }
});*/ });*/
/* 投票 */
$("body").delegate(".vote01 .icon-light-grey", "click", function () {
$(".vote01 .icon-light-grey").addClass("icon-light-red");
$(".vote02 .icon-light-grey").removeClass("icon-light-blue");
});
$("body").delegate(".vote02 .icon-light-grey", "click", function () {
$(".vote01 .icon-light-grey").removeClass("icon-light-red");
$(".vote02 .icon-light-grey").addClass("icon-light-blue");
});
$("body").delegate("#hotList ul li", "click", function () { $("body").delegate("#hotList ul li", "click", function () {
var select_city = $(this).find("a").attr("data-city"); var select_city = $(this).find("a").attr("data-city");