修改优惠券显示有问题

master
lemon橪 2022-04-19 14:08:57 +08:00
parent b0714ab27e
commit c6e04bc4b9
2 changed files with 184 additions and 184 deletions

View File

@ -6,7 +6,7 @@ export default {
downloadLink: "https://pickmall.cn/download-page/index.html", //下载地址下载app的地址 downloadLink: "https://pickmall.cn/download-page/index.html", //下载地址下载app的地址
shareLink: "https://m-b2b2c.pickmall.cn", //分享地址也就是在h5中默认的复制地址 shareLink: "https://m-b2b2c.pickmall.cn", //分享地址也就是在h5中默认的复制地址
appid: "wx6f10f29075dc1b0b", //小程序唯一凭证,即 AppID可在「微信公众平台 - 设置 - 开发设置」页中获得。(需要已经成为开发者,且帐号没有异常状态) appid: "wx6f10f29075dc1b0b", //小程序唯一凭证,即 AppID可在「微信公众平台 - 设置 - 开发设置」页中获得。(需要已经成为开发者,且帐号没有异常状态)
aMapKey: "d649892b3937a5ad20b76dacb2bcb5bd", //在高德中申请web端key aMapKey: "d649892b3937a5ad20b76dacb2bcb5bd", //在高德中申请Web服务key
scanAuthNavigation:['https://m-b2b2c.pickmall.cn/'], //扫码认证跳转域名配置 会根据此处配置的路由进行跳转 scanAuthNavigation:['https://m-b2b2c.pickmall.cn/'], //扫码认证跳转域名配置 会根据此处配置的路由进行跳转
iosAppId:"id1564638363", //AppStore的应用地址id 具体在分享->拷贝链接中查看 iosAppId:"id1564638363", //AppStore的应用地址id 具体在分享->拷贝链接中查看
logo:"https://lilishop-oss.oss-cn-beijing.aliyuncs.com/4c864e133c2944efad1f7282ac8a3b9e.png", //logo地址 logo:"https://lilishop-oss.oss-cn-beijing.aliyuncs.com/4c864e133c2944efad1f7282ac8a3b9e.png", //logo地址

View File

@ -1,184 +1,184 @@
<template> <template>
<view class="wrapper"> <view class="wrapper">
<div class="coupon-empty" v-if="!res"></div> <div class="coupon-empty" v-if="!res"></div>
<view class="coupon-List" v-for="(item, index) in couponRes" :key="index"> <view class="coupon-List" v-for="(item, index) in couponRes" :key="index">
<view class="coupon-item"> <view class="coupon-item">
<view class="top"> <view class="top">
<div class="price"> <div class="price">
<span v-if="item.couponType == 'DISCOUNT'">{{ item.couponDiscount }}</span> <span v-if="item.couponType == 'DISCOUNT'">{{ item.couponDiscount }}</span>
<span v-if="item.couponType == 'PRICE'">{{ item.price | unitPrice }}</span> <span v-if="item.couponType == 'PRICE'">{{ item.price | unitPrice }}</span>
</div> </div>
<view class="text"> <view class="text">
<div class="coupon-List-title"> <div class="coupon-List-title">
<view v-if="item.scopeType"> <view v-if="item.scopeType">
<span v-if="item.scopeType == 'ALL' && item.id == 'platform'" <span v-if="item.scopeType == 'ALL' && item.id == 'platform'"></span>
>全平台</span <span v-if="item.scopeType == 'PORTION_CATEGORY'"></span>
> <view v-else>{{
<span v-if="item.scopeType == 'PORTION_CATEGORY'"></span> item.storeName == "platform" ? "全平台" : item.storeName + "店铺"
<view v-else }}使用</view>
>{{ </view>
item.storeName == "platform" ? "全平台" : item.storeName + "店铺" </div>
}}使用</view <div>{{ item.consumeThreshold | unitPrice }}可用</div>
> </view>
</view> <view class="lingqu-btn" @click="getCoupon(item, index)">
</div> <div :class="yhqFlag[index] ? 'cur' : ''">
<div>{{ item.consumeThreshold | unitPrice }}可用</div> {{ yhqFlag[index] ? "已领取或领完" : "立即领取" }}
</view> </div>
<view class="lingqu-btn" @click="getCoupon(item, index)"> </view>
<div :class="yhqFlag[index] ? 'cur' : ''"> </view>
{{ yhqFlag[index] ? "已领取或领完" : "立即领取" }} <view class="line"></view>
</div> <view class="time">{{ item.startTime / 1000 | unixToDate }} - {{ item.endTime / 1000 | unixToDate }}</view>
</view> </view>
</view> </view>
<view class="line"></view> </view>
<view class="time">{{ item.startTime }} - {{ item.endTime }}</view>
</view>
</view>
</view>
</template> </template>
<script> <script>
export default { export default {
data() { data() {
return { return {
yhqFlag: [], // yhqFlag: [], //
couponRes: {}, couponRes: [],
}; };
}, },
props: { props: {
res: { res: {
type: null, type: null,
default: "", default: "",
}, },
}, },
watch: { watch: {
res: { res: {
handler() { handler() {
if (this.res && this.res.length != 0) { if (this.res && this.res.length != 0) {
Object.keys(this.res).forEach((item) => { Object.keys(this.res).forEach((item) => {
let key = item.split("-")[0]; let key = item.split("-")[0];
if (key === "COUPON") { if (key === "COUPON") {
this.couponRes[item] = this?.res[item]; this.couponRes.push(this?.res[item]);
}
}); }
} });
}, }
immediate: true, },
}, immediate: true,
}, },
methods: { },
// methods: {
getCoupon(item, index) { //
this.yhqFlag[index] = true; getCoupon(item, index) {
this.$emit("getCoupon", item); this.yhqFlag[index] = true;
}, this.$emit("getCoupon", item);
}, },
}; },
};
</script> </script>
<style lang="scss" scoped> <style lang="scss" scoped>
.coupon-item { .coupon-item {
width: 100%; width: 100%;
height: 100%; height: 100%;
display: flex; display: flex;
flex-direction: column; flex-direction: column;
justify-content: space-between; justify-content: space-between;
} }
.coupon-List {
display: flex;
flex-direction: column;
height: 230rpx;
background: #e9ebfb;
margin: 30rpx 0;
padding: 10rpx 30rpx;
.line { .coupon-List {
height: 1px; display: flex;
background: #fff; flex-direction: column;
margin: 0 20rpx; height: 230rpx;
position: relative; background: #e9ebfb;
margin: 30rpx 0;
padding: 10rpx 30rpx;
&:before, .line {
&:after { height: 1px;
content: ""; background: #fff;
display: block; margin: 0 20rpx;
width: 15rpx; position: relative;
height: 30rpx;
background: #fff;
position: absolute;
top: -15rpx;
}
&:before { &:before,
left: -50rpx; &:after {
} content: "";
display: block;
width: 15rpx;
height: 30rpx;
background: #fff;
position: absolute;
top: -15rpx;
}
&:after { &:before {
right: -50rpx; left: -50rpx;
} }
}
.time { &:after {
flex: 1; right: -50rpx;
font-size: 24rpx; }
align-items: center; }
display: flex;
align-items: center;
}
}
.top { .time {
height: 140rpx; flex: 1;
display: flex; font-size: 24rpx;
align-items: center;
display: flex;
align-items: center;
}
}
.price { .top {
width: 33%; height: 140rpx;
justify-content: center; display: flex;
color: #6772e5;
font-size: 40rpx;
display: flex;
height: 100%; .price {
align-items: center; width: 33%;
span { justify-content: center;
font-size: 50rpx; color: #6772e5;
} font-size: 40rpx;
} display: flex;
.text { height: 100%;
width: 33%; align-items: center;
display: flex;
flex-direction: column;
justify-content: center;
font-size: 26rpx;
color: 333;
margin-left: 40rpx;
.coupon-List-title { span {
font-size: 30rpx; font-size: 50rpx;
font-weight: bold; }
} }
}
.lingqu-btn { .text {
display: flex; width: 33%;
align-items: center; display: flex;
margin-left: 40rpx; flex-direction: column;
text { justify-content: center;
width: 140rpx; font-size: 26rpx;
height: 40rpx; color: 333;
text-align: center; margin-left: 40rpx;
line-height: 40rpx;
color: #fff;
background: #6772e5;
border-radius: 5px;
font-size: 26rpx;
&.cur { .coupon-List-title {
background: none; font-size: 30rpx;
transform: rotate(45deg) translate(10rpx, -46rpx); font-weight: bold;
} }
} }
}
} .lingqu-btn {
display: flex;
align-items: center;
margin-left: 40rpx;
text {
width: 140rpx;
height: 40rpx;
text-align: center;
line-height: 40rpx;
color: #fff;
background: #6772e5;
border-radius: 5px;
font-size: 26rpx;
&.cur {
background: none;
transform: rotate(45deg) translate(10rpx, -46rpx);
}
}
}
}
</style> </style>