|
|
@@ -245,6 +245,9 @@
|
|
|
<view>
|
|
|
<text :class="isFreeDelivery ? 'delivery-price-free' : 'delivery-price-normal'">¥ {{ form.sendCost }}</text>
|
|
|
<text v-if="isFreeDelivery" class="free-delivery-tag">【免跑腿费】</text>
|
|
|
+ <text v-if="showDeliveryPolicy" class="delivery-policy-link" @click="showDeliveryPolicyModal">
|
|
|
+ <text class="iconfont iconchangjianwentixiangguanwenti2 policy-icon"></text>包配送政策
|
|
|
+ </text>
|
|
|
</view>
|
|
|
</tui-list-cell>
|
|
|
<tui-list-cell class="line-cell" :hover="false" :arrow="true" v-if="displayAddress == true" @click="modifyAddress">
|
|
|
@@ -304,6 +307,20 @@
|
|
|
</view>
|
|
|
</uni-popup>
|
|
|
|
|
|
+ <uni-popup ref="deliveryPolicyPopup" type="center" background-color="#fff">
|
|
|
+ <view class="policy-popup-content">
|
|
|
+ <view class="policy-title">包配送政策</view>
|
|
|
+ <scroll-view scroll-y="true" class="policy-scroll">
|
|
|
+ <view class="policy-list">
|
|
|
+ <block v-for="(item, index) in deliveryPolicyList" :key="index">
|
|
|
+ <view class="policy-item">{{ item }}</view>
|
|
|
+ </block>
|
|
|
+ </view>
|
|
|
+ </scroll-view>
|
|
|
+ <view class="policy-btn" @click="closeDeliveryPolicy">知道了</view>
|
|
|
+ </view>
|
|
|
+ </uni-popup>
|
|
|
+
|
|
|
</view>
|
|
|
</template>
|
|
|
|
|
|
@@ -403,7 +420,8 @@ export default {
|
|
|
deliveryQuotes: [], // 跑腿平台报价列表
|
|
|
selectedDeliveryIndex: -1, // 选中的报价索引
|
|
|
deliveryQuotesLoading: false, // 报价加载状态
|
|
|
- selectedDeliveryData: null // 选中的报价数据
|
|
|
+ selectedDeliveryData: null, // 选中的报价数据
|
|
|
+ deliveryPolicyList: [] // 包配送政策列表
|
|
|
};
|
|
|
},
|
|
|
onLoad() {
|
|
|
@@ -479,6 +497,9 @@ export default {
|
|
|
|
|
|
// 条件2: 如果距离大于免费公里数,判断hcMap
|
|
|
if(distanceInMeters > freeKmInMeters){
|
|
|
+ if(this.ghsInfo.hcMap && typeof this.ghsInfo.hcMap == 'string'){
|
|
|
+ this.ghsInfo.hcMap = JSON.parse(this.ghsInfo.hcMap)
|
|
|
+ }
|
|
|
// 判断hcMap是否为空
|
|
|
if(this.ghsInfo.hcMap && Array.isArray(this.ghsInfo.hcMap) && this.ghsInfo.hcMap.length > 0){
|
|
|
// 获取花材数量和总价
|
|
|
@@ -501,6 +522,31 @@ export default {
|
|
|
|
|
|
return false
|
|
|
},
|
|
|
+ /**
|
|
|
+ * 是否显示包配送政策
|
|
|
+ */
|
|
|
+ showDeliveryPolicy() {
|
|
|
+ if (!this.ghsInfo) return false
|
|
|
+
|
|
|
+ // 检查 hcFreeKm
|
|
|
+ const hasFreeKm = this.ghsInfo.hcFreeKm && Number(this.ghsInfo.hcFreeKm) > 0
|
|
|
+
|
|
|
+ // 检查 hcMap
|
|
|
+ let hasMap = false
|
|
|
+ let mapData = this.ghsInfo.hcMap
|
|
|
+ if(mapData && typeof mapData == 'string'){
|
|
|
+ try {
|
|
|
+ mapData = JSON.parse(mapData)
|
|
|
+ } catch(e) {
|
|
|
+ // 解析失败忽略
|
|
|
+ }
|
|
|
+ }
|
|
|
+ if(mapData && Array.isArray(mapData) && mapData.length > 0){
|
|
|
+ hasMap = true
|
|
|
+ }
|
|
|
+
|
|
|
+ return hasFreeKm || hasMap
|
|
|
+ },
|
|
|
/**
|
|
|
* 计算总金额
|
|
|
* @returns {number}
|
|
|
@@ -548,6 +594,47 @@ export default {
|
|
|
this.form.wlId = this.wlSelData.id
|
|
|
this.form.wlName = this.wlSelData.name
|
|
|
},
|
|
|
+ // 展示包配送政策弹窗
|
|
|
+ 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'){
|
|
|
+ try {
|
|
|
+ mapData = JSON.parse(mapData)
|
|
|
+ } catch(e) {
|
|
|
+ mapData = []
|
|
|
+ }
|
|
|
+ }
|
|
|
+ if(mapData && Array.isArray(mapData) && mapData.length > 0){
|
|
|
+ mapData.forEach(rule => {
|
|
|
+ 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: '暂无详细配送政策',
|
|
|
+ icon: 'none'
|
|
|
+ })
|
|
|
+ return
|
|
|
+ }
|
|
|
+
|
|
|
+ this.$refs.deliveryPolicyPopup.open()
|
|
|
+ },
|
|
|
+ closeDeliveryPolicy() {
|
|
|
+ this.$refs.deliveryPolicyPopup.close()
|
|
|
+ },
|
|
|
closeRemind(){
|
|
|
this.$refs.selectFlowerNumRef.close()
|
|
|
this.lackList = []
|
|
|
@@ -1440,4 +1527,60 @@ export default {
|
|
|
color: #3385FF;
|
|
|
margin-left: 10upx;
|
|
|
}
|
|
|
+
|
|
|
+.delivery-policy-link {
|
|
|
+ color: rgb(201, 52, 52);
|
|
|
+ font-size: 28upx;
|
|
|
+ margin-left: 26upx;
|
|
|
+ text-decoration: underline;
|
|
|
+}
|
|
|
+
|
|
|
+.policy-icon {
|
|
|
+ font-size: 28upx;
|
|
|
+ margin-left: 4upx;
|
|
|
+}
|
|
|
+
|
|
|
+.policy-popup-content {
|
|
|
+ width: 600upx;
|
|
|
+ background-color: #fff;
|
|
|
+ border-radius: 20upx;
|
|
|
+ padding: 30upx;
|
|
|
+ display: flex;
|
|
|
+ flex-direction: column;
|
|
|
+ align-items: center;
|
|
|
+}
|
|
|
+.policy-title {
|
|
|
+ font-size: 34upx;
|
|
|
+ font-weight: bold;
|
|
|
+ color: #333;
|
|
|
+ margin-bottom: 30upx;
|
|
|
+}
|
|
|
+.policy-scroll {
|
|
|
+ width: 100%;
|
|
|
+ max-height: 50vh;
|
|
|
+ margin-bottom: 30upx;
|
|
|
+}
|
|
|
+.policy-list {
|
|
|
+ width: 100%;
|
|
|
+}
|
|
|
+.policy-item {
|
|
|
+ font-size: 30upx;
|
|
|
+ color: #666;
|
|
|
+ margin-bottom: 20upx;
|
|
|
+ text-align: left;
|
|
|
+ line-height: 1.5;
|
|
|
+ display: list-item;
|
|
|
+ list-style-type: disc;
|
|
|
+ margin-left: 40upx;
|
|
|
+}
|
|
|
+.policy-btn {
|
|
|
+ width: 100%;
|
|
|
+ height: 80upx;
|
|
|
+ line-height: 80upx;
|
|
|
+ text-align: center;
|
|
|
+ background-color: #3385ff;
|
|
|
+ color: #fff;
|
|
|
+ font-size: 32upx;
|
|
|
+ border-radius: 40upx;
|
|
|
+}
|
|
|
</style>
|