Authored by 郭成尧

'h5-call-app-up'

... ... @@ -13,7 +13,7 @@ exports.index = (req, res, next) => {
uid = req.user.uid;
}
var param = {
let param = {
contentCode: req.query.code
};
... ... @@ -35,7 +35,8 @@ exports.index = (req, res, next) => {
navTitle: '领券中心'
}),
content: result,
noLoginUrl: result.noLoginUrl
noLoginUrl: result.noLoginUrl,
appPath: 'yohobuy://yohobuy.com/goapp?openby:yohobuy={"action":"go.couponCenter", "params":{"share":"/operations/api/v5/webshare/getShare","share_id":"1037","title":"领券中心"}}' //eslint-disable-line
});
}).catch(next);
};
... ...
... ... @@ -90,7 +90,8 @@ let index = (req, res, next) => {
channelList: result[0].channelList,
yohood: result[0].yohood,
double11: result[0].double11,
background: result[1]
background: result[1],
appPath: 'yohobuy://yohobuy.com/goapp?openby:yohobuy={"action":"go.home","params":{"channel":"1"}}'
});
}).catch(next);
};
... ... @@ -122,7 +123,8 @@ let boys = (req, res, next) => {
_channelPage(req, res, {
gender: 'boys',
title: '男生 | Yoho!Buy有货 | 潮流购物逛不停',
boysHomePage: true
boysHomePage: true,
appPath: 'yohobuy://yohobuy.com/goapp?openby:yohobuy={"action":"go.home","params":{"channel":"1"}}'
}).catch(next); // TODO 我们在路由处理的最上层的方法处理catch
};
... ... @@ -133,7 +135,8 @@ let girls = (req, res, next) => {
_channelPage(req, res, {
gender: 'girls',
title: '女生 | Yoho!Buy有货 | 潮流购物逛不停',
girlsHomePage: true
girlsHomePage: true,
appPath: 'yohobuy://yohobuy.com/goapp?openby:yohobuy={"action":"go.home","params":{"channel":"2"}}'
}).catch(next);
};
... ... @@ -145,7 +148,8 @@ let kids = (req, res, next) => {
_channelPage(req, res, {
gender: 'kids',
title: '潮童 | Yoho!Buy有货 | 潮流购物逛不停',
kidsHomePage: true
kidsHomePage: true,
appPath: 'yohobuy://yohobuy.com/goapp?openby:yohobuy={"action":"go.home","params":{"channel":"3"}}'
}).catch(next);
};
... ... @@ -156,7 +160,8 @@ let lifestyle = (req, res, next) => {
_channelPage(req, res, {
gender: 'lifestyle',
title: '创意生活 | Yoho!Buy有货 | 潮流购物逛不停',
lifestyleHomePage: true
lifestyleHomePage: true,
appPath: 'yohobuy://yohobuy.com/goapp?openby:yohobuy={"action":"go.home","params":{"channel":"4"}}'
}).catch(next);
};
... ...
... ... @@ -65,7 +65,7 @@ const _baseShop = (req, res, shopInfo, shopId) => {
};
/**
* TODO TAR 店铺和品牌收藏状态调用新的接口
*
* 基础模板收藏
*/
const baseShopFav = (req, res) => {
... ... @@ -183,7 +183,7 @@ const shopAppCookie = (req, res) => {
};
/**
* TODO TAR 店铺和品牌收藏状态调用新的接口
*
* 前端请求判断shop是否收藏
*/
const shopFav = (req, res) => {
... ... @@ -212,6 +212,15 @@ const shopFav = (req, res) => {
const category = (req, res, next) => {
let params = Object.assign({}, req.query);
/* 勿修改,唤起 APP 使用 */
let appParams = Object.assign({}, req.query, {
title: req.query.sort_name || ''
});
let appPath = 'yohobuy://yohobuy.com/goapp?openby:yohobuy={"action":"go.list","params":' +
JSON.stringify(appParams) +
'}';
// 获取第一页数据做服务端渲染
let initialData = _.assign({
gender: params.gender,
... ... @@ -242,7 +251,8 @@ const category = (req, res, next) => {
showDownloadApp: true,
pageFooter: true,
category: true,
localCss: true
localCss: true,
appPath: appPath
});
}).catch(next);
};
... ... @@ -344,7 +354,7 @@ const brand = (req, res, next) => {
};
/**
* TODO TAR 店铺和品牌收藏状态调用新的接口
*
* @param req
* @param res
*/
... ...
... ... @@ -32,13 +32,19 @@ const newDetail = {
result.id = id;
result.goodsId = goodsId;
let appParams = {product_skn: result.productSkn};
let appPath = 'yohobuy://yohobuy.com/goapp?openby:yohobuy={"action":"go.productDetail","params":' +
JSON.stringify(appParams) +
'}';
res.render('detail/new/detail', {
pageHeader: headerData,
result: result,
page: 'new-detail',
title: result.goodsName,
pageFooter: true,
localCss: true
localCss: true,
appPath: appPath
});
}).catch(next);
},
... ...
... ... @@ -61,7 +61,8 @@
<link rel="apple-touch-startup-image" sizes="320x460" href="http://static.yohobuy.com/m/v1/img/startup/startup.png" media="screen and (max-device-width: 320)">
</head>
<body class="{{pageStyle}} {{#if isWechat}}wechat-body{{/if}} {{#if width750}}width750{{/if}} {{#if isPassportPage}}passport-body{{/if}} {{#if isStarIndexPage}}star-index-bg{{/if}} {{#if isStarDetailPage}}star-class-body{{/if}} {{#if isInstallmentPage}}installment-body{{/if}}">
<div class="main-wrap">
{{log appPath}}
<div class="main-wrap" id="main-wrap" {{#if appPath}}data-apppath='{{appPath}}'{{/if}}>
{{#if systemUpdate}}
{{> updata}}
{{/if}}
... ...
... ... @@ -4,7 +4,7 @@
const qs = require('yoho-qs');
const getAppPath = () => {
return 'yohobuy://yohobuy.com/goapp?{"action":"go.productDetail","params":{"product_skn":"51256842",tags_filter: "1"}}';
return document.getElementById("main-wrap").dataset.apppath || 'yohobuy://yohobuy.com/goapp?openby:yohobuy={"action":"go.home","params":{"gender":"1","channel":"2"}}';
};
if (qs.openapp) {
... ...