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
毕凯
7 years ago
Commit
1a5e904c9345892ce5849f9530f4471fe2aad610
2 parents
170d298a
be89a80c
Merge branch 'hotfix/activity' into 'gray'
get-app-info See merge request
!1111
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
36 additions
and
17 deletions
apps/activity/controllers/feature.js
apps/activity/controllers/individuation.js
config/common.js
public/js/activity/feature.page.js
apps/activity/controllers/feature.js
View file @
1a5e904
...
...
@@ -85,18 +85,18 @@ exports.couponSend = (req, res, next) => {
}
// 接口要加 session 校验,跨域异步请求未添加相关参数
// if (req.yoho.isApp) {
// if (app.app_version && app.client_type && app.session_key && app.uid) {
// uid = {
// toString: () => {
// return _.parseInt(app.uid);
// },
// sessionKey: app.session_key,
// appVersion: app.app_version,
// appSessionType: app.client_type
// };
// }
// }
if
(
req
.
yoho
.
isApp
)
{
if
(
app
.
app_version
&&
app
.
client_type
&&
app
.
session_key
&&
app
.
uid
)
{
uid
=
{
toString
:
()
=>
{
return
_
.
parseInt
(
app
.
uid
);
},
sessionKey
:
app
.
session_key
,
appVersion
:
app
.
app_version
,
appSessionType
:
app
.
client_type
};
}
}
model
.
couponSend
(
uid
,
token
,
app
).
then
(
result
=>
{
res
.
set
({
...
...
apps/activity/controllers/individuation.js
View file @
1a5e904
'use strict'
;
const
moment
=
require
(
'moment'
);
const
_
=
require
(
'lodash'
);
const
model
=
require
(
'../models/individuation'
);
const
channels
=
{
boys
:
1
,
...
...
@@ -73,6 +74,18 @@ exports.productLst = function(req, res, next) {
exports
.
coupon
=
function
(
req
,
res
,
next
)
{
let
activity_template_id
=
req
.
query
.
activity_id
;
let
uid
=
req
.
user
.
uid
||
req
.
query
.
uid
;
let
app
=
req
.
query
.
app
;
if
(
app
&&
app
.
app_version
&&
app
.
client_type
&&
app
.
session_key
&&
app
.
uid
)
{
uid
=
{
toString
:
()
=>
{
return
_
.
parseInt
(
app
.
uid
);
},
sessionKey
:
app
.
session_key
,
appVersion
:
app
.
app_version
,
appSessionType
:
app
.
client_type
};
}
if
(
!
uid
||
!
activity_template_id
)
{
return
res
.
jsonp
({
...
...
config/common.js
View file @
1a5e904
...
...
@@ -109,7 +109,7 @@ module.exports = {
maxQps
:
1200
,
maxQps10m
:
2500
,
geetestJs
:
'//static.geetest.com/static/tools/gt.js'
,
jsSdk
:
'//cdn.yoho.cn/js-sdk/1.2.
7
/jssdk.js'
,
jsSdk
:
'//cdn.yoho.cn/js-sdk/1.2.
8
/jssdk.js'
,
redis
:
{
connect
:
{
host
:
'127.0.0.1'
,
...
...
public/js/activity/feature.page.js
View file @
1a5e904
...
...
@@ -2,6 +2,8 @@ var $ = require('yoho-jquery');
var
lazyLoad
=
require
(
'yoho-jquery-lazyload'
);
var
Swiper
=
require
(
'yoho-swiper'
);
var
yoho
=
require
(
'../yoho-app'
);
const
qs
=
require
(
'yoho-qs'
);
const
cookie
=
require
(
'yoho-cookie'
);
global
.
jQuery
=
$
;
...
...
@@ -218,10 +220,14 @@ function persenalCouponInit() {
let
data
=
{
activity_id
:
$
(
'.feature-page'
).
data
(
'id'
)
};
let
href
=
'//activity.yoho.cn/individuation/coupon'
;
if
(
location
.
hostname
===
'm.yohobuy.com'
)
{
href
=
'//m.yohobuy.com/activity/individuation/coupon'
;
if
(
yoho
.
isApp
)
{
data
.
app
=
{
uid
:
cookie
.
get
(
'app_uid'
)
||
qs
.
uid
,
app_version
:
cookie
.
get
(
'app_version'
)
||
qs
.
app_version
,
client_type
:
cookie
.
get
(
'app_client_type'
)
||
qs
.
client_type
,
session_key
:
cookie
.
get
(
'app_session_key'
)
||
qs
.
session_key
};
}
$
(
'.yoho-conpon'
).
each
(
function
()
{
...
...
@@ -229,7 +235,7 @@ function persenalCouponInit() {
if
(
$this
.
data
(
'persenal-enable'
))
{
$
.
ajax
({
url
:
href
,
url
:
'//m.yohobuy.com/activity/individuation/coupon'
,
dataType
:
'jsonp'
,
data
:
data
,
success
:
function
(
res
)
{
...
...
Please
register
or
login
to post a comment