|
|
@ -1,6 +1,6 @@ |
|
|
|
<template> |
|
|
|
<template> |
|
|
|
<view class="coupon"> |
|
|
|
<view class="coupon"> |
|
|
|
<!-- <view class="rule" @click="openPage()">规则</view> --> |
|
|
|
<view class="rule" @click="openPage()">规则</view> |
|
|
|
<view class="coupon-hd"> |
|
|
|
<view class="coupon-hd"> |
|
|
|
<image src="https://www.royaum.com.cn/static/news/coupon-bg.jpg"></image> |
|
|
|
<image src="https://www.royaum.com.cn/static/news/coupon-bg.jpg"></image> |
|
|
|
</view> |
|
|
|
</view> |
|
|
@ -10,15 +10,17 @@ |
|
|
|
</view> |
|
|
|
</view> |
|
|
|
<view class="coupon-bd"> |
|
|
|
<view class="coupon-bd"> |
|
|
|
<view class="item" v-for="(item,index) in couponList" :key="index"> |
|
|
|
<view class="item" v-for="(item,index) in couponList" :key="index"> |
|
|
|
<view class="a" v-if="item.coupon_type==10">¥<text>{{item.reduce_price}}</text></view> |
|
|
|
<view class="a" v-if="item.coupon_type==10">¥<text>{{ item.reduce_price?Number(item.reduce_price):''}}</text></view> |
|
|
|
<view class="a" v-if="item.coupon_type==20"><text>{{item.discount}}</text>折</view> |
|
|
|
<view class="a" v-if="item.coupon_type==20"><text>{{item.discount}}</text>折</view> |
|
|
|
<view class="b">满{{item.min_price}}元使用</view> |
|
|
|
<view class="b">满{{item.min_price? Number(item.min_price):''}}元使用</view> |
|
|
|
<view class="c"> |
|
|
|
<view class="c"> |
|
|
|
<text v-if="item.apply_range==10">适用于全场商品</text> |
|
|
|
<text v-if="item.apply_range==10">适用于全场商品</text> |
|
|
|
<text v-if="item.apply_range==20">适用于部分商品</text> |
|
|
|
<text v-if="item.apply_range==20">适用于部分商品</text> |
|
|
|
</view> |
|
|
|
</view> |
|
|
|
<view class="d" @click="receive(item)">点击领取</view> |
|
|
|
<view class="d" @click="toUse(item)" v-if="item.state.value==0">去使用</view> |
|
|
|
<image :src="$picUrl+'/static/news/icon-coupon-01.png'"></image> |
|
|
|
<view class="d" @click="receive(item)" v-else>点击领取</view> |
|
|
|
|
|
|
|
<image :src="$picUrl+'/static/news/icon-coupon-01.png?t=2'"></image> |
|
|
|
|
|
|
|
<view class="f" v-if="item.start_time&&item.end_time">有效期:{{item.start_time}}-{{item.end_time}}</view> |
|
|
|
</view> |
|
|
|
</view> |
|
|
|
</view> |
|
|
|
</view> |
|
|
|
<view class="nolist" v-if="couponList.length==0"> |
|
|
|
<view class="nolist" v-if="couponList.length==0"> |
|
|
@ -50,10 +52,6 @@ |
|
|
|
if (index == 0) { |
|
|
|
if (index == 0) { |
|
|
|
CouponApi.list() |
|
|
|
CouponApi.list() |
|
|
|
.then(res => { |
|
|
|
.then(res => { |
|
|
|
res.data.list.forEach(item => { |
|
|
|
|
|
|
|
item.min_price = Number(item.min_price); |
|
|
|
|
|
|
|
item.reduce_price = Number(item.reduce_price); |
|
|
|
|
|
|
|
}); |
|
|
|
|
|
|
|
that.couponList = res.data.list |
|
|
|
that.couponList = res.data.list |
|
|
|
}) |
|
|
|
}) |
|
|
|
.finally(() => that.isLoading = false) |
|
|
|
.finally(() => that.isLoading = false) |
|
|
@ -67,14 +65,10 @@ |
|
|
|
|
|
|
|
|
|
|
|
}, |
|
|
|
}, |
|
|
|
openPage() { |
|
|
|
openPage() { |
|
|
|
uni.navigateTo({ |
|
|
|
this.$toast('暂无优惠券规则') |
|
|
|
url: '/pages/activity/presaleRule?type=6' |
|
|
|
// uni.navigateTo({ |
|
|
|
}) |
|
|
|
// url: '/pages/activity/presaleRule?type=7' |
|
|
|
}, |
|
|
|
// }) |
|
|
|
openPage() { |
|
|
|
|
|
|
|
uni.navigateTo({ |
|
|
|
|
|
|
|
url: "/pages/news/coupon/list" |
|
|
|
|
|
|
|
}) |
|
|
|
|
|
|
|
}, |
|
|
|
}, |
|
|
|
tabItem(index) { |
|
|
|
tabItem(index) { |
|
|
|
this.tabIndex = index; |
|
|
|
this.tabIndex = index; |
|
|
@ -87,9 +81,17 @@ |
|
|
|
}) |
|
|
|
}) |
|
|
|
.then(res => { |
|
|
|
.then(res => { |
|
|
|
that.$toast(res.message) |
|
|
|
that.$toast(res.message) |
|
|
|
|
|
|
|
this.getCoupon() |
|
|
|
}) |
|
|
|
}) |
|
|
|
.finally(() => that.isLoading = false) |
|
|
|
.finally(() => that.isLoading = false) |
|
|
|
}, |
|
|
|
}, |
|
|
|
|
|
|
|
// 去使用 |
|
|
|
|
|
|
|
toUse(){ |
|
|
|
|
|
|
|
// 调到商品列表 |
|
|
|
|
|
|
|
uni.switchTab({ |
|
|
|
|
|
|
|
url: "/pages/index/index" |
|
|
|
|
|
|
|
}) |
|
|
|
|
|
|
|
}, |
|
|
|
goMyCoupon() { |
|
|
|
goMyCoupon() { |
|
|
|
uni.navigateTo({ |
|
|
|
uni.navigateTo({ |
|
|
|
url: "/pages/news/coupon/list" |
|
|
|
url: "/pages/news/coupon/list" |
|
|
@ -178,7 +180,7 @@ |
|
|
|
|
|
|
|
|
|
|
|
.item { |
|
|
|
.item { |
|
|
|
width: 662rpx; |
|
|
|
width: 662rpx; |
|
|
|
height: 366rpx; |
|
|
|
height: 240rpx; |
|
|
|
position: relative; |
|
|
|
position: relative; |
|
|
|
margin-top: 20rpx; |
|
|
|
margin-top: 20rpx; |
|
|
|
overflow: hidden; |
|
|
|
overflow: hidden; |
|
|
@ -192,14 +194,14 @@ |
|
|
|
width: 100%; |
|
|
|
width: 100%; |
|
|
|
position: absolute; |
|
|
|
position: absolute; |
|
|
|
left: 60rpx; |
|
|
|
left: 60rpx; |
|
|
|
top: 70rpx; |
|
|
|
top: 20rpx; |
|
|
|
z-index: 2; |
|
|
|
z-index: 2; |
|
|
|
font-size: 36rpx; |
|
|
|
font-size: 30rpx; |
|
|
|
font-weight: 500; |
|
|
|
font-weight: 500; |
|
|
|
color: #FE6900; |
|
|
|
color: #FE6900; |
|
|
|
|
|
|
|
|
|
|
|
text { |
|
|
|
text { |
|
|
|
font-size: 68rpx; |
|
|
|
font-size: 60rpx; |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
@ -207,7 +209,7 @@ |
|
|
|
width: 100%; |
|
|
|
width: 100%; |
|
|
|
position: absolute; |
|
|
|
position: absolute; |
|
|
|
left: 60rpx; |
|
|
|
left: 60rpx; |
|
|
|
top: 160rpx; |
|
|
|
top: 100rpx; |
|
|
|
z-index: 2; |
|
|
|
z-index: 2; |
|
|
|
font-size: 32rpx; |
|
|
|
font-size: 32rpx; |
|
|
|
font-weight: 500; |
|
|
|
font-weight: 500; |
|
|
@ -218,7 +220,7 @@ |
|
|
|
width: 100%; |
|
|
|
width: 100%; |
|
|
|
position: absolute; |
|
|
|
position: absolute; |
|
|
|
left: 60rpx; |
|
|
|
left: 60rpx; |
|
|
|
bottom: 20rpx; |
|
|
|
bottom: 22rpx; |
|
|
|
z-index: 2; |
|
|
|
z-index: 2; |
|
|
|
font-size: 28rpx; |
|
|
|
font-size: 28rpx; |
|
|
|
font-weight: 500; |
|
|
|
font-weight: 500; |
|
|
@ -232,13 +234,28 @@ |
|
|
|
border-radius: 68rpx; |
|
|
|
border-radius: 68rpx; |
|
|
|
position: absolute; |
|
|
|
position: absolute; |
|
|
|
right: 28rpx; |
|
|
|
right: 28rpx; |
|
|
|
top: 40rpx; |
|
|
|
top: 35rpx; |
|
|
|
z-index: 2; |
|
|
|
z-index: 2; |
|
|
|
font-size: 28rpx; |
|
|
|
font-size: 28rpx; |
|
|
|
font-weight: 500; |
|
|
|
font-weight: 500; |
|
|
|
color: #FFFFFF; |
|
|
|
color: #FFFFFF; |
|
|
|
text-align: center; |
|
|
|
text-align: center; |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
.f{ |
|
|
|
|
|
|
|
height: 40rpx; |
|
|
|
|
|
|
|
font-family: PingFang SC, PingFang SC; |
|
|
|
|
|
|
|
font-weight: 400; |
|
|
|
|
|
|
|
font-size: 24rpx; |
|
|
|
|
|
|
|
color: #AFAFAF; |
|
|
|
|
|
|
|
line-height: 40rpx; |
|
|
|
|
|
|
|
text-align: left; |
|
|
|
|
|
|
|
font-style: normal; |
|
|
|
|
|
|
|
text-transform: none; |
|
|
|
|
|
|
|
position: absolute; |
|
|
|
|
|
|
|
right: 28rpx; |
|
|
|
|
|
|
|
bottom: 85rpx; |
|
|
|
|
|
|
|
z-index: 2; |
|
|
|
|
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|