|
@@ -10,8 +10,7 @@
|
|
|
class="item mt-20 "
|
|
class="item mt-20 "
|
|
|
v-for="(item, index) in couponList"
|
|
v-for="(item, index) in couponList"
|
|
|
:class="item.collected?'inactive':''"
|
|
:class="item.collected?'inactive':''"
|
|
|
- :key="index"
|
|
|
|
|
- >
|
|
|
|
|
|
|
+ :key="index">
|
|
|
<image class="full-percent" src="/static/images/discount-bg.png"></image>
|
|
<image class="full-percent" src="/static/images/discount-bg.png"></image>
|
|
|
<view class="absolute-full flex pt-8 pb-8">
|
|
<view class="absolute-full flex pt-8 pb-8">
|
|
|
<view class="left flex-justify-center pl-48">
|
|
<view class="left flex-justify-center pl-48">
|
|
@@ -40,7 +39,7 @@
|
|
|
|
|
|
|
|
</view>
|
|
</view>
|
|
|
|
|
|
|
|
- <block >
|
|
|
|
|
|
|
+ <block>
|
|
|
<view class="fs-26 color-999 mt-8"
|
|
<view class="fs-26 color-999 mt-8"
|
|
|
@click.stop="to(`/pages-common/activity/activity?id=${item.activityId}`)">
|
|
@click.stop="to(`/pages-common/activity/activity?id=${item.activityId}`)">
|
|
|
<view class="fs-26 color-999">到期时间:{{ item.endTime }}</view>
|
|
<view class="fs-26 color-999">到期时间:{{ item.endTime }}</view>
|
|
@@ -54,11 +53,19 @@
|
|
|
</block>
|
|
</block>
|
|
|
</view>
|
|
</view>
|
|
|
<view class="item-content_right">
|
|
<view class="item-content_right">
|
|
|
- <view class="item-status ml-10" @tap.stop="handleCollectCoupon(item,index)">{{item.collected?'已领取':'领取'}}</view>
|
|
|
|
|
|
|
+ <view class="item-status ml-10" @tap.stop="handleCollectCoupon(item,index)">{{ item.collected ? '已领取' : '领取' }}</view>
|
|
|
</view>
|
|
</view>
|
|
|
</view>
|
|
</view>
|
|
|
</view>
|
|
</view>
|
|
|
</view>
|
|
</view>
|
|
|
|
|
+
|
|
|
|
|
+ <view style="width: 100%;text-align: center;display: flex;flex-direction: column;align-content: center;align-items: center;">
|
|
|
|
|
+ <image v-if="!couponList||couponList.length==0"
|
|
|
|
|
+ style="width: 240rpx;" mode="widthFix"
|
|
|
|
|
+ src="/static/images/search-empty.png"></image>
|
|
|
|
|
+
|
|
|
|
|
+ <text style="font-size: 22rpx;">暂无优惠券</text>
|
|
|
|
|
+ </view>
|
|
|
</view>
|
|
</view>
|
|
|
|
|
|
|
|
|
|
|
|
@@ -81,7 +88,7 @@ const stationId = ref(null);
|
|
|
const visible = ref(false);
|
|
const visible = ref(false);
|
|
|
|
|
|
|
|
const handleClose = () => {
|
|
const handleClose = () => {
|
|
|
- visible.value = false;
|
|
|
|
|
|
|
+ visible.value = false;
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
onPullDownRefresh(() => {
|
|
onPullDownRefresh(() => {
|
|
@@ -92,8 +99,8 @@ const changeTab = (tab: number) => {
|
|
|
mode.value = tab;
|
|
mode.value = tab;
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
-const handleCollectCoupon = (coupon: any,index:number) => {
|
|
|
|
|
- if(coupon.collected)return;
|
|
|
|
|
|
|
+const handleCollectCoupon = (coupon: any, index: number) => {
|
|
|
|
|
+ if (coupon.collected) return;
|
|
|
collectCoupon(coupon.id).then((res) => {
|
|
collectCoupon(coupon.id).then((res) => {
|
|
|
console.log(res)
|
|
console.log(res)
|
|
|
uni.showToast({
|
|
uni.showToast({
|
|
@@ -101,9 +108,9 @@ const handleCollectCoupon = (coupon: any,index:number) => {
|
|
|
icon: "success"
|
|
icon: "success"
|
|
|
});
|
|
});
|
|
|
couponList.value[index].collected = true;
|
|
couponList.value[index].collected = true;
|
|
|
- }).catch(e=>{
|
|
|
|
|
|
|
+ }).catch(e => {
|
|
|
console.error(e)
|
|
console.error(e)
|
|
|
- if(e.errMsg){
|
|
|
|
|
|
|
+ if (e.errMsg) {
|
|
|
uni.showToast({
|
|
uni.showToast({
|
|
|
title: e.errMsg,
|
|
title: e.errMsg,
|
|
|
icon: "none"
|
|
icon: "none"
|