coupon.vue
2.9 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
<template>
<div class="containerbox">
<div class="flextwo sharetopk" @click="back">
<div class="leftrow leftrowkimg">
<img src="../../../assets/leftrow.png" alt />
</div>
<div class="sharemiddle">获得奖券</div>
<div class="sharebtn">
<!-- <img src="../../../assets/sharebtn.png" alt /> -->
</div>
</div>
<div class="couponbox">
<div class="couponimg" v-if="ticket.status==0">
<img src="../../../assets/couponone.png" alt />
<img src="../../../assets/unused.png" alt class="useimg" />
<div class="couponhezi">
<div class="coupontop flextwo">
<div class="moneynumber">
<span class="moneysign">¥</span>
<span class="moneynum">{{ticket.num}}</span>
</div>
</div>
<div class="couponname">抵扣优惠券(全场可用)</div>
<div class="coupondate">{{ticket.createtime}}---{{ticket.end_time}}</div>
</div>
</div>
<div class="couponimg" v-if="ticket.status==1">
<img src="../../../assets/coupontwo.png" alt />
<img src="../../../assets/shiyong.png" alt class="useimg" />
<div class="couponhezi">
<div class="coupontop flextwo">
<div class="moneynumber">
<span class="moneysign">¥</span>
<span class="moneynum">{{ticket.num}}</span>
</div>
</div>
<div class="couponname">抵扣优惠券(全场可用)</div>
<div class="coupondate">{{ticket.createtime}}---{{ticket.end_time}}</div>
</div>
</div>
<div class="couponimg" v-if="ticket.status==2">
<img src="../../../assets/coupontwo.png" alt />
<img src="../../../assets/used.png" alt class="useimg" />
<div class="couponhezi">
<div class="coupontop flextwo">
<div class="moneynumber">
<span class="moneysign">¥</span>
<span class="moneynum">{{ticket.num}}</span>
</div>
</div>
<div class="couponname">抵扣优惠券(全场可用)</div>
<div class="coupondate">{{ticket.createtime}}---{{ticket.end_time}}</div>
</div>
</div>
</div>
</div>
</template>
<script>
export default {
data() {
return {
ticket: ''
}
},
created() {
document.title = '唐元集'
this.getcoupon()
},
methods: {
back() {
this.$router.go(-1)
},
getcoupon() {
let that = this;
var url = "/api/user/my_ticket";
let param = {
};
that.$axios
.post(url, param)
.then(function (res) {
console.log(res);
that.ticket = res.data.ticket
})
.catch(function (err) {
console.log(err);
});
}
}
}
</script>
<style scoped>
@import "../../../style/usercenter.css";
.couponbox {
margin-top: 1.2rem;
}
</style>