2022-08-01 09:03:10 +00:00
|
|
|
|
<template>
|
2022-08-03 13:28:45 +00:00
|
|
|
|
<view>
|
|
|
|
|
<status-container titlet="我的优惠券" returnc="#FFFFFF">
|
2022-08-01 09:03:10 +00:00
|
|
|
|
<view slot="content">
|
2022-08-03 13:28:45 +00:00
|
|
|
|
<view class="posi-sticky" :style="{top:newtop+'px'}" style="margin-top: -20rpx;">
|
|
|
|
|
<swiper-tab id="tab" :ifBetween="false" :ifPadding="true" :list="tabList" v-model="current" @changeEv="clickTab" :itemColor="'#e42417'" :lineColor="'#e42417'"></swiper-tab>
|
|
|
|
|
</view>
|
|
|
|
|
<view class="pad-zy20 mar-s30">
|
|
|
|
|
<view class="bacf radius12 pad-sx20 fon24 mar-x20" v-for="(item,index) in dataList" :key="index">
|
|
|
|
|
<view class="disac">
|
2022-08-11 10:27:47 +00:00
|
|
|
|
<view class="flexs bold col-e42417 dis pad-z20" style="min-width: 180rpx;" :style="{color:current!=0?'#c0c0c0':'#e42417'}">
|
2022-08-03 13:28:45 +00:00
|
|
|
|
<view class="">¥</view>
|
2022-08-11 10:27:47 +00:00
|
|
|
|
<view class="fon66" style="margin-top: -10rpx;">{{item.amount}}</view>
|
2022-08-03 13:28:45 +00:00
|
|
|
|
</view>
|
|
|
|
|
<view class="width100 pad-zy20 posir">
|
2022-08-11 10:27:47 +00:00
|
|
|
|
<view class="disjbac">
|
|
|
|
|
<view class="line-h40">
|
|
|
|
|
<view class="">{{item.name}}</view>
|
|
|
|
|
<view class="fon20" style="color: #747474;" v-if="item.begin_at">有限期:{{item.begin_at.slice(0,10).split('-').join('.')}}-{{item.end_at.slice(0,10).split('-').join('.')}}</view>
|
2022-08-03 13:28:45 +00:00
|
|
|
|
</view>
|
2022-08-12 10:14:13 +00:00
|
|
|
|
<view @tap="goCourse" class="flexs mar-z20 radius26 colf disjcac" style="width: 124rpx;height: 52rpx;" :style="{backgroundColor:current!=0?'#c0c0c0':'#f37717'}">去使用</view>
|
2022-08-03 13:28:45 +00:00
|
|
|
|
</view>
|
2022-08-10 10:18:06 +00:00
|
|
|
|
<!-- <view class="disac fon20 pad-s20" style="color: #747474;">
|
2022-08-03 13:28:45 +00:00
|
|
|
|
<span @tap="lookDetail(index)">详细信息</span>
|
|
|
|
|
<view @tap="lookDetail(index)" class="icon icon-return fon20 mar-z10" :class="item.show?'isshow':'noshow'"></view>
|
2022-08-10 10:18:06 +00:00
|
|
|
|
</view> -->
|
2022-08-03 13:28:45 +00:00
|
|
|
|
<!-- 图标 -->
|
2022-08-11 10:27:47 +00:00
|
|
|
|
<view class="posia" v-if="current!=0" style="position: absolute;right: 120rpx;top: 0rpx;">
|
2022-08-03 13:28:45 +00:00
|
|
|
|
<image v-if="current==1" src="/static/tabbar/icon-used.png" style="width: 90rpx;height: 86rpx;" mode="" lazy-load></image>
|
|
|
|
|
<image v-if="current==2" src="/static/tabbar/icon-overduce.png" style="width: 90rpx;height: 86rpx;" mode="" lazy-load></image>
|
|
|
|
|
</view>
|
|
|
|
|
</view>
|
|
|
|
|
</view>
|
2022-08-10 10:18:06 +00:00
|
|
|
|
<!-- <view v-if="item.show" class="fon20 line-h36 pad-zy20 pad-s20" style="color: #898989;">
|
2022-08-03 13:28:45 +00:00
|
|
|
|
<view class="">时间:2022.07.11 00:00:00 - 2022.07.30 23:59:59</view>
|
|
|
|
|
<view class="">来源:秒杀抢卷所得</view>
|
|
|
|
|
<view class="">渠道:全部渠道可</view>
|
|
|
|
|
<view class="disac">编号:全部渠道可
|
|
|
|
|
<image class="mar-z10" src="/static/tabbar/icon-bh.png" mode="" style="width: 22rpx;height: 22rpx;" lazy-load></image>
|
|
|
|
|
</view>
|
2022-08-10 10:18:06 +00:00
|
|
|
|
</view> -->
|
2022-08-03 13:28:45 +00:00
|
|
|
|
</view>
|
|
|
|
|
</view>
|
2022-08-16 10:06:46 +00:00
|
|
|
|
<view class="pad-zy20" v-if="loading">
|
|
|
|
|
<pitera :textStr="`${noMore && total > dataList.length?'上滑加载更多':'到底了'}~~`" textColor="#b0aaa9" paddingStr="40rpx 0 20rpx 0"></pitera>
|
2022-08-03 13:28:45 +00:00
|
|
|
|
</view>
|
2022-08-01 09:03:10 +00:00
|
|
|
|
</view>
|
|
|
|
|
</status-container>
|
|
|
|
|
</view>
|
|
|
|
|
</template>
|
|
|
|
|
|
|
|
|
|
<script>
|
2022-08-03 13:28:45 +00:00
|
|
|
|
import swiperTab from '@/components/swiper-tab/swiper-tab.vue';
|
|
|
|
|
import pitera from '@/components/nothing/pitera.vue';
|
2022-08-01 09:03:10 +00:00
|
|
|
|
export default {
|
2022-08-03 13:28:45 +00:00
|
|
|
|
components:{
|
|
|
|
|
swiperTab,
|
|
|
|
|
pitera
|
|
|
|
|
},
|
2022-08-01 09:03:10 +00:00
|
|
|
|
data() {
|
|
|
|
|
return {
|
2022-08-03 13:28:45 +00:00
|
|
|
|
newtop:uni.getSystemInfoSync().statusBarHeight + 42,
|
|
|
|
|
current:0,
|
|
|
|
|
tabList:[
|
|
|
|
|
{title:'待使用'},
|
|
|
|
|
{title:'已使用'},
|
|
|
|
|
{title:'已过期'}
|
|
|
|
|
],
|
|
|
|
|
dataList:[
|
2022-08-11 10:27:47 +00:00
|
|
|
|
// {price:10,title:'【满减卷】满100元减10元抵扣卷',time:'2022.07.11-2022.07.30',show:false},
|
|
|
|
|
// {price:10,title:'【满减卷】满100元减10元抵扣卷',time:'2022.07.11-2022.07.30',show:false},
|
|
|
|
|
// {price:10,title:'【满减卷】满100元减10元抵扣卷',time:'2022.07.11-2022.07.30',show:false},
|
|
|
|
|
// {price:10,title:'【满减卷】满100元减10元抵扣卷',time:'2022.07.11-2022.07.30',show:false},
|
2022-08-10 10:18:06 +00:00
|
|
|
|
],
|
|
|
|
|
status:'normal',
|
|
|
|
|
page:1,
|
|
|
|
|
size:20,
|
|
|
|
|
total:0,
|
2022-08-16 10:06:46 +00:00
|
|
|
|
noMore:false,
|
|
|
|
|
loading:false
|
2022-08-10 10:18:06 +00:00
|
|
|
|
}
|
|
|
|
|
},
|
|
|
|
|
onReachBottom() {
|
|
|
|
|
if(this.total!=this.dataList.length){
|
|
|
|
|
this.page++;
|
|
|
|
|
this.getCouponList();
|
2022-08-01 09:03:10 +00:00
|
|
|
|
}
|
|
|
|
|
},
|
2022-08-10 10:18:06 +00:00
|
|
|
|
onLoad() {
|
|
|
|
|
this.getCouponList();
|
|
|
|
|
},
|
2022-08-01 09:03:10 +00:00
|
|
|
|
methods: {
|
2022-08-12 10:14:13 +00:00
|
|
|
|
// 去使用事件
|
|
|
|
|
goCourse(){
|
|
|
|
|
if(this.status=='normal'){
|
|
|
|
|
uni.reLaunch({
|
|
|
|
|
url:'/pages/tabbar/course/course'
|
|
|
|
|
})
|
|
|
|
|
}
|
|
|
|
|
},
|
2022-08-03 13:28:45 +00:00
|
|
|
|
// tab点击事件
|
|
|
|
|
clickTab(index){
|
2022-08-11 10:27:47 +00:00
|
|
|
|
this.dataList = [];
|
2022-08-03 13:28:45 +00:00
|
|
|
|
this.current = index;
|
2022-08-10 10:18:06 +00:00
|
|
|
|
this.status = ['normal','used','invalid'][this.current];
|
|
|
|
|
this.page = 1;
|
|
|
|
|
this.getCouponList();
|
2022-08-03 13:28:45 +00:00
|
|
|
|
},
|
|
|
|
|
// 去商品详情
|
|
|
|
|
goDetail(id){
|
|
|
|
|
uni.navigateTo({
|
|
|
|
|
url:`/pagesB/shop-detail/shop-detail?id=${id}`
|
|
|
|
|
})
|
|
|
|
|
},
|
|
|
|
|
// 查看优惠券详情
|
|
|
|
|
lookDetail(index){
|
|
|
|
|
if(this.dataList[index].show){
|
|
|
|
|
this.dataList[index].show = false;
|
|
|
|
|
} else {
|
|
|
|
|
this.dataList.forEach(item=>item.show=false);
|
|
|
|
|
this.dataList[index].show = true;
|
|
|
|
|
}
|
2022-08-10 10:18:06 +00:00
|
|
|
|
},
|
|
|
|
|
// 获取优惠券列表
|
|
|
|
|
getCouponList(){
|
2022-08-16 10:06:46 +00:00
|
|
|
|
this.loading = false;
|
2022-08-10 10:18:06 +00:00
|
|
|
|
let params = {
|
|
|
|
|
status:this.status,
|
|
|
|
|
page:this.page,
|
|
|
|
|
size:this.size
|
|
|
|
|
}
|
|
|
|
|
this.$requst.get('/api/user/coupon-list',params).then(res=>{
|
|
|
|
|
if(res.code==0){
|
2022-08-11 10:27:47 +00:00
|
|
|
|
this.total = res.data.total;
|
|
|
|
|
if(this.page==1){this.dataList=[];}
|
|
|
|
|
this.dataList = [...this.dataList,...res.data.list];
|
|
|
|
|
if(this.total==this.dataList.length && this.page!=1){
|
|
|
|
|
this.noMore = true;
|
|
|
|
|
}
|
2022-08-16 10:06:46 +00:00
|
|
|
|
this.loading = true;
|
2022-08-10 10:18:06 +00:00
|
|
|
|
}
|
|
|
|
|
})
|
2022-08-03 13:28:45 +00:00
|
|
|
|
}
|
2022-08-01 09:03:10 +00:00
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
</script>
|
|
|
|
|
|
|
|
|
|
<style>
|
2022-08-03 13:28:45 +00:00
|
|
|
|
.noshow{transform: rotate(-90deg);transition: all .3s linear;}
|
|
|
|
|
.isshow{transform: rotate(90deg);transition: all .3s linear;}
|
2022-08-01 09:03:10 +00:00
|
|
|
|
</style>
|