Commit afff1ee0 by Administrator

Merge remote-tracking branch 'origin/master'

parents c38edda3 b0cf2170
......@@ -73,6 +73,7 @@ class ExamsPaperModel extends Model
$data[$key]['exams_module_title'] = $this->getModuleTitleAttr($v['exams_module_id']);
$data[$key]['level_title'] = $this->getLevelTitle($v['level']);
$data[$key]['is_buy'] = $this->isBuy($v['exams_paper_id'], $this->mid);
$data[$key]['attach'] = '';
if ($data[$key]['is_buy'] || $v['price'] == 0) {
$data[$key]['attach'] = $this->getAttachPathByAttachId($v['attachment']);
}
......
......@@ -105,10 +105,10 @@
<div @click="onMyTab(1)" class="layout_center weight_full" :class="myTab == 1 ? 'zhenti_tab_selected' : 'zhenti_tab_normal'">收藏</div>
</div>
<template v-if="myTab == 1">
<div class="zhenti_my_collect_cell layout_v">
<div class="text_16_600 color_333333">某种糖果的进价为12元/千克,现购进这种糖果若干千克,每天销售10千克,且从第二天起每天都比前一天降价2元/千克。已知以6元/千克的价格销售的那天正好卖完最后10千克,且总销售额是总进货成本的2倍。问总共进了多少千克这种糖果?</div>
<div class="text_12_400 color_999999 zhenti_my_collect_cell_time">2020-04-04 03:12:56</div>
</div>
<!-- <div class="zhenti_my_collect_cell layout_v">-->
<!-- <div class="text_16_600 color_333333"></div>-->
<!-- <div class="text_12_400 color_999999 zhenti_my_collect_cell_time">2020-04-04 03:12:56</div>-->
<!-- </div>-->
<span style="margin-top: 35vh;" v-if="myCollect.length == 0" class="text_14_400 color_999999 self_center">没有找到!</span>
</template>
<template v-if="myTab == 0">
......@@ -216,6 +216,10 @@
if(this.tab == 0) {
return f.length > 0 ? f[0].id : ''
}
if(this.tab == 1) {
return f.length > 0 ? f[0].id : ''
}
}
},
methods: {
......
......@@ -80,8 +80,6 @@ class TopicAction extends CommonAction
$data = D('Topics')->getTopic(1,$_GET['cate'],$map);
$this->assign('topic_data',$data);
if($this->isAjax()) {
var_dump($data);
die;
echo json_encode($data);
exit();
}
......
......@@ -35,6 +35,18 @@ class TopicsModel extends Model
{
return $this->add($data);
}
protected function getAttachPathByAttachId($attachid) {
if (empty($attachid)) {
return '';
}
if ($attachInfo = model('Attach')->getAttachById($attachid)) {
return '/data/upload/' . $attachInfo['save_path'] . $attachInfo['save_name'];
} else {
return '';
}
}
/**
* 获取资讯
* @param boolean $with_plat_form 传入机构时是否同时显示平台资讯
......@@ -61,9 +73,13 @@ class TopicsModel extends Model
}else if ($type == 4) { //排序
$orders = '`re_sort` DESC';
}
var_dump(getAttachPathByAttachId(91));
die;
return $this->where($map)->order($orders)->findPage(10);
$results = $this->where($map)->order($orders)->findPage(10);
foreach ($results['data'] as $key => $result) {
if ($result['image']) {
$results['data'][$key]['cover'] = $this->getAttachPathByAttachId($result['image']);
}
}
return $results;
}
public function setTj($id)
......
......@@ -5,7 +5,7 @@
}
</style>
<div id="app">
<van-sticky>
<div class="tabs_container">
<div @click="onChange(idx)" v-for="(opt, idx) in options" :key="idx" :class="idx == tab ? 'tab_item_selected' : 'tab_item_normal'" >
......@@ -13,13 +13,13 @@
</div>
</div>
</van-sticky>
<van-list
v-model="loading"
:finished="finished"
finished-text="没有更多了"
@load="onLoad">
<template v-if="tab == 0">
<div v-for="(item, index) in options[0].items" class="layout_h news_hire_info">
<van-image height="72" width="72" :src="item.cover" fit="cover" ></van-image>
......@@ -38,7 +38,7 @@
</div>
</div>
</template>
<template v-if="tab == 1">
<div v-for="(item, index) in options[1].items" class="layout_h news_hire_info">
<van-image height="72" width="72" :src="item.cover" fit="cover" ></van-image>
......@@ -55,7 +55,7 @@
</div>
</div>
</template>
<template v-if="tab == 2">
<div v-for="(item, index) in options[2].items" class="layout_h news_hire_info">
<van-image height="72" width="72" :src="item.cover" fit="cover" ></van-image>
......@@ -72,12 +72,12 @@
</div>
</div>
</template>
</van-list>
</div>
<script>
new Vue({
el: "#app",
data: function() {
......@@ -129,7 +129,7 @@
return {
id: r.id,
title: r.title,
cover: r.image,
cover: r.cover,
time: d.format("yyyy-MM-dd")
}
}))
......@@ -140,7 +140,7 @@
})
},
onItem: function(item) {
window.location.href = "/news/"+item.id+".html";
}
}
})
......
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