1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071 |
- <template>
- <view class="news-index">
- <nav-bar title="新闻" @init="onInitNavbar"></nav-bar>
- <u-scroll-view :tabbar-conflict="false">
- <view class="main-container">
- <u-tabs :active.sync="tabActive" :tabs="tabs" tab-style="default" @change="tabChange"/>
- <van-empty v-if="newsList.length === 0" description="暂无数据" />
- <view v-else class="news-list">
- <template v-for="(item, index) in newsList">
- <news-item :item="item" :key="index" />
- </template>
- </view>
- <disclaimer-text></disclaimer-text>
- </view>
- </u-scroll-view>
- </view>
- </template>
- <script>
- import NavBar from '@/components/layout/nav-bar'
- import UTabs from '@/components/common/u-tabs'
- import UScrollView from '@/components/common/u-scroll-view'
- import NewsItem from '@/pages/news/components/news-item.vue'
- import DisclaimerText from '@/components/disclaimer-text/index.vue'
-
- export default {
- options: {
- styleIsolation: 'shared'
- },
- components: {
- NavBar,
- UTabs,
- UScrollView,
- NewsItem,
- DisclaimerText
- },
- data() {
- return {
- tabActive: 'exhibition',
- tabs: [{
- label: '展会新闻',
- value: 'exhibition'
- }, {
- label: '展商新闻',
- value: 'exhibitor'
- }],
- newsList: [{}, {}, {}, {}, {}, {}]
- }
- },
- onLoad(options) {
- if (options.type) {
- this.tabActive = options.type
- }
- },
- created() {},
- methods: {
- tabChange() {
-
- }
- }
- }
- </script>
- <style lang="scss">
- .news-list{
- display: grid;
- grid-template-columns: 1fr;
- grid-row-gap: 18rpx;
- margin-top: 28rpx;
- }
- </style>
|