Compare commits

...

2 Commits

Author SHA1 Message Date
44a4d393c6 【类 型】:fix
【原  因】:传值到 付款页面  由于提前清空购物车  导致商品价格没有累计
【过  程】:清空购物车前 记录商品总价格 到一个变量
【影  响】:

# 类型 包含:
# feat:新功能(feature)
# fix:修补bug
# docs:文档(documentation)
# style: 格式(不影响代码运行的变动)
# refactor:重构(即不是新增功能,也不是修改bug的代码变动)
# test:增加测试
# chore:构建过程或辅助工具的变动
2024-12-12 19:40:48 +08:00
88610e5b43 【类 型】:fix
【原  因】:
【过  程】:商品详情页 sku单价高的 在差价前添加一个正号
【影  响】:

# 类型 包含:
# feat:新功能(feature)
# fix:修补bug
# docs:文档(documentation)
# style: 格式(不影响代码运行的变动)
# refactor:重构(即不是新增功能,也不是修改bug的代码变动)
# test:增加测试
# chore:构建过程或辅助工具的变动
2024-12-12 17:10:01 +08:00
3 changed files with 19 additions and 6 deletions

View File

@ -30,9 +30,12 @@
<view class="fz28 tc l-h-18 m-t-12">{{sku.name}}</view>
<view class="flex1 flex msb mac">
<view class="m-l-12 fcm">
<text v-if="priceDifference(sku.id)!==0">
<text v-if="priceDifference(sku.id)<0">
{{priceDifference(sku.id) | formatPrice}}
</text>
<text v-else-if="priceDifference(sku.id)>0">
+{{priceDifference(sku.id) | formatPrice}}
</text>
</view>
<view class="border rad-c m-r-12" :class="isSel(sku.id)?'border-m bg-m':''"
style="width: 40rpx;height: 40rpx;">

View File

@ -127,7 +127,7 @@
},
//
total() {
return this.totalPrice(this.$store.state.cartList)
return Number(this.totalPrice(this.$store.state.cartList))
},
//
transportPrice() {
@ -149,7 +149,7 @@
},
//
fullPrice() {
return this.total + this.transportPrice + this.packPrice
return Number(this.total) + Number(this.transportPrice) + Number(this.packPrice)
},
//
userInfo() {
@ -182,11 +182,12 @@
}).then(res => {
//
if (res.data.status === 1) {
let fullPrice = String(this.fullPrice)
//
this.$store.commit('clearCartList')
//
uni.navigateTo({
url: `/pages/shop/pay?order_sn=${res.data.order_sn}`
url: `/pages/shop/pay?order_sn=${res.data.order_sn}&fullPrice=${fullPrice}`
});
} else if (res.data.status === -1) {
uni.removeStorage({ //

View File

@ -7,23 +7,32 @@
</view>
</u-navbar>
<!-- 价格 -->
<view></view>
<view>{{fullPrice | formatPrice}}</view>
<button @click="pay" type="primary" style="margin-top:200rpx;">确认支付</button>
</view>
</template>
<script>
import {
formatPrice
} from '@/utils/index.js'
export default {
data() {
return {
order_sn: '' //
order_sn: '', //
fullPrice: 0,//
}
},
onLoad(options) {
this.order_sn = options.order_sn; //
this.fullPrice = Number(options.fullPrice); //
},
computed(){
},
filters: {
formatPrice, //
},
methods: {
//