持续集成分支

This commit is contained in:
aixianling
2024-10-31 14:34:57 +08:00
parent 6a833be062
commit 8c56cf808b
2165 changed files with 4116 additions and 8716 deletions

View File

@@ -0,0 +1,240 @@
<template>
<div class="AppAnswerList">
<div class="search-wrapper">
<div class="search" @click="linkTo('./Search')">
<image src="../img/search.png" />
<div>请输入</div>
</div>
</div>
<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>{{ 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>{{ item.answerCount }}</i>
<span>条回答</span>
</div>
<div class="right">
<span @click.stop="linkTo('./Add?id=' + item.id)" v-if="item.createUserId === user.id && item.answerCount === 0">修改问题</span>
<span @click.stop="linkTo(`./answerAdd?qid=${item.id}`)">去回答</span>
</div>
</div>
</div>
<AiEmpty v-if="!list.length && isMore"></AiEmpty>
</div>
<div class="answer-btn">
<div @click="linkTo('./Add')">提问</div>
</div>
</div>
</template>
<script>
import { mapState } from 'vuex'
export default {
data () {
return {
search: {
current: 1,
title: '',
size: 10
},
isMore: false,
list: []
}
},
computed: {
...mapState(['user']),
},
mounted () {
this.$loading()
this.getList()
},
methods: {
linkTo (url) {
uni.navigateTo({
url
})
},
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
}
}).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()
})
}
}
}
</script>
<style lang="scss" scoped>
.AppAnswerList {
padding: 0 32px 120px;
.search-wrapper {
position: sticky;
top: 112px;
z-index: 11;
padding: 0 0 20px 0;
background: #F3F5F9;
}
.search {
display: flex;
align-items: center;
height: 64px;
padding: 0 32px;
border-radius: 16px;
background: #fff;
image {
width: 32px;
height: 32px;
margin-right: 8px;
}
div {
font-size: 26px;
color: #999999;
}
}
.answer-btn {
position: fixed;
bottom: 0;
left: 0;
z-index: 11;
width: 100%;
padding: 16px 32px;
text-align: center;
box-sizing: border-box;
background: #F3F5F9;
div {
height: 88px;
line-height: 88px;
background: #3975C6;
border-radius: 44px;
font-size: 34px;
color: #FFFFFF;
}
}
.list-wrapper {
padding-bottom: 40px;
.item {
margin-bottom: 24px;
padding: 24px;
border-radius: 16px;
background: #fff;
.item-bottom {
display: flex;
align-items: center;
justify-content: space-between;
margin-top: 48px;
.right {
span {
height: 56px;
line-height: 56px;
margin-right: 24px;
padding: 0 16px;
background: #FFFFFF;
border: 1px solid #FF883C;
color: #FF883C;
border-radius: 8px;
&:last-child {
margin-right: 0;
color: #3975C6;
border: 1px solid #3975C6;
}
}
}
div {
display: flex;
align-items: center;
font-size: 28px;
color: #999;
}
i {
font-style: normal;
color: #3975C6;;
}
}
p {
display: -webkit-box;
line-height: 1.3;
-webkit-box-orient: vertical;
-webkit-line-clamp: 2;
font-size: 34px;
overflow: hidden;
color: #333333;
}
.item-title {
display: flex;
align-items: center;
margin-bottom: 16px;
font-size: 28px;
color: #999;
i {
font-style: normal;
color: #3975C6;;
}
}
}
}
}
</style>

View File

@@ -0,0 +1,219 @@
<template>
<div class="ranking">
<div class="list-data">
<div class="item" v-for="(item, index) in list" :key="index">
<div class="flex-left">
<div class="item-rank">
<img :src="imgList[index]" alt="" v-if="index < 3">
<span v-else>{{index+1}}</span>
</div>
<div class="item-user">
<img :src="item.avatar || 'https://cdn.cunwuyun.cn/wxmp/tianfuxing/avatar.png'" alt="">{{item.name}}
</div>
</div>
<div class="flex-right">{{item.score}}</div>
</div>
</div>
<AiEmpty description="暂无数据" v-if="!list.length"/>
<div class="list-data footer">
<div class="item" @click="linkTo">
<div class="flex-left">
<div class="item-rank">
<span>{{ info['积分排行'] }}</span>
</div>
<div class="item-user">
<img :src="user.avatar || 'https://cdn.cunwuyun.cn/wxmp/tianfuxing/avatar.png'" alt="">{{ user.name }}
</div>
</div>
<div class="flex-right">
<span>{{ info['累计获取积分'] }}</span>
<image class="right" src="../img/right.png" />
</div>
</div>
</div>
</div>
</template>
<script>
import { mapState } from 'vuex'
export default {
data () {
return {
search: {
current: 1,
title: '',
size: 100
},
isMore: false,
barStyle: {
'width': '24px',
'height': '3px',
'border-radius': '2px',
'bottom': '0px',
'background-color': '#3399FF'
},
activeStyle: {
'font-weight' : '400',
'color': '#000000'
},
imgList: [require('../img/top0.png'),require('../img/top1.png'),require('../img/top2.png')],
info: {},
list: []
}
},
computed: {
...mapState(['user']),
},
mounted () {
this.$loading()
this.getList()
this.getInfo()
},
methods: {
linkTo () {
uni.navigateTo({
url: './IntegralDetail'
})
},
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, {
params: {
...this.search
}
}).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 < 100) {
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>
<style scoped lang="scss">
.ranking {
min-height: 100%;
background-color: #F3F5F9;
padding-bottom: 32px;
.list-data {
padding: 32px;
margin-bottom: 80px;
.item {
width: 100%;
display: flex;
justify-content: space-between;
padding: 24px 48px 24px 32px;
box-sizing: border-box;
background-color: #fff;
border-radius: 32px;
margin-bottom: 16px;
.flex-left {
display: flex;
.item-rank {
width: 152px;
img {
padding-top: 12px;
width: 56px;
height: 56px;
vertical-align: middle;
}
span {
line-height: 80px;
font-family: SFPro-SNaNpxiboldItalic;
font-weight: SemiboldItalic;
font-size: 40px;
color: #DDD;
}
}
.item-user {
line-height: 80px;
font-family: PingFangSC-Medium;
font-weight: 500;
font-size: 32px;
color: #333;
img {
width: 80px;
height: 80px;
border-radius: 50%;
margin-right: 16px;
vertical-align: middle;
}
}
}
.flex-right {
font-family: SFPro-SNaNpxibold;
font-weight: 600;
font-size: 36px;
color: #FF9343;
line-height: 42px;
padding-top: 20px;
}
}
}
.footer {
padding: 0;
margin-bottom: 0;
width: 100%;
position: fixed;
bottom: 0;
left: 0;
.item {
border-radius: 0;
margin-bottom: 0;
padding: 24px 14px 24px 32px;
&:active {
background: #eee;
}
}
.flex-right {
display: flex;
align-items: center;
}
.right {
width: 50px;
height: 50px;
}
}
}
</style>