diff --git a/common/server/news.js b/common/server/news.js index 2e1744d..792e06e 100644 --- a/common/server/news.js +++ b/common/server/news.js @@ -1,5 +1,5 @@ import HttpRequest from "../system/request"; - +import { sleep } from "@/common/utils"; /** * 获取推荐新闻列表 * @param {Number} page 页码 @@ -28,7 +28,10 @@ export const getHotNewsList = async (page = 1, pageSize = 10, title = "") => { * @param {Number} id 新闻id * @returns {Promise} 新闻详情 */ -export const getNewsDetail = async (id) => { - const res = await HttpRequest.getOrCache('/get_news_detail', { id }); +export const getNewsDetail = async (id, current = 0) => { + const res = await HttpRequest.getOrCache('/get_news_detail', { id, current }); + if (res.status == 0) { + return null; + } return res.data; } diff --git a/components.d.ts b/components.d.ts index b67e343..4c61e12 100644 --- a/components.d.ts +++ b/components.d.ts @@ -8,10 +8,13 @@ export {} /* prettier-ignore */ declare module 'vue' { export interface GlobalComponents { + LoadingData: typeof import('./components/youdas-container/loading-data.vue')['default'] NewsListItem: typeof import('./components/youdas-container/news-list-item.vue')['default'] NoData: typeof import('./components/youdas-container/no-data.vue')['default'] PageContainer: typeof import('./components/youdas-container/page-container.vue')['default'] RouterLink: typeof import('vue-router')['RouterLink'] RouterView: typeof import('vue-router')['RouterView'] + UniNavBar: typeof import('./components/uni-nav-bar/uni-nav-bar.vue')['default'] + UniStatusBar: typeof import('./components/uni-nav-bar/uni-status-bar.vue')['default'] } } diff --git a/components/youdas-container/loading-data.vue b/components/youdas-container/loading-data.vue new file mode 100644 index 0000000..15fa196 --- /dev/null +++ b/components/youdas-container/loading-data.vue @@ -0,0 +1,61 @@ + + + + + \ No newline at end of file diff --git a/components/youdas-container/news-list-item.vue b/components/youdas-container/news-list-item.vue index 3e55b0d..7084cb8 100644 --- a/components/youdas-container/news-list-item.vue +++ b/components/youdas-container/news-list-item.vue @@ -1,6 +1,7 @@