Merge branch 'feature/3partyBind' of http://git.yoho.cn/fe/yohobuy-node into feature/3partyBind
Showing
6 changed files
with
170 additions
and
19 deletions
@@ -16,10 +16,8 @@ const helpers = global.yoho.helpers; | @@ -16,10 +16,8 @@ const helpers = global.yoho.helpers; | ||
16 | * @return {[type]} [description] | 16 | * @return {[type]} [description] |
17 | */ | 17 | */ |
18 | exports.index = (req, res, next) => { | 18 | exports.index = (req, res, next) => { |
19 | - // if (!req.user.uid) { | ||
20 | - // res.redirect(helpers.urlFormat('/signin.html')); | ||
21 | - // } | ||
22 | - let uid = '20001048'; | 19 | + |
20 | + let uid = req.user.uid; | ||
23 | 21 | ||
24 | let responseData = { | 22 | let responseData = { |
25 | module: 'home', | 23 | module: 'home', |
@@ -42,9 +40,6 @@ exports.index = (req, res, next) => { | @@ -42,9 +40,6 @@ exports.index = (req, res, next) => { | ||
42 | */ | 40 | */ |
43 | exports.editUserInfo = (req, res, next) => { | 41 | exports.editUserInfo = (req, res, next) => { |
44 | 42 | ||
45 | - if (!req.user.uid) { | ||
46 | - res.redirect(helpers.urlFormat('/signin.html')); | ||
47 | - } | ||
48 | let uid = req.user.uid; | 43 | let uid = req.user.uid; |
49 | 44 | ||
50 | // 真实数据输出 | 45 | // 真实数据输出 |
@@ -62,9 +57,6 @@ exports.editUserInfo = (req, res, next) => { | @@ -62,9 +57,6 @@ exports.editUserInfo = (req, res, next) => { | ||
62 | */ | 57 | */ |
63 | exports.editUserContactInfo = (req, res, next) => { | 58 | exports.editUserContactInfo = (req, res, next) => { |
64 | 59 | ||
65 | - if (!req.user.uid) { | ||
66 | - res.redirect(helpers.urlFormat('/signin.html')); | ||
67 | - } | ||
68 | let uid = req.user.uid; | 60 | let uid = req.user.uid; |
69 | 61 | ||
70 | // 真实数据输出 | 62 | // 真实数据输出 |
@@ -81,9 +73,7 @@ exports.editUserContactInfo = (req, res, next) => { | @@ -81,9 +73,7 @@ exports.editUserContactInfo = (req, res, next) => { | ||
81 | * @return {[type]} [description] | 73 | * @return {[type]} [description] |
82 | */ | 74 | */ |
83 | exports.editUserHabitsInfo = (req, res, next) => { | 75 | exports.editUserHabitsInfo = (req, res, next) => { |
84 | - if (!req.user.uid) { | ||
85 | - res.redirect(helpers.urlFormat('/signin.html')); | ||
86 | - } | 76 | + |
87 | let uid = req.user.uid; | 77 | let uid = req.user.uid; |
88 | 78 | ||
89 | // 真实数据输出 | 79 | // 真实数据输出 |
@@ -101,9 +91,7 @@ exports.editUserHabitsInfo = (req, res, next) => { | @@ -101,9 +91,7 @@ exports.editUserHabitsInfo = (req, res, next) => { | ||
101 | * @return {[type]} [description] | 91 | * @return {[type]} [description] |
102 | */ | 92 | */ |
103 | exports.editUserLikeBrand = (req, res, next) => { | 93 | exports.editUserLikeBrand = (req, res, next) => { |
104 | - if (!req.user.uid) { | ||
105 | - res.redirect(helpers.urlFormat('/signin.html')); | ||
106 | - } | 94 | + |
107 | let uid = req.user.uid; | 95 | let uid = req.user.uid; |
108 | 96 | ||
109 | // 真实数据输出 | 97 | // 真实数据输出 |
@@ -135,6 +135,13 @@ const exchangeGift = (params, uid) => { | @@ -135,6 +135,13 @@ const exchangeGift = (params, uid) => { | ||
135 | }); | 135 | }); |
136 | }; | 136 | }; |
137 | 137 | ||
138 | +const get3partyBindInfo = (uid) => { | ||
139 | + return api.get('', { | ||
140 | + method: '', | ||
141 | + uid: uid | ||
142 | + }); | ||
143 | +}; | ||
144 | + | ||
138 | module.exports = { | 145 | module.exports = { |
139 | getUserInfo, | 146 | getUserInfo, |
140 | editUserInfo, | 147 | editUserInfo, |
@@ -147,5 +154,6 @@ module.exports = { | @@ -147,5 +154,6 @@ module.exports = { | ||
147 | editUserLikeBrand, | 154 | editUserLikeBrand, |
148 | getTipConfig, | 155 | getTipConfig, |
149 | getUserInfoByMobile, | 156 | getUserInfoByMobile, |
150 | - exchangeGift | 157 | + exchangeGift, |
158 | + get3partyBindInfo | ||
151 | }; | 159 | }; |
@@ -275,7 +275,8 @@ const getUserInfo = (uid) => { | @@ -275,7 +275,8 @@ const getUserInfo = (uid) => { | ||
275 | userApi.getUserContactInfo(uid), | 275 | userApi.getUserContactInfo(uid), |
276 | userApi.getUserHabitsInfo(uid), | 276 | userApi.getUserHabitsInfo(uid), |
277 | userApi.getUserLikeBrand(uid), | 277 | userApi.getUserLikeBrand(uid), |
278 | - searchApi.get('/brand/list.json', {}, {cache: true}) | 278 | + searchApi.get('/brand/list.json', {}, {cache: true}), |
279 | + userApi.get3partyBindInfo(uid) | ||
279 | ]); | 280 | ]); |
280 | 281 | ||
281 | let finalResult = {}, | 282 | let finalResult = {}, |
@@ -482,7 +483,7 @@ const getUserInfo = (uid) => { | @@ -482,7 +483,7 @@ const getUserInfo = (uid) => { | ||
482 | }; | 483 | }; |
483 | 484 | ||
484 | } | 485 | } |
485 | - | 486 | + console.log(JSON.stringify(result[3])); |
486 | if (result[3].code === 200) { | 487 | if (result[3].code === 200) { |
487 | let habitsInfo = result[3].data || '', | 488 | let habitsInfo = result[3].data || '', |
488 | dressHabitArr, | 489 | dressHabitArr, |
@@ -7,6 +7,7 @@ | @@ -7,6 +7,7 @@ | ||
7 | <h2 class="title"></h2> | 7 | <h2 class="title"></h2> |
8 | <div class="edit-box"> | 8 | <div class="edit-box"> |
9 | {{> home/edit/basicinfo}} | 9 | {{> home/edit/basicinfo}} |
10 | + {{> home/edit/3partybind}} | ||
10 | {{> home/edit/contactinfo}} | 11 | {{> home/edit/contactinfo}} |
11 | {{> home/edit/habbit}} | 12 | {{> home/edit/habbit}} |
12 | {{> home/edit/favorite}} | 13 | {{> home/edit/favorite}} |
1 | +<div class="user-habbit-info"> | ||
2 | + <h2 class="sub-title"> | ||
3 | + <div class="more"><a class="btn-edit" title="修改"></a></div> | ||
4 | + {{subTitle}} | ||
5 | + </h2> | ||
6 | + <div class="account-list"> | ||
7 | + <div class="account-item"> | ||
8 | + <div class="account-item-title"> | ||
9 | + <p>绑定QQ账号:<b>raining</b></p> | ||
10 | + <a>收起</a> | ||
11 | + </div> | ||
12 | + <div class="account-item-body"> | ||
13 | + <div class="account-body-left"> | ||
14 | + <p>解绑后,账号仍可正常使用</p> | ||
15 | + <button>解除绑定</button> | ||
16 | + </div> | ||
17 | + <div class="account-body-right"> | ||
18 | + <img class="logo-yh" src="../img/new/yoho.png"/> | ||
19 | + <img class="img-contact" src="../img/new/img-contact.png"/> | ||
20 | + <img class="logo-contact" src="../img/new/tengxun.png"/> | ||
21 | + </div> | ||
22 | + </div> | ||
23 | + </div> | ||
24 | + <div class="account-item"> | ||
25 | + <div class="account-item-title"> | ||
26 | + <p>绑定QQ账号:<b>raining</b></p> | ||
27 | + <a>收起</a> | ||
28 | + </div> | ||
29 | + <div class="account-item-body"> | ||
30 | + <div class="account-body-left"> | ||
31 | + <p>解绑后,账号仍可正常使用</p> | ||
32 | + <button>解除绑定</button> | ||
33 | + </div> | ||
34 | + <div class="account-body-right"> | ||
35 | + <img class="logo-yh" src="../img/new/yoho.png"/> | ||
36 | + <img class="img-contact" src="../img/new/img-contact.png"/> | ||
37 | + <img class="logo-contact" src="../img/new/tengxun.png"/> | ||
38 | + </div> | ||
39 | + </div> | ||
40 | + </div> | ||
41 | + </div> | ||
42 | +</div> |
@@ -969,3 +969,114 @@ | @@ -969,3 +969,114 @@ | ||
969 | color: red; | 969 | color: red; |
970 | } | 970 | } |
971 | } | 971 | } |
972 | + | ||
973 | +.account-list{ | ||
974 | + margin-left: 35px; | ||
975 | + margin-right: 20px; | ||
976 | + | ||
977 | + .account-item{ | ||
978 | + border: 2px solid #bdbdbd; | ||
979 | + margin-bottom: 5px; | ||
980 | + | ||
981 | + .account-item-title{ | ||
982 | + padding-left: 10px; | ||
983 | + padding-right: 10px; | ||
984 | + height: 38px; | ||
985 | + line-height: 38px; | ||
986 | + border-bottom: 1px dashed #eaeaea; | ||
987 | + | ||
988 | + &:after{ | ||
989 | + content: ''; | ||
990 | + display: block; | ||
991 | + clear: both; | ||
992 | + } | ||
993 | + | ||
994 | + p{ | ||
995 | + float:left; | ||
996 | + font-size: 14px; | ||
997 | + color: #000; | ||
998 | + | ||
999 | + b{ | ||
1000 | + color: #7bbd55; | ||
1001 | + margin-left: 10px; | ||
1002 | + font-weight: normal; | ||
1003 | + } | ||
1004 | + } | ||
1005 | + | ||
1006 | + a{ | ||
1007 | + float: right; | ||
1008 | + color: #468fa2; | ||
1009 | + font-size: 14px; | ||
1010 | + } | ||
1011 | + } | ||
1012 | + | ||
1013 | + .account-item-body{ | ||
1014 | + padding: 45px 35px 40px; | ||
1015 | + | ||
1016 | + &:after{ | ||
1017 | + content: ''; | ||
1018 | + display: block; | ||
1019 | + clear: both; | ||
1020 | + } | ||
1021 | + } | ||
1022 | + | ||
1023 | + .account-body-left{ | ||
1024 | + float: left; | ||
1025 | + | ||
1026 | + p{ | ||
1027 | + color: #000; | ||
1028 | + font-size: 16px; | ||
1029 | + } | ||
1030 | + | ||
1031 | + button{ | ||
1032 | + margin-top: 22px; | ||
1033 | + background-color: #2e849c; | ||
1034 | + font-size: 14px; | ||
1035 | + color: #fff; | ||
1036 | + border: none; | ||
1037 | + width: 80px; | ||
1038 | + height: 25px; | ||
1039 | + border-radius: 3px; | ||
1040 | + -webkit-border-radius: 3px; | ||
1041 | + -moz-border-radius: 3px; | ||
1042 | + -ms-border-radius: 3px; | ||
1043 | + } | ||
1044 | + } | ||
1045 | + | ||
1046 | + .account-body-right{ | ||
1047 | + position: relative; | ||
1048 | + float: right; | ||
1049 | + width: 290px; | ||
1050 | + height: 55px; | ||
1051 | + | ||
1052 | + .logo-yh{ | ||
1053 | + position: absolute; | ||
1054 | + top: 19px; | ||
1055 | + left: 0; | ||
1056 | + width: 115px; | ||
1057 | + height: 27px; | ||
1058 | + background-size: 100%; | ||
1059 | + } | ||
1060 | + | ||
1061 | + .logo-contact{ | ||
1062 | + position: absolute; | ||
1063 | + top: 0; | ||
1064 | + left: initial; | ||
1065 | + right: 0; | ||
1066 | + width: 105px; | ||
1067 | + height: 55px; | ||
1068 | + background-size: 100%; | ||
1069 | + } | ||
1070 | + | ||
1071 | + .img-contact{ | ||
1072 | + position: absolute; | ||
1073 | + top: 18px; | ||
1074 | + left: 130px; | ||
1075 | + display: inline-block; | ||
1076 | + width: 37px; | ||
1077 | + height: 20px; | ||
1078 | + background-size: 100%; | ||
1079 | + } | ||
1080 | + } | ||
1081 | + } | ||
1082 | +} |
-
Please register or login to post a comment