瀏覽代碼

Merge remote-tracking branch 'origin/jeffery/feat/order_info_get_status'

xing.li 3 年之前
父節點
當前提交
6c0ef21761

+ 8 - 0
api/welfareMall.js

@@ -120,6 +120,14 @@ class WelfareMall extends request {
     return this.postRequest(`${this.BASE_URL}open/welfare-mall/activity/detail`, params);
   }
 
+  static getPayStatus(orderSn) {
+    let params={
+      orderSn:orderSn
+    }
+    return this.postRequest(`${this.BASE_URL}open/call/getPayStatus`, params);
+  }
+
+
 
        /**
    * 创建订单

+ 21 - 7
pages/welfareMall/activityInfo/activityInfo.js

@@ -20,6 +20,7 @@ Page({
      hideWindowValue:false,
      preventDup:true,
      config: {},
+     orderSn:""
   },
 
   /**
@@ -229,22 +230,35 @@ Page({
           //支付成功,跳转领取成功页面
           _self.setData({
             hideWindowValue:true,
-            preventDup:true
+            preventDup:true,
+            orderSn:_self.data.orderInfo.orderSn
           })
          
         },
         fail: function (res) {
           _self.setData({
-            preventDup:true
+            preventDup:true,
+            orderSn:_self.data.orderInfo.orderSn
           })
-          _self.goToOrderList()
+          _self.goToOrderCancelInfo()
         }
       })
   },
-  goToOrderList(){
-       wx.redirectTo({
-            url: '/pages/welfareMall/historical/historical'
-        })
+
+  goToOrderCancelInfo(){
+    wx.redirectTo({
+      url: '/pages/welfareMall/order/orderCompletion?ordersn='+this.data.orderSn
+    })
+  },
+  //type 1  是未支付带过去的    2 是已支付带过去的
+   async goToOrderInfo(){
+   
+    let res = await WelfareMall.getPayStatus(this.data.orderSn);
+     console.log(res);
+    wx.redirectTo({
+      url: '/pages/welfareMall/order/orderCompletion?ordersn='+this.data.orderSn
+    })
+     
   },
 
 hideWindow(){

+ 2 - 2
pages/welfareMall/activityInfo/activityInfo.wxml

@@ -4,7 +4,7 @@
     <view class="flex-row info">
       <view class="info_left flex-column">
         <view class="info_name over-ellipsis">{{detail.name}}</view>
-
+        <view class="round" wx:if="{{detail.round}}">轮次:{{detail.round}}</view>
         <!-- <view class="info_coupon_num">3张代金券、3张折扣券</view> -->
         <view class="info_coupon_num" wx:if="{{detail.cashCouponNum > 0 && detail.discountCouponNum > 0}}">含{{detail.cashCouponNum}}张代金券、{{detail.discountCouponNum}}张折扣券</view>
           <view class="info_coupon_num" wx:if="{{detail.cashCouponNum ==0 && detail.discountCouponNum > 0}}">含{{detail.discountCouponNum}}张折扣券</view>
@@ -78,7 +78,7 @@
         <view class="w_name">{{detail.name}}</view>
         <view class="w_text">已发送至您的卡包</view>
         <view class="w_border"></view>
-        <view class="w_go_order" bindtap="goToOrderList">去看看</view>
+        <view class="w_go_order" bindtap="goToOrderInfo">去看看</view>
 
         </view>
       <image class="widow_del" src="/images/welfareMall/window_del.png"  bindtap="goToOrderList"></image>

+ 5 - 0
pages/welfareMall/activityInfo/activityInfo.wxss

@@ -48,6 +48,11 @@ Page {
   font-weight: 500;
   color: #A0A0A0;
 }
+.round{
+  font-size: 12px;
+  font-weight: 500;
+  color: #A0A0A0;
+}
 .right_text{
   font-size: 12px;
   font-weight: 400;

+ 2 - 1
pages/welfareMall/order/orderCompletion.js

@@ -162,6 +162,7 @@ Page({
         success: function (res) {
           //支付成功
           console.log(res);
+          WelfareMall.getPayStatus(that.data.orderSn);
           that.selectOrder(that.data.orderSn);
           that.data.repeat = false;
         },
@@ -261,7 +262,7 @@ Page({
     //获取上一个页面的页面栈
     var lastPage = page[page.length-2];
     console.log(lastPage.data)
-    let oldOrderList = lastPage.data.orderList;
+    let oldOrderList = lastPage.data.orderList?lastPage.data.orderList:[];
     for(var i = 0;i<oldOrderList.length;i++){
        if(orderSn == oldOrderList[i].orderSn){
         oldOrderList[i].status.value = status

+ 1 - 0
pages/welfareMall/order/orderCompletion.wxml

@@ -23,6 +23,7 @@
           <view class="middle-it flex-row">
             <image class="middle-img" src="{{orderDetail.goodsList[0].fullCoverImg}}" mode="aspectFill" />
             <view>
+              <view class="round" wx:if="{{orderDetail.goodsList[0].round}}">轮次:{{orderDetail.goodsList[0].round}}</view>
               <view class="middle-text">{{orderDetail.goodsList[0].activityName}}</view>
               <view class="look-coupon-detail" catchtap="extendCouponWrap"><text class="word_text">查看券包详情</text>
                 <image wx:if="{{!isExtend}}" class="fold-btn" src="../../../images/welfareMall/down-ico.png" />

+ 6 - 0
pages/welfareMall/order/orderCompletion.wxss

@@ -285,4 +285,10 @@ page{
   display: inline-block;
   left: 20rpx;
   top: 6rpx;
+}
+.round{
+  font-size: 12px;
+  font-weight: 500;
+  color: #A0A0A0;
+  margin-left: 36rpx;
 }