You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
yanzong_qianduan/pages/news/coupon/list.vue

182 lines
3.8 KiB

<template>
<view class="coupon">
<view class="coupon-tab">
<u-tabs :list="list" height="106" font-size="32" active-color="#F34A40" inactive-color="#686868" :is-scroll="false" v-model="tabIndex" @change="change"></u-tabs>
</view>
<view class="coupon-bd">
<view class="item" :class="tabIndex == 2?'item-on':''" v-for="i in 10" :key="i">
<view class="a"><text>890</text></view>
<view class="b">有效期2024.01-2024.01.19</view>
<view class="c">适用于全场商品</view>
<view class="d" v-if="tabIndex == 0">去使用</view>
<view class="e">满999元使用</view>
<view class="f">满999元减130元</view>
<image class="bg" v-if="tabIndex <= 1" src="@/static/news/icon-coupon-01.png"></image>
<image class="bg" v-else src="@/static/news/icon-coupon-02.png"></image>
<image class="icon" v-if="tabIndex == 1" src="@/static/news/icon-coupon-use.png"></image>
<image class="icon" v-if="tabIndex == 2" src="@/static/news/icon-coupon-used.png"></image>
<view class="line">
<u-line v-if="tabIndex <= 1" direction="col" border-style="dashed" color="#FFC7B9" />
<u-line v-if="tabIndex == 2" direction="col" border-style="dashed" color="#D9D9D9" />
</view>
</view>
</view>
<view class="nolist">
<image src="@/static/news/icon-coupon-03.png"></image>
<view class="txt">暂无已使用优惠券</view>
</view>
</view>
</template>
<script>
export default {
data() {
return {
list: [{
name: '未使用'
}, {
name: '已使用'
}, {
name: '已过期'
}],
tabIndex: 0
}
},
methods: {
change() {
},
tabItem(index){
this.tabIndex = index
}
}
}
</script>
<style lang="scss" scoped>
.coupon{
overflow: hidden;
.nolist{
width: 100%;
display: block;
margin: 0 auto;
text-align: center;
padding: 150rpx 50rpx;
image{
width: 388rpx;
height: 378rpx;
}
.txt{
font-size: 32rpx;
margin-top: 20rpx;
font-weight: 500;
color: #959595;
}
}
&-bd{
padding: 0 40rpx 40rpx;
overflow: hidden;
.item{
width: 662rpx;
height: 366rpx;
position: relative;
margin-top: 20rpx;
overflow: hidden;
.bg{
width: 100%;
height: 100%;
}
.icon{
width:220rpx;
height: 195rpx;
position: absolute;
right: 0;
bottom: 0;
z-index:1;
}
.a{
width: 235rpx;
position: absolute;
right: 0;
top: 40rpx;
z-index: 2;
font-size: 36rpx;
font-weight: 500;
text-align: center;
color: #FE6900;
text{
font-size: 68rpx;
}
}
.b{
position: absolute;
left: 40rpx;
top: 110rpx;
z-index: 2;
font-size: 28rpx;
font-weight: 500;
color: #AFAFAF;
}
.e{
position: absolute;
left: 40rpx;
top: 46rpx;
z-index: 2;
font-size: 36rpx;
font-weight: 500;
color: #454545;
}
.f{
position: absolute;
left: 40rpx;
top: 160rpx;
z-index: 2;
font-size: 28rpx;
font-family: PingFang SC, PingFang SC;
font-weight: 400;
color: #6C6C6C;
}
.c{
position: absolute;
left: 40rpx;
bottom: 20rpx;
z-index: 2;
font-size: 28rpx;
font-weight: 500;
color: #A7572C;
}
.d{
width: 188rpx;
line-height: 68rpx;
background: linear-gradient(180deg, #FF7366 0%, #FF5242 100%);
border-radius: 68rpx;
position: absolute;
right: 28rpx;
top: 140rpx;
z-index: 2;
font-size: 28rpx;
font-weight: 500;
color: #FFFFFF;
text-align: center;
}
.line{
position: absolute;
right: 230rpx;
height: 200rpx;
width: 2px;
z-index: 3;
top: 36rpx;
}
&-on{
.a{
color: #BBBBBB;
}
.c{
color: #BBBBBB;
}
}
}
}
}
</style>