|
@@ -7,7 +7,6 @@
|
|
<text>{{ freightText }}</text>
|
|
<text>{{ freightText }}</text>
|
|
<text
|
|
<text
|
|
class="cell-more iconfont icon-xiangyou"
|
|
class="cell-more iconfont icon-xiangyou"
|
|
- v-if="infoData.designatedFlag !== 1"
|
|
|
|
@click="showPopup"
|
|
@click="showPopup"
|
|
></text>
|
|
></text>
|
|
</view>
|
|
</view>
|
|
@@ -16,7 +15,7 @@
|
|
<tui-bottom-popup :radius="true" :show="popupShow">
|
|
<tui-bottom-popup :radius="true" :show="popupShow">
|
|
<view class="freight-title">运费设置</view>
|
|
<view class="freight-title">运费设置</view>
|
|
<view class="freight-content">
|
|
<view class="freight-content">
|
|
- <radio-group @change="radioChange">
|
|
|
|
|
|
+ <radio-group @change="radioChange" v-if="designatedFlag()">
|
|
<label v-for="(item, index) in radioItems" :key="index">
|
|
<label v-for="(item, index) in radioItems" :key="index">
|
|
<radio
|
|
<radio
|
|
style="transform:scale(0.7)"
|
|
style="transform:scale(0.7)"
|
|
@@ -31,7 +30,7 @@
|
|
</label>
|
|
</label>
|
|
</radio-group>
|
|
</radio-group>
|
|
<view class="freight-form">
|
|
<view class="freight-form">
|
|
- <view class="freight-form-item" v-if="infoData.designatedFlag !== 2">
|
|
|
|
|
|
+ <view class="freight-form-item" v-if="infoData.designatedFlag !== 2 && infoData.coldChain > 0">
|
|
<view>冷链运输费</view>
|
|
<view>冷链运输费</view>
|
|
<view style="position: relative;">
|
|
<view style="position: relative;">
|
|
¥{{ this.infoData.coldChain.toFixed(2) }}
|
|
¥{{ this.infoData.coldChain.toFixed(2) }}
|
|
@@ -43,7 +42,7 @@
|
|
></radio>
|
|
></radio>
|
|
</view>
|
|
</view>
|
|
</view>
|
|
</view>
|
|
- <block>
|
|
|
|
|
|
+ <block v-if="newPostAge() !== 0">
|
|
<view class="freight-form-item" v-if="isCPay">
|
|
<view class="freight-form-item" v-if="isCPay">
|
|
<view>其他运费</view>
|
|
<view>其他运费</view>
|
|
<view>{{ '¥' + postAge().toFixed(2) }}</view>
|
|
<view>{{ '¥' + postAge().toFixed(2) }}</view>
|
|
@@ -55,11 +54,8 @@
|
|
</block>
|
|
</block>
|
|
<view class="freight-form-item">
|
|
<view class="freight-form-item">
|
|
<view>总运费</view>
|
|
<view>总运费</view>
|
|
- <view style="color: #F94B4B;display: flex;">
|
|
|
|
- <view class="" v-if="allPostage === 0">
|
|
|
|
- 到付
|
|
|
|
- </view>
|
|
|
|
- <view style="display: flex;" v-else>
|
|
|
|
|
|
+ <view style="color: #F94B4B;">
|
|
|
|
+ <view style="display: flex;" v-if="allPostage !== 0 || isCPay">
|
|
¥
|
|
¥
|
|
<count-up
|
|
<count-up
|
|
:num="allPostage.toFixed(2)"
|
|
:num="allPostage.toFixed(2)"
|
|
@@ -69,6 +65,9 @@
|
|
color="#F94B4B"
|
|
color="#F94B4B"
|
|
></count-up>
|
|
></count-up>
|
|
</view>
|
|
</view>
|
|
|
|
+ <text v-else>
|
|
|
|
+ 到付
|
|
|
|
+ </text>
|
|
</view>
|
|
</view>
|
|
</view>
|
|
</view>
|
|
</view>
|
|
</view>
|
|
@@ -129,9 +128,8 @@ export default {
|
|
computed: {
|
|
computed: {
|
|
// 总运费
|
|
// 总运费
|
|
allPostage() {
|
|
allPostage() {
|
|
- console.log(111)
|
|
|
|
this.freightText =
|
|
this.freightText =
|
|
- this.postAge() + (this.isCheck ? this.infoData.coldChain : 0) === 0
|
|
|
|
|
|
+ (this.postAge() + (this.isCheck ? this.infoData.coldChain : 0) === 0) && !this.isCPay
|
|
? '到付'
|
|
? '到付'
|
|
: '¥' + (this.postAge() + (this.isCheck ? this.infoData.coldChain : 0)).toFixed(2)
|
|
: '¥' + (this.postAge() + (this.isCheck ? this.infoData.coldChain : 0)).toFixed(2)
|
|
return this.postAge() + (this.infoData.isColdChina ? this.infoData.coldChain : 0)
|
|
return this.postAge() + (this.infoData.isColdChina ? this.infoData.coldChain : 0)
|
|
@@ -149,13 +147,24 @@ export default {
|
|
this.popupShow = true
|
|
this.popupShow = true
|
|
this.$emit('showFreight', true)
|
|
this.$emit('showFreight', true)
|
|
},
|
|
},
|
|
|
|
+ // 是否到付
|
|
postAgeFlag(e) {
|
|
postAgeFlag(e) {
|
|
return JSON.parse(uni.getStorageSync('goodsData'))[this.goodIndex].postageFlag === e
|
|
return JSON.parse(uni.getStorageSync('goodsData'))[this.goodIndex].postageFlag === e
|
|
},
|
|
},
|
|
|
|
+ // 初始运费
|
|
postAge() {
|
|
postAge() {
|
|
- if (this.isCPay) return JSON.parse(uni.getStorageSync('goodsData'))[this.goodIndex].postage
|
|
|
|
|
|
+ if (this.isCPay) return this.newPostAge()
|
|
else return 0
|
|
else return 0
|
|
},
|
|
},
|
|
|
|
+ // 新运费
|
|
|
|
+ newPostAge() {
|
|
|
|
+ return JSON.parse(uni.getStorageSync('goodsData'))[this.goodIndex].postage
|
|
|
|
+ },
|
|
|
|
+ // 是否运费切换
|
|
|
|
+ designatedFlag(index) {
|
|
|
|
+ return JSON.parse(uni.getStorageSync('goodsData'))[this.goodIndex].designatedFlag !== 1
|
|
|
|
+ },
|
|
|
|
+ // 按钮切换
|
|
radioChange($event) {
|
|
radioChange($event) {
|
|
console.log('切换运费')
|
|
console.log('切换运费')
|
|
this.isCPay = !this.isCPay
|
|
this.isCPay = !this.isCPay
|