|
@@ -26,17 +26,16 @@ Page({
|
|
|
idname: options.idname || this.data.idname,
|
|
|
showName: options.showName || this.data.showName,
|
|
|
newPrice: options.newprice || "marketprice", //红色价格
|
|
|
- oldPrice: options.oldprice || "oldprice" //对比老价格
|
|
|
});
|
|
|
this.getList()
|
|
|
},
|
|
|
getList(init = false) {
|
|
|
+ console.log('发送')
|
|
|
//init 用于初始化分页
|
|
|
if (init.detail != undefined) init = init.detail;
|
|
|
let params = this.data.params;
|
|
|
if (init) params.content.pageNumber = 1
|
|
|
if (params.content.pageNumber > params.content.pageTotal) return;
|
|
|
-
|
|
|
_Http.basic(params).then(res => {
|
|
|
console.log("选择产品列表", res)
|
|
|
this.selectComponent('#ListBox').RefreshToComplete();
|
|
@@ -48,18 +47,14 @@ Page({
|
|
|
symbol: "¥",
|
|
|
precision: 2
|
|
|
}).format();
|
|
|
- let newPrice = this.data.newPrice,
|
|
|
- oldPrice = this.data.oldPrice;
|
|
|
+ let newPrice = this.data.newPrice;
|
|
|
res.data = res.data.map(value => {
|
|
|
if (value.attinfos.length != 0) {
|
|
|
value.attinfos = file.fileList(value.attinfos)
|
|
|
let image = value.attinfos.find(v => v.fileType == "image");
|
|
|
value.cover = image ? image.cover : "";
|
|
|
}
|
|
|
-
|
|
|
if (newPrice) value.newPrice = CNY(value[newPrice] || 0);
|
|
|
- if (oldPrice) value.oldPrice = CNY(value[oldPrice] || 0);
|
|
|
-
|
|
|
value.brandName = value.brand.map(name => name.brandname)
|
|
|
value.tradefields = value.tradefield.map(name => name.tradefield)
|
|
|
return value;
|