Эх сурвалжийг харах

【Mod】修改未选择SKU时的提示为提示对应的属性

liuxiangxin 5 сар өмнө
parent
commit
b5d0b5b8d8
1 өөрчлөгдсөн 16 нэмэгдсэн , 2 устгасан
  1. 16 2
      pages/product/index.vue

+ 16 - 2
pages/product/index.vue

@@ -562,8 +562,15 @@
 				if (!this.$checkAccess.alertCity()) return;
 				// 如果有SKU,但是没有选择
 				if (this.productInfo.product_sku.length && !this.sku_id) {
+					// 选择提示
+					let skuname	= [];
+					// 循环产品属性
+					for ( let i in this.productInfo.product_attr) {
+						// 属性名称
+						skuname.push(this.productInfo.product_attr[i].spec_name);
+					}
 					uni.showToast({
-						title: "请选择规格",
+						title: "请选择"+skuname.join(' 与 '),
 						icon: "none"
 					})
 					return;
@@ -700,8 +707,15 @@
 				if (!this.$checkAccess.alertCity()) return;
 				// 如果有SKU,但是没有选择
 				if (this.productInfo.product_sku.length && !this.sku_id) {
+					// 选择提示
+					let skuname	= [];
+					// 循环产品属性
+					for (let i in this.productInfo.product_attr) {
+						// 属性名称
+						skuname.push(this.productInfo.product_attr[i].spec_name);
+					}
 					uni.showToast({
-						title: "请选择规格",
+						title: "请选择"+skuname.join(' 与 '),
 						icon: "none"
 					})
 					return;