|
|
@@ -101,12 +101,13 @@
|
|
|
</view>
|
|
|
</tui-list-cell>
|
|
|
|
|
|
- <!-- 未达标提示:加运费/加包装费/不能下单 -->
|
|
|
- <tui-list-cell class="line-cell" :hover="false" :arrow="false" v-if="showShMethodUnMeetWarning">
|
|
|
- <view>
|
|
|
- <text style="color: red;width:100%;font-weight: bold;font-size: 30upx;text-decoration: underline;">{{ shMethodUnMeetWarningText }}</text>
|
|
|
+ <!-- 未达标提示:还差扎数/金额,引导加购或说明加收费用 -->
|
|
|
+ <view class="unmeet-warning" v-if="showShMethodUnMeetWarning">
|
|
|
+ <view class="unmeet-warning-inner">
|
|
|
+ <text class="unmeet-warning-badge">!</text>
|
|
|
+ <text class="unmeet-warning-text">{{ shMethodUnMeetWarningText }}</text>
|
|
|
</view>
|
|
|
- </tui-list-cell>
|
|
|
+ </view>
|
|
|
|
|
|
<!-- 配送地址状态提示 -->
|
|
|
<tui-list-cell v-if="form.sendType == 2 && ghsInfo.openIntraCity != 1" class="line-cell" :hover="false" :arrow="false">
|
|
|
@@ -168,14 +169,22 @@
|
|
|
<view>
|
|
|
<text :class="isFreePt ? 'delivery-price-free' : 'delivery-price-normal'">¥{{ form.sendCost }}</text>
|
|
|
<text v-if="isFreePt" class="free-delivery-tag">¥0</text>
|
|
|
- <!-- 展示最接近的免运费差额提示;右侧问号提示可点击查看全部条件 -->
|
|
|
- <view v-if="!isFreePt" class="delivery-policy-link" @click="showDeliveryPolicyModal">
|
|
|
- <text>{{ nearestDeliveryPolicyText }}</text>
|
|
|
- <text class="policy-icon">?</text>
|
|
|
- </view>
|
|
|
</view>
|
|
|
</tui-list-cell>
|
|
|
|
|
|
+ <!-- 免跑腿费差额提示:单独成条,点击可看全部条件 -->
|
|
|
+ <view
|
|
|
+ v-if="form.sendType == 2 && !isFreePt && showDeliveryPolicy"
|
|
|
+ class="free-pt-tip"
|
|
|
+ @click="showDeliveryPolicyModal"
|
|
|
+ >
|
|
|
+ <view class="free-pt-tip-inner">
|
|
|
+ <text class="free-pt-tip-badge">惠</text>
|
|
|
+ <text class="free-pt-tip-text">{{ nearestDeliveryPolicyText }}</text>
|
|
|
+ <text class="free-pt-tip-action">?</text>
|
|
|
+ </view>
|
|
|
+ </view>
|
|
|
+
|
|
|
<!-- 额外费用(包装费/运费) -->
|
|
|
<tui-list-cell class="line-cell" :hover="false" v-if="showShMethodExtraFee">
|
|
|
<view class="tui-title">{{ shMethodExtraFeeLabel }}</view>
|
|
|
@@ -447,31 +456,25 @@ export default {
|
|
|
const method = this.currentShMethod
|
|
|
return parseFloat(Number(method && method.unMeetFee) || 0)
|
|
|
},
|
|
|
- /** 未达标红色文案:加运费/包装费金额,或不能下单 */
|
|
|
+ /**
|
|
|
+ * 未达标红色文案:用「还差」差额引导加购,比写绝对门槛更易懂
|
|
|
+ * 例:还差2扎50元,免10元包装费 / 还差2扎,即可下单
|
|
|
+ */
|
|
|
shMethodUnMeetWarningText() {
|
|
|
const method = this.currentShMethod
|
|
|
if (!method) {
|
|
|
return ""
|
|
|
}
|
|
|
- const tips = []
|
|
|
- const minAmount = Number(method.minAmount) || 0
|
|
|
- const minNum = Number(method.minNum) || 0
|
|
|
- if (minAmount > 0) {
|
|
|
- tips.push("未满" + minAmount + "元")
|
|
|
- }
|
|
|
- if (minNum > 0) {
|
|
|
- tips.push("未满" + minNum + "扎")
|
|
|
- }
|
|
|
- const conditionText = tips.length > 0 ? tips.join("并且") : "未达最低消费"
|
|
|
+ const lackText = this.buildShMethodLackTip(method)
|
|
|
const unMeet = Number(method.unMeet) || 0
|
|
|
- // unMeet=2:未满最低消费时引导加购,文案避免生硬的「不能下单」
|
|
|
+ // unMeet=2:凑齐差额即可下单
|
|
|
if (unMeet === 2) {
|
|
|
- return conditionText + ",请再加购后下单"
|
|
|
+ return lackText + ",即可下单"
|
|
|
}
|
|
|
- // unMeet=0 加运费;unMeet=1 加包装费,并写出具体金额
|
|
|
+ // unMeet=0/1:凑齐后可免掉这笔运费/包装费
|
|
|
const fee = parseFloat(Number(method.unMeetFee) || 0)
|
|
|
const feeLabel = unMeet === 1 ? "包装费" : "运费"
|
|
|
- return conditionText + ",加" + feeLabel + fee + "元"
|
|
|
+ return lackText + ",免" + fee + "元" + feeLabel
|
|
|
},
|
|
|
currentMethodExplains() {
|
|
|
const method = this.currentShMethod
|
|
|
@@ -641,6 +644,30 @@ export default {
|
|
|
const bigLength = Number(this.allCountFun.bigLength) || 0
|
|
|
return (minAmount > 0 && allPrice < minAmount) || (minNum > 0 && bigLength < minNum)
|
|
|
},
|
|
|
+ /**
|
|
|
+ * 相对配送方式最低消费,拼出「还差x扎x元」文案(只写仍未达到的维度)
|
|
|
+ * @param {Object} method - 当前配送方式
|
|
|
+ * @returns {string}
|
|
|
+ */
|
|
|
+ buildShMethodLackTip(method) {
|
|
|
+ const minAmount = Number(method && method.minAmount) || 0
|
|
|
+ const minNum = Number(method && method.minNum) || 0
|
|
|
+ const count = Number(this.allCountFun.bigLength) || 0
|
|
|
+ const price = Number(this.allPriceFun) || 0
|
|
|
+ const lackNum = minNum > 0 ? Math.max(0, minNum - count) : 0
|
|
|
+ const lackAmount = minAmount > 0 ? Math.max(0, parseFloat((minAmount - price).toFixed(2))) : 0
|
|
|
+ const parts = []
|
|
|
+ if (lackNum > 0) {
|
|
|
+ parts.push(lackNum + "扎")
|
|
|
+ }
|
|
|
+ if (lackAmount > 0) {
|
|
|
+ parts.push(lackAmount + "元")
|
|
|
+ }
|
|
|
+ if (!parts.length) {
|
|
|
+ return "未达最低消费"
|
|
|
+ }
|
|
|
+ return "还差" + parts.join("和")
|
|
|
+ },
|
|
|
/** 按列表下标切换配送方式,并同步 sendType 供下单与条件展示 */
|
|
|
selectMethodByIndex(index) {
|
|
|
const list = this.visibleMethodList
|
|
|
@@ -749,15 +776,15 @@ export default {
|
|
|
const lackNum = meetNum > 0 ? Math.max(0, meetNum - count) : 0
|
|
|
const lackAmount = meetAmount > 0 ? Math.max(0, parseFloat((meetAmount - price).toFixed(2))) : 0
|
|
|
if (lackNum <= 0 && lackAmount <= 0) {
|
|
|
- return "免运费"
|
|
|
+ return "免跑腿费"
|
|
|
}
|
|
|
if (lackNum > 0 && lackAmount > 0) {
|
|
|
- return `差${lackNum}扎${lackAmount}元免运费`
|
|
|
+ return `差${lackAmount}元和${lackNum}扎 免跑腿费`
|
|
|
}
|
|
|
if (lackNum > 0) {
|
|
|
- return `差${lackNum}扎免运费`
|
|
|
+ return `差${lackNum}扎 免跑腿费`
|
|
|
}
|
|
|
- return `差${lackAmount}元免运费`
|
|
|
+ return `差${lackAmount}元 免跑腿费`
|
|
|
},
|
|
|
// 展示包配送政策弹窗
|
|
|
showDeliveryPolicyModal() {
|
|
|
@@ -1107,18 +1134,8 @@ export default {
|
|
|
}
|
|
|
const method = this.currentShMethod
|
|
|
if (method && Number(method.unMeet) === 2 && this.checkShMethodBelowMinimum(method)) {
|
|
|
- // 未满最低消费且不可下单时,提示具体需要的最低金额与数量
|
|
|
- const minAmount = Number(method.minAmount) || 0
|
|
|
- const minNum = Number(method.minNum) || 0
|
|
|
- const tips = []
|
|
|
- if (minAmount > 0) {
|
|
|
- tips.push(`满${minAmount}元`)
|
|
|
- }
|
|
|
- if (minNum > 0) {
|
|
|
- tips.push(`满${minNum}扎`)
|
|
|
- }
|
|
|
- const tipStr = tips.length > 0 ? `${tips.join("并且")},请加购后下单` : "未达到最低消费,请再加购后下单"
|
|
|
- this.$msg(tipStr)
|
|
|
+ // 与页面红色提示一致:用还差差额引导加购
|
|
|
+ this.$msg(this.buildShMethodLackTip(method) + ",即可下单")
|
|
|
return false
|
|
|
}
|
|
|
|
|
|
@@ -1271,7 +1288,7 @@ export default {
|
|
|
}
|
|
|
},
|
|
|
gobackEvent() {
|
|
|
- this.$util.pageTo({url: "/pagesPurchase/ghsProduct?id="+this.options.id,type: 2})
|
|
|
+ this.$util.pageTo({url: "/pagesPurchase/ghsProduct?id="+this.options.id+'&ghsId='+this.options.id,type: 2})
|
|
|
}
|
|
|
}
|
|
|
};
|
|
|
@@ -1675,6 +1692,46 @@ export default {
|
|
|
}
|
|
|
}
|
|
|
|
|
|
+/* 未达标提示条:浅红底 + 左侧强调,比纯红下划线更醒目且易读 */
|
|
|
+.unmeet-warning {
|
|
|
+ padding: 0 24upx 16upx;
|
|
|
+ background-color: #fff;
|
|
|
+}
|
|
|
+.unmeet-warning-inner {
|
|
|
+ display: flex;
|
|
|
+ flex-direction: row;
|
|
|
+ align-items: flex-start;
|
|
|
+ padding: 20upx 24upx;
|
|
|
+ background-color: #fff5f5;
|
|
|
+ border: 2upx solid #ffd0d0;
|
|
|
+ border-left-width: 8upx;
|
|
|
+ border-left-color: #e64545;
|
|
|
+ border-radius: 12upx;
|
|
|
+ box-sizing: border-box;
|
|
|
+}
|
|
|
+.unmeet-warning-badge {
|
|
|
+ flex-shrink: 0;
|
|
|
+ width: 36upx;
|
|
|
+ height: 36upx;
|
|
|
+ margin-right: 16upx;
|
|
|
+ margin-top: 2upx;
|
|
|
+ border-radius: 50%;
|
|
|
+ background-color: #e64545;
|
|
|
+ color: #fff;
|
|
|
+ font-size: 24upx;
|
|
|
+ font-weight: bold;
|
|
|
+ line-height: 36upx;
|
|
|
+ text-align: center;
|
|
|
+}
|
|
|
+.unmeet-warning-text {
|
|
|
+ flex: 1;
|
|
|
+ color: #c62828;
|
|
|
+ font-size: 30upx;
|
|
|
+ font-weight: bold;
|
|
|
+ line-height: 1.45;
|
|
|
+ word-break: break-all;
|
|
|
+}
|
|
|
+
|
|
|
/* 跑腿费价格样式 */
|
|
|
.delivery-price-normal {
|
|
|
color: #3385FF;
|
|
|
@@ -1690,30 +1747,57 @@ export default {
|
|
|
margin-left: 20upx;
|
|
|
}
|
|
|
|
|
|
-.delivery-policy-link {
|
|
|
- display: inline-flex;
|
|
|
- align-items: center;
|
|
|
- color: rgb(201, 52, 52);
|
|
|
- font-size: 32upx;
|
|
|
- margin-left: 20upx;
|
|
|
- font-weight: bold;
|
|
|
+/* 免跑腿费提示条:跑腿费下方独立展示,橙色系与红色未达标提示区分 */
|
|
|
+.free-pt-tip {
|
|
|
+ padding: 0 24upx 16upx;
|
|
|
+ background-color: #fff;
|
|
|
}
|
|
|
-
|
|
|
-/* 右侧问号提示符:表明文案可点击查看全部免运费条件 */
|
|
|
-.policy-icon {
|
|
|
- display: inline-flex;
|
|
|
+.free-pt-tip-inner {
|
|
|
+ display: flex;
|
|
|
+ flex-direction: row;
|
|
|
align-items: center;
|
|
|
- justify-content: center;
|
|
|
- width: 28upx;
|
|
|
- height: 28upx;
|
|
|
- margin-left: 8upx;
|
|
|
+ padding: 20upx 24upx;
|
|
|
+ background-color: #fff8ef;
|
|
|
+ border: 2upx solid #ffe0b8;
|
|
|
+ border-left-width: 8upx;
|
|
|
+ border-left-color: #f0a020;
|
|
|
+ border-radius: 12upx;
|
|
|
+ box-sizing: border-box;
|
|
|
+}
|
|
|
+.free-pt-tip-badge {
|
|
|
+ flex-shrink: 0;
|
|
|
+ width: 40upx;
|
|
|
+ height: 40upx;
|
|
|
+ margin-right: 16upx;
|
|
|
+ border-radius: 8upx;
|
|
|
+ background-color: #f0a020;
|
|
|
+ color: #fff;
|
|
|
font-size: 22upx;
|
|
|
font-weight: bold;
|
|
|
- line-height: 28upx;
|
|
|
- color: rgb(201, 52, 52);
|
|
|
- background-color: transparent;
|
|
|
- border: 2upx solid rgb(201, 52, 52);
|
|
|
+ line-height: 40upx;
|
|
|
+ text-align: center;
|
|
|
+}
|
|
|
+.free-pt-tip-text {
|
|
|
+ flex: 1;
|
|
|
+ color: #c56a00;
|
|
|
+ font-size: 30upx;
|
|
|
+ font-weight: bold;
|
|
|
+ line-height: 1.45;
|
|
|
+ word-break: break-all;
|
|
|
+}
|
|
|
+/* 右侧问号:提示可点击查看全部免运费条件 */
|
|
|
+.free-pt-tip-action {
|
|
|
+ flex-shrink: 0;
|
|
|
+ width: 32upx;
|
|
|
+ height: 32upx;
|
|
|
+ margin-left: 12upx;
|
|
|
border-radius: 50%;
|
|
|
+ border: 2upx solid #f0a020;
|
|
|
+ color: #f0a020;
|
|
|
+ font-size: 22upx;
|
|
|
+ font-weight: bold;
|
|
|
+ line-height: 32upx;
|
|
|
+ text-align: center;
|
|
|
box-sizing: border-box;
|
|
|
}
|
|
|
|