学习问答
This commit is contained in:
@@ -1,17 +1,17 @@
|
||||
<template>
|
||||
<div class="answerAdd">
|
||||
<div class="input_box">
|
||||
<u-input v-model="value" type="textarea" height="580" maxlength="10000"
|
||||
<u-input v-model="form.content" type="textarea" height="580" maxlength="10000"
|
||||
:clearable="false" placeholder="请输入回答内容" :auto-height="true" placeholder-style="color: '#AAAAAA';font-size: 16px" />
|
||||
</div>
|
||||
|
||||
<div class="upload">
|
||||
<h4>图片上传<span>(最多9张)</span></h4>
|
||||
<AiUploader :def.sync="form.url" multiple placeholder="上传图片" :limit="9" action="/admin/file/add2"></AiUploader>
|
||||
<AiUploader :def.sync="form.files" multiple placeholder="上传图片" :limit="9" action="/admin/file/add2"></AiUploader>
|
||||
</div>
|
||||
|
||||
<div class="submitBtn">
|
||||
<div class="btn">提交</div>
|
||||
<div class="btn" @click="submit">提交</div>
|
||||
</div>
|
||||
</div>
|
||||
</template>
|
||||
@@ -22,16 +22,43 @@ export default {
|
||||
appName: "进行回答",
|
||||
data() {
|
||||
return {
|
||||
value: '',
|
||||
form: {
|
||||
url: []
|
||||
}
|
||||
qid: '',
|
||||
content: '',
|
||||
files: []
|
||||
},
|
||||
flag: false,
|
||||
|
||||
}
|
||||
},
|
||||
methods: {
|
||||
|
||||
submit() {
|
||||
if(this.flag) return
|
||||
|
||||
if(!this.form.content) {
|
||||
return this.$u.toast('请输入回答内容')
|
||||
}
|
||||
this.flag = true
|
||||
this.$http.post(`/app/applearningquestion/addOrUpdateAnswer`, {
|
||||
...this.form
|
||||
}).then(res=> {
|
||||
if(res?.code==0) {
|
||||
this.$u.toast('提交成功!')
|
||||
setTimeout(()=> {
|
||||
uni.navigateBack()
|
||||
}, 500)
|
||||
}
|
||||
})
|
||||
}
|
||||
},
|
||||
onLoad(o) {
|
||||
if(o.qid) {
|
||||
this.form.qid = o?.qid
|
||||
}
|
||||
if(o.data) {
|
||||
this.form = JSON.parse(o?.data)
|
||||
}
|
||||
},
|
||||
onShow() {},
|
||||
}
|
||||
</script>
|
||||
|
||||
|
||||
Reference in New Issue
Block a user