123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201 |
- <template>
- <view class="">
- <u-navbar
- title="我的优惠券"
- :placeholder="true"
- :autoBack="false"
- @leftClick="leftClick"
- :safeAreaInsetTop="true"
- >
- </u-navbar>
- <view class="tabs-wrap">
- <u-tabs
- :list="tabsList"
- lineColor="#3B49BF"
- :activeStyle="{color:'#333','font-weight': '600','font-size':'30rpx'}"
- :inactiveStyle="{color:'#999'}"
- :itemStyle="{width:'28%','padding-bottom':'20rpx'}"
- @click="tabsClick"></u-tabs>
- </view>
- <mescroll-body class="" ref="mescrollRef" @init="mescrollInit" @down="downCallback" @up="upCallback" :down="downOption" :up="upOption">
- <view class="page-wrap">
- <view class="coupon-activity u-flex u-row-right" @click="$u.route('/center/couponlist',{})" :style="{backgroundImage:`url(${staticUrl}/img/coupon-activity.png)`}">
- <view class="u-flex">
- 活动中心
- <u-icon name="arrow-right" color="#fff" size="30rpx"></u-icon>
- </view>
- </view>
- <view class="coupon-list">
- <view class="item"
- :class="{disable:item.status==2}"
- :style="{backgroundImage:`url(${staticUrl}/img/coupon-active-bg-v2.png)`,filter:item.status!=1?'grayscale(100%)':''}" v-for="item in dataList" :key="item.id">
- <view class="content u-flex">
- <view class="left">
- <view class="quota">
- <text v-if="item.type == 1">¥</text>
- <text class="number" :class="{'small': String(item.quota).length>=3}">{{item.type==1?item.quota:item.quota/10}}</text>
- <text v-if="item.type == 2">折</text>
- </view>
- </view>
- <view class="center">
- <view class="name" :class="{'small': String(item.couponName).length>=9}">{{item.couponName}}</view>
- <view class="condition" v-if="item.useThresholdType == 2">
- 消费满{{item.useThresholdAmount}}可用
- </view>
- </view>
- <view class="right">
- <text class="btn" @click="couponClick(item)" v-if="item.status == 1">去使用</text>
- <text class="btn" @click="couponClick(item)" v-if="item.status == 2">已使用</text>
- <text class="btn" @click="couponClick(item)" v-if="item.status == 3">已过期</text>
- <text class="btn" @click="couponClick(item)" v-if="item.status == 4">已作废</text>
-
- {{item.startTime}}
- {{item.endTime}}
- </view>
- </view>
- <view class="bottom-time">
- 有效期 {{item.startTime||''}} - {{item.endTime||''}}
- </view>
- <view class="type" v-if="item.type == 1">满减券</view>
- <view class="type" v-else-if="item.type == 2">折扣卷</view>
- <image class="status-img" :src="staticUrl+'/img/coupon-status-shiyong.png'" v-if="item.status == 2"></image>
- <image class="status-img" :src="staticUrl+'/img/coupon-status-guoqi.png'" v-if="item.status == 3"></image>
- <image class="status-img" :src="staticUrl+'/img/coupon-status-guoqi.png'" v-if="item.status == 4"></image>
- </view>
- </view>
- </view>
- </mescroll-body>
- </view>
- </template>
- <script>
-
- import MescrollMixin from "@/uni_modules/mescroll-uni/components/mescroll-uni/mescroll-mixins.js";
- export default {
- mixins: [MescrollMixin],
- data() {
- return {
- staticUrl:this.$commonConfig.staticUrl,
- downOption: {},
-
- upOption: {
- page: {
- size: 10
- },
- noMoreSize: 5,
- empty: {
- tip: '暂无相关数据'
- }
- },
- tabsList:[{name:'待使用',recordType:1},{name:'已使用',recordType:2},{name:'已过期',recordType:3}],
- params:{
- status:''
- },
- activeIndex:0,
- dataList: []
- }
- },
- onShow() {
-
- },
- onLoad() {
- this.params.status = this.tabsList[this.activeIndex].recordType;
-
- },
- methods: {
- leftClick(e){
- let pages = getCurrentPages();
- if(pages.length==1){
- uni.$u.route('/pages/index/index')
- }else{
- uni.navigateBack()
- };
- },
-
- </script>
- <style>
- page{
- background-color: #f5f5f5;
- }
- </style>
- <style lang="scss" scoped>
- .tabs-wrap{
- background-color: #fff;
- margin-bottom: 10rpx;
- }
- .coupon-activity{
- height: 120rpx;
- background-size: 100%;
- color: #fff;
- font-weight: 500;
- font-size: 24rpx;
- padding-right: 15rpx;
- margin-bottom: 14rpx;
- }
- </style>
|