...
|
...
|
@@ -11,7 +11,8 @@ module.exports = class extends global.yoho.BaseModel { |
|
|
let options = {
|
|
|
url: 'operations/api/v5/resource/home',
|
|
|
data: {
|
|
|
content_code: '8512bf0755cc549ac323f852c9fd945d'
|
|
|
content_code: '8512bf0755cc549ac323f852c9fd945d',
|
|
|
platform: 'iphone'
|
|
|
},
|
|
|
param: {
|
|
|
cache: true,
|
...
|
...
|
@@ -73,13 +74,17 @@ module.exports = class extends global.yoho.BaseModel { |
|
|
|
|
|
_.forEach(data, (val) => {
|
|
|
let discount = this.getDiscound(val.sales_price, val.market_price);
|
|
|
let url = `//m.yohobuy.com/product/${val.product_skn}.html`;
|
|
|
|
|
|
if (params.isApp) {
|
|
|
url += `?openby:yohobuy={"action":"go.productDetail","params":{"product_skn":"${val.product_skn}"}}`; // eslint-disable-line
|
|
|
}
|
|
|
build.push({
|
|
|
productName: val.product_name,
|
|
|
salesPrice: val.sales_price,
|
|
|
marketPrice: val.market_price === val.sales_price ? '' : val.market_price,
|
|
|
defaultImages: val.default_images ? val.default_images.split(',')[0] : '',
|
|
|
productSkn: val.product_skn,
|
|
|
url: url,
|
|
|
discount: discount
|
|
|
});
|
|
|
});
|
...
|
...
|
@@ -116,13 +121,18 @@ module.exports = class extends global.yoho.BaseModel { |
|
|
|
|
|
_.forEach(data, (val) => {
|
|
|
let discount = this.getDiscound(val.sales_price, val.market_price);
|
|
|
let url = `//m.yohobuy.com/product/${val.product_skn}.html`;
|
|
|
|
|
|
if (params.isApp) {
|
|
|
url += `?openby:yohobuy={"action":"go.productDetail","params":{"product_skn":"${val.product_skn}"}}`; // eslint-disable-line
|
|
|
}
|
|
|
|
|
|
build.push({
|
|
|
productName: val.product_name,
|
|
|
salesPrice: val.sales_price,
|
|
|
marketPrice: val.market_price === val.sales_price ? '' : val.market_price,
|
|
|
defaultImages: val.default_images ? val.default_images.split(',')[0] : '',
|
|
|
productSkn: val.product_skn,
|
|
|
url: url,
|
|
|
discount: discount
|
|
|
});
|
|
|
});
|
...
|
...
|
|