Authored by yyq

小程序码

... ... @@ -129,7 +129,7 @@ class featureModel extends global.yoho.BaseModel {
/**
* 拼团商品列表
*/
_getCollageProductList(collageInfo, ctx) { // eslint-disable-line
_getCollageProductList(collageInfo) {
let activityId = collageInfo.collageActivityId;
if (!activityId) {
... ... @@ -152,13 +152,9 @@ class featureModel extends global.yoho.BaseModel {
let replaceKey = '__skn__';
let replaceReg = new RegExp(replaceKey, 'g');
let productUrl = `//m.yohobuy.com/product/${replaceKey}.html?openby:yohobuy={"action":"go.productDetail","params":{"product_skn":"${replaceKey}","activity_id":"${activityId}","activity_type":"groupPurchase"}}`; // eslint-disable-line
let productUrl = `//m.yohobuy.com/product/${replaceKey}.html?type=groupPurchase&&skn=${replaceKey}&&activity_id=${activityId}&&openby:yohobuy={"action":"go.productDetail","params":{"product_skn":"${replaceKey}","activity_id":"${activityId}","activity_type":"groupPurchase"}}`; // eslint-disable-line
let defaultPros = _.get(result, 'data.collageProductVoList', []);
// if (!ctx.req.yoho.isApp) {
// productUrl = 'javascript:;'; // eslint-disable-line
// }
defaultPros.forEach(val => {
val.producturl = productUrl.replace(replaceReg, val.productSkn);
});
... ...
... ... @@ -62,6 +62,18 @@ const newDetail = {
let description = result.goodsName + ' 有货网仅售' + result.goodsPrice.currentPrice + '元,购买' +
result.brandName + result.sortName + ',了解' + result.brandName + result.sortName + '商品信息就上有货网!';
let miniAppParams = {
productSkn: result.productSkn,
union_type: req.query.union_type || req.cookies.unionTypeYas || '',
};
let miniQrType: 7;
// 拼团展示拼团小程序码
if (req.query.type === 'groupPurchase') {
miniQrType = 17;
miniAppParams.activityId = req.query.activity_id || '';
}
res.render('detail/new/detail', {
pageHeader: headerData,
result: result,
... ... @@ -79,11 +91,8 @@ const newDetail = {
isMarsApp: req.yoho.isMarsApp, // 判断mars
miniPath: helpers.urlFormat('/api/wechat/miniapp.jpg', {
miniapp_type: 0,
param: JSON.stringify({
productSkn: result.productSkn,
union_type: req.query.union_type || req.cookies.unionTypeYas || '',
}),
miniQrType: 7,
param: JSON.stringify(miniAppParams),
miniQrType: miniQrType,
isOpen: _.get(req.app, 'locals.wap.wechat.miniPathOpen', false)
}), // param:品牌ID, name:品牌名称, miniQrType 7:商品 2 品牌,miniapp_type 0:有货,1:新与力,union_type商品详情页和默认页加
miphtml: `https://m.yohobuy.com/mip/product/${result.productSkn}.html`,
... ...