zs %!s(int64=2) %!d(string=hai) anos
pai
achega
46aa31f57a
Modificáronse 1 ficheiros con 17 adicións e 0 borrados
  1. 17 0
      pagesHome/group/share.vue

+ 17 - 0
pagesHome/group/share.vue

@@ -151,6 +151,8 @@
 										</view>
 										<view class="one_3_1">
 											<text>库存{{specsInfo.num||0}}</text>
+											<text
+												class="limit" v-if="specsInfo.limit_num">({{specsInfo.buy_name||'暂无'}}{{specsInfo.limit_num||0}}个)</text>
 										</view>
 									</view>
 								</view>
@@ -204,6 +206,8 @@
 				is_specs: 0,
 				specsInfo: {},
 				infospecs: {},
+				// 限制说明
+				buyList: [],
 				// 购买数量
 				buy_num: 1,
 				// 是否零库存
@@ -311,6 +315,8 @@
 					let data = e.find(i => i.num > 0);
 					let dataIndex = e.findIndex(i => i._id == data._id);
 					if (data) {
+						let limit = that.buyList.find((i) => i.value == data.buy_limit);
+						if (limit) data.buy_name = limit.label
 						that.$set(that, `specsInfo`, data);
 						that.$set(that, `is_specs`, dataIndex);
 					}
@@ -398,6 +404,8 @@
 				const that = this;
 				let specs = that.info.specs;
 				let dataIndex = specs.findIndex(i => i._id == e._id);
+				let limit = that.buyList.find((i) => i.value == e.buy_limit);
+				if (limit) e.buy_name = limit.label
 				that.$set(that, `is_specs`, dataIndex);
 				that.$set(that, `specsInfo`, e)
 				that.$set(that, `buy_num`, 1);
@@ -486,6 +494,11 @@
 					shop: that.info?.shop?._id
 				});
 				if (res.errcode == '0') that.$set(that, `shopColect`, res.data)
+				// 限制说明
+				res = await that.$api(`/dictData`, 'GET', {
+					code: "buy_limit"
+				});
+				if (res.errcode == '0') that.$set(that, `buyList`, res.data)
 			},
 			// 配置分享内容
 			configShare() {
@@ -911,6 +924,10 @@
 								font-size: 14px;
 								color: #858585;
 							}
+							.limit {
+								color: #ff0000;
+								padding: 0 0 0 2vw;
+							}
 						}
 					}
 				}