学习问答

This commit is contained in:
yanran200730
2023-01-11 09:58:04 +08:00
parent 4fcc643a09
commit e59cc375d1
4 changed files with 133 additions and 14 deletions

View File

@@ -1,9 +1,9 @@
<template>
<div class="add">
<textarea placeholder="请输入回答内容" :maxlength="500"></textarea>
<textarea placeholder="请输入" :maxlength="500" v-model="content"></textarea>
<div class="answer-btn">
<div>提问</div>
<div @click="submit">提问</div>
</div>
</div>
</template>
@@ -14,7 +14,29 @@
data () {
return {
content: ''
}
},
methods: {
submit () {
if (!this.content) {
return this.$u.toast('请输入题目内容')
}
this.$loading()
this.$http.post(`/app/applearningquestion/addOrUpdate`, {
content: this.content
}).then(res => {
if (res.code == 0) {
this.$u.toast('提交成功')
uni.$emit('update')
setTimeout(() => {
uni.navigateTo()
}, 500)
}
})
}
}
}