|
|
@@ -4,14 +4,17 @@
|
|
|
'coupon',
|
|
|
{
|
|
|
'coupon-active': active,
|
|
|
- disabled: '' + coupon.use_type !== 'undefined' && coupon.use_type !== 1,
|
|
|
+ disabled:
|
|
|
+ ('' + coupon.use_type !== 'undefined' && coupon.use_type !== 1) ||
|
|
|
+ coupon.is_use,
|
|
|
expired: coupon.use_type === 0,
|
|
|
- used: coupon.use_type === 2,
|
|
|
+ used: coupon.use_type === 2 || coupon.is_use,
|
|
|
},
|
|
|
]"
|
|
|
>
|
|
|
<view :class="['coupon-card', { checked: checked }]" @click="handleClick">
|
|
|
- <view class="coupon-label">
|
|
|
+ <image class="coupon-img" v-if="coupon.img" :src="coupon.img"></image>
|
|
|
+ <view v-else class="coupon-label">
|
|
|
<view class="coupon-title">
|
|
|
<text
|
|
|
v-if="coupon.unit === '元' || coupon.unit === '¥'"
|
|
|
@@ -28,15 +31,28 @@
|
|
|
<text class="coupon-desc">{{ coupon.satisfy_notice }}</text>
|
|
|
</view>
|
|
|
<view class="coupon-body">
|
|
|
- <text class="coupon-title">{{ coupon.coupon_name }}</text>
|
|
|
- <text class="coupon-desc">{{ coupon.date }}</text>
|
|
|
- <view class="rule-btn" @click.stop="active = !active">
|
|
|
+ <text class="coupon-title" v-if="coupon.coupon_name">{{
|
|
|
+ coupon.coupon_name
|
|
|
+ }}</text>
|
|
|
+ <text class="coupon-desc">{{ coupon.date || coupon.name }}</text>
|
|
|
+ <button
|
|
|
+ class="btn"
|
|
|
+ v-if="coupon.is_use === 1"
|
|
|
+ @click.stop="handleUseClick"
|
|
|
+ >
|
|
|
+ 立即使用
|
|
|
+ </button>
|
|
|
+ <view
|
|
|
+ class="rule-btn"
|
|
|
+ v-if="coupon.rule"
|
|
|
+ @click.stop="active = !active"
|
|
|
+ >
|
|
|
<text class="text">使用规则</text>
|
|
|
<image class="arrow" src="@/assets/coupon/icon-arrow.png"></image>
|
|
|
</view>
|
|
|
</view>
|
|
|
</view>
|
|
|
- <view class="rule-text" v-html="coupon.rule"></view>
|
|
|
+ <view v-if="coupon.rule" class="rule-text" v-html="coupon.rule"></view>
|
|
|
</view>
|
|
|
</template>
|
|
|
|
|
|
@@ -63,6 +79,9 @@ export default {
|
|
|
handleClick() {
|
|
|
this.$emit("click", this.coupon);
|
|
|
},
|
|
|
+ handleUseClick() {
|
|
|
+ this.$emit("use", this.coupon);
|
|
|
+ },
|
|
|
},
|
|
|
};
|
|
|
</script>
|
|
|
@@ -83,6 +102,12 @@ export default {
|
|
|
color: #979797;
|
|
|
margin: 0 auto 20rpx;
|
|
|
|
|
|
+ .coupon-img {
|
|
|
+ width: 186rpx;
|
|
|
+ height: 186rpx;
|
|
|
+ margin: 20rpx;
|
|
|
+ }
|
|
|
+
|
|
|
.coupon-label {
|
|
|
width: 226rpx;
|
|
|
height: 164rpx;
|
|
|
@@ -114,7 +139,7 @@ export default {
|
|
|
|
|
|
.coupon-title {
|
|
|
display: block;
|
|
|
- height: 48rpx;
|
|
|
+ // height: 48rpx;
|
|
|
font-size: 34rpx;
|
|
|
font-weight: 600;
|
|
|
line-height: 48rpx;
|
|
|
@@ -273,5 +298,14 @@ export default {
|
|
|
}
|
|
|
}
|
|
|
}
|
|
|
+ .btn {
|
|
|
+ display: block;
|
|
|
+ font-size: 28rpx;
|
|
|
+ margin-top: 20rpx;
|
|
|
+ background-color: rgba(255, 255, 255, 0.2);
|
|
|
+ &::after {
|
|
|
+ display: none;
|
|
|
+ }
|
|
|
+ }
|
|
|
}
|
|
|
</style>
|