we254/addons/fy_lessonv2/inc/mobile/search.php
@@ -35,11 +35,11 @@ } /* 知识点分类 */ $hot_knowledge = pdo_fetchall("SELECT * FROM " . tablename($this -> table_knowledge_point) . " WHERE uniacid=:uniacid AND is_hot=:is_hot AND search_show=:search_show ORDER BY displayorder DESC", array(':uniacid' => $uniacid, ':is_hot' => 1,':search_show'=>1)); $knowledgelist = pdo_fetchall("SELECT * FROM " . tablename($this -> table_knowledge_point) . " WHERE uniacid=:uniacid AND parentid=:parentid AND search_show=:search_show ORDER BY displayorder DESC", array(':uniacid'=>$uniacid, ':parentid'=>0,':search_show'=>1)); $hot_knowledge = pdo_fetchall("SELECT * FROM " . tablename("fy_lesson_knowledge_point") . " WHERE uniacid=:uniacid AND is_hot=:is_hot AND search_show=:search_show ORDER BY displayorder DESC", array(':uniacid' => $uniacid, ':is_hot' => 1,':search_show'=>1)); $knowledgelist = pdo_fetchall("SELECT * FROM " . tablename("fy_lesson_knowledge_point") . " WHERE uniacid=:uniacid AND parentid=:parentid AND search_show=:search_show ORDER BY displayorder DESC", array(':uniacid'=>$uniacid, ':parentid'=>0,':search_show'=>1)); foreach ($knowledgelist as $k => $v) { $knowledgelist[$k]['child'] = pdo_fetchall("SELECT * FROM " . tablename($this -> table_knowledge_point) . " WHERE uniacid=:uniacid AND parentid=:parentid AND search_show=:search_show ORDER BY displayorder DESC", array(':uniacid'=>$uniacid, ':parentid'=>$v['id'],':search_show'=>1)); $knowledgelist[$k]['child'] = pdo_fetchall("SELECT * FROM " . tablename("fy_lesson_knowledge_point") . " WHERE uniacid=:uniacid AND parentid=:parentid AND search_show=:search_show ORDER BY displayorder DESC", array(':uniacid'=>$uniacid, ':parentid'=>$v['id'],':search_show'=>1)); } if ($op == 'display') { @@ -50,6 +50,7 @@ $sort = trim($_GPC['sort']); $attr1 = $_GPC['attr1']; $attr2 = $_GPC['attr2']; $know_id = $_GPC['knowledge_id']; $condition = " a.uniacid = '{$uniacid}' AND a.status=1 "; $order = " ORDER BY a.displayorder DESC, a.id DESC "; @@ -65,6 +66,15 @@ $catname = $common['page_title']['search'] ? $common['page_title']['search'] : '全部分类'; } /* 按知识点搜索 */ if ($know_id > 0) { $condition .= " AND (a.knowledge_pid='{$know_id}' OR a.knowledge_id='{$know_id}')"; $nowknow = pdo_fetch("SELECT name FROM " . tablename("fy_lesson_knowledge_point") . " WHERE uniacid='{$uniacid}' AND id='{$know_id}'"); $knowledgename = $nowknow['name']; } else { $knowledgename = $common['page_title']['search'] ? $common['page_title']['search'] : '知识点'; } /* 综合排序 */ if ($sort == 'general') { $condition .= " AND a.lesson_type=0"; @@ -75,6 +85,9 @@ } elseif ($sort == 'live') { $condition .= " AND a.lesson_type=3"; $sortname = '直播课程'; } elseif ($sort == 'knowledge') { $condition .= " AND a.lesson_type=5"; $sortname = '知识点课'; } elseif ($sort == 'price') { $order = " ORDER BY a.price ASC, a.displayorder DESC "; $sortname = '价格优先'; we254/addons/fy_lessonv2/template/mobile/default/search.html
@@ -125,16 +125,16 @@ <!-- /课程属性 --> <!-- 知识点课分类 --> <div class="nav hidden" data-active="knowledge"> <div class="nav1 hidden" data-active="knowledge"> <div class="nav_panel nav_panel-know"> <!-- 顶级分类 --> <ul class="nav_menu nav_panel_know_mt"> <a href="javascript:;"> <li class="nav_menu_item {if !$_GPC['knowledge_pid']}nav_menu_item_selected{/if}"><img class="nav_menu_item-icon" src="{MODULE_URL}template/mobile/{$template}/images/ico-allcategory.png">推荐知识点</li> <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['knowledge_pid']}nav_menu_item_selected{/if}"><img class="nav_menu_item-icon" src="{$_W['attachurl']}{$parent['ico']}">{$parent['name']}</li> <li class="nav_menu_item {if $_GPC['knowledge_pid']==$parent['knowledge_pid']}nav_menu_item_selected{/if}">{$parent['name']}</li> </a> {/loop} </ul> @@ -142,23 +142,23 @@ <!-- 推荐二级分类 --> <ul class="nav_menu nav_panel-know_st" {if !$_GPC['knowledge_pid']}style="display:block;"{/if}"> <a href="{php echo $this->createMobileUrl('search')}&keyword={$keyword}&sort={$sort}&attr1={$attr1}&attr2={$attr2}"> <li class="nav_menu_item {if !$_GPC['knowledge_id']}nav_menu_item_selected{/if}"><img class="nav_menu_item-icon" src="{$all_category_ico}">全部</li> <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']))}&keyword={$keyword}&sort={$sort}&attr1={$attr1}&attr2={$attr2}"> <li class="nav_menu_item {if !$_GPC['knowledge_pid'] && ($_GPC['knowledge_id']==$hot['id'])}nav_menu_item_selected{/if}"><img class="nav_menu_item-icon" src="{$_W['attachurl']}{$hot['ico']}">{$hot['name']}</li> <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 class="nav_menu nav_panel-know_st" {if $_GPC['knowledge_pid']==$know['id']}style="display:block;"{/if}> <a href="{php echo $know['link'] ? $know['link'] : $this->createMobileUrl('search', array('cat_id'=>$know['id'],'pid'=>$know['id'])).'&keyword='.$keyword.'&sort='.$sort.'&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}"><img class="nav_menu_item-icon" src="{$_W['attachurl']}{$know['ico']}">{$know['name']}</li> <a href="{php echo $know['link'] ? $know['link'] : $this->createMobileUrl('search', array('knowledge_id'=>$know['id'],'pid'=>$know['id'])).'&keyword='.$keyword.'&sort='.$sort.'&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('cat_id'=>$child['id'],'pid'=>$child['parentid'])).'&keyword='.$keyword.'&sort='.$sort.'&attr1='.$attr1.'&attr2='.$attr2;}"> <li class="nav_menu_item {if $_GPC['knowledge_id']==$child['id']}nav_menu_item_selected{/if}"><img class="nav_menu_item-icon" src="{$_W['attachurl']}{$child['ico']}">{$child['name']}</li> <a href="{php echo $child['link'] ? $child['link'] : $this->createMobileUrl('search', array('knowledge_id'=>$child['id'],'pid'=>$child['parentid'])).'&keyword='.$keyword.'&sort='.$sort.'&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> @@ -166,7 +166,6 @@ </div> </div> <!-- /知识点课分类 --> <div class="mark hidden"></div> <!-- 课程列表 --> @@ -247,7 +246,7 @@ // /* 知识点分类 */ function showknowledge(){ closeCondition(); $(".nav").removeClass("hidden"); $(".nav1").removeClass("hidden"); $(".mark").removeClass("hidden"); } $(".nav_panel_know_mt").on("click", 'a', function() { @@ -268,7 +267,8 @@ $(".sort_list_grid").addClass("hidden"); $(".nav").addClass("hidden"); $(".attribute1").addClass("hidden"); $(".attribute2").addClass("hidden"); $(".attribute2").addClass("hidden"); $(".nav1").addClass("hidden"); $(".mark").addClass("hidden"); } </script> we254/addons/fy_lessonv2/template/mobile/default/style/cssv2/search.css
@@ -205,6 +205,16 @@ z-index: 102; background-color: rgba(0, 0, 0, 0.5); } .mark1 { position: absolute; top: 0; left: 0; right: 0; bottom: 0; z-index: 102; background-color: rgba(0, 0, 0, 0.5); } .sort_list_grid a + a { border-top: 1px solid #e4e5ea; } @@ -348,6 +358,92 @@ } /* 知识点分类 */ .nav1 { z-index: 1100; position: fixed; top: 96px; width: 100%; max-width: 640px; } .nav1[data-active=filter] .nav_panel-filter,.nav1[data-active=sort] .nav_panel-sort { display: block; -webkit-transform: translateZ(0); transform: translateZ(0) } .nav1[data-active=knowledge] .nav_panel-know { display: -webkit-box; display: -webkit-flex; display: flex; -webkit-transform: translateZ(0); transform: translateZ(0) } .nav1_panel { width: 100%; top: 0; background: #fff; background: var(--white); -webkit-transition: -webkit-transform .2s ease; transition: -webkit-transform .2s ease; transition: transform .2s ease; transition: transform .2s ease,-webkit-transform .2s ease; -webkit-transform: translate3d(0,-250%,0); transform: translate3d(0,-250%,0); overflow-y: auto } .nav1 .nav_panel-sort,.nav1_panel { position: absolute } .nav_panel-know { display: -webkit-box; display: -webkit-flex; display: flex; height: 25rem; } @media (device-height:568px) and (-webkit-min-device-pixel-ratio:2){ .nav_panel-know { height:400px; } } @media (min-device-width : 375px) and (max-device-width : 667px) and (-webkit-min-device-pixel-ratio : 2){ .nav_panel-know { height:455px; } } @media (min-device-width : 414px) and (max-device-width : 736px) and (-webkit-min-device-pixel-ratio : 3){ .nav_panel-know { height: 550px; } } .nav_panel-know .nav_menu_item { overflow: hidden; position: relative; font-size: 14px; white-space: nowrap; text-overflow: ellipsis; word-break: break-all; padding-left: 25px; height: 50px; max-height: 50px; line-height: 50px; } .nav_panel-know .nav_menu_item_selected { color: #DC3528; } .nav_panel-know .nav_menu_item-icon { display: block; position: absolute; top: 50%; left: 10px; margin-top: -10px; width: 18px; height: 18px; } .nav_panel_know_mt { width: 45%; min-height: 105px; @@ -355,7 +451,7 @@ } .nav_panel_know_mt .nav_menu_item { padding-left: 35px; padding-left: 10px; background: #f2f2f2; } @@ -369,7 +465,7 @@ } .nav_panel-know_st .nav_menu_item { padding-left: 35px; padding-left: 10px; background: #f8f8f9; }