|
|
@@ -4,13 +4,7 @@
|
|
|
<app-navbar title="市场资讯" />
|
|
|
</template>
|
|
|
<Tabs v-model:active="active" @click-tab="onClickTab">
|
|
|
- <Tab title="宏观新闻">
|
|
|
- <Empty v-if="empty" />
|
|
|
- </Tab>
|
|
|
- <Tab title="行业动态">
|
|
|
- <Empty v-if="empty" />
|
|
|
- </Tab>
|
|
|
- <Tab title="厂家信息">
|
|
|
+ <Tab v-for="(item, index) in configs" :key="index" :title="item.columnname">
|
|
|
<Empty v-if="empty" />
|
|
|
</Tab>
|
|
|
</Tabs>
|
|
|
@@ -31,20 +25,39 @@ import { ref, shallowRef } from 'vue'
|
|
|
import { Cell, Tab, Tabs, Empty } from 'vant'
|
|
|
import { formatDate } from '@/filters'
|
|
|
import { useSiteColumnDetail } from '@/business/news'
|
|
|
+import { querySiteColumnConfig } from '@/services/api/news'
|
|
|
import AppPullRefresh from '@mobile/components/base/pull-refresh/index.vue'
|
|
|
|
|
|
/// tab激活项
|
|
|
const active = ref(0);
|
|
|
const empty = shallowRef(false)
|
|
|
+const configs = shallowRef<Model.SiteColumnConfigRsp[]>([])
|
|
|
+const config = shallowRef<Model.SiteColumnConfigRsp>({})
|
|
|
|
|
|
const { dataList, pageIndex, pageCount, getSiteColumnDetail } = useSiteColumnDetail()
|
|
|
/// Tab触发
|
|
|
const onClickTab = (e) => {
|
|
|
active.value = e.name
|
|
|
+ /// 设置选中的数据
|
|
|
+ if (configs.value.length>0) {
|
|
|
+ config.value = configs.value[e.name]
|
|
|
+ }
|
|
|
+ getSiteColumnDetail(config.value.id)
|
|
|
}
|
|
|
|
|
|
+/// 查询栏目配置
|
|
|
+querySiteColumnConfig({
|
|
|
+ success: (res) => {
|
|
|
+ configs.value = res.data
|
|
|
+ /// 默认第一个
|
|
|
+ if (res.data.length > 0) {
|
|
|
+ config.value = res.data[0]
|
|
|
+ }
|
|
|
+ }
|
|
|
+})
|
|
|
+
|
|
|
const onRefresh = (callback: () => void) => {
|
|
|
- getSiteColumnDetail(active.value).finally(() => callback())
|
|
|
+ getSiteColumnDetail(config.value.id).finally(() => callback())
|
|
|
}
|
|
|
|
|
|
const onUpdated = (lists: Model.THJProductRsp[]) => {
|