Commit b1aba396 by Lyan

z资讯中心bug

parent ff3dfe77
......@@ -45,7 +45,6 @@ export default {
const params = {
page: page,
limit: this.tableResult.pageSize,
classId:9
};
const listRes =
await this.$api.news.sdztList(params);
......
......@@ -76,7 +76,7 @@
</div>
<div class="row">
<div class="col-lg-8">
<img src="../../assets/image/news/sdzt-tp1.png" alt="" />
<img src="../../assets/image/news/sdzt-tp1.png" alt="" @click="goDepth" />
</div>
<div class="col-lg-4">
<ul v-if="depthList.length > 0">
......@@ -96,14 +96,14 @@
<div class="row">
<div class="col-lg-4">
<ul v-if="videoList.length > 0">
<li v-for="(tmp, i) in videoList" :key="i" @click="goInfo(tmp.id)">
<li v-for="(tmp, i) in videoList" :key="i" @click="getVideoInfo(tmp.id)">
<span></span><span>{{tmp.title}}</span>
</li>
</ul>
<span v-else>暂无数据</span>
</div>
<div class="col-lg-8">
<img src="../../assets/image/news/jcsp-tp1.png" alt="" />
<img src="../../assets/image/news/jcsp-tp1.png" alt="" @click="goVideo" />
</div>
</div>
</div>
......@@ -137,6 +137,7 @@
</div>
</template>
<script>
import { mapMutations } from "vuex";
export default {
data() {
return {
......@@ -288,21 +289,20 @@ export default {
that.centerList = result
})
// 精彩视频
this.initListFn(7,10).then(function(result) {
that.videoList = result
})
this.videoListFn()
//地方动态
this.initListFn(6,7).then(function(result) {
that.localList = result
})
//深度专题
this.initListFn(7,9).then(function(result) {
that.depthList = result
})
this.depthListFn();
//top
this.newsTop10()
},
methods:{
...mapMutations({
setMatche: "setMatche",
}),
goNewPic(){
this.$router.push({
path: '/News/PicNews',
......@@ -351,6 +351,32 @@ export default {
}
},
async depthListFn() {
const params = {
page: 1,
limit: 7,
};
const listRes =
await this.$api.news.sdztList(params);
const { returnCode, data } = listRes;
if (returnCode === "0") {
this.depthList = data.list
}
},
async videoListFn() {
const params = {
page: 1,
limit: 7,
};
const listRes =
await this.$api.news.jcspList(params);
const { returnCode, data } = listRes;
if (returnCode === "0") {
this.videoList = data.list
}
},
// 详情
goInfo(id){
console.log(id,'id')
......@@ -359,6 +385,7 @@ export default {
});
window.open(link.href,'_blank')
},
// top列表
async newsTop10() {
const policyListRes =
......@@ -370,6 +397,24 @@ export default {
}
},
getVideoInfo(id,directpath){
if(directpath&&directpath!==''&& directpath.length>0){
window.open(directpath,'_blank');
}else{
const matche = [
{
name: "精彩视频",
path: "/News/Video",
}
];
this.setMatche(matche);
let link = this.$router.resolve({
path: `/News/msgVideo?id=${id}`,
});
window.open(link.href,'_blank')
}
}
}
};
</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