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="fz28 tc l-h-18 m-t-12">{{sku.name}}</view>
|
||||||
<view class="flex1 flex msb mac">
|
<view class="flex1 flex msb mac">
|
||||||
<view class="m-l-12 fcm">
|
<view class="m-l-12 fcm">
|
||||||
<text v-if="priceDifference(sku.id)!==0">
|
<text v-if="priceDifference(sku.id)<0">
|
||||||
{{priceDifference(sku.id) | formatPrice}}
|
{{priceDifference(sku.id) | formatPrice}}
|
||||||
</text>
|
</text>
|
||||||
|
<text v-else-if="priceDifference(sku.id)>0">
|
||||||
|
+{{priceDifference(sku.id) | formatPrice}}
|
||||||
|
</text>
|
||||||
</view>
|
</view>
|
||||||
<view class="border rad-c m-r-12" :class="isSel(sku.id)?'border-m bg-m':''"
|
<view class="border rad-c m-r-12" :class="isSel(sku.id)?'border-m bg-m':''"
|
||||||
style="width: 40rpx;height: 40rpx;">
|
style="width: 40rpx;height: 40rpx;">
|
||||||
|
@ -127,7 +127,7 @@
|
|||||||
},
|
},
|
||||||
//购物车总价
|
//购物车总价
|
||||||
total() {
|
total() {
|
||||||
return this.totalPrice(this.$store.state.cartList)
|
return Number(this.totalPrice(this.$store.state.cartList))
|
||||||
},
|
},
|
||||||
//外送费
|
//外送费
|
||||||
transportPrice() {
|
transportPrice() {
|
||||||
@ -149,7 +149,7 @@
|
|||||||
},
|
},
|
||||||
//所有总价包括 商品总价 打包费 等总和
|
//所有总价包括 商品总价 打包费 等总和
|
||||||
fullPrice() {
|
fullPrice() {
|
||||||
return this.total + this.transportPrice + this.packPrice
|
return Number(this.total) + Number(this.transportPrice) + Number(this.packPrice)
|
||||||
},
|
},
|
||||||
//用户信息
|
//用户信息
|
||||||
userInfo() {
|
userInfo() {
|
||||||
@ -182,11 +182,12 @@
|
|||||||
}).then(res => {
|
}).then(res => {
|
||||||
//订单添加成功
|
//订单添加成功
|
||||||
if (res.data.status === 1) {
|
if (res.data.status === 1) {
|
||||||
|
let fullPrice = String(this.fullPrice)
|
||||||
//清空购物车
|
//清空购物车
|
||||||
this.$store.commit('clearCartList')
|
this.$store.commit('clearCartList')
|
||||||
//跳转到支付页面
|
//跳转到支付页面
|
||||||
uni.navigateTo({
|
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) {
|
} else if (res.data.status === -1) {
|
||||||
uni.removeStorage({ //清除用户信息 跳转首页
|
uni.removeStorage({ //清除用户信息 跳转首页
|
||||||
|
@ -7,23 +7,32 @@
|
|||||||
</view>
|
</view>
|
||||||
</u-navbar>
|
</u-navbar>
|
||||||
<!-- 价格 -->
|
<!-- 价格 -->
|
||||||
<view></view>
|
<view>{{fullPrice | formatPrice}}</view>
|
||||||
<button @click="pay" type="primary" style="margin-top:200rpx;">确认支付</button>
|
<button @click="pay" type="primary" style="margin-top:200rpx;">确认支付</button>
|
||||||
</view>
|
</view>
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
<script>
|
<script>
|
||||||
|
import {
|
||||||
|
formatPrice
|
||||||
|
} from '@/utils/index.js'
|
||||||
|
|
||||||
export default {
|
export default {
|
||||||
data() {
|
data() {
|
||||||
return {
|
return {
|
||||||
order_sn: '' //订单号
|
order_sn: '', //订单号
|
||||||
|
fullPrice: 0,//总价格 包括附加费用
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
onLoad(options) {
|
onLoad(options) {
|
||||||
this.order_sn = options.order_sn; // 从提交订单页面传递过来的订单号
|
this.order_sn = options.order_sn; // 从提交订单页面传递过来的订单号
|
||||||
|
this.fullPrice = Number(options.fullPrice); // 从提交订单页面传递过来的订单号
|
||||||
},
|
},
|
||||||
computed(){
|
computed(){
|
||||||
|
|
||||||
|
},
|
||||||
|
filters: {
|
||||||
|
formatPrice, //格式化价格
|
||||||
},
|
},
|
||||||
methods: {
|
methods: {
|
||||||
// 支付方法
|
// 支付方法
|
||||||
|
Loading…
Reference in New Issue
Block a user