价格显示问题

This commit is contained in:
liuyuan
2025-04-18 17:56:33 +08:00
parent 648a993d14
commit 380ed58d17
179 changed files with 17322 additions and 2750 deletions

View File

@@ -27,14 +27,14 @@
<view class="order_top common_radius_box color_shandow goods_box">
<view class="curriulum_title_box goods_item" style=" position: relative;" v-for="(v, i) in goodsDataList">
<!-- <text class="goods_item_vip" v-if="v.isVipPrice==1&&v.vipPrice!=null&&v.vipPrice!=0">VIP优惠</text> -->
<text class="goods_item_vip" v-if="v.isVipPrice==1&&v.vipPrice!=null&&v.vipPrice!=0">VIP优惠</text>
<image class="goods_item_img" :src="v.productImages" mode="aspectFit">
</image>
<view class="normal_box">
<view class="normal_box_top">
<view class="curriulum_title">{{ v.productName }} </view>
<view class="price_box">
<!-- <view class="vip_price" v-if="v.isVipPrice==1&&v.vipPrice!=null&&v.vipPrice!=0">
<view class="vip_price" v-if="v.isVipPrice==1&&v.vipPrice!=null&&v.vipPrice!=0">
<text class="vip_price_jg">{{ v.vipPrice }}</text>
<text class="vip_price_text">VIP到手价</text>
<text class="vip_price_line">{{ v.price }}</text>
@@ -43,8 +43,8 @@
<text class="vip_price_jg">{{ v.activityPrice }}</text>
<text class="vip_price_text">活动价</text>
<text class="vip_price_line">{{ v.price }}</text>
</text> -->
<text>{{ v.price }}</text>
</text>
<text v-else>{{ v.price }}</text>
<view>
x 1
@@ -92,13 +92,13 @@
<text style="color: #aaa; margin-left: 10rpx">
(全部积分{{ initData.user.jf }})</text>
</template>
<!-- <template v-else-if="v.type == 5">
<template v-else-if="v.type == 5">
<text class="type_text_red">活动立减</text>
</template>
<template v-else-if="v.type == 6">
<text class="type_text_red">VIP专享立减</text>
</template> -->
</template>
<text v-else>{{ v.text }}</text>
</view>
<view class="right">
@@ -110,12 +110,12 @@
<template v-if="v.type == 3">
<text style="color: #fe6035"> -{{ jfNumberShow }}</text>
</template>
<!-- <template v-if="v.type == 5">
<template v-if="v.type == 5">
<text class="type_text_red">-{{districtAmount}}</text>
</template>
<template v-if="v.type == 6">
<text class="type_text_red">-{{vipPrice}}</text>
</template> -->
</template>
</view>
</view>
@@ -149,7 +149,7 @@
<text v-else> {{ v.text }}</text>
</view>
<template v-if="isDefaultCurrency">
<radio :value="v.value" color="#7dc1f0"
<radio :value="v.value" color="#7dc1f0" v-if="i == 2"
:checked="selectPayIndex == i ? true : false" @click="radioChange(i)" size="10" />
</template>
<template v-else>
@@ -213,10 +213,19 @@
<common-goods-nav :iconList="[]" :customButton="customButton" @submit="goBuyJie">
<!-- leftSlot -->
<template slot="leftSlot" slot-scope="slotProps">
<view class="price_box order_bottom_box"><text class="number">{{ number }}</text>
<text class="price">合计
<text class="total">{{ actualPayment }}</text>
<view class="price_box order_bottom_box">
<text class="price">合计:
<text class="total">
<template v-if="actualPayment>0">
{{ Number(actualPayment).toFixed(2) }}
</template>
<text style="margin: 0 4rpx;" v-if="actualPayment>0&&jfNumber>0">
+
</text>
<text v-if="jfNumber>0">{{ jfNumber }} 积分</text>
</text>
</text>
</view>
</template>
@@ -269,21 +278,32 @@ import parse from "../../uni_modules/uview-ui/libs/config/props/parse";
isDefaultCurrency: {
immediate: true,
handler(newRoute) {
if (this.isDefaultCurrency) {
if (platform == "ios") {
this.selectPayIndex = 0;
} else {
this.selectPayIndex = 0;
}
} else {
if (platform == "ios") {
this.selectPayIndex = 0;
} else {
this.selectPayIndex = 0;
}
}
this.payType = this.payList[this.selectPayIndex].type;
this.$forceUpdate();
if (this.isDefaultCurrency) {
if (platform == "ios") {
this.selectPayIndex = 0;
} else {
this.selectPayIndex = 0;
}
} else {
if (platform == "ios") {
this.selectPayIndex = 0;
} else {
this.selectPayIndex = 0;
}
}
this.payType = this.payList[this.selectPayIndex].type;
if (this.actualPayment == 0) {
var that = this;
this.payList.forEach((e, i) => {
if (e.type == 4) {
that.selectPayIndex = i;
that.payType = 4;
}
});
this.$forceUpdate();
}
this.$forceUpdate();
},
},
},
@@ -370,7 +390,7 @@ import parse from "../../uni_modules/uview-ui/libs/config/props/parse";
freightNum: "book/buyOrder/calculateTransportPrice", //运费
},
customButton: [{
width: "340rpx",
width: "300rpx",
text: "立即支付",
backgroundColor: "linear-gradient(90deg, #294a97 0%, #7dc1f0 80%)",
color: "#fff",
@@ -558,12 +578,21 @@ import parse from "../../uni_modules/uview-ui/libs/config/props/parse";
this.jfNumberShow = this.jfNumber.toFixed(2);
}
this.actualPayment = this.totalPrice - this.jfNumber + this.freightNum;
this.actualPayment = this.totalPrice - this.jfNumber - this.vipPrice - this.districtAmount + this.freightNum;
// 如果实际支付金额为0设置支付方式为默认货币
if (this.actualPayment == 0) {
this.isDefaultCurrency = true;
console.log("this.actualPayment at line 1097:", this.actualPayment);
this.isDefaultCurrency = true;
this.payList.forEach((e, i) => {
if (e.type == 4) {
this.selectPayIndex = i;
this.payType = 4;
}
});
this.$forceUpdate();
} else {
this.isDefaultCurrency = false;
this.isDefaultCurrency = false;
}
this.$forceUpdate();
});
@@ -597,17 +626,17 @@ import parse from "../../uni_modules/uview-ui/libs/config/props/parse";
},
];
//如果是活动
// if(this.goodsDataList[0].activityPrice&&this.goodsDataList[0].activityPrice>0&&!this.goodsDataList[0].vipPrice>0){
// this.priceBreakdownList.push({
// type: 5,
// })
// }
// //如果是vip
// if(this.goodsDataList[0].isVipPrice==1&&this.goodsDataList[0].vipPrice!=null&&this.goodsDataList[0].vipPrice!=0){
// this.priceBreakdownList.push({
// type: 6,
// })
// }
if(this.goodsDataList[0].activityPrice&&this.goodsDataList[0].activityPrice>0&&!this.goodsDataList[0].vipPrice>0){
this.priceBreakdownList.push({
type: 5,
})
}
//如果是vip
if(this.goodsDataList[0].isVipPrice==1&&this.goodsDataList[0].vipPrice!=null&&this.goodsDataList[0].vipPrice!=0){
this.priceBreakdownList.push({
type: 6,
})
}
var data = {
uid: this.userInfo.id,
@@ -753,8 +782,8 @@ import parse from "../../uni_modules/uview-ui/libs/config/props/parse";
if (!this.isShowAddress) {
if (this.initData.user.jf >= that.totalPrice) {
this.jfNumber = that.totalPrice;
this.jfNumberMax = that.totalPrice;
this.jfNumber = that.totalPrice - that.vipPrice - that.districtAmount;
this.jfNumberMax = that.totalPrice - that.vipPrice - that.districtAmount;
} else {
this.jfNumber = this.initData.user.jf;
this.jfNumberMax = this.initData.user.jf;
@@ -766,23 +795,13 @@ import parse from "../../uni_modules/uview-ui/libs/config/props/parse";
that.jfNumberShow = that.jfNumber.toFixed(2);
that.actualPayment = that.totalPrice - that.jfNumber;
}
that.actualPayment = that.actualPayment + that.freightNum;
that.actualPayment = that.actualPayment + that.freightNum - that.vipPrice- that.districtAmount;
} else {
that.actualPayment = that.totalPrice + that.freightNum;
that.actualPayment = that.totalPrice + that.freightNum - that.vipPrice - that.districtAmount;
}
if (this.actualPayment == 0 && !this.isShowAddress) {
this.isDefaultCurrency = true;
this.payList = [
{
text: "天医币",
imgUrl: require("@/static/icon/pay_3.png"),
type: 4,
value: "2",
},
];
this.selectPayIndex = 0;
this.payType = 4;
this.isDefaultCurrency = true;
} else {
this.isDefaultCurrency = false;
}
@@ -1212,9 +1231,8 @@ import parse from "../../uni_modules/uview-ui/libs/config/props/parse";
.price {
width: auto;
font-size: 30rpx;
font-size: 28rpx;
font-weight: 600;
float: right;
margin-right: 10rpx;
color: #333;
}
@@ -1378,7 +1396,6 @@ import parse from "../../uni_modules/uview-ui/libs/config/props/parse";
.number {
font-size: 26rpx;
margin-right: 15rpx;
margin-top: 5rpx;
}
.price {
@@ -1395,7 +1412,6 @@ import parse from "../../uni_modules/uview-ui/libs/config/props/parse";
width: calc(100% - 220rpx);
height: auto;
position: relative;
// overflow: hidden;
}
}
@@ -1409,6 +1425,7 @@ import parse from "../../uni_modules/uview-ui/libs/config/props/parse";
.order_bottom_box {
display: flex;
align-items: center;
justify-content: center;
}
.pay_box {