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: {