Commit 91514e48 by Lyan

首页搜索bug 修改

parent 5598c095
...@@ -2,7 +2,7 @@ ...@@ -2,7 +2,7 @@
<ul class="sousuoList"> <ul class="sousuoList">
<li v-for="(tmp, i) in list" :key="i" > <li v-for="(tmp, i) in list" :key="i" >
<div class="sousuoList-top"> <div class="sousuoList-top">
<span>【资讯动态】</span> <span>{{tmp.type==1?'【标准科研】':tmp.type==2?'【政策法规】':(tmp.type==3||tmp.type==31||tmp.type==32)?'【资讯动态】':tmp.type==5?'【应用领域】':tmp.type==6?'【技术知识】':''}}</span>
<span v-html="tmp.title" @click="handelMsg(tmp.urlid,tmp.type)"></span> <span v-html="tmp.title" @click="handelMsg(tmp.urlid,tmp.type)"></span>
</div> </div>
<div class="sousuoList-middle" v-html="changeText(tmp.content)"></div> <div class="sousuoList-middle" v-html="changeText(tmp.content)"></div>
...@@ -26,20 +26,48 @@ export default { ...@@ -26,20 +26,48 @@ export default {
props: ['list'], props: ['list'],
data() { data() {
return { return {
typeName:''
} }
}, },
methods: { methods: {
handelMsg(id,type) { handelMsg(id,type) {
// this.InfoFn(id,type) // this.InfoFn(id,type)
if(type==2){ // 1 【标准科研】 /News/msg
// 2 【政策法规】 /Knowledge/Statuteinfo
// 3 【资讯动态】 /News/msg
// 5 【应用领域】 /News/msg
// 6 【技术知识】 /Knowledge/article
// 31 【资讯动态】/News/msg
// 32 【资讯动态】 /News/Video
if(type==1){
this.$router.push({
path: `/News/msg?id=${id}`,
});
}else if(type==2){
this.$router.push({ this.$router.push({
path: `/Knowledge/Statuteinfo?id=${id}`, path: `/Knowledge/Statuteinfo?id=${id}`,
}); });
}else if(type==3){
this.$router.push({
path: `/News/msg?id=${id}`,
});
}else if(type==5){
this.$router.push({
path: `/News/msg?id=${id}`,
});
}else if(type==6){ }else if(type==6){
this.$router.push({ this.$router.push({
path: `/Knowledge/article?id=${id}`, path: `/Knowledge/article?id=${id}`,
}); });
}else if(type==31){
this.$router.push({
path: `/News/viewsub?id=${id}`,
});
}else if(type==32){
this.$router.push({
path: `/News/msgVideo?id=${id}`,
});
}else{ }else{
this.$router.push({ this.$router.push({
path: `/News/msg?id=${id}`, path: `/News/msg?id=${id}`,
......
...@@ -24,7 +24,7 @@ ...@@ -24,7 +24,7 @@
<div class="sousuo-bottom"> <div class="sousuo-bottom">
<div class="container"> <div class="container">
<ul class="nav nav-tabs" id="myTab" role="tablist"> <ul class="nav nav-tabs" id="myTab" role="tablist">
<li class="nav-item" role="presentation" @click="initListFn(1,'')"> <li class="nav-item" role="presentation" @click="initListFn2(1,'')">
<button <button
class="nav-link active" class="nav-link active"
href="#qbwt" href="#qbwt"
...@@ -33,7 +33,7 @@ ...@@ -33,7 +33,7 @@
<span>全部问题</span> <span>全部问题</span>
</button> </button>
</li> </li>
<li class="nav-item" role="presentation" @click="initListFn(1,'1')"> <li class="nav-item" role="presentation" @click="initListFn2(1,'1')">
<button <button
class="nav-link" class="nav-link"
href="#bzky" href="#bzky"
...@@ -42,7 +42,7 @@ ...@@ -42,7 +42,7 @@
<span>标准科研</span> <span>标准科研</span>
</button> </button>
</li> </li>
<li class="nav-item" role="presentation" @click="initListFn(1,'2')"> <li class="nav-item" role="presentation" @click="initListFn2(1,'2')">
<button <button
class="nav-link" class="nav-link"
href="#zcfg" href="#zcfg"
...@@ -51,7 +51,7 @@ ...@@ -51,7 +51,7 @@
<span>政策法规</span> <span>政策法规</span>
</button> </button>
</li> </li>
<li class="nav-item" role="presentation" @click="initListFn(1,'3,31,32')"> <li class="nav-item" role="presentation" @click="initListFn2(1,'3,31,32')">
<button <button
class="nav-link" class="nav-link"
href="#zxdt" href="#zxdt"
...@@ -60,7 +60,7 @@ ...@@ -60,7 +60,7 @@
<span>资讯动态</span> <span>资讯动态</span>
</button> </button>
</li> </li>
<li class="nav-item" role="presentation" @click="initListFn(1,'5')"> <li class="nav-item" role="presentation" @click="initListFn2(1,'5')">
<button <button
class="nav-link" class="nav-link"
href="#yyly" href="#yyly"
...@@ -130,6 +130,7 @@ export default { ...@@ -130,6 +130,7 @@ export default {
pageSize: 10, pageSize: 10,
totalCount: 0, totalCount: 0,
}, },
typeStr:'',
pickerOptions: { pickerOptions: {
shortcuts: [ shortcuts: [
{ {
...@@ -167,12 +168,17 @@ export default { ...@@ -167,12 +168,17 @@ export default {
this.initListFn(this.pageParams.currPage); this.initListFn(this.pageParams.currPage);
}, },
methods:{ methods:{
initListFn2(page,type){
this.typeStr=type
this.initListFn(page)
},
// 列表 // 列表
async initListFn(page,type) { async initListFn(page) {
const params = { const params = {
page: page, page: page,
size: this.pageParams.pageSize, size:this.pageParams.pageSize,
type:type, type:this.typeStr,
name:this.search.keywords name:this.search.keywords
}; };
const listRes = const listRes =
......
...@@ -69,6 +69,7 @@ export default { ...@@ -69,6 +69,7 @@ export default {
.org { .org {
padding-bottom: 20px; padding-bottom: 20px;
.title-style { .title-style {
width: 100%;
font-size: 24px; font-size: 24px;
text-align: center; text-align: center;
padding: 30px; padding: 30px;
......
...@@ -95,7 +95,7 @@ ...@@ -95,7 +95,7 @@
</div> </div>
</template> </template>
<script> <script>
import { mapState } from "vuex"; import { mapState,mapMutations } from "vuex";
import breadcrumb from "../comps/breadcrumb.vue"; import breadcrumb from "../comps/breadcrumb.vue";
import list from "./comps/list.vue"; import list from "./comps/list.vue";
import list2 from "./comps/list2.vue"; import list2 from "./comps/list2.vue";
...@@ -148,6 +148,58 @@ export default { ...@@ -148,6 +148,58 @@ export default {
zttjListListArr: [], zttjListListArr: [],
url: window.location.href, url: window.location.href,
sharesinastring: null, sharesinastring: null,
matcheList:[
{
classid:4,
name: "图片资讯",
path: "/News/PicNews",
},
{
classid:5,
name: "综合报道",
path: "/News/Composite",
},
{
classid:6,
name: "中心活动",
path: "/News/Center",
},
{
classid:7,
name: "地方动态",
path: "/News/Local",
},
{
classid:8,
name: "国际追踪",
path: "/News/International",
},
{
classid:24,
name: "行业应用",
path: "/News/Application",
},
{
classid:14,
name: "零售",
path: "/News/Retail",
},
{
classid:15,
name: "物流",
path: "/News/Logistics",
},{
classid:16,
name: "食品安全追溯",
path: "/News/FoodSafety",
},
{
classid:31,
name: "标准科研动态",
path: "/News/Research",
},
]
}; };
}, },
created() { created() {
...@@ -155,8 +207,12 @@ export default { ...@@ -155,8 +207,12 @@ export default {
this.newsTop10(); this.newsTop10();
this.announceList(); this.announceList();
this.zttjList(); this.zttjList();
}, },
methods: { methods: {
...mapMutations({
setMatche: "setMatche",
}),
async InfoFn() { async InfoFn() {
const params = { const params = {
id: this.id, id: this.id,
...@@ -164,6 +220,14 @@ export default { ...@@ -164,6 +220,14 @@ export default {
const listRes = await this.$api.news.newsInfo(params); const listRes = await this.$api.news.newsInfo(params);
const { returnCode, data } = listRes; const { returnCode, data } = listRes;
if (returnCode === "0") { if (returnCode === "0") {
let matche = this.matcheList.filter((item) => item.classid ===data.classid)[0];
if(typeof(matche)==='undefined'){
matche = [{
name:'资讯中心',
path:'/News/index'
}]
}
this.setMatche(matche);
this.content = data.content; this.content = data.content;
this.title = data.title; this.title = data.title;
this.showtime = data.showtime; this.showtime = data.showtime;
......
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