From f86d8e434c64a9ce29a85aa34cb41432e1c090a7 Mon Sep 17 00:00:00 2001 From: huliyong <2783385703@qq.com> Date: Wed, 11 Sep 2024 00:37:48 +0800 Subject: [PATCH] =?UTF-8?q?=E4=B8=8A=E4=BC=A0=E4=BB=A3=E7=A0=81?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- api/api.js | 6 + pages.json | 30 +- pages/index/index.vue | 2 +- pages/publish/actorDetail.vue | 19 +- pages/publish/actorList.vue | 7 +- pages_mine/publish/addWorks.vue | 365 +++++++++++++++++++++ {pages => pages_mine}/publish/competition.vue | 9 +- pages_mine/publish/worksDetail.vue | 187 +++++++++++ .../image => pages_mine/static}/competition/1.png | Bin .../image => pages_mine/static}/competition/k.png | Bin utils/utils.js | 4 +- 11 files changed, 599 insertions(+), 30 deletions(-) create mode 100644 pages_mine/publish/addWorks.vue rename {pages => pages_mine}/publish/competition.vue (95%) create mode 100644 pages_mine/publish/worksDetail.vue rename {static/image => pages_mine/static}/competition/1.png (100%) rename {static/image => pages_mine/static}/competition/k.png (100%) diff --git a/api/api.js b/api/api.js index 92f4c18..077b278 100644 --- a/api/api.js +++ b/api/api.js @@ -60,6 +60,12 @@ const config = { method: 'GET', showLoading : true, }, + //获取作品详情 + indexGetGetWorkDetail: { + url: '/api/index/getWorkDetail', + method: 'GET', + showLoading : true, + }, //获取置顶列表 indexTopPayList: { url: '/api/index/getTopPayList', diff --git a/pages.json b/pages.json index 8faaa54..508a03c 100644 --- a/pages.json +++ b/pages.json @@ -5,12 +5,6 @@ "navigationBarTitleText": "" } }, - { - "path": "pages/publish/competition", - "style": { - "navigationBarTitleText": "" - } - }, { "path": "pages/auth/login", "style": { @@ -72,6 +66,12 @@ } } ], + "preloadRule" : { + "pages/index/index" : { + "network" : "all", + "packages" : ["pages_mine"] + } + }, "subPackages": [{ "root": "pages_mine", "pages": [{ @@ -170,6 +170,24 @@ "style": { "navigationBarTitleText": "" } + }, + { + "path": "publish/worksDetail", + "style": { + "navigationBarTitleText": "" + } + }, + { + "path": "publish/competition", + "style": { + "navigationBarTitleText": "" + } + }, + { + "path": "publish/addWorks", + "style": { + "navigationBarTitleText": "" + } } ] }], diff --git a/pages/index/index.vue b/pages/index/index.vue index 745c235..60bb20e 100644 --- a/pages/index/index.vue +++ b/pages/index/index.vue @@ -162,7 +162,7 @@ bannerClick(index){ console.log(index); uni.navigateTo({ - url: '/pages/publish/competition' + url: '/pages_mine/publish/competition' }) } } diff --git a/pages/publish/actorDetail.vue b/pages/publish/actorDetail.vue index 1dcb6cf..e2dc506 100644 --- a/pages/publish/actorDetail.vue +++ b/pages/publish/actorDetail.vue @@ -53,7 +53,7 @@ v-for="(t, index) in item.isImage && item.isImage.split(',')" :key="index"> - @@ -82,14 +82,10 @@ onLoad(options) { // this.$route.query的参数 this.getData(options.id) - // this.getList() }, //滚动到屏幕底部 onReachBottom() { - // if(this.queryParams.pageSize < this.total){ - // this.queryParams.pageSize += 10 - // this.getList() - // } + }, methods: { leftClick(){ @@ -104,17 +100,6 @@ } }) }, - getList(){ - this.$api('indexGetGetWorkPage', { - token : uni.getStorageSync('token'), - ...this.queryParams - }, res => { - if(res.code == 200){ - this.list = res.result.records - this.total = res.result.total - } - }) - } } } diff --git a/pages/publish/actorList.vue b/pages/publish/actorList.vue index 337a157..7b82b37 100644 --- a/pages/publish/actorList.vue +++ b/pages/publish/actorList.vue @@ -39,14 +39,17 @@ return { actorList : [], total : 0, + queryParams: { + pageNo: 1, + pageSize: 10 + }, } }, onShow() { this.getData() }, onReachBottom(){ - let allTotal = this.queryParams.pageNo * this.queryParams.pageSize - if(allTotal < this.total){ + if(this.queryParams.pageSize < this.total){ //当前条数小于总条数 则增加请求数 this.queryParams.pageSize += 10 this.getData() //调用加载数据方法 diff --git a/pages_mine/publish/addWorks.vue b/pages_mine/publish/addWorks.vue new file mode 100644 index 0000000..f3081a8 --- /dev/null +++ b/pages_mine/publish/addWorks.vue @@ -0,0 +1,365 @@ + + + + + \ No newline at end of file diff --git a/pages/publish/competition.vue b/pages_mine/publish/competition.vue similarity index 95% rename from pages/publish/competition.vue rename to pages_mine/publish/competition.vue index 3be92f6..e59ff5f 100644 --- a/pages/publish/competition.vue +++ b/pages_mine/publish/competition.vue @@ -15,7 +15,7 @@ - + @@ -36,7 +36,7 @@ - + 暂无作品,发布第一个作品吧 ~ @@ -47,6 +47,7 @@ {{ index + 1 }} @@ -88,7 +89,9 @@ - + 发布作品 diff --git a/pages_mine/publish/worksDetail.vue b/pages_mine/publish/worksDetail.vue new file mode 100644 index 0000000..3de003d --- /dev/null +++ b/pages_mine/publish/worksDetail.vue @@ -0,0 +1,187 @@ + + + + + \ No newline at end of file diff --git a/static/image/competition/1.png b/pages_mine/static/competition/1.png similarity index 100% rename from static/image/competition/1.png rename to pages_mine/static/competition/1.png diff --git a/static/image/competition/k.png b/pages_mine/static/competition/k.png similarity index 100% rename from static/image/competition/k.png rename to pages_mine/static/competition/k.png diff --git a/utils/utils.js b/utils/utils.js index 0314556..5e2d81e 100644 --- a/utils/utils.js +++ b/utils/utils.js @@ -118,7 +118,9 @@ function params(url){ url } - data.url = '/pages' + data.url + if(!data.url.includes('/pages')){ + data.url = '/pages' + data.url + } return data }