Commit 9106c794 by amateur

新闻动态

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