|
@@ -22,7 +22,11 @@
|
|
</view>
|
|
</view>
|
|
</view>
|
|
</view>
|
|
<view class="one_4" v-if="couponList.length>0">
|
|
<view class="one_4" v-if="couponList.length>0">
|
|
- <view class="left">优惠</view>
|
|
|
|
|
|
+ <view class="left">优惠券</view>
|
|
|
|
+ <view class="right" @tap="toCoupon">
|
|
|
|
+ <text v-if="discountInfo.name">{{discountInfo.name}}</text>
|
|
|
|
+ <text class="iconfont icon-dayuhao"></text>
|
|
|
|
+ </view>
|
|
</view>
|
|
</view>
|
|
</view>
|
|
</view>
|
|
<view class="two">
|
|
<view class="two">
|
|
@@ -95,6 +99,50 @@
|
|
</view>
|
|
</view>
|
|
</view>
|
|
</view>
|
|
</uni-popup>
|
|
</uni-popup>
|
|
|
|
+ <!-- 领取优惠卷 -->
|
|
|
|
+ <uni-popup ref="coupon" background-color="#fff" type="bottom" :is-mask-click="false" @change="change">
|
|
|
|
+ <view class="popup">
|
|
|
|
+ <view class="close">
|
|
|
|
+ <text>抵用券</text>
|
|
|
|
+ <text @click="toCouponClose" class="iconfont icon-shanchu"></text>
|
|
|
|
+ </view>
|
|
|
|
+ <view class="info_1">
|
|
|
|
+ <scroll-view scroll-y="true" class="scroll-view">
|
|
|
|
+ <view class="list-scroll-view">
|
|
|
|
+ <view class="list" v-for="(item, index) in couponList" :key="index">
|
|
|
|
+ <view class="list_1">
|
|
|
|
+ <view class="left">
|
|
|
|
+ <view class="left_1">
|
|
|
|
+ ¥<text>{{item.discount_config.min}}</text>
|
|
|
|
+ </view>
|
|
|
|
+ <view class="left_2">
|
|
|
|
+ <text v-if="item.discount_config.limit=='0'">无门槛</text>
|
|
|
|
+ <text
|
|
|
|
+ v-else>满{{item.discount_config.limit}}减{{item.discount_config.min}}</text>
|
|
|
|
+ </view>
|
|
|
|
+ </view>
|
|
|
|
+ <view class="center">
|
|
|
|
+ <view class="name textOver">{{item.name}}</view>
|
|
|
|
+ <view class="content">有效日期:({{item.expire_type_label}}) {{item.expire_time}}
|
|
|
|
+ </view>
|
|
|
|
+ </view>
|
|
|
|
+ <view class="right">
|
|
|
|
+ <button class="button_1" type="primary" @tap="toUser(item)">使用</button>
|
|
|
|
+ </view>
|
|
|
|
+ </view>
|
|
|
|
+ <view class="list_2">
|
|
|
|
+ <uni-collapse>
|
|
|
|
+ <uni-collapse-item title="使用规则补充说明" :open="false">
|
|
|
|
+ <view class="content">{{item.brief}}</view>
|
|
|
|
+ </uni-collapse-item>
|
|
|
|
+ </uni-collapse>
|
|
|
|
+ </view>
|
|
|
|
+ </view>
|
|
|
|
+ </view>
|
|
|
|
+ </scroll-view>
|
|
|
|
+ </view>
|
|
|
|
+ </view>
|
|
|
|
+ </uni-popup>
|
|
</view>
|
|
</view>
|
|
</template>
|
|
</template>
|
|
|
|
|
|
@@ -114,6 +162,7 @@
|
|
}],
|
|
}],
|
|
// 优惠券
|
|
// 优惠券
|
|
couponList: [],
|
|
couponList: [],
|
|
|
|
+ discountInfo: '',
|
|
// 数量
|
|
// 数量
|
|
num: 1,
|
|
num: 1,
|
|
// 日期
|
|
// 日期
|
|
@@ -186,7 +235,7 @@
|
|
const res = uni.getStorageSync('token');
|
|
const res = uni.getStorageSync('token');
|
|
if (res) {
|
|
if (res) {
|
|
that.$set(that, `user`, res);
|
|
that.$set(that, `user`, res);
|
|
- const arr = await that.$api(`/userCoupon`, 'GET', {
|
|
|
|
|
|
+ const arr = await that.$api(`/userCoupon/specialQuery`, 'GET', {
|
|
user: res._id || res.id,
|
|
user: res._id || res.id,
|
|
is_use: "0"
|
|
is_use: "0"
|
|
})
|
|
})
|
|
@@ -280,6 +329,28 @@
|
|
that.toClose()
|
|
that.toClose()
|
|
})
|
|
})
|
|
},
|
|
},
|
|
|
|
+ // 领卷
|
|
|
|
+ toCoupon() {
|
|
|
|
+ const that = this;
|
|
|
|
+ that.$refs.coupon.open()
|
|
|
|
+ },
|
|
|
|
+ // 关闭弹框
|
|
|
|
+ toCouponClose() {
|
|
|
|
+ const that = this;
|
|
|
|
+ that.$refs.coupon.close();
|
|
|
|
+ },
|
|
|
|
+ // 去使用
|
|
|
|
+ toUser(item) {
|
|
|
|
+ const that = this;
|
|
|
|
+ if (item.type == '0') {
|
|
|
|
+ uni.showToast({
|
|
|
|
+ title: '该优惠券不符合使用类型!',
|
|
|
|
+ icon: 'none',
|
|
|
|
+ duration: 2000
|
|
|
|
+ });
|
|
|
|
+ } else that.$set(that, `discountInfo`, item);
|
|
|
|
+ that.toCouponClose();
|
|
|
|
+ },
|
|
// 关闭弹框
|
|
// 关闭弹框
|
|
toClose() {
|
|
toClose() {
|
|
const that = this;
|
|
const that = this;
|
|
@@ -311,14 +382,15 @@
|
|
date: that.date,
|
|
date: that.date,
|
|
num: that.num,
|
|
num: that.num,
|
|
identity: that.identityList,
|
|
identity: that.identityList,
|
|
- discount: '',
|
|
|
|
|
|
+ discount: that.discountInfo._id || that.discountInfo.id,
|
|
buy_time: moment().format('YYYY-MM-DD HH:mm:ss'),
|
|
buy_time: moment().format('YYYY-MM-DD HH:mm:ss'),
|
|
pay_time: '',
|
|
pay_time: '',
|
|
- pay: []
|
|
|
|
|
|
+ pay: [],
|
|
|
|
+ status: '1'
|
|
}
|
|
}
|
|
const res = await that.$api(`/order`, 'POST', data);
|
|
const res = await that.$api(`/order`, 'POST', data);
|
|
if (res.errcode == '0') {
|
|
if (res.errcode == '0') {
|
|
- uni.reLaunch({
|
|
|
|
|
|
+ uni.redirectTo({
|
|
url: `/pagesIndex/order/index?status=${'1'}`
|
|
url: `/pagesIndex/order/index?status=${'1'}`
|
|
})
|
|
})
|
|
} else {
|
|
} else {
|
|
@@ -414,6 +486,8 @@
|
|
}
|
|
}
|
|
|
|
|
|
.one_4 {
|
|
.one_4 {
|
|
|
|
+ display: flex;
|
|
|
|
+ justify-content: space-between;
|
|
font-size: var(--font18Size);
|
|
font-size: var(--font18Size);
|
|
font-weight: bold;
|
|
font-weight: bold;
|
|
padding: 2vw;
|
|
padding: 2vw;
|
|
@@ -550,6 +624,90 @@
|
|
height: 54vh;
|
|
height: 54vh;
|
|
padding: 2vw;
|
|
padding: 2vw;
|
|
|
|
|
|
|
|
+ .list {
|
|
|
|
+ background-color: var(--mainColor);
|
|
|
|
+ border: 1px solid var(--f5Color);
|
|
|
|
+ padding: 2vw;
|
|
|
|
+ margin: 2vw 2vw 0 2vw;
|
|
|
|
+ border-radius: 5px;
|
|
|
|
+
|
|
|
|
+ .list_1 {
|
|
|
|
+ display: flex;
|
|
|
|
+ justify-content: space-between;
|
|
|
|
+ align-items: center;
|
|
|
|
+
|
|
|
|
+ .left {
|
|
|
|
+ width: 20vw;
|
|
|
|
+ display: flex;
|
|
|
|
+ flex-direction: column;
|
|
|
|
+ justify-content: center;
|
|
|
|
+ align-items: center;
|
|
|
|
+ padding: 3vw;
|
|
|
|
+ color: var(--fF0Color);
|
|
|
|
+ font-size: var(--font14Size);
|
|
|
|
+
|
|
|
|
+ .left_1 {
|
|
|
|
+ text {
|
|
|
|
+ font-weight: bold;
|
|
|
|
+ font-size: 25px;
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ .left_2 {
|
|
|
|
+ font-size: var(--font12Size);
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ .center {
|
|
|
|
+ width: 40vw;
|
|
|
|
+
|
|
|
|
+ .name {
|
|
|
|
+ font-size: var(--font14Size);
|
|
|
|
+ font-weight: bold;
|
|
|
|
+ margin: 0 0 1vw 0;
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ .content {
|
|
|
|
+ color: var(--f85Color);
|
|
|
|
+ font-size: var(--font12Size);
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ .right {
|
|
|
|
+ .button {
|
|
|
|
+ font-size: 12px;
|
|
|
|
+ border-radius: 20px;
|
|
|
|
+ background: linear-gradient(to right, #FFA500, #FF0000);
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ .button_1 {
|
|
|
|
+ font-size: 12px;
|
|
|
|
+ border-radius: 20px;
|
|
|
|
+ border: 1px solid var(--fF0Color);
|
|
|
|
+ color: var(--fF0Color);
|
|
|
|
+ background: var(--mainColor);
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ .list_2 {
|
|
|
|
+ font-size: var(--font12Size);
|
|
|
|
+
|
|
|
|
+ /deep/.uni-collapse-item__title-box {
|
|
|
|
+ padding: 0 !important;
|
|
|
|
+ font-size: 12px !important;
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ /deep/.uni-collapse-item__title-text {
|
|
|
|
+ font-size: 12px !important;
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ .content {
|
|
|
|
+ padding: 2vw;
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+
|
|
button {
|
|
button {
|
|
font-size: var(--font14Size);
|
|
font-size: var(--font14Size);
|
|
background: linear-gradient(to right, #00BFFF, #007AFF);
|
|
background: linear-gradient(to right, #00BFFF, #007AFF);
|