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

This commit is contained in:
2018-04-17 20:22:10 +08:00
3 changed files with 91 additions and 20 deletions
+25 -19
View File
@@ -14,26 +14,32 @@ axios.interceptors.request.use(function (config) {
var showTimeOutTime = 0;
// 添加响应拦截器
axios.interceptors.response.use(function (response) {
plus.nativeUI.closeWaiting();
try {
plus.nativeUI.closeWaiting();
}catch(e){
}
return response;
}, function (error) {
if (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){
clicked('error.html',true,false,{},{},function(){
window.location.reload();
})
}else{
$(".loadingBg").hide();
plus.nativeUI.closeWaiting();
plus.webview.getWebviewById("error.html").show();
}
}
try {
if (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){
clicked('error.html',true,false,{},{},function(){
window.location.reload();
})
}else{
$(".loadingBg").hide();
plus.nativeUI.closeWaiting();
plus.webview.getWebviewById("error.html").show();
}
}
}catch(e){}
return Promise.reject(error);
});
+20
View File
@@ -46,6 +46,14 @@
<script src="config.js"></script>
<script src="js/common.js"></script>
<script src="js/push-common.js"></script>
<script type="text/javascript" src="js/zepto.js" charset="utf-8"></script>
<script>
/* 关闭路由,以实现不同页面之间的相互跳转(仅开发环境需要) */
Zepto = $
$.config = {router: false}
</script>
<script type="text/javascript" charset="utf-8">
// 清空过期的Token
var token_add_time = localStorage.getItem("user_token_add_time");
@@ -97,6 +105,18 @@
});
}
// 加载菜单信息,控制是否显示贷款菜单
$.ajax({
type: "GET",
url:BASE_PATH+"/rest/version/info",
dataType:'json',
async : false,
success: function(data) {
if(data.status){
localStorage.setItem("showLoanMenu", data.data.showLoanMenu)
}
}
})
var self = plus.webview.currentWebview();
for (var i = 0; i < 4; i++) {
@@ -53,7 +53,52 @@ Vue.component('city_increase_ranking',{
clicked('/views/user/passLogin.html',true,false,{},{},function(){
if(localStorage.getItem("user_token") == null || localStorage.getItem("user_token") == ""){
}else{
$.confirm('您确定要关注'+city+"?", function () {
axios.get("/rest/quotations/collectCity",{params:{city:city, type:type}}).then(function(response){
var msg = response.data.message;
if(msg != "取消关注成功" && msg != "关注成功"){
$.toast(msg);
}else{
//$(event.target).parent().children().removeClass("dn");
//$(event.target).addClass("dn");
var increaseList = cityIncreaseRankingData.cityIncreaseRankingList
if(increaseList && increaseList.length>0){
for(var i in increaseList){
var dd = increaseList[i];
if(dd.city == city){
if(type == 0){
dd.follow = true;
}else{
dd.follow = false;
}
break;
}
}
}
// reloadMyFocus()
// reloadCityPotentialRanking()
// reloadCityIncreaseRanking()
plus.webview.getWebviewById('views/house/houseDetail.html').reload();
plus.webview.getWebviewById('views/house/houseManageList.html').reload();
plus.webview.getWebviewById('views/user/userInfo.html').reload();
// loadMyCollectCity()
if(type == 0){
var curDatas = cityDetaiVue.$data.citys
if(curDatas && curDatas.length>=0){
if(!IsInArray(curDatas, city)){
cityDetaiVue.$data.citys.push(city);
}
}
}
}
}).catch(function(error){
console.log(error)
})
});
}
})
}else{