网格员积分页面完成
This commit is contained in:
223
src/apps/AppCreditPoints/AppGridIntegral.vue
Normal file
223
src/apps/AppCreditPoints/AppGridIntegral.vue
Normal file
@@ -0,0 +1,223 @@
|
||||
<template>
|
||||
<div class="AppGridIntegral">
|
||||
<div class="bg-blue"></div>
|
||||
<div class="header-content">
|
||||
<img src="https://cdn.cunwuyun.cn/dvcp/credit/head.png" alt="">
|
||||
<div class="headerDataPane" flex>
|
||||
<div class="headerItem" v-for="i in 3" :key="i">
|
||||
<b v-text="560"/>
|
||||
<div v-text="`个人积分`"/>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="detail-content" v-if="list.length">
|
||||
<div class="title">积分明细</div>
|
||||
<div class="item" v-for="(item, index) in list" :key="index">
|
||||
<div class="item-info">
|
||||
<p v-text="item.eventDesc"/>
|
||||
<span v-text="item.doTime"/>
|
||||
</div>
|
||||
<div class="item-num" :class="'color-'+ item.integralCalcType">
|
||||
{{ (item.integralCalcType == 1 ? '+' : '-') + item.changeIntegral }}
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<AiEmpty v-else/>
|
||||
</div>
|
||||
</template>
|
||||
<script>
|
||||
import {mapState} from 'vuex'
|
||||
|
||||
export default {
|
||||
name: "AppGridIntegral",
|
||||
appName: "网格员积分",
|
||||
computed: {
|
||||
...mapState(['user'])
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
info: {},
|
||||
list: [],
|
||||
current: 1,
|
||||
pages: 0
|
||||
}
|
||||
},
|
||||
created() {
|
||||
this.getInfo()
|
||||
uni.$on("reachBottom2", () => {
|
||||
this.current++;
|
||||
this.getInfo()
|
||||
})
|
||||
uni.$on('updateIntegral', () => {
|
||||
this.current = 1
|
||||
this.list = []
|
||||
this.getInfo()
|
||||
})
|
||||
},
|
||||
methods: {
|
||||
// 积分排行
|
||||
getInfo() {
|
||||
let {current, user: {id: userId}, info: {details}} = this
|
||||
if (!details?.pages || current <= details.pages) {
|
||||
this.$http.post('/app/appvillagerintegraldetail/sysUserIntegralList', null, {
|
||||
params: {userId, current, size: 10}
|
||||
}).then(res => {
|
||||
if (res?.data) {
|
||||
this.info = res.data
|
||||
this.list = [this.list, res.data.details?.records || []].flat()
|
||||
}
|
||||
})
|
||||
}
|
||||
},
|
||||
gotoGive() {
|
||||
uni.navigateTo({url: "./giveIntegral"})
|
||||
}
|
||||
},
|
||||
destroyed() {
|
||||
uni.$off("reachBottom2")
|
||||
uni.$off("onShow")
|
||||
}
|
||||
}
|
||||
</script>
|
||||
<style scoped lang="scss">
|
||||
.AppGridIntegral {
|
||||
width: 100vw;
|
||||
background-color: #f3f6f9;
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
align-items: center;
|
||||
|
||||
.bg-blue {
|
||||
width: 100%;
|
||||
height: 176px;
|
||||
background-color: #3975C6;
|
||||
}
|
||||
|
||||
.header-content {
|
||||
width: 690px;
|
||||
height: 256px;
|
||||
margin: -130px 0 40px;
|
||||
padding: 32px;
|
||||
box-sizing: border-box;
|
||||
position: relative;
|
||||
background: #FFF;
|
||||
border-radius: 16px;
|
||||
|
||||
.headerDataPane {
|
||||
justify-content: space-around;
|
||||
top: 106px;
|
||||
left: 0;
|
||||
right: 0;
|
||||
position: absolute;
|
||||
z-index: 9;
|
||||
|
||||
.headerItem {
|
||||
text-align: center;
|
||||
font-size: 28px;
|
||||
font-family: PingFangSC-Regular, PingFang SC;
|
||||
font-weight: 400;
|
||||
color: #999999;
|
||||
line-height: 40px;
|
||||
|
||||
b {
|
||||
display: block;
|
||||
color: #4185F5;
|
||||
line-height: 60px;
|
||||
font-size: 52px;
|
||||
font-family: DINAlternate-Bold, DINAlternate;
|
||||
margin-bottom: 10px;
|
||||
}
|
||||
|
||||
&:nth-of-type(1) > b {
|
||||
color: #5AAD6A;
|
||||
}
|
||||
|
||||
&:nth-of-type(3) > b {
|
||||
color: #CD413A;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
img {
|
||||
position: absolute;
|
||||
width: 342px;
|
||||
height: 220px;
|
||||
top: -40px;
|
||||
right: 10px;
|
||||
z-index: 2;
|
||||
}
|
||||
}
|
||||
|
||||
.mar-b4 {
|
||||
margin-bottom: 8px;
|
||||
}
|
||||
|
||||
.mar-b8 {
|
||||
margin-bottom: 16px;
|
||||
}
|
||||
|
||||
.detail-content {
|
||||
width: 690px;
|
||||
background: #FFF;
|
||||
border-radius: 16px;
|
||||
padding: 30px 30px 94px;
|
||||
box-sizing: border-box;
|
||||
|
||||
.title {
|
||||
font-size: 34px;
|
||||
font-family: PingFangSC-Medium, PingFang SC;
|
||||
font-weight: 500;
|
||||
color: #333;
|
||||
line-height: 48px;
|
||||
margin-bottom: 30px;
|
||||
}
|
||||
|
||||
.item {
|
||||
padding: 34px 0 32px 0;
|
||||
border-bottom: 2px solid #ddd;
|
||||
display: flex;
|
||||
|
||||
.item-info {
|
||||
width: 500px;
|
||||
|
||||
p {
|
||||
word-break: break-all;
|
||||
font-size: 32px;
|
||||
font-family: PingFangSC-Regular, PingFang SC;
|
||||
font-weight: 400;
|
||||
color: #333;
|
||||
line-height: 44px;
|
||||
}
|
||||
|
||||
span {
|
||||
display: inline-block;
|
||||
margin-top: 8px;
|
||||
font-size: 24px;
|
||||
font-family: PingFangSC-Regular, PingFang SC;
|
||||
font-weight: 400;
|
||||
color: #999;
|
||||
line-height: 34px;
|
||||
}
|
||||
}
|
||||
|
||||
.item-num {
|
||||
width: calc(100% - 500px);
|
||||
text-align: right;
|
||||
font-size: 36px;
|
||||
font-family: PingFangSC-Semibold, PingFang SC;
|
||||
font-weight: 600;
|
||||
line-height: 50px;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
.color-1 {
|
||||
color: #2C51CE !important;
|
||||
}
|
||||
|
||||
.color-0 {
|
||||
color: #E6736E !important;
|
||||
}
|
||||
}
|
||||
</style>
|
||||
Reference in New Issue
Block a user