|
|
@@ -97,7 +97,7 @@
|
|
|
<tui-list-cell class="line-cell" :hover="false" :arrow="false">
|
|
|
<view class="tui-title">配送方式</view>
|
|
|
<button @tap="setSendType(0)" class="admin-button-com middle" :class="form.sendType == 0 ? 'blue' : 'default'">出车</button>
|
|
|
- <button @tap="setSendType(1)" class="admin-button-com middle" :class="form.sendType == 1 ? 'blue' : 'default'">客户自取</button>
|
|
|
+ <button @tap="setSendType(1)" class="admin-button-com middle" :class="form.sendType == 1 ? 'blue' : 'default'">自取</button>
|
|
|
<button @click="setSendType(2)" class="admin-button-com middle" :class="form.sendType == 2 ? 'blue' : 'default'">发快递</button>
|
|
|
</tui-list-cell>
|
|
|
|
|
|
@@ -134,11 +134,18 @@
|
|
|
</tui-list-cell>
|
|
|
-->
|
|
|
|
|
|
+ <tui-list-cell class="line-cell" :hover="false" :arrow="false" v-if="(form.sendType == 0 || form.sendType == 2) && Number(form.packCost)>0" >
|
|
|
+ <view class="tui-title">
|
|
|
+ <text>打包费</text>
|
|
|
+ </view>
|
|
|
+ <text style="color: #3385FF">¥{{parseFloat(form.packCost)}}</text>
|
|
|
+ </tui-list-cell>
|
|
|
+
|
|
|
<tui-list-cell class="line-cell" :hover="false" :arrow="false" >
|
|
|
<view class="tui-title">
|
|
|
<text>合计金额</text>
|
|
|
</view>
|
|
|
- <text style="color: #3385FF">{{parseFloat(finalPrice)}}</text>
|
|
|
+ <text style="color: #3385FF">¥{{parseFloat(finalPrice)}}</text>
|
|
|
</tui-list-cell>
|
|
|
|
|
|
<tui-list-cell class="line-cell" :hover="false" :arrow="false" >
|
|
|
@@ -235,6 +242,7 @@ export default {
|
|
|
sendDate: "",
|
|
|
sendTimeWant: "",
|
|
|
sendCost: "",
|
|
|
+ packCost:0,
|
|
|
customId: "",
|
|
|
product: "",
|
|
|
remark:"",
|
|
|
@@ -259,13 +267,13 @@ export default {
|
|
|
|
|
|
this.kdType = option.kdType
|
|
|
|
|
|
- if (!this.getMerchantInfo) {
|
|
|
- this.initMerchantInfo().then((data) => {
|
|
|
- uni.setNavigationBarTitle({ title: data.name, })
|
|
|
- });
|
|
|
- } else {
|
|
|
- uni.setNavigationBarTitle({ title: this.getMerchantInfo.name, })
|
|
|
- }
|
|
|
+ let that = this
|
|
|
+ this.initMerchantInfo().then((data) => {
|
|
|
+
|
|
|
+ uni.setNavigationBarTitle({ title: data.name })
|
|
|
+ that.form.packCost = data.shopInfo.packCost?parseFloat(data.shopInfo.packCost):0
|
|
|
+
|
|
|
+ })
|
|
|
|
|
|
//默认出车
|
|
|
this.setSendType(0)
|
|
|
@@ -324,7 +332,13 @@ export default {
|
|
|
...mapGetters(["getMerchantInfo", "getLoginInfo"]),
|
|
|
finalPrice(){
|
|
|
let totalPrice = this.allPrice.toFixed(2)
|
|
|
- let finalPrice = (Number(totalPrice) + Number(this.form.sendCost)).toFixed(2)
|
|
|
+ let finalPrice = Number(totalPrice)
|
|
|
+ if(this.form.sendType == 2){
|
|
|
+ finalPrice = Number(finalPrice) + Number(this.form.sendCost)
|
|
|
+ }
|
|
|
+ if(this.form.sendType == 0 || this.form.sendType == 2){
|
|
|
+ finalPrice = finalPrice + Number(this.form.packCost)
|
|
|
+ }
|
|
|
let currentPrice = parseFloat(finalPrice)
|
|
|
this.modifyPrice = currentPrice
|
|
|
return currentPrice
|
|
|
@@ -364,35 +378,11 @@ export default {
|
|
|
this.form.payWay = payWay
|
|
|
},
|
|
|
setSendType (type) {
|
|
|
- this.form.sendType = type;
|
|
|
- if (type === 2) {
|
|
|
- this.form.sendCost = "";
|
|
|
+ this.form.sendType = type
|
|
|
+ if (type !== 2) {
|
|
|
+ this.form.sendCost = ""
|
|
|
}
|
|
|
},
|
|
|
- changeCustomerFn (info) {
|
|
|
- const product = this.selectList.map((ele) => {
|
|
|
- return {
|
|
|
- productId: ele.id,
|
|
|
- bigNum: ele.bigCount,
|
|
|
- smallNum: ele.smallCount,
|
|
|
- classId: ele.classId,
|
|
|
- itemId: ele.itemId,
|
|
|
- };
|
|
|
- });
|
|
|
- let params = {
|
|
|
- customId: info.id,
|
|
|
- product: JSON.stringify(product),
|
|
|
- province: info.province,
|
|
|
- city: info.city,
|
|
|
- address: info.address,
|
|
|
- floor: info.floor,
|
|
|
- long: info.long,
|
|
|
- lat: info.lat,
|
|
|
- };
|
|
|
- this.form.sendCost = '';
|
|
|
- this.form.customId = info.id;
|
|
|
- this.form.customName = info.name;
|
|
|
- },
|
|
|
confirmSubmit () {
|
|
|
let self = this;
|
|
|
let rules = [
|
|
|
@@ -431,9 +421,6 @@ export default {
|
|
|
await this.initMerchantInfo();
|
|
|
}
|
|
|
formData.shopId = this.getMerchantInfo.id;
|
|
|
- if (formData.sendType == 2) {
|
|
|
- formData.sendCost = "";
|
|
|
- }
|
|
|
if(Number(this.modifyPrice) <= 0){
|
|
|
this.$msg('收款金额必须大于0');
|
|
|
return false
|