Parcourir la source

花卉宝--花材页加上满多少扎的优惠提示

修改说明
1. 行高:当 presell == 1 或 Number(reachNum) > 0 时使用 middle-box(215upx),避免出现满扎文案被裁切;仅普通商品仍为 box(185upx)。

2. 文案(与同页原有「配送日」一致用词):
	reachNum > 0 时:满 X 扎,每扎优惠 ¥Y;
	非预售(presell == 0)时追加 (提交订单后优惠);
	若同时是预售,在满扎文案后用 , 再接 配送日: 与 presellDateShow 列表。

3. 结构:原 <template v-for> 与 ESLint 规则冲突,已改为外层 <view v-for>,key 挂在真实节点上,当前该文件无新的 lint 报错。
shizhongqi il y a 2 mois
Parent
commit
ff9d82935b
1 fichiers modifiés avec 18 ajouts et 11 suppressions
  1. 18 11
      mallApp/src/pages/item/item.vue

+ 18 - 11
mallApp/src/pages/item/item.vue

@@ -42,8 +42,12 @@
 				<block v-if="!$util.isEmpty(filterProductInfo)">
 					<view class="item_list_bx selectAll" v-for="(classItem, classIndex) in filterProductInfo" :key="classIndex" :id="`class_${classIndex}`">
 						<view class="item_list_title">{{ classItem.className }}</view>
-						<template v-for="(productItem, productIndex) in classItem.child">
-							<view :class="[productItem.presell == 1 ? 'middle-box' : 'box']" :id="`class_${classItem.classId}_${productItem.id}`" :key="productIndex">
+						<view
+							v-for="(productItem, productIndex) in classItem.child"
+							:key="productIndex"
+							:class="[(productItem.presell == 1 || Number(productItem.reachNum) > 0) ? 'middle-box' : 'box']"
+							:id="`class_${classItem.classId}_${productItem.id}`"
+						>
 								<Commondity v-if="classItem.isActive"
 									:info="productItem"
 									:offVerifyRepertory="true"
@@ -56,17 +60,20 @@
 									@showBigCover="showBigCover"
 									@goToSpecialVariety="goToSpecialVariety"
 								></Commondity>
-								<view v-if="productItem.presell && productItem.presell == 1" style="position:absolute;top:150upx;font-size:26upx;color:#3385ff;white-space: nowrap;text-overflow: hidden;">
-									配送日:
-									<block v-if="!$util.isEmpty(productItem.presellDateShow)">
-										<text v-for="(dateItem, dateIndex) in productItem.presellDateShow" :key="dateIndex" style="">
-											{{dateItem}}
-											<text v-if="dateIndex!=productItem.presellDateShow.length-1">,</text>
-										</text>
+								<view v-if="productItem.presell == 1 || Number(productItem.reachNum) > 0" style="position:absolute;top:150upx;font-size:26upx;color:#3385ff;white-space: normal;word-wrap: break-word;">
+									<text style="font-weight:bold;" v-if="Number(productItem.reachNum) > 0">
+										满{{ productItem.reachNum }}扎,每扎优惠 ¥{{ parseFloat(productItem.reachNumDiscount) }}<block v-if="productItem.presell == 0">(提交订单后优惠)</block>
+									</text>
+									<block v-if="productItem.presell && productItem.presell == 1"><block v-if="Number(productItem.reachNum) > 0">,</block>配送日:
+										<block v-if="!$util.isEmpty(productItem.presellDateShow)">
+											<text v-for="(dateItem, dateIndex) in productItem.presellDateShow" :key="dateIndex">
+												{{ dateItem }}
+												<text v-if="dateIndex != productItem.presellDateShow.length - 1">,</text>
+											</text>
+										</block>
 									</block>
 								</view>
-							</view>
-						</template>
+						</view>
 					</view>
 				</block>
 				<block v-else>