Authored by lijing

个人中心优化

@@ -24,12 +24,35 @@ const getOnlineServiceInfo = (req, res, next) => { @@ -24,12 +24,35 @@ const getOnlineServiceInfo = (req, res, next) => {
24 }), 24 }),
25 title: '在线客服', 25 title: '在线客服',
26 pageFooter: true, 26 pageFooter: true,
27 - service: result 27 + service: result,
  28 + serviceUrl: 'http://chat80.live800.com/live800/chatClient/chatbox.jsp?companyID=493979&configID=123576&jid=9277320930'
28 }); 29 });
29 }).catch(next); 30 }).catch(next);
  31 +};
  32 +
  33 +const getOnlineServiceDetail = (req, res, next) => {
  34 + let cateId = parseInt(req.query.cateInfo, 10);
  35 + let title = req.query.cateInfo.substring(req.query.cateInfo.indexOf('_') + 1);
  36 +
  37 + onlineModel.getOnlineServiceDetail(cateId).then((result) => {
30 38
  39 + res.render('online-service-detail', {
  40 + module: 'home',
  41 + page: 'online-service',
  42 + pageHeader: _.assign(headerModel.setNav({
  43 + navTitle: title
  44 + }), {
  45 + navBtn: false
  46 + }),
  47 + title: title,
  48 + pageFooter: true,
  49 + service: result
  50 + });
  51 + }).catch(next);
31 }; 52 };
32 53
  54 +
33 module.exports = { 55 module.exports = {
34 - getOnlineServiceInfo 56 + getOnlineServiceInfo,
  57 + getOnlineServiceDetail
35 }; 58 };
@@ -5,13 +5,13 @@ const api = global.yoho.API; @@ -5,13 +5,13 @@ const api = global.yoho.API;
5 5
6 const couponData = (params) => { 6 const couponData = (params) => {
7 return api.get('', params).then(result => { 7 return api.get('', params).then(result => {
8 - if(result && result.data && result.data.info){  
9 - for(let item of result.data.info){ 8 + if (result && result.data && result.data.info) {
  9 + for (let item of result.data.info) {
10 item.used = ((params.status === '1') ? true : false); 10 item.used = ((params.status === '1') ? true : false);
11 } 11 }
12 return result.data.info; 12 return result.data.info;
13 } 13 }
14 - else{ 14 + else {
15 return 0; 15 return 0;
16 } 16 }
17 }); 17 });
@@ -11,7 +11,7 @@ const getOnlineServiceInfo = (contentCode) => { @@ -11,7 +11,7 @@ const getOnlineServiceInfo = (contentCode) => {
11 return serviceAPI.get('operations/api/v1/help/getCategory', { 11 return serviceAPI.get('operations/api/v1/help/getCategory', {
12 content_code: contentCode 12 content_code: contentCode
13 }).then((result) => { 13 }).then((result) => {
14 - // console.log(result) 14 +
15 if (result && result.code === 200) { 15 if (result && result.code === 200) {
16 16
17 let formData = { 17 let formData = {
@@ -57,7 +57,17 @@ const getOnlineServiceInfo = (contentCode) => { @@ -57,7 +57,17 @@ const getOnlineServiceInfo = (contentCode) => {
57 }); 57 });
58 }; 58 };
59 59
  60 +const getOnlineServiceDetail = (cateId) => {
  61 +
  62 + return serviceAPI.get('operations/api/v1/help/getHelp', {
  63 + category_id: cateId
  64 + }).then((result) => {
  65 + return result;
  66 + });
  67 +};
  68 +
60 module.exports = { 69 module.exports = {
61 - getOnlineServiceInfo 70 + getOnlineServiceInfo,
  71 + getOnlineServiceDetail
62 }; 72 };
63 73
@@ -65,17 +65,8 @@ const saveSuggest = (uid, content, image, suggestType) => { @@ -65,17 +65,8 @@ const saveSuggest = (uid, content, image, suggestType) => {
65 return serviceAPI.get('suggest/api/v1/suggest/saveSuggest', per); 65 return serviceAPI.get('suggest/api/v1/suggest/saveSuggest', per);
66 }; 66 };
67 67
68 -// 图片上传  
69 -// const suggestimgUpload = (name) => {  
70 -  
71 -  
72 -// };  
73 -  
74 -  
75 module.exports = { 68 module.exports = {
76 suggestData, 69 suggestData,
77 upAndDown, 70 upAndDown,
78 saveSuggest 71 saveSuggest
79 -  
80 - // suggestimgUpload  
81 }; 72 };
@@ -91,6 +91,7 @@ router.post('/ajaxDelMes', message.ajaxDelMes); @@ -91,6 +91,7 @@ router.post('/ajaxDelMes', message.ajaxDelMes);
91 router.post('/pickCoupon', message.pickCoupon); 91 router.post('/pickCoupon', message.pickCoupon);
92 92
93 // 在线客服 93 // 在线客服
94 -router.get('/onlineService', onlineService.getOnlineServiceInfo); 94 +router.get('/onlineservice', onlineService.getOnlineServiceInfo);
  95 +router.get('/onlineservicedetail', onlineService.getOnlineServiceDetail);
95 96
96 module.exports = router; 97 module.exports = router;
  1 +<div class="online-service-detail-page yoho-page">
  2 + <div class="qa-list">
  3 + {{# service}}
  4 + {{# data}}
  5 + <div class="question-item">
  6 + <div class="question">Q:{{title}}</div>
  7 + <div class="answer">{{content}}</div>
  8 + </div>
  9 + {{/ data}}
  10 + {{/ service}}
  11 + </div>
  12 +</div>
1 {{#if this}} {{!-- 剔除值为false的项 --}} 1 {{#if this}} {{!-- 剔除值为false的项 --}}
2 - {{#each this}} 2 + {{#this}}
3 <div class="good-info {{#if @root.saleViplogin}}sale-vip{{/if}}" data-id="{{productSkn}}" data-bp-id="guang_goodList_{{productName}}_false"> 3 <div class="good-info {{#if @root.saleViplogin}}sale-vip{{/if}}" data-id="{{productSkn}}" data-bp-id="guang_goodList_{{productName}}_false">
4 <div class="tag-container clearfix"> 4 <div class="tag-container clearfix">
5 {{# tags}} 5 {{# tags}}
@@ -60,5 +60,5 @@ @@ -60,5 +60,5 @@
60 {{/if}} 60 {{/if}}
61 </div> 61 </div>
62 </div> 62 </div>
63 - {{/each}} 63 + {{/this}}
64 {{/if}} 64 {{/if}}
@@ -7,6 +7,8 @@ var $ = require('yoho-jquery'); @@ -7,6 +7,8 @@ var $ = require('yoho-jquery');
7 7
8 var $questionTab = $('.question-tab .tab-item'); 8 var $questionTab = $('.question-tab .tab-item');
9 9
  10 +require('../common');
  11 +
10 $questionTab.on('touchend', function() { 12 $questionTab.on('touchend', function() {
11 var clickTab = $(this).data('tab'); 13 var clickTab = $(this).data('tab');
12 14
@@ -20,6 +20,8 @@ var orderId = $('#order-detail').data('id'), @@ -20,6 +20,8 @@ var orderId = $('#order-detail').data('id'),
20 optHammer, 20 optHammer,
21 $createTime = new Date($('.createTime').text() * 1000); 21 $createTime = new Date($('.createTime').text() * 1000);
22 22
  23 +require('../common');
  24 +
23 lazyLoad({ 25 lazyLoad({
24 try_again_css: 'order-failure' 26 try_again_css: 'order-failure'
25 }); 27 });
@@ -22,7 +22,7 @@ var $uploadImgList = $('.upload-img-list'), @@ -22,7 +22,7 @@ var $uploadImgList = $('.upload-img-list'),
22 uploadImgNum = 0; 22 uploadImgNum = 0;
23 23
24 require('./jquery.upload'); 24 require('./jquery.upload');
25 - 25 +require('../common');
26 26
27 imgTpl = '{{# imgList}}' + 27 imgTpl = '{{# imgList}}' +
28 '<li>' + 28 '<li>' +