add
yj
2024-12-05 b9900893177c78fc559223521fe839aa21000017
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
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
<template>
    <view class="coupon-item">
        <view class="coupon-money">
            <view class="nick" v-if="!types">{{item.title}}</view>
            <view class="layof" :style="{color:theme}">¥{{item.discount / 100.0}}</view>
            <view v-if="item.couponId" class="end_time">有效期至{{item.gmtEnd | dateFormat}}</view>
            <view v-if="!item.couponId && item.gmtEnd" class="end_time">在{{item.gmtEnd}}前有效。 可领{{item.limit}}张,已领{{item.nowCount}}张</view>
            <view v-if="!item.couponId && !item.gmtEnd" class="end_time">在领取后{{item.days}}天内有效。可领{{item.limit}}张,已领{{item.nowCount}}张</view>
            <view v-if="!types">
                <!-- <view class="tit">券号:{{item.ticket}}</view> -->
                <view class="demand">满{{item.min / 100.0}}可用。{{item.categoryTitle?'限' + item.categoryTitle + '可用': '全品类可用'}}</view>
            </view>
        </view>
        <!-- <view @click="share" v-if="item.couponId" class="get-btn" :style="{color:color, borderColor:color, background:solid}">分享</view> -->
        <view @click="obtain" v-if="!item.couponId" class="get-btn" :style="{color:color, borderColor:color, background:solid}">{{ item.nowCount < item.limit ? '立即领取' : '已领取' }}</view>
    </view>
</template>
 
<script>
    export default {
        components: {
 
        },
        data() {
            return {
 
            }
        },
        props: {
            item: {
                type: Object
            },
            index: {
                type: Number
            },
            types: {
                type: String,
                default: ''
            },
            theme: {
                type: String,
                default: '#ff9000'
            },
            solid: {
                type: String,
                default: '#ffffff'
            },
            color: {
                type: String,
                default: '#ff9000'
            },
        },
        methods: {
            obtain() {
                this.$emit('obtainCoupon', this.item, this.index)
            },
            share() {
                this.$emit('shareCoupon', this.item, this.index)
            }
        }
    }
</script>
 
<style lang='scss'>
    .coupon-item {
        width: 100%;
        height: auto;
        display: table;
        border-radius: 10upx;
        padding: 0 20upx;
        margin-top: 22upx;
        border: 1px solid #eeeeee;
        position: relative;
 
        .coupon-money {
            width: 465upx;
            height: auto;
            display: table;
            float: left;
            padding: 26upx 0;
            border-style: none dotted none none;
            border-color: #eeeeee;
 
            .nick {
                width: 100%;
                height: 50upx;
                line-height: 30upx;
                font-size: $font-sm;
                color: #999999;
            }
 
            .tit {
                width: 100%;
                height: 50upx;
                line-height: 50upx;
                font-size: $font-sm;
                color: #999999;
            }
 
            .demand {
                width: 100%;
                height: 30upx;
                line-height: 30upx;
                font-size: $font-sm;
                color: #999999;
            }
 
            .layof {
                width: 100%;
                height: 48upx;
                line-height: 30upx;
                font-size: 44upx;
                color: #ff9000;
                font-weight: bold;
            }
 
            .end_time {
                width: 100%;
                height: 30upx;
                line-height: 30upx;
                font-size: $font-sm;
                color: #999999;
            }
        }
 
        .get-btn {
            width: 146upx;
            height: 52upx;
            line-height: 50upx;
            position: absolute;
            top: 50%;
            right: 26upx;
            margin-top: -26upx;
            text-align: center;
            border-radius: 60upx;
            color: #ff9000;
            border: 1px solid #ff9000;
            font-size: $font-sm;
            float: right;
        }
    }
 
    .coupon-item:after {
        width: 40upx;
        height: 20upx;
        position: absolute;
        left: 460upx;
        top: -1px;
        border-radius: 0 0 40upx 40upx;
        content: "";
        display: block;
        background: #FFF;
        border: 1px solid #eeeeee;
        border-top: 0px;
    }
 
    .coupon-item:before {
        width: 40upx;
        height: 20upx;
        position: absolute;
        left: 460upx;
        bottom: -1px;
        border-radius: 40upx 40upx 0 0;
        content: "";
        display: block;
        background: #FFF;
        border: 1px solid #eeeeee;
        border-bottom: 0px;
    }
</style>