Browse Source

网络超时设置修改

tags/2.2.9
海洋之声 6 years ago
parent
commit
ea02e5a43b
26 changed files with 379 additions and 70 deletions
  1. +1
    -1
      app.json
  2. +2
    -2
      components/gameentry/gentry.js
  3. +8
    -0
      components/questionnaire/questionnaire.js
  4. +8
    -1
      pages/bannerdetail/index.js
  5. +29
    -7
      pages/coupon/detail/index.js
  6. +25
    -1
      pages/couponorder/detail/index.js
  7. +9
    -1
      pages/couponorder/index/index.js
  8. +20
    -12
      pages/edit/edit.js
  9. +18
    -2
      pages/getphoneInfo/index.js
  10. +18
    -2
      pages/getuserinfo/index.js
  11. +18
    -2
      pages/index/coupons/index.js
  12. +19
    -8
      pages/index/index.js
  13. +9
    -1
      pages/index/rushToBuy/index.js
  14. +7
    -0
      pages/login/index.js
  15. +8
    -0
      pages/managelicenseplate/managelicenseplate.js
  16. +25
    -4
      pages/order/detail/index.js
  17. +9
    -1
      pages/order/index/index.js
  18. +18
    -2
      pages/orderquanma/index.js
  19. +9
    -1
      pages/passCar/choicecoupon/choicecoupon.js
  20. +9
    -1
      pages/passCar/couponDetail/couponDetail.js
  21. +9
    -6
      pages/passCar/couponList/couponList.js
  22. +63
    -7
      pages/passCar/passCar.js
  23. +12
    -6
      pages/phoneinput/phoneinput.js
  24. +9
    -1
      pages/rushToBuy/index.js
  25. +9
    -1
      pages/user/index.js
  26. +8
    -0
      utils/HttpBasics.js

+ 1
- 1
app.json View File

@@ -65,7 +65,7 @@
"navigationBarTextStyle": "white"
},
"networkTimeout": {
"request": 1000,
"request": 100,
"downloadFile": 10000
},
"debug": false

+ 2
- 2
components/gameentry/gentry.js View File

@@ -52,8 +52,8 @@ Component({
});
}else {
wx.showToast({
title: err.message,
image: "../../assets/img/fail.png",
title: err.errMsg,
icon: 'none',
duration: 2000,
mask: false
});


+ 8
- 0
components/questionnaire/questionnaire.js View File

@@ -60,6 +60,14 @@ Component({
this.alphaClick();
this.queueClick();
})
.catch(err => {
wx.showToast({
title: err.errMsg,
icon: 'none',
duration: 2000,
mask: false
});
})
// 子组件向父组件传值
// 传值到 coupon=>detail页面
var myEvent1 = "questions2";


+ 8
- 1
pages/bannerdetail/index.js View File

@@ -25,7 +25,14 @@ Page({
data: res.data
});
console.log(that.data.data);
});
}).catch(err => {
wx.showToast({
title: err.errMsg,
icon: 'none',
duration: 2000,
mask: false
});
})
},
gotoactdetail:function(){
let that = this;


+ 29
- 7
pages/coupon/detail/index.js View File

@@ -95,8 +95,13 @@ Page({
console.log(that.data.questionnaire);
}
})
.catch(error=>{
console.log(error)
.catch(err => {
wx.showToast({
title: err.message,
image: "../../../assets/img/fail.png",
duration: 2000,
mask: false
});
})
}
},
@@ -197,7 +202,14 @@ Page({
validDays: res.data.validDays
});
}
});
}).catch(err => {
wx.showToast({
title: err.message,
image: "../../../assets/img/fail.png",
duration: 2000,
mask: false
});
})
},
/**
* 支付订单更新
@@ -217,8 +229,13 @@ Page({
console.log("payOrderUpdate then", res);
})
.catch(err => {
console.log("payOrderUpdate catch", err);
});
wx.showToast({
title: err.message,
image: "../../../assets/img/fail.png",
duration: 2000,
mask: false
});
})
},
/**
* 发起支付
@@ -447,8 +464,13 @@ Page({
}
})
.catch(err => {
console.log("ERR", err);
});
wx.showToast({
title: err.errMsg,
icon: 'none',
duration: 2000,
mask: false
});
})
}
},
onShareAppMessage: function (options) {


+ 25
- 1
pages/couponorder/detail/index.js View File

@@ -50,6 +50,14 @@ Page({
staticGamedata: res.data
})
})
.catch(err => {
wx.showToast({
title: err.errMsg,
icon: 'none',
duration: 2000,
mask: false
});
})
},
onLoad: function(options) {
let that = this;
@@ -101,7 +109,15 @@ Page({
updateDate: util.formatTime(that.data.data.updateDate, "yyyy-MM-dd hh:mm:ss"),
createDate: util.formatTime(that.data.data.createDate, "yyyy-MM-dd hh:mm:ss")
});
});
})
.catch(err => {
wx.showToast({
title: err.errMsg,
icon: 'none',
duration: 2000,
mask: false
});
})
}
}, 2000);

@@ -127,6 +143,14 @@ Page({
util.barcode("barcode", options.quancode, 510, 100);
util.qrcode("qrcode", options.quancode, 350, 350);
})
.catch(err => {
wx.showToast({
title: err.errMsg,
icon: 'none',
duration: 2000,
mask: false
});
})
},
phone: function() {
let that = this;


+ 9
- 1
pages/couponorder/index/index.js View File

@@ -102,7 +102,15 @@ Page({
that.setData({
list: tmpArr
})
});
})
.catch(err => {
wx.showToast({
title: err.errMsg,
icon: 'none',
duration: 2000,
mask: false
});
})
} else {
that.setData({
loading: true,


+ 20
- 12
pages/edit/edit.js View File

@@ -118,19 +118,27 @@ Page({
birthdate: birthdate,
}
})
.then(res => {
console.log(res);
wx.showModal({
title: '提示',
content: '修改成功',
showCancel: false,
success: function (res) {
wx.switchTab({
url: '/pages/user/index',
})
}
})
.then(res => {
console.log(res);
wx.showModal({
title: '提示',
content: '修改成功',
showCancel: false,
success: function (res) {
wx.switchTab({
url: '/pages/user/index',
})
}
})
})
.catch(err => {
wx.showToast({
title: err.errMsg,
icon: 'none',
duration: 2000,
mask: false
});
})
}
},
radioChange: function (e) {


+ 18
- 2
pages/getphoneInfo/index.js View File

@@ -39,7 +39,15 @@ Page({
wx.setNavigationBarTitle({
title: res.data.mallName
})
});
})
.catch(err => {
wx.showToast({
title: err.message,
image: "../../assets/img/fail.png",
duration: 2000,
mask: false
});
})
},

getPhoneNumber: function (e) {
@@ -92,6 +100,14 @@ Page({
icon: "none"
});
}
);
)
.catch(err => {
wx.showToast({
title: err.errMsg,
icon: 'none',
duration: 2000,
mask: false
});
})
}
});

+ 18
- 2
pages/getuserinfo/index.js View File

@@ -24,7 +24,15 @@ Page({
wx.setNavigationBarTitle({
title: res.data.mallName
})
});
})
.catch(err => {
wx.showToast({
title: err.message,
image: "../../assets/img/fail.png",
duration: 2000,
mask: false
});
})
},

bindGetUserInfo: function(e) {
@@ -61,6 +69,14 @@ Page({
icon: "none"
});
}
);
)
.catch(err => {
wx.showToast({
title: err.errMsg,
icon: 'none',
duration: 2000,
mask: false
});
})
}
});

+ 18
- 2
pages/index/coupons/index.js View File

@@ -134,7 +134,15 @@ Component({
})

console.log(tmpArr);
});
})
.catch(err => {
wx.showToast({
title: err.message,
image: "../../../assets/img/fail.png",
duration: 2000,
mask: false
});
})
setTimeout(function () {
that.setData({
loading: false,
@@ -175,7 +183,15 @@ Component({
that.setData({
tabs: res.data.list
});
});
})
.catch(err => {
wx.showToast({
title: err.errMsg,
icon: 'none',
duration: 2000,
mask: false
});
})
};
if (app.globalData.token && app.globalData.token != null) {
app.businessListCallback(app.globalData.token);


+ 19
- 8
pages/index/index.js View File

@@ -111,13 +111,19 @@ Page({
title: weapNote.firstpage.title
})
})
.catch(err => {
console.log(err);
that.setData({
loading: false,
loadingtext: "网络异常,请检查您的网络设置"
})
.catch(err => {
console.log(err);
that.setData({
loading: false,
loadingtext: "网络异常,请检查您的网络设置"
})
wx.showToast({
title: err.errMsg,
icon: 'none',
duration: 2000,
mask: false
});
});
},
onShow:function(){
this.setData({
@@ -232,12 +238,10 @@ Page({
.catch(err => {
console.log(err);
if(err.errMsg=='request:fail timeout'){
setTimeout(function(){
that.setData({
loading:false,
loadingtext:"网络异常,请检查您的网络设置"
})
},3000)
}
if (err.code == 11004) {
// 用户昵称未授权
@@ -245,6 +249,13 @@ Page({
url: "/pages/getuserinfo/index"
});
}
// debugger
wx.showToast({
title: err.errMsg,
icon:'none',
duration: 2000,
mask: false
});
});
}
});


+ 9
- 1
pages/index/rushToBuy/index.js View File

@@ -55,7 +55,15 @@ Component({
list: res.data.list,
total:res.data.total
});
});
})
.catch(err => {
wx.showToast({
title: err.errMsg,
icon: 'none',
duration: 2000,
mask: false
});
})
};
if (app.globalData.token && app.globalData.token != null) {
console.log("couponChannelList init 1");


+ 7
- 0
pages/login/index.js View File

@@ -23,6 +23,13 @@ Page({
that.setData({
mallImgUrl: res.data.mallImgUrl
});
}).catch(err => {
wx.showToast({
title: err.errMsg,
icon: 'none',
duration: 2000,
mask: false
});
})
}
});

+ 8
- 0
pages/managelicenseplate/managelicenseplate.js View File

@@ -19,6 +19,14 @@ Page({
carList: res.data
});
})
.catch(err => {
wx.showToast({
title: err.message,
image: "../../assets/img/fail.png",
duration: 2000,
mask: false
});
})
},
unbindCarBtn: function(e) {
console.log(e);


+ 25
- 4
pages/order/detail/index.js View File

@@ -83,7 +83,15 @@ Page({
that.setData({
createDate: createDate
});
});
})
.catch(err => {
wx.showToast({
title: err.message,
image: "../../../assets/img/fail.png",
duration: 2000,
mask: false
});
})
},
gotogame: function () {
let that=this;
@@ -178,7 +186,15 @@ Page({
},
});
/// End payment --------
});
})
.catch(err => {
wx.showToast({
title: err.errMsg,
icon: 'none',
duration: 2000,
mask: false
});
})
} else {
// 免费券
that.payOrderUpdate(orderId, "0", 1) // 支付成功
@@ -207,8 +223,13 @@ Page({
console.log("payOrderUpdate then", res);
})
.catch(err => {
console.log("payOrderUpdate catch", err);
});
wx.showToast({
title: err.errMsg,
icon: 'none',
duration: 2000,
mask: false
});
})
},

/**


+ 9
- 1
pages/order/index/index.js View File

@@ -115,7 +115,15 @@ Page({
[createDate]: createDate1
});
}
});
})
.catch(err => {
wx.showToast({
title: err.errMsg,
icon: 'none',
duration: 2000,
mask: false
});
})
}
else {
console.log("加载完成allow_load设置成false");


+ 18
- 2
pages/orderquanma/index.js View File

@@ -54,7 +54,15 @@ Page({
});
}
});
})
.catch(err => {
wx.showToast({
title: err.message,
image: "../../assets/img/fail.png",
duration: 2000,
mask: false
});
})
}
}, 2000);

@@ -73,7 +81,15 @@ Page({
that.setData({
couponorderstatus: res.data.CouponOrderStatus
});
});
})
.catch(err => {
wx.showToast({
title: err.errMsg,
icon: 'none',
duration: 2000,
mask: false
});
})
}
/**
* couponorderstatus


+ 9
- 1
pages/passCar/choicecoupon/choicecoupon.js View File

@@ -68,7 +68,15 @@ Page({
that.setData({
list: that.data.list
});
});
})
.catch(err => {
wx.showToast({
title: err.errMsg,
icon: 'none',
duration: 2000,
mask: false
});
})
}
},
});

+ 9
- 1
pages/passCar/couponDetail/couponDetail.js View File

@@ -41,7 +41,15 @@ Page({
});
util.barcode("barcode", options.quancode, 510, 100);
util.qrcode("qrcode", options.quancode, 350, 350);
});
})
.catch(err => {
wx.showToast({
title: err.errMsg,
icon: 'none',
duration: 2000,
mask: false
});
})
},
phone: function () {
let that = this;


+ 9
- 6
pages/passCar/couponList/couponList.js View File

@@ -75,7 +75,6 @@ Page({
"yyyy-MM-dd hh:mm:ss"
);
});
console.log("姐姐的订单列表");
setTimeout(function () {
wx.hideLoading();
}, 1200);
@@ -93,13 +92,20 @@ Page({
that.setData({
list: that.data.list
});
});
})
.catch(err => {
wx.showToast({
title: err.errMsg,
icon: 'none',
duration: 2000,
mask: false
});
})
} else {
console.log("加载完成allow_load设置成false");
}
},
handleChange({ detail }) {
console.log(detail);
this.setData({
current: detail.key
});
@@ -117,13 +123,10 @@ Page({
},
onReachBottom: function () {
var that = this;
console.log(that.data.page);
that.data.page++;
console.log(that.data.page);
that.setData({
page: that.data.page
});
console.info("after++ " + that.data.page);
that.getList(that.data.current_scroll, that.data.page);
}
});

+ 63
- 7
pages/passCar/passCar.js View File

@@ -121,7 +121,15 @@ Page({
desc: weapNote.carpage.desc,
title: weapNote.carpage.title
})
});
})
.catch(err => {
wx.showToast({
title: err.errMsg,
icon: 'none',
duration: 2000,
mask: false
});
})
// 登录
var scene = decodeURIComponent(options.scene);
that.setData({
@@ -194,6 +202,13 @@ Page({
wx.redirectTo({
url: "/pages/getuserinfo/index"
});
}else{
wx.showToast({
title: err.errMsg,
icon: 'none',
duration: 2000,
mask: false
});
}
});
}
@@ -215,7 +230,15 @@ Page({
// 共同登录
that.userCarLogin();
}
});
})
.catch(err => {
wx.showToast({
title: err.errMsg,
icon: 'none',
duration: 2000,
mask: false
});
})
},
/**
* 获取用户信息
@@ -318,7 +341,15 @@ Page({
that.setData({
couponList: res.data.list
});
});
})
.catch(err => {
wx.showToast({
title: err.errMsg,
icon: 'none',
duration: 2000,
mask: false
});
})
},
@@ -375,6 +406,13 @@ Page({
wx.redirectTo({
url: "/pages/phoneinput/phoneinput"
});
}else{
wx.showToast({
title: err.errMsg,
icon: 'none',
duration: 2000,
mask: false
});
}
})
}
@@ -436,8 +474,13 @@ Page({
park: res.data
})
})
.catch(error=>{
console.log(error)
.catch(err => {
wx.showToast({
title: err.errMsg,
icon: 'none',
duration: 2000,
mask: false
});
})
},
@@ -452,8 +495,13 @@ Page({
.then(res => {
console.log(res);
})
.catch(error=>{
console.log(error)
.catch(err => {
wx.showToast({
title: err.errMsg,
icon: 'none',
duration: 2000,
mask: false
});
})
},
@@ -488,6 +536,14 @@ Page({
that.getStopFee(listCardNum);
}
})
.catch(err => {
wx.showToast({
title: err.errMsg,
icon: 'none',
duration: 2000,
mask: false
});
})
},
/**


+ 12
- 6
pages/phoneinput/phoneinput.js View File

@@ -53,10 +53,13 @@ Page({
})
}
})
.catch(error => {
.catch(err => {
wx.showToast({
title: error.data,
})
title: err.errMsg,
icon: 'none',
duration: 2000,
mask: false
});
})
},
//计时器
@@ -102,10 +105,13 @@ Page({
})
}
})
.catch(error => {
.catch(err => {
wx.showToast({
title: '请输入有效手机号',
})
title: err.errMsg,
icon: 'none',
duration: 2000,
mask: false
});
})
}
}

+ 9
- 1
pages/rushToBuy/index.js View File

@@ -91,7 +91,15 @@ Page({
}
}

});
})
.catch(err => {
wx.showToast({
title: err.errMsg,
icon: 'none',
duration: 2000,
mask: false
});
})
} else {
console.info("allow_load==false 已禁止加载");
that.setData({


+ 9
- 1
pages/user/index.js View File

@@ -114,7 +114,15 @@ Page({
score: res.data.score,
levelName: res.data.levelName
})
});
})
.catch(err => {
wx.showToast({
title: err.errMsg,
icon: 'none',
duration: 2000,
mask: false
});
})
// that.getrun();
}
});

+ 8
- 0
utils/HttpBasics.js View File

@@ -49,6 +49,9 @@ class HttpBasics {
},
fail: err => {
// wx.hideLoading();
if (err.errMsg == 'request:fail timeout') {
err.errMsg = '请求超时,请检查您的网络设置!'
}
reject(err);
}
});
@@ -75,7 +78,12 @@ class HttpBasics {
this.responseMap(res, resolve, reject);
},
fail: err => {
// debugger
// wx.hideLoading();
console.log(err)
if (err.errMsg=='request:fail timeout'){
err.errMsg='请求超时,请检查您的网络设置!'
}
reject(err);
},
complete: res => {}


Loading…
Cancel
Save