|
|
@@ -1,15 +1,25 @@
|
|
|
<template>
|
|
|
<app-view class="home-main">
|
|
|
<template #header>
|
|
|
- <app-statusbar class="home-main__header">
|
|
|
- <img src="../../../assets/images/home-logo.svg" />
|
|
|
- </app-statusbar>
|
|
|
+ <app-navbar :show-back-button="false">
|
|
|
+ <div class="home-main__title">
|
|
|
+ <span>{{ globalStore.getSystemInfo('appName') }}</span>
|
|
|
+ <span>订单管理系统</span>
|
|
|
+ </div>
|
|
|
+ </app-navbar>
|
|
|
</template>
|
|
|
- <div class="home-main__container">
|
|
|
- <div class="home-main__banner">
|
|
|
- <Banner :data-list="topBanners" />
|
|
|
- </div>
|
|
|
- <div class="home-main__iconbar">
|
|
|
+ <div class="home-main__banner">
|
|
|
+ <Banner :data-list="topBanners" />
|
|
|
+ </div>
|
|
|
+ <PullRefresh class="home-main__container" v-model="refreshing" @refresh="onRefresh">
|
|
|
+ <app-block>
|
|
|
+ <Cell class="home-main__titlebar" 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('order-list')">
|
|
|
<img src="../../../assets/images/icons/order.svg" />
|
|
|
@@ -28,32 +38,35 @@
|
|
|
<span>我的库存</span>
|
|
|
</li>
|
|
|
</ul>
|
|
|
- </div>
|
|
|
- <div class="home-main__news">
|
|
|
- <section>
|
|
|
- <h2>
|
|
|
- <span>业务公告</span>
|
|
|
- <span @click="routerTo('news-list')">更多></span>
|
|
|
- </h2>
|
|
|
- <ul v-if="newsList.length">
|
|
|
- <template v-for="(item, index) in newsList" :key="index">
|
|
|
- <li @click="routerTo('news-list')">{{ item.title }}</li>
|
|
|
- </template>
|
|
|
- </ul>
|
|
|
- </section>
|
|
|
- </div>
|
|
|
- </div>
|
|
|
+ </app-block>
|
|
|
+ <app-block class="home-main__news">
|
|
|
+ <CellGroup class="article">
|
|
|
+ <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.title" :value="formatDate(item.publishdate, 'MM/DD')"
|
|
|
+ @click="routerTo('news-list')" />
|
|
|
+ </template>
|
|
|
+ </CellGroup>
|
|
|
+ </app-block>
|
|
|
+ </PullRefresh>
|
|
|
</app-view>
|
|
|
</template>
|
|
|
|
|
|
<script lang="ts" setup>
|
|
|
-import { shallowRef, onActivated } from 'vue'
|
|
|
-import { useNavigation } from '@mobile/router/navigation'
|
|
|
-import { queryImageConfigs } from "@/services/api/common"
|
|
|
+import { shallowRef } from "vue";
|
|
|
+import { Cell, CellGroup, PullRefresh, Badge } from "vant";
|
|
|
+import { formatDate } from "@/filters";
|
|
|
+import { useNavigation } from '@mobile/router/navigation';
|
|
|
+import { queryImageConfigs } from "@/services/api/common";
|
|
|
+import { useNoticeStore, useGlobalStore } from '@/stores'
|
|
|
import Banner from '@mobile/components/base/banner/index.vue'
|
|
|
-import { queryNewTitles } from '@/services/api/news'
|
|
|
+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.NewTitlesRsp[]>([]) // 资讯列表
|
|
|
@@ -82,9 +95,7 @@ const onRefresh = () => {
|
|
|
})
|
|
|
}
|
|
|
|
|
|
-onActivated(() => {
|
|
|
- onRefresh()
|
|
|
-})
|
|
|
+onRefresh()
|
|
|
</script>
|
|
|
|
|
|
<style lang="less">
|