|
@@ -1,6 +1,6 @@
|
|
|
<template>
|
|
<template>
|
|
|
- <view class="affirm-page">
|
|
|
|
|
- <view class="affirm-view overscroll">
|
|
|
|
|
|
|
+ <view class="app-main app-content">
|
|
|
|
|
+ <view class="affirm-view">
|
|
|
<form>
|
|
<form>
|
|
|
<view class="module-com">
|
|
<view class="module-com">
|
|
|
<view class="commodity-view">
|
|
<view class="commodity-view">
|
|
@@ -81,25 +81,36 @@
|
|
|
<text style="color: #3385FF">¥{{ modifyPrice }}</text>
|
|
<text style="color: #3385FF">¥{{ modifyPrice }}</text>
|
|
|
</tui-list-cell>
|
|
</tui-list-cell>
|
|
|
|
|
|
|
|
- <tui-list-cell class="line-cell" :hover="false" :arrow="true">
|
|
|
|
|
- <view class="tui-title ">配送时间</view>
|
|
|
|
|
- <picker mode="date" :value="sendTimeWant" @change="bindDateChange" style="width:400upx;">
|
|
|
|
|
- <view class="uni-input">{{sendTimeWant || '今天'}}</view>
|
|
|
|
|
|
|
+ <tui-list-cell class="line-cell" :hover="false" :arrow="true" v-if="form.sendType == 2">
|
|
|
|
|
+ <view class="tui-title ">配送日期</view>
|
|
|
|
|
+ <picker mode="date" :value="form.reachDate" @change="selTimeFn" class="tui-input">
|
|
|
|
|
+ <div v-if="form.reachDate">{{ form.reachDate }}</div>
|
|
|
|
|
+ <div v-else>今天</div>
|
|
|
|
|
+ </picker>
|
|
|
|
|
+ </tui-list-cell>
|
|
|
|
|
+
|
|
|
|
|
+ <tui-list-cell class="line-cell" :hover="false" :arrow="true" v-if="form.sendType == 2">
|
|
|
|
|
+ <div class="tui-title">配送时间</div>
|
|
|
|
|
+ <picker mode="multiSelector" :value="form.reachPeriod" :range="timeOptions" @change="bindTimeChange">
|
|
|
|
|
+ <view class="uni-input" style="width:450upx;">{{form.reachPeriod}}<text style="margin-left:10upx;">前</text></view>
|
|
|
</picker>
|
|
</picker>
|
|
|
</tui-list-cell>
|
|
</tui-list-cell>
|
|
|
|
|
|
|
|
<tui-list-cell class="line-cell" :hover="false" :arrow="false">
|
|
<tui-list-cell class="line-cell" :hover="false" :arrow="false">
|
|
|
- <textarea style="height: 100upx" v-model="remark" placeholder="这里写备注"/>
|
|
|
|
|
|
|
+ <textarea style="height: 100upx" v-model="form.remark" placeholder="这里写备注"/>
|
|
|
</tui-list-cell>
|
|
</tui-list-cell>
|
|
|
|
|
|
|
|
</view>
|
|
</view>
|
|
|
|
|
|
|
|
</form>
|
|
</form>
|
|
|
|
|
+
|
|
|
</view>
|
|
</view>
|
|
|
|
|
+
|
|
|
<view class="under-bar">
|
|
<view class="under-bar">
|
|
|
<view class="price-view"> </view>
|
|
<view class="price-view"> </view>
|
|
|
<button class="admin-button-com blue middle" style="border:none;height:68upx;margin-right:38upx;" @click="confirmForm">提交</button>
|
|
<button class="admin-button-com blue middle" style="border:none;height:68upx;margin-right:38upx;" @click="confirmForm">提交</button>
|
|
|
</view>
|
|
</view>
|
|
|
|
|
+
|
|
|
</view>
|
|
</view>
|
|
|
</template>
|
|
</template>
|
|
|
<script>
|
|
<script>
|
|
@@ -109,7 +120,7 @@ import { buyItem,freight } from "@/api/order"
|
|
|
import { currentInfo } from "@/api/user"
|
|
import { currentInfo } from "@/api/user"
|
|
|
import { mapActions, mapGetters } from "vuex";
|
|
import { mapActions, mapGetters } from "vuex";
|
|
|
export default {
|
|
export default {
|
|
|
- name: "BillingAffirm",
|
|
|
|
|
|
|
+ name: "affirmGhs",
|
|
|
components: {
|
|
components: {
|
|
|
TuiListCell
|
|
TuiListCell
|
|
|
},
|
|
},
|
|
@@ -121,36 +132,34 @@ export default {
|
|
|
autoLoad: false,
|
|
autoLoad: false,
|
|
|
ghsInfo:'',
|
|
ghsInfo:'',
|
|
|
sendTimeWant:'',
|
|
sendTimeWant:'',
|
|
|
- remark:'',
|
|
|
|
|
form: {
|
|
form: {
|
|
|
- debt:1,
|
|
|
|
|
- shopId: "",
|
|
|
|
|
- shopName: "",
|
|
|
|
|
- receiveProvince: "",
|
|
|
|
|
- receiveCity: "",
|
|
|
|
|
- receiveFloor: "",
|
|
|
|
|
- receiveAddress: "",
|
|
|
|
|
- receiveLong: "",
|
|
|
|
|
- receiveLat: "",
|
|
|
|
|
|
|
+ reachDate: "",
|
|
|
|
|
+ reachPeriod: "12:00",
|
|
|
|
|
+ province: "",
|
|
|
|
|
+ city: "",
|
|
|
|
|
+ floor: "",
|
|
|
|
|
+ address: "",
|
|
|
|
|
+ long: "",
|
|
|
|
|
+ lat: "",
|
|
|
sendType: 2,
|
|
sendType: 2,
|
|
|
- sendSide: "2",
|
|
|
|
|
- sendDate: "",
|
|
|
|
|
- sendTimeWant: "",
|
|
|
|
|
- sendCost: "",
|
|
|
|
|
- customId: "",
|
|
|
|
|
- product: "",
|
|
|
|
|
- packCost:0
|
|
|
|
|
|
|
+ remark:'',
|
|
|
|
|
+ packCost:0,
|
|
|
|
|
+ sendCost:0,
|
|
|
|
|
+ showAddress:''
|
|
|
},
|
|
},
|
|
|
showCustomer: false,
|
|
showCustomer: false,
|
|
|
today:'',
|
|
today:'',
|
|
|
monthLater:'',
|
|
monthLater:'',
|
|
|
- modifyPrice:0,
|
|
|
|
|
userInfo:{
|
|
userInfo:{
|
|
|
lat:'',
|
|
lat:'',
|
|
|
long:'',
|
|
long:'',
|
|
|
fullAddress:'',
|
|
fullAddress:'',
|
|
|
showAddress:''
|
|
showAddress:''
|
|
|
- }
|
|
|
|
|
|
|
+ },
|
|
|
|
|
+ timeOptions: [
|
|
|
|
|
+ ['00', '01', '02','03','04','05','06','07','08','09','10','11','12','13', '14','15','16','17','18','19','20','21','22','23'],
|
|
|
|
|
+ ['00', '05', '10','15','20','25','30','35','40','45','50','55']
|
|
|
|
|
+ ]
|
|
|
};
|
|
};
|
|
|
},
|
|
},
|
|
|
onShow() {
|
|
onShow() {
|
|
@@ -174,23 +183,53 @@ export default {
|
|
|
}
|
|
}
|
|
|
}
|
|
}
|
|
|
this.list = list
|
|
this.list = list
|
|
|
- this.calcPrice()
|
|
|
|
|
|
|
+
|
|
|
|
|
+ this.getUserInfo()
|
|
|
|
|
+
|
|
|
},
|
|
},
|
|
|
computed: {
|
|
computed: {
|
|
|
- ...mapGetters(["getLoginInfo"])
|
|
|
|
|
|
|
+ ...mapGetters(["getLoginInfo"]),
|
|
|
|
|
+ modifyPrice(){
|
|
|
|
|
+ let price = this.allPrice.toFixed(2)
|
|
|
|
|
+ if(this.form.sendType == 2){
|
|
|
|
|
+ let sendCost = parseFloat(Number(this.form.sendCost))
|
|
|
|
|
+ price = Number(price) + Number(sendCost)
|
|
|
|
|
+ }
|
|
|
|
|
+ price = parseFloat(price)
|
|
|
|
|
+ return price
|
|
|
|
|
+ },
|
|
|
},
|
|
},
|
|
|
methods: {
|
|
methods: {
|
|
|
...mapActions(["initMerchantInfo"]),
|
|
...mapActions(["initMerchantInfo"]),
|
|
|
|
|
+ selTimeFn(e) {
|
|
|
|
|
+ this.form.reachDate = e.detail.value;
|
|
|
|
|
+ },
|
|
|
|
|
+ bindTimeChange(event){
|
|
|
|
|
+ let val = event.detail.value
|
|
|
|
|
+ let before = Number(val[0])
|
|
|
|
|
+ let after = Number(val[1])
|
|
|
|
|
+ let timeOptions = this.timeOptions
|
|
|
|
|
+ this.form.reachPeriod = timeOptions[0][before]+':'+timeOptions[1][after]
|
|
|
|
|
+ },
|
|
|
init(){
|
|
init(){
|
|
|
- this.calcFreight()
|
|
|
|
|
-
|
|
|
|
|
|
|
+ this.getUserInfo()
|
|
|
|
|
+ },
|
|
|
|
|
+ getUserInfo(){
|
|
|
currentInfo().then(res=>{
|
|
currentInfo().then(res=>{
|
|
|
let that = this
|
|
let that = this
|
|
|
if(res.code == 1){
|
|
if(res.code == 1){
|
|
|
that.userInfo = res.data.info
|
|
that.userInfo = res.data.info
|
|
|
|
|
+ that.form.province = that.userInfo.province
|
|
|
|
|
+ that.form.city = that.userInfo.city
|
|
|
|
|
+ that.form.floor = that.userInfo.floor
|
|
|
|
|
+ that.form.address = that.userInfo.address
|
|
|
|
|
+ that.form.long = that.userInfo.long
|
|
|
|
|
+ that.form.lat = that.userInfo.lat
|
|
|
|
|
+ that.form.showAddress = that.userInfo.showAddress
|
|
|
|
|
+
|
|
|
|
|
+ that.calcSendCost()
|
|
|
}
|
|
}
|
|
|
})
|
|
})
|
|
|
-
|
|
|
|
|
},
|
|
},
|
|
|
modifyAddress(){
|
|
modifyAddress(){
|
|
|
this.$util.pageTo({ url: '/pages/user/modify'})
|
|
this.$util.pageTo({ url: '/pages/user/modify'})
|
|
@@ -199,10 +238,11 @@ export default {
|
|
|
this.form.sendType = num
|
|
this.form.sendType = num
|
|
|
if(num == 2){
|
|
if(num == 2){
|
|
|
//计算运费
|
|
//计算运费
|
|
|
- this.calcFreight()
|
|
|
|
|
|
|
+ this.calcSendCost()
|
|
|
}
|
|
}
|
|
|
},
|
|
},
|
|
|
- calcFreight() {
|
|
|
|
|
|
|
+ calcSendCost() {
|
|
|
|
|
+ let that = this
|
|
|
let weight = 0
|
|
let weight = 0
|
|
|
if(!this.$util.isEmpty(this.selectList)){
|
|
if(!this.$util.isEmpty(this.selectList)){
|
|
|
this.selectList.forEach((item,idx,arr) => {
|
|
this.selectList.forEach((item,idx,arr) => {
|
|
@@ -217,24 +257,13 @@ export default {
|
|
|
})
|
|
})
|
|
|
}
|
|
}
|
|
|
weight = Number(weight).toFixed(2)
|
|
weight = Number(weight).toFixed(2)
|
|
|
-
|
|
|
|
|
- let params = {
|
|
|
|
|
- account: this.options.account,
|
|
|
|
|
- weight:weight
|
|
|
|
|
- };
|
|
|
|
|
- freight(params).then(res => {
|
|
|
|
|
|
|
+ freight({weight:weight,lat:that.userInfo.lat,long:that.userInfo.long}).then(res => {
|
|
|
if(res.code == 1){
|
|
if(res.code == 1){
|
|
|
- this.form.sendCost = res.data.fee?parseFloat(res.data.fee):0
|
|
|
|
|
|
|
+ that.form.sendCost = res.data.fee?parseFloat(Number(res.data.fee)):0
|
|
|
}
|
|
}
|
|
|
});
|
|
});
|
|
|
},
|
|
},
|
|
|
- calcPrice(){
|
|
|
|
|
- let allPrice = this.allPrice.toFixed(2)
|
|
|
|
|
- this.modifyPrice = Number(allPrice)
|
|
|
|
|
- this.modifyPrice = parseFloat(this.modifyPrice)
|
|
|
|
|
- },
|
|
|
|
|
confirmForm() {
|
|
confirmForm() {
|
|
|
- let that = this
|
|
|
|
|
const product = this.selectList.map(ele => {
|
|
const product = this.selectList.map(ele => {
|
|
|
let unitType = 0
|
|
let unitType = 0
|
|
|
let num = ele.bigCount
|
|
let num = ele.bigCount
|
|
@@ -244,7 +273,7 @@ export default {
|
|
|
}
|
|
}
|
|
|
return { productId: ele.id, num:num,ptItemId:ele.itemId,property:1,unitType:unitType,property:1};
|
|
return { productId: ele.id, num:num,ptItemId:ele.itemId,property:1,unitType:unitType,property:1};
|
|
|
});
|
|
});
|
|
|
- let params = { product: JSON.stringify(product),sendType:that.form.sendType }
|
|
|
|
|
|
|
+ let params = { product: JSON.stringify(product),...this.form }
|
|
|
if(this.$util.isEmpty(this.userInfo.lat) || this.$util.isEmpty(this.userInfo.long)){
|
|
if(this.$util.isEmpty(this.userInfo.lat) || this.$util.isEmpty(this.userInfo.long)){
|
|
|
this.$msg('请完善地址')
|
|
this.$msg('请完善地址')
|
|
|
return false
|
|
return false
|
|
@@ -269,15 +298,12 @@ export default {
|
|
|
.admin-button-com {
|
|
.admin-button-com {
|
|
|
margin-right: 20upx;
|
|
margin-right: 20upx;
|
|
|
}
|
|
}
|
|
|
-.affirm-page {
|
|
|
|
|
- position: relative;
|
|
|
|
|
- height: 100%;
|
|
|
|
|
- display: flex;
|
|
|
|
|
- flex-direction: column;
|
|
|
|
|
|
|
+.app-content {
|
|
|
.affirm-view {
|
|
.affirm-view {
|
|
|
flex: 1;
|
|
flex: 1;
|
|
|
padding: 20upx;
|
|
padding: 20upx;
|
|
|
background-color: #f0f2f6;
|
|
background-color: #f0f2f6;
|
|
|
|
|
+ margin-bottom:90upx;
|
|
|
.commodity-view {
|
|
.commodity-view {
|
|
|
display: flex;
|
|
display: flex;
|
|
|
flex-direction: column;
|
|
flex-direction: column;
|
|
@@ -393,6 +419,8 @@ export default {
|
|
|
}
|
|
}
|
|
|
}
|
|
}
|
|
|
.under-bar {
|
|
.under-bar {
|
|
|
|
|
+ position:fixed;
|
|
|
|
|
+ bottom:0upx;
|
|
|
display: flex;
|
|
display: flex;
|
|
|
justify-content: space-between;
|
|
justify-content: space-between;
|
|
|
align-items: center;
|
|
align-items: center;
|