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 @@
+
+
+
+ {{ message }}
+
+
+
+
+
+
\ 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 @@
-
+
@@ -31,6 +32,9 @@
+
+
+
@@ -46,7 +50,7 @@ const isCurrentPage = ref(false);
// 跳转到详情页
const toDetails = (id) => {
if (!id) return;
- emit('clickItem', id);
+ emit('clickItem', id);
}
const props = defineProps({
@@ -74,7 +78,7 @@ watch(() => props.currentIndex, (newVal) => {
// 这里需要延迟渲染z-paging的原因是为了避免在一些平台上立即渲染可能引发的底层报错问题
setTimeout(() => {
isCurrentPage.value = true;
- }, 100);
+ }, 50);
}
}
}, {
diff --git a/components/youdas-container/page-container.vue b/components/youdas-container/page-container.vue
index 764fdc6..39cf628 100644
--- a/components/youdas-container/page-container.vue
+++ b/components/youdas-container/page-container.vue
@@ -1,12 +1,19 @@
-
-
-
-
-
+
+
+
+
+
+
+
+
+
+
+
+
-
+
\ No newline at end of file
diff --git a/pages/news/news-details.vue b/pages/news/news-details.vue
index 396b28a..dfc8d13 100644
--- a/pages/news/news-details.vue
+++ b/pages/news/news-details.vue
@@ -1,7 +1,7 @@
-
+
{{ title }}
@@ -13,33 +13,98 @@
+
+
+
+ 推荐
+
+
+
+
+
+
+
+ {{ item.title }}
+
+
+
+
@@ -47,6 +112,7 @@ export default {