|
|
@@ -27,7 +27,7 @@
|
|
|
>
|
|
|
<swiper-item v-for="item in ghsNoticeList" :key="item.id" class="ghs-notice-slide">
|
|
|
<view class="ghs-notice-item">
|
|
|
- <view class="ghs-notice-summary">{{ item.summary }}</view>
|
|
|
+ <view class="ghs-notice-summary">【公告】{{ item.summary }}</view>
|
|
|
</view>
|
|
|
</swiper-item>
|
|
|
</swiper>
|
|
|
@@ -310,12 +310,12 @@
|
|
|
<!-- 跑腿平台报价列表 -->
|
|
|
<view v-if="ghsInfo.openIntraCity == 1 && deliveryQuotes.length > 0" class="delivery-quotes-container">
|
|
|
<view class="delivery-quotes-grid">
|
|
|
- <view
|
|
|
- v-for="(item, index) in deliveryQuotes"
|
|
|
+ <view
|
|
|
+ v-for="(item, index) in deliveryQuotes"
|
|
|
:key="index"
|
|
|
class="delivery-quote-item"
|
|
|
- :class="{
|
|
|
- 'active': selectedDeliveryIndex === index,
|
|
|
+ :class="{
|
|
|
+ 'active': selectedDeliveryIndex === index,
|
|
|
'disabled': !item.isAble,
|
|
|
'fixed-width': deliveryQuotes.length <= 2
|
|
|
}"
|
|
|
@@ -590,12 +590,12 @@ export default {
|
|
|
// showDistance单位是米,hcFreeKm单位是千米
|
|
|
const distanceInMeters = Number(this.showDistance) || 0
|
|
|
const freeKmInMeters = (Number(this.ghsInfo.hcFreeKm) || 0) * 1000
|
|
|
-
|
|
|
+
|
|
|
// 如果距离小于免费公里数,则免运费
|
|
|
if(distanceInMeters < freeKmInMeters){
|
|
|
return true
|
|
|
}
|
|
|
-
|
|
|
+
|
|
|
// 条件2: 如果距离大于免费公里数,判断hcMap
|
|
|
if(distanceInMeters > freeKmInMeters){
|
|
|
if(this.ghsInfo.hcMap && typeof this.ghsInfo.hcMap == 'string'){
|
|
|
@@ -607,13 +607,13 @@ export default {
|
|
|
// 获取花材数量和总价
|
|
|
const flowerCount = this.allCountFun.bigLength || 0
|
|
|
const flowerPrice = this.allPriceFun || 0
|
|
|
-
|
|
|
+
|
|
|
// 遍历hcMap,检查是否满足免运费条件
|
|
|
for(const rule of this.ghsInfo.hcMap){
|
|
|
const ruleNum = Number(rule.num) || 0
|
|
|
const rulePrice = Number(rule.price) || 0
|
|
|
const ruleDistance = (Number(rule.distance) || 0) * 1000 // 转换为米
|
|
|
-
|
|
|
+
|
|
|
// 如果花材数量大于num,花材总价大于price,距离小于distance,则免运费
|
|
|
if(flowerCount >= ruleNum && flowerPrice >= rulePrice && distanceInMeters <= ruleDistance){
|
|
|
console.log('满足免运费条件:',flowerCount,ruleNum,flowerPrice,rulePrice,distanceInMeters,ruleDistance)
|
|
|
@@ -625,12 +625,12 @@ export default {
|
|
|
console.log('hcMap数据为空')
|
|
|
return false
|
|
|
}
|
|
|
-
|
|
|
+
|
|
|
console.log('this.ghsInfo.hcMap: ',this.ghsInfo.hcMap)
|
|
|
console.log('hcMap数据格式出问题了')
|
|
|
}
|
|
|
}
|
|
|
-
|
|
|
+
|
|
|
return false
|
|
|
},
|
|
|
/**
|
|
|
@@ -638,10 +638,10 @@ export default {
|
|
|
*/
|
|
|
showDeliveryPolicy() {
|
|
|
if (!this.ghsInfo) return false
|
|
|
-
|
|
|
+
|
|
|
// 检查 hcFreeKm
|
|
|
const hasFreeKm = this.ghsInfo.hcFreeKm ?Number(this.ghsInfo.hcFreeKm):0
|
|
|
-
|
|
|
+
|
|
|
// 检查 hcMap
|
|
|
let hasPolicy = false
|
|
|
let mapData = this.ghsInfo.hcMap
|
|
|
@@ -710,12 +710,12 @@ export default {
|
|
|
// 展示包配送政策弹窗
|
|
|
showDeliveryPolicyModal() {
|
|
|
this.deliveryPolicyList = []
|
|
|
-
|
|
|
+
|
|
|
// 1. hcFreeKm 规则
|
|
|
if (this.ghsInfo.hcFreeKm && Number(this.ghsInfo.hcFreeKm) > 0) {
|
|
|
this.deliveryPolicyList.push(`${Number(this.ghsInfo.hcFreeKm)}公里内免费配送`)
|
|
|
}
|
|
|
-
|
|
|
+
|
|
|
// 2. hcMap 规则
|
|
|
let mapData = this.ghsInfo.hcMap
|
|
|
if(mapData && typeof mapData == 'string'){
|
|
|
@@ -730,11 +730,11 @@ export default {
|
|
|
const num = Number(rule.num) || 0
|
|
|
const price = Number(rule.price) || 0
|
|
|
const distance = Number(rule.distance) || 0
|
|
|
-
|
|
|
+
|
|
|
this.deliveryPolicyList.push(`满${num}扎${price}元,${distance}公里内免费配送`)
|
|
|
})
|
|
|
}
|
|
|
-
|
|
|
+
|
|
|
if (this.deliveryPolicyList.length === 0) {
|
|
|
uni.showToast({
|
|
|
title: '暂无详细配送政策',
|
|
|
@@ -742,7 +742,7 @@ export default {
|
|
|
})
|
|
|
return
|
|
|
}
|
|
|
-
|
|
|
+
|
|
|
this.$refs.deliveryPolicyPopup.open()
|
|
|
},
|
|
|
closeDeliveryPolicy() {
|
|
|
@@ -826,7 +826,7 @@ export default {
|
|
|
this.deliveryQuotes = []
|
|
|
this.selectedDeliveryIndex = -1
|
|
|
this.selectedDeliveryData = null
|
|
|
-
|
|
|
+
|
|
|
allDeliveryQuotes({
|
|
|
ghsId: this.option.id,
|
|
|
totalPrice: this.allPriceFun,
|
|
|
@@ -842,7 +842,7 @@ export default {
|
|
|
.map(item => {
|
|
|
// 价格从分转换为元
|
|
|
const price = item.price ? (item.price / 100).toFixed(1) : '0.0'
|
|
|
-
|
|
|
+
|
|
|
// 提取平台名称(去掉括号内的内容)
|
|
|
let displayName = item.name
|
|
|
let bracketContent = ''
|
|
|
@@ -855,7 +855,7 @@ export default {
|
|
|
if(item.en_name == 'didi' && bracketContent != ''){
|
|
|
item.type = bracketContent
|
|
|
}
|
|
|
-
|
|
|
+
|
|
|
return {
|
|
|
...item,
|
|
|
displayName: displayName,
|
|
|
@@ -864,7 +864,7 @@ export default {
|
|
|
bracketContent: bracketContent
|
|
|
}
|
|
|
})
|
|
|
-
|
|
|
+
|
|
|
// 自动选中第一个可用的报价
|
|
|
const firstAvailableIndex = this.deliveryQuotes.findIndex(item => item.isAble)
|
|
|
if (firstAvailableIndex !== -1) {
|
|
|
@@ -1194,7 +1194,7 @@ export default {
|
|
|
version:10,
|
|
|
direct:direct
|
|
|
}
|
|
|
-
|
|
|
+
|
|
|
// 如果选择了跑腿配送并且有选中的平台数据,则添加配送平台信息
|
|
|
if (this.form.sendType == 2 && this.selectedDeliveryData) {
|
|
|
params.deliveryPlatform = this.selectedDeliveryData.en_name // 平台名称
|
|
|
@@ -1271,9 +1271,9 @@ export default {
|
|
|
}
|
|
|
try {
|
|
|
r2 = arg2.toString().split(".")[1].length
|
|
|
- } catch (e) {
|
|
|
- r2 = 0
|
|
|
- }
|
|
|
+ } catch (e) {
|
|
|
+ r2 = 0
|
|
|
+ }
|
|
|
m = Math.pow(10, Math.max(r1, r2))
|
|
|
n = (r1 >= r2) ? r1 : r2;
|
|
|
return ((arg1 * m + arg2 * m) / m).toFixed(n);
|
|
|
@@ -1290,7 +1290,7 @@ export default {
|
|
|
} catch (e) {
|
|
|
re2 = 0;
|
|
|
}
|
|
|
- m = Math.pow(10, Math.max(re1, re2));
|
|
|
+ m = Math.pow(10, Math.max(re1, re2));
|
|
|
n = (re1 >= re2) ? re1 : re2;
|
|
|
return ((arg1 * m - arg2 * m) / m).toFixed(n);
|
|
|
},
|
|
|
@@ -1649,13 +1649,13 @@ export default {
|
|
|
border-radius: 8upx;
|
|
|
box-sizing: border-box;
|
|
|
transition: all 0.3s;
|
|
|
-
|
|
|
+
|
|
|
// 当只有1-2项时使用固定宽度
|
|
|
&.fixed-width {
|
|
|
flex: 0 0 220rpx;
|
|
|
width: 220rpx;
|
|
|
}
|
|
|
-
|
|
|
+
|
|
|
.platform-name {
|
|
|
font-size: 26upx;
|
|
|
color: #333;
|
|
|
@@ -1672,14 +1672,14 @@ export default {
|
|
|
-webkit-box-orient: vertical;
|
|
|
word-break: break-all;
|
|
|
}
|
|
|
-
|
|
|
+
|
|
|
.platform-price {
|
|
|
font-size: 30upx;
|
|
|
color: #333;
|
|
|
font-weight: bold;
|
|
|
margin-bottom: 4upx;
|
|
|
}
|
|
|
-
|
|
|
+
|
|
|
.platform-type {
|
|
|
font-size: 20upx;
|
|
|
color: #868686;
|
|
|
@@ -1695,27 +1695,27 @@ export default {
|
|
|
-webkit-box-orient: vertical;
|
|
|
word-break: break-all;
|
|
|
}
|
|
|
-
|
|
|
+
|
|
|
// 选中状态
|
|
|
&.active {
|
|
|
background: #09C567;
|
|
|
border-color: #09C567;
|
|
|
-
|
|
|
+
|
|
|
.platform-name,
|
|
|
.platform-price {
|
|
|
color: #FFFFFF;
|
|
|
}
|
|
|
-
|
|
|
+
|
|
|
.platform-type {
|
|
|
color: rgba(255, 255, 255, 0.85);
|
|
|
}
|
|
|
}
|
|
|
-
|
|
|
+
|
|
|
// 不可用状态
|
|
|
&.disabled {
|
|
|
opacity: 0.5;
|
|
|
background: #F5F5F5;
|
|
|
-
|
|
|
+
|
|
|
.platform-name,
|
|
|
.platform-price,
|
|
|
.platform-type {
|
|
|
@@ -1864,4 +1864,4 @@ export default {
|
|
|
-webkit-box-orient: vertical;
|
|
|
-webkit-line-clamp: 3;
|
|
|
}
|
|
|
-</style>
|
|
|
+</style>
|