Authored by ccbikai

在线客服样式 JS

@@ -7,4 +7,5 @@ @@ -7,4 +7,5 @@
7 require('./order'); 7 require('./order');
8 require('./fav'); 8 require('./fav');
9 require('./index'); 9 require('./index');
10 -require('./coupons');  
  10 +require('./coupons');
  11 +require('./online-service');
  1 +/**
  2 + * 在线客服
  3 + * @author: bikai<kai.bi@yoho.cn>
  4 + * @date: 2015/11/16
  5 + */
  6 +var $ = require('jquery');
  7 +
  8 +var $questionTab = $('.question-tab .tab-item');
  9 +
  10 +$questionTab.on('touchend', function(){
  11 + var clickTab = $(this).data('tab');
  12 + clickTab = '[data-tab-name="' + clickTab + '"]';
  13 +
  14 + $questionTab.removeClass('current');
  15 + $(this).addClass('current');
  16 +
  17 + $('.question-list').removeClass('current');
  18 + $(clickTab).addClass('current');
  19 +});
1 -@import "home", "vip-grade", "order", "coupons", "personal-details", "yoho-coin", "recommend-for-you", "fav", "suggest", "address";  
  1 +@import "home", "vip-grade", "order", "coupons", "personal-details", "yoho-coin", "recommend-for-you", "fav", "suggest", "address", "online-service";
@@ -2,7 +2,9 @@ @@ -2,7 +2,9 @@
2 @return $n / 40 * 1rem; 2 @return $n / 40 * 1rem;
3 } 3 }
4 4
5 -.online-service-detail-page{ 5 +.online-service-page{
  6 + background: #f0f0f0;
  7 +
6 .question { 8 .question {
7 background: #fff; 9 background: #fff;
8 } 10 }
@@ -20,11 +22,14 @@ @@ -20,11 +22,14 @@
20 line-height: rem(58); 22 line-height: rem(58);
21 text-align: center; 23 text-align: center;
22 color: #b0b0b0; 24 color: #b0b0b0;
  25 +
23 .current { 26 .current {
24 color: #444; 27 color: #444;
25 } 28 }
  29 +
26 .line { 30 .line {
27 - padding: 0 rem(32); 31 + margin: 0 rem(32);
  32 + border-left: 1px solid #b0b0b0;
28 } 33 }
29 } 34 }
30 35
@@ -32,24 +37,29 @@ @@ -32,24 +37,29 @@
32 display: none; 37 display: none;
33 border-top: 1px solid #ccc; 38 border-top: 1px solid #ccc;
34 border-bottom: 1px solid #ccc; 39 border-bottom: 1px solid #ccc;
  40 +
35 &.current { 41 &.current {
36 display: block; 42 display: block;
37 } 43 }
  44 +
38 li { 45 li {
39 margin-left: rem(30); 46 margin-left: rem(30);
40 width: rem(610); 47 width: rem(610);
41 font-size: rem(28); 48 font-size: rem(28);
42 line-height: rem(90); 49 line-height: rem(90);
43 border-bottom: 1px solid #ccc; 50 border-bottom: 1px solid #ccc;
  51 +
44 a { 52 a {
45 display: block; 53 display: block;
46 color: #444; 54 color: #444;
47 } 55 }
  56 +
48 .iconfont { 57 .iconfont {
49 float: right; 58 float: right;
50 margin-right: rem(30); 59 margin-right: rem(30);
51 color: #ccc; 60 color: #ccc;
52 } 61 }
  62 +
53 &:last-child { 63 &:last-child {
54 border-bottom: none; 64 border-bottom: none;
55 } 65 }
@@ -63,14 +73,16 @@ @@ -63,14 +73,16 @@
63 background: #fff; 73 background: #fff;
64 border-top: 1px solid #ccc; 74 border-top: 1px solid #ccc;
65 border-bottom: 1px solid #ccc; 75 border-bottom: 1px solid #ccc;
  76 +
66 p { 77 p {
67 margin-top: rem(25); 78 margin-top: rem(25);
68 margin-left: rem(-72); 79 margin-left: rem(-72);
69 line-height: 1.5; 80 line-height: 1.5;
70 } 81 }
71 - .iconfont {  
72 - float: right; 82 +
  83 + .icon-yoho-enter {
73 color: #ccc; 84 color: #ccc;
  85 + float: right;
74 } 86 }
75 .connect-item { 87 .connect-item {
76 position: relative; 88 position: relative;
@@ -94,15 +106,9 @@ @@ -94,15 +106,9 @@
94 } 106 }
95 } 107 }
96 } 108 }
97 - .icon-chat {  
98 - @include retina-sprite($customerIcons, chat);  
99 - }  
100 - .icon-tel {  
101 - @include retina-sprite($customerIcons, tel);  
102 - }  
103 .icon { 109 .icon {
104 display: inline-block; 110 display: inline-block;
105 - margin-right: rem(14); 111 + margin-right: rem(28);
106 margin-left: rem(-70); 112 margin-left: rem(-70);
107 vertical-align:middle; 113 vertical-align:middle;
108 } 114 }
@@ -110,12 +116,14 @@ @@ -110,12 +116,14 @@
110 } 116 }
111 117
112 .online-service-detail-page { 118 .online-service-detail-page {
  119 + background: #f0f0f0;
  120 +
113 .qa-list { 121 .qa-list {
114 - background: #f0f0f0;  
115 .question-item { 122 .question-item {
116 margin-bottom: rem(32); 123 margin-bottom: rem(32);
117 border-top: 1px solid #c8c7cc; 124 border-top: 1px solid #c8c7cc;
118 border-bottom: 1px solid #c8c7cc; 125 border-bottom: 1px solid #c8c7cc;
  126 + color: #444;
119 background: #fff; 127 background: #fff;
120 &:last-child { 128 &:last-child {
121 margin-bottom: 0; 129 margin-bottom: 0;
1 {{> layout/header}} 1 {{> layout/header}}
2 <div class="online-service-page yoho-page"> 2 <div class="online-service-page yoho-page">
  3 + {{# service}}
3 <div class="question"> 4 <div class="question">
4 <div class="question-title">问题查询</div> 5 <div class="question-title">问题查询</div>
5 <div class="question-tab"> 6 <div class="question-tab">
6 <span class="tab-item" data-tab="order">订单问题</span> 7 <span class="tab-item" data-tab="order">订单问题</span>
7 - <span class="line">|</span> 8 + <span class="line"></span>
8 <span class="tab-item current" data-tab="shopping">购物问题</span> 9 <span class="tab-item current" data-tab="shopping">购物问题</span>
9 - <span class="line">|</span> 10 + <span class="line"></span>
10 <span class="tab-item" data-tab="other">其他问题</span> 11 <span class="tab-item" data-tab="other">其他问题</span>
11 </div> 12 </div>
12 {{#question}} 13 {{#question}}
@@ -15,24 +16,25 @@ @@ -15,24 +16,25 @@
15 <li class="question-item"> 16 <li class="question-item">
16 <a href="{{link}}" title="{{title}}"> 17 <a href="{{link}}" title="{{title}}">
17 {{title}} 18 {{title}}
18 - <span class="iconfont icon-yoho-enter"></span> 19 + <span class="iconfont icon-yoho-enter">&#xe604;</span>
19 </a> 20 </a>
20 </li> 21 </li>
21 {{/list}} 22 {{/list}}
22 </ul> 23 </ul>
23 {{/question}} 24 {{/question}}
24 </div> 25 </div>
  26 + {{/ service}}
25 <div class="connect-info"> 27 <div class="connect-info">
26 <div class="connect-item connect-online"> 28 <div class="connect-item connect-online">
27 <a href="#" title="在线客服"> 29 <a href="#" title="在线客服">
28 - <span class="icon icon-chat"></span> 30 + <span class="icon iconfont icon-chat">&#xe620;</span>
29 在线客服 31 在线客服
30 - <span class="iconfont icon-yoho-enter"></span> 32 + <span class="iconfont icon-yoho-enter">&#xe604;</span>
31 </a> 33 </a>
32 </div> 34 </div>
33 <div class="connect-item connect-tel"> 35 <div class="connect-item connect-tel">
34 <a href="tel:400-889-9649" title="电话客服"> 36 <a href="tel:400-889-9649" title="电话客服">
35 - <span class="icon icon-tel"></span> 37 + <span class="icon iconfont icon-tel">&#xe620;</span>
36 电话客服 38 电话客服
37 <p> 39 <p>
38 400-889-9649 &nbsp;&nbsp; 09:00 - 22:30 &nbsp; (周一至周日) 40 400-889-9649 &nbsp;&nbsp; 09:00 - 22:30 &nbsp; (周一至周日)
@@ -212,16 +212,19 @@ @@ -212,16 +212,19 @@
212 seajs.use('js/me/order'); 212 seajs.use('js/me/order');
213 </script> 213 </script>
214 {{/if}} 214 {{/if}}
215 -  
216 {{!-- 个人中心: 商品收藏&品牌收藏 --}} 215 {{!-- 个人中心: 商品收藏&品牌收藏 --}}
217 {{#if favPage}} 216 {{#if favPage}}
218 <script> 217 <script>
219 seajs.use('js/me/fav'); 218 seajs.use('js/me/fav');
220 </script> 219 </script>
221 {{/if}} 220 {{/if}}
222 -  
223 {{#if couponsPage}} 221 {{#if couponsPage}}
224 <script> 222 <script>
225 seajs.use('js/me/coupons'); 223 seajs.use('js/me/coupons');
226 </script> 224 </script>
  225 +{{/if}}
  226 +{{#if onlineServicePage}}
  227 +<script>
  228 + seajs.use('js/me/online-service');
  229 +</script>
227 {{/if}} 230 {{/if}}
@@ -243,8 +243,17 @@ class HomeController extends AbstractAction @@ -243,8 +243,17 @@ class HomeController extends AbstractAction
243 //在线客服 243 //在线客服
244 public function onlineServiceAction() 244 public function onlineServiceAction()
245 { 245 {
  246 + // 设置网站标题
  247 + $this->setTitle('在线客服');
  248 + $this->setNavHeader('在线客服', true, SITE_MAIN);
  249 +
246 $service = home\OnlineModel::getOnlineServiceInfo(); 250 $service = home\OnlineModel::getOnlineServiceInfo();
247 - $this->_view->display('online_service', $service); 251 +
  252 + $this->_view->display('online_service', array(
  253 + 'onlineServicePage' => true,
  254 + // 'pageFooter' => true,
  255 + 'service' => $service
  256 + ));
248 } 257 }
249 258
250 //在线客服-具体详情 259 //在线客服-具体详情