Compare commits
2 Commits
134e9cbe6e
...
44a4d393c6
Author | SHA1 | Date | |
---|---|---|---|
44a4d393c6 | |||
88610e5b43 |
@ -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;">
|
||||
|
@ -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({ //清除用户信息 跳转首页
|
||||
|
@ -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: {
|
||||
// 支付方法
|
||||
|
Loading…
Reference in New Issue
Block a user