Просмотр исходного кода

fix(订单详情)页面操作后刷新

xing.li лет назад: 3
Родитель
Сommit
850d4c8f79
1 измененных файлов с 12 добавлено и 6 удалено
  1. 12 6
      pages/welfareMall/order/orderCompletion.js

+ 12 - 6
pages/welfareMall/order/orderCompletion.js

@@ -24,13 +24,16 @@ Page({
    * 生命周期函数--监听页面加载
    */
   onLoad: function (options) {
-    var that = this;
-    that.orderSn = options.ordersn
+    // var that = this;
+    // that.orderSn = options.ordersn
+    if(!options.ordersn){
+      return;
+    }
     this.setData({
       orderSn: options.ordersn,
     })
-      this.getOrder(that.orderSn);
-      this.data.orderSn = options.ordersn;
+      this.getOrder(options.ordersn);
+      // this.data.orderSn = options.ordersn;
   },
 
   
@@ -58,10 +61,12 @@ Page({
    * 订单数据--查询
    */
   selectOrder: async function(orderSn) {
+   
     let res = await WelfareMall.getOrder({
       mobile: getMobileCache(),
       orderSn: orderSn,
     })
+    this.userOrderistView(res.data)
     await this.changeOrder(res.data.orderSn,res.data.status.value,res.data.status.showText);
   },
 
@@ -241,9 +246,10 @@ Page({
       orderSn: that.data.orderSn,
       reason: reason,
     });
-    await that.cancel();
-    // await that.onLoad(that.options);
+     that.cancel();
+
     await that.selectOrder(that.data.orderSn);
+   
     // await wx.navigateTo({
     //   url:  "../refund/refund?orderSn=" + that.data.orderSn
     // })