Parcourir la source

商城自动选项

xiaohaizhao il y a 1 an
Parent
commit
af837ef5a6
1 fichiers modifiés avec 10 ajouts et 3 suppressions
  1. 10 3
      packageA/market/detail.js

+ 10 - 3
packageA/market/detail.js

@@ -80,13 +80,20 @@ Page({
 			item.gradeprice = CNY(item.gradeprice);
 			item.marketprice = CNY(item.marketprice);
 			item.qty = item.orderaddqty;
-			this.setData({
-				content,
-				detail: item,
+			let ros = {
 				specRows: res.data.specRows.reverse(),
 				cheekRows: res.data.cheekRows,
 				materialRows: res.data.materialRows,
 				colorRows: res.data.colorRows,
+			};
+			['spec', 'cheek', 'material', 'color'].forEach(key => {
+				let list = ros[key + 'Rows'].filter(v => v.flag);
+				if (list.length == 1) content[key] = list[0].parm
+			})
+			this.setData({
+				content,
+				detail: item,
+				...ros,
 				loading: false,
 				itemCount: ['specRows', 'cheekRows', 'materialRows', 'colorRows'].filter(v => res.data[v].length).length
 			});