This commit is contained in:
liuye
2021-12-23 15:49:49 +08:00
parent 074500710e
commit d02c703838
2 changed files with 27 additions and 15 deletions

View File

@@ -8,11 +8,11 @@
<u-form-item label="类别" prop="status" required> <u-form-item label="类别" prop="status" required>
<div class="right" @click="showStstus=true"> <div class="right" @click="showStstus=true">
<span v-if="forms.showIndex === ''" class="color-999">请选择类别</span> <span v-if="forms.selectIndex === ''" class="color-999">请选择类别</span>
<span v-else>{{selectList[forms.showIndex].categoryName}}</span> <span v-else>{{selectList[forms.selectIndex].categoryName}}</span>
<u-icon name="arrow-right" color="#CCCCCC" class="right-icon"></u-icon> <u-icon name="arrow-right" color="#CCCCCC" class="right-icon"></u-icon>
</div> </div>
<u-select v-model="showStstus" :list="selectList" value-name="showIndex" label-name="categoryName" @confirm="selectStatus"></u-select> <u-select v-model="showStstus" :list="selectList" value-name="selectIndex" label-name="categoryName" @confirm="selectStatus"></u-select>
</u-form-item> </u-form-item>
<u-form-item label="发布地区" prop="areaId" required > <u-form-item label="发布地区" prop="areaId" required >
@@ -31,6 +31,7 @@
</u-form-item> </u-form-item>
</u-form> </u-form>
</div> </div>
<div class="pad-b112"></div>
<div class="btn" @click="submit">保存</div> <div class="btn" @click="submit">保存</div>
@@ -53,7 +54,7 @@ export default {
content: '', content: '',
fileIds: [], fileIds: [],
areaId: '', areaId: '',
showIndex: '', selectIndex: '',
}, },
showStstus: false, showStstus: false,
flag: false, flag: false,
@@ -82,7 +83,7 @@ export default {
if(this.selectList.length) { if(this.selectList.length) {
this.selectList.map((item, index) => { this.selectList.map((item, index) => {
if(item.id == res.data.categoryId) { if(item.id == res.data.categoryId) {
this.forms.showIndex = index this.forms.selectIndex = index
} }
}) })
} }
@@ -97,6 +98,9 @@ export default {
if (res.code == 0) { if (res.code == 0) {
if(res.data && res.data[0].categoryList.length) { if(res.data && res.data[0].categoryList.length) {
this.selectList = res.data[0].categoryList this.selectList = res.data[0].categoryList
this.selectList.map((item, index) => {
item.selectIndex = index
})
if(this.id) { if(this.id) {
this.getDetail() this.getDetail()
} }
@@ -116,7 +120,7 @@ export default {
return this.$u.toast('请输入正文') return this.$u.toast('请输入正文')
} }
if(this.selectList.length && this.forms.showIndex === '') { if(this.selectList.length && this.forms.selectIndex === '') {
return this.$u.toast('请选择类别') return this.$u.toast('请选择类别')
} }
@@ -135,14 +139,17 @@ export default {
files: imgs || [], files: imgs || [],
id: this.id, id: this.id,
moduleId: this.moduleId, moduleId: this.moduleId,
categoryId: this.selectList[this.forms.showIndex].id, categoryId: this.selectList[this.forms.selectIndex].id,
categoryName: this.selectList[this.forms.showIndex].categoryName, categoryName: this.selectList[this.forms.selectIndex].categoryName,
}) })
.then((res) => { .then((res) => {
if (res.code == 0) { if (res.code == 0) {
uni.$emit('update')
this.$u.toast('发布成功') this.$u.toast('发布成功')
this.flag = false this.flag = false
uni.navigateBack() setTimeout(() => {
uni.navigateBack()
}, 600)
} }
}) })
} else { } else {
@@ -156,7 +163,7 @@ export default {
}, },
selectStatus(e) { selectStatus(e) {
this.forms.showIndex = e[0].value this.forms.selectIndex = e[0].value
}, },
}, },
} }
@@ -165,8 +172,6 @@ export default {
<style lang="scss" scoped> <style lang="scss" scoped>
.add { .add {
height: 100%; height: 100%;
padding-bottom: 112px;
.header-description { .header-description {
::v-deep .u-form { ::v-deep .u-form {
.u-form-item { .u-form-item {
@@ -192,6 +197,9 @@ export default {
} }
} }
} }
.pad-b112{
padding-bottom: 224px;
}
.btn { .btn {
position: fixed; position: fixed;
@@ -204,6 +212,7 @@ export default {
font-size: 32px; font-size: 32px;
font-weight: 500; font-weight: 500;
color: #ffffff; color: #ffffff;
z-index: 999;
} }
.right{ .right{

View File

@@ -92,8 +92,10 @@ export default {
this.listName = o.listName this.listName = o.listName
this.getType() this.getType()
this.getList() this.getList()
uni.$on('update' , () => {
this.getList()
})
}, },
mounted() {},
methods: { methods: {
getType() { getType() {
this.$http.post(`/app/appcontentmoduleinfo/listByName?names=${this.listName}`).then((res) => { this.$http.post(`/app/appcontentmoduleinfo/listByName?names=${this.listName}`).then((res) => {
@@ -158,8 +160,9 @@ export default {
}, },
delet() { delet() {
this.$http.post(`/app/appvisitvondolence/delete?ids=${this.deletId}`).then((res) => { this.$http.post(`/app/appcontentinfo/delete?ids=${this.deletId}`).then((res) => {
if (res.code == 0) { if (res.code == 0) {
this.current = 1
this.$u.toast('删除成功!') this.$u.toast('删除成功!')
this.getList() this.getList()
} }
@@ -210,7 +213,7 @@ uni-page-body {
} }
} }
.iconfont-iconMore{ .iconfont-iconMore{
margin-top: 8px; // margin-top: 8px;
} }
.AppServicePublic { .AppServicePublic {
height: 100%; height: 100%;