bug
This commit is contained in:
@@ -14,11 +14,28 @@
|
||||
|
||||
data () {
|
||||
return {
|
||||
id: '',
|
||||
content: ''
|
||||
}
|
||||
},
|
||||
|
||||
onLoad (query) {
|
||||
if (query.id) {
|
||||
this.id = query.id
|
||||
|
||||
this.getInfo(query.id)
|
||||
}
|
||||
},
|
||||
|
||||
methods: {
|
||||
getInfo (id) {
|
||||
this.$http.post(`/app/applearningquestion/queryDetailById?id=${id}`).then(res => {
|
||||
if (res.code == 0) {
|
||||
this.content = res.data.content
|
||||
}
|
||||
})
|
||||
},
|
||||
|
||||
submit () {
|
||||
if (!this.content) {
|
||||
return this.$u.toast('请输入题目内容')
|
||||
@@ -26,7 +43,8 @@
|
||||
|
||||
this.$loading()
|
||||
this.$http.post(`/app/applearningquestion/addOrUpdate`, {
|
||||
content: this.content
|
||||
content: this.content,
|
||||
id: this.id || ''
|
||||
}).then(res => {
|
||||
if (res.code == 0) {
|
||||
this.$u.toast('提交成功')
|
||||
|
||||
@@ -9,18 +9,18 @@
|
||||
<div class="list-wrapper">
|
||||
<div class="item" v-for="(item, index) in list" :key="index" @click="linkTo('./answerList?id=' + item.id)">
|
||||
<div class="item-title">
|
||||
<i>我 </i>
|
||||
<i>{{ item.createUserId === user.id ? '我' : item.createUserName }} </i>
|
||||
<span>于{{ item.createTime }} 提问</span>
|
||||
</div>
|
||||
<p>{{ item.content }}</p>
|
||||
<div class="item-bottom">
|
||||
<div class="left">
|
||||
<span>共</span>
|
||||
<i>0</i>
|
||||
<i>{{ item.answerCount }}</i>
|
||||
<span>条回答</span>
|
||||
</div>
|
||||
<div class="right">
|
||||
<span @click.stop="linkTo('./answerList')">修改问题</span>
|
||||
<span @click.stop="linkTo('./Add?id=' + item.id)" v-if="item.createUserId === user.id && item.answerCount === 0">修改问题</span>
|
||||
<span @click.stop="linkTo('./answerAdd')">去回答</span>
|
||||
</div>
|
||||
</div>
|
||||
@@ -34,20 +34,27 @@
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import { mapState } from 'vuex'
|
||||
|
||||
export default {
|
||||
data () {
|
||||
return {
|
||||
search: {
|
||||
current: 1,
|
||||
title: '',
|
||||
size: 20
|
||||
size: 10
|
||||
},
|
||||
isMore: false,
|
||||
list: []
|
||||
}
|
||||
},
|
||||
|
||||
computed: {
|
||||
...mapState(['user']),
|
||||
},
|
||||
|
||||
mounted () {
|
||||
console.log(this.user)
|
||||
this.$loading()
|
||||
this.getList()
|
||||
},
|
||||
@@ -55,7 +62,7 @@
|
||||
methods: {
|
||||
linkTo () {
|
||||
uni.navigateTo({
|
||||
url: './Add'
|
||||
url
|
||||
})
|
||||
},
|
||||
|
||||
@@ -88,7 +95,7 @@
|
||||
|
||||
uni.hideLoading()
|
||||
|
||||
if (res.data.records.length < 20) {
|
||||
if (res.data.records.length < 10) {
|
||||
this.isMore = true
|
||||
|
||||
return false
|
||||
|
||||
Reference in New Issue
Block a user