Authored by huangyCode

修改商品详情

... ... @@ -160,6 +160,69 @@ class GroupApi extends global.yoho.BaseModel {
console.log(error);
});
}
getShopInfo(data) {
let param = {
method: 'app.product.queryShopsInfoById',
brand_id: data.brand_id,
shop_id: data.shop_id,
};
this.get({data: param})
.then(res =>{
let shopList = res.data;
if (shopList && shopList.length) {
let shopInfo = shopList[0];
shopInfo.brand_ico = shopInfo.brand_ico.replace(/{width}/g, 120)
.replace(/{height}/g, 60).replace('{mode}', 2);
return {
shopInfo,
shopList
};
} else {
return {
shopInfo: {},
shopList: []
};
}
});
}
// 详情页获取skn的拼团购信息
getCollageProductInfo(obj) {
let param = {
method: 'app.collage.productInfo',
productSkn: obj.productSkn,
activityId: obj.activityId
};
this.get({data: param})
.then(data => {
return data.data;
})
.catch(function(error) {
console.log(error);
});
}
fetchActivityGroups(obj) {
let param = {
method: 'app.activity.getGroups',
activityId: obj.activityId,
uid: obj.uid || 0,
productSkn: obj.productSkn
};
this.get({data: param})
.then(function(data) {
if (!data || !data.data) {
return;
}
return data.data;
});
}
}
module.exports = GroupApi;
... ...