Showing
8 changed files
with
101 additions
and
60 deletions
@@ -2,11 +2,12 @@ | @@ -2,11 +2,12 @@ | ||
2 | * 收藏商品、品牌 | 2 | * 收藏商品、品牌 |
3 | * @type {Object} | 3 | * @type {Object} |
4 | */ | 4 | */ |
5 | +'use strict'; | ||
5 | const favModel = require('../models/favorite'); | 6 | const favModel = require('../models/favorite'); |
6 | const helpers = global.yoho.helpers; | 7 | const helpers = global.yoho.helpers; |
7 | 8 | ||
8 | const fav = { | 9 | const fav = { |
9 | - favorite: (req, res, next) => { | 10 | + favorite: (req, res) => { |
10 | if (req.query.tab === 'brand') { | 11 | if (req.query.tab === 'brand') { |
11 | res.render('favorite-brand', { | 12 | res.render('favorite-brand', { |
12 | module: 'home', | 13 | module: 'home', |
@@ -97,7 +98,7 @@ const fav = { | @@ -97,7 +98,7 @@ const fav = { | ||
97 | const type = req.body.type; | 98 | const type = req.body.type; |
98 | favModel.favoriteDelete(uid, favId, type).then(data => { | 99 | favModel.favoriteDelete(uid, favId, type).then(data => { |
99 | return res.json(data); | 100 | return res.json(data); |
100 | - }); | 101 | + }).catch(next); |
101 | } | 102 | } |
102 | } | 103 | } |
103 | 104 |
@@ -15,6 +15,12 @@ const refund = { | @@ -15,6 +15,12 @@ const refund = { | ||
15 | refundModel.getOrderData(uid, orderId).then(result => { | 15 | refundModel.getOrderData(uid, orderId).then(result => { |
16 | res.json(result); | 16 | res.json(result); |
17 | }).catch(next); | 17 | }).catch(next); |
18 | + }, | ||
19 | + logistics(req, res) { | ||
20 | + res.render('logistics', { | ||
21 | + module: 'home', | ||
22 | + page: 'logistics' | ||
23 | + }); | ||
18 | } | 24 | } |
19 | }; | 25 | }; |
20 | 26 |
@@ -2,7 +2,6 @@ | @@ -2,7 +2,6 @@ | ||
2 | const api = global.yoho.API; | 2 | const api = global.yoho.API; |
3 | const serviceAPI = global.yoho.ServiceAPI; | 3 | const serviceAPI = global.yoho.ServiceAPI; |
4 | const Promise = require('bluebird'); | 4 | const Promise = require('bluebird'); |
5 | -const co = Promise.coroutine; | ||
6 | const _ = require('lodash'); | 5 | const _ = require('lodash'); |
7 | const helpers = global.yoho.helpers; | 6 | const helpers = global.yoho.helpers; |
8 | 7 | ||
@@ -76,63 +75,6 @@ exports.getUserHomeData = (uid) => { | @@ -76,63 +75,6 @@ exports.getUserHomeData = (uid) => { | ||
76 | }; | 75 | }; |
77 | 76 | ||
78 | /** | 77 | /** |
79 | - * 处理用户收藏的商品数据 | ||
80 | - * | ||
81 | - * @param int uid 用户ID | ||
82 | - * @param int page 第几页 | ||
83 | - * @param int limit 限制读取的数目,默认10 | ||
84 | - * @return array 处理之后的收藏的商品数据 | ||
85 | - */ | ||
86 | -exports.getFavProductData = (uid, page, limit) => { | ||
87 | - return api.get('', { | ||
88 | - method: 'app.favorite.product', | ||
89 | - uid: uid, | ||
90 | - page: page, | ||
91 | - limit: limit | ||
92 | - }).then(result => { | ||
93 | - return result.data; | ||
94 | - }); | ||
95 | -}; | ||
96 | - | ||
97 | -/** | ||
98 | - * 处理用户收藏的品牌数据 | ||
99 | - * | ||
100 | - * @param int uid 用户ID | ||
101 | - * @param string gender 性别 1,3表示男,2,3表示女,1,2,3表示全部 | ||
102 | - * @param int page 第几页 | ||
103 | - * @param int limit 限制读取的数目 | ||
104 | - * @return array 处理之后的收藏的品牌数据 | ||
105 | - */ | ||
106 | -exports.getFavBrandData = (uid, gender, page, limit) => { | ||
107 | - return api.get('', { | ||
108 | - method: 'app.favorite.brand', | ||
109 | - uid: uid, | ||
110 | - gender: gender, | ||
111 | - page: page, | ||
112 | - limit: limit | ||
113 | - }).then(result => { | ||
114 | - return result.data; | ||
115 | - }) | ||
116 | -} | ||
117 | - | ||
118 | -/** | ||
119 | - * 取消收藏的商品/品牌数据 | ||
120 | - * | ||
121 | - * @param int uid 用户ID | ||
122 | - * @param int favId 要取消的收藏id | ||
123 | - * @param string type 取消类型(brand:品牌,product:商品) | ||
124 | - * @return array 接口返回的数据 | ||
125 | - */ | ||
126 | -exports.favoriteDelete = (uid, favId, type) => { | ||
127 | - return api.get('', { | ||
128 | - method: 'app.favorite.cancel', | ||
129 | - uid: uid, | ||
130 | - type: type, | ||
131 | - fav_id: favId | ||
132 | - }); | ||
133 | -} | ||
134 | - | ||
135 | -/** | ||
136 | * 帮助中心列表页 | 78 | * 帮助中心列表页 |
137 | * | 79 | * |
138 | * @param data | 80 | * @param data |
@@ -31,6 +31,8 @@ router.post('/favorite/favdel', favorite.favdel); // 个人中心 - 收藏商品 | @@ -31,6 +31,8 @@ router.post('/favorite/favdel', favorite.favdel); // 个人中心 - 收藏商品 | ||
31 | 31 | ||
32 | router.get('/refund', refund.refund); | 32 | router.get('/refund', refund.refund); |
33 | router.get('/refund/order', refund.order); | 33 | router.get('/refund/order', refund.order); |
34 | +router.get('/refund/logistics', refund.logistics); // 退换货 - 商品寄回信息 | ||
35 | + | ||
34 | 36 | ||
35 | router.get('/about-us', home.aboutUs); // 个人中心 - 关于我们 | 37 | router.get('/about-us', home.aboutUs); // 个人中心 - 关于我们 |
36 | 38 |
apps/home/views/action/logistics.hbs
0 → 100644
1 | +<div class="logistics-page"> | ||
2 | + <div class="edit-logistics-page"> | ||
3 | + <form class="edit-logistics"> | ||
4 | + <label class="company"> | ||
5 | + 选择快递公司 | ||
6 | + <input type="text" name="company" value="{{company}}" readonly> | ||
7 | + <span class="icon icon-right"></span> | ||
8 | + </label> | ||
9 | + <label class="num"> | ||
10 | + 快递单号 | ||
11 | + <input type="text" name="num" value="{{num}}"> | ||
12 | + </label> | ||
13 | + </form> | ||
14 | + <div class="submit">确认</div> | ||
15 | + </div> | ||
16 | +</div> |
public/js/home/logistics.page.js
0 → 100644
public/scss/home/_logistics.css
0 → 100644
1 | +.logistics-page { | ||
2 | + width: 100%; | ||
3 | + background: #f0f0f0; | ||
4 | + | ||
5 | + .edit-logistics-page { | ||
6 | + width: 100%; | ||
7 | + color: #d0d0d0; | ||
8 | + background: #f0f0f0; | ||
9 | + | ||
10 | + .edit-logistics { | ||
11 | + padding: 0 30px; | ||
12 | + background: #fff; | ||
13 | + font-size: 30px; | ||
14 | + line-height: 88px; | ||
15 | + border-bottom: 1px solid #e0e0e0; | ||
16 | + | ||
17 | + label { | ||
18 | + display: block; | ||
19 | + position: relative; | ||
20 | + color: #000; | ||
21 | + font-size: 34px; | ||
22 | + border-bottom: 1px solid #e0e0e0; | ||
23 | + | ||
24 | + &:last-of-type:after { | ||
25 | + content: none; | ||
26 | + } | ||
27 | + | ||
28 | + input { | ||
29 | + direction: rtl; | ||
30 | + } | ||
31 | + } | ||
32 | + | ||
33 | + input { | ||
34 | + position: absolute; | ||
35 | + top: 0; | ||
36 | + right: 40px; | ||
37 | + width: 360px; | ||
38 | + height: 88px; | ||
39 | + color: #444; | ||
40 | + padding: 0; | ||
41 | + border: none; | ||
42 | + -webkit-appearance: none; | ||
43 | + } | ||
44 | + | ||
45 | + p { | ||
46 | + position: absolute; | ||
47 | + top: 0; | ||
48 | + right: 40px; | ||
49 | + width: 360px; | ||
50 | + height: 88px; | ||
51 | + color: #444; | ||
52 | + padding: 0; | ||
53 | + border: none; | ||
54 | + } | ||
55 | + } | ||
56 | + | ||
57 | + .submit { | ||
58 | + margin: auto 30px; | ||
59 | + width: 100%; | ||
60 | + height: 100px; | ||
61 | + color: #fff; | ||
62 | + background: #000; | ||
63 | + text-align: center; | ||
64 | + font-size: 28px; | ||
65 | + line-height: 88px; | ||
66 | + | ||
67 | + &.highlight { | ||
68 | + background: rgba(0, 0, 0, 0.6); | ||
69 | + } | ||
70 | + } | ||
71 | + } | ||
72 | +} | ||
73 | + |
-
Please register or login to post a comment