Showing
6 changed files
with
37 additions
and
14 deletions
@@ -13,7 +13,7 @@ exports.index = (req, res, next) => { | @@ -13,7 +13,7 @@ exports.index = (req, res, next) => { | ||
13 | uid = req.user.uid; | 13 | uid = req.user.uid; |
14 | } | 14 | } |
15 | 15 | ||
16 | - var param = { | 16 | + let param = { |
17 | contentCode: req.query.code | 17 | contentCode: req.query.code |
18 | }; | 18 | }; |
19 | 19 | ||
@@ -35,7 +35,8 @@ exports.index = (req, res, next) => { | @@ -35,7 +35,8 @@ exports.index = (req, res, next) => { | ||
35 | navTitle: '领券中心' | 35 | navTitle: '领券中心' |
36 | }), | 36 | }), |
37 | content: result, | 37 | content: result, |
38 | - noLoginUrl: result.noLoginUrl | 38 | + noLoginUrl: result.noLoginUrl, |
39 | + appPath: 'yohobuy://yohobuy.com/goapp?openby:yohobuy={"action":"go.couponCenter", "params":{"share":"/operations/api/v5/webshare/getShare","share_id":"1037","title":"领券中心"}}' //eslint-disable-line | ||
39 | }); | 40 | }); |
40 | }).catch(next); | 41 | }).catch(next); |
41 | }; | 42 | }; |
@@ -90,7 +90,8 @@ let index = (req, res, next) => { | @@ -90,7 +90,8 @@ let index = (req, res, next) => { | ||
90 | channelList: result[0].channelList, | 90 | channelList: result[0].channelList, |
91 | yohood: result[0].yohood, | 91 | yohood: result[0].yohood, |
92 | double11: result[0].double11, | 92 | double11: result[0].double11, |
93 | - background: result[1] | 93 | + background: result[1], |
94 | + appPath: 'yohobuy://yohobuy.com/goapp?openby:yohobuy={"action":"go.home","params":{"channel":"1"}}' | ||
94 | }); | 95 | }); |
95 | }).catch(next); | 96 | }).catch(next); |
96 | }; | 97 | }; |
@@ -122,7 +123,8 @@ let boys = (req, res, next) => { | @@ -122,7 +123,8 @@ let boys = (req, res, next) => { | ||
122 | _channelPage(req, res, { | 123 | _channelPage(req, res, { |
123 | gender: 'boys', | 124 | gender: 'boys', |
124 | title: '男生 | Yoho!Buy有货 | 潮流购物逛不停', | 125 | title: '男生 | Yoho!Buy有货 | 潮流购物逛不停', |
125 | - boysHomePage: true | 126 | + boysHomePage: true, |
127 | + appPath: 'yohobuy://yohobuy.com/goapp?openby:yohobuy={"action":"go.home","params":{"channel":"1"}}' | ||
126 | }).catch(next); // TODO 我们在路由处理的最上层的方法处理catch | 128 | }).catch(next); // TODO 我们在路由处理的最上层的方法处理catch |
127 | }; | 129 | }; |
128 | 130 | ||
@@ -133,7 +135,8 @@ let girls = (req, res, next) => { | @@ -133,7 +135,8 @@ let girls = (req, res, next) => { | ||
133 | _channelPage(req, res, { | 135 | _channelPage(req, res, { |
134 | gender: 'girls', | 136 | gender: 'girls', |
135 | title: '女生 | Yoho!Buy有货 | 潮流购物逛不停', | 137 | title: '女生 | Yoho!Buy有货 | 潮流购物逛不停', |
136 | - girlsHomePage: true | 138 | + girlsHomePage: true, |
139 | + appPath: 'yohobuy://yohobuy.com/goapp?openby:yohobuy={"action":"go.home","params":{"channel":"2"}}' | ||
137 | }).catch(next); | 140 | }).catch(next); |
138 | }; | 141 | }; |
139 | 142 | ||
@@ -145,7 +148,8 @@ let kids = (req, res, next) => { | @@ -145,7 +148,8 @@ let kids = (req, res, next) => { | ||
145 | _channelPage(req, res, { | 148 | _channelPage(req, res, { |
146 | gender: 'kids', | 149 | gender: 'kids', |
147 | title: '潮童 | Yoho!Buy有货 | 潮流购物逛不停', | 150 | title: '潮童 | Yoho!Buy有货 | 潮流购物逛不停', |
148 | - kidsHomePage: true | 151 | + kidsHomePage: true, |
152 | + appPath: 'yohobuy://yohobuy.com/goapp?openby:yohobuy={"action":"go.home","params":{"channel":"3"}}' | ||
149 | }).catch(next); | 153 | }).catch(next); |
150 | }; | 154 | }; |
151 | 155 | ||
@@ -156,7 +160,8 @@ let lifestyle = (req, res, next) => { | @@ -156,7 +160,8 @@ let lifestyle = (req, res, next) => { | ||
156 | _channelPage(req, res, { | 160 | _channelPage(req, res, { |
157 | gender: 'lifestyle', | 161 | gender: 'lifestyle', |
158 | title: '创意生活 | Yoho!Buy有货 | 潮流购物逛不停', | 162 | title: '创意生活 | Yoho!Buy有货 | 潮流购物逛不停', |
159 | - lifestyleHomePage: true | 163 | + lifestyleHomePage: true, |
164 | + appPath: 'yohobuy://yohobuy.com/goapp?openby:yohobuy={"action":"go.home","params":{"channel":"4"}}' | ||
160 | }).catch(next); | 165 | }).catch(next); |
161 | }; | 166 | }; |
162 | 167 |
@@ -65,7 +65,7 @@ const _baseShop = (req, res, shopInfo, shopId) => { | @@ -65,7 +65,7 @@ const _baseShop = (req, res, shopInfo, shopId) => { | ||
65 | }; | 65 | }; |
66 | 66 | ||
67 | /** | 67 | /** |
68 | - * TODO TAR 店铺和品牌收藏状态调用新的接口 | 68 | + * |
69 | * 基础模板收藏 | 69 | * 基础模板收藏 |
70 | */ | 70 | */ |
71 | const baseShopFav = (req, res) => { | 71 | const baseShopFav = (req, res) => { |
@@ -183,7 +183,7 @@ const shopAppCookie = (req, res) => { | @@ -183,7 +183,7 @@ const shopAppCookie = (req, res) => { | ||
183 | }; | 183 | }; |
184 | 184 | ||
185 | /** | 185 | /** |
186 | - * TODO TAR 店铺和品牌收藏状态调用新的接口 | 186 | + * |
187 | * 前端请求判断shop是否收藏 | 187 | * 前端请求判断shop是否收藏 |
188 | */ | 188 | */ |
189 | const shopFav = (req, res) => { | 189 | const shopFav = (req, res) => { |
@@ -212,6 +212,15 @@ const shopFav = (req, res) => { | @@ -212,6 +212,15 @@ const shopFav = (req, res) => { | ||
212 | const category = (req, res, next) => { | 212 | const category = (req, res, next) => { |
213 | let params = Object.assign({}, req.query); | 213 | let params = Object.assign({}, req.query); |
214 | 214 | ||
215 | + /* 勿修改,唤起 APP 使用 */ | ||
216 | + let appParams = Object.assign({}, req.query, { | ||
217 | + title: req.query.sort_name || '' | ||
218 | + }); | ||
219 | + | ||
220 | + let appPath = 'yohobuy://yohobuy.com/goapp?openby:yohobuy={"action":"go.list","params":' + | ||
221 | + JSON.stringify(appParams) + | ||
222 | + '}'; | ||
223 | + | ||
215 | // 获取第一页数据做服务端渲染 | 224 | // 获取第一页数据做服务端渲染 |
216 | let initialData = _.assign({ | 225 | let initialData = _.assign({ |
217 | gender: params.gender, | 226 | gender: params.gender, |
@@ -242,7 +251,8 @@ const category = (req, res, next) => { | @@ -242,7 +251,8 @@ const category = (req, res, next) => { | ||
242 | showDownloadApp: true, | 251 | showDownloadApp: true, |
243 | pageFooter: true, | 252 | pageFooter: true, |
244 | category: true, | 253 | category: true, |
245 | - localCss: true | 254 | + localCss: true, |
255 | + appPath: appPath | ||
246 | }); | 256 | }); |
247 | }).catch(next); | 257 | }).catch(next); |
248 | }; | 258 | }; |
@@ -344,7 +354,7 @@ const brand = (req, res, next) => { | @@ -344,7 +354,7 @@ const brand = (req, res, next) => { | ||
344 | }; | 354 | }; |
345 | 355 | ||
346 | /** | 356 | /** |
347 | - * TODO TAR 店铺和品牌收藏状态调用新的接口 | 357 | + * |
348 | * @param req | 358 | * @param req |
349 | * @param res | 359 | * @param res |
350 | */ | 360 | */ |
@@ -32,13 +32,19 @@ const newDetail = { | @@ -32,13 +32,19 @@ const newDetail = { | ||
32 | result.id = id; | 32 | result.id = id; |
33 | result.goodsId = goodsId; | 33 | result.goodsId = goodsId; |
34 | 34 | ||
35 | + let appParams = {product_skn: result.productSkn}; | ||
36 | + let appPath = 'yohobuy://yohobuy.com/goapp?openby:yohobuy={"action":"go.productDetail","params":' + | ||
37 | + JSON.stringify(appParams) + | ||
38 | + '}'; | ||
39 | + | ||
35 | res.render('detail/new/detail', { | 40 | res.render('detail/new/detail', { |
36 | pageHeader: headerData, | 41 | pageHeader: headerData, |
37 | result: result, | 42 | result: result, |
38 | page: 'new-detail', | 43 | page: 'new-detail', |
39 | title: result.goodsName, | 44 | title: result.goodsName, |
40 | pageFooter: true, | 45 | pageFooter: true, |
41 | - localCss: true | 46 | + localCss: true, |
47 | + appPath: appPath | ||
42 | }); | 48 | }); |
43 | }).catch(next); | 49 | }).catch(next); |
44 | }, | 50 | }, |
@@ -61,7 +61,8 @@ | @@ -61,7 +61,8 @@ | ||
61 | <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)"> | 61 | <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)"> |
62 | </head> | 62 | </head> |
63 | <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}}"> | 63 | <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}}"> |
64 | - <div class="main-wrap"> | 64 | + {{log appPath}} |
65 | + <div class="main-wrap" id="main-wrap" {{#if appPath}}data-apppath='{{appPath}}'{{/if}}> | ||
65 | {{#if systemUpdate}} | 66 | {{#if systemUpdate}} |
66 | {{> updata}} | 67 | {{> updata}} |
67 | {{/if}} | 68 | {{/if}} |
@@ -4,7 +4,7 @@ | @@ -4,7 +4,7 @@ | ||
4 | const qs = require('yoho-qs'); | 4 | const qs = require('yoho-qs'); |
5 | 5 | ||
6 | const getAppPath = () => { | 6 | const getAppPath = () => { |
7 | - return 'yohobuy://yohobuy.com/goapp?{"action":"go.productDetail","params":{"product_skn":"51256842",tags_filter: "1"}}'; | 7 | + return document.getElementById("main-wrap").dataset.apppath || 'yohobuy://yohobuy.com/goapp?openby:yohobuy={"action":"go.home","params":{"gender":"1","channel":"2"}}'; |
8 | }; | 8 | }; |
9 | 9 | ||
10 | if (qs.openapp) { | 10 | if (qs.openapp) { |
-
Please register or login to post a comment