mirror of
https://gitee.com/koogua/course-tencent-cloud.git
synced 2025-06-26 12:23:06 +08:00
vip.js -> vip.index.js
This commit is contained in:
parent
12ceda62df
commit
28639f4ccd
@ -57,17 +57,8 @@
|
||||
|
||||
{% endblock %}
|
||||
|
||||
{% block inline_js %}
|
||||
{% block include_js %}
|
||||
|
||||
<script>
|
||||
layui.use(['form'], function () {
|
||||
var form = layui.form;
|
||||
form.on('submit(search)', function (data) {
|
||||
if (data.field.query === '') {
|
||||
return false;
|
||||
}
|
||||
});
|
||||
});
|
||||
</script>
|
||||
{{ js_include('home/js/search.index.js') }}
|
||||
|
||||
{% endblock %}
|
@ -10,6 +10,17 @@
|
||||
</div>
|
||||
{% endif %}
|
||||
|
||||
{% if type == 'course' %}
|
||||
{% set load_url = url({'for':'home.widget.featured_courses'}) %}
|
||||
<div class="sidebar" id="sidebar-course-list" data-url="{{ load_url }}"></div>
|
||||
{% elseif type == 'article' %}
|
||||
{% set load_url = url({'for':'home.widget.featured_articles'}) %}
|
||||
<div class="sidebar" id="sidebar-article-list" data-url="{{ load_url }}"></div>
|
||||
{% elseif type == 'question' %}
|
||||
{% set load_url = url({'for':'home.widget.featured_questions'}) %}
|
||||
<div class="sidebar" id="sidebar-question-list" data-url="{{ load_url }}"></div>
|
||||
{% endif %}
|
||||
|
||||
{% if related_queries %}
|
||||
<div class="layui-card">
|
||||
<div class="layui-card-header">相关搜索</div>
|
||||
|
@ -55,6 +55,6 @@
|
||||
|
||||
{% block include_js %}
|
||||
|
||||
{{ js_include('home/js/vip.js') }}
|
||||
{{ js_include('home/js/vip.index.js') }}
|
||||
|
||||
{% endblock %}
|
28
public/static/home/js/search.index.js
Normal file
28
public/static/home/js/search.index.js
Normal file
@ -0,0 +1,28 @@
|
||||
layui.use(['jquery', 'form', 'layer', 'helper'], function () {
|
||||
|
||||
var $ = layui.jquery;
|
||||
var form = layui.form;
|
||||
var helper = layui.helper;
|
||||
|
||||
var $courseList = $('#sidebar-course-list');
|
||||
if ($courseList.length > 0) {
|
||||
helper.ajaxLoadHtml($courseList.data('url'), $courseList.attr('id'));
|
||||
}
|
||||
|
||||
var $articleList = $('#sidebar-article-list');
|
||||
if ($articleList.length > 0) {
|
||||
helper.ajaxLoadHtml($articleList.data('url'), $articleList.attr('id'));
|
||||
}
|
||||
|
||||
var $questionList = $('#sidebar-question-list');
|
||||
if ($questionList.length > 0) {
|
||||
helper.ajaxLoadHtml($questionList.data('url'), $questionList.attr('id'));
|
||||
}
|
||||
|
||||
form.on('submit(search)', function (data) {
|
||||
if (data.field.query === '') {
|
||||
return false;
|
||||
}
|
||||
});
|
||||
|
||||
});
|
Loading…
x
Reference in New Issue
Block a user