diff --git a/src/apps/AppServicePublic/Add.vue b/src/apps/AppServicePublic/Add.vue
index 79ed31c4..d3699e2a 100644
--- a/src/apps/AppServicePublic/Add.vue
+++ b/src/apps/AppServicePublic/Add.vue
@@ -8,11 +8,11 @@
- 请选择类别
- {{selectList[forms.showIndex].categoryName}}
+ 请选择类别
+ {{selectList[forms.selectIndex].categoryName}}
-
+
@@ -31,6 +31,7 @@
+
保存
@@ -53,7 +54,7 @@ export default {
content: '',
fileIds: [],
areaId: '',
- showIndex: '',
+ selectIndex: '',
},
showStstus: false,
flag: false,
@@ -82,7 +83,7 @@ export default {
if(this.selectList.length) {
this.selectList.map((item, index) => {
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.data && res.data[0].categoryList.length) {
this.selectList = res.data[0].categoryList
+ this.selectList.map((item, index) => {
+ item.selectIndex = index
+ })
if(this.id) {
this.getDetail()
}
@@ -116,7 +120,7 @@ export default {
return this.$u.toast('请输入正文')
}
- if(this.selectList.length && this.forms.showIndex === '') {
+ if(this.selectList.length && this.forms.selectIndex === '') {
return this.$u.toast('请选择类别')
}
@@ -135,14 +139,17 @@ export default {
files: imgs || [],
id: this.id,
moduleId: this.moduleId,
- categoryId: this.selectList[this.forms.showIndex].id,
- categoryName: this.selectList[this.forms.showIndex].categoryName,
+ categoryId: this.selectList[this.forms.selectIndex].id,
+ categoryName: this.selectList[this.forms.selectIndex].categoryName,
})
.then((res) => {
if (res.code == 0) {
+ uni.$emit('update')
this.$u.toast('发布成功')
this.flag = false
- uni.navigateBack()
+ setTimeout(() => {
+ uni.navigateBack()
+ }, 600)
}
})
} else {
@@ -156,7 +163,7 @@ export default {
},
selectStatus(e) {
- this.forms.showIndex = e[0].value
+ this.forms.selectIndex = e[0].value
},
},
}
@@ -165,8 +172,6 @@ export default {