|  | @@ -12,26 +12,29 @@ Page({ | 
														
													
														
															
																|  |  | order: null, |  |  | order: null, | 
														
													
														
															
																|  |  | orderId: null, |  |  | orderId: null, | 
														
													
														
															
																|  |  | //存储计时器 |  |  | //存储计时器 | 
														
													
														
															
																|  |  | setInter: "", |  |  |  | 
														
													
														
															
																|  |  | mystatus: '' |  |  |  | 
														
													
														
															
																|  |  |  |  |  | setInter: null, | 
														
													
														
															
																|  |  |  |  |  | mystatus: null | 
														
													
														
															
																|  |  | }, |  |  | }, | 
														
													
														
															
																|  |  | 
 |  |  | 
 | 
														
													
														
															
																|  |  | 
 |  |  | 
 | 
														
													
														
															
																|  |  | powerDrawer: function (e) { |  |  | powerDrawer: function (e) { | 
														
													
														
															
																|  |  | let that = this; |  |  | let that = this; | 
														
													
														
															
																|  |  | // couponOrderStatus |  |  |  | 
														
													
														
															
																|  |  | // 0 未使用 |  |  |  | 
														
													
														
															
																|  |  | // 1 已使用 |  |  |  | 
														
													
														
															
																|  |  | // 2 已过期 |  |  |  | 
														
													
														
															
																|  |  | // 3 已经退款 |  |  |  | 
														
													
														
															
																|  |  |  |  |  | /** | 
														
													
														
															
																|  |  |  |  |  | * couponOrderStatus | 
														
													
														
															
																|  |  |  |  |  | *  0 未使用 | 
														
													
														
															
																|  |  |  |  |  | 1 已使用 | 
														
													
														
															
																|  |  |  |  |  | 2 已过期 | 
														
													
														
															
																|  |  |  |  |  | 3 已经退款 | 
														
													
														
															
																|  |  |  |  |  | */ | 
														
													
														
															
																|  |  |  |  |  | 
 | 
														
													
														
															
																|  |  | console.log(e); |  |  | console.log(e); | 
														
													
														
															
																|  |  | if (that.data.mystatus == "" || that.data.mystatus == undefined) { |  |  | if (that.data.mystatus == "" || that.data.mystatus == undefined) { | 
														
													
														
															
																|  |  | wx.navigateTo({ |  |  | wx.navigateTo({ | 
														
													
														
															
																|  |  | url: `/pages/orderquanma/index?quancode=${ |  |  | url: `/pages/orderquanma/index?quancode=${ | 
														
													
														
															
																|  |  | e.currentTarget.dataset.quancode |  |  | e.currentTarget.dataset.quancode | 
														
													
														
															
																|  |  | }&title=${e.currentTarget.dataset.title}&subtitle=${ |  |  |  | 
														
													
														
															
																|  |  |  |  |  | }&title=${e.currentTarget.dataset.title}&subtitle=${ | 
														
													
														
															
																|  |  | e.currentTarget.dataset.subtitle |  |  | e.currentTarget.dataset.subtitle | 
														
													
														
															
																|  |  | }&remark=${e.currentTarget.dataset.remark}&couponorderstatus=${ |  |  |  | 
														
													
														
															
																|  |  |  |  |  | }&remark=${e.currentTarget.dataset.remark}&couponorderstatus=${ | 
														
													
														
															
																|  |  | e.currentTarget.dataset.couponorderstatus |  |  | e.currentTarget.dataset.couponorderstatus | 
														
													
														
															
																|  |  | }&sight=${that.data.sight}` |  |  | }&sight=${that.data.sight}` | 
														
													
														
															
																|  |  | }); |  |  | }); | 
														
													
												
													
														
															
																|  | @@ -40,11 +43,11 @@ Page({ | 
														
													
														
															
																|  |  | wx.navigateTo({ |  |  | wx.navigateTo({ | 
														
													
														
															
																|  |  | url: `/pages/orderquanma/index?quancode=${ |  |  | url: `/pages/orderquanma/index?quancode=${ | 
														
													
														
															
																|  |  | e.currentTarget.dataset.quancode |  |  | e.currentTarget.dataset.quancode | 
														
													
														
															
																|  |  | }&title=${e.currentTarget.dataset.title}&subtitle=${ |  |  |  | 
														
													
														
															
																|  |  |  |  |  | }&title=${e.currentTarget.dataset.title}&subtitle=${ | 
														
													
														
															
																|  |  | e.currentTarget.dataset.subtitle |  |  | e.currentTarget.dataset.subtitle | 
														
													
														
															
																|  |  | }&remark=${e.currentTarget.dataset.remark}&couponorderstatus=${ |  |  |  | 
														
													
														
															
																|  |  |  |  |  | }&remark=${e.currentTarget.dataset.remark}&couponorderstatus=${ | 
														
													
														
															
																|  |  | that.data.mystatus |  |  | that.data.mystatus | 
														
													
														
															
																|  |  | }&sight=${that.data.sight}` |  |  |  | 
														
													
														
															
																|  |  |  |  |  | }&sight=${that.data.sight}` | 
														
													
														
															
																|  |  | }); |  |  | }); | 
														
													
														
															
																|  |  | } |  |  | } | 
														
													
														
															
																|  |  | }, |  |  | }, | 
														
													
												
													
														
															
																|  | @@ -62,16 +65,12 @@ Page({ | 
														
													
														
															
																|  |  | setTimeout(function () { |  |  | setTimeout(function () { | 
														
													
														
															
																|  |  | wx.hideLoading(); |  |  | wx.hideLoading(); | 
														
													
														
															
																|  |  | }, 1500); |  |  | }, 1500); | 
														
													
														
															
																|  |  | // that.data.setInter = setInterval(function() { |  |  |  | 
														
													
														
															
																|  |  | 
 |  |  |  | 
														
													
														
															
																|  |  | Http.get({ |  |  | Http.get({ | 
														
													
														
															
																|  |  | url: config.api.orderDetail, |  |  | url: config.api.orderDetail, | 
														
													
														
															
																|  |  | data: { |  |  | data: { | 
														
													
														
															
																|  |  | orderId: options.orderId |  |  | orderId: options.orderId | 
														
													
														
															
																|  |  | } |  |  | } | 
														
													
														
															
																|  |  | }).then(res => { |  |  | }).then(res => { | 
														
													
														
															
																|  |  | console.log(res); |  |  |  | 
														
													
														
															
																|  |  | console.log("我是订单详情"); |  |  |  | 
														
													
														
															
																|  |  | that.setData({ |  |  | that.setData({ | 
														
													
														
															
																|  |  | order: res.data |  |  | order: res.data | 
														
													
														
															
																|  |  | }); |  |  | }); | 
														
													
												
													
														
															
																|  | @@ -83,8 +82,6 @@ Page({ | 
														
													
														
															
																|  |  | createDate: createDate |  |  | createDate: createDate | 
														
													
														
															
																|  |  | }); |  |  | }); | 
														
													
														
															
																|  |  | }); |  |  | }); | 
														
													
														
															
																|  |  | 
 |  |  |  | 
														
													
														
															
																|  |  | // }, 100); |  |  |  | 
														
													
														
															
																|  |  | }, |  |  | }, | 
														
													
														
															
																|  |  | 
 |  |  | 
 | 
														
													
														
															
																|  |  | /** |  |  | /** | 
														
													
												
													
														
															
																|  | @@ -118,6 +115,11 @@ Page({ | 
														
													
														
															
																|  |  | success: res => { |  |  | success: res => { | 
														
													
														
															
																|  |  | console.log(res); |  |  | console.log(res); | 
														
													
														
															
																|  |  | that.payOrderUpdate(that.data.orderId, payOrderId, 1); // 支付成功 |  |  | that.payOrderUpdate(that.data.orderId, payOrderId, 1); // 支付成功 | 
														
													
														
															
																|  |  |  |  |  | /** | 
														
													
														
															
																|  |  |  |  |  | * @Meo | 
														
													
														
															
																|  |  |  |  |  | * 更新订单的状态 | 
														
													
														
															
																|  |  |  |  |  | */ | 
														
													
														
															
																|  |  |  |  |  | 
 | 
														
													
														
															
																|  |  | console.log(res); |  |  | console.log(res); | 
														
													
														
															
																|  |  | if (res.errMsg == "requestPayment:ok") { |  |  | if (res.errMsg == "requestPayment:ok") { | 
														
													
														
															
																|  |  | wx.showToast({ |  |  | wx.showToast({ | 
														
													
												
													
														
															
																|  | @@ -129,7 +131,6 @@ Page({ | 
														
													
														
															
																|  |  | wx.showLoading({ |  |  | wx.showLoading({ | 
														
													
														
															
																|  |  | title: "加载中..." |  |  | title: "加载中..." | 
														
													
														
															
																|  |  | }); |  |  | }); | 
														
													
														
															
																|  |  | 
 |  |  |  | 
														
													
														
															
																|  |  | setTimeout(function () { |  |  | setTimeout(function () { | 
														
													
														
															
																|  |  | wx.hideLoading(); |  |  | wx.hideLoading(); | 
														
													
														
															
																|  |  | }, 1600); |  |  | }, 1600); | 
														
													
												
													
														
															
																|  | @@ -137,7 +138,7 @@ Page({ | 
														
													
														
															
																|  |  | wx.navigateTo({ |  |  | wx.navigateTo({ | 
														
													
														
															
																|  |  | url: `/pages/order/detail/index?orderId=${ |  |  | url: `/pages/order/detail/index?orderId=${ | 
														
													
														
															
																|  |  | that.data.orderId |  |  | that.data.orderId | 
														
													
														
															
																|  |  | }` |  |  |  | 
														
													
														
															
																|  |  |  |  |  | }` | 
														
													
														
															
																|  |  | }); |  |  | }); | 
														
													
														
															
																|  |  | }, 1600); |  |  | }, 1600); | 
														
													
														
															
																|  |  | } |  |  | } | 
														
													
												
													
														
															
																|  | @@ -145,28 +146,10 @@ Page({ | 
														
													
														
															
																|  |  | } |  |  | } | 
														
													
														
															
																|  |  | }, |  |  | }, | 
														
													
														
															
																|  |  | fail: res => { |  |  | fail: res => { | 
														
													
														
															
																|  |  | that.payOrderUpdate(that.data.orderId, payOrderId, 2); |  |  |  | 
														
													
														
															
																|  |  |  |  |  | that.payOrderUpdate(that.data.orderId, payOrderId, 2); | 
														
													
														
															
																|  |  | console.log(res); |  |  | console.log(res); | 
														
													
														
															
																|  |  | // wx.showToast({ |  |  |  | 
														
													
														
															
																|  |  | //   title: "支付失败", |  |  |  | 
														
													
														
															
																|  |  | //   image: "./../../../assets/img/fail.png", |  |  |  | 
														
													
														
															
																|  |  | //   duration: 2000, |  |  |  | 
														
													
														
															
																|  |  | //   mask: false |  |  |  | 
														
													
														
															
																|  |  | // }); |  |  |  | 
														
													
														
															
																|  |  | return; |  |  | return; | 
														
													
														
															
																|  |  | }, |  |  | }, | 
														
													
														
															
																|  |  | // complete: res => { |  |  |  | 
														
													
														
															
																|  |  | //   console.log(res); |  |  |  | 
														
													
														
															
																|  |  | //   if (res.errMsg == "requestPayment:ok") {} else { |  |  |  | 
														
													
														
															
																|  |  | //     wx.showToast({ |  |  |  | 
														
													
														
															
																|  |  | //       title: "支付失败", |  |  |  | 
														
													
														
															
																|  |  | //       image: "./../../../assets/img/fail.png", |  |  |  | 
														
													
														
															
																|  |  | //       duration: 2000, |  |  |  | 
														
													
														
															
																|  |  | //       mask: false |  |  |  | 
														
													
														
															
																|  |  | //     }); |  |  |  | 
														
													
														
															
																|  |  | //   } |  |  |  | 
														
													
														
															
																|  |  | //   return; |  |  |  | 
														
													
														
															
																|  |  | // } |  |  |  | 
														
													
														
															
																|  |  | }); |  |  | }); | 
														
													
														
															
																|  |  | /// End payment  -------- |  |  | /// End payment  -------- | 
														
													
														
															
																|  |  | }); |  |  | }); | 
														
													
												
													
														
															
																|  | @@ -186,20 +169,16 @@ Page({ | 
														
													
														
															
																|  |  | payOrderUpdate: (orderId, payOrderId, status, reason) => { |  |  | payOrderUpdate: (orderId, payOrderId, status, reason) => { | 
														
													
														
															
																|  |  | // 支付成功 |  |  | // 支付成功 | 
														
													
														
															
																|  |  | Http.post({ |  |  | Http.post({ | 
														
													
														
															
																|  |  | url: config.api.payOrderUpdate, |  |  |  | 
														
													
														
															
																|  |  | data: { |  |  |  | 
														
													
														
															
																|  |  | payOrderId: payOrderId, |  |  |  | 
														
													
														
															
																|  |  | orderId: orderId, |  |  |  | 
														
													
														
															
																|  |  | status: status, |  |  |  | 
														
													
														
															
																|  |  | reason: reason |  |  |  | 
														
													
														
															
																|  |  | } |  |  |  | 
														
													
														
															
																|  |  | }) |  |  |  | 
														
													
														
															
																|  |  |  |  |  | url: config.api.payOrderUpdate, | 
														
													
														
															
																|  |  |  |  |  | data: { | 
														
													
														
															
																|  |  |  |  |  | payOrderId: payOrderId, | 
														
													
														
															
																|  |  |  |  |  | orderId: orderId, | 
														
													
														
															
																|  |  |  |  |  | status: status, | 
														
													
														
															
																|  |  |  |  |  | reason: reason | 
														
													
														
															
																|  |  |  |  |  | } | 
														
													
														
															
																|  |  |  |  |  | }) | 
														
													
														
															
																|  |  | .then(res => { |  |  | .then(res => { | 
														
													
														
															
																|  |  | console.log("payOrderUpdate then", res); |  |  | console.log("payOrderUpdate then", res); | 
														
													
														
															
																|  |  | // wx.showToast({ |  |  |  | 
														
													
														
															
																|  |  | //   title: "购买成功", |  |  |  | 
														
													
														
															
																|  |  | //   duration: 2500 |  |  |  | 
														
													
														
															
																|  |  | // }); |  |  |  | 
														
													
														
															
																|  |  | }) |  |  | }) | 
														
													
														
															
																|  |  | .catch(err => { |  |  | .catch(err => { | 
														
													
														
															
																|  |  | console.log("payOrderUpdate catch", err); |  |  | console.log("payOrderUpdate catch", err); | 
														
													
												
													
														
															
																|  | @@ -217,26 +196,6 @@ Page({ | 
														
													
														
															
																|  |  | sight: res.value |  |  | sight: res.value | 
														
													
														
															
																|  |  | }) |  |  | }) | 
														
													
														
															
																|  |  | } |  |  | } | 
														
													
														
															
																|  |  | }); |  |  |  | 
														
													
														
															
																|  |  | }, |  |  |  | 
														
													
														
															
																|  |  | 
 |  |  |  | 
														
													
														
															
																|  |  | /** |  |  |  | 
														
													
														
															
																|  |  | * 生命周期函数--监听页面隐藏 |  |  |  | 
														
													
														
															
																|  |  | */ |  |  |  | 
														
													
														
															
																|  |  | onHide: function () {}, |  |  |  | 
														
													
														
															
																|  |  | 
 |  |  |  | 
														
													
														
															
																|  |  | /** |  |  |  | 
														
													
														
															
																|  |  | * 页面相关事件处理函数--监听用户下拉动作 |  |  |  | 
														
													
														
															
																|  |  | */ |  |  |  | 
														
													
														
															
																|  |  | onPullDownRefresh: function () {}, |  |  |  | 
														
													
														
															
																|  |  | 
 |  |  |  | 
														
													
														
															
																|  |  | /** |  |  |  | 
														
													
														
															
																|  |  | * 页面上拉触底事件的处理函数 |  |  |  | 
														
													
														
															
																|  |  | */ |  |  |  | 
														
													
														
															
																|  |  | onReachBottom: function () {}, |  |  |  | 
														
													
														
															
																|  |  | 
 |  |  |  | 
														
													
														
															
																|  |  | /** |  |  |  | 
														
													
														
															
																|  |  | * 用户点击右上角分享 |  |  |  | 
														
													
														
															
																|  |  | */ |  |  |  | 
														
													
														
															
																|  |  | onShareAppMessage: function () {} |  |  |  | 
														
													
														
															
																|  |  |  |  |  | }) | 
														
													
														
															
																|  |  |  |  |  | } | 
														
													
														
															
																|  |  | }); |  |  | }); |