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

This commit is contained in:
gongjin
2018-04-17 14:55:12 +08:00
6 changed files with 35 additions and 12 deletions
File diff suppressed because one or more lines are too long
+6 -3
View File
@@ -1,6 +1,6 @@
axios.defaults.baseURL = BASE_PATH;
axios.defaults.headers.post['Content-Type'] = 'application/json';
axios.defaults.timeout = 10000;
axios.defaults.timeout = 15000;
// 添加请求拦截器
axios.interceptors.request.use(function (config) {
@@ -15,14 +15,17 @@ axios.interceptors.request.use(function (config) {
axios.interceptors.response.use(function (response) {
return response;
}, function (error) {
if(error=="Error: Network Error"){
if (error.toString().indexOf('timeout') > -1) {
plus.nativeUI.alert("请求超时");
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.nativeUI.closeWaiting();
plus.webview.getWebviewById("error.html").show();
}
}
+22 -3
View File
@@ -1267,7 +1267,23 @@ function onPlusReady(){
$("#input_city").val("上海");
$(".nowCity").text("上海");
}
getRequestId();
}
// 生成请求ID,防止重复提交
var requestId = "";
function getRequestId() {
axios.get("/rest/index/id")
.then(function (response) {
if(response.data.status){
requestId = response.data.data;
}
})
.catch(function (error) {
console.log(error);
});
}
/* 弹出城市选择页面 */
$(document).on("click",".open-about01", function () {
$.popup(".popup-about01");
@@ -1828,7 +1844,7 @@ function checkIsLogin(){
function addEvaluation(){
var data={};
if(type==0){
data={cityDisplay: $("#input_city").val(),
data={id:requestId,cityDisplay: $("#input_city").val(),
region:$("input[name=region]").val(),
district:$("#input_address").val(),
address:$("input[name=address]").val(),
@@ -1844,7 +1860,7 @@ function addEvaluation(){
lastRentDate:$("#input_time03").val(),
houseStatus:0}
}else{
data={cityDisplay: $("#input_city").val(),
data={id:requestId,cityDisplay: $("#input_city").val(),
region:$("input[name=region]").val(),
district:$("#input_address").val(),
address:$("input[name=address]").val(),
@@ -1863,7 +1879,9 @@ function addEvaluation(){
var id = response.data.data.id;
plus.webview.getWebviewById('views/house/houseManageList.html').reload();
plus.webview.getWebviewById('views/user/userInfo.html').reload();
clicked('/views/evaluate/evaluateReport.html',true,false,{},{hid:id})
clicked('/views/evaluate/evaluateReport.html',true,false,{},{hid:id},function(){
getRequestId();
})
}else{
$("#evaluation_btn").removeAttr("disabled");
$.toast(response.data.message);
@@ -1874,6 +1892,7 @@ function addEvaluation(){
});
}
/* 信息输入弹窗 */
$(document).on('click','.open-modal', function () {
$.modal({
+1 -1
View File
@@ -9,7 +9,7 @@
<meta name="apple-mobile-web-app-capable" content="yes">
<meta name="apple-mobile-web-app-status-bar-style" content="black">
<link rel="stylesheet" href="http://g.alicdn.com/msui/sm/0.6.2/css/sm.css">
<link rel="stylesheet" href="../../css/sm.css">
<link rel="stylesheet" href="../../css/main.css">
<link rel="stylesheet" href="../../css/city.css">
<link rel="stylesheet" href="../../css/theme-orange.css">
+3 -3
View File
@@ -9,7 +9,7 @@
<meta name="apple-mobile-web-app-capable" content="yes">
<meta name="apple-mobile-web-app-status-bar-style" content="black">
<link rel="stylesheet" href="http://g.alicdn.com/msui/sm/0.6.2/css/sm.css">
<link rel="stylesheet" href="../../css/sm.css">
<link rel="stylesheet" href="../../css/main.css">
<link rel="stylesheet" href="../../css/theme-orange.css">
<script type="text/javascript" src="http://api.map.baidu.com/api?v=2.0&ak=0a7eM0lkIvpKGPiq1bMCfeH7"></script>
@@ -153,8 +153,8 @@
</div>
</div>
<script type="text/javascript" src="http://g.alicdn.com/sj/lib/zepto/zepto.js" charset="utf-8"></script>
<script type="text/javascript" src="http://api.map.baidu.com/library/RichMarker/1.2/src/RichMarker_min.js "></script>
<script type="text/javascript" src="../../js/zepto.js" charset="utf-8"></script>
<script type="text/javascript" src="../../js/RichMarker_min.js "></script>
<script>
/* 关闭路由,以实现不同页面之间的相互跳转(仅开发环境需要) */
+2 -2
View File
@@ -9,7 +9,7 @@
<meta name="apple-mobile-web-app-capable" content="yes">
<meta name="apple-mobile-web-app-status-bar-style" content="black">
<link rel="stylesheet" href="http://g.alicdn.com/msui/sm/0.6.2/css/sm.css">
<link rel="stylesheet" href="../../css/sm.css">
<link rel="stylesheet" href="../../css/main.css">
<link rel="stylesheet" href="../../css/city.css">
<link rel="stylesheet" href="../../css/theme-orange.css">
@@ -104,7 +104,7 @@
</div>
</div>
<script type="text/javascript" src="http://g.alicdn.com/sj/lib/zepto/zepto.js" charset="utf-8"></script>
<script type="text/javascript" src="../../js/zepto.js" charset="utf-8"></script>
<script>