|
|
@ -32,41 +32,7 @@ Page({ |
|
|
cartTop: 0, |
|
|
cartTop: 0, |
|
|
top: 0, |
|
|
top: 0, |
|
|
skuList: [], //立即预定的列表
|
|
|
skuList: [], //立即预定的列表
|
|
|
sku_ids: [ |
|
|
sku_ids: [] |
|
|
353954, |
|
|
|
|
|
353950, |
|
|
|
|
|
353949, |
|
|
|
|
|
353951, |
|
|
|
|
|
353947, |
|
|
|
|
|
353953, |
|
|
|
|
|
353685, |
|
|
|
|
|
353684, |
|
|
|
|
|
353952, |
|
|
|
|
|
353686, |
|
|
|
|
|
353948, |
|
|
|
|
|
354730, |
|
|
|
|
|
354409, |
|
|
|
|
|
354359, |
|
|
|
|
|
345343, |
|
|
|
|
|
354756, |
|
|
|
|
|
354385, |
|
|
|
|
|
354360, |
|
|
|
|
|
354361, |
|
|
|
|
|
354362, |
|
|
|
|
|
355466, |
|
|
|
|
|
355465, |
|
|
|
|
|
356230, |
|
|
|
|
|
356223, |
|
|
|
|
|
356207, |
|
|
|
|
|
346648, |
|
|
|
|
|
357518, |
|
|
|
|
|
356233, |
|
|
|
|
|
354381, |
|
|
|
|
|
354384, |
|
|
|
|
|
356324, |
|
|
|
|
|
354737, |
|
|
|
|
|
355467, |
|
|
|
|
|
] |
|
|
|
|
|
}, |
|
|
}, |
|
|
|
|
|
|
|
|
/** |
|
|
/** |
|
|
@ -89,6 +55,7 @@ Page({ |
|
|
commonApi._post("scene/detail", { |
|
|
commonApi._post("scene/detail", { |
|
|
id: options.id |
|
|
id: options.id |
|
|
}).then(res => { |
|
|
}).then(res => { |
|
|
|
|
|
let flag = false |
|
|
if (!res.data) { |
|
|
if (!res.data) { |
|
|
wx.showToast({ |
|
|
wx.showToast({ |
|
|
title: '产品已下架', |
|
|
title: '产品已下架', |
|
|
@ -122,22 +89,58 @@ Page({ |
|
|
if (pItem) { |
|
|
if (pItem) { |
|
|
res.data.product = [pItem]; |
|
|
res.data.product = [pItem]; |
|
|
} |
|
|
} |
|
|
|
|
|
} else if (options.zhuanti_type) { |
|
|
} else if (options.zhuanti_type == "yihuFree") { |
|
|
flag = true |
|
|
|
|
|
commonApi._post("theme/getYihuFreeList", { |
|
|
let skuArr = this.data.sku_ids |
|
|
zhuanti_type: options.zhuanti_type |
|
|
let newArr = [] |
|
|
}).then(res1 => { |
|
|
for (let i = 0; i < res.data.product.length; i++) { //3
|
|
|
let skuArr = res1.data.sku_ids |
|
|
for (let j = 0; j < res.data.product[i].sku.length; j++) { //4
|
|
|
let newArr = [] |
|
|
for (let k = 0; k < skuArr.length; k++) { |
|
|
for (let i = 0; i < res.data.product.length; i++) { //3
|
|
|
if (res.data.product[i].sku[j].id == skuArr[k]) { |
|
|
for (let j = 0; j < res.data.product[i].sku.length; j++) { //4
|
|
|
newArr.push(res.data.product[i].sku[j]) |
|
|
for (let k = 0; k < skuArr.length; k++) { |
|
|
|
|
|
if (res.data.product[i].sku[j].id == skuArr[k]) { |
|
|
|
|
|
newArr.push(res.data.product[i].sku[j]) |
|
|
|
|
|
} |
|
|
} |
|
|
} |
|
|
} |
|
|
} |
|
|
|
|
|
res.data.product[i].sku = newArr; |
|
|
} |
|
|
} |
|
|
res.data.product[i].sku = newArr; |
|
|
res.data.product.map(product => { |
|
|
} |
|
|
product.sku.map(sku => { |
|
|
|
|
|
sku.display_tags = (sku.display_tags ? sku.display_tags.split(",") : []).splice(0, 2); |
|
|
|
|
|
}) |
|
|
|
|
|
}) |
|
|
|
|
|
this.setData({ |
|
|
|
|
|
info: res.data |
|
|
|
|
|
}) |
|
|
|
|
|
var arr = [] |
|
|
|
|
|
res.data.product.forEach((item, index) => { |
|
|
|
|
|
item.sku.forEach(itemB => { |
|
|
|
|
|
itemB.proIndex = index |
|
|
|
|
|
arr.push(itemB) |
|
|
|
|
|
}) |
|
|
|
|
|
}); |
|
|
|
|
|
this.setData({ |
|
|
|
|
|
skuList: arr |
|
|
|
|
|
}) |
|
|
|
|
|
util.pagePoint({ |
|
|
|
|
|
event: 'scene_view', |
|
|
|
|
|
param: { |
|
|
|
|
|
type: res.data.type, |
|
|
|
|
|
id: res.data.id |
|
|
|
|
|
} |
|
|
|
|
|
}, 1) |
|
|
|
|
|
this.BroswerRecord() |
|
|
|
|
|
}) |
|
|
|
|
|
|
|
|
} |
|
|
} |
|
|
|
|
|
console.log(res.data.product); |
|
|
|
|
|
if (flag) { |
|
|
|
|
|
return |
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
// res.data.listimg = res.data.listimg?res.data.listimg.split(","):[];
|
|
|
// res.data.listimg = res.data.listimg?res.data.listimg.split(","):[];
|
|
|
res.data.product.map(product => { |
|
|
res.data.product.map(product => { |
|
|
product.sku.map(sku => { |
|
|
product.sku.map(sku => { |
|
|
|