|
|
@@ -30,7 +30,7 @@
|
|
|
<view class="operate-view" @click="modifyItem">
|
|
|
<text class="iconfont icongouwuche"></text>返回修改
|
|
|
</view>
|
|
|
- <view class="describe-view">共{{ allCountFun.bigLength }}扎,合计 ¥<text class="price">{{ allPriceFun }}</text></view>
|
|
|
+ <view class="describe-view">{{ allCount.bigLength }}扎,{{allCount.weight}}公斤,<text class="price">¥{{ allPriceFun }}</text></view>
|
|
|
</view>
|
|
|
</view>
|
|
|
</view>
|
|
|
@@ -266,37 +266,23 @@ export default {
|
|
|
},
|
|
|
calcSendCost() {
|
|
|
let that = this
|
|
|
- let weight = 0
|
|
|
- if(!this.$util.isEmpty(this.selectList)){
|
|
|
- this.selectList.forEach((item,idx,arr) => {
|
|
|
- if(Number(item.bigCount)>0){
|
|
|
- let add = Number(item.weight)*Number(item.bigCount)
|
|
|
- weight = Number(weight) + Number(add)
|
|
|
- }else{
|
|
|
- let unitWeight = item.weight/item.ratio
|
|
|
- let add = Number(unitWeight)*Number(item.smallCount)
|
|
|
- weight = Number(weight) + Number(add)
|
|
|
- }
|
|
|
- })
|
|
|
- }
|
|
|
- weight = Number(weight).toFixed(2)
|
|
|
// 无地址或重量为 0 时,设为 0 并返回
|
|
|
if (this.$util.isEmpty(that.userInfo.lat) || this.$util.isEmpty(that.userInfo.long)) {
|
|
|
that.form.sendCost = 0
|
|
|
this.$msg('请填写地址')
|
|
|
return
|
|
|
}
|
|
|
- if(Number(weight) <= 0){
|
|
|
+ if(Number(that.allCount.weight) <= 0){
|
|
|
this.$msg('商品没有重量,无法使用跑腿')
|
|
|
return false
|
|
|
}
|
|
|
// newFreight
|
|
|
- let packageNum = that.allCountFun && that.allCountFun.bigLength ? Number(that.allCountFun.bigLength) : 1
|
|
|
+ let packageNum = that.allCount && Number(that.allCount.bigLength)>0 ? Number(that.allCount.bigLength) : that.allCount.smallLength
|
|
|
let cargoName = '花材'
|
|
|
let newFreightParams = {
|
|
|
cargo_name: cargoName,
|
|
|
price: that.allPriceFun,
|
|
|
- weight: weight,
|
|
|
+ weight: that.allCount.weight,
|
|
|
package_num: packageNum,
|
|
|
user_lng: that.userInfo.long,
|
|
|
user_lat: that.userInfo.lat,
|
|
|
@@ -305,7 +291,6 @@ export default {
|
|
|
user_address: that.userInfo.province + that.userInfo.city + that.userInfo.dist + that.userInfo.address + that.userInfo.floor
|
|
|
}
|
|
|
newFreight(newFreightParams).then(res => {
|
|
|
- console.log('newFreight',res)
|
|
|
if(res.code == 1){
|
|
|
that.form.sendCost = res.data.est_fee?parseFloat(Number(res.data.est_fee/100)):0
|
|
|
}
|
|
|
@@ -443,10 +428,9 @@ export default {
|
|
|
}
|
|
|
.describe-view {
|
|
|
display: flex;
|
|
|
-
|
|
|
align-items: center;
|
|
|
color: #333;
|
|
|
- font-size: 24upx;
|
|
|
+ font-size: 26upx;
|
|
|
.price {
|
|
|
font-weight: bold;
|
|
|
font-size: 36upx;
|