Files
dvcp_v2_wxcp_app/src/apps/AppCreditPoints/AppGridIntegral.vue

229 lines
4.7 KiB
Vue
Raw Normal View History

2022-08-05 10:24:21 +08:00
<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>
2022-08-09 11:09:32 +08:00
<div class="headerItem top">
2022-08-05 10:24:21 +08:00
<div v-text="`个人积分`"/>
2022-08-09 11:09:32 +08:00
<b v-text="info.historyIntegralTotal||0"/>
</div>
<div class="headerItem">
<div v-text="`剩余积分`"/>
<b v-text="info.nowIntegral||0"/>
</div>
<div class="divider"/>
<div class="headerItem">
<div v-text="`积分排名`"/>
<b v-text="info.integralRanking||'-'"/>
2022-08-05 10:24:21 +08:00
</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()
},
methods: {
// 积分排行
getInfo() {
2022-08-09 11:09:32 +08:00
let {current, info: {detailList: details}} = this
2022-08-05 10:24:21 +08:00
if (!details?.pages || current <= details.pages) {
2022-08-09 09:51:42 +08:00
this.$http.post('/app/appintegraluser/appGirdIntegral', null, {
params: {current, size: 10}
2022-08-05 10:24:21 +08:00
}).then(res => {
if (res?.data) {
this.info = res.data
2022-08-09 11:09:32 +08:00
this.list = [this.list, res.data.detailList?.records || []].flat()
2022-08-05 10:24:21 +08:00
}
})
}
},
},
2022-08-09 09:51:42 +08:00
onReachBottom() {
this.current++
this.getInfo()
2022-08-05 10:24:21 +08:00
}
}
</script>
<style scoped lang="scss">
.AppGridIntegral {
width: 100vw;
background-color: #f3f6f9;
display: flex;
flex-direction: column;
align-items: center;
.bg-blue {
width: 100%;
2022-08-09 11:09:32 +08:00
height: 270px;
2022-08-05 10:24:21 +08:00
background-color: #3975C6;
}
.header-content {
width: 690px;
2022-08-09 11:09:32 +08:00
height: 408px;
2022-08-05 10:24:21 +08:00
margin: -130px 0 40px;
padding: 32px;
box-sizing: border-box;
position: relative;
background: #FFF;
border-radius: 16px;
.headerDataPane {
justify-content: space-around;
2022-08-09 11:09:32 +08:00
top: 76px;
2022-08-05 10:24:21 +08:00
left: 0;
right: 0;
position: absolute;
z-index: 9;
2022-08-09 11:09:32 +08:00
flex-wrap: wrap;
2022-08-05 10:24:21 +08:00
.headerItem {
text-align: center;
font-size: 28px;
font-family: PingFangSC-Regular, PingFang SC;
font-weight: 400;
color: #999999;
line-height: 40px;
b {
display: block;
2022-08-09 11:09:32 +08:00
line-height: 50px;
color: #000;
font-size: 36px;
2022-08-05 10:24:21 +08:00
font-family: DINAlternate-Bold, DINAlternate;
margin-bottom: 10px;
}
2022-08-09 11:09:32 +08:00
&.top {
width: 100%;
2022-08-05 10:24:21 +08:00
2022-08-09 11:09:32 +08:00
b {
font-size: 104px;
line-height: 122px;
}
2022-08-05 10:24:21 +08:00
}
}
}
2022-08-09 11:09:32 +08:00
& > img {
2022-08-05 10:24:21 +08:00
position: absolute;
width: 342px;
height: 220px;
2022-08-09 11:09:32 +08:00
top: -60px;
2022-08-05 10:24:21 +08:00
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;
}
2022-08-09 11:09:32 +08:00
.divider {
width: 2px;
height: 60px;
background: #ededed;
}
2022-08-05 10:24:21 +08:00
}
</style>