shish 1 روز پیش
والد
کامیت
0fc80d2daf
1فایلهای تغییر یافته به همراه34 افزوده شده و 7 حذف شده
  1. 34 7
      hdApp/src/admin/billing/affirmSh.vue

+ 34 - 7
hdApp/src/admin/billing/affirmSh.vue

@@ -101,10 +101,10 @@
 							</view>
 						</tui-list-cell>
 
-						<!-- 未达标提示 -->
-						<tui-list-cell class="line-cell" :hover="false" :arrow="false" v-if="showShMethodExtraFee">
+						<!-- 未达标提示:加运费/加包装费/不能下单 -->
+						<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;">{{ shMethodUnMeetWarningText }}</text>
+								<text style="color: red;width:100%;font-weight: bold;font-size: 30upx;text-decoration: underline;">{{ shMethodUnMeetWarningText }}</text>
 							</view>
 						</tui-list-cell>
 
@@ -411,6 +411,24 @@ export default {
 			const fee = Number(method.unMeetFee) || 0
 			return (unMeet === 0 || unMeet === 1) && fee > 0
 		},
+		/**
+		 * 未达配送方式最低消费时是否展示红色提示
+		 * unMeet:0 加运费、1 加包装费、2 不能下单
+		 */
+		showShMethodUnMeetWarning() {
+			const method = this.currentShMethod
+			if (!method || !this.checkShMethodBelowMinimum(method)) {
+				return false
+			}
+			const unMeet = Number(method.unMeet) || 0
+			// 不能下单:直接提示
+			if (unMeet === 2) {
+				return true
+			}
+			// 加运费 / 加包装费:有费用时提示
+			const fee = Number(method.unMeetFee) || 0
+			return (unMeet === 0 || unMeet === 1) && fee > 0
+		},
 		shMethodExtraFeeLabel() {
 			const method = this.currentShMethod
 			if (!method) {
@@ -425,6 +443,7 @@ export default {
 			const method = this.currentShMethod
 			return parseFloat(Number(method && method.unMeetFee) || 0)
 		},
+		/** 未达标红色文案:加运费/包装费金额,或不能下单 */
 		shMethodUnMeetWarningText() {
 			const method = this.currentShMethod
 			if (!method) {
@@ -434,13 +453,21 @@ export default {
 			const minAmount = Number(method.minAmount) || 0
 			const minNum = Number(method.minNum) || 0
 			if (minAmount > 0) {
-				tips.push("满" + minAmount + "元")
+				tips.push("满" + minAmount + "元")
 			}
 			if (minNum > 0) {
-				tips.push("满" + minNum + "扎")
+				tips.push("满" + minNum + "扎")
 			}
 			const conditionText = tips.length > 0 ? tips.join("或") : "未达最低消费"
-			return "当天订单" + conditionText + ",加" + this.shMethodExtraFeeLabel + this.shMethodExtraFeeAmount + "元"
+			const unMeet = Number(method.unMeet) || 0
+			// unMeet=2:未满最低消费则禁止下单
+			if (unMeet === 2) {
+				return conditionText + ",不能下单"
+			}
+			// unMeet=0 加运费;unMeet=1 加包装费,并写出具体金额
+			const fee = parseFloat(Number(method.unMeetFee) || 0)
+			const feeLabel = unMeet === 1 ? "包装费" : "运费"
+			return conditionText + ",加" + feeLabel + fee + "元"
 		},
 		currentMethodExplains() {
 			const method = this.currentShMethod
@@ -974,7 +1001,7 @@ 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 = []