From f21acaa62a9da3f0dc96320009d5cdf263b5cc33 Mon Sep 17 00:00:00 2001 From: hejin Date: Wed, 13 Aug 2025 23:25:44 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BA=A7=E5=93=81=E5=88=86=E9=A1=B5=E5=92=8C?= =?UTF-8?q?=E6=96=87=E7=AB=A0=E5=88=86=E7=B1=BB=E5=A2=9E=E5=8A=A0=E6=98=BE?= =?UTF-8?q?=E7=A4=BA=E5=AF=8C=E6=96=87=E6=9C=AC=E6=A8=A1=E5=9D=97=EF=BC=9B?= =?UTF-8?q?=E5=A2=9E=E5=8A=A0=E5=90=8E=E5=8F=B0=E4=BA=A7=E5=93=81=E5=92=8C?= =?UTF-8?q?=E6=96=87=E7=AB=A0=E8=AF=A6=E6=83=85=E9=A2=84=E8=A7=88=E9=A1=B5?= =?UTF-8?q?=E9=9D=A2?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- pages/admin-preview/article-page/_id.vue | 217 +++++++++++ pages/admin-preview/products/_id.vue | 440 +++++++++++++++++++++++ pages/article-page/index.vue | 22 +- pages/products/index.vue | 18 +- 4 files changed, 694 insertions(+), 3 deletions(-) create mode 100644 pages/admin-preview/article-page/_id.vue create mode 100644 pages/admin-preview/products/_id.vue diff --git a/pages/admin-preview/article-page/_id.vue b/pages/admin-preview/article-page/_id.vue new file mode 100644 index 0000000..49732d7 --- /dev/null +++ b/pages/admin-preview/article-page/_id.vue @@ -0,0 +1,217 @@ + + + + + \ No newline at end of file diff --git a/pages/admin-preview/products/_id.vue b/pages/admin-preview/products/_id.vue new file mode 100644 index 0000000..9345c68 --- /dev/null +++ b/pages/admin-preview/products/_id.vue @@ -0,0 +1,440 @@ + + + + + + + \ No newline at end of file diff --git a/pages/article-page/index.vue b/pages/article-page/index.vue index 5e3f072..3219a2b 100644 --- a/pages/article-page/index.vue +++ b/pages/article-page/index.vue @@ -1,6 +1,7 @@ @@ -40,6 +41,14 @@ export default { }, } }, + computed: { + prodUp() { + return this.$store.state.device === '手机端' ? this.catgInfo.prodUpApp : this.catgInfo.prodUp + }, + prodDown() { + return this.$store.state.device === '手机端' ? this.catgInfo.prodDownApp : this.catgInfo.prodDown + } + }, async asyncData({$axios,query}) { let params = { pageNum: query.pageNum || 1, @@ -48,8 +57,17 @@ export default { } let {data: pordObj} = await $axios('/web/newsPageList', {params}) + let catgInfo = {} + if (params.catgId) { + var {data: catgInfoRes} = await $axios.get(`/web/categoryInfo?id=${query.catgId || query.maxCatgId ||''}`) + catgInfo = catgInfoRes + } + console.log(catgInfo); + + return { - pordObj + pordObj, + catgInfo } }, diff --git a/pages/products/index.vue b/pages/products/index.vue index 29a5948..f5c7730 100644 --- a/pages/products/index.vue +++ b/pages/products/index.vue @@ -1,6 +1,7 @@ @@ -35,17 +37,31 @@ export default { }, } }, + computed: { + prodUp() { + return this.$store.state.device === '手机端' ? this.catgInfo.prodUpApp : this.catgInfo.prodUp + }, + prodDown() { + return this.$store.state.device === '手机端' ? this.catgInfo.prodDownApp : this.catgInfo.prodDown + } + }, async asyncData({$axios,query}) { let params = { pageNum: query.pageNum || 1, pageSize: 9, catgId: query.catgId || query.maxCatgId ||'', } - let {data: pordObj} = await $axios('/web/prodPageList', {params}) + let {data: pordObj} = await $axios.get('/web/prodPageList', {params}) + let catgInfo = {} + if (params.catgId) { + var {data: catgInfoRes} = await $axios.get(`/web/categoryInfo?id=${query.catgId || query.maxCatgId ||''}`) + catgInfo = catgInfoRes + } return { pordObj, maxCatgId: query.maxCatgId || '', + catgInfo } }, methods: {