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
lijing
2016-08-31 15:37:03 +0800
Commit
3886d1e05314378bc83f70fb846dc6fa04490445
1 parent
fb374015
VIP
Hide whitespace changes
Inline
Side-by-side
Showing
9 changed files
with
232 additions
and
4 deletions
apps/home/controllers/index.js
apps/home/index.js
apps/home/models/index.js
apps/home/router.js
apps/home/views/action/vip-grade/vip-grade.hbs
apps/home/views/partial/vip-grade/basic-info.hbs
apps/home/views/partial/vip-grade/privilege.hbs
public/js/home/grade.page.js
public/scss/me/_vip-grade.css
apps/home/controllers/index.js
View file @
3886d1e
...
...
@@ -91,8 +91,14 @@ exports.record = (req, res) => {
};
/**
* 浏览记录列表
* @param req
* @param res
* @param next
*/
exports
.
recordContent
=
(
req
,
res
,
next
)
=>
{
let
uid
=
req
.
user
.
uid
;
let
uid
=
req
.
user
.
uid
||
6228593
;
let
udid
=
req
.
user
.
udid
;
...
...
@@ -112,6 +118,12 @@ exports.recordContent = (req, res, next) => {
}).
catch
(
next
);
};
/**
* 删除浏览记录
* @param req
* @param res
* @param next
*/
exports
.
delRecord
=
(
req
,
res
,
next
)
=>
{
let
uid
=
req
.
user
.
uid
;
...
...
@@ -122,4 +134,35 @@ exports.delRecord = (req, res, next) => {
}).
catch
(
next
);
};
/**
* 会员等级展示页
* @param req
* @param res
* @param next
*/
exports
.
grade
=
(
req
,
res
,
next
)
=>
{
let
headerData
=
headerModel
.
setNav
({
navTitle
:
'会员等级'
});
let
responseData
=
{
pageHeader
:
headerData
,
module
:
'home'
,
page
:
'grade'
,
title
:
'会员等级'
,
pageFooter
:
true
};
indexModel
.
getGrade
({
uid
:
req
.
user
.
uid
||
8039759
,
channel
:
req
.
query
.
channel
||
1
}).
then
((
result
)
=>
{
console
.
log
(
result
);
res
.
render
(
'vip-grade/vip-grade'
,
Object
.
assign
(
result
,
responseData
));
}).
catch
(
next
);
};
...
...
apps/home/index.js
View file @
3886d1e
...
...
@@ -22,7 +22,7 @@ app.engine('.hbs', hbs({
extname
:
'.hbs'
,
defaultLayout
:
'layout'
,
layoutsDir
:
doraemon
,
partialsDir
:
[
'./views/partial'
,
`
$
{
doraemon
}
/partial`]
,
partialsDir
:
[
path
.
join
(
__dirname
,
'./views/partial'
)
,
`
$
{
doraemon
}
/partial`]
,
helpers
:
global
.
yoho
.
helpers
}));
...
...
apps/home/models/index.js
View file @
3886d1e
...
...
@@ -202,6 +202,10 @@ const recordContent = (uid, udid, page, limit) => {
});
};
/**
* 删除浏览记录
* @param params
*/
const
delRecord
=
(
uid
,
skn
)
=>
{
return
api
.
get
(
''
,
{
method
:
'app.browse.delete'
,
...
...
@@ -210,9 +214,58 @@ const delRecord = (uid, skn) => {
});
};
/**
* 会员等级
* @param params
*/
const
getGradeGrade
=
(
channel
,
uid
)
=>
{
return
api
.
get
(
''
,
{
method
:
'app.passport.vip'
,
uid
:
uid
||
6228593
,
channel
:
channel
||
1
},
{
code
:
200
});
};
const
getGradeUser
=
(
channel
,
uid
)
=>
{
return
api
.
get
(
''
,
{
method
:
'app.passport.profile'
,
uid
:
uid
||
6228593
,
channel
:
channel
||
1
},
{
code
:
200
});
};
const
getGrade
=
(
channel
,
uid
)
=>
{
return
api
.
all
([
getGradeGrade
(
channel
,
uid
),
getGradeUser
(
channel
,
uid
)
]).
then
((
result
)
=>
{
let
resu
=
{
vipGrade
:
[]
};
if
(
result
[
0
]
&&
result
[
0
].
data
)
{
resu
=
{
vipGrade
:
[
{
costOfThisYear
:
result
[
0
].
data
.
current_year_cost
,
sumCost
:
result
[
0
].
data
.
current_total_cost
,
vip1
:
true
,
name
:
'1111'
}
]
};
}
return
resu
;
});
};
module
.
exports
=
{
index
,
myDetails
,
recordContent
,
delRecord
delRecord
,
getGrade
};
...
...
apps/home/router.js
View file @
3886d1e
...
...
@@ -44,6 +44,8 @@ router.get('/cancelOrder', orderDetailController.cancelOrder); // 取消订单
router
.
get
(
'/'
,
homeController
.
index
);
// 个人中心首页
router
.
get
(
'/mydetails'
,
homeController
.
myDetails
);
// 个人基本资料页面
router
.
get
(
'/grade'
,
homeController
.
grade
);
// 会员等级页
router
.
get
(
'/mycurrency'
,
currencyController
.
myCurrency
);
// yoho币总数
router
.
get
(
'/currencyDetail'
,
currencyController
.
currencyDetail
);
// yoho币列表
router
.
post
(
'/ajaxCurrencyDetail'
,
currencyController
.
ajaxCurrencyDetail
);
// yoho币列表
...
...
apps/home/views/action/vip-grade/vip-grade.hbs
0 → 100644
View file @
3886d1e
<div
class=
"vip-grade-page yoho-page"
>
{{#
vipGrade
}}
<div
class=
"basic-info block"
>
{{>
vip-grade
/
basic-info
}}
</div>
<ul
class=
"cost block"
>
<li>
年度累计金额:
<span>
¥
{{
costOfThisYear
}}
</span>
</li>
<li>
历史消费总金额:
<span>
¥
{{
sumCost
}}
</span>
</li>
</ul>
{{#
unless
vip0
}}
<div
class=
"privilege block"
>
<h3
class=
"title"
>
当前可享受的特权
</h3>
{{>
vip-grade
/
privilege
}}
</div>
{{/
unless
}}
<a
class=
"all-privilege block tap-hightlight"
href=
"
{{
allUrl
}}
"
>
查看全部VIP特权
<span
class=
"iconfont"
>

</span>
</a>
{{/
vipGrade
}}
</div>
...
...
apps/home/views/partial/vip-grade/basic-info.hbs
0 → 100644
View file @
3886d1e
{{#if
vip3
}}
<p>
<span
class=
"user-name"
>
{{
name
}}
</span>
<span
class=
"vip-icon vip-3"
></span>
</p>
<p
class=
"grade-desc"
>
您已升级至最高的等级啦!
</p>
<p
class=
"sum-cost"
>
年度累计金额
<span>
¥
{{
costOfThisYear
}}
</span>
</p>
<div
class=
"progresser"
>
<div
class=
"outer"
></div>
<div
class=
"inner"
style=
"width:
{{
percent
}}
%;"
></div>
<span
class=
"beacon beacon-min"
>
白金卡会员
</span>
</div>
{{/if}}
{{#if
vip2
}}
<p>
<span
class=
"user-name"
>
{{
name
}}
</span>
<span
class=
"vip-icon vip-2"
></span>
</p>
<p
class=
"grade-desc"
>
还差
<span
class=
"cost-gap"
>
¥
{{
costGap
}}
</span>
就可以升级为白金会员!
<span
class=
"sub-desc"
>
(VIP金额累计需订单成功签收满15天并无退换货)
</span>
</p>
<p
class=
"sum-cost"
>
年度累计金额
<span>
¥
{{
costOfThisYear
}}
</span>
</p>
<div
class=
"progresser"
>
<div
class=
"outer"
></div>
<div
class=
"inner"
style=
"width:
{{
percent
}}
%;"
></div>
<span
class=
"beacon beacon-min"
>
金卡会员
</span>
<span
class=
"beacon beacon-max"
>
白金卡会员
</span>
<span
class=
"cost-limit"
>
¥5000.00
</span>
</div>
{{/if}}
{{#if
vip1
}}
<p>
<span
class=
"user-name"
>
{{
name
}}
</span>
<span
class=
"vip-icon vip-1"
></span>
</p>
<p
class=
"grade-desc"
>
还差
<span
class=
"cost-gap"
>
¥
{{
costGap
}}
</span>
就可以升级为金卡会员!
<span
class=
"sub-desc"
>
(VIP金额累计需订单成功签收满15天并无退换货)
</span>
</p>
<p
class=
"sum-cost"
>
年度累计金额
<span>
¥
{{
costOfThisYear
}}
</span>
</p>
<div
class=
"progresser"
>
<div
class=
"outer"
></div>
<div
class=
"inner"
style=
"width:
{{
percent
}}
%;"
></div>
<span
class=
"beacon beacon-min"
>
银卡会员
</span>
<span
class=
"beacon beacon-max"
>
金卡会员
</span>
<span
class=
"cost-limit"
>
¥2000.00
</span>
</div>
{{/if}}
{{#if
vip0
}}
<p>
<span
class=
"user-name"
>
{{
name
}}
</span>
<span>
普通会员
</span>
</p>
<p
class=
"grade-desc"
>
还差
<span
class=
"cost-gap"
>
¥
{{
costGap
}}
</span>
就可以升级为银卡会员!
<span
class=
"sub-desc"
>
(VIP金额累计需订单成功签收满15天并无退换货)
</span>
</p>
<p
class=
"sum-cost"
>
年度累计金额
<span>
¥
{{
costOfThisYear
}}
</span>
</p>
<div
class=
"progresser"
>
<div
class=
"outer"
></div>
<div
class=
"inner"
style=
"width:
{{
percent
}}
%;"
></div>
<span
class=
"beacon beacon-min"
>
普通
</span>
<span
class=
"beacon beacon-max"
>
银卡会员
</span>
<span
class=
"cost-limit"
>
¥600.00
</span>
</div>
{{/if}}
...
...
apps/home/views/partial/vip-grade/privilege.hbs
0 → 100644
View file @
3886d1e
333
<ul
class=
"privilege-list"
>
{{#
each
privilege
}}
<li>
<img
class=
"icon"
src=
"
{{
pic
}}
"
>
<p>
{{
title
}}
<span>
{{
description
}}
</span>
</p>
</li>
{{/
each
}}
</ul>
\ No newline at end of file
...
...
public/js/home/grade.page.js
0 → 100644
View file @
3886d1e
require
(
'../common'
);
...
...
public/scss/me/_vip-grade.css
View file @
3886d1e
...
...
@@ -72,7 +72,6 @@
.progresser
{
position
:
relative
;
width
:
100%
;
height
:
20px
;
padding
:
20px
0
;
}
...
...
Please
register
or
login
to post a comment