chenrong 1 год назад
Родитель
Сommit
1ab455b111

+ 7 - 0
api/coupon.js

@@ -24,3 +24,10 @@ export function couponReceive(data) {
     data: data,
   })
 }
+export function buyCouponListApi(data) {
+  return request({
+    url: '/wx/coupon/buy/list',
+    method: 'get',
+    data: data,
+  })
+}

+ 73 - 9
component/paymentPopup.vue

@@ -34,8 +34,18 @@
               选择优惠券
               <uni-icons type="right" color="#FF2C43" size="20"></uni-icons>
             </view>
-            <view v-if="!selestCouponId && couponList.length == 0" class="noCoupon">暂无可用优惠券</view>
-            <view class="coupon price" v-if="selestCouponId">-¥{{ selestCoupon.discount }}</view>
+            <view
+              v-if="!selestCouponId && couponList.length == 0 && unusableList.length > 0"
+              class="noCoupon"
+              @click="showPopup3"
+            >
+              暂无可用优惠券
+              <uni-icons type="right" color="#8c8c8c" size="20"></uni-icons>
+            </view>
+            <view v-if="!selestCouponId && couponList.length == 0 && unusableList.length == 0" class="noCoupon">
+              没有优惠券
+            </view>
+            <view class="coupon price" @click="showPopup3" v-if="selestCouponId">-¥{{ selestCoupon.discount }}</view>
           </view>
         </view>
 
@@ -128,6 +138,7 @@
         </view>
       </view>
       <view class="popupList">
+        <view class="tip">可用优惠券</view>
         <view class="card" v-for="(item, index) in couponList" @click="clickSelestCoupon(item)">
           <view class="leftIcon"></view>
           <view class="left">
@@ -144,6 +155,24 @@
             </view>
           </view>
         </view>
+        <view class="tip">以下优惠券本单暂不适用</view>
+        <view class="card unusable" v-for="(item, index) in unusableList">
+          <view class="leftIcon"></view>
+          <view class="left">
+            ¥
+            <span style="font-size: 36rpx">{{ item.discount }}</span>
+          </view>
+          <view class="right">
+            <view class="row title">
+              {{ item.name }}
+            </view>
+            <view class="row endTime">{{ item.endTime }}到期</view>
+            <view class="row desc">
+              {{ item.desc }}
+              <span class="reason" v-show="item.reason">({{ item.reason }})</span>
+            </view>
+          </view>
+        </view>
       </view>
     </uni-popup>
   </view>
@@ -151,7 +180,7 @@
 
 <script>
 import { rewardType } from '@/utils/commonConfig.js'
-import { couponListApi } from '@/api/coupon.js'
+import { buyCouponListApi } from '@/api/coupon.js'
 import { drawCardSubmitApi, submittResultApi, orderPriceApi } from '@/api/drawCard.js'
 
 import Mloading from '@/component/Mloading.vue'
@@ -204,6 +233,8 @@ export default {
       info: {},
       // 优惠券
       couponList: [],
+      // 不可用优惠券
+      unusableList: [],
       // 选中的优惠券
       selestCouponId: null,
       selestCoupon: {},
@@ -230,6 +261,8 @@ export default {
       this.params.raffleNum = num
       //计算订单价格
       this.getPrice()
+      // 获取优惠券
+      this.getCoupon()
     },
     show(params, list, info) {
       console.log(info, 'info')
@@ -278,13 +311,14 @@ export default {
     // 获取优惠券
     getCoupon() {
       let params = {
-        limit: 999,
-        page: 1,
-        status: 0,
-        raffleId: this.params.raffleId,
+        orderNum: this.params.raffleNumList.length || this.params.raffleNum,
+        orderThirdId: this.params.raffleId,
+        orderType: 1,
       }
-      couponListApi(params).then(res => {
-        this.couponList = res.data.list
+      buyCouponListApi(params).then(res => {
+        console.log(res, 'res')
+        this.couponList = res.data.usableList
+        this.unusableList = res.data.unusableList
       })
     },
     // 选择优惠券
@@ -418,6 +452,7 @@ export default {
         flex-grow: 0;
         flex-shrink: 0;
       }
+
       .numBerActive {
         background: linear-gradient(180deg, #ffad3d 0%, #ff740a 100%);
         color: #fff;
@@ -593,11 +628,18 @@ export default {
   background: #f8f8f8;
   padding: 20rpx;
 
+  .tip {
+    color: #8c8c8c;
+    margin-bottom: 10px;
+    text-align: center;
+  }
+
   .card {
     background: #fff;
     border-radius: 16rpx;
     overflow: hidden;
     display: flex;
+    margin-bottom: 20rpx;
 
     .leftIcon {
       height: auto;
@@ -638,6 +680,28 @@ export default {
       }
     }
   }
+
+  .unusable {
+    .leftIcon {
+      background: #ffc1c8;
+    }
+    .left {
+      color: #ffc1c8;
+    }
+
+    .right {
+      padding: 20rpx;
+      color: #bf977f;
+
+      .endTime {
+        color: #ffc1c8;
+      }
+
+      .desc {
+        color: #b7b7b7;
+      }
+    }
+  }
 }
 </style>
 <style scoped>

+ 1 - 1
pages/drawCard_infinite/drawCard_infinite.vue

@@ -383,7 +383,7 @@ export default {
         console.log(res, '奖池预览')
         let newArray = res.data
         for (var i = 0; i < res.data.length; i++) {
-          if (res.data[i].type == 21) {
+          if (res.data[i].type == 23) {
             newArray = []
             newArray.push(res.data[i])
             res.data.splice(i, 1)

+ 28 - 22
pages/drawCard_last/drawCard_last.vue

@@ -126,33 +126,38 @@
         >
           <view
             class="absolute top-1 left-2"
-            style="width: 106rpx; height: 28rpx; font-size: 24rpx; font-weight: 600; color: #ffff00"
+            style="width: 120rpx; height: 28rpx; font-size: 24rpx; font-weight: 600; color: #e1ff13"
           >
-            {{ lockData.userId ? '锁箱中' : '' }}
+            {{ lockData.userId ? '锁箱倒计时' : '锁箱说明' }}
           </view>
           <div class="text-white fs12 mt-5 px-2 pt-1 lockBox">
-            <view class="text" v-if="!lockData.userId">本福袋连续购买10发,即开启保护机制</view>
+            <view class="text" v-if="!lockData.userId">
+              <p>本福袋连续购买10发,即开启5分钟保护机制</p>
+              <p>锁箱后,每抽一发加10秒</p>
+            </view>
             <view class="info" v-else>
               <image class="photo" :src="lockData.userAvtar" mode="aspectFill"></image>
               <view class="right">
                 <view class="row">
                   <view class="name">{{ lockData.userName }}</view>
-                  <view class="tip">目前已开启自动保护机制</view>
-                </view>
-                <view class="row">
-                  保护倒计时:
-                  <span v-if="lockHour != '00'">
-                    <span class="time">{{ lockHour }}</span>
-                    :
-                  </span>
-                  <span>
-                    <span class="time">{{ lockMin }}</span>
-                    :
-                  </span>
-                  <span>
-                    <span class="time">{{ lockSecond }}</span>
-                  </span>
+                  <view class="">
+                    <!-- 保护倒计时: -->
+                    <span v-if="lockHour != '00'">
+                      <span class="time">{{ lockHour }}</span>
+                      :
+                    </span>
+                    <span>
+                      <span class="time">{{ lockMin }}</span>
+                      :
+                    </span>
+                    <span>
+                      <span class="time">{{ lockSecond }}</span>
+                    </span>
+                  </view>
                 </view>
+                <!-- <view class="row">
+					<view class="tip">目前已开启自动保护机制</view>
+                </view> -->
               </view>
             </view>
           </div>
@@ -592,7 +597,7 @@ export default {
         console.log(res, '奖池预览')
         let newArray = res.data
         for (var i = 0; i < res.data.length; i++) {
-          if (res.data[i].type == 21) {
+          if (res.data[i].type == 22) {
             newArray = []
             newArray.push(res.data[i])
             res.data.splice(i, 1)
@@ -836,12 +841,12 @@ export default {
 
 .lockBox {
   display: flex;
-  justify-content: center;
+  // justify-content: center;
   align-items: center;
 
   .text {
     color: #fff;
-    font-weight: 600;
+    // font-weight: 600;
     font-size: 28rpx;
   }
 
@@ -854,6 +859,7 @@ export default {
       width: 9vw;
       height: 9vw;
       border-radius: 50%;
+      padding: 0 30rpx;
     }
 
     .right {
@@ -876,7 +882,7 @@ export default {
         .time {
           padding: 4rpx;
           color: #565656;
-          background: #ffff00;
+          background: #e1ff13;
           margin: 0 16rpx;
           border-radius: 10rpx;
           font-weight: 600;