|
@@ -34,8 +34,18 @@
|
|
选择优惠券
|
|
选择优惠券
|
|
<uni-icons type="right" color="#FF2C43" size="20"></uni-icons>
|
|
<uni-icons type="right" color="#FF2C43" size="20"></uni-icons>
|
|
</view>
|
|
</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>
|
|
</view>
|
|
</view>
|
|
|
|
|
|
@@ -128,6 +138,7 @@
|
|
</view>
|
|
</view>
|
|
</view>
|
|
</view>
|
|
<view class="popupList">
|
|
<view class="popupList">
|
|
|
|
+ <view class="tip">可用优惠券</view>
|
|
<view class="card" v-for="(item, index) in couponList" @click="clickSelestCoupon(item)">
|
|
<view class="card" v-for="(item, index) in couponList" @click="clickSelestCoupon(item)">
|
|
<view class="leftIcon"></view>
|
|
<view class="leftIcon"></view>
|
|
<view class="left">
|
|
<view class="left">
|
|
@@ -144,6 +155,24 @@
|
|
</view>
|
|
</view>
|
|
</view>
|
|
</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>
|
|
</view>
|
|
</uni-popup>
|
|
</uni-popup>
|
|
</view>
|
|
</view>
|
|
@@ -151,7 +180,7 @@
|
|
|
|
|
|
<script>
|
|
<script>
|
|
import { rewardType } from '@/utils/commonConfig.js'
|
|
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 { drawCardSubmitApi, submittResultApi, orderPriceApi } from '@/api/drawCard.js'
|
|
|
|
|
|
import Mloading from '@/component/Mloading.vue'
|
|
import Mloading from '@/component/Mloading.vue'
|
|
@@ -204,6 +233,8 @@ export default {
|
|
info: {},
|
|
info: {},
|
|
// 优惠券
|
|
// 优惠券
|
|
couponList: [],
|
|
couponList: [],
|
|
|
|
+ // 不可用优惠券
|
|
|
|
+ unusableList: [],
|
|
// 选中的优惠券
|
|
// 选中的优惠券
|
|
selestCouponId: null,
|
|
selestCouponId: null,
|
|
selestCoupon: {},
|
|
selestCoupon: {},
|
|
@@ -230,6 +261,8 @@ export default {
|
|
this.params.raffleNum = num
|
|
this.params.raffleNum = num
|
|
//计算订单价格
|
|
//计算订单价格
|
|
this.getPrice()
|
|
this.getPrice()
|
|
|
|
+ // 获取优惠券
|
|
|
|
+ this.getCoupon()
|
|
},
|
|
},
|
|
show(params, list, info) {
|
|
show(params, list, info) {
|
|
console.log(info, 'info')
|
|
console.log(info, 'info')
|
|
@@ -278,13 +311,14 @@ export default {
|
|
// 获取优惠券
|
|
// 获取优惠券
|
|
getCoupon() {
|
|
getCoupon() {
|
|
let params = {
|
|
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-grow: 0;
|
|
flex-shrink: 0;
|
|
flex-shrink: 0;
|
|
}
|
|
}
|
|
|
|
+
|
|
.numBerActive {
|
|
.numBerActive {
|
|
background: linear-gradient(180deg, #ffad3d 0%, #ff740a 100%);
|
|
background: linear-gradient(180deg, #ffad3d 0%, #ff740a 100%);
|
|
color: #fff;
|
|
color: #fff;
|
|
@@ -593,11 +628,18 @@ export default {
|
|
background: #f8f8f8;
|
|
background: #f8f8f8;
|
|
padding: 20rpx;
|
|
padding: 20rpx;
|
|
|
|
|
|
|
|
+ .tip {
|
|
|
|
+ color: #8c8c8c;
|
|
|
|
+ margin-bottom: 10px;
|
|
|
|
+ text-align: center;
|
|
|
|
+ }
|
|
|
|
+
|
|
.card {
|
|
.card {
|
|
background: #fff;
|
|
background: #fff;
|
|
border-radius: 16rpx;
|
|
border-radius: 16rpx;
|
|
overflow: hidden;
|
|
overflow: hidden;
|
|
display: flex;
|
|
display: flex;
|
|
|
|
+ margin-bottom: 20rpx;
|
|
|
|
|
|
.leftIcon {
|
|
.leftIcon {
|
|
height: auto;
|
|
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>
|
|
<style scoped>
|
|
<style scoped>
|