|
|
@@ -13,13 +13,14 @@
|
|
|
</div>
|
|
|
<PullRefresh class="home-main__container" v-model="refreshing" @refresh="onRefresh">
|
|
|
<app-block>
|
|
|
- <Cell title="通知公告" value="更多" :to="{ name: 'notice-list' }" icon="volume" is-link />
|
|
|
+ <Cell title="通知公告" value="更多" :to="{ name: 'notice-list' }" icon="volume" is-link>
|
|
|
+ <template #title>
|
|
|
+ <Badge :offset="[10, 8]" :dot="noticeStore.unreadList.length > 0">{{ $t('routes.notice') }}</Badge>
|
|
|
+ </template>
|
|
|
+ </Cell>
|
|
|
</app-block>
|
|
|
<app-block class="home-main__iconbar bg">
|
|
|
<ul>
|
|
|
- <li @click="routerTo('home-market', true)">
|
|
|
- <Iconfont label-direction="bottom" icon="g-icon-quote--line">行情</Iconfont>
|
|
|
- </li>
|
|
|
<li @click="routerTo('order-list')">
|
|
|
<Iconfont label-direction="bottom" icon="g-icon-order--line">持有订单</Iconfont>
|
|
|
</li>
|
|
|
@@ -29,8 +30,6 @@
|
|
|
<li @click="routerTo('pickup-list')">
|
|
|
<Iconfont label-direction="bottom" icon="g-icon-pickup--line">提料订单</Iconfont>
|
|
|
</li>
|
|
|
- </ul>
|
|
|
- <ul>
|
|
|
<li @click="routerTo('inventory-list')">
|
|
|
<Iconfont label-direction="bottom" icon="g-icon-inventory">我的库存</Iconfont>
|
|
|
</li>
|
|
|
@@ -38,11 +37,11 @@
|
|
|
</app-block>
|
|
|
<app-block class="home-main__news">
|
|
|
<CellGroup class="article">
|
|
|
- <Cell class="home-main__titlebar" title="市场资讯" value="更多" icon="fire" @click="routerTo('home-news', true)"
|
|
|
+ <Cell class="home-main__titlebar" title="业务公告" value="更多" icon="fire" @click="routerTo('news-list')"
|
|
|
is-link />
|
|
|
<template v-for="(item, index) in newsList" :key="index">
|
|
|
- <Cell class="article-item" :title="item.data.content" :value="formatDate(item.time, 'MM/DD')"
|
|
|
- @click="routerTo('home-news', true)" />
|
|
|
+ <Cell class="article-item" :title="item.title" :value="formatDate(item.publishdate, 'MM/DD')"
|
|
|
+ @click="routerTo('news-list')" />
|
|
|
</template>
|
|
|
</CellGroup>
|
|
|
</app-block>
|
|
|
@@ -52,19 +51,21 @@
|
|
|
|
|
|
<script lang="ts" setup>
|
|
|
import { shallowRef } from "vue";
|
|
|
-import { Cell, CellGroup, PullRefresh } from "vant";
|
|
|
+import { Cell, CellGroup, PullRefresh, Badge } from "vant";
|
|
|
import { formatDate } from "@/filters";
|
|
|
import { useNavigation } from '@mobile/router/navigation';
|
|
|
-import { queryImageConfigs, getJ10News } from "@/services/api/common";
|
|
|
-import { useGlobalStore } from '@/stores'
|
|
|
+import { queryImageConfigs } from "@/services/api/common";
|
|
|
+import { useNoticeStore, useGlobalStore } from '@/stores'
|
|
|
import Banner from '@mobile/components/base/banner/index.vue'
|
|
|
import Iconfont from '@/components/base/iconfont/index.vue'
|
|
|
+import { queryNewTitles } from "@/services/api/news";
|
|
|
|
|
|
const { routerTo } = useNavigation()
|
|
|
+const noticeStore = useNoticeStore()
|
|
|
const globalStore = useGlobalStore()
|
|
|
const refreshing = shallowRef(false) // 是否处于加载中状态
|
|
|
const topBanners = shallowRef<string[]>([]) // 轮播图列表
|
|
|
-const newsList = shallowRef<Model.J10NewsRsp[]>([]) // 资讯列表
|
|
|
+const newsList = shallowRef<Model.NewTitlesRsp[]>([]) // 资讯列表
|
|
|
|
|
|
// 下拉刷新
|
|
|
const onRefresh = () => {
|
|
|
@@ -75,10 +76,13 @@ const onRefresh = () => {
|
|
|
}).then((res) => {
|
|
|
topBanners.value = res.data.map((e) => e.imagepath)
|
|
|
})
|
|
|
+
|
|
|
// 市场资讯
|
|
|
- getJ10News({
|
|
|
+ queryNewTitles({
|
|
|
data: {
|
|
|
- limit: 10
|
|
|
+ columnid: 1,
|
|
|
+ page: 1,
|
|
|
+ pagesize: 10
|
|
|
}
|
|
|
}).then((res) => {
|
|
|
newsList.value = res.data
|