zhangmeng
2020-09-15 ea787992a46d890dc019b39ff18a0e16d9bc236a
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
<!-- 
 * 微课堂首页
 * ============================================================================
 * 版权所有 2015-2020 ,并保留所有权利。
 * 网站地址: 
 * ----------------------------------------------------------------------------
 
 * ============================================================================
-->
{template $template.'/_headerv2'}
 
{if $op=='display'}
<link href="{MODULE_URL}template/mobile/{$template}/style/cssv2/search.css?v={$versions}" rel="stylesheet" />
 
<!-- 顶部搜索框 -->
<div class="fix_grid_96">
    <div class="fix_grid">
        <div class="search_grid">
            <div class="search flex0">
                <i class="icon_search flex_g0"></i>
                <input type="text" name="keyword" value="{$_GPC['keyword']}" placeholder="{php echo $index_page['searchBox'] ? $index_page['searchBox'] : '搜索您感兴趣的课程';}">
                <button class="search-btn">搜索</button>
            </div>
        </div>
 
        <div class="list_menu_grid flex0_1">
            <div class="list_menu flex-al1 flex9" onclick="showsort()">
                <span>{$sortname}</span><i class="icon_down"></i>
            </div>
            <div class="list_menu flex-al1 flex9" onclick="showcategory()">
                <span>{$catname}</span><i class="icon_down"></i>
            </div>
            {if $lesson_attribute['attribute1']}
            <div class="list_menu flex-al1 flex9" onclick="showattribute1()">
                <span>{$attr1_name}</span><i class="icon_down"></i>
            </div>
            {/if}
            {if $_GPC['searchtype']=='2'}
            <div class="list_menu flex-al1 flex9" onclick="showknowledge()">
                <span>{$knowledgename}</span><i class="icon_down"></i>
            </div>
            {elseif $lesson_attribute['attribute2']}
            <div class="list_menu flex-al1 flex9" onclick="showattribute2()">
                <span>{$attr2_name}</span><i class="icon_down"></i>
            </div>
            {/if}
        </div>
    </div>
</div>
<!-- /顶部搜索框 -->
 
<!-- 筛选条件 -->
<div class="sort_list_grid sort_list hidden">
    <a href="{php echo $this->createMobileUrl('search', array('sort'=>'hot'))}&searchtype={$searchtype}&keyword={$keyword}&cat_id={$cat_id}&pid={$pid}&attr1={$attr1}&attr2={$attr2}&knowledge_id={$know_id}" {if !$_GPC['sort']}class="curr"{/if}>综合排序</a>
    <a href="{php echo $this->createMobileUrl('search', array('sort'=>'price'))}&searchtype={$searchtype}&keyword={$keyword}&cat_id={$cat_id}&pid={$pid}&attr1={$attr1}&attr2={$attr2}&knowledge_id={$know_id}" {if $_GPC['sort']=='price'}class="curr"{/if}>价格优先</a>
    <a href="{php echo $this->createMobileUrl('search', array('sort'=>'hot'))}&searchtype={$searchtype}&keyword={$keyword}&cat_id={$cat_id}&pid={$pid}&attr1={$attr1}&attr2={$attr2}&knowledge_id={$know_id}" {if $_GPC['sort']=='hot'}class="curr"{/if}>人气优先</a>
    <a href="{php echo $this->createMobileUrl('search', array('sort'=>'score'))}&searchtype={$searchtype}&keyword={$keyword}&cat_id={$cat_id}&pid={$pid}&attr1={$attr1}&attr2={$attr2}&knowledge_id={$know_id}" {if $_GPC['sort']=='score'}class="curr"{/if}>好评优先</a>
    <a href="{php echo $this->createMobileUrl('search', array('sort'=>'general'))}&searchtype=1&keyword={$keyword}&cat_id={$cat_id}&pid={$pid}&attr1={$attr1}&attr2={$attr2}" {if $_GPC['sort']=='general'}class="curr"{/if}>普通课程</a>
    <a href="{php echo $this->createMobileUrl('search', array('sort'=>'knowledge'))}&searchtype=2&keyword={$keyword}&cat_id={$cat_id}&pid={$pid}&attr1={$attr1}&attr2={$attr2}" {if $_GPC['sort']=='knowledge'}class="curr"{/if}>知识点课</a>
    <a href="{php echo $this->createMobileUrl('search', array('sort'=>'live'))}&keyword={$keyword}&cat_id={$cat_id}&pid={$pid}&attr1={$attr1}&attr2={$attr2}" {if $_GPC['sort']=='live'}class="curr"{/if}>直播课程</a>
    <a href="{php echo $this->createMobileUrl('search', array('sort'=>'apply'))}&keyword={$keyword}&cat_id={$cat_id}&pid={$pid}&attr1={$attr1}&attr2={$attr2}" {if $_GPC['sort']=='apply'}class="curr"{/if}>报名课程</a>
</div>
<!-- /筛选条件 -->
 
<!-- 课程分类 -->
<div id="nav" class="nav hidden" data-active="cate">
    <div class="nav_panel nav_panel-cate">
        <!-- 顶级分类 -->
        <ul id="nav_menu_parent1" class="nav_menu">
            <a href="javascript:;">
                <li class="nav_menu_item {if !$_GPC['pid']}nav_menu_item_selected{/if}"><img class="nav_menu_item-icon" src="{MODULE_URL}template/mobile/{$template}/images/ico-allcategory.png">推荐分类</li>
            </a>
            {loop $categorylist $key $parent}
            <a href="javascript:;">
                <li class="nav_menu_item {if $_GPC['pid']==$parent['id']}nav_menu_item_selected{/if}"><img class="nav_menu_item-icon" src="{$_W['attachurl']}{$parent['ico']}">{$parent['name']}</li>
            </a>
            {/loop}
        </ul>
 
        <!-- 推荐二级分类 -->
        <ul name="nav_st1" class="nav_menu" {if !$_GPC['pid']}style="display:block;"{/if}">
            <a href="{php echo $this->createMobileUrl('search')}&searchtype={$searchtype}&keyword={$keyword}&sort={$sort}&attr1={$attr1}&attr2={$attr2}">
                <li class="nav_menu_item {if !$_GPC['cat_id']}nav_menu_item_selected{/if}"><img class="nav_menu_item-icon" src="{$all_category_ico}">全部</li>
            </a>
            {loop $hot_category $hot}
            <a href="{php echo $hot['link'] ? $hot['link'] : $this->createMobileUrl('search', array('cat_id'=>$hot['id']))}&searchtype={$searchtype}&keyword={$keyword}&sort={$sort}&attr1={$attr1}&attr2={$attr2}">
                <li class="nav_menu_item {if !$_GPC['pid'] && ($_GPC['cat_id']==$hot['id'])}nav_menu_item_selected{/if}"><img class="nav_menu_item-icon" src="{$_W['attachurl']}{$hot['ico']}">{$hot['name']}</li>
            </a>
            {/loop}
        </ul>
        <!-- 二级分类 -->
        {loop $categorylist $category}
            <ul name="nav_st1" class="nav_menu" {if $_GPC['pid']==$category['id']}style="display:block;"{/if}>
                <a href="{php echo $category['link'] ? $category['link'] : $this->createMobileUrl('search', array('cat_id'=>$category['id'],'pid'=>$category['id'])).'&searchtype='.$searchtype.'&keyword='.$keyword.'&sort='.$sort.'&attr1='.$attr1.'&attr2='.$attr2;}">
                    <li class="nav_menu_item {if ($_GPC['pid']==$_GPC['cat_id']) && ($_GPC['cat_id']==$category['id'])}nav_menu_item_selected{/if}"><img class="nav_menu_item-icon" src="{$_W['attachurl']}{$category['ico']}">{$category['name']}</li>
                </a>
                {loop $category['child'] $child}
                <a href="{php echo $child['link'] ? $child['link'] : $this->createMobileUrl('search', array('cat_id'=>$child['id'],'pid'=>$child['parentid'])).'&searchtype='.$searchtype.'&keyword='.$keyword.'&sort='.$sort.'&attr1='.$attr1.'&attr2='.$attr2;}">
                    <li class="nav_menu_item {if $_GPC['cat_id']==$child['id']}nav_menu_item_selected{/if}"><img class="nav_menu_item-icon" src="{$_W['attachurl']}{$child['ico']}">{$child['name']}</li>
                </a>
                {/loop}
            </ul>
        {/loop}
    </div>
</div>
<!-- /课程分类 -->
 
<!-- 课程属性 -->
{if $lesson_attribute['attribute1']}
<div class="sort_list_grid attribute1 hidden">
    <a href="{php echo $this->createMobileUrl('search')}&searchtype={$searchtype}&keyword={$keyword}&sort={$sort}&cat_id={$cat_id}&pid={$pid}&attr2={$attr2}&knowledge_id={$know_id}" {if !$_GPC['attr1']}class="curr"{/if}>不限</a>
    {loop $attribute1 $item}
    <a href="{php echo $this->createMobileUrl('search', array('attr1'=>$item['id']))}&searchtype={$searchtype}&keyword={$keyword}&sort={$sort}&cat_id={$cat_id}&pid={$pid}&attr2={$attr2}&knowledge_id={$know_id})" {if $_GPC['attr1']==$item['id']}class="curr"{/if}>{$item['name']}</a>
    {/loop}
</div>
{/if}
{if $lesson_attribute['attribute2']}
<div class="sort_list_grid attribute2 hidden">
    <a href="{php echo $this->createMobileUrl('search')}&searchtype={$searchtype}&keyword={$keyword}&sort={$sort}&cat_id={$cat_id}&pid={$pid}&attr1={$attr1}&knowledge_id={$know_id}" {if !$_GPC['attr2']}class="curr"{/if}>不限</a>
    {loop $attribute2 $item}
    <a href="{php echo $this->createMobileUrl('search', array('attr2'=>$item['id']))}&searchtype={$searchtype}&keyword={$keyword}&sort={$sort}&cat_id={$cat_id}&pid={$pid}&attr1={$attr1}&knowledge_id={$know_id}" {if $_GPC['attr2']==$item['id']}class="curr"{/if}>{$item['name']}</a>
    {/loop}
</div>
{/if}
<!-- /课程属性 -->
 
<!-- 知识点课分类 -->
<div id="nav1" class="nav hidden" data-active="cate">
    <div class="nav_panel nav_panel-cate">
        <!-- 顶级分类 -->
        <ul id="nav_menu_parent2" class="nav_menu">
            <a href="javascript:;">
                <li class="nav_menu_item {if !$_GPC['knowledge_pid']}nav_menu_item_selected{/if}">推荐知识点</li>
            </a>
            {loop $knowledgelist $key $parent}
            <a href="javascript:;">
                <li class="nav_menu_item {if $_GPC['knowledge_pid']==$parent['id']}nav_menu_item_selected{/if}">{$parent['name']}</li>
            </a>
            {/loop}
        </ul>
        <!-- 推荐二级分类 -->
        <ul name="nav_st2" class="nav_menu" {if !$_GPC['knowledge_pid']}style="display:block;"{/if}">
            <a href="{php echo $this->createMobileUrl('search')}}&searchtype={$searchtype}&keyword={$keyword}&sort={$sort}&cat_id={$cat_id}&pid={$pid}&attr1={$attr1}&attr2={$attr2}">
                <li class="nav_menu_item {if !$_GPC['knowledge_id']}nav_menu_item_selected{/if}">全部</li>
            </a>
            {loop $hot_knowledge $hot}
            <a href="{php echo $hot['link'] ? $hot['link'] : $this->createMobileUrl('search', array('knowledge_id'=>$hot['id']))}}&searchtype={$searchtype}&keyword={$keyword}&sort={$sort}&cat_id={$cat_id}&pid={$pid}&attr1={$attr1}&attr2={$attr2}">
                <li class="nav_menu_item {if !$_GPC['knowledge_pid'] && ($_GPC['knowledge_id']==$hot['id'])}nav_menu_item_selected{/if}">{$hot['name']}</li>
            </a>
            {/loop}
        </ul>
        <!-- 二级分类 -->
        {loop $knowledgelist $know}
            <ul name="nav_st2" class="nav_menu" {if $_GPC['knowledge_pid']==$know['id']}style="display:block;"{/if}>
                <a href="{php echo $know['link'] ? $know['link'] : $this->createMobileUrl('search', array('knowledge_id'=>$know['id'])).'&searchtype='.$searchtype.'&keyword='.$keyword.'&sort='.$sort.'&cat_id='.$cat_id.'&pid='.$pid.'&attr1='.$attr1.'&attr2='.$attr2;}">
                    <li class="nav_menu_item {if ($_GPC['knowledge_pid']==$_GPC['knowledge_id']) && ($_GPC['knowledge_id']==$know['id'])}nav_menu_item_selected{/if}">{$know['name']}</li>
                </a>
                {loop $know['child'] $child}
                <a href="{php echo $child['link'] ? $child['link'] : $this->createMobileUrl('search', array('knowledge_id'=>$child['id'],'knowledge_pid'=>$child['parentid'])).'&searchtype='.$searchtype.'&keyword='.$keyword.'&sort='.$sort.'&cat_id='.$cat_id.'&pid='.$pid.'&attr1='.$attr1.'&attr2='.$attr2;}">
                    <li class="nav_menu_item {if $_GPC['knowledge_id']==$child['id']}nav_menu_item_selected{/if}">{$child['name']}</li>
                </a>
                {/loop}
            </ul>
        {/loop}
    
    </div>
</div>
<!-- /知识点课分类 -->
<div class="mark hidden"></div>
 
<!-- 课程列表 -->
<div class="section">
    {if $total}
        <div class="list_grid" id="lesson-list">
        </div>
        <div id="loading_div" class="loading_div" style="padding:15px 0 30px 0;">
            <a href="javascript:void(0);" id="btn_Page"><i class="fa fa-arrow-circle-down"></i> 加载更多</a>
        </div>
    {else}
        <div class="my_empty">
            <div class="empty_bd  my_course_empty">
                <h3>没有找到任何课程~</h3>
                <p><a href="{php echo $this->createMobileUrl('index', array('t'=>1));}">去首页看看...</a></p>
            </div>
        </div>
    {/if}
</div>
<!-- /课程列表 -->
 
<div id="loadingToast">
    <div class="weui-mask_transparent"></div>
    <div class="weui-toast">
        <i class="weui-loading weui-icon_toast"></i>
        <p class="weui-toast__content">加载数据中</p>
    </div>
</div>
 
<script type="text/javascript">
/* 搜索 */
$(".search-btn").click(function() {
    var keywords = $.trim($("input[name=keyword]").val());
    if (keywords == '') {
        searchUrl = "{php echo $this->createMobileUrl('search');}";
    } else {
        searchUrl = searchUrl = "{php echo $this->createMobileUrl('search');}&keyword=" + encodeURIComponent(keywords);
    }
    document.location.href = searchUrl;
    return false;
});
 
/* 综合排序 */
function showsort() {
    closeCondition();
    $(".sort_list").removeClass("hidden");
    $(".mark").removeClass("hidden");
}
 
/* 课程分类 */
function showcategory(){
    closeCondition();
    switchnav(1);
    $(".mark").removeClass("hidden");
}
 
$("#nav_menu_parent1").on("click", 'a', function() {
    var $currItem = $(this),
    index = $currItem.index();
 
    $(".nav_panel_cate_mt a li").removeClass('nav_menu_item_selected');    
    $currItem.addClass('nav_menu_item_selected').siblings().removeClass('nav_menu_item_selected');
    $(".nav_panel-cate_st").hide().eq(index).show();
});
 
/* 课程属性 */
function showattribute1() {
    closeCondition();
    $(".attribute1").removeClass("hidden");
    $(".mark").removeClass("hidden");
}
 
function showattribute2() {
    closeCondition();
    $(".attribute2").removeClass("hidden");
    $(".mark").removeClass("hidden");
}
 
// /* 知识点分类 */
function showknowledge(){
    closeCondition();
    switchnav(2);
    $(".mark").removeClass("hidden");
}
$("#nav_menu_parent2").on("click", 'a', function() {
    var $currItem = $(this),
    index = $currItem.index();
 
    $(".nav_panel_cate_mt a li").removeClass('nav_menu_item_selected');    
    $currItem.addClass('nav_menu_item_selected').siblings().removeClass('nav_menu_item_selected');
    $(".nav_panel-cate_st").hide().eq(index).show();
});
 
function switchnav(flag){
    if(flag==1){            
        $("#nav_menu_parent1").removeClass("nav_panel_cate_mt");
        $("ul[name='nav_st1']").removeClass("nav_panel_cate_st");
 
        $("#nav_menu_parent1").addClass("nav_panel_cate_mt");
        $("ul[name='nav_st1']").addClass("nav_panel-cate_st ");
 
        $("#nav_menu_parent2").removeClass("nav_panel_cate_mt");
        $("ul[name='nav_st2']").removeClass("nav_panel-cate_st ");
 
        $("#nav1").removeClass("nav");
        $("#nav").removeClass("nav");
        $("#nav").removeClass("hidden");
        $("#nav").addClass("nav");
    }else{        
        $("#nav_menu_parent2").removeClass("nav_panel_cate_mt");
        $("ul[name='nav_st2']").removeClass("nav_panel-cate_st ");
        $("#nav_menu_parent2").addClass("nav_panel_cate_mt");
        $("ul[name='nav_st2']").addClass("nav_panel-cate_st ");
 
        $("#nav_menu_parent1").removeClass("nav_panel_cate_mt");
        $("ul[name='nav_st1']").removeClass("nav_panel-cate_st ");
 
        $("#nav").removeClass("nav");    
        $("#nav1").removeClass("nav");
        $("#nav1").removeClass("hidden");
        $("#nav1").addClass("nav");    
    }
}
 
 
/* 关闭所有选项 */
$(".mark, .sort_list_grid").click(function(){
    closeCondition();
})
function closeCondition() {
  $(".sort_list_grid").addClass("hidden");
  $(".nav").addClass("hidden");
  $(".attribute1").addClass("hidden");
  $(".attribute2").addClass("hidden");
  $(".mark").addClass("hidden");
}
</script>
 
<script type="text/javascript">
var uniacid = "{$uniacid}";
//首页检索跳转过来的清掉缓存
var clear = "{php echo intval($_GPC['clear']);}";
if(clear==1){
    localStorage.removeItem('lesson_back_'+uniacid);
}
 
var localStorage = window.localStorage;
var ajaxUrl   = "{php echo $_W['siteUrl'];}";
var attachUrl = "{php echo $_W['attachurl'];}";
var lessonUrl = "{php echo $this->createMobileUrl('lesson');}";
var loadingToast = document.getElementById("loadingToast");
var get_status = true;
$(function () {
    var nowPage = 1; //设置当前页数,全局变量
    function getData(page) {
        if(get_status){
            nowPage++;
            $.get(ajaxUrl, {page: page}, function (data) {
                var jsonObj = JSON.parse(data);
                loadingToast.style.display = 'none';
                if (jsonObj.length > 0) {
                    insertDiv(jsonObj);
                }else{
                    get_status = false;
                    // document.getElementById("loading_div").innerHTML='<div class="loading_bd">没有了,已经到底了</div>';
                }
            });
        }
    } 
    //初始化加载数据
    var lesson_back = localStorage.getItem('lesson_back_'+uniacid);
    var lesson_list = localStorage.getItem('lesson_list_'+uniacid);
 
    if(lesson_back==1 && lesson_list){
        $("#lesson-list").append(lesson_list);
        $(".section").scrollTop(localStorage.getItem('section_top_'+uniacid));
        nowPage = localStorage.getItem('nowPage_'+uniacid);
        loadingToast.style.display = 'none';
        localStorage.removeItem('lesson_back_'+uniacid);
    }else{
        getData(1);
    }
 
    //生成数据html,append到div中  
    function insertDiv(result) {  
        var mainDiv =$("#lesson-list");
        var already_study = "{$already_study}";
        var lesson_vip_status = {$setting['lesson_vip_status']};
        var chtml = '';  
        for (var j = 0; j < result.length; j++) {
            chtml += '<a href="' + lessonUrl + '&id=' + result[j].id + '" class="normal_grid flex0_1">';
            chtml += '    <div class="normal_grid_a flex_g0">';
            chtml += '        <div class="img-box flex_g0">';
            chtml += '            <div class="img"><img src="' + (result[j].images.substr(0,4).toLowerCase()=='http'?'':attachUrl) + result[j].images + '"></div>';
            chtml += '            <div class="icon-live ' + result[j].icon_live_status + '"></div>';
            chtml += '            <div class="learned ' + result[j].learned_hide + '">' + result[j].buyTotal + already_study + '</div>';
            chtml += '            <i class="ico_common '+ result[j].ico_name +'"></i>';
            chtml += '        </div>';
            chtml += '    </div>';
            chtml += '    <div class="flex-al1 flex10">';
            chtml += '        <div>';
            chtml += '            <div class="grid_title2">' + result[j].bookname + '</div>';
            chtml += '            <div class="grid_info flex0">';
            if(lesson_vip_status!=1){
                if(result[j].price>0){
                    chtml += '        <span class="price flex_g0 index_price_lesson ios-system">¥' + result[j].price + '</span>';
                }else{
                    chtml += '        <span class="free flex_g0 index_free_lesson ios-system">免费课程</span>';
                }
            }
            if(result[j].soncount>0){
                    chtml += '        <span class="mar5 ios-system">|</span>';
                    chtml += '        <span class="index_section_number">' + result[j].soncount + '节</span>';
            }
            chtml += '            </div>';
            chtml += '        </div>';
            chtml += '        <div class="grid_bottom2 flex1">';
            chtml += '    <div class="text">';
            if(result[j].section_status==0){
                chtml += '已完结';
            }
            chtml += '    </div>';
            if(result[j].score>0){
                    chtml += '    <span class="eva index_lesson_evaluation">' + result[j].score_rate + '%好评</span>';
            }
            chtml += '        </div>';
            chtml += '    </div>';
            chtml += '</a>';
        }
        mainDiv.append(chtml);
        
        //存储当前课程列表信息
        if($("#lesson-list").html()){
            localStorage.setItem('lesson_list_'+uniacid, $("#lesson-list").html());
            localStorage.setItem('nowPage_'+uniacid, nowPage);
        }
    }  
  
    //==============核心代码=============
    var msg_list_loading = false;
    $('.section').on('scroll', function(){
        if (!msg_list_loading){
            load_more_msg();
        }
 
        //记录滚动条位置
        localStorage.setItem('section_top_'+uniacid, $(".section").scrollTop());
    })
    function load_more_msg(){     
        var msg_list = $('.section');
        if (msg_list.height() + msg_list[0].scrollTop >= msg_list[0].scrollHeight) {
            msg_list_loading = true;
            $("#btn_Page").hide();
            getData(nowPage);
            msg_list_loading = false;
        }
        $("#btn_Page").show();
    }
 
    //继续加载按钮事件
    $("#btn_Page").click(function () {
        loadingToast.style.display = 'block';
        getData(nowPage);
    });
});
 
var nav_panel_height = parseInt(document.body.clientHeight * 0.7);
var head = document.head || document.getElementsByTagName('head')[0];
var style = document.createElement('style');
style.innerHTML = '.nav_panel-cate{height:' + nav_panel_height + 'px !important;}';
var style1 = document.createElement('style');
style1.innerHTML = '.nav_panel-know{height:' + nav_panel_height + 'px !important;}';
head.appendChild(style);
head.appendChild(style1);
</script>
 
{elseif $op=='allcategory'}
<link href="{MODULE_URL}template/mobile/{$template}/style/cssv2/all-category.css?v={$versions}" rel="stylesheet" />
 
<div class="header-2 cbox">
    <a href="javascript:history.go(-1);" class="ico go-back"></a>
    <div class="flex title" style="max-width:80%;">{$title}</div>
</div>
 
<!-- 分类 START-->
<div class="fui-fullHigh-group max-width-640">
    <div class="category-inner menu">
        <nav class="category-switch on">推荐分类</nav>
        {loop $categorylist $key $item}
        <nav class="category-switch">{$item['name']}</nav>
        {/loop}
    </div>
    <div class="category-inner container">
        <div class="all-category-son">
            <div class="category-right">
                <a href="{php echo $this->createMobileUrl('search');}" class="category-item">
                    <div class="icon radius">
                        <img src="{$all_category_ico}">
                    </div>
                    <div class="text">全部课程</div>
                </a>
                {loop $hot_category $hot}
                <a href="{php echo $hot['link'] ? $hot['link'] : $this->createMobileUrl('search',array('cat_id'=>$hot['id']));}" class="category-item">
                    <div class="icon radius">
                        <img src="{$_W['attachurl']}{$hot['ico']}">
                    </div>
                    <div class="text">{$hot['name']}</div>
                </a>
                {/loop}
            </div>
        </div>
 
        {loop $categorylist $key $parent}
        <div class="all-category-son" style="display:none;">
            <div class="category-right">
                <a href="{php echo $parent['link'] ? $parent['link'] : $this->createMobileUrl('search', array('cat_id'=>$parent['id'],'pid'=>$parent['id']));}" class="category-item">
                    <div class="icon radius">
                        <img src="{$_W['attachurl']}{$parent['ico']}">
                    </div>
                    <div class="text">{$parent['name']}</div>
                </a>
 
                {loop $parent['child'] $son}
                <a href="{php echo $son['link'] ? $son['link'] : $this->createMobileUrl('search', array('cat_id'=>$son['id'],'pid'=>$parent['id']));}" class="category-item">
                    <div class="icon radius">
                        <img src="{$_W['attachurl']}{$son['ico']}">
                    </div>
                    <div class="text">{$son['name']}</div>
                </a>
                {/loop}
            </div>
        </div>
        {/loop}
    </div>
</div>
<!-- 分类 END-->
<script type="text/javascript">
$(".category-inner").on("click", 'nav', function() {
    var $currItem = $(this),
    index = $currItem.index();
    
    $currItem.addClass('on').siblings().removeClass('on');
    $(".all-category-son").hide().eq(index).show();
})
</script>
 
{/if}
 
{template $template.'/_footerv2'}