+
+
@@ -27,23 +28,22 @@ const switchTab = (index) => {
-
+
+
+
+
+ {{ tab.label }}
+
+
+
diff --git a/frontend/wechat/src/main.js b/frontend/wechat/src/main.js
index 380af50..7e447ef 100644
--- a/frontend/wechat/src/main.js
+++ b/frontend/wechat/src/main.js
@@ -1,14 +1,7 @@
-import Aura from '@primeuix/themes/aura';
import { createPinia } from 'pinia';
-import PrimeVue from 'primevue/config';
-import ConfirmationService from 'primevue/confirmationservice';
-import ToastService from 'primevue/toastservice';
import { createApp } from 'vue';
import App from './App.vue';
import { router } from './router.js';
-
-// Import only the required PrimeVue styles
-import 'primeicons/primeicons.css'; // Icons
import './style.css';
@@ -17,24 +10,5 @@ const app = createApp(App)
const pinia = createPinia()
app.use(pinia);
-
app.use(router);
-app.use(PrimeVue, {
- theme: {
- preset: Aura,
- },
- ripple: true,
- options: {
- darkModeSelector: '.my-app-dark',
- }
-})
-
-// Register the ConfirmationService to fix the error
-app.use(ConfirmationService);
-
-// Register the ToastService
-app.use(ToastService);
-
-// Remove global component registrations
-
app.mount('#app');
diff --git a/frontend/wechat/src/router.js b/frontend/wechat/src/router.js
index f35b039..e3d5a25 100644
--- a/frontend/wechat/src/router.js
+++ b/frontend/wechat/src/router.js
@@ -24,7 +24,7 @@ const routes = [
]
},
{
- path: '/article/:id',
+ path: '/posts/:id',
name: 'article-detail',
component: () => import('@/views/ArticleDetail.vue')
}
diff --git a/frontend/wechat/src/stores/article.js b/frontend/wechat/src/stores/article.js
index 5b28d94..679ad9d 100644
--- a/frontend/wechat/src/stores/article.js
+++ b/frontend/wechat/src/stores/article.js
@@ -14,10 +14,11 @@ export const useArticleStore = defineStore('article', {
if (this.loading || !this.hasMore) return
this.loading = true
try {
- const response = await fetch(`/api/articles?page=${this.page}&q=${this.searchQuery}`)
+ const response = await fetch(`/api/posts?page=${this.page}&q=${this.searchQuery}`)
const data = await response.json()
- this.articles = [...this.articles, ...data.items]
- this.hasMore = data.hasMore
+ const items = data.items || []
+ this.articles = [...this.articles, ...items]
+ this.hasMore = items.length > 0 // 只有当返回的列表为空时,才设置 hasMore 为 false
this.page++
} finally {
this.loading = false
diff --git a/frontend/wechat/src/stores/article_list.json b/frontend/wechat/src/stores/article_list.json
new file mode 100644
index 0000000..e135c57
--- /dev/null
+++ b/frontend/wechat/src/stores/article_list.json
@@ -0,0 +1,297 @@
+{
+ "page": 7,
+ "limit": 10,
+ "total": 100,
+ "items": [
+ {
+ "id": 40,
+ "created_at": "2025-04-11T15:03:25.666419Z",
+ "updated_at": "2025-04-11T15:03:25.666419Z",
+ "deleted_at": null,
+ "status": 1,
+ "title": "test-title-39",
+ "description": "test-description-39",
+ "content": "test-content-39",
+ "price": 6747,
+ "discount": 98,
+ "views": 8091,
+ "likes": 9914,
+ "tags": [
+ "tag1",
+ "tag2",
+ "tag3"
+ ],
+ "assets": [
+ {
+ "type": "audio",
+ "media": 8143
+ },
+ {
+ "type": "video",
+ "media": 2977
+ }
+ ]
+ },
+ {
+ "id": 39,
+ "created_at": "2025-04-11T15:03:25.661237Z",
+ "updated_at": "2025-04-11T15:03:25.661237Z",
+ "deleted_at": null,
+ "status": 1,
+ "title": "test-title-38",
+ "description": "test-description-38",
+ "content": "test-content-38",
+ "price": 2891,
+ "discount": 45,
+ "views": 4462,
+ "likes": 6110,
+ "tags": [
+ "tag1",
+ "tag2",
+ "tag3"
+ ],
+ "assets": [
+ {
+ "type": "audio",
+ "media": 5431
+ },
+ {
+ "type": "video",
+ "media": 3866
+ }
+ ]
+ },
+ {
+ "id": 38,
+ "created_at": "2025-04-11T15:03:25.657112Z",
+ "updated_at": "2025-04-11T15:03:25.657112Z",
+ "deleted_at": null,
+ "status": 1,
+ "title": "test-title-37",
+ "description": "test-description-37",
+ "content": "test-content-37",
+ "price": 904,
+ "discount": 70,
+ "views": 8988,
+ "likes": 816,
+ "tags": [
+ "tag1",
+ "tag2",
+ "tag3"
+ ],
+ "assets": [
+ {
+ "type": "audio",
+ "media": 3307
+ },
+ {
+ "type": "video",
+ "media": 2933
+ }
+ ]
+ },
+ {
+ "id": 37,
+ "created_at": "2025-04-11T15:03:25.65266Z",
+ "updated_at": "2025-04-11T15:03:25.65266Z",
+ "deleted_at": null,
+ "status": 1,
+ "title": "test-title-36",
+ "description": "test-description-36",
+ "content": "test-content-36",
+ "price": 4476,
+ "discount": 45,
+ "views": 9910,
+ "likes": 9295,
+ "tags": [
+ "tag1",
+ "tag2",
+ "tag3"
+ ],
+ "assets": [
+ {
+ "type": "audio",
+ "media": 3472
+ },
+ {
+ "type": "video",
+ "media": 3283
+ }
+ ]
+ },
+ {
+ "id": 36,
+ "created_at": "2025-04-11T15:03:25.644946Z",
+ "updated_at": "2025-04-11T15:03:25.644946Z",
+ "deleted_at": null,
+ "status": 1,
+ "title": "test-title-35",
+ "description": "test-description-35",
+ "content": "test-content-35",
+ "price": 7397,
+ "discount": 56,
+ "views": 2486,
+ "likes": 673,
+ "tags": [
+ "tag1",
+ "tag2",
+ "tag3"
+ ],
+ "assets": [
+ {
+ "type": "audio",
+ "media": 1183
+ },
+ {
+ "type": "video",
+ "media": 9735
+ }
+ ]
+ },
+ {
+ "id": 35,
+ "created_at": "2025-04-11T15:03:25.640256Z",
+ "updated_at": "2025-04-11T15:03:25.640256Z",
+ "deleted_at": null,
+ "status": 1,
+ "title": "test-title-34",
+ "description": "test-description-34",
+ "content": "test-content-34",
+ "price": 3733,
+ "discount": 15,
+ "views": 3705,
+ "likes": 1863,
+ "tags": [
+ "tag1",
+ "tag2",
+ "tag3"
+ ],
+ "assets": [
+ {
+ "type": "audio",
+ "media": 8713
+ },
+ {
+ "type": "video",
+ "media": 9442
+ }
+ ]
+ },
+ {
+ "id": 34,
+ "created_at": "2025-04-11T15:03:25.634088Z",
+ "updated_at": "2025-04-11T15:03:25.634088Z",
+ "deleted_at": null,
+ "status": 1,
+ "title": "test-title-33",
+ "description": "test-description-33",
+ "content": "test-content-33",
+ "price": 6591,
+ "discount": 12,
+ "views": 3834,
+ "likes": 7400,
+ "tags": [
+ "tag1",
+ "tag2",
+ "tag3"
+ ],
+ "assets": [
+ {
+ "type": "audio",
+ "media": 7429
+ },
+ {
+ "type": "video",
+ "media": 9401
+ }
+ ]
+ },
+ {
+ "id": 33,
+ "created_at": "2025-04-11T15:03:25.628572Z",
+ "updated_at": "2025-04-11T15:03:25.628572Z",
+ "deleted_at": null,
+ "status": 1,
+ "title": "test-title-32",
+ "description": "test-description-32",
+ "content": "test-content-32",
+ "price": 3740,
+ "discount": 92,
+ "views": 7324,
+ "likes": 3705,
+ "tags": [
+ "tag1",
+ "tag2",
+ "tag3"
+ ],
+ "assets": [
+ {
+ "type": "audio",
+ "media": 8942
+ },
+ {
+ "type": "video",
+ "media": 2618
+ }
+ ]
+ },
+ {
+ "id": 32,
+ "created_at": "2025-04-11T15:03:25.623885Z",
+ "updated_at": "2025-04-11T15:03:25.623885Z",
+ "deleted_at": null,
+ "status": 1,
+ "title": "test-title-31",
+ "description": "test-description-31",
+ "content": "test-content-31",
+ "price": 1839,
+ "discount": 37,
+ "views": 4750,
+ "likes": 2995,
+ "tags": [
+ "tag1",
+ "tag2",
+ "tag3"
+ ],
+ "assets": [
+ {
+ "type": "audio",
+ "media": 7409
+ },
+ {
+ "type": "video",
+ "media": 8843
+ }
+ ]
+ },
+ {
+ "id": 31,
+ "created_at": "2025-04-11T15:03:25.61745Z",
+ "updated_at": "2025-04-11T15:03:25.61745Z",
+ "deleted_at": null,
+ "status": 1,
+ "title": "test-title-30",
+ "description": "test-description-30",
+ "content": "test-content-30",
+ "price": 2297,
+ "discount": 56,
+ "views": 715,
+ "likes": 1224,
+ "tags": [
+ "tag1",
+ "tag2",
+ "tag3"
+ ],
+ "assets": [
+ {
+ "type": "audio",
+ "media": 9268
+ },
+ {
+ "type": "video",
+ "media": 4416
+ }
+ ]
+ }
+ ]
+}
\ No newline at end of file
diff --git a/frontend/wechat/src/style.css b/frontend/wechat/src/style.css
index c376756..a461c50 100644
--- a/frontend/wechat/src/style.css
+++ b/frontend/wechat/src/style.css
@@ -1,4 +1 @@
-@import "tailwindcss";
-@import "tailwindcss-primeui";
-
-@custom-variant dark (&:where(.my-app-dark, .my-app-dark *));
\ No newline at end of file
+@import "tailwindcss";
\ No newline at end of file
diff --git a/frontend/wechat/src/views/ArticleDetail.vue b/frontend/wechat/src/views/ArticleDetail.vue
index 52b8e30..dae51f0 100644
--- a/frontend/wechat/src/views/ArticleDetail.vue
+++ b/frontend/wechat/src/views/ArticleDetail.vue
@@ -14,14 +14,31 @@ onMounted(async () => {
-
-
+
+
+
+
+
+
+
+ {{ article?.title || '文章详情' }}
+
-
-
{{ article.title }}
-
- {{ article.content }}
+
+
+
+ {{ article.content }}
+
-
+
+
+
+
\ No newline at end of file
diff --git a/frontend/wechat/src/views/ArticleList.vue b/frontend/wechat/src/views/ArticleList.vue
index a5bacc9..08356b6 100644
--- a/frontend/wechat/src/views/ArticleList.vue
+++ b/frontend/wechat/src/views/ArticleList.vue
@@ -1,7 +1,8 @@
-
-
-
-
搜索
+
+
-
-
- {{ article.title }}
- {{ article.summary }}
-
+
+
+
+ 暂无文章
+
-
-
+
+
+
+
+
+
+ 没有更多文章了
+
diff --git a/frontend/wechat/src/views/PurchasedArticles.vue b/frontend/wechat/src/views/PurchasedArticles.vue
index c7468c1..5565507 100644
--- a/frontend/wechat/src/views/PurchasedArticles.vue
+++ b/frontend/wechat/src/views/PurchasedArticles.vue
@@ -16,33 +16,21 @@ onMounted(async () => {
-
-
已购买的文章
-
-
+
+
已购买的文章
+
+
暂无已购买的文章
-
- {{ article.title }}
- {{ article.summary }}
-
+
+
{{ article.title }}
+
{{ article.summary }}
+
diff --git a/frontend/wechat/src/views/UserProfile.vue b/frontend/wechat/src/views/UserProfile.vue
index 838a703..cccd260 100644
--- a/frontend/wechat/src/views/UserProfile.vue
+++ b/frontend/wechat/src/views/UserProfile.vue
@@ -9,21 +9,21 @@ const userInfo = ref({
-
-
-
-
-
-
{{ userInfo.name }}
+
+
+
+
+
-
-
-
-
-
-
-
-
-
+
{{ userInfo.name }}
+
+
+
+
+ {{ item }}
+
+
+