bobo 3 lat temu
rodzic
commit
8326c84747

+ 14 - 0
api/activity.js

@@ -199,6 +199,20 @@ class activity extends request {
     return wx.getStorageSync('loginInfo').openId;
   }
 
+  /**
+  * 卡券详情数据
+  */
+  static getCouponDetailData(params) {
+    return this.postRequest(`${this.BASE_URL}open/coupon/get-coupon-data`, params);
+  }
+
+  static getFoodListByCoupon(params) {
+    return this.postRequest(`${this.BASE_URL}open/coupon/get-food-list-by-coupon`, params);
+  }
+
+  static getStoreListByCoupon(params) {
+    return this.postRequest(`${this.BASE_URL}open/coupon/get-store-list-by-coupon`, params);
+  }
 }
 
 export default activity

+ 13 - 1
pages/welfareMall/activityInfo/activityInfo.js

@@ -96,10 +96,22 @@ Page({
      }
      console.log(res.data.stock)
      let buttonText = res.data.isPay == 1 ? '立即抢购' : '立即领取';
+     // 构建券包传参参数
+     const couponList = []
+     if (res.data.activityCouponList && Array.isArray(res.data.activityCouponList)) {
+       res.data.activityCouponList.forEach(v => {
+          const coupon = v.coupon
+          if (coupon) {
+            coupon.num = v.num
+            couponList.push(coupon)
+          }
+       })
+     }
      this.setData({
        detail:res.data,
        statusShowText:statusShowText,
-       buttonText:buttonText
+       buttonText:buttonText,
+       couponList,
      })
   },
   /**

+ 1 - 1
pages/welfareMall/activityInfo/activityInfo.json

@@ -1,6 +1,6 @@
 {
   "usingComponents": {
-    
+    "coupon-wrap" : "../../../components/couponWrap/index"
   },
   "navigationBarBackgroundColor": "#FFFFFF",
   "navigationBarTextStyle": "black",

+ 5 - 6
pages/welfareMall/activityInfo/activityInfo.wxml

@@ -1,4 +1,4 @@
-<!-- <page-wrap id="#Page"> -->
+<page-wrap id="#Page">
   <image src="{{detail.fullCoverImg}}" mode="widthFix" class="top_img"></image>
   <view class="info_all flex-row">
     <view class="flex-row info">
@@ -40,10 +40,8 @@
     <image src="/images/welfareMall/bag_content.png" class="bottom_icon"></image>
     <view class="bottom_tilte_text">礼包内容</view>
     </view>
-    <view class="bottom_title_b" wx:if="{{detail.cashCouponNum > 0 && detail.discountCouponNum > 0}}">代金券 X {{detail.cashCouponNum}} ,折扣券 X {{detail.discountCouponNum}}</view>
-          <view class="bottom_title_b" wx:if="{{detail.cashCouponNum ==0 && detail.discountCouponNum > 0}}">折扣券 X {{detail.discountCouponNum}}</view>
-          <view class="bottom_title_b" wx:if="{{detail.cashCouponNum > 0 && detail.discountCouponNum == 0}}">代金券 X {{detail.cashCouponNum}}</view>
-          <view class="bottom_title_b" wx:if="{{detail.cashCouponNum ==0 && detail.discountCouponNum ==0}}"></view>
+
+    <coupon-wrap wx:if="{{couponList.length>0}}" coupon-list="{{couponList}}" class="coupon_wrap" />
 
     </view>
 
@@ -85,4 +83,5 @@
         </view>
       <image class="widow_del" src="/images/welfareMall/window_del.png"  bindtap="goToOrderList"></image>
     </view>
-<!-- </page-wrap>-->
+
+</page-wrap>

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

@@ -214,7 +214,11 @@ margin-top:30px;
    border-top-left-radius: 40rpx;
    border-top-right-radius: 40rpx;
    align-items: flex-end;
-   border-top:solid 1px #E8e8e8;
+   border-top:solid 1px #F08D8C;
    position: relative;
    z-index: 2
+}
+
+.coupon_wrap {
+  padding: 46rpx 0 0 0;
 }

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

@@ -1,6 +1,5 @@
 // pages/welfareMall/order/orderCompletion.js
 import WelfareMall from '../../../api/welfareMall'
-import { parseTime } from '../../../utils/util'
 import {getMobileCache, getPhoneNumber as getPhoneNumberSync} from '../../../utils/user'
 Page({
 
@@ -71,11 +70,26 @@ Page({
         console.log("订单详情数据为空");
         return
     }
+
+    // 构建券包传参参数
+    const couponList = []
+    if (data.goodsList && Array.isArray(data.goodsList)) {
+        data.goodsList.forEach(v => {
+          const coupons = v.couponList
+          if (coupons && coupons.length > 0) {
+            coupons.forEach(coupon => {
+               coupon.isSn = true
+               couponList.push(coupon)
+            })
+          }
+        })
+    }
     //对象转换
     this.data.orderDetail = data
     this.setData({
         mobileTop:getMobileCache(),
-        orderDetail: this.data.orderDetail
+        orderDetail: this.data.orderDetail,
+        couponList,
     })
   }, 
 
@@ -258,6 +272,13 @@ Page({
     return ;
   },
 
+  extendCouponWrap() {
+    this.data.isExtend = !this.data.isExtend
+    this.setData({
+      isExtend: this.data.isExtend
+    })
+  },
+
   /**
    * 生命周期函数--监听页面初次渲染完成
    */

+ 3 - 1
pages/welfareMall/order/orderCompletion.json

@@ -1,4 +1,6 @@
 {
-  "usingComponents": {},
+  "usingComponents": {
+    "coupon-wrap" : "../../../components/couponWrap/index"
+  },
   "navigationBarTitleText": "订单详情"
 }

+ 22 - 6
pages/welfareMall/order/orderCompletion.wxml

@@ -21,8 +21,14 @@
         </view>
         <view class="content-middle flex-row">
           <view class="middle-it flex-row">
-            <image class="middle-img" src="{{orderDetail.goodsList[0].fullCoverImg}}" />
-            <view class="middle-text">{{orderDetail.goodsList[0].activityName}}</view>
+            <image class="middle-img" src="{{orderDetail.goodsList[0].fullCoverImg}}" mode="aspectFill" />
+            <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" />
+                <image wx:else class="fold-btn" src="../../../images/welfareMall/up-ico.png" />
+              </view>
+            </view>
           </view>
           <view class="middle-num flex-column">
             <view class="middle-num-money">¥{{orderDetail.payPriceFormatter}}</view>
@@ -30,15 +36,21 @@
           </view>
         </view>
       </view>
-      <view class="content-payment flex-row">
-        <view class="content-payment-mode">支付方式</view>
-        <view class="content-payment-mode">微信支付</view>
-      </view>
       <view class="content-line"></view>
       <view class="content-lower flex-row" catchtap="getCompletion">
         <view class="lower-total">共{{orderDetail.goodsList.length}}件商品 合计¥{{orderDetail.payPriceFormatter}}</view>
       </view>
     </view>
+
+    <view wx:if="{{isExtend}}" class="coupon-wrap-list">
+      <coupon-wrap wx:if="{{couponList.length>0}}" 
+        coupon-list="{{couponList}}" 
+        class="coupon_wrap"
+        coupon-item-ex-class="coupon-item-style"
+        coupon-circule-ex-class="coupon-circule-style"
+        />
+    </view>
+    <view style="height: 20rpx;" wx:else></view>
     <view class="order-information flex-column">
       <view class="order-information-code flex-row">
         <view class="code-text">订单编号</view>
@@ -48,6 +60,10 @@
         <view class="date-text">交易时间</view>
         <view class="date-time">{{orderDetail.payedAt}}</view>
       </view>
+      <view class="order-information-date flex-row">
+        <view class="date-text">支付方式</view>
+        <view class="date-time">微信支付</view>
+      </view>
     </view>
     <view class="order-rt flex-row">
       <view class="order-refund flex-row" wx:if="{{orderDetail.status.value == 1}}" catchtap="toCancelOrder">

+ 40 - 8
pages/welfareMall/order/orderCompletion.wxss

@@ -44,8 +44,7 @@ page{
 
 /* 订单详情 **/
 .order-details{
-  width: 716rpx;
-  height: 433rpx;
+  width: 100vw;
   background: #FFFFFF;
   border-radius: 10rpx;
   margin-top: 16rpx;
@@ -53,7 +52,6 @@ page{
 
 .content-hm{
   width: 680rpx;
-  height: 260rpx;
 }
 .content-head{
   width: 676rpx;
@@ -90,14 +88,13 @@ page{
 .middle-text{
   width: 240rpx;
   height: 36rpx;
-  font-size: 28rpx;
+  font-size: 30rpx;
   font-weight: 500;
   color: #444444;
   margin-left: 36rpx;
   overflow: hidden;
 	white-space: nowrap;
   text-overflow: ellipsis;
-  margin-bottom: 34rpx;
 }
 
 .middle-num{
@@ -126,7 +123,6 @@ page{
 .content-lower{
   width: 676rpx;
   height: 90rpx;
-  justify-content: space-between;
 }
 
 .lower-total{
@@ -134,6 +130,8 @@ page{
   font-family: Source Han Sans CN;
   font-weight: 500;
   color: #444444;
+  text-align: right;
+  width: 100%;
 }
 
 .content-payment{
@@ -151,11 +149,10 @@ page{
 }
 
 .order-information{
-  width: 716rpx;
+  width: 100vw;
   height: 176rpx;
   background: #FFFFFF;
   border-radius: 10rpx;
-  margin-top: 20rpx;
   justify-content: center;
 }
 
@@ -253,4 +250,39 @@ page{
 .w_go_order{
   width: 150px;
   text-align: center;
+}
+
+.coupon-wrap-list {
+  background: #FFF6F5;
+  width: 100vw;
+  padding: 20rpx 30rpx;
+  box-sizing: border-box;
+}
+.coupon_wrap {
+  width: 690rpx;
+}
+.coupon-item-style {
+  background: #fff !important;
+}
+.coupon-circule-style {
+  background: #FFF6F5 !important;
+}
+
+.look-coupon-detail {
+  height: 26rpx;
+  margin-left: 36rpx;
+  margin-top: 8rpx;
+}
+.look-coupon-detail .word_text {
+  font-size: 24rpx;
+  color: #F06255;
+  text-decoration: underline;
+}
+.look-coupon-detail .fold-btn {
+  width: 26rpx;
+  height: 26rpx;
+  position: relative;
+  display: inline-block;
+  left: 20rpx;
+  top: 6rpx;
 }

+ 24 - 0
project.private.config.json

@@ -113,6 +113,30 @@
                     "pathName": "pages/signIn/activity/activity",
                     "query": "",
                     "scene": null
+                },
+                {
+                    "name": "",
+                    "pathName": "pages/welfareMall/activityInfo/activityInfo",
+                    "query": "activityId=0zVqEyWqDn",
+                    "scene": null
+                },
+                {
+                    "name": "",
+                    "pathName": "pages/welfareMall/order/orderCompletion",
+                    "query": "ordersn=640950757739862",
+                    "scene": null
+                },
+                {
+                    "name": "",
+                    "pathName": "pages/welfareMall/order/orderCompletion",
+                    "query": "ordersn=640940250652495",
+                    "scene": null
+                },
+                {
+                    "name": "",
+                    "pathName": "pages/welfareMall/order/orderCompletion",
+                    "query": "ordersn=640230958639293",
+                    "scene": null
                 }
             ]
         }