|
|
@@ -1,52 +1,52 @@
|
|
|
<template>
|
|
|
- <app-view class="news-list-main">
|
|
|
- <template #header>
|
|
|
- <app-navbar title="市场资讯" />
|
|
|
+ <app-view class="news-list" flex>
|
|
|
+ <template #header>
|
|
|
+ <app-navbar title="市场资讯" />
|
|
|
+ </template>
|
|
|
+ <Tabs v-model:active="active" @click-tab="onClickTab">
|
|
|
+ <Tab title="宏观新闻">
|
|
|
+ <Empty v-if="dataList.length === 0" />
|
|
|
+ </Tab>
|
|
|
+ <Tab title="行业动态">
|
|
|
+ <Empty v-if="dataList.length === 0" />
|
|
|
+ </Tab>
|
|
|
+ <Tab title="厂家信息">
|
|
|
+ <Empty v-if="dataList.length === 0" />
|
|
|
+ </Tab>
|
|
|
+ </Tabs>
|
|
|
+ <app-pull-refresh class="news-list__container" v-model:pageIndex="pageIndex" :page-count="pageCount"
|
|
|
+ :updateList="dataList" @refresh="onRefresh">
|
|
|
+ <template #default="{ item }">
|
|
|
+ <Cell class="article-item" title-class="article-item__title" value-class="article-item__time"
|
|
|
+ :title="item.title" :value="formatDate(item.creaedate, 'MM/DD')"
|
|
|
+ :to="{ name: 'news-details', params: { details: JSON.stringify(item) } }" />
|
|
|
</template>
|
|
|
- <Tabs class="mine-generalize__tabs" v-model:active="active" @click-tab="onClickTab" sticky>
|
|
|
- <Tab title="宏观新闻">
|
|
|
- <Empty v-if="dataList.length===0" />
|
|
|
- </Tab>
|
|
|
- <Tab title="行业动态">
|
|
|
- <Empty v-if="dataList.length===0" />
|
|
|
- </Tab>
|
|
|
- <Tab title="厂家信息">
|
|
|
- <Empty v-if="dataList.length===0" />
|
|
|
- </Tab>
|
|
|
- </Tabs>
|
|
|
- <app-pull-refresh class="news-list__container" v-model:pageIndex="pageIndex" :page-count="pageCount"
|
|
|
- :updateList="dataList" @refresh="onRefresh">
|
|
|
- <template #default="{ item }">
|
|
|
- <Cell class="article-item" title-class="article-item__title" value-class="article-item__time"
|
|
|
- :title="item.title" :value="formatDate(item.creaedate, 'MM/DD')"
|
|
|
- :to="{ name: 'news-details', params: { details: JSON.stringify(item) } }" />
|
|
|
- </template>
|
|
|
- </app-pull-refresh>
|
|
|
- </app-view>
|
|
|
- </template>
|
|
|
+ </app-pull-refresh>
|
|
|
+ </app-view>
|
|
|
+</template>
|
|
|
|
|
|
- <script lang="ts" setup>
|
|
|
+<script lang="ts" setup>
|
|
|
|
|
|
- import { ref } from 'vue'
|
|
|
- import { Cell, Tab, Tabs, Empty } from 'vant'
|
|
|
- import { formatDate } from '@/filters'
|
|
|
- import { useSiteColumnDetail } from '@/business/news'
|
|
|
- import AppPullRefresh from '@mobile/components/base/pull-refresh/index.vue'
|
|
|
+import { ref } from 'vue'
|
|
|
+import { Cell, Tab, Tabs, Empty } from 'vant'
|
|
|
+import { formatDate } from '@/filters'
|
|
|
+import { useSiteColumnDetail } from '@/business/news'
|
|
|
+import AppPullRefresh from '@mobile/components/base/pull-refresh/index.vue'
|
|
|
|
|
|
- /// tab激活项
|
|
|
- const active = ref(0);
|
|
|
+/// tab激活项
|
|
|
+const active = ref(0);
|
|
|
|
|
|
- const { dataList, pageIndex, pageCount, getSiteColumnDetail } = useSiteColumnDetail()
|
|
|
- /// Tab触发
|
|
|
- const onClickTab = (e => {
|
|
|
- active.value = e.name
|
|
|
- })
|
|
|
+const { dataList, pageIndex, pageCount, getSiteColumnDetail } = useSiteColumnDetail()
|
|
|
+/// Tab触发
|
|
|
+const onClickTab = (e) => {
|
|
|
+ active.value = e.name
|
|
|
+}
|
|
|
|
|
|
- const onRefresh = (callback: () => void) => {
|
|
|
- getSiteColumnDetail(active.value).finally(() => callback())
|
|
|
- }
|
|
|
- </script>
|
|
|
+const onRefresh = (callback: () => void) => {
|
|
|
+ getSiteColumnDetail(active.value).finally(() => callback())
|
|
|
+}
|
|
|
+</script>
|
|
|
|
|
|
- <style lang="less">
|
|
|
- @import './index.less';
|
|
|
- </style>
|
|
|
+<style lang="less">
|
|
|
+@import './index.less';
|
|
|
+</style>
|