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,7 +143,8 @@ i.icon{
143 143
 /* +++++++++++++  首页  +++++++++ */
144 144
 /*swiper*/
145 145
 .swiper-container {
146
-  height: 4.0rem;
146
+  height: 2.25rem;
147
+  margin: 0.25rem 0;
147 148
 }
148 149
 .swiper-slide {
149 150
   background:#fff;

+ 15 - 14
css/index.css

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

BIN
img/banner.png


+ 17 - 7
js/app.js

@@ -13,6 +13,7 @@ function getCategory(package_id){
13 13
 var cate_id = '';
14 14
   var html = '', res = null, className = '';
15 15
   $$.post('http://d1.henhaojie.com/user/information/getclassification', { package_id: package_id}, function (data) {
16
+  	console.log(JSON.parse(data))
16 17
     res = JSON.parse(data);
17 18
     if (res.errno == 0 && res.rst != []) {
18 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,9 +30,9 @@ var cate_id = '';
29 30
      var pageInfo = res.rst.listdata.pageinfo;
30 31
      if (res.errno == 0) {
31 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 36
        // list 循环
36 37
        if (pageInfo.page == 1) {
37 38
         $$(id).html('');
@@ -48,8 +49,9 @@ var cate_id = '';
48 49
        }else{
49 50
              loading = false;
50 51
        }
52
+       console.log(res.rst.listdata.data)
51 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 56
        $$(id).append(html);
55 57
      }else if(res.errno == 40044){
@@ -66,11 +68,10 @@ var cate_id = '';
66 68
    });
67 69
  }
68 70
 var loading = true, page = 1;
69
-var cate_id = '',timer, index = 1;
71
+var cate_id = '推荐',timer, index = 1;
70 72
 getCategory('package_9');
71 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 75
     if (cate_id != '' && cate_id != null ) {clearInterval(timer); getList('package_9',cate_id, '#nav1'); }
75 76
 
76 77
     $$('.infinite-scroll').on('infinite', function () {
@@ -100,3 +101,12 @@ $$.post('http://d1.henhaojie.com/user/user/personalCenter', function (res) {
100 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