|
@@ -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 +' '+ 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
|
+})
|