Commit 470be20f authored by 潘永坪's avatar 潘永坪

订单填写页面开发

parent 3c81b50e
<template> <template>
<u-popup :show="show" :round="20" @close="show = false" closeable> <u-popup :show="showPop" :round="20" @close="showPop = false" closeable>
<view class="son-wrap"> <view class="son-wrap">
<view class="detail-title"> <view class="detail-title">
订单明细 订单明细
...@@ -15,7 +15,7 @@ ...@@ -15,7 +15,7 @@
</view> </view>
</view> </view>
<!-- ---------------------------------------额外服务------------------------------------------- --> <!-- ---------------------------------------额外服务------------------------------------------- -->
<view class="content-box" v-for="(item, index) of choooseServiceData" :key="index"> <view class="content-box" v-for="(item, index) of chooseService" :key="index">
<text> <text>
{{ item.name }} {{ item.name }}
</text> </text>
...@@ -45,56 +45,19 @@ ...@@ -45,56 +45,19 @@
<script> <script>
export default { export default {
props: ['merchantName', 'name', 'buyNum', 'sellingPrice', 'productDepositTotal', 'chooseCouponObj', 'choooseService'], props: [
watch: { 'merchantName',
choooseService: { 'name',
handler(newValue, oldValue) { 'buyNum',
if (newValue) { 'sellingPrice',
this.choooseServiceData = this.choooseService 'productDepositTotal',
} 'chooseCouponObj',
}, 'chooseService',
deep: false, 'sellTotal'
immediate: false ],
}
},
data() { data() {
return { return {
show: false, //控制弹窗显示隐藏 showPop: false, //控制弹窗显示隐藏
extraPrice: 0, //额外服务价格
depositTotal: 0, //额外服务总押金
choooseServiceData: [] //选中的服务
}
},
computed: {
sellTotal() {
//卖价总价
let savedMoney = 0
if (this.chooseCouponObj) {
savedMoney = this.chooseCouponObj.savedMoney
}
if (this.choooseServiceData.length > 0) {
//额外服务价格
let singleMoney = 0 //单个产品总押金,用于算出总押金
this.extraPrice = 0
this.depositTotal = 0 //总押金
for (let i = 0; i < this.choooseServiceData.length; i++) {
this.extraPrice += parseFloat((this.choooseServiceData[i].sellingPrice * this.buyNum).toFixed(2))
if (this.choooseServiceData[i].depositType == 1) {
//等于1,押金金额跟数量没关系
singleMoney = this.choooseServiceData[i].deposit
this.choooseServiceData[i].depositTotal = this.choooseServiceData[i].deposit //单个产品总押金
} else if (this.choooseServiceData[i].depositType == 2) {
//等于2,押金单价乘购买数量
singleMoney = parseFloat((this.choooseServiceData[i].deposit * this.buyNum).toFixed(2))
this.choooseServiceData[i].depositTotal = parseFloat((this.choooseServiceData[i].deposit * this.buyNum).toFixed(2)) //单个产品总押金
}
this.depositTotal += singleMoney
}
} else {
this.extraPrice = 0
this.depositTotal = 0
}
return parseFloat((this.sellingPrice * this.buyNum + this.extraPrice + this.depositTotal + this.productDepositTotal - savedMoney).toFixed(2))
} }
}, },
......
This diff is collapsed.
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment