diff --git a/src/apps/AppPageBasic/AppPageBasic.vue b/src/apps/AppPageBasic/AppPageBasic.vue index 60ab8280..77a6d885 100644 --- a/src/apps/AppPageBasic/AppPageBasic.vue +++ b/src/apps/AppPageBasic/AppPageBasic.vue @@ -20,7 +20,7 @@ export default { { name: '三务公开', icon: require('./img/shgk.png'), - url: '../AppServicePublic/AppServicePublic?moduleId=b03d1ea68c8449ecb00685644e3f0192' + url: '../AppServicePublic/AppServicePublic?moduleId=b03d1ea68c8449ecb00685644e3f0192&listName=三务公开' } ] } diff --git a/src/apps/AppPageCivilization/AppPageCivilization.vue b/src/apps/AppPageCivilization/AppPageCivilization.vue index 27fcd6af..b05a1f0e 100644 --- a/src/apps/AppPageCivilization/AppPageCivilization.vue +++ b/src/apps/AppPageCivilization/AppPageCivilization.vue @@ -20,12 +20,12 @@ export default { { name: '好人好事', icon: require('./img/hrhs.png'), - url: '../AppServicePublic/AppServicePublic?moduleId=5da220f3182047aba92d64ac08b93b55' + url: '../AppServicePublic/AppServicePublic?moduleId=5da220f3182047aba92d64ac08b93b55&listName=好人好事' }, { name: '五好家庭', icon: require('./img/whjt.png'), - url: '../AppServicePublic/AppServicePublic?moduleId=6afadf4cd44f4b73be29390b30ca88bb' + url: '../AppServicePublic/AppServicePublic?moduleId=6afadf4cd44f4b73be29390b30ca88bb&listName=五好家庭' } ] } diff --git a/src/apps/AppPageParty/AppPageParty.vue b/src/apps/AppPageParty/AppPageParty.vue index dc8d2303..c1c630c8 100644 --- a/src/apps/AppPageParty/AppPageParty.vue +++ b/src/apps/AppPageParty/AppPageParty.vue @@ -20,7 +20,7 @@ export default { { name: '党建要闻', icon: require('./img/djyw.png'), - url: '../AppServicePublic/AppServicePublic?moduleId=95f0f1c509e44d528069bc9f9dc19e53' + url: '../AppServicePublic/AppServicePublic?moduleId=95f0f1c509e44d528069bc9f9dc19e53&listName=党建要闻' }, { name: '党员学习', diff --git a/src/apps/AppServicePublic/Add.vue b/src/apps/AppServicePublic/Add.vue index 0916aad4..79ed31c4 100644 --- a/src/apps/AppServicePublic/Add.vue +++ b/src/apps/AppServicePublic/Add.vue @@ -6,18 +6,20 @@ - - - - - - + +
+ 请选择类别 + {{selectList[forms.showIndex].categoryName}} + +
+
- - - - + +
+ + +
@@ -48,16 +50,17 @@ export default { id: '', forms: { title: '', - status: '', - statusValue: '', content: '', fileIds: [], areaId: '', + showIndex: '', }, showStstus: false, flag: false, areaIdProps: '', - moduleId: '' + moduleId: '', + listName: '', + selectList: [] } }, computed: { ...mapState(['user']) }, @@ -65,27 +68,42 @@ export default { console.log(o) this.id = o.id this.moduleId = o.moduleId - this.areaIdProps = this.user.areaId - this.$dict.load('realityStatus').then(() => { - this.getDetail() - }) + this.forms.areaId = this.user.areaId + this.listName = o.listName + this.getType() }, mounted() {}, methods: { - // getDetail() { - // this.$http.post(`/app/appvisitvondolence/queryDetailById?id=${this.id}`).then((res) => { - // if (res?.data) { - // this.forms = res.data - // this.forms.statusValue = res.data.status - // this.forms.status = this.$dict.getLabel('realityStatus', res.data.status) - // if (res.data.images) { - // this.forms.images = JSON.parse(res.data.images || '[]') - // } - // } - // }) - // }, - + getDetail() { + this.$http.post(`/app/appcontentinfo/queryDetailById?id=${this.id}`).then((res) => { + if (res?.data) { + this.forms = {...res.data} + if(this.selectList.length) { + this.selectList.map((item, index) => { + if(item.id == res.data.categoryId) { + this.forms.showIndex = index + } + }) + } + if (res.data.images) { + this.forms.images = JSON.parse(res.data.images || '[]') + } + } + }) + }, + getType() { + this.$http.post(`/app/appcontentmoduleinfo/listByName?names=${this.listName}`).then((res) => { + if (res.code == 0) { + if(res.data && res.data[0].categoryList.length) { + this.selectList = res.data[0].categoryList + if(this.id) { + this.getDetail() + } + } + } + }) + }, submit() { if (this.flag) return @@ -98,6 +116,10 @@ export default { return this.$u.toast('请输入正文') } + if(this.selectList.length && this.forms.showIndex === '') { + return this.$u.toast('请选择类别') + } + const imgs = [] if (this.forms.fileIds) { this.forms.fileIds.map((e) => { @@ -106,22 +128,21 @@ export default { } this.flag = true - this.$http - .post(`/app/appvisitvondolence/addOrUpdate`, { + this.$http.post(`/app/appcontentinfo/addOrUpdate`, { title: this.forms.title, - status: this.forms.statusValue ? this.forms.statusValue : this.forms.status, areaId: this.forms.areaId, content: this.forms.content, - // images: JSON.stringify(imgs) || [], - images: imgs || [], + files: imgs || [], id: this.id, - moduleId: this.moduleId + moduleId: this.moduleId, + categoryId: this.selectList[this.forms.showIndex].id, + categoryName: this.selectList[this.forms.showIndex].categoryName, }) .then((res) => { if (res.code == 0) { this.$u.toast('发布成功') this.flag = false - uni.navigateTo({ url: `./AppServicePublic` }) + uni.navigateBack() } }) } else { @@ -135,8 +156,7 @@ export default { }, selectStatus(e) { - this.forms.status = e[0].label - this.forms.statusValue = e[0].value + this.forms.showIndex = e[0].value }, }, } @@ -185,5 +205,35 @@ export default { font-weight: 500; color: #ffffff; } + + .right{ + width: 100%; + text-align: right; + .right-icon{ + vertical-align: middle; + margin-left: 8px; + } + .area-right-icon{ + margin: -40px 0 0 8px; + } + ::v-deep .AiAreaPicker{ + display: inline-block; + width: calc(100% - 50px); + .areaSelector{ + div{ + width: 100%; + padding-top: 30px; + box-sizing: border-box; + text-align: right; + } + .fixedTop{ + text-align: left; + } + } + } + } + .color-999{ + color: #999; + } } diff --git a/src/apps/AppServicePublic/AppServicePublic.vue b/src/apps/AppServicePublic/AppServicePublic.vue index e774b5f5..9822d537 100644 --- a/src/apps/AppServicePublic/AppServicePublic.vue +++ b/src/apps/AppServicePublic/AppServicePublic.vue @@ -1,8 +1,13 @@