Просмотр исходного кода

Merge refs/heads/商城唯一解锁 into refs/heads/测试

xiaohaizhao 9 месяцев назад
Родитель
Сommit
03b8075fee
1 измененных файлов с 9 добавлено и 7 удалено
  1. 9 7
      packageA/market/detail.js

+ 9 - 7
packageA/market/detail.js

@@ -50,7 +50,7 @@ Page({
 		}
 	},
 	/* 获取详情 */
-	getDetail(init = false, getCustom = true) {
+	getDetail(init = false) {
 		let content = this.data.content;
 		if (sys_enterpriseid) content.sys_enterpriseid = sys_enterpriseid;
 		if (this.data.UniqueLine)['spec', 'cheek', 'material', 'color'].forEach(key => content[key] = '')
@@ -100,6 +100,8 @@ Page({
 					if (obj[key].length) content[key] = obj[key][0].parm;
 				}
 			}
+			let itemCount = ['specRows', 'cheekRows', 'materialRows', 'colorRows'].filter(v => res.data[v].length).length,
+				selectCount = ['cheek', 'color', 'material', 'spec'].filter(v => content[v].length).length;
 
 			this.setData({
 				content,
@@ -107,13 +109,13 @@ Page({
 				row,
 				customschemeItems: res.data.customschemeItems,
 				loading: false,
-				itemCount: ['specRows', 'cheekRows', 'materialRows', 'colorRows'].filter(v => res.data[v].length).length,
-				selectCount: ['cheek', 'color', 'material', 'spec'].filter(v => content[v].length).length,
+				itemCount,
+				selectCount,
 				UniqueLine
 			});
 			//是否定制
-			if (item.iscustomsize == 1 && content.spec == "custom") {
-				if (getCustom) this.selectComponent("#customMade").init(item);
+			if (itemCount == selectCount && item.iscustomsize == 1) {
+				this.selectComponent("#customMade").init(item);
 			} else {
 				this.selectComponent("#customMade").setData({
 					list: []
@@ -185,7 +187,7 @@ Page({
 		this.setData({
 			selectCount: ['cheek', 'color', 'material', 'spec'].filter(v => content[v].length).length
 		})
-		this.getDetail(valuename == "spec")
+		this.getDetail()
 	},
 	/* 打开文档 */
 	openDocument(e) {
@@ -374,7 +376,7 @@ Page({
 			favoriteCount: getApp().globalData.favoriteCount,
 			badge: getApp().globalData.collectCount,
 		})
-		this.getDetail(true, this.data.loading);
+		this.getDetail(true);
 	},
 	/* 步进器输入框失去焦点 */
 	inputBlur(e) {