xiuli.gao 6 years ago
parent
commit
118ee2d54d
5 changed files with 39 additions and 41 deletions
  1. 2 1
      css/app.css
  2. 15 14
      css/index.css
  3. BIN
      img/banner.png
  4. 17 7
      js/app.js
  5. 5 19
      zixun.html

+ 2 - 1
css/app.css

143
 /* +++++++++++++  首页  +++++++++ */
143
 /* +++++++++++++  首页  +++++++++ */
144
 /*swiper*/
144
 /*swiper*/
145
 .swiper-container {
145
 .swiper-container {
146
-  height: 4.0rem;
146
+  height: 2.25rem;
147
+  margin: 0.25rem 0;
147
 }
148
 }
148
 .swiper-slide {
149
 .swiper-slide {
149
   background:#fff;
150
   background:#fff;

+ 15 - 14
css/index.css

3
     background-color: #fff;
3
     background-color: #fff;
4
 }
4
 }
5
 #list ul li{
5
 #list ul li{
6
-    border-bottom: #e5e5e5 solid 2px;
6
+    /*border-bottom: #e5e5e5 solid 2px;*/
7
     overflow: hidden;
7
     overflow: hidden;
8
 }
8
 }
9
 #list ul li a{
9
 #list ul li a{
10
     display: block;
10
     display: block;
11
-    width: 100%;
12
-    padding: 3%;
11
+    margin: 0 3%;
12
+    padding: 3% 0;
13
     overflow: hidden;
13
     overflow: hidden;
14
+    border-bottom: #E3E3E3 solid 1px;
14
 }
15
 }
15
 #list li .content{
16
 #list li .content{
16
     width: 68%;
17
     width: 68%;
17
-    margin-top: -8px;
18
+    margin-top: -0.1rem;
18
 }
19
 }
19
 #list li .content h5{
20
 #list li .content h5{
20
-    height: 86px;
21
-    font-size: 32px;
21
+    height: 1.075rem;
22
+    font-size: 0.4rem;
22
 }
23
 }
23
 #list li .content h5 strong{
24
 #list li .content h5 strong{
24
     display: inline-block;
25
     display: inline-block;
27
     border:#e90000 solid 2px;
28
     border:#e90000 solid 2px;
28
     padding: 2px 6px 4px;
29
     padding: 2px 6px 4px;
29
     border-radius: 8px;
30
     border-radius: 8px;
30
-    margin-right: 10px;
31
+    margin-right: 0.125rem;
31
     vertical-align: middle;
32
     vertical-align: middle;
32
 }
33
 }
33
 #list li .content .label{
34
 #list li .content .label{
34
-    margin-top: 10px;
35
+    margin-top: 0.125rem;
35
     overflow: hidden;
36
     overflow: hidden;
36
 }
37
 }
37
 #list li .content .label span{
38
 #list li .content .label span{
39
     overflow: hidden;
40
     overflow: hidden;
40
     text-overflow: ellipsis;
41
     text-overflow: ellipsis;
41
     white-space: nowrap;
42
     white-space: nowrap;
42
-    font-size: 24px;
43
+    font-size: 0.3rem;
43
     color: #999;
44
     color: #999;
44
 }
45
 }
45
 .icon-count, .icon-reply{
46
 .icon-count, .icon-reply{
172
     -webkit-box-orient: vertical;
173
     -webkit-box-orient: vertical;
173
 }
174
 }
174
 #list ul li img{
175
 #list ul li img{
175
-    width: 176px;
176
-    height: 116px;
177
-    border-radius: 10px;
178
-    border: #e5e5e5 solid 1px;
176
+    width: 2.2rem;
177
+    height: 1.45rem;
178
+    /*border-radius: 10px;*/
179
+    /*border: #e5e5e5 solid 1px;*/
179
 }
180
 }
180
 .infinite-scroll-preloader {
181
 .infinite-scroll-preloader {
181
   /*margin-top:-20px;*/
182
   /*margin-top:-20px;*/
182
-  margin-bottom: 10px;
183
+  margin-bottom: 0.125rem;
183
   text-align: center;
184
   text-align: center;
184
 }
185
 }
185
 .infinite-scroll-preloader .preloader {
186
 .infinite-scroll-preloader .preloader {

BIN
img/banner.png


+ 17 - 7
js/app.js

13
 var cate_id = '';
13
 var cate_id = '';
14
   var html = '', res = null, className = '';
14
   var html = '', res = null, className = '';
15
   $$.post('http://d1.henhaojie.com/user/information/getclassification', { package_id: package_id}, function (data) {
15
   $$.post('http://d1.henhaojie.com/user/information/getclassification', { package_id: package_id}, function (data) {
16
+  	console.log(JSON.parse(data))
16
     res = JSON.parse(data);
17
     res = JSON.parse(data);
17
     if (res.errno == 0 && res.rst != []) {
18
     if (res.errno == 0 && res.rst != []) {
18
       html += '<li><a data-label="'+  res.rst[0] +'" href="#nav1" class="tab-link active">'+  res.rst[0] +'</a></li><li><a  data-label="'+  res.rst[1] +'" href="#nav2" class="tab-link">'+ res.rst[1] +'</a></li>';
19
       html += '<li><a data-label="'+  res.rst[0] +'" href="#nav1" class="tab-link active">'+  res.rst[0] +'</a></li><li><a  data-label="'+  res.rst[1] +'" href="#nav2" class="tab-link">'+ res.rst[1] +'</a></li>';
29
      var pageInfo = res.rst.listdata.pageinfo;
30
      var pageInfo = res.rst.listdata.pageinfo;
30
      if (res.errno == 0) {
31
      if (res.errno == 0) {
31
        // 添加banner
32
        // 添加banner
32
-       if (res.rst.banner !== null) {
33
-         $$('.swiper-slide').html('<a class="external" href="details.html?id='+ res.rst.banner.id +'"><img src="'+ res.rst.banner.thumbnail +'"></a>');
34
-       }
33
+//     if (res.rst.banner !== null) {
34
+//       $$('.swiper-slide').html('<a class="external" href="details.html?id='+ res.rst.banner.id +'"><img src="'+ res.rst.banner.thumbnail +'"></a>');
35
+//     }
35
        // list 循环
36
        // list 循环
36
        if (pageInfo.page == 1) {
37
        if (pageInfo.page == 1) {
37
         $$(id).html('');
38
         $$(id).html('');
48
        }else{
49
        }else{
49
              loading = false;
50
              loading = false;
50
        }
51
        }
52
+       console.log(res.rst.listdata.data)
51
        $$.each(res.rst.listdata.data , function(index, el) {
53
        $$.each(res.rst.listdata.data , function(index, el) {
52
-          html += '<li><a class="external" href="details.html?id='+el.id+'"> <div class="content fl"> <h5 class="elli">'+ el.title +'</h5> <div class="label"> <span class="fl" style="max-width: 30%;">'+ el.source +'</span> <span class="fr"  style="max-width: 60%;">'+ el.page_views +' &nbsp; '+ el.create_time +'</span></div></div> <div class="img-box fr"><img src="'+ el.thumbnail +'"></div> </a></li>';
54
+          html += '<li><a class="external" href="details.html?id='+el.id+'"> <div class="content fl"> <h5 class="elli">'+ el.title +'</h5> <div class="label"> <span class="fl" style="max-width: 30%;">'+ el.source +'</span> <span class="zixun_number"  style="max-width: 60%; padding-left:0.4rem">'+ el.page_views +'人阅读</span></div></div> <div class="img-box fr"><img src="'+ el.thumbnail +'"></div> </a></li>';
53
        });
55
        });
54
        $$(id).append(html);
56
        $$(id).append(html);
55
      }else if(res.errno == 40044){
57
      }else if(res.errno == 40044){
66
    });
68
    });
67
  }
69
  }
68
 var loading = true, page = 1;
70
 var loading = true, page = 1;
69
-var cate_id = '',timer, index = 1;
71
+var cate_id = '推荐',timer, index = 1;
70
 getCategory('package_9');
72
 getCategory('package_9');
71
 timer = setInterval( function(){
73
 timer = setInterval( function(){
72
-    cate_id = $$('#nav li a.active').attr('data-label');
73
-    console.log(cate_id);
74
+//  cate_id = $$('#nav li a.active').attr('data-label');
74
     if (cate_id != '' && cate_id != null ) {clearInterval(timer); getList('package_9',cate_id, '#nav1'); }
75
     if (cate_id != '' && cate_id != null ) {clearInterval(timer); getList('package_9',cate_id, '#nav1'); }
75
 
76
 
76
     $$('.infinite-scroll').on('infinite', function () {
77
     $$('.infinite-scroll').on('infinite', function () {
100
     $$('.toolbar .JS_login').attr('href', '/mine.html');
101
     $$('.toolbar .JS_login').attr('href', '/mine.html');
101
   }
102
   }
102
 });
103
 });
104
+
105
+$$('.external img').click(function () {
106
+	if(navigator.userAgent.match(/(iPhone|iPod|iPad);?/i)){
107
+		window.location.href='https://itunes.apple.com/cn/app/%E9%87%91%E7%89%9B%E8%AE%B0%E8%B4%A6/id1398141686?mt=8';
108
+	}
109
+	if(navigator.userAgent.match(/android/i)){
110
+		window.location.href='http://android.myapp.com/myapp/detail.htm?apkName=com.kuxuan.jinniunote&ADTAG=mobile';
111
+	}
112
+})

File diff suppressed because it is too large
+ 5 - 19
zixun.html