|  | @@ -27,8 +27,7 @@ Page({
 | 
	
		
			
				|  |  |  			spec: ""
 | 
	
		
			
				|  |  |  		},
 | 
	
		
			
				|  |  |  		privacyFieldC: [],
 | 
	
		
			
				|  |  | -		isShowFavorites: false,
 | 
	
		
			
				|  |  | -		UniqueLine: false
 | 
	
		
			
				|  |  | +		isShowFavorites: false
 | 
	
		
			
				|  |  |  	},
 | 
	
		
			
				|  |  |  	onLoad(options) {
 | 
	
		
			
				|  |  |  		let data = JSON.parse(options.params);
 | 
	
	
		
			
				|  | @@ -50,10 +49,9 @@ Page({
 | 
	
		
			
				|  |  |  		}
 | 
	
		
			
				|  |  |  	},
 | 
	
		
			
				|  |  |  	/* 获取详情 */
 | 
	
		
			
				|  |  | -	getDetail(init = false) {
 | 
	
		
			
				|  |  | +	getDetail(reset = 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] = '')
 | 
	
		
			
				|  |  |  		_Http.basic({
 | 
	
		
			
				|  |  |  			"id": "20221223165503",
 | 
	
		
			
				|  |  |  			content
 | 
	
	
		
			
				|  | @@ -84,25 +82,17 @@ Page({
 | 
	
		
			
				|  |  |  				materialRows: res.data.materialRows,
 | 
	
		
			
				|  |  |  				colorRows: res.data.colorRows,
 | 
	
		
			
				|  |  |  			};
 | 
	
		
			
				|  |  | -
 | 
	
		
			
				|  |  |  			let obj = {},
 | 
	
		
			
				|  |  | -				auto = true,
 | 
	
		
			
				|  |  | -				UniqueLine = true;
 | 
	
		
			
				|  |  | +				isRecursion = false;
 | 
	
		
			
				|  |  |  			res.data.customschemeItems.map(v => v.value).forEach(key => obj[key] = row[key + 'Rows'].filter(v => v.flag))
 | 
	
		
			
				|  |  |  			for (const key in obj) {
 | 
	
		
			
				|  |  | -				if (obj[key].length > 1) {
 | 
	
		
			
				|  |  | -					auto = false
 | 
	
		
			
				|  |  | -					UniqueLine = false;
 | 
	
		
			
				|  |  | -				}
 | 
	
		
			
				|  |  | -			}
 | 
	
		
			
				|  |  | -			if (auto) {
 | 
	
		
			
				|  |  | -				for (const key in obj) {
 | 
	
		
			
				|  |  | -					if (obj[key].length) content[key] = obj[key][0].parm;
 | 
	
		
			
				|  |  | +				if (obj[key].length == 1) {
 | 
	
		
			
				|  |  | +					content[key] = obj[key][0].parm;
 | 
	
		
			
				|  |  | +					isRecursion = true;
 | 
	
		
			
				|  |  |  				}
 | 
	
		
			
				|  |  |  			}
 | 
	
		
			
				|  |  | -			let itemCount = ['specRows', 'cheekRows', 'materialRows', 'colorRows'].filter(v => res.data[v].length).length,
 | 
	
		
			
				|  |  | +			let itemCount = res.data.customschemeItems.length,
 | 
	
		
			
				|  |  |  				selectCount = ['cheek', 'color', 'material', 'spec'].filter(v => content[v].length).length;
 | 
	
		
			
				|  |  | -
 | 
	
		
			
				|  |  |  			this.setData({
 | 
	
		
			
				|  |  |  				content,
 | 
	
		
			
				|  |  |  				detail: item,
 | 
	
	
		
			
				|  | @@ -110,9 +100,15 @@ Page({
 | 
	
		
			
				|  |  |  				customschemeItems: res.data.customschemeItems,
 | 
	
		
			
				|  |  |  				loading: false,
 | 
	
		
			
				|  |  |  				itemCount,
 | 
	
		
			
				|  |  | -				selectCount,
 | 
	
		
			
				|  |  | -				UniqueLine
 | 
	
		
			
				|  |  | +				selectCount
 | 
	
		
			
				|  |  |  			});
 | 
	
		
			
				|  |  | +			if (!reset && isRecursion) {
 | 
	
		
			
				|  |  | +				wx.showLoading({
 | 
	
		
			
				|  |  | +					title: '加载中...',
 | 
	
		
			
				|  |  | +					mask: true
 | 
	
		
			
				|  |  | +				})
 | 
	
		
			
				|  |  | +				this.getDetail(true)
 | 
	
		
			
				|  |  | +			}
 | 
	
		
			
				|  |  |  			//是否定制
 | 
	
		
			
				|  |  |  			if (itemCount == selectCount && item.iscustomsize == 1) {
 | 
	
		
			
				|  |  |  				this.selectComponent("#customMade").init(item);
 | 
	
	
		
			
				|  | @@ -182,10 +178,14 @@ Page({
 | 
	
		
			
				|  |  |  			title: '加载中...',
 | 
	
		
			
				|  |  |  			mask: true
 | 
	
		
			
				|  |  |  		})
 | 
	
		
			
				|  |  | -		// UniqueLine
 | 
	
		
			
				|  |  | -		content[valuename] = (content[valuename] == value.parm) ? "" : value.parm;
 | 
	
		
			
				|  |  | +		if (content[valuename] == value.parm && this.data.row[valuename + 'Rows'].filter(v => v.flag).length == 1) {
 | 
	
		
			
				|  |  | +			['spec', 'cheek', 'material', 'color'].forEach(key => content[key] = '')
 | 
	
		
			
				|  |  | +		} else {
 | 
	
		
			
				|  |  | +			content[valuename] = (content[valuename] == value.parm) ? "" : value.parm;
 | 
	
		
			
				|  |  | +		}
 | 
	
		
			
				|  |  |  		this.setData({
 | 
	
		
			
				|  |  | -			selectCount: ['cheek', 'color', 'material', 'spec'].filter(v => content[v].length).length
 | 
	
		
			
				|  |  | +			selectCount: ['cheek', 'color', 'material', 'spec'].filter(v => content[v].length).length,
 | 
	
		
			
				|  |  | +			content
 | 
	
		
			
				|  |  |  		})
 | 
	
		
			
				|  |  |  		this.getDetail()
 | 
	
		
			
				|  |  |  	},
 |