Showing
6 changed files
with
11 additions
and
121 deletions
@@ -232,16 +232,3 @@ exports.preferential = (req, res, next) => { | @@ -232,16 +232,3 @@ exports.preferential = (req, res, next) => { | ||
232 | }).catch(next); | 232 | }).catch(next); |
233 | 233 | ||
234 | }; | 234 | }; |
235 | - | ||
236 | -exports.modify = (req, res, next) => { | ||
237 | - let params = { | ||
238 | - uid: req.user.uid, | ||
239 | - nickName: req.query.nickName, | ||
240 | - gender: req.query.gender, | ||
241 | - birthday: req.query.birthday | ||
242 | - }; | ||
243 | - | ||
244 | - indexModel.modify(params).then((result) => { | ||
245 | - res.json(result); | ||
246 | - }).catch(next); | ||
247 | -}; |
@@ -509,18 +509,6 @@ const getPreferential = (params) => { | @@ -509,18 +509,6 @@ const getPreferential = (params) => { | ||
509 | }); | 509 | }); |
510 | }; | 510 | }; |
511 | 511 | ||
512 | -const modify = (params) => { | ||
513 | - return api.get('', { | ||
514 | - method: 'app.passport.modifyBase', | ||
515 | - uid: params.uid, | ||
516 | - nick_name: params.nickName, | ||
517 | - gender: params.gender, | ||
518 | - birthday: params.birthday | ||
519 | - }).then((result) => { | ||
520 | - return result; | ||
521 | - }); | ||
522 | -}; | ||
523 | - | ||
524 | module.exports = { | 512 | module.exports = { |
525 | index, | 513 | index, |
526 | myDetails, | 514 | myDetails, |
@@ -528,6 +516,5 @@ module.exports = { | @@ -528,6 +516,5 @@ module.exports = { | ||
528 | delRecord, | 516 | delRecord, |
529 | getGrade, | 517 | getGrade, |
530 | getPreferential, | 518 | getPreferential, |
531 | - getGradeGrade, | ||
532 | - modify | 519 | + getGradeGrade |
533 | }; | 520 | }; |
@@ -67,7 +67,6 @@ router.post('/orders/sure', auth, orderController.sure); // 确认收货 | @@ -67,7 +67,6 @@ router.post('/orders/sure', auth, orderController.sure); // 确认收货 | ||
67 | 67 | ||
68 | router.get('/', homeController.index); // 个人中心首页 | 68 | router.get('/', homeController.index); // 个人中心首页 |
69 | router.get('/mydetails', auth, homeController.myDetails); // 个人基本资料页面 | 69 | router.get('/mydetails', auth, homeController.myDetails); // 个人基本资料页面 |
70 | -router.get('/mydetails/modify', homeController.modify); // 个人基本资料修改 | ||
71 | 70 | ||
72 | // router.get('/grade', auth, homeController.grade); // 会员等级页 | 71 | // router.get('/grade', auth, homeController.grade); // 会员等级页 |
73 | router.get('/privilege', homeController.preferential); // 会员特权列表页 | 72 | router.get('/privilege', homeController.preferential); // 会员特权列表页 |
1 | <div class="personal-details yoho-page"> | 1 | <div class="personal-details yoho-page"> |
2 | <ul> | 2 | <ul> |
3 | <li><span>头像</span><span><i class="head-portrait user-avatar" data-avatar="{{image head_ico 128 128}}"></i></span></li> | 3 | <li><span>头像</span><span><i class="head-portrait user-avatar" data-avatar="{{image head_ico 128 128}}"></i></span></li> |
4 | - <li><span>昵称</span><span><input type="text" class="modify nick-name" value="{{ nickname }}" /></span></li> | ||
5 | - <li><span>性别</span> | ||
6 | - <span> | ||
7 | - <select class="modify gender"> | ||
8 | - <option value="{{genderId}}">{{ gender }}</option> | ||
9 | - <option value="{{otherGenderId}}">{{ otherGender }}</option> | ||
10 | - </select> | ||
11 | - </span> | ||
12 | - </li> | ||
13 | - <li><span>生日</span><span><input type="date" class="modify birthday" value="{{ birthday }}" /></span></li> | 4 | + <li><span>昵称</span><span>{{ nickname }}</span></li> |
5 | + <li><span>性别</span><span>{{ gender }}</span></li> | ||
6 | + <li><span>生日</span><span>{{ birthday }}</span></li> | ||
14 | <li class="tap-hightlight"><span>会员等级</span> | 7 | <li class="tap-hightlight"><span>会员等级</span> |
15 | <span> | 8 | <span> |
16 | <a href="grade" class="grade"> | 9 | <a href="grade" class="grade"> |
@@ -9,68 +9,16 @@ | @@ -9,68 +9,16 @@ | ||
9 | * @author: bikai<kai.bi@yoho.cn> | 9 | * @author: bikai<kai.bi@yoho.cn> |
10 | * @date: 2015/11/19 | 10 | * @date: 2015/11/19 |
11 | */ | 11 | */ |
12 | -import $ from 'yoho-jquery'; | ||
13 | -import Page from 'yoho-page'; | ||
14 | -import tip from 'plugin/tip'; | ||
15 | - | 12 | +let $ = require('yoho-jquery'); |
16 | let $userAvatar = $('.user-avatar'); | 13 | let $userAvatar = $('.user-avatar'); |
17 | let myImage = new Image(), | 14 | let myImage = new Image(), |
18 | avatar; | 15 | avatar; |
19 | 16 | ||
20 | require('common'); | 17 | require('common'); |
21 | 18 | ||
22 | -class PersonDetail extends Page { | ||
23 | - constructor() { | ||
24 | - super(); | ||
25 | - this.selector = { | ||
26 | - $modifyInp: $('.modify'), | ||
27 | - $nickName: $('.nick-name'), | ||
28 | - $gender: $('.gender'), | ||
29 | - $birthday: $('.birthday'), | ||
30 | - }; | ||
31 | - | ||
32 | - this.init(); | ||
33 | - } | ||
34 | - | ||
35 | - init() { | ||
36 | - this.bindEvents(); | ||
37 | - | ||
38 | - // 部分老用户没有头像,显示默认头像 | ||
39 | - avatar = $userAvatar.data('avatar'); | ||
40 | - myImage.src = avatar; | ||
41 | - myImage.onload = function() { | ||
42 | - $userAvatar.css('background-image', 'url(' + avatar + ')'); | ||
43 | - }; | ||
44 | - } | ||
45 | - | ||
46 | - bindEvents() { | ||
47 | - this.selector.$modifyInp.on('blur', this.modifyInp.bind(this)); | ||
48 | - } | ||
49 | - | ||
50 | - modifyInp() { | ||
51 | - if (!this.selector.$nickName.val()) { | ||
52 | - tip.show('请输入昵称'); | ||
53 | - return false; | ||
54 | - } | ||
55 | - this.ajax({ | ||
56 | - url: '/home/mydetails/modify', | ||
57 | - data: { | ||
58 | - nickName: this.selector.$nickName.val(), | ||
59 | - gender: this.selector.$gender.val(), | ||
60 | - birthday: this.selector.$birthday.val() | ||
61 | - }, | ||
62 | - }).then(result => { | ||
63 | - if (result && result.code === 200) { | ||
64 | - location.href = location.href; | ||
65 | - } else { | ||
66 | - tip.show(result.message); | ||
67 | - } | ||
68 | - }).catch(error => { | ||
69 | - tip.show(error); | ||
70 | - }); | ||
71 | - } | ||
72 | -} | ||
73 | - | ||
74 | -$(() => { | ||
75 | - new PersonDetail(); | ||
76 | -}); | 19 | +// 部分老用户没有头像,显示默认头像 |
20 | +avatar = $userAvatar.data('avatar'); | ||
21 | +myImage.src = avatar; | ||
22 | +myImage.onload = function() { | ||
23 | + $userAvatar.css('background-image', 'url(' + avatar + ')'); | ||
24 | +}; |
@@ -6,14 +6,6 @@ | @@ -6,14 +6,6 @@ | ||
6 | background-color: #fff; | 6 | background-color: #fff; |
7 | border-bottom: 1px solid #e0e0e0; | 7 | border-bottom: 1px solid #e0e0e0; |
8 | 8 | ||
9 | - input::-webkit-clear-button { | ||
10 | - display: none; | ||
11 | - } | ||
12 | - | ||
13 | - input::-webkit-calendar-picker-indicator { | ||
14 | - display: none; | ||
15 | - } | ||
16 | - | ||
17 | ul { | 9 | ul { |
18 | width: 95%; | 10 | width: 95%; |
19 | height: auto; | 11 | height: auto; |
@@ -101,22 +93,6 @@ | @@ -101,22 +93,6 @@ | ||
101 | } | 93 | } |
102 | } | 94 | } |
103 | 95 | ||
104 | - .modify { | ||
105 | - width: auto; | ||
106 | - border: 0; | ||
107 | - background: none; | ||
108 | - color: #b0b0b0; | ||
109 | - text-align: right; | ||
110 | - } | ||
111 | - | ||
112 | - select { | ||
113 | - direction: rtl; | ||
114 | - } | ||
115 | - | ||
116 | - .modify.nick-name { | ||
117 | - width: 100%; | ||
118 | - } | ||
119 | - | ||
120 | .tip { | 96 | .tip { |
121 | background: url("/home/index/xwf.png"); | 97 | background: url("/home/index/xwf.png"); |
122 | background-size: 100%; | 98 | background-size: 100%; |
-
Please register or login to post a comment