|
@@ -2,10 +2,6 @@ const _Http = getApp().globalData.http;
|
|
|
let sa_brandid = null,
|
|
|
sys_enterpriseid = null;
|
|
|
|
|
|
-import {
|
|
|
- getLabelList
|
|
|
-} from "../../utils/customItemType";
|
|
|
-
|
|
|
import {
|
|
|
fileList
|
|
|
} from "../../utils/FormatTheAttachment";
|
|
@@ -15,7 +11,6 @@ Page({
|
|
|
data: {
|
|
|
itemCount: 0,
|
|
|
selectCount: 0,
|
|
|
- labelList: getLabelList(),
|
|
|
hidePrice: wx.getStorageSync('hidePrice'),
|
|
|
badge: getApp().globalData.collectCount,
|
|
|
favoriteCount: getApp().globalData.favoriteCount,
|
|
@@ -27,11 +22,13 @@ Page({
|
|
|
material: "", //材质
|
|
|
cheek: "" //边框
|
|
|
},
|
|
|
+ itmes: [],
|
|
|
detail: {
|
|
|
spec: ""
|
|
|
},
|
|
|
privacyFieldC: [],
|
|
|
- isShowFavorites: false
|
|
|
+ isShowFavorites: false,
|
|
|
+ UniqueLine: false
|
|
|
},
|
|
|
onLoad(options) {
|
|
|
let data = JSON.parse(options.params);
|
|
@@ -56,6 +53,7 @@ Page({
|
|
|
getDetail(init = false, getCustom = true) {
|
|
|
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
|
|
@@ -80,7 +78,7 @@ Page({
|
|
|
item.gradeprice = CNY(item.gradeprice);
|
|
|
item.marketprice = CNY(item.marketprice);
|
|
|
item.qty = item.orderaddqty;
|
|
|
- let ros = {
|
|
|
+ let row = {
|
|
|
specRows: res.data.specRows.reverse(),
|
|
|
cheekRows: res.data.cheekRows,
|
|
|
materialRows: res.data.materialRows,
|
|
@@ -88,25 +86,32 @@ Page({
|
|
|
};
|
|
|
|
|
|
let obj = {},
|
|
|
- auto = true;
|
|
|
- ['spec', 'cheek', 'material', 'color'].forEach(key => obj[key] = ros[key + 'Rows'].filter(v => v.flag))
|
|
|
-
|
|
|
+ auto = true,
|
|
|
+ UniqueLine = true;
|
|
|
+ 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;
|
|
|
+ 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;
|
|
|
}
|
|
|
}
|
|
|
+
|
|
|
this.setData({
|
|
|
content,
|
|
|
detail: item,
|
|
|
- ...ros,
|
|
|
+ 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
|
|
|
+ selectCount: ['cheek', 'color', 'material', 'spec'].filter(v => content[v].length).length,
|
|
|
+ UniqueLine
|
|
|
});
|
|
|
+ console.log("itmes", this.data.itmes)
|
|
|
//是否定制
|
|
|
if (getCustom && item.iscustomsize == 1) this.selectComponent("#customMade").init(item);
|
|
|
})
|
|
@@ -170,6 +175,7 @@ Page({
|
|
|
title: '加载中...',
|
|
|
mask: true
|
|
|
})
|
|
|
+ // UniqueLine
|
|
|
content[valuename] = (content[valuename] == value.parm) ? "" : value.parm;
|
|
|
this.setData({
|
|
|
selectCount: ['cheek', 'color', 'material', 'spec'].filter(v => content[v].length).length
|
|
@@ -320,7 +326,7 @@ Page({
|
|
|
}
|
|
|
//是否为定制项
|
|
|
if (detail.iscustomsize == 1) custom = this.selectComponent("#customMade").getResult(true);
|
|
|
- console.log("custom",custom)
|
|
|
+ console.log("custom", custom)
|
|
|
if (typeof custom == "boolean") return;
|
|
|
content.items = [Object.assign({
|
|
|
sa_orderitemsid: 0,
|