Authored by 郭成尧

order-goods

... ... @@ -72,7 +72,8 @@ class payModel extends global.yoho.BaseModel {
payment_amount: _.get(result, 'data.order_extInfo.payment_amount') ||
_.get(result, 'data.payment_amount'),
pay_expire: _.get(result, 'data.order_detail_info.ext.pay_expire') ||
_.get(result, 'data.pay_expire')
_.get(result, 'data.pay_expire'),
order_goods: _.get(result, 'data.order_goods')
}
};
}
... ... @@ -95,21 +96,14 @@ class payModel extends global.yoho.BaseModel {
// 购买此商品的用户也购买了,要先从订单详情获取商品skn
_getOthersBuy(param) {
return Promise.all([
this.getOtherDetail(param)
]).then((result) => {
this.getOtherDetail(param).then(result => {
let skn = _.get(result, 'data.order_goods.0.product_skn', '');
let goodSkn = '';
if (result && result[0] && result[0].data && result[0].data.order_goods) {
goodSkn = result[0].data.order_goods[0].product_skn;
if (skn) {
return this._getOthersBuy2(Object.assign(param, { skn: skn }));
} else {
return Promise.resolve([]);
}
return this._getOthersBuy2(Object.assign(param, { skn: goodSkn }));
}).then((result) => {
return result;
});
}
... ...
... ... @@ -59,11 +59,13 @@
</a>
{{/data}}
{{/banner}}
{{#if othersBuy}}
<div class="others-buy clearfix">
<p>购买此商品的用户也购买了</p>
{{# othersBuy}}
{{> common/goods}}
{{/ othersBuy}}
</div>
{{/if}}
{{> home/maybe-like}}
</div>
... ...