Authored by zhangxiaoru

列表页

@@ -74,7 +74,7 @@ const index = (req, res) => { @@ -74,7 +74,7 @@ const index = (req, res) => {
74 liked: true, 74 liked: true,
75 like: '8' 75 like: '8'
76 }, 76 },
77 - { 77 + {
78 id: '2', 78 id: '2',
79 msgLeft: '潮品', 79 msgLeft: '潮品',
80 msgTitle: '很到位和范围的恢复文件和的减肥了晚餐费', 80 msgTitle: '很到位和范围的恢复文件和的减肥了晚餐费',
@@ -136,7 +136,7 @@ const list = (req, res) => { @@ -136,7 +136,7 @@ const list = (req, res) => {
136 liked: true, 136 liked: true,
137 like: '8' 137 like: '8'
138 }, 138 },
139 - { 139 + {
140 id: '2', 140 id: '2',
141 msgLeft: '潮品', 141 msgLeft: '潮品',
142 msgTitle: '很到位和范围的恢复文件和的减肥了晚餐费', 142 msgTitle: '很到位和范围的恢复文件和的减肥了晚餐费',
@@ -153,7 +153,7 @@ const list = (req, res) => { @@ -153,7 +153,7 @@ const list = (req, res) => {
153 totalRows: 100 // total page number 153 totalRows: 100 // total page number
154 } 154 }
155 }, 155 },
156 - 156 +
157 helpers: { 157 helpers: {
158 // import component, path depends on your project 158 // import component, path depends on your project
159 pagination: require('../../../doraemon/components/pagination/pagination').createPagination 159 pagination: require('../../../doraemon/components/pagination/pagination').createPagination
@@ -163,6 +163,6 @@ const list = (req, res) => { @@ -163,6 +163,6 @@ const list = (req, res) => {
163 }; 163 };
164 164
165 module.exports = { 165 module.exports = {
166 - index ,// 组件demo页 166 + index, // 组件demo页
167 list 167 list
168 }; 168 };
@@ -4,30 +4,31 @@ @@ -4,30 +4,31 @@
4 * @date: 2016/07/05 4 * @date: 2016/07/05
5 */ 5 */
6 6
7 - var $ = require('yoho-jquery'), 7 +var $ = require('yoho-jquery'),
8 lazyLoad = require('yoho-jquery-lazyload'); 8 lazyLoad = require('yoho-jquery-lazyload');
9 9
10 var prising; 10 var prising;
11 11
12 - lazyLoad($('#msg-list img.lazy')); 12 +lazyLoad($('#msg-list img.lazy'));
13 13
14 -$(".msg-nav li").on('click', function() {  
15 - var activeTab = $(this).attr("data-type"),  
16 - href = $(this).find('a').attr("href"); 14 +$('.msg-nav li').on('click', function() {
  15 + var activeTab = $(this).attr('data-type'),
  16 + href = $(this).find('a').attr('href');
17 17
18 - $(".msg-nav li").removeClass("active");  
19 - $(this).addClass("active");  
20 - console.log(activeTab)  
21 - console.log(href) 18 + $('.msg-nav li').removeClass('active');
  19 + $(this).addClass('active');
  20 + console.log(activeTab);
  21 + console.log(href);
22 }); 22 });
23 23
24 $('.editorial-index-page').on('click', '.like-icon', function() { 24 $('.editorial-index-page').on('click', '.like-icon', function() {
25 var $this = $(this), 25 var $this = $(this),
26 - msgId = $this.closest('.content-msg').data().id,  
27 - url; 26 + msgId = $this.closest('.content-msg').data().id;
28 27
  28 + // url;
29 29
30 - //同一资讯多次点击归一处理 30 +
  31 + // 同一资讯多次点击归一处理
31 if (prising === msgId) { 32 if (prising === msgId) {
32 return; 33 return;
33 } 34 }
@@ -38,7 +39,7 @@ $('.editorial-index-page').on('click', '.like-icon', function() { @@ -38,7 +39,7 @@ $('.editorial-index-page').on('click', '.like-icon', function() {
38 $this.toggleClass('liked'); 39 $this.toggleClass('liked');
39 40
40 41
41 - //点赞或取消点赞 42 + // 点赞或取消点赞
42 // if ($this.hasClass('liked')) { 43 // if ($this.hasClass('liked')) {
43 // url = '/guang/info/praise'; 44 // url = '/guang/info/praise';
44 // } else { 45 // } else {
@@ -2,11 +2,6 @@ @@ -2,11 +2,6 @@
2 width: 1150px; 2 width: 1150px;
3 margin: 0 auto; 3 margin: 0 auto;
4 4
5 - /*.index-content {  
6 - width: 1150px;  
7 - margin: 0 auto;  
8 - }*/  
9 -  
10 .msg-nav { 5 .msg-nav {
11 height: 35px; 6 height: 35px;
12 border-bottom: 1px solid #eee; 7 border-bottom: 1px solid #eee;
@@ -17,12 +17,11 @@ @@ -17,12 +17,11 @@
17 font-size: 18px; 17 font-size: 18px;
18 margin-right: 5px; 18 margin-right: 5px;
19 } 19 }
20 - } 20 + }
21 21
22 .paging { 22 .paging {
23 margin: 20px auto; 23 margin: 20px auto;
24 width: 300px; 24 width: 300px;
25 height: 40px; 25 height: 40px;
26 } 26 }
27 -  
28 -}  
  27 +}