优化显示
parent
33e9728400
commit
4605e3538d
|
|
@ -104,9 +104,11 @@
|
||||||
<view class="footer-left">
|
<view class="footer-left">
|
||||||
<view class="price-section">
|
<view class="price-section">
|
||||||
<view class="main-price">
|
<view class="main-price">
|
||||||
|
<view class="price-left">
|
||||||
<text class="price-label">合计:</text>
|
<text class="price-label">合计:</text>
|
||||||
<text class="price-symbol">¥</text>
|
<text class="price-symbol">¥</text>
|
||||||
<text class="price-num">{{ totalAmount.toFixed(2) }}</text>
|
<text class="price-num">{{ totalAmount.toFixed(2) }}</text>
|
||||||
|
</view>
|
||||||
<view class="member-benefit" v-if="hasMemberDiscount">
|
<view class="member-benefit" v-if="hasMemberDiscount">
|
||||||
<image class="crown-icon" src="/static/service/crown-icon.png" mode="aspectFill"></image>
|
<image class="crown-icon" src="/static/service/crown-icon.png" mode="aspectFill"></image>
|
||||||
<text class="benefit-text">{{ memberLevelName }}优惠</text>
|
<text class="benefit-text">{{ memberLevelName }}优惠</text>
|
||||||
|
|
@ -182,9 +184,10 @@ export default {
|
||||||
}
|
}
|
||||||
return amount;
|
return amount;
|
||||||
},
|
},
|
||||||
// 是否有会员优惠
|
// 是否有会员优惠(现在改为:只要是会员就显示)
|
||||||
hasMemberDiscount() {
|
hasMemberDiscount() {
|
||||||
return this.menuList.some((item) => item.selected && item.discount);
|
// 只要用户信息中存在 level 对象,或者 level 名称不为空,就认为是会员
|
||||||
|
return !!(this.userInfo && this.userInfo.level && this.userInfo.level.name);
|
||||||
},
|
},
|
||||||
// 获取会员等级名称(安全访问)
|
// 获取会员等级名称(安全访问)
|
||||||
memberLevelName() {
|
memberLevelName() {
|
||||||
|
|
@ -555,7 +558,7 @@ export default {
|
||||||
|
|
||||||
// 如果选择了优惠卷,传递优惠卷ID
|
// 如果选择了优惠卷,传递优惠卷ID
|
||||||
if (this.selectedCoupon) {
|
if (this.selectedCoupon) {
|
||||||
buyParams.memberCouponId = this.selectedCoupon.id;
|
buyParams.couponId = this.selectedCoupon.id;
|
||||||
}
|
}
|
||||||
|
|
||||||
const res = await appBuy(buyParams);
|
const res = await appBuy(buyParams);
|
||||||
|
|
@ -963,8 +966,15 @@ export default {
|
||||||
flex-direction: column;
|
flex-direction: column;
|
||||||
|
|
||||||
.main-price {
|
.main-price {
|
||||||
|
display: flex;
|
||||||
|
align-items: center;
|
||||||
|
flex-wrap: wrap;
|
||||||
|
gap: 8rpx;
|
||||||
|
|
||||||
|
.price-left {
|
||||||
display: flex;
|
display: flex;
|
||||||
align-items: baseline;
|
align-items: baseline;
|
||||||
|
}
|
||||||
|
|
||||||
.price-label {
|
.price-label {
|
||||||
font-size: 26rpx;
|
font-size: 26rpx;
|
||||||
|
|
@ -986,24 +996,28 @@ export default {
|
||||||
}
|
}
|
||||||
|
|
||||||
.member-benefit {
|
.member-benefit {
|
||||||
display: flex;
|
display: inline-flex;
|
||||||
align-items: center;
|
align-items: center;
|
||||||
gap: 6rpx;
|
gap: 6rpx;
|
||||||
margin-left: 12rpx;
|
margin-left: 12rpx;
|
||||||
background: rgba(255, 107, 0, 0.1);
|
background: rgba(255, 107, 0, 0.1);
|
||||||
padding: 4rpx 10rpx;
|
padding: 4rpx 12rpx;
|
||||||
border-radius: 8rpx;
|
border-radius: 8rpx;
|
||||||
white-space: nowrap;
|
white-space: nowrap;
|
||||||
|
flex-shrink: 0;
|
||||||
|
|
||||||
.crown-icon {
|
.crown-icon {
|
||||||
width: 23rpx;
|
width: 24rpx;
|
||||||
height: 20rpx;
|
height: 24rpx;
|
||||||
|
display: block;
|
||||||
|
flex-shrink: 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
.benefit-text {
|
.benefit-text {
|
||||||
font-weight: 500;
|
font-weight: 500;
|
||||||
font-size: 20rpx;
|
font-size: 20rpx;
|
||||||
color: #ff6b00;
|
color: #ff6b00;
|
||||||
|
line-height: 1;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue