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
Plain Diff
Browse Files
Authored by
毕凯
8 years ago
Commit
7a73e936e50f26ad4298f83b4cf1dd85528a096c
2 parents
310f0f3c
abfee667
Merge branch 'hotfix/detailInfo' into 'master'
Hotfix/detail info See merge request
!674
Hide whitespace changes
Inline
Side-by-side
Showing
13 changed files
with
38 additions
and
30 deletions
apps/3party/controllers/check.js
apps/3party/controllers/sitemap.js
apps/product/controllers/new-detail.js
apps/product/router.js
doraemon/middleware/limiter/rules/qps-limit.js
package.json
public/js/activity/share-buy.page.js
public/js/guang/detail/guang-cart.js
public/js/product/bundle.page.js
public/js/product/detail/page-render.js
public/js/product/new-detail.js
public/js/product/shop/all-product.js
public/scss/activity/share-buy/_share-buy.css
apps/3party/controllers/check.js
View file @
7a73e93
...
...
@@ -17,8 +17,8 @@ exports.submit = (req, res) => {
remoteIp
=
arr
[
0
];
}
let
key
=
`
h5
:
limiter
:
$
{
remoteIp
}
`
;
let
key10m
=
`
h5
:
limiter
:
10
m
:
$
{
remoteIp
}
`
;
let
key
=
`
pc
:
limiter
:
$
{
remoteIp
}
`
;
let
key10m
=
`
pc
:
limiter
:
10
m
:
$
{
remoteIp
}
`
;
Promise
.
all
([
cache
.
delAsync
(
key
),
...
...
apps/3party/controllers/sitemap.js
View file @
7a73e93
...
...
@@ -40,7 +40,7 @@ const itemXmlData = () => {// eslint-disable-line
return
api
.
get
(
''
,
{
method
:
'web.product.bdPromotion'
},
{
cache
:
86400
}).
then
(
res
=>
{
_
.
forEach
(
_
.
get
(
res
,
'data'
,
''
),
val
=>
{
urls
.
push
({
url
:
'https:'
+
helpers
.
urlFormat
(
`
/
product
/
$
{
val
.
i
d
}.
html
`
,
''
,
null
),
url
:
'https:'
+
helpers
.
urlFormat
(
`
/
product
/
$
{
val
.
erpProductI
d
}.
html
`
,
''
,
null
),
changefreq
:
'daily'
,
priority
:
0.3
});
...
...
apps/product/controllers/new-detail.js
View file @
7a73e93
...
...
@@ -140,20 +140,25 @@ const newDetail = {
},
indexData
(
req
,
res
,
next
)
{
if
(
!
req
.
xhr
)
{
return
next
();
}
if
(
!
req
.
body
.
id
)
{
// for guang
let
allowOrigin
=
_
.
get
(
req
,
'headers.origin'
,
null
)
?
req
.
headers
.
origin
:
req
.
protocol
+
'://guang.'
+
req
.
headers
.
host
;
res
.
setHeader
(
'Access-Control-Allow-Origin'
,
allowOrigin
);
res
.
setHeader
(
'Access-Control-Allow-Credentials'
,
'true'
);
if
(
!
req
.
query
.
id
&&
!
req
.
query
.
productSkn
)
{
return
next
();
}
let
uid
=
req
.
user
.
uid
||
0
;
let
shoppingKey
=
req
.
cookies
.
_SPK
||
''
;
detailModel
.
getNewProductAsyncData
(
Object
.
assign
({
id
:
req
.
body
.
id
,
goodsId
:
req
.
body
.
goodsId
,
productSkn
:
req
.
body
.
productSkn
,
bundleType
:
req
.
body
.
bundleType
,
id
:
req
.
query
.
id
,
goodsId
:
req
.
query
.
goodsId
,
productSkn
:
req
.
query
.
productSkn
,
bundleType
:
req
.
query
.
bundleType
,
uid
:
uid
,
shoppingKey
:
shoppingKey
,
ua
:
req
.
get
(
'user-agent'
)
||
''
...
...
apps/product/router.js
View file @
7a73e93
...
...
@@ -77,8 +77,7 @@ router.get('/detail/preference', detail.preference); // 为你优选
router
.
get
(
'/detail/consults'
,
detail
.
consults
);
// 商品咨询页
router
.
get
(
'/detail/consultform'
,
auth
,
detail
.
consultform
);
// 商品咨询表单页
router
.
get
(
'/detail/comments'
,
detail
.
comments
);
// 商品评价
router
.
post
(
'/detail/info'
,
detail
.
getUser
,
detail
.
indexData
);
// 商品详情页-异步数据
router
.
post
(
'/detail/newinfo'
,
detail
.
getUser
,
newDetail
.
indexData
);
// 商品详情页-异步数据 (优化)
router
.
get
(
'/detail/newinfo'
,
detail
.
getUser
,
newDetail
.
indexData
);
// 商品详情页-异步数据 (优化)
router
.
post
(
'/detail/consultsubmit'
,
auth
,
detail
.
consultsubmit
);
// 商品咨询提交接口
...
...
doraemon/middleware/limiter/rules/qps-limit.js
View file @
7a73e93
...
...
@@ -29,8 +29,8 @@ module.exports = (limiter, policy) => {
const
req
=
limiter
.
req
,
res
=
limiter
.
res
;
const
key
=
`
h5
:
limiter
:
$
{
limiter
.
remoteIp
}
`
;
const
key10m
=
`
h5
:
limiter
:
10
m
:
$
{
limiter
.
remoteIp
}
`
;
const
key
=
`
pc
:
limiter
:
$
{
limiter
.
remoteIp
}
`
;
const
key10m
=
`
pc
:
limiter
:
10
m
:
$
{
limiter
.
remoteIp
}
`
;
res
.
on
(
'render'
,
function
()
{
let
route
=
req
.
route
?
req
.
route
.
path
:
''
;
...
...
package.json
View file @
7a73e93
{
"name"
:
"m-yohobuy-node"
,
"version"
:
"5.8.
1
"
,
"version"
:
"5.8.
2
"
,
"private"
:
true
,
"description"
:
"A New Yohobuy Project With Express"
,
"repository"
:
{
...
...
public/js/activity/share-buy.page.js
View file @
7a73e93
...
...
@@ -19,10 +19,6 @@ let shareData = {
require
(
'common'
);
require
(
'common/share'
)(
shareData
);
if
(
$
(
'.share-buy-page'
).
height
()
<
$
(
window
).
height
())
{
$
(
'.share-buy-page'
).
height
(
$
(
window
).
height
());
}
if
(
yoho
.
isApp
)
{
if
(
window
.
queryString
.
act_id
)
{
shareData
.
link
=
'http://m.yohobuy.com/activity/share-buy?act_id='
+
window
.
queryString
.
act_id
;
...
...
public/js/guang/detail/guang-cart.js
View file @
7a73e93
...
...
@@ -2,7 +2,7 @@
* @Author: Targaryen
* @Date: 2017-05-08 09:43:20
* @Last Modified by: Targaryen
* @Last Modified time: 2017-0
5-09 11:31:56
* @Last Modified time: 2017-0
6-20 09:40:29
*/
const
$
=
require
(
'yoho-jquery'
);
...
...
@@ -15,7 +15,7 @@ $addToCart.on('click', function(e) {
let
$this
=
$
(
e
.
currentTarget
);
let
productSkn
=
$this
.
data
(
'skn'
);
$
.
post
(
location
.
protocol
+
'//m.yohobuy.com/product/detail/
info'
,
{
$
.
get
(
location
.
protocol
+
'//m.yohobuy.com/product/detail/new
info'
,
{
productSkn
:
productSkn
},
function
(
data
)
{
chosePanel
.
show
({
data
}).
then
(
result
=>
{
...
...
public/js/product/bundle.page.js
View file @
7a73e93
...
...
@@ -45,7 +45,7 @@ $(function() {
$selectBtn
.
on
(
'touchend'
,
function
()
{
let
self
=
$
(
this
);
$
.
post
(
'/product/detail/
info'
,
{
$
.
get
(
'/product/detail/new
info'
,
{
id
:
self
.
data
(
'id'
),
productSkn
:
self
.
data
(
'skn'
)
},
function
(
data
)
{
...
...
public/js/product/detail/page-render.js
View file @
7a73e93
...
...
@@ -11,8 +11,8 @@ module.exports = function(callback) {
if
(
productId
&&
(
goodsId
||
productSkn
))
{
$
.
ajax
({
type
:
'POST'
,
url
:
'/product/detail/info'
,
type
:
'GET'
,
url
:
'/product/detail/newinfo'
,
data
:
{
id
:
productId
,
goodsId
:
goodsId
,
...
...
public/js/product/new-detail.js
View file @
7a73e93
...
...
@@ -100,7 +100,7 @@ setTimeout(() => {
if
(
productId
&&
(
goodsId
||
productSkn
))
{
setTimeout
(()
=>
{
$
.
ajax
({
type
:
'
POS
T'
,
type
:
'
GE
T'
,
url
:
'/product/detail/newinfo'
,
data
:
{
id
:
productId
,
...
...
public/js/product/shop/all-product.js
View file @
7a73e93
...
...
@@ -2,7 +2,7 @@
* @Author: Targaryen
* @Date: 2017-03-24 13:43:55
* @Last Modified by: Targaryen
* @Last Modified time: 2017-0
3-31 14:46:52
* @Last Modified time: 2017-0
6-20 09:50:01
*/
/** *****************************
...
...
@@ -192,7 +192,7 @@ $listNav.bind('contextmenu', function() {
});
$listNav
.
on
(
'touchend touchcancel'
,
function
(
e
)
{
page
=
0
;
page
=
1
;
beforeScroll
=
$
(
window
).
scrollTop
();
isScrollLoad
=
false
;
...
...
public/scss/activity/share-buy/_share-buy.css
View file @
7a73e93
.share-buy-page
{
width
:
100%
;
body
{
height
:
100%
;
}
.main-wrap
{
height
:
100%
;
background-image
:
resolve
(
"activity/share-buy/back.jpg"
);
background-size
:
100%
;
}
.share-buy-page
{
width
:
100%
;
height
:
100%
;
padding-bottom
:
145px
;
.share-title
{
...
...
Please
register
or
login
to post a comment