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.

243 lines
103 KiB

<template>
<view>
<view class='coupon-list' v-if="couponsList.length">
<view class='item acea-row row-center-wrapper' :class="{gray: item.is_fail || item.status === $t(`已使用`)}" v-for='(item,index) in couponsList'
:key="index">
<view class='money' :class='item.is_fail ? "moneyGray" : ""'>
<view>{{$t(``)}}<text class='num'>{{item.coupon_price | money}}</text></view>
<view class="pic-num" v-if="item.use_min_price > 0">{{$t(``)}}{{ item.use_min_price | money }}{{$t(`元可用`)}}</view>
<view class="pic-num" v-else>{{$t(`无门槛券`)}}</view>
</view>
<view class='text'>
<view class='condition'>
<view class="name line2">
<view class="line-title" :class="item.is_fail? 'bg-color-huic' : 'bg-color-check'" v-if="item.applicable_type === 0">{{$t(`通用劵`)}}</view>
<view class="line-title" :class="item.is_fail? 'bg-color-huic' : 'bg-color-check'" v-else-if="item.applicable_type === 1">{{$t(`品类券`)}}</view>
<view class="line-title" :class="item.is_fail? 'bg-color-huic' : 'bg-color-check'" v-else>{{$t(`商品券`)}}</view>
<text>{{item.coupon_title}}</text>
</view>
</view>
<view class='data acea-row row-between-wrapper'>
<!-- item.start_time | format -->
<view>{{item.add_time}}-{{item.end_time}}</view>
<!-- is_fail:1为失效0为可用 -->
<view class='bnt gray' v-if="item.is_fail">{{item.status}}</view>
<view class='bnt' v-else>{{item.status}}</view>
</view>
</view>
</view>
</view>
<view class='noCommodity' v-if="!couponsList.length && loading==true">
<view class='pictrue'>
<image :src="imgHost + '/statics/images/noCoupon.png'"></image>
</view>
</view>
<!-- #ifdef MP -->
<!-- <authorize @onLoadFun="onLoadFun" :isAuto="isAuto" :isShowAuth="isShowAuth" @authColse="authColse"></authorize> -->
<!-- #endif -->
<!-- #ifndef MP -->
<home></home>
<!-- #endif -->
</view>
</template>
<script>
import {
memberCouponsList
} from '@/api/user.js';
import {
toLogin
} from '@/libs/login.js';
import dayjs from '@/plugin/dayjs/dayjs.min.js';
import {
mapGetters
} from "vuex";
// #ifdef MP
import authorize from '@/components/Authorize';
// #endif
import home from '@/components/home';
import {HTTP_REQUEST_URL} from '@/config/app';
export default {
components: {
// #ifdef MP
authorize,
// #endif
home
},
data() {
return {
imgHost:HTTP_REQUEST_URL,
couponsList: [],
loading: false,
isAuto: false, //没有授权的不会自动授权
isShowAuth: false //是否隐藏授权
};
},
filters: {
format(value) {
if (!value) return ''
return dayjs(value * 1000).format('YYYY-MM-DD');
},
money(value) {
if (!value) return '0'
return parseFloat(value);
}
},
computed: mapGetters(['isLogin']),
watch: {
isLogin: {
handler: function(newV, oldV) {
if (newV) {
this.getUseCoupons();
}
},
deep: true
}
},
onLoad() {
if (this.isLogin) {
this.getUseCoupons();
} else {
toLogin();
}
},
methods: {
/**
* 授权回调
*/
onLoadFun: function() {
this.getUseCoupons();
},
// 授权关闭
authColse: function(e) {
this.isShowAuth = e
},
/**
* 获取领取优惠券列表
*/
getUseCoupons: function() {
let that = this;
memberCouponsList().then(res => {
that.loading = true;
that.$set(that, 'couponsList', res.data);
})
}
}
}
</script>
<style scoped>
.coupon-list .moneyGray.item .text .data .bnt {
background: #B5B5B5;
}
.coupon-list .moneyGray.item .money {
color: #7D7D7D;
}
.coupon-list .moneyGray.item .text {
background: linear-gradient(-90deg, #DADADA 0%, #E9E9E9 100%);
}
.coupon-list .moneyGray.item .text .condition {
border-color: #F0F0F0;
}
.coupon-list .moneyGray.item .text .condition {
color: #7D7D7D;
}
.coupon-list .moneyGray.item .text .data {
color: #999999;
}
.moneyGray .condition .line-title {
border-color: #7D7D7D;
background: #EFEFEF;
color: #7D7D7D;
}
.coupon-list .item .money {
background: url("data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAeIAAAFWCAYAAAC1sp7AAAAgAElEQVR4Xuy9za5tSXIetva5VRQNW6py1wNYD0DQbXlsmj/SXEMaNlAXHtjw6OoFbMp2/1XLJglQHHmgGhsNSHqCKgNWV3dTUE0MmAMCGpgEDJNXpQYbMNz3nrONiIxYO9fa+f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XhHeh/90QMRGRAEu5I+sM6x5ELccjYpNYDSzY0ZUETEmY6kFGVA7IwoZqm+7R17MvUD99zIvICFz7WwP83hIgPYBnBxL1nSS851E247ab7PMuYvJ5CC/3rtkJLtuhYJLx6/yGeCCk9muPA2pCDYTBgDQGxYffxGYycIv9TbFh7TFvqh1uQ8N4e0G35ftFZi5p5PD1Nr6fT9KYFW/l+twWRgUr6HptMHE0L3Y2X5YDZik1NHe6IoBsiMJ1DF7pXjBRUaafqgTUbGmp85dayadrDyxmU9Gk1dakL/e9yJ/aAJntNs0I+n7+cptNHPqWaCcSjzL34HKhk77HJe2zy6m4bhM0QRHzLiGCjnIghdB+NhMUNfdY4sM4HVhT83DwRhIjfTxOhYkv9sEveG437Z5ILlO01HZTx9HUfRVxa5ZYto7ru6+K2GzJVqQciAI2kuyfi7oloMZKG8L9T7nD2c6SAU9nQeyBhs+63GKnnULZkVcQecAQp7wPKnUZPRHH60tuffvb5NJ0+9SvjOyKAE7CGIIMW+oPM7rlsdeukU4gZEDZD6D4akdUqR2CpcJ9qBU21kpKjKze0jifMeAAhPi9obfcxduZ7rh+m8YfoxKW73KnK/ZXcKU5fGouKnRapx219j0
}
.money {
display: flex;
flex-direction: column;
justify-content: center;
}
.pic-num {
font-size: 24rpx;
}
.coupon-list .item .text .condition {
display: flex;
align-items: center;
}
.coupon-list .item .text .condition .name {
font-size: 26rpx;
font-weight: 500;
}
.coupon-list .item .text .condition .pic {
width: 30rpx;
height: 30rpx;
display: block;
margin-right: 10rpx;
display: inline-block;
vertical-align: middle;
}
.condition .line-title {
width: 70rpx;
height: 32rpx !important;
line-height: 30rpx;
text-align: center;
box-sizing: border-box;
background: #FEF7EC;
border: 1px solid #EEC181;
opacity: 1;
border-radius: 20rpx;
font-size: 18rpx !important;
color: #EEC181;
margin-right: 12rpx;
text-align: center;
display: inline-block;
vertical-align: middle;
}
.condition .line-title.bg-color-huic {
border-color: #BBB;
color: #bbb;
background-color: #F5F5F5;
}
.coupon-list .item .text .data .bnt {
background: linear-gradient(90deg, #EDC98A 0%, #EDBB75 100%);
}
.coupon-list .item.gray .line-title {
border: 1px solid #CCCCCC;
background: #F7F7F7;
color: #CCCCCC;
}
.coupon-list .item.gray .text .condition {
color: #CCCCCC;
}
.coupon-list .item.gray .text .data {
color: #CCCCCC;
}
.coupon-list .item.gray .text .data .bnt {
background: #CCCCCC;
}
.coupon-list .item.gray .money {
background-image: url("data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAeIAAAFWCAYAAAC1sp7AAAAgAElEQVR4Xu29Ta+lR3Imds4lqZkBjCY98Fbw/ADJ6JbtlTfeyitDn2Q32VWW1OJmAM4/8Czk9Sw0mI0XQ8wfsLwxoBbJqiKL39VdBJqQll4KUEOy1N1qiax77zGi6j6XcaIy38yIjIw333OygMK5dSvzRGREZDwRkV/73fwzJTAlMCUwJTAlMCWwmgT2npQfP378b66urv5fz+8c8bsOh8Nuv9/v+OcSn6n26O/ZL4oOeNbS07a30rH2m/wdW6NWHtr2Vj1Z+03+pn5T/jbKLnJ0fuu3fmvvCsSff/75v9/v9//7iOBp5clTSZ6gO51Rm1OZ8pvyW9MpT/ub9gcJ/PZv/7YvED969Oj/2+12r1hBb/R+MxN+piFtcKJtb3VS1n6TvzanOOW3HflRJY7+8Ioc6Q/zegYnzyqdnklTaX64AvGpZcMl4eUUNcF6gjW3DU87WlrOiKIzg5020F1LfgBf/snBV4Kx1p607a1ysPYbmT83IL5ZG358qtnwBNcJrhNcnw89R3ZulsqN1clb+0XIj4I3/JUgzPmGvIgn/lfuhemxt2Vk+bXM+1r9ugHxo0eP/q/dbve/LubzG/nPWuHJ4UywnmDdMmnP3RnVzKceIOA530fij4PuCy+88FS8NfxdX18/BWL6lMFMyoWfqvyixkV0fud3fqd9jfhHP/rRvzscDv9hIzirYnOC6wTXCa4zE45eM8w5qVpwQAZ8cXFx+1WazBYZMUCZ011yoLX8tQZdUXSiguPmjPjRo0eUBVM2vPk/nsqdxlo+2uUp75pIX0tP2946a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