样式修复
This commit is contained in:
@@ -50,6 +50,10 @@
|
|||||||
>
|
>
|
||||||
<chatItem :item="item"></chatItem>
|
<chatItem :item="item"></chatItem>
|
||||||
</view>
|
</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>
|
</view>
|
||||||
<up-avatar
|
<up-avatar
|
||||||
size="122rpx"
|
size="122rpx"
|
||||||
|
|||||||
@@ -18,13 +18,64 @@
|
|||||||
<view class="" v-if="item.msg_type == 4">
|
<view class="" v-if="item.msg_type == 4">
|
||||||
<view>{{ item.coupon.title }}</view>
|
<view>{{ item.coupon.title }}</view>
|
||||||
<view class="u-m-t-16 bg-f7 coupon u-flex">
|
<view class="u-m-t-16 bg-f7 coupon u-flex">
|
||||||
<view class="left">
|
<template v-if="item.coupon.type == 1">
|
||||||
<view class="price">
|
<view class="left">
|
||||||
|
<view class="price">
|
||||||
<text class="u-font-32">¥</text>
|
<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>
|
||||||
<view class="u-font-24 color-999 no-wrap">满{{item.coupon.fullAmount}}可用</view>
|
</template>
|
||||||
</view>
|
<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="right u-p-l-28">
|
||||||
<view class="u-font-32 ">{{item.coupon.couponName}}</view>
|
<view class="u-font-32 ">{{item.coupon.couponName}}</view>
|
||||||
<view class="u-font-24 color-999 u-m-t-8">有效期:{{ returnTime(item.coupon) }} </view>
|
<view class="u-font-24 color-999 u-m-t-8">有效期:{{ returnTime(item.coupon) }} </view>
|
||||||
@@ -34,6 +85,7 @@
|
|||||||
</template>
|
</template>
|
||||||
|
|
||||||
<script setup>
|
<script setup>
|
||||||
|
import dayjs from 'dayjs'
|
||||||
const props = defineProps({
|
const props = defineProps({
|
||||||
item: {
|
item: {
|
||||||
type: Object,
|
type: Object,
|
||||||
@@ -46,6 +98,9 @@ function previewImage(url) {
|
|||||||
});
|
});
|
||||||
}
|
}
|
||||||
function returnTime(coupon){
|
function returnTime(coupon){
|
||||||
|
// if(coupon.validType=="fixed"){
|
||||||
|
// return dayjs().add(coupon.daysToTakeEffect,'day').format('YYYY-MM-DD')
|
||||||
|
// }
|
||||||
let startTime = coupon.useStartTime;
|
let startTime = coupon.useStartTime;
|
||||||
let endTime = coupon.useEndTime;
|
let endTime = coupon.useEndTime;
|
||||||
if(startTime && endTime){
|
if(startTime && endTime){
|
||||||
@@ -55,22 +110,36 @@ function returnTime(coupon){
|
|||||||
</script>
|
</script>
|
||||||
|
|
||||||
<style lang="scss" scoped>
|
<style lang="scss" scoped>
|
||||||
.img {
|
.img {
|
||||||
width: 50vw;
|
width: 50vw;
|
||||||
|
}
|
||||||
|
.coupon {
|
||||||
|
padding: 16rpx 10rpx;
|
||||||
|
border-radius: 16rpx;
|
||||||
|
.price {
|
||||||
|
color: #ff1c1c;
|
||||||
|
font-weight: 700;
|
||||||
}
|
}
|
||||||
.coupon{
|
.left {
|
||||||
padding: 16rpx 10rpx;
|
width: 112rpx;
|
||||||
border-radius: 16rpx;
|
margin-right: 26rpx;
|
||||||
.price{
|
}
|
||||||
color: #FF1C1C;
|
.right {
|
||||||
font-weight: 700;
|
border-left: 1rpx solid #ededed;
|
||||||
}
|
|
||||||
.left{
|
|
||||||
padding-right: 26rpx;
|
|
||||||
border-right: 1rpx solid #EDEDED;
|
|
||||||
}
|
|
||||||
.right{
|
|
||||||
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
.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>
|
</style>
|
||||||
|
|
||||||
|
|||||||
@@ -163,8 +163,9 @@ function sendMsg(msg) {
|
|||||||
});
|
});
|
||||||
}
|
}
|
||||||
function toShare(item) {
|
function toShare(item) {
|
||||||
|
const hasGet=item.couponJson.giveNum-item.couponJson.leftNum
|
||||||
sendMsg({
|
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,
|
chat_coupon_id:item.id,
|
||||||
msg_type: 4,
|
msg_type: 4,
|
||||||
});
|
});
|
||||||
|
|||||||
Reference in New Issue
Block a user