Toggle navigation
Toggle navigation
This project
Loading...
Sign in
fe
/
yohobuywap-node
·
Commits
Go to a project
GitLab
Go to group
Project
Activity
Files
Commits
Pipelines
0
Builds
0
Graphs
Milestones
Issues
0
Merge Requests
0
Members
Labels
Wiki
Forks
Network
Create a new issue
Download as
Email Patches
Plain Diff
Browse Files
Authored by
郭成尧
8 years ago
Commit
d82474398f58a22e7e59ec738394c84c032e5c31
1 parent
6d9b5ac0
'h5-call-app-up'
Hide whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
37 additions
and
14 deletions
apps/activity/controllers/coupon-floor.js
apps/channel/controllers/index.js
apps/product/controllers/list.js
apps/product/controllers/new-detail.js
doraemon/views/layout.hbs
public/js/common/open-app.js
apps/activity/controllers/coupon-floor.js
View file @
d824743
...
...
@@ -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
);
};
...
...
apps/channel/controllers/index.js
View file @
d824743
...
...
@@ -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
);
};
...
...
apps/product/controllers/list.js
View file @
d824743
...
...
@@ -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
*/
...
...
apps/product/controllers/new-detail.js
View file @
d824743
...
...
@@ -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
);
},
...
...
doraemon/views/layout.hbs
View file @
d824743
...
...
@@ -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}}
...
...
public/js/common/open-app.js
View file @
d824743
...
...
@@ -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
)
{
...
...
Please
register
or
login
to post a comment