| @@ -65,7 +65,7 @@ | |||
| "navigationBarTextStyle": "white" | |||
| }, | |||
| "networkTimeout": { | |||
| "request": 1000, | |||
| "request": 100, | |||
| "downloadFile": 10000 | |||
| }, | |||
| "debug": false | |||
| @@ -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 | |||
| }); | |||
| @@ -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"; | |||
| @@ -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; | |||
| @@ -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) { | |||
| @@ -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; | |||
| @@ -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, | |||
| @@ -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) { | |||
| @@ -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 | |||
| }); | |||
| }) | |||
| } | |||
| }); | |||
| @@ -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 | |||
| }); | |||
| }) | |||
| } | |||
| }); | |||
| @@ -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); | |||
| @@ -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 | |||
| }); | |||
| }); | |||
| } | |||
| }); | |||
| @@ -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"); | |||
| @@ -23,6 +23,13 @@ Page({ | |||
| that.setData({ | |||
| mallImgUrl: res.data.mallImgUrl | |||
| }); | |||
| }).catch(err => { | |||
| wx.showToast({ | |||
| title: err.errMsg, | |||
| icon: 'none', | |||
| duration: 2000, | |||
| mask: false | |||
| }); | |||
| }) | |||
| } | |||
| }); | |||
| @@ -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); | |||
| @@ -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 | |||
| }); | |||
| }) | |||
| }, | |||
| /** | |||
| @@ -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"); | |||
| @@ -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 | |||
| @@ -68,7 +68,15 @@ Page({ | |||
| that.setData({ | |||
| list: that.data.list | |||
| }); | |||
| }); | |||
| }) | |||
| .catch(err => { | |||
| wx.showToast({ | |||
| title: err.errMsg, | |||
| icon: 'none', | |||
| duration: 2000, | |||
| mask: false | |||
| }); | |||
| }) | |||
| } | |||
| }, | |||
| }); | |||
| @@ -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; | |||
| @@ -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); | |||
| } | |||
| }); | |||
| @@ -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 | |||
| }); | |||
| }) | |||
| }, | |||
| /** | |||
| @@ -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 | |||
| }); | |||
| }) | |||
| } | |||
| } | |||
| @@ -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({ | |||
| @@ -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(); | |||
| } | |||
| }); | |||
| @@ -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 => {} | |||