Commit 9106c794 by amateur

新闻动态

1 parent 52665ae9
......@@ -3,7 +3,9 @@ const Types = {
Home: { size: 10 },
RegIssue: { size: 10 },
InfoDisclosure: { size: 10 },
SelfRegulating: { size: 10 }
SelfRegulating: { size: 10 },
News: { size: 10 },
}
import utils from '@/utils/index'
......@@ -13,7 +15,8 @@ export default {
Home: [],
RegIssue: [],
InfoDisclosure: [],
SelfRegulating: []
SelfRegulating: [],
News: []
},
mutations: {
MSetHistoryDatas (state, { key, datas }) {
......
......@@ -2,19 +2,20 @@
<div class="news">
<nafm-header navClass="nafmii-head-bg3">
<template slot="bottom">
<SearchInput :placeholder="$t('home.searchPlaceholder')" />
<SearchInput v-model="keyword" readonly @click="handleSearch" :placeholder="$t('home.searchPlaceholder')" />
<div class="nav-placeholder"></div>
</template>
</nafm-header>
<van-tabs v-model="active" animated scrollspy swipe-threshold="3" class="data-tabs">
<van-tab :title="item.name" v-for="(item,idx) in tabs" :key="idx">
<DataListLayout :tab="item" />
<DataListLayout :keyword="keyword" :tab="item" />
</van-tab>
</van-tabs>
</div>
</template>
<script>
import { KeywordBus } from '@/utils/eventBus'
import SearchInput from '@/components/SearchInput'
import DataListLayout from './components/DataListLayout'
export default {
......@@ -23,6 +24,7 @@ export default {
data () {
return {
active: 0,
keyword: null,
tabs: []
}
},
......@@ -34,10 +36,23 @@ export default {
{ type: 3, name: '通知' },
{ type: 4, name: '其他' },
]
},
handleSearch () {
this.$router.push({ name: 'SelfRegulatingSearch' })
},
initKeywordListener () {
KeywordBus.on((val) => {
this.keyword = val
})
}
},
mounted () {
this.onGetTabs()
this.initKeywordListener()
},
destroyed () {
KeywordBus.off()
}
}
</script>
......
<template>
<div class="news-search"></div>
<ModuleSearchLayout @onSearch="handleSearch" stateKey="News" />
</template>
<script>
import { KeywordBus } from '@/utils/eventBus'
import ModuleSearchLayout from '@/components/ModuleSearchLayout'
export default {
name: 'NewsSearch'
}
</script>
name: 'NewSearch',
components: { ModuleSearchLayout },
data () {
return {
}
},
methods: {
handleSearch (val) {
KeywordBus.emit(val)
this.$router.back();
}
}
<style lang="less" scoped>
.news {
}
</style>
\ No newline at end of file
</script>
\ No newline at end of file
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!