From 4b708b830fd8052709d1a608feed752d98955e0a Mon Sep 17 00:00:00 2001 From: huliyong <2783385703@qq.com> Date: Wed, 25 Sep 2024 19:44:47 +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 --- pages.json | 3 +- pages/index/index.vue | 1 + pages/publish/actorDetail.vue | 16 +++- pages/publish/actorRelease.vue | 107 +++++++++++++++++++----- pages/publish/publishPost.vue | 50 +++++++++-- pages_mine/mine/promotionRecord.vue | 26 ++++-- pages_mine/mine/releaseRecord.vue | 24 ++++-- pages_mine/mine/sonPage/release/releaseList.vue | 48 ++++++++++- pages_mine/publish/addWorks.vue | 53 +++++++++++- pages_mine/publish/competition.vue | 1 + 10 files changed, 276 insertions(+), 53 deletions(-) diff --git a/pages.json b/pages.json index e0396d6..9542b4b 100644 --- a/pages.json +++ b/pages.json @@ -46,8 +46,7 @@ { "path": "pages/index/center", "style": { - "navigationBarTitleText": "", - "enablePullDownRefresh" : true + "navigationBarTitleText": "" } }, { diff --git a/pages/index/index.vue b/pages/index/index.vue index b28b581..c026699 100644 --- a/pages/index/index.vue +++ b/pages/index/index.vue @@ -149,6 +149,7 @@ } }, onPullDownRefresh(){ + this.queryParams.pageNo = 1 this.indexGetTrendsPage() this.getData() }, diff --git a/pages/publish/actorDetail.vue b/pages/publish/actorDetail.vue index 0261e61..6e693b0 100644 --- a/pages/publish/actorDetail.vue +++ b/pages/publish/actorDetail.vue @@ -66,8 +66,11 @@ + + {{ item.details.workName[index] || '' }} + @@ -85,7 +88,7 @@ style="width: 150rpx;height: 150rpx;" mode=""> - 请支付10元,10小时内可查看任意联系方式 + 请支付{{ item.details.price }}元,10小时内可查看任意联系方式 @@ -147,6 +150,15 @@ }, res => { uni.stopPullDownRefresh() if(res.code == 200){ + + res.result.details.isImage = + res.result.details.isImage ? + res.result.details.isImage.split(',') : [], + + res.result.details.workName = + res.result.details.workName ? + res.result.details.workName.split(',') : [] + this.item = res.result } }) diff --git a/pages/publish/actorRelease.vue b/pages/publish/actorRelease.vue index ceff2a2..c764e81 100644 --- a/pages/publish/actorRelease.vue +++ b/pages/publish/actorRelease.vue @@ -120,6 +120,7 @@ @@ -135,6 +136,7 @@ @@ -164,7 +166,8 @@ - + { + if (res.code == 200) { + + res.result.details.image.split(',') + .forEach(url => { + self.fileListImage.push({ + url + }) + }) + + res.result.details.isImage.split(',') + .forEach(url => { + self.fileList.push({ + url + }) + }) + + res.result.details.workName && res.result.details.workName.split(',') + .forEach(title => { + self.inputs.push({ + title + }) + }) + + res.result.details.topId = res.result.details.topId || 0 + + this.form = res.result.details + } + }) + }, // 获取置顶方式 indexTopPayList() { this.$api('indexTopPayList', res => { @@ -286,21 +334,33 @@ let self = this let data = { - ...this.form, + // ...this.form, + money: this.form.money, + name : this.form.name, + phone : this.form.phone, + isUser : this.form.isUser,//是否本人发布 + phonePay : this.form.phonePay,//联系方式是否付费查看 + photographerContent : this.form.photographerContent,//演员介绍 + topId : this.form.topId, + + state : 0, isCard: 'N', isImage : this.fileList.map((item) => item.url).join(","),//代表作视频列表 image : this.fileListImage.map((item) => item.url).join(","),//封面 - // 字段名称待确认 - titles : this.inputs.map((item) => item.title).join(","),//代表作名称列表 + workName : this.inputs.map((item) => item.title).join(","),//代表作名称列表 isTop : this.form.topId ? 'Y' : 'N', } + + if(this.id){ + data.id = this.id + } this.$api('publishActor', data, res => { if (res.code == 200) { // this.$refs.confirmationPopupUpload.open() - if(self.form.topId){ + if(self.form.topId && !this.id){ uni.requestPayment({ provider: 'wxpay', // 服务提提供商 timeStamp: res.result.timeStamp, // 时间戳 @@ -330,6 +390,7 @@ }, submit() { + if(this.fileListImage.length == 0){ return uni.showToast({ title: '请上传封面', @@ -337,6 +398,23 @@ }) } + + if(!this.$utils.verificationPhone(this.form.phone)){ + return uni.showToast({ + title: `请输入正确的手机号`, + icon : 'none' + }) + } + + if (this.$utils.verificationAll(this.form, { + name: '请输入演员名称', + photographerContent: '请输入演员介绍', + phone: '请输入手机号', + money: '请输入价格', + })) { + return + } + if(this.fileList.length == 0){ return uni.showToast({ title: '请上传代表作', @@ -353,17 +431,7 @@ } } - - if (this.$utils.verificationAll(this.form, { - name: '请输入演员名称', - photographerContent: '请输入演员介绍', - phone: '请输入手机号', - money: '请输入价格', - })) { - return - } - - if(this.form.topId){ + if(this.form.topId && !this.id){ // 选择付费模式 this.$refs.confirmationPopup.open() }else{ @@ -373,9 +441,10 @@ }, confirm() { // this.$refs.confirmationPopupUpload.close() - uni.navigateTo({ - url: "/pages/index/index" - }) + // uni.navigateTo({ + // url: "/pages/index/index" + // }) + uni.navigateBack(-1) }, } } diff --git a/pages/publish/publishPost.vue b/pages/publish/publishPost.vue index 4c4c6c4..e9f78da 100644 --- a/pages/publish/publishPost.vue +++ b/pages/publish/publishPost.vue @@ -46,6 +46,7 @@ @@ -60,6 +61,7 @@ @@ -78,7 +80,7 @@ @submit="submit" @preview="preview" @draft="draft" - submitTitle="发布帖子" + :submitTitle="id ? '修改帖子' : '发布帖子'" /> { + if (res.code == 200) { + + res.result.details.image.split(',') + .forEach(url => { + self.fileList.push({ + url + }) + }) + + res.result.details.topId = res.result.details.topId || 0 + + this.form = res.result.details + } + }) + }, deleteImage(e){ this.fileList.splice(e.index, 1) }, @@ -182,16 +214,24 @@ let self = this let data = { - ...this.form, + // ...this.form, + content : this.form.content, + topId : this.form.topId, + title : this.form.title, isCard : 'Y', + state : 0, image : this.fileList.map((item) => item.url).join(","), isTop : this.form.topId ? 'Y' : 'N', } + if(this.id){ + data.id = this.id + } + this.$api('infoReleaseTrends', data, res => { if(res.code == 200){ - if(self.form.topId){ + if(self.form.topId && !this.id){ uni.requestPayment({ provider: 'wxpay', // 服务提提供商 timeStamp: res.result.timeStamp, // 时间戳 @@ -239,7 +279,7 @@ return } - if(this.form.topId){ + if(this.form.topId && !this.id){ // 选择付费模式 this.$refs.confirmationPopup.open() }else{ diff --git a/pages_mine/mine/promotionRecord.vue b/pages_mine/mine/promotionRecord.vue index 93441bb..81ae6ab 100644 --- a/pages_mine/mine/promotionRecord.vue +++ b/pages_mine/mine/promotionRecord.vue @@ -12,12 +12,21 @@ + + + + - + + 开始时间 {{ queryParams.startDate }} @@ -28,7 +37,7 @@ - + 结束时间 {{ queryParams.endDate }} @@ -39,7 +48,7 @@ - + --> @@ -70,9 +79,10 @@ queryParams: { pageNo: 1, pageSize: 10, - startDate: dayjs(new Date()).subtract(30,'day').format('YYYY-MM-DD'), - endDate: dayjs(new Date()).format('YYYY-MM-DD'), - keyWord: '', + // startDate: dayjs(new Date()).subtract(30,'day').format('YYYY-MM-DD'), + // endDate: dayjs(new Date()).format('YYYY-MM-DD'), + // keyWord: '', + title : '', }, } }, @@ -104,7 +114,7 @@ }) }, keyWordChange(val) { - this.queryParams.keyWord = val + // this.queryParams.keyWord = val this.getData() }, diff --git a/pages_mine/mine/releaseRecord.vue b/pages_mine/mine/releaseRecord.vue index d90033c..80b221b 100644 --- a/pages_mine/mine/releaseRecord.vue +++ b/pages_mine/mine/releaseRecord.vue @@ -11,15 +11,23 @@ - - 全部 + + {{ item }} - + @@ -43,18 +51,15 @@ data() { return { recordsList: [], - total: 0, + total: 0, checkedIndex: 0, queryParams: { pageNo: 1, pageSize: 10, }, - + tabs : ['帖子', '名片', '作品'], }; }, - mounted() { - this.getData() - }, onReachBottom() { console.log("===我的发布页面到底部了,开始加载数据===") let allTotal = this.queryParams.pageNo * this.queryParams.pageSize @@ -72,6 +77,7 @@ // this.$refs.showLogin.checkLogin() // 获取用户个人信息 this.$store.commit('getUserInfo') + this.getData() }, methods: { getData() { @@ -79,7 +85,7 @@ pageNo: this.queryParams.pageNo, pageSize: this.queryParams.pageSize, // 缺少type参数,需要补充 - state: this.checkedIndex + type: this.checkedIndex }, res => { if (res.code == 200) { this.recordsList = res.result.records diff --git a/pages_mine/mine/sonPage/release/releaseList.vue b/pages_mine/mine/sonPage/release/releaseList.vue index 0dca165..7fead91 100644 --- a/pages_mine/mine/sonPage/release/releaseList.vue +++ b/pages_mine/mine/sonPage/release/releaseList.vue @@ -4,7 +4,7 @@ - {{ item.title }} + {{ item.title || item.name }} @@ -16,6 +16,11 @@ 是否付费:{{ item.isPay=='Y'?"是":"否" }} + + + 状态:{{ state[item.state] }} + + 发布时间:{{ item.createTime }} @@ -36,6 +41,7 @@ pageSize: 5, }, checkedIndex: 0, + state : ['待审核', '审核通过', '审核不通过,请编辑后重新提交'], }; }, onShow() { @@ -65,15 +71,49 @@ }) }, gotoDetail(item) { + + // 待审核 + if(item.state == 0){ + return uni.showToast({ + title: '审核中', + icon:'none' + }) + } + + // 审核不通过,请编辑后重新提交 + if(item.state == 2){ + // 根据字段区分跳转到不同页面 + if (item.isCard == 'Y') { + // 跳转到动态(贴子)发布页面 + uni.navigateTo({ + url: '/pages/publish/publishPost?id=' + item.id + }) + } else if(item.phone) { + // 跳转到演员(名片)发布页面 + uni.navigateTo({ + url: '/pages/publish/actorRelease?id=' + item.id + }) + }else{ + // 跳转到作品发布页面 + uni.navigateTo({ + url: '/pages_mine/publish/addWorks?id=' + item.id + }) + } + return + } + // 根据字段区分跳转到不同页面 if (item.isCard == 'Y') { // 跳转到动态(贴子)详情页面 - console.log("跳转到动态(贴子)详情页面") this.$utils.navigateTo('/publish/postDetail?id=' + item.id) - } else { + } else if(item.phone) { // 跳转到演员(名片)详情页面 - console.log("跳转到演员(名片)详情页面") this.$utils.navigateTo('/publish/actorDetail?id=' + item.id) + }else{ + // 跳转到作品详情页面 + uni.navigateTo({ + url: '/pages_mine/publish/worksDetail?id=' + item.id + }) } } } diff --git a/pages_mine/publish/addWorks.vue b/pages_mine/publish/addWorks.vue index aa2dbe4..f1ac82a 100644 --- a/pages_mine/publish/addWorks.vue +++ b/pages_mine/publish/addWorks.vue @@ -101,7 +101,8 @@ - +