Authored by 王水玲

新潮教室代码合并

21.3 KB | W: | H:

21.7 KB | W: | H:

  • 2-up
  • Swipe
  • Onion skin

17.3 KB | W: | H:

17.1 KB | W: | H:

  • 2-up
  • Swipe
  • Onion skin
@@ -76,7 +76,7 @@ if ($('.collocation-list').find('li').length === 0) { @@ -76,7 +76,7 @@ if ($('.collocation-list').find('li').length === 0) {
76 } 76 }
77 77
78 // 星搭配收藏请求 78 // 星搭配收藏请求
79 -$(document).on('touchstart', '.collection', function() { 79 +$(document).on('touchstart', '.collection', function(event) {
80 var $that = $(this), 80 var $that = $(this),
81 $icon = $that.find('.collected-ico'); 81 $icon = $that.find('.collected-ico');
82 82
@@ -89,8 +89,12 @@ function intimacyData(data) { @@ -89,8 +89,12 @@ function intimacyData(data) {
89 $('.increased').hide(); 89 $('.increased').hide();
90 } 90 }
91 91
92 - $('.pop-intimacy').show();  
93 - $('.classroom-mask').show(); 92 + $('.pop-intimacy').css({
  93 + zIndex: '10'
  94 + }).show();
  95 + $('.classroom-mask').css({
  96 + zIndex: '9'
  97 + }).show();
94 $('body').css({ 98 $('body').css({
95 overflow: 'hidden' 99 overflow: 'hidden'
96 }); 100 });
@@ -178,7 +182,7 @@ if ($('.home-floor-sign').length > 0) { @@ -178,7 +182,7 @@ if ($('.home-floor-sign').length > 0) {
178 } 182 }
179 183
180 // 星鲜事点赞事件 184 // 星鲜事点赞事件
181 -$(document).on('touchstart', '.like-ico', function() { 185 +$(document).on('touchstart', '.like-ico', function(event) {
182 var $that = $(this), 186 var $that = $(this),
183 addString = ''; 187 addString = '';
184 188
@@ -216,8 +220,9 @@ $(document).on('touchstart', '.like-ico', function() { @@ -216,8 +220,9 @@ $(document).on('touchstart', '.like-ico', function() {
216 }); 220 });
217 221
218 // 增加亲密度请求 222 // 增加亲密度请求
219 -$('.add-intimacy').on('touchstart', function() { 223 +$('.add-intimacy').on('touchstart', function(event) {
220 event.stopPropagation(); 224 event.stopPropagation();
  225 + event.preventDefault();
221 226
222 $.ajax({ 227 $.ajax({
223 type: 'GET', 228 type: 'GET',
@@ -231,7 +236,7 @@ $('.add-intimacy').on('touchstart', function() { @@ -231,7 +236,7 @@ $('.add-intimacy').on('touchstart', function() {
231 236
232 if (code === 201) { 237 if (code === 201) {
233 if ($('#intimacy-link').length <= 0) { 238 if ($('#intimacy-link').length <= 0) {
234 - $('body').append('<a href="' + data.data + '" style="display:none;" id="intimacy-link">' + 239 + $('body').append('<a href=\'' + data.data + '\' style="display:none;" id="intimacy-link">' +
235 '<span class="intimacy-link"></span></a>'); 240 '<span class="intimacy-link"></span></a>');
236 } 241 }
237 242
@@ -246,8 +251,12 @@ $('.add-intimacy').on('touchstart', function() { @@ -246,8 +251,12 @@ $('.add-intimacy').on('touchstart', function() {
246 251
247 // 关闭日历弹出窗事件 252 // 关闭日历弹出窗事件
248 $('.pop-intimacy .pop-close, .classroom-mask').on('click', function() { 253 $('.pop-intimacy .pop-close, .classroom-mask').on('click', function() {
249 - $('.pop-intimacy').hide();  
250 - $('.classroom-mask').hide(); 254 + $('.pop-intimacy').css({
  255 + zIndex: '-1'
  256 + }).hide();
  257 + $('.classroom-mask').css({
  258 + zIndex: '-1'
  259 + }).hide();
251 260
252 $('body').css({ 261 $('body').css({
253 overflow: 'visible' 262 overflow: 'visible'
  1 +
  2 +
1 .yoho-header .nav-title { 3 .yoho-header .nav-title {
2 font-weight: normal; 4 font-weight: normal;
3 } 5 }
@@ -47,7 +49,7 @@ @@ -47,7 +49,7 @@
47 right: 0; 49 right: 0;
48 top: 0; 50 top: 0;
49 bottom: 0; 51 bottom: 0;
50 - z-index: 9; 52 + z-index: -1;
51 display: none; 53 display: none;
52 } 54 }
53 55
@@ -320,7 +322,7 @@ @@ -320,7 +322,7 @@
320 position: fixed; 322 position: fixed;
321 top:20rem / $pxConvertRem; 323 top:20rem / $pxConvertRem;
322 left: 30rem / $pxConvertRem; 324 left: 30rem / $pxConvertRem;
323 - z-index: 10; 325 + z-index: -1;
324 display: none; 326 display: none;
325 327
326 .intimacy-head { 328 .intimacy-head {
@@ -731,7 +733,7 @@ @@ -731,7 +733,7 @@
731 } 733 }
732 734
733 .cont-txt { 735 .cont-txt {
734 - font-size: 30rem / $pxConvertRem; 736 + font-size: 28rem / $pxConvertRem;
735 line-height: 46rem / $pxConvertRem; 737 line-height: 46rem / $pxConvertRem;
736 color: #b0b0b0; 738 color: #b0b0b0;
737 margin-top: 10rem / $pxConvertRem; 739 margin-top: 10rem / $pxConvertRem;
@@ -747,11 +749,17 @@ @@ -747,11 +749,17 @@
747 } 749 }
748 750
749 .title { 751 .title {
750 - font-size: 42rem / $pxConvertRem; 752 + font-size: 40rem / $pxConvertRem;
751 line-height: 48rem / $pxConvertRem; 753 line-height: 48rem / $pxConvertRem;
752 754
753 a { 755 a {
754 color: #fff; 756 color: #fff;
  757 + width: 100%;
  758 + overflow: hidden;
  759 + text-overflow: ellipsis;
  760 + display: -webkit-box;
  761 + -webkit-line-clamp: 2;
  762 + -webkit-box-orient: vertical;
755 } 763 }
756 } 764 }
757 765
@@ -47,7 +47,7 @@ @@ -47,7 +47,7 @@
47 right: 0; 47 right: 0;
48 top: 0; 48 top: 0;
49 bottom: 0; 49 bottom: 0;
50 - z-index: 9; 50 + z-index: -1;
51 display: none; 51 display: none;
52 } 52 }
53 53
@@ -320,7 +320,7 @@ @@ -320,7 +320,7 @@
320 position: fixed; 320 position: fixed;
321 top:20px; 321 top:20px;
322 left: 30px; 322 left: 30px;
323 - z-index: 10; 323 + z-index: -1;
324 display: none; 324 display: none;
325 325
326 .intimacy-head { 326 .intimacy-head {
@@ -27,7 +27,7 @@ @@ -27,7 +27,7 @@
27 <span data-avatar="{{img}}" class="rank-avatar"></span> 27 <span data-avatar="{{img}}" class="rank-avatar"></span>
28 <div class="ranking-mid"> 28 <div class="ranking-mid">
29 <i class="rank-ico">{{num}}</i> 29 <i class="rank-ico">{{num}}</i>
30 - <p class="rank-name">{{userName}}</p> 30 + <p class="rank-name">{{name}}</p>
31 </div> 31 </div>
32 <div class="ranking-rg">亲密度<span class="intimacy {{#if @first}}font-bold{{/if}}">{{intimacyNum}}</span></div> 32 <div class="ranking-rg">亲密度<span class="intimacy {{#if @first}}font-bold{{/if}}">{{intimacyNum}}</span></div>
33 </li> 33 </li>
@@ -17,7 +17,7 @@ @@ -17,7 +17,7 @@
17 </div> 17 </div>
18 <div class="fan-charts"> 18 <div class="fan-charts">
19 <h2>新潮粉丝榜</h2> 19 <h2>新潮粉丝榜</h2>
20 - <a href="/guang/starclass/top" class="arrow iconfont">&#xe614;</a> 20 + <a href="{{topUrl}}" class="arrow iconfont">&#xe614;</a>
21 </div> 21 </div>
22 <ul class="fan-charts-cont"> 22 <ul class="fan-charts-cont">
23 <!-- {{#each fanCharts}} 23 <!-- {{#each fanCharts}}
@@ -91,6 +91,8 @@ class StarClassModel @@ -91,6 +91,8 @@ class StarClassModel
91 if (isset($data['starClassIndex']) && !empty($data['starClassIndex'])) { 91 if (isset($data['starClassIndex']) && !empty($data['starClassIndex'])) {
92 array_splice($result['resources'], 1, 0 ,$rankInfo); 92 array_splice($result['resources'], 1, 0 ,$rankInfo);
93 } 93 }
  94 + //top100链接
  95 + $result['topUrl'] = Helpers::url('/guang/starclass/top');
94 96
95 return $result; 97 return $result;
96 } 98 }
@@ -168,7 +170,6 @@ class StarClassModel @@ -168,7 +170,6 @@ class StarClassModel
168 $collocationList[$key]['content'] = $value['intro']; 170 $collocationList[$key]['content'] = $value['intro'];
169 $collocationList[$key]['time'] = $value['publish_time']; 171 $collocationList[$key]['time'] = $value['publish_time'];
170 $collocationList[$key]['seeNum'] = $value['views_num']; 172 $collocationList[$key]['seeNum'] = $value['views_num'];
171 - $collocationList[$key]['zanNum'] = $value['praise_num'];  
172 $collocationList[$key]['articleId'] = $value['id']; 173 $collocationList[$key]['articleId'] = $value['id'];
173 //string转bool值 174 //string转bool值
174 $collocationList[$key]['isLiked'] = $value['isPraise'] == 'Y' ? true : false; 175 $collocationList[$key]['isLiked'] = $value['isPraise'] == 'Y' ? true : false;
@@ -228,14 +229,13 @@ class StarClassModel @@ -228,14 +229,13 @@ class StarClassModel
228 $data = StarClassData::sign($uid); 229 $data = StarClassData::sign($uid);
229 230
230 $result = array(); 231 $result = array();
231 - $result['signDay'] = '';  
232 //处理签到数据 232 //处理签到数据
233 if (isset($data['code']) && $data['code'] == 200) { 233 if (isset($data['code']) && $data['code'] == 200) {
  234 + $result['signDay'] = '';
234 foreach ($data['data']['logs'] as $key => $value) { 235 foreach ($data['data']['logs'] as $key => $value) {
235 $result['signDay'] .= !empty($value['createTime']) ? date('d', $value['createTime']) . ',' : ''; 236 $result['signDay'] .= !empty($value['createTime']) ? date('d', $value['createTime']) . ',' : '';
236 $result['todayIntimacy'] = $value['addNum']; 237 $result['todayIntimacy'] = $value['addNum'];
237 } 238 }
238 - $result['topUrl'] = Helpers::url('/guang/starclass/top');  
239 $result['intimacyNum'] = isset($data['data']['addNum']) ? $data['data']['addNum'] : '0'; 239 $result['intimacyNum'] = isset($data['data']['addNum']) ? $data['data']['addNum'] : '0';
240 foreach ($data['data']['rankList'] as $key => $value) { 240 foreach ($data['data']['rankList'] as $key => $value) {
241 //排名数据按数组顺序排列 241 //排名数据按数组顺序排列
@@ -248,9 +248,10 @@ class StarClassModel @@ -248,9 +248,10 @@ class StarClassModel
248 248
249 if (!empty($result)) { 249 if (!empty($result)) {
250 return array('code'=>200, 'data'=>$result); 250 return array('code'=>200, 'data'=>$result);
  251 + }else{
  252 + return array('code'=>201, 'message'=>'签到失败');
251 } 253 }
252 254
253 - return;  
254 } 255 }
255 256
256 257
@@ -20,29 +20,26 @@ class StarClassController extends AbstractAction @@ -20,29 +20,26 @@ class StarClassController extends AbstractAction
20 public function indexAction() 20 public function indexAction()
21 { 21 {
22 //获取uid 22 //获取uid
23 - $uid = $this->getLoggedUid(); 23 + $uid = $this->getLoggedUid() ? $this->getLoggedUid() : $this->getCookie('uid');
24 24
25 if (!$this->_isApp) { 25 if (!$this->_isApp) {
26 if ($uid) { 26 if ($uid) {
27 $this->setCookie('uid', $uid); 27 $this->setCookie('uid', $uid);
28 - }else{  
29 - $this->setCookie('uid', '', time() - 3600);  
30 } 28 }
31 }else{ 29 }else{
32 $this->setCookie('isApp',true); 30 $this->setCookie('isApp',true);
33 if ($uid) { 31 if ($uid) {
34 $this->setCookie('uid', $uid); 32 $this->setCookie('uid', $uid);
35 - }else{  
36 - $this->setCookie('uid', '', time() - 3600);  
37 } 33 }
38 } 34 }
39 //设置头部公共导航 35 //设置头部公共导航
40 $isApp = $this->getCookie('isApp', false); 36 $isApp = $this->getCookie('isApp', false);
41 - if (!$isApp) { 37 +
  38 + if (!($isApp || $this->_isApp)) {
42 $this->setNavHeader('星潮教室', true, false); 39 $this->setNavHeader('星潮教室', true, false);
43 } 40 }
44 41
45 - $this->setTitle('星潮教室'); 42 + $this->setTitle('星潮教室', false, '');
46 //调用模型获得星潮教室首页数据 43 //调用模型获得星潮教室首页数据
47 $data = StarClassModel::getStarClass($uid); 44 $data = StarClassModel::getStarClass($uid);
48 //渲染模板 45 //渲染模板
@@ -66,7 +63,7 @@ class StarClassController extends AbstractAction @@ -66,7 +63,7 @@ class StarClassController extends AbstractAction
66 //设置头部公共导航 63 //设置头部公共导航
67 $this->setNavHeader('星潮教室', true, false); 64 $this->setNavHeader('星潮教室', true, false);
68 } 65 }
69 - $this->setTitle('星潮教室'); 66 + $this->setTitle('星潮教室', false, '');
70 67
71 //调用模型获得星专题数据 68 //调用模型获得星专题数据
72 $data = StarClassModel::getspecial(); 69 $data = StarClassModel::getspecial();
@@ -91,7 +88,7 @@ class StarClassController extends AbstractAction @@ -91,7 +88,7 @@ class StarClassController extends AbstractAction
91 //设置头部公共导航 88 //设置头部公共导航
92 $this->setNavHeader('星潮教室', true, false); 89 $this->setNavHeader('星潮教室', true, false);
93 } 90 }
94 - $this->setTitle('星潮教室'); 91 + $this->setTitle('星潮教室', false, '');
95 92
96 //调用模板获得星搭配数据 93 //调用模板获得星搭配数据
97 $data = StarClassModel::getCollocation(); 94 $data = StarClassModel::getCollocation();
@@ -143,7 +140,7 @@ class StarClassController extends AbstractAction @@ -143,7 +140,7 @@ class StarClassController extends AbstractAction
143 $url = Helpers::url('/guang/starclass/index'); 140 $url = Helpers::url('/guang/starclass/index');
144 $this->setNavHeader('星潮粉丝榜', $url, false); 141 $this->setNavHeader('星潮粉丝榜', $url, false);
145 } 142 }
146 - $this->setTitle('星潮粉丝榜'); 143 + $this->setTitle('星潮粉丝榜', false, '');
147 144
148 //根据客户端类型,进行未登录跳转 145 //根据客户端类型,进行未登录跳转
149 if (!$uid) { 146 if (!$uid) {