This commit is contained in:
花有清香月有阴
2022-01-07 15:58:20 +08:00
parent 5859f1c8c9
commit 07da160ab8

View File

@@ -11,7 +11,7 @@
</u-form-item> </u-form-item>
<u-form-item label="发布地区" prop="areaId" required :border-bottom="false" right-icon="arrow-right" class="addresss"> <u-form-item label="发布地区" prop="areaId" required :border-bottom="false" right-icon="arrow-right" class="addresss">
<AiAreaPicker v-model="form.areaId" :areaId="user.areaId" @select="areaSelect" style="color: #666"></AiAreaPicker> <AiAreaPicker v-model="form.areaId" :areaId="user.areaId" :name.sync="form.areaName" @select="areaSelect" style="color: #666"></AiAreaPicker>
</u-form-item> </u-form-item>
<u-form-item label="议事截止时间" prop="discussDeadline" required :border-bottom="false" right-icon="arrow-right"> <u-form-item label="议事截止时间" prop="discussDeadline" required :border-bottom="false" right-icon="arrow-right">
@@ -39,7 +39,7 @@
<img src="./img/22.png" alt="" /> <img src="./img/22.png" alt="" />
<div class="rightopts"> <div class="rightopts">
<u-input v-model="content" placeholder="选项" maxlength="20" :clearable="false" /> <u-input v-model="content" placeholder="选项" maxlength="200" :clearable="false" />
</div> </div>
</div> </div>
</div> </div>
@@ -53,7 +53,7 @@
<img src="./img/22.png" alt="" /> <img src="./img/22.png" alt="" />
<div class="rightopts"> <div class="rightopts">
<u-input v-model="content" placeholder="选项" :clearable="false" maxlength="20" /> <u-input v-model="content" placeholder="选项" :clearable="false" maxlength="200" />
</div> </div>
</div> </div>
@@ -94,7 +94,11 @@ export default {
data() { data() {
return { return {
id: '', id: '',
form: { type: 0 }, form: {
type: 0,
areaId: '',
areaName: '',
},
flag: false, flag: false,
showStartTime: false, showStartTime: false,
showEndTime: false, showEndTime: false,
@@ -111,6 +115,7 @@ export default {
checked: true, checked: true,
list: [], list: [],
content: '', content: '',
keys: ['A', 'B', 'C', 'D', 'E', 'F', 'G'],
} }
}, },
computed: { ...mapState(['user']) }, computed: { ...mapState(['user']) },
@@ -147,14 +152,32 @@ export default {
if (!this.form.discussDeadline) { if (!this.form.discussDeadline) {
return this.$u.toast('请选择 议事截止时间') return this.$u.toast('请选择 议事截止时间')
} }
this.$http
.post(`/app/appvillagediscuss/addOrUpdate`, { if (this.opts == 1) {
...this.form, var lists = []
images: JSON.stringify(this.form.images), this.list.map((item, index) => {
id: this.id, item.content == item, item.item == this.keys[index]
lists.push({
content: item,
item: this.keys[index],
}) })
.then((res) => { })
if (res?.code == 0) { console.log(lists)
}
var params = {
...this.form,
// voteItems: this.list,
voteItems: lists,
anonymous: this.checked == true ? 1 : 0,
createUserId: this.user.id,
createUserName: this.user.name,
images: JSON.stringify(this.form.images),
voteType: this.opts,
}
this.$http.post(`/app/appvillagediscuss/addOrUpdate`, params).then((res) => {
if (res.code == 0) {
uni.$emit('update') uni.$emit('update')
this.$u.toast('发布成功') this.$u.toast('发布成功')
this.flag = true this.flag = true