Commit 7cc2929f by 陈超

A

parent 9aeb3419
...@@ -58,52 +58,37 @@ ...@@ -58,52 +58,37 @@
<van-sticky :offset-top="44"> <van-sticky :offset-top="44">
<van-dropdown-menu active-color="#333333"> <van-dropdown-menu active-color="#333333">
<van-dropdown-item title="筛选" ref="item"> <van-dropdown-item title="筛选" ref="item">
<div class="drop_down_grid"> <div class="drop_down_grid">
<div class="drop_down_option_selected">全部</div> <div @click="onCondition(item)" v-for="(item, index) in condition" :key="index" :class="item.select ? 'drop_down_option_selected' : 'drop_down_option'">
<div class="drop_down_option">事业单位</div> <span class="van-ellipsis">{{item.title}}</span>
<div class="drop_down_option">公考面试</div> </div>
<div class="drop_down_option">教师</div>
<div class="drop_down_option">财会</div>
<div class="drop_down_option">银行</div>
<div class="drop_down_option">法考</div>
<div class="drop_down_option">考研</div>
</div> </div>
</van-dropdown-item> </van-dropdown-item>
</van-dropdown-menu> </van-dropdown-menu>
<div class="drop_down_selected_container">
<div v-for="(item, index) in selectedCondition" :key="index" class="color_primary text_14_400 drop_down_selected_item">
<span>{{item.title}}</span>
</div>
</div>
</van-sticky> </van-sticky>
<div class="layout_v list_container"> <div class="layout_v list_container">
<!-- 项目1 --> <!-- 项目1 -->
<div class="class_item layout_h"> <div v-for="(item, index) in download" :key="index" class="class_item layout_h">
<div class="class_left layout_v weight_full"> <div class="class_left layout_v weight_full">
<div class="layout_h"> <div class="layout_h">
<div class="mark_green layout_center">免费</div> <div v-if="item.price > 0" class="mark_orange layout_center">付费</div>
<span class="text_14_600 color_333333 weight_full van-multi-ellipsis--l2" style="margin-left: 0.625rem;">2020年国家公务员《行测》试卷(省级)-名师版</span> <div v-if="item.price == 0" class="mark_green layout_center">免费</div>
</div> <span class="text_14_600 color_333333 weight_full van-multi-ellipsis--l2" style="margin-left: 0.625rem;">{{item.title}}</span>
<div class="layout_h" style="margin-top: 1.25rem;">
<span class="text_12_400 color_999999">题数:45</span>
<span class="class_attr text_12_400 color_999999">推荐用时:45m</span>
<span class="class_attr text_12_400 color_999999">45121已做</span>
</div>
</div>
<div class="class_right layout_center">
<div class="button_green layout_center">下载试题</div>
</div>
</div>
<!-- 项目2 -->
<div class="class_item layout_h">
<div class="class_left layout_v weight_full">
<div class="layout_h">
<div class="mark_orange layout_center">付费</div>
<span class="text_14_600 color_333333 weight_full van-multi-ellipsis--l2" style="margin-left: 0.625rem;">2020年国家公务员《行测》试卷(省级)-名师版</span>
</div> </div>
<div class="layout_h" style="margin-top: 1.25rem;"> <div class="layout_h" style="margin-top: 1.25rem;">
<span class="text_12_400 color_999999">题数:45</span> <span class="text_12_400 color_999999">题数:{{item.count}}</span>
<span class="class_attr text_12_400 color_999999">推荐用时:45m</span> <span class="class_attr text_12_400 color_999999">推荐用时:{{item.time}}m</span>
<span class="class_attr text_12_400 color_999999">45121已做</span> <span class="class_attr text_12_400 color_999999">{{item.person}}</span>
</div> </div>
</div> </div>
<div class="class_right layout_center"> <div class="class_right layout_center">
<div class="button_green layout_center">下载试题</div> <div v-if="item.price > 0" class="button_orange layout_center">¥{{item.price}}</div>
<div v-if="item.price == 0" class="button_green layout_center">下载试题</div>
</div> </div>
</div> </div>
</div> </div>
...@@ -286,7 +271,38 @@ ...@@ -286,7 +271,38 @@
}) })
}, },
//加载试题下载 //加载试题下载
loadDownload: function() {
let that = this
$.ajax({
type: "GET",
url: "{:U('exams/Index/paper')}" + "&api=1&c=" + that.conditionId,
dataType: "json",
success: function(res) {
if(res.status == 1) {
let array = res.data.data.length > 0 ? res.data.data : []
that.download = [].concat(array.map( r => {
return {
id: r.exams_paper_id,
title: r.exams_paper_title,
price: r.price,
count: r.questions_count,
time: r.reply_time,
person: r.exams_user + "已做"
}
}))
if(that.condition.length == 0) {
that.condition = [{ id: '', title: '全部', select: true }].concat(res.cate.map( r => {
return {
id: r.id,
title: r.title,
select: false
}
}))
}
}
}
})
}
} }
}) })
</script> </script>
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