Commit f1c0c130 by 冷斌

fix bug

parent 6b902d8d
<include file="__THEME__/public_header_w3g" />
<style>
body {
padding: 0 !important;
}
.van-cell:not(:last-child)::after {
border-bottom: none !important;
}
.van-field__control {
width: 6.25rem !important;
height: 2rem;
background: rgba(245,245,245,1);
border-radius: 1rem;
}
.van-dropdown-item__content {
max-height: 100% !important;
}
</style>
<div id="app" style="height: 100%;">
<div class="layout_v">
......@@ -34,10 +34,6 @@
<div @click="onCategory('{$top['id']}', '{$top.title}')" class="van-ellipsis" :class="selectedCategory('{$top['id']}') ? 'drop_down_option_selected' : 'drop_down_option'">{$top.title}</div>
</volist>
</div>
<span class="all_category_title text_16_600 color_333333">讲师</span>
<div class="drop_down_grid">
</div>
<span class="all_category_title text_16_600 color_333333">状态</span>
<div class="drop_down_grid">
<div @click="onBuy('', '')" class="van-ellipsis" :class="selectedBuy('') ? 'drop_down_option_selected' : 'drop_down_option'">全部</div>
......@@ -68,7 +64,7 @@
:finished="finished"
finished-text="没有更多了"
@load="onLoad">
<div @click="onTapItem(item)" v-for="(item, index) in items" :key="index" class="home_class_item layout_v">
<div class="layout_h">
<van-image style="margin-right: 0.75rem;" height="72" width="128" fit="cover" :src="item.cover">
......@@ -85,13 +81,13 @@
</div>
<div class="home_divider divider"></div>
</div>
</van-list>
</div>
</div>
<script>
new Vue({
el: '#app',
data: function() {
......@@ -109,28 +105,28 @@
}
},
computed: {
selectedCategory: function() {
let cate = this.cate
return function(c) {
return c == cate
}
},
selectedBuy: function() {
let buy = this.buy
return function(c) {
return c == buy
}
},
},
created: function(){
document.title = "全部课程"
this.onInit()
},
methods: {
onInit: function() {
let p = {:json_encode($selCate)};
if(p[this.cate]) {
......@@ -138,12 +134,12 @@
this.selected = this.conditions
}
},
onTapItem: function(item) {
let url = "{:U('course/Video/view')}"
window.location.href = url.replace(/\[.*?\]/g, item.id)
},
//Helper
onCondition: function(id, title, key) {
let idx = this.conditions.hx_indexOf( r => { return r.type == key })
......@@ -162,17 +158,17 @@
}
}
},
onCategory: function(id, title) {
this.onCondition(id, title, 'category')
this.cate = id
},
onBuy: function(type, title) {
this.onCondition(type, title, 'buy')
this.buy = type
},
onSure: function() {
this.$refs.filter.toggle()
this.selected = this.conditions
......@@ -180,7 +176,7 @@
this.page = 0
this.onLoad()
},
onReset: function() {
this.$refs.filter.toggle();
this.onCategory('', '')
......@@ -189,7 +185,7 @@
this.page = 0
this.onLoad()
},
onLoad: function() {
let that = this
let on = "{$marketConf['order_switch']}" == 1
......@@ -222,9 +218,9 @@
}
})
}
}
})
</script>
<include file="__THEME__/public_footer_w3g" />
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment