学习问答
This commit is contained in:
@@ -51,7 +51,7 @@
|
||||
uni.$emit('update')
|
||||
|
||||
setTimeout(() => {
|
||||
uni.navigateTo()
|
||||
uni.navigateBack()
|
||||
}, 500)
|
||||
}
|
||||
})
|
||||
|
||||
@@ -1,18 +1,78 @@
|
||||
<template>
|
||||
<div class="integralDetail">
|
||||
<div class="item" v-for="(item, index) in 10" :key="index">
|
||||
<div class="item" v-for="(item, index) in list" :key="index">
|
||||
<div class="left">
|
||||
<h2>提问</h2>
|
||||
<p>2022-07-21 10:10:02</p>
|
||||
<h2>{{ item.changeDesc }}</h2>
|
||||
<p>{{ item.createTime }}</p>
|
||||
</div>
|
||||
<span>+10</span>
|
||||
<span>+{{ item.changeScore }}</span>
|
||||
</div>
|
||||
<AiEmpty v-if="!list.length && isMore"></AiEmpty>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import { mapState } from 'vuex'
|
||||
|
||||
export default {
|
||||
appName: '积分明细',
|
||||
data () {
|
||||
return {
|
||||
search: {
|
||||
current: 1,
|
||||
size: 20
|
||||
},
|
||||
isMore: false,
|
||||
list: []
|
||||
}
|
||||
},
|
||||
|
||||
computed: {
|
||||
...mapState(['user']),
|
||||
},
|
||||
|
||||
mounted () {
|
||||
this.getList()
|
||||
},
|
||||
|
||||
methods: {
|
||||
getList () {
|
||||
if (this.isMore) return
|
||||
this.$http.post(`/app/applearningquestion/scoreDetail`, null, {
|
||||
params: {
|
||||
...this.search,
|
||||
sysUserId: this.user.id
|
||||
}
|
||||
}).then(res => {
|
||||
if (res.code == 0) {
|
||||
if (this.search.current > 1) {
|
||||
this.list = [...this.list, ...res.data.records]
|
||||
} else {
|
||||
this.list = res.data.records
|
||||
}
|
||||
|
||||
uni.hideLoading()
|
||||
|
||||
if (res.data.records.length < 20) {
|
||||
this.isMore = true
|
||||
|
||||
return false
|
||||
}
|
||||
|
||||
this.search.current = this.search.current + 1
|
||||
} else {
|
||||
uni.hideLoading()
|
||||
}
|
||||
}).catch(() => {
|
||||
uni.hideLoading()
|
||||
})
|
||||
}
|
||||
},
|
||||
|
||||
onReachBottom () {
|
||||
this.current = this.current + 1
|
||||
this.getList()
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
||||
|
||||
@@ -3,54 +3,123 @@
|
||||
<div class="search-wrapper">
|
||||
<div class="search">
|
||||
<image src="./img/search.png" />
|
||||
<input placeholder="请输入" v-model="name">
|
||||
<image v-if="name" src="./img/close.png" @click="name = ''" />
|
||||
<input placeholder="请输入" v-model="content" @confirm="onChange">
|
||||
<image v-if="content" src="./img/close.png" @click="content = ''" />
|
||||
</div>
|
||||
</div>
|
||||
<div class="list-wrapper">
|
||||
<div class="item" v-for="(item, index) in 12" :key="index" @click="linkTo('./answerList')">
|
||||
<div class="item" v-for="(item, index) in list" :key="index" @click="linkTo('./answerList?id=' + item.id)">
|
||||
<div class="item-title">
|
||||
<i>我 </i>
|
||||
<span>于2022年12月30日 12:23:54 提问</span>
|
||||
<i>{{ item.createUserId === user.id ? '我' : item.createUserName }} </i>
|
||||
<span>于{{ item.createTime }} 提问</span>
|
||||
</div>
|
||||
<p>基层工作如何展开相关工作合适基层工作如何展开相关工作合适基层工作如何展...</p>
|
||||
<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>
|
||||
</div>
|
||||
<AiEmpty v-if="!list.length"></AiEmpty>
|
||||
</div>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import { mapState } from 'vuex'
|
||||
|
||||
export default {
|
||||
appName: '学习问答',
|
||||
|
||||
data () {
|
||||
return {
|
||||
name: ''
|
||||
search: {
|
||||
current: 1,
|
||||
title: '',
|
||||
size: 10
|
||||
},
|
||||
content: '',
|
||||
isMore: false,
|
||||
list: []
|
||||
}
|
||||
},
|
||||
|
||||
mounted () {
|
||||
computed: {
|
||||
...mapState(['user']),
|
||||
},
|
||||
|
||||
mounted () {
|
||||
},
|
||||
|
||||
methods: {
|
||||
linkTo (url) {
|
||||
console.log(url)
|
||||
uni.navigateTo({
|
||||
url
|
||||
})
|
||||
},
|
||||
|
||||
onChange () {
|
||||
this.current = 1
|
||||
this.isMore = false
|
||||
|
||||
this.getList()
|
||||
},
|
||||
|
||||
getMore () {
|
||||
this.current = this.current + 1
|
||||
|
||||
this.getList()
|
||||
},
|
||||
|
||||
update () {
|
||||
this.current = 1
|
||||
this.isMore = false
|
||||
|
||||
this.getList()
|
||||
},
|
||||
|
||||
getList () {
|
||||
if (this.isMore) return
|
||||
this.$http.post(`/app/applearningquestion/list`, null, {
|
||||
params: {
|
||||
...this.search,
|
||||
content: this.content || ''
|
||||
}
|
||||
}).then(res => {
|
||||
if (res.code == 0) {
|
||||
if (this.search.current > 1) {
|
||||
this.list = [...this.list, ...res.data.records]
|
||||
} else {
|
||||
this.list = res.data.records
|
||||
}
|
||||
|
||||
uni.hideLoading()
|
||||
|
||||
if (res.data.records.length < 10) {
|
||||
this.isMore = true
|
||||
|
||||
return false
|
||||
}
|
||||
|
||||
this.search.current = this.search.current + 1
|
||||
} else {
|
||||
uni.hideLoading()
|
||||
}
|
||||
}).catch(() => {
|
||||
uni.hideLoading()
|
||||
})
|
||||
}
|
||||
},
|
||||
|
||||
onReachBottom () {
|
||||
this.current = this.current + 1
|
||||
this.getList()
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
||||
@@ -2,44 +2,51 @@
|
||||
<div class="ranking">
|
||||
<div class="list-wrapper">
|
||||
<div class="item my" @click="linkTo">
|
||||
<span>113</span>
|
||||
<span>{{ info['积分排行'] }}</span>
|
||||
<div class="userinfo">
|
||||
<image :src="'https://cdn.cunwuyun.cn/wxmp/tianfuxing/avatar.png'" />
|
||||
<h3>且听风吟</h3>
|
||||
<image :src="user.avatar || 'https://cdn.cunwuyun.cn/wxmp/tianfuxing/avatar.png'" />
|
||||
<h3>{{ user.name }}</h3>
|
||||
</div>
|
||||
<i>20</i>
|
||||
<i>{{ info['累计获取积分'] }}</i>
|
||||
<image class="right" src="../img/right.png" />
|
||||
</div>
|
||||
<div class="item" v-for="(item, index) in 21" :key="index">
|
||||
<div class="item" v-for="(item, index) in list" :key="index">
|
||||
<span>{{ index + 1 }}</span>
|
||||
<div class="userinfo">
|
||||
<image :src="'https://cdn.cunwuyun.cn/wxmp/tianfuxing/avatar.png'" />
|
||||
<h3>且听风吟</h3>
|
||||
<image :src="item.avatar || 'https://cdn.cunwuyun.cn/wxmp/tianfuxing/avatar.png'" />
|
||||
<h3>{{ item.name }}</h3>
|
||||
</div>
|
||||
<i>20</i>
|
||||
<i>{{ item.score }}</i>
|
||||
</div>
|
||||
<!-- <AiEmpty v-if="!list.length"></AiEmpty> -->
|
||||
<AiEmpty v-if="!list.length && isMore"></AiEmpty>
|
||||
</div>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import { mapState } from 'vuex'
|
||||
export default {
|
||||
data () {
|
||||
return {
|
||||
search: {
|
||||
current: 1,
|
||||
title: '',
|
||||
size: 20
|
||||
size: 100
|
||||
},
|
||||
isMore: false,
|
||||
info: {},
|
||||
list: []
|
||||
}
|
||||
},
|
||||
|
||||
computed: {
|
||||
...mapState(['user']),
|
||||
},
|
||||
|
||||
mounted () {
|
||||
this.$loading()
|
||||
this.getList()
|
||||
this.getInfo()
|
||||
},
|
||||
|
||||
methods: {
|
||||
@@ -49,6 +56,14 @@
|
||||
})
|
||||
},
|
||||
|
||||
getInfo () {
|
||||
this.$http.post(`/app/applearningquestion/myScore`).then(res => {
|
||||
if (res.code === 0) {
|
||||
this.info = res.data
|
||||
}
|
||||
})
|
||||
},
|
||||
|
||||
getList () {
|
||||
if (this.isMore) return
|
||||
this.$http.post(`/app/applearningquestion/scoreRanking`, null, {
|
||||
@@ -65,7 +80,7 @@
|
||||
|
||||
uni.hideLoading()
|
||||
|
||||
if (res.data.records.length < 20) {
|
||||
if (res.data.records.length < 100) {
|
||||
this.isMore = true
|
||||
|
||||
return false
|
||||
|
||||
Reference in New Issue
Block a user