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