|
@@ -70,7 +70,7 @@
|
|
|
<text v-else style="color: #3385FF;width:100%;">到店取货,没有配送费</text>
|
|
<text v-else style="color: #3385FF;width:100%;">到店取货,没有配送费</text>
|
|
|
</view>
|
|
</view>
|
|
|
<view v-if="form.sendType == 2">
|
|
<view v-if="form.sendType == 2">
|
|
|
- <text style="color: #3385FF;width:100%;">请跑腿送送货,有配送费</text>
|
|
|
|
|
|
|
+ <text style="color: #3385FF;width:100%;">请跑腿送,有跑腿费</text>
|
|
|
</view>
|
|
</view>
|
|
|
</tui-list-cell>
|
|
</tui-list-cell>
|
|
|
|
|
|
|
@@ -78,7 +78,7 @@
|
|
|
<view class="tui-title">收花地址</view>
|
|
<view class="tui-title">收花地址</view>
|
|
|
<view v-if="!$util.isEmpty(userInfo.lat) && !$util.isEmpty(userInfo.long)">
|
|
<view v-if="!$util.isEmpty(userInfo.lat) && !$util.isEmpty(userInfo.long)">
|
|
|
<view><text>{{userInfo.fullAddress}}</text></view>
|
|
<view><text>{{userInfo.fullAddress}}</text></view>
|
|
|
- <view><text>{{userInfo.showAddress}}</text></view>
|
|
|
|
|
|
|
+ <view v-if="userInfo.showAddress!=userInfo.fullAddress" style="color:#848181;"><text>{{userInfo.showAddress}}</text></view>
|
|
|
</view>
|
|
</view>
|
|
|
<view v-else>
|
|
<view v-else>
|
|
|
<view><text style="color:#CCCCCC;">请填写地址</text></view>
|
|
<view><text style="color:#CCCCCC;">请填写地址</text></view>
|
|
@@ -135,9 +135,8 @@
|
|
|
<script>
|
|
<script>
|
|
|
import TuiListCell from "@/components/plugin/list-cell";
|
|
import TuiListCell from "@/components/plugin/list-cell";
|
|
|
import productMins from "@/mixins/cgProduct";
|
|
import productMins from "@/mixins/cgProduct";
|
|
|
-import { buyItem,freight,newFreight } from "@/api/order"
|
|
|
|
|
|
|
+import { buyItem,newFreight } from "@/api/order"
|
|
|
import { currentInfo } from "@/api/user"
|
|
import { currentInfo } from "@/api/user"
|
|
|
-// import { mapActions, mapGetters } from "vuex";
|
|
|
|
|
export default {
|
|
export default {
|
|
|
name: "affirmGhs",
|
|
name: "affirmGhs",
|
|
|
components: {
|
|
components: {
|
|
@@ -192,7 +191,6 @@ export default {
|
|
|
this.getUserInfo()
|
|
this.getUserInfo()
|
|
|
},
|
|
},
|
|
|
computed: {
|
|
computed: {
|
|
|
- // removed unused getLoginInfo
|
|
|
|
|
modifyPrice(){
|
|
modifyPrice(){
|
|
|
let price = Number(this.allPrice) || 0
|
|
let price = Number(this.allPrice) || 0
|
|
|
if(this.form.sendType == 2){
|
|
if(this.form.sendType == 2){
|
|
@@ -200,11 +198,19 @@ export default {
|
|
|
} else if (this.form.sendType == 0){
|
|
} else if (this.form.sendType == 0){
|
|
|
price = price + Number(this.form.packCost || 0)
|
|
price = price + Number(this.form.packCost || 0)
|
|
|
}
|
|
}
|
|
|
|
|
+ price = price.toFixed(2)
|
|
|
return parseFloat(price)
|
|
return parseFloat(price)
|
|
|
},
|
|
},
|
|
|
},
|
|
},
|
|
|
|
|
+ onLoad(){
|
|
|
|
|
+ if(this.option.account){
|
|
|
|
|
+ uni.setStorageSync('account',this.option.account)
|
|
|
|
|
+ }
|
|
|
|
|
+ if(this.option.hdId){
|
|
|
|
|
+ uni.setStorageSync('hdId',this.option.hdId)
|
|
|
|
|
+ }
|
|
|
|
|
+ },
|
|
|
methods: {
|
|
methods: {
|
|
|
- // removed unused initMerchantInfo
|
|
|
|
|
selTimeFn(e) {
|
|
selTimeFn(e) {
|
|
|
this.form.reachDate = e.detail.value;
|
|
this.form.reachDate = e.detail.value;
|
|
|
},
|
|
},
|
|
@@ -225,7 +231,6 @@ export default {
|
|
|
this.form.sendType = 0
|
|
this.form.sendType = 0
|
|
|
}
|
|
}
|
|
|
}
|
|
}
|
|
|
- //this.getUserInfo()
|
|
|
|
|
},
|
|
},
|
|
|
getUserInfo(){
|
|
getUserInfo(){
|
|
|
currentInfo().then(res=>{
|
|
currentInfo().then(res=>{
|
|
@@ -241,12 +246,16 @@ export default {
|
|
|
that.form.lat = that.userInfo.lat
|
|
that.form.lat = that.userInfo.lat
|
|
|
that.form.showAddress = that.userInfo.showAddress
|
|
that.form.showAddress = that.userInfo.showAddress
|
|
|
that.form.hasMap = that.userInfo.hasMap || 0
|
|
that.form.hasMap = that.userInfo.hasMap || 0
|
|
|
- that.calcSendCost()
|
|
|
|
|
|
|
+ if(that.form.hasMap == 1 && this.form.sendType == 2){
|
|
|
|
|
+ that.calcSendCost()
|
|
|
|
|
+ }
|
|
|
}
|
|
}
|
|
|
}).catch(()=>{})
|
|
}).catch(()=>{})
|
|
|
},
|
|
},
|
|
|
modifyAddress(){
|
|
modifyAddress(){
|
|
|
- this.$util.pageTo({ url: '/pages/user/modify?hasMap='+this.form.hasMap})
|
|
|
|
|
|
|
+ let account = this.option.account
|
|
|
|
|
+ let hdId = this.option.hdId
|
|
|
|
|
+ this.$util.pageTo({ url: '/pages/user/address?account='+account+'&hdId='+hdId})
|
|
|
},
|
|
},
|
|
|
changeSendType(num){
|
|
changeSendType(num){
|
|
|
this.form.sendType = num
|
|
this.form.sendType = num
|
|
@@ -272,15 +281,15 @@ export default {
|
|
|
}
|
|
}
|
|
|
weight = Number(weight).toFixed(2)
|
|
weight = Number(weight).toFixed(2)
|
|
|
// 无地址或重量为 0 时,设为 0 并返回
|
|
// 无地址或重量为 0 时,设为 0 并返回
|
|
|
- if (this.$util.isEmpty(that.userInfo.lat) || this.$util.isEmpty(that.userInfo.long) || Number(weight) <= 0) {
|
|
|
|
|
|
|
+ if (this.$util.isEmpty(that.userInfo.lat) || this.$util.isEmpty(that.userInfo.long)) {
|
|
|
that.form.sendCost = 0
|
|
that.form.sendCost = 0
|
|
|
|
|
+ this.$msg('请填写地址')
|
|
|
return
|
|
return
|
|
|
}
|
|
}
|
|
|
- // freight({weight:weight,lat:that.userInfo.lat,long:that.userInfo.long}).then(res => {
|
|
|
|
|
- // if(res.code == 1){
|
|
|
|
|
- // that.form.sendCost = res.data.fee?parseFloat(Number(res.data.fee)):0
|
|
|
|
|
- // }
|
|
|
|
|
- // }).catch(()=>{});
|
|
|
|
|
|
|
+ if(Number(weight) <= 0){
|
|
|
|
|
+ this.$msg('商品没有重量,无法使用跑腿')
|
|
|
|
|
+ return false
|
|
|
|
|
+ }
|
|
|
// newFreight
|
|
// newFreight
|
|
|
let packageNum = that.allCountFun && that.allCountFun.bigLength ? Number(that.allCountFun.bigLength) : 1
|
|
let packageNum = that.allCountFun && that.allCountFun.bigLength ? Number(that.allCountFun.bigLength) : 1
|
|
|
let cargoName = '花材'
|
|
let cargoName = '花材'
|
|
@@ -320,37 +329,29 @@ export default {
|
|
|
return false
|
|
return false
|
|
|
}
|
|
}
|
|
|
}
|
|
}
|
|
|
- if(this.form.sendType == 2 && this.form.sendCost <= 0) {
|
|
|
|
|
- this.$msg('选择请跑腿送,必须获取运费')
|
|
|
|
|
- return false
|
|
|
|
|
- }
|
|
|
|
|
- if(this.form.sendType == 2 && this.form.hasMap == 0) {
|
|
|
|
|
- this.$msg('由于地图定位服务停用,无法使用请跑腿送')
|
|
|
|
|
- return false
|
|
|
|
|
|
|
+ if(this.form.sendType == 2) {
|
|
|
|
|
+ if(this.form.hasMap == 0){
|
|
|
|
|
+ this.$msg('跑腿送已停用,请换其它方式')
|
|
|
|
|
+ return false
|
|
|
|
|
+ }
|
|
|
|
|
+ if(Number(this.form.sendCost) <= 0){
|
|
|
|
|
+ this.$msg('没有获取到跑腿费')
|
|
|
|
|
+ return false
|
|
|
|
|
+ }
|
|
|
}
|
|
}
|
|
|
uni.showLoading({mask:true})
|
|
uni.showLoading({mask:true})
|
|
|
buyItem(params).then(res => {
|
|
buyItem(params).then(res => {
|
|
|
uni.hideLoading()
|
|
uni.hideLoading()
|
|
|
if(res.code && res.code == 1){
|
|
if(res.code && res.code == 1){
|
|
|
let account = this.option.account ? this.option.account : 0
|
|
let account = this.option.account ? this.option.account : 0
|
|
|
- let totalPrice = Number(res.data.totalPrice)
|
|
|
|
|
- if (this.form.sendType == 2) { // 当是请跑腿送时,总价格得加上运费
|
|
|
|
|
- totalPrice =+ Number(this.form.sendCost)
|
|
|
|
|
- }
|
|
|
|
|
-
|
|
|
|
|
- if (Math.abs(totalPrice - this.modifyPrice) < 0.001) {
|
|
|
|
|
- res.data.totalPrice = totalPrice
|
|
|
|
|
- }else{
|
|
|
|
|
- this.$msg('运费计算错误')
|
|
|
|
|
- return
|
|
|
|
|
- }
|
|
|
|
|
- this.$util.pageTo({ url: "/pages/callback/pay", type: 2, query: { pageStatus: 1, ...res.data, hdId: hdId, account: account } })
|
|
|
|
|
|
|
+ let getPayType = res.data.getPayType?res.data.getPayType:0
|
|
|
|
|
+ let totalPrice = res.data.totalPrice?res.data.totalPrice:0
|
|
|
|
|
+ let orderSn = res.data.orderSn?res.data.orderSn:''
|
|
|
|
|
+ this.$util.pageTo({url:"/pages/callback/pay?account="+account+'&hdId='+hdId+'&pageStatus=1&getPayType='+getPayType+'&totalPrice='+totalPrice+'&orderSn='+orderSn,type:2})
|
|
|
}
|
|
}
|
|
|
this.removeMemory()
|
|
this.removeMemory()
|
|
|
}).catch((e)=>{
|
|
}).catch((e)=>{
|
|
|
- console.log('buyItem error: ', e)
|
|
|
|
|
- uni.hideLoading()
|
|
|
|
|
- this.removeMemory()
|
|
|
|
|
|
|
+ this.$msg('下单失败,请重试')
|
|
|
})
|
|
})
|
|
|
},
|
|
},
|
|
|
modifyItem() {
|
|
modifyItem() {
|