样式修复
This commit is contained in:
@@ -50,6 +50,10 @@
|
||||
>
|
||||
<chatItem :item="item"></chatItem>
|
||||
</view>
|
||||
<view class="text-center u-m-t-20" v-if="item.msg_type==4&&item.hasGet">
|
||||
<text>{{item.hasGet||0}}人已领取</text>
|
||||
<text class="color-main">优惠券</text>
|
||||
</view>
|
||||
</view>
|
||||
<up-avatar
|
||||
size="122rpx"
|
||||
|
||||
@@ -18,13 +18,64 @@
|
||||
<view class="" v-if="item.msg_type == 4">
|
||||
<view>{{ item.coupon.title }}</view>
|
||||
<view class="u-m-t-16 bg-f7 coupon u-flex">
|
||||
<view class="left">
|
||||
<view class="price">
|
||||
<template v-if="item.coupon.type == 1">
|
||||
<view class="left">
|
||||
<view class="price">
|
||||
<text class="u-font-32">¥</text>
|
||||
<text style="font-size: 72rpx;">15</text>
|
||||
<text style="font-size: 72rpx">{{
|
||||
item.coupon.discountAmount
|
||||
}}</text>
|
||||
</view>
|
||||
<view class="u-font-24 color-999 no-wrap"
|
||||
>满{{ item.coupon.fullAmount }}可用</view
|
||||
>
|
||||
</view>
|
||||
<view class="u-font-24 color-999 no-wrap">满{{item.coupon.fullAmount}}可用</view>
|
||||
</view>
|
||||
</template>
|
||||
<template v-if="item.coupon.type == 2">
|
||||
<view class="left">
|
||||
<view class="price">
|
||||
<text class="u-font-32"
|
||||
>商品兑换券</text
|
||||
>
|
||||
</view>
|
||||
<view class="u-font-24 color-999 no-wrap"
|
||||
>满{{ item.coupon.fullAmount }}可用</view
|
||||
>
|
||||
</view>
|
||||
</template>
|
||||
|
||||
<template v-if="item.coupon.type == 3">
|
||||
<view class="left">
|
||||
<view class="price">
|
||||
<text class="u-font-32"
|
||||
>{{ item.coupon.discountRate / 100 }}折</text
|
||||
>
|
||||
</view>
|
||||
<view class="u-font-24 color-999 no-wrap"
|
||||
>满{{ item.coupon.fullAmount }}可用</view
|
||||
>
|
||||
</view>
|
||||
</template>
|
||||
<template v-if="item.coupon.type == 4">
|
||||
<view class="left">
|
||||
<view class="price">
|
||||
<text class="u-font-32"
|
||||
>第二件半价券</text
|
||||
>
|
||||
</view>
|
||||
|
||||
</view>
|
||||
</template>
|
||||
<template v-if="item.coupon.type == 6">
|
||||
<view class="left">
|
||||
<view class="price">
|
||||
<text class="u-font-32"
|
||||
>买一送一券</text
|
||||
>
|
||||
</view>
|
||||
|
||||
</view>
|
||||
</template>
|
||||
<view class="right u-p-l-28">
|
||||
<view class="u-font-32 ">{{item.coupon.couponName}}</view>
|
||||
<view class="u-font-24 color-999 u-m-t-8">有效期:{{ returnTime(item.coupon) }} </view>
|
||||
@@ -34,6 +85,7 @@
|
||||
</template>
|
||||
|
||||
<script setup>
|
||||
import dayjs from 'dayjs'
|
||||
const props = defineProps({
|
||||
item: {
|
||||
type: Object,
|
||||
@@ -46,6 +98,9 @@ function previewImage(url) {
|
||||
});
|
||||
}
|
||||
function returnTime(coupon){
|
||||
// if(coupon.validType=="fixed"){
|
||||
// return dayjs().add(coupon.daysToTakeEffect,'day').format('YYYY-MM-DD')
|
||||
// }
|
||||
let startTime = coupon.useStartTime;
|
||||
let endTime = coupon.useEndTime;
|
||||
if(startTime && endTime){
|
||||
@@ -55,22 +110,36 @@ function returnTime(coupon){
|
||||
</script>
|
||||
|
||||
<style lang="scss" scoped>
|
||||
.img {
|
||||
width: 50vw;
|
||||
.img {
|
||||
width: 50vw;
|
||||
}
|
||||
.coupon {
|
||||
padding: 16rpx 10rpx;
|
||||
border-radius: 16rpx;
|
||||
.price {
|
||||
color: #ff1c1c;
|
||||
font-weight: 700;
|
||||
}
|
||||
.coupon{
|
||||
padding: 16rpx 10rpx;
|
||||
border-radius: 16rpx;
|
||||
.price{
|
||||
color: #FF1C1C;
|
||||
font-weight: 700;
|
||||
}
|
||||
.left{
|
||||
padding-right: 26rpx;
|
||||
border-right: 1rpx solid #EDEDED;
|
||||
}
|
||||
.right{
|
||||
.left {
|
||||
width: 112rpx;
|
||||
margin-right: 26rpx;
|
||||
}
|
||||
.right {
|
||||
border-left: 1rpx solid #ededed;
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
.lingqu {
|
||||
background-color: #e8ad7b;
|
||||
line-height: 48rpx;
|
||||
font-size: 28rpx;
|
||||
padding: 6rpx 70rpx;
|
||||
color: #fff;
|
||||
border-radius: 140rpx;
|
||||
&.hasGet {
|
||||
background-color: #eee;
|
||||
color: #999;
|
||||
}
|
||||
}
|
||||
</style>
|
||||
|
||||
|
||||
@@ -163,8 +163,9 @@ function sendMsg(msg) {
|
||||
});
|
||||
}
|
||||
function toShare(item) {
|
||||
const hasGet=item.couponJson.giveNum-item.couponJson.leftNum
|
||||
sendMsg({
|
||||
coupon: { ...item.couponJson, title: item.title,activity_id:item.id },
|
||||
coupon: { ...item.couponJson, title: item.title,activity_id:item.id, hasGet:hasGet<=0?0:hasGet} ,
|
||||
chat_coupon_id:item.id,
|
||||
msg_type: 4,
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user