Merge branch 'release/1.0' of http://git.yoho.cn/fe/yoho-blk into release/1.0
Showing
14 changed files
with
64 additions
and
26 deletions
@@ -13,14 +13,14 @@ const helpModel = require('../models/help'); | @@ -13,14 +13,14 @@ const helpModel = require('../models/help'); | ||
13 | * @returns {*} | 13 | * @returns {*} |
14 | */ | 14 | */ |
15 | /* const getData = (id)=> { | 15 | /* const getData = (id)=> { |
16 | - let contentData = helpModel.contentData().content; | 16 | + let contentData = helpModel.contentData().content; |
17 | 17 | ||
18 | - for (var i = 0; i < contentData.length; i++) { | ||
19 | - if (contentData[i].id === id) { | ||
20 | - return contentData[i] | ||
21 | - } | ||
22 | - } | ||
23 | -};*/ | 18 | + for (var i = 0; i < contentData.length; i++) { |
19 | + if (contentData[i].id === id) { | ||
20 | + return contentData[i] | ||
21 | + } | ||
22 | + } | ||
23 | + };*/ | ||
24 | 24 | ||
25 | /** | 25 | /** |
26 | * 根据id获取当前所在位置,拼接面包屑 | 26 | * 根据id获取当前所在位置,拼接面包屑 |
@@ -57,7 +57,7 @@ const getNav = (id)=> { | @@ -57,7 +57,7 @@ const getNav = (id)=> { | ||
57 | /** | 57 | /** |
58 | * 主界面 | 58 | * 主界面 |
59 | */ | 59 | */ |
60 | -const index = (req, res) => { | 60 | +const index = (req, res,next) => { |
61 | let id = req.query.id || '11'; | 61 | let id = req.query.id || '11'; |
62 | 62 | ||
63 | helpModel.getHelpDetail('81', 1, 15, '').then(result=> { | 63 | helpModel.getHelpDetail('81', 1, 15, '').then(result=> { |
@@ -73,13 +73,15 @@ const index = (req, res) => { | @@ -73,13 +73,15 @@ const index = (req, res) => { | ||
73 | } | 73 | } |
74 | ]; | 74 | ]; |
75 | 75 | ||
76 | - nav = nav.concat(getNav(id)); | 76 | + if (!(typeof (getNav(id)) === "undefined")) { |
77 | + nav = nav.concat(getNav(id)); | ||
78 | + } | ||
77 | res.display('detail', { | 79 | res.display('detail', { |
78 | module: 'help', | 80 | module: 'help', |
79 | page: 'help', | 81 | page: 'help', |
80 | content: Object.assign({nav}, data) | 82 | content: Object.assign({nav}, data) |
81 | }); | 83 | }); |
82 | - }); | 84 | + }).catch(next); |
83 | 85 | ||
84 | /* let data = Object.assign(getData(id), helpModel.menuData()); | 86 | /* let data = Object.assign(getData(id), helpModel.menuData()); |
85 | let nav = [ | 87 | let nav = [ |
@@ -100,7 +102,6 @@ const index = (req, res) => { | @@ -100,7 +102,6 @@ const index = (req, res) => { | ||
100 | }; | 102 | }; |
101 | 103 | ||
102 | 104 | ||
103 | - | ||
104 | module.exports = { | 105 | module.exports = { |
105 | index | 106 | index |
106 | }; | 107 | }; |
@@ -314,7 +314,7 @@ const relateMobile = (req, res, next) => { | @@ -314,7 +314,7 @@ const relateMobile = (req, res, next) => { | ||
314 | let areaCode = req.body.areaCode || '86'; | 314 | let areaCode = req.body.areaCode || '86'; |
315 | let sourceType = req.body.sourceType; | 315 | let sourceType = req.body.sourceType; |
316 | 316 | ||
317 | - return BindService.relateMobileAsync(openId, sourceType, mobile, areaCode).then(result => { | 317 | + BindService.relateMobileAsync(openId, sourceType, mobile, areaCode).then(result => { |
318 | if (result && result.code) { | 318 | if (result && result.code) { |
319 | if (result.code === 200 && result.data && result.data.uid) { | 319 | if (result.code === 200 && result.data && result.data.uid) { |
320 | let refer = helpers.urlFormat('/passport/thirdlogin/relatesuccess', { | 320 | let refer = helpers.urlFormat('/passport/thirdlogin/relatesuccess', { |
@@ -193,7 +193,7 @@ let msgCaptcha = (req, res, next) => { | @@ -193,7 +193,7 @@ let msgCaptcha = (req, res, next) => { | ||
193 | }; | 193 | }; |
194 | 194 | ||
195 | /** | 195 | /** |
196 | - * 注册接口 | 196 | + * 手机注册 |
197 | */ | 197 | */ |
198 | let mobileRegister = (req, res, next) => { | 198 | let mobileRegister = (req, res, next) => { |
199 | Promise.coroutine(function*() { | 199 | Promise.coroutine(function*() { |
@@ -3,9 +3,9 @@ | @@ -3,9 +3,9 @@ | ||
3 | <ul class="about-us clearfix"> | 3 | <ul class="about-us clearfix"> |
4 | <li><a href="{{siteUrl}}">BLK首页</a></li> | 4 | <li><a href="{{siteUrl}}">BLK首页</a></li> |
5 | <li><a href="{{siteUrl}}/help">客户服务</a></li> | 5 | <li><a href="{{siteUrl}}/help">客户服务</a></li> |
6 | - <li><a href="{{siteUrl}}/#">支付方式</a></li> | ||
7 | - <li><a href="{{siteUrl}}/#">配送方式</a></li> | ||
8 | - <li><a href="{{siteUrl}}/#">售后服务</a></li> | 6 | + <li><a href="{{siteUrl}}/help?id=2">支付方式</a></li> |
7 | + <li><a href="{{siteUrl}}/help?id=31">配送方式</a></li> | ||
8 | + <li><a href="{{siteUrl}}/help?id=41">售后服务</a></li> | ||
9 | </ul> | 9 | </ul> |
10 | <div class="record-info"> | 10 | <div class="record-info"> |
11 | <p> | 11 | <p> |
@@ -61,7 +61,7 @@ | @@ -61,7 +61,7 @@ | ||
61 | "uuid": "^2.0.2", | 61 | "uuid": "^2.0.2", |
62 | "winston": "^2.2.0", | 62 | "winston": "^2.2.0", |
63 | "winston-daily-rotate-file": "^1.1.4", | 63 | "winston-daily-rotate-file": "^1.1.4", |
64 | - "yoho-node-lib": "0.0.30" | 64 | + "yoho-node-lib": "0.0.31" |
65 | }, | 65 | }, |
66 | "devDependencies": { | 66 | "devDependencies": { |
67 | "autoprefixer": "^6.3.6", | 67 | "autoprefixer": "^6.3.6", |
@@ -450,6 +450,18 @@ function bindUploadEvent() { | @@ -450,6 +450,18 @@ function bindUploadEvent() { | ||
450 | }); | 450 | }); |
451 | } | 451 | } |
452 | 452 | ||
453 | +function bindKeyUpEvent() { | ||
454 | + $('.mark-text').on('keyup', function() { | ||
455 | + var $this = $(this), | ||
456 | + str = $.trim($this.val()); | ||
457 | + | ||
458 | + if (str.length > 100) { | ||
459 | + str = str.substring(0, 100); | ||
460 | + } | ||
461 | + $this.val(str); | ||
462 | + }); | ||
463 | +} | ||
464 | + | ||
453 | $(document).on('ready', function() { | 465 | $(document).on('ready', function() { |
454 | getProductInfo(); | 466 | getProductInfo(); |
455 | bindSelectEvent(); | 467 | bindSelectEvent(); |
@@ -459,4 +471,5 @@ $(document).on('ready', function() { | @@ -459,4 +471,5 @@ $(document).on('ready', function() { | ||
459 | initAddr($('#city').data('code')); | 471 | initAddr($('#city').data('code')); |
460 | bindBlurEvent(); | 472 | bindBlurEvent(); |
461 | bindUploadEvent(); | 473 | bindUploadEvent(); |
474 | + bindKeyUpEvent(); | ||
462 | }); | 475 | }); |
@@ -59,7 +59,7 @@ function cancelOrder(code, onCancel) { | @@ -59,7 +59,7 @@ function cancelOrder(code, onCancel) { | ||
59 | ] | 59 | ] |
60 | }).show(); | 60 | }).show(); |
61 | } else { | 61 | } else { |
62 | - new _alert('<h1>出错了!修改失败!</h1>').show(); | 62 | + new _alert('<h1>' + result.message + '</h1>').show(); |
63 | } | 63 | } |
64 | 64 | ||
65 | }).fail(function(err) { | 65 | }).fail(function(err) { |
@@ -11,8 +11,11 @@ module.exports = function(code) { | @@ -11,8 +11,11 @@ module.exports = function(code) { | ||
11 | if (result.code === 200) { | 11 | if (result.code === 200) { |
12 | location.href = '/shopping/cart'; | 12 | location.href = '/shopping/cart'; |
13 | } else { | 13 | } else { |
14 | - new _alert('出错了,请重试!').show(); | 14 | + new _alert(result.message).show(); |
15 | } | 15 | } |
16 | + }).fail(function(err) { | ||
17 | + console.log(err); | ||
18 | + new _alert('出错了!').show(); | ||
16 | }); | 19 | }); |
17 | }; | 20 | }; |
18 | 21 |
@@ -223,6 +223,11 @@ $refundTable.on('change', '.refund-reason', function() { | @@ -223,6 +223,11 @@ $refundTable.on('change', '.refund-reason', function() { | ||
223 | upload.up({ | 223 | upload.up({ |
224 | callback: function(result) { | 224 | callback: function(result) { |
225 | if (result && result.code === 200) { | 225 | if (result && result.code === 200) { |
226 | + // 避免异步上传导致数量不统一 | ||
227 | + num = $this.data('num') || 0; | ||
228 | + if (num > 3) { | ||
229 | + return; | ||
230 | + } | ||
226 | $this.siblings('.img-up-tip').text(++num + '/4'); | 231 | $this.siblings('.img-up-tip').text(++num + '/4'); |
227 | $this.data('num', num); | 232 | $this.data('num', num); |
228 | $this.before(imgFn(result)); | 233 | $this.before(imgFn(result)); |
@@ -318,9 +318,9 @@ exports.init = function() { | @@ -318,9 +318,9 @@ exports.init = function() { | ||
318 | var name = $clickItem.data('value'); | 318 | var name = $clickItem.data('value'); |
319 | var $selectedItem = $clickItem.siblings('.selected'); | 319 | var $selectedItem = $clickItem.siblings('.selected'); |
320 | 320 | ||
321 | - $selectedItem.find('.iconfont').html('').removeClass('selected'); | 321 | + $selectedItem.find('.iconfont').html('').end().removeClass('selected'); |
322 | 322 | ||
323 | - $clickItem.find('.iconfont').html(selectedIcon).addClass('selected'); | 323 | + $clickItem.find('.iconfont').html(selectedIcon).end().addClass('selected'); |
324 | 324 | ||
325 | $regionSelectHeader.find('.name').html(name); | 325 | $regionSelectHeader.find('.name').html(name); |
326 | $regionCodeText.text(areaCode); | 326 | $regionCodeText.text(areaCode); |
@@ -287,9 +287,9 @@ $regionSelectList.on('click', '.option', function() { | @@ -287,9 +287,9 @@ $regionSelectList.on('click', '.option', function() { | ||
287 | var name = $clickItem.data('value'); | 287 | var name = $clickItem.data('value'); |
288 | var $selectedItem = $clickItem.siblings('.selected'); | 288 | var $selectedItem = $clickItem.siblings('.selected'); |
289 | 289 | ||
290 | - $selectedItem.find('.iconfont').html('').removeClass('selected'); | 290 | + $selectedItem.find('.iconfont').html('').end().removeClass('selected'); |
291 | 291 | ||
292 | - $clickItem.find('.iconfont').html(selectedIcon).addClass('selected'); | 292 | + $clickItem.find('.iconfont').html(selectedIcon).end().addClass('selected'); |
293 | 293 | ||
294 | $regionSelectHeader.find('.name').html(name); | 294 | $regionSelectHeader.find('.name').html(name); |
295 | $regionCodeText.text(areaCode); | 295 | $regionCodeText.text(areaCode); |
@@ -534,9 +534,8 @@ exports.init = function() { | @@ -534,9 +534,8 @@ exports.init = function() { | ||
534 | var name = $clickItem.data('value'); | 534 | var name = $clickItem.data('value'); |
535 | var $selectedItem = $clickItem.siblings('.selected'); | 535 | var $selectedItem = $clickItem.siblings('.selected'); |
536 | 536 | ||
537 | - $selectedItem.find('.iconfont').html('').removeClass('selected'); | ||
538 | - | ||
539 | - $clickItem.find('.iconfont').html(selectedIcon).addClass('selected'); | 537 | + $selectedItem.find('.iconfont').html('').end().removeClass('selected'); |
538 | + $clickItem.find('.iconfont').html(selectedIcon).end().addClass('selected'); | ||
540 | 539 | ||
541 | $regionSelectHeader.find('.name').html(name); | 540 | $regionSelectHeader.find('.name').html(name); |
542 | $regionCodeText.text(areaCode); | 541 | $regionCodeText.text(areaCode); |
1 | .refund-wrap { | 1 | .refund-wrap { |
2 | + position: relative; | ||
3 | + | ||
4 | + .refund-notice { | ||
5 | + width: 70px; | ||
6 | + height: 24px; | ||
7 | + line-height: 26px; | ||
8 | + text-align: center; | ||
9 | + font-size: 12px; | ||
10 | + border: 1px solid #eee; | ||
11 | + display: block; | ||
12 | + cursor: pointer; | ||
13 | + position: absolute; | ||
14 | + top: -64px; | ||
15 | + right: 0; | ||
16 | + } | ||
17 | + | ||
2 | .returns-status { | 18 | .returns-status { |
3 | margin-bottom: 40px; | 19 | margin-bottom: 40px; |
4 | } | 20 | } |
-
Please register or login to post a comment