学习问答
This commit is contained in:
@@ -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)
|
||||
}
|
||||
})
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user