|
|
@@ -17,6 +17,12 @@ Page({
|
|
|
});
|
|
|
this.getOrderDetail();
|
|
|
},
|
|
|
+ onPullDownRefresh() {
|
|
|
+ wx.showNavigationBarLoading() //在标题栏中显示加载
|
|
|
+ this.getOrderDetail();
|
|
|
+ wx.hideNavigationBarLoading() //完成停止加载
|
|
|
+ wx.stopPullDownRefresh() //停止下拉刷新
|
|
|
+ },
|
|
|
getOrderExpress: function() {
|
|
|
let that = this;
|
|
|
util.request(api.ExpressQuery, {
|
|
|
@@ -28,7 +34,6 @@ Page({
|
|
|
expressInfo: res.data
|
|
|
});
|
|
|
|
|
|
- console.log(that.data.expressInfo);
|
|
|
}
|
|
|
});
|
|
|
},
|
|
|
@@ -51,42 +56,42 @@ Page({
|
|
|
handleOption: res.data.orderInfo.handleOption
|
|
|
});
|
|
|
|
|
|
- // 请求物流信息,仅当订单状态为发货时才请求
|
|
|
- if (that.data.handleOption.confirm) {
|
|
|
- that.getOrderExpress();
|
|
|
- }
|
|
|
- }
|
|
|
- });
|
|
|
- },
|
|
|
- // “去付款”按钮点击效果
|
|
|
- payOrder: function () {
|
|
|
- let that = this;
|
|
|
- util.request(api.OrderPrepay, {
|
|
|
- orderId: that.data.orderId
|
|
|
- }, 'POST').then(function (res) {
|
|
|
- if (res.errno === 0) {
|
|
|
- const payParam = res.data;
|
|
|
- console.log("支付过程开始")
|
|
|
- wx.requestPayment({
|
|
|
- 'timeStamp': payParam.timeStamp,
|
|
|
- 'nonceStr': payParam.nonceStr,
|
|
|
- 'package': payParam.packageValue,
|
|
|
- 'signType': payParam.signType,
|
|
|
- 'paySign': payParam.paySign,
|
|
|
- 'success': function (res) {
|
|
|
- console.log("支付过程成功")
|
|
|
- util.redirect('/pages/ucenter/order/order');
|
|
|
- },
|
|
|
- 'fail': function (res) {
|
|
|
- console.log("支付过程失败")
|
|
|
- util.showErrorToast('支付失败');
|
|
|
- },
|
|
|
- 'complete': function (res) {
|
|
|
- console.log("支付过程结束")
|
|
|
- }
|
|
|
- });
|
|
|
- }
|
|
|
+ // 请求物流信息,仅当订单状态为发货时才请求
|
|
|
+ if (res.data.orderInfo.handleOption.confirm) {
|
|
|
+ that.getOrderExpress();
|
|
|
+ }
|
|
|
+ }
|
|
|
+ });
|
|
|
+ },
|
|
|
+ // “去付款”按钮点击效果
|
|
|
+ payOrder: function() {
|
|
|
+ let that = this;
|
|
|
+ util.request(api.OrderPrepay, {
|
|
|
+ orderId: that.data.orderId
|
|
|
+ }, 'POST').then(function(res) {
|
|
|
+ if (res.errno === 0) {
|
|
|
+ const payParam = res.data;
|
|
|
+ console.log("支付过程开始");
|
|
|
+ wx.requestPayment({
|
|
|
+ 'timeStamp': payParam.timeStamp,
|
|
|
+ 'nonceStr': payParam.nonceStr,
|
|
|
+ 'package': payParam.packageValue,
|
|
|
+ 'signType': payParam.signType,
|
|
|
+ 'paySign': payParam.paySign,
|
|
|
+ 'success': function(res) {
|
|
|
+ console.log("支付过程成功");
|
|
|
+ util.redirect('/pages/ucenter/order/order');
|
|
|
+ },
|
|
|
+ 'fail': function(res) {
|
|
|
+ console.log("支付过程失败");
|
|
|
+ util.showErrorToast('支付失败');
|
|
|
+ },
|
|
|
+ 'complete': function(res) {
|
|
|
+ console.log("支付过程结束")
|
|
|
+ }
|
|
|
});
|
|
|
+ }
|
|
|
+ });
|
|
|
|
|
|
},
|
|
|
// “取消订单”点击效果
|