积分排行,积分明细
This commit is contained in:
481
src/project/fengdu/AppCreditPoints/AppCreditPoints.vue
Normal file
481
src/project/fengdu/AppCreditPoints/AppCreditPoints.vue
Normal file
@@ -0,0 +1,481 @@
|
||||
<template>
|
||||
<section class="AppCreditPoints">
|
||||
<AiTabPanes :tabs="tabList" v-model="tabIndex" @change="handChangeTab" />
|
||||
<div class="area-content">
|
||||
<AiAreaPicker :areaId="user.areaId" :value="areaId" @select="areaSelect" :name.sync="areaName" selectRoot>
|
||||
<img src="./components/img/local-icon.png" alt="">
|
||||
<span class="label" v-if="areaName">{{ areaName }}</span>
|
||||
<span v-else>请选择</span>
|
||||
<u-icon name="arrow-down" color="#666" size="24"/>
|
||||
</AiAreaPicker>
|
||||
</div>
|
||||
<u-gap height="6"/>
|
||||
<div class="fill" v-if="info && info.length">
|
||||
<div class="ranking-content" v-if="info && info.length">
|
||||
<div class="item" v-if="info.length > 1" @click="toGridIntegral(1, info[1].integral_user_id)">
|
||||
<img
|
||||
src="https://cdn.cunwuyun.cn/dvcp/credit/2.png"
|
||||
alt=""
|
||||
class="top-img"
|
||||
/>
|
||||
<img
|
||||
:src="info[1].avatar_url"
|
||||
alt=""
|
||||
class="user-img mar-b4"
|
||||
v-if="info[1].avatar_url"
|
||||
/>
|
||||
<div class="user-name-bg mar-b4" v-else>
|
||||
{{ formatName(info[1].name) }}
|
||||
</div>
|
||||
<p class="user-name mar-b8">
|
||||
{{ info[1].name }}
|
||||
</p>
|
||||
<p class="item-num">{{ info[1].integral }}</p>
|
||||
</div>
|
||||
<div class="item-top item" v-if="info.length > 0" @click="toGridIntegral(0, info[0].integral_user_id)">
|
||||
<img
|
||||
src="https://cdn.cunwuyun.cn/dvcp/credit/1.png"
|
||||
alt=""
|
||||
class="top-img-one"
|
||||
/>
|
||||
<img
|
||||
:src="info[0].avatar_url"
|
||||
alt=""
|
||||
class="user-img mar-b4"
|
||||
v-if="info[0].avatar_url"
|
||||
/>
|
||||
<div class="user-name-bg mar-b4" v-else>
|
||||
{{ formatName(info[0].name) }}
|
||||
</div>
|
||||
<p class="user-name mar-b8">
|
||||
{{ info[0].name }}
|
||||
</p>
|
||||
<p class="item-num">{{ info[0].integral }}</p>
|
||||
</div>
|
||||
<div class="item" v-if="info.length > 2" @click="toGridIntegral(2, info[2].integral_user_id)">
|
||||
<img
|
||||
src="https://cdn.cunwuyun.cn/dvcp/credit/3.png"
|
||||
alt=""
|
||||
class="top-img"
|
||||
/>
|
||||
<img
|
||||
:src="info[2].avatar_url"
|
||||
alt=""
|
||||
class="user-img mar-b4"
|
||||
v-if="info[2].avatar_url"
|
||||
/>
|
||||
<div class="user-name-bg mar-b4" v-else>
|
||||
{{ formatName(info[2].name) }}
|
||||
</div>
|
||||
<p class="user-name mar-b8">
|
||||
{{ info[2].name }}
|
||||
</p>
|
||||
<p class="item-num">{{ info[2].integral }}</p>
|
||||
</div>
|
||||
</div>
|
||||
<u-gap height="6"/>
|
||||
<div class="ranking-list" v-if="info && info.length">
|
||||
<div
|
||||
class="item"
|
||||
v-for="(item, index) in info"
|
||||
:key="index"
|
||||
v-if="index > 2"
|
||||
@click="toGridIntegral(index, item.integral_user_id)"
|
||||
>
|
||||
<span class="item-num">{{ index + 1 }}</span>
|
||||
<img
|
||||
:src="item.avatar_url"
|
||||
alt=""
|
||||
class="user-img mar-b4"
|
||||
v-if="item.avatar_url"
|
||||
/>
|
||||
<div class="user-name-bg mar-b4 mar-r24" v-else>
|
||||
{{ formatName(item.name) }}
|
||||
</div>
|
||||
<span class="item-name">{{ item.name }}</span>
|
||||
<span class="item-point">{{ item.integral }}</span>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<AiEmpty v-else/>
|
||||
</section>
|
||||
</template>
|
||||
<script>
|
||||
import {mapState} from 'vuex'
|
||||
|
||||
export default {
|
||||
name: "AppCreditPoints",
|
||||
appName: "积分排行",
|
||||
computed: {
|
||||
...mapState(['user'])
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
info: [],
|
||||
current: 1,
|
||||
areaId: '',
|
||||
areaName: '',
|
||||
tabIndex: 0,
|
||||
tabList: ['总榜', '月榜', "周榜"],
|
||||
}
|
||||
},
|
||||
created() {
|
||||
this.areaId = this.user.areaId
|
||||
this.areaName = this.user.areaName || ''
|
||||
this.getInfo();
|
||||
},
|
||||
methods: {
|
||||
handChangeTab() {
|
||||
this.getInfo()
|
||||
},
|
||||
areaSelect(e) {
|
||||
this.areaId = e
|
||||
this.getInfo()
|
||||
},
|
||||
// 积分排行
|
||||
getInfo() {
|
||||
this.info = []
|
||||
this.$http.post(`/app/appintegraluser/integralSortFD?type=${this.tabIndex}&areaId=${this.areaId}`).then((res) => {
|
||||
if (res?.data) {
|
||||
this.info = res.data
|
||||
}
|
||||
});
|
||||
},
|
||||
formatName(name) {
|
||||
if (name == undefined) {
|
||||
return
|
||||
}
|
||||
return name.substr(name.length - 2, name.length > 2 ? (name.length - 1) : name.length)
|
||||
},
|
||||
toGridIntegral(rankNum, userId) {
|
||||
uni.navigateTo({url: `./gridIntegral?rankNum=${rankNum}&userId=${userId}`})
|
||||
}
|
||||
},
|
||||
}
|
||||
</script>
|
||||
<style scoped lang="scss">
|
||||
.AppCreditPoints {
|
||||
width: 100vw;
|
||||
background-color: #f3f6f9;
|
||||
|
||||
.bg-blue {
|
||||
width: 100%;
|
||||
height: 176px;
|
||||
background-color: #3975C6;
|
||||
}
|
||||
|
||||
.header-content {
|
||||
width: 690px;
|
||||
height: 256px;
|
||||
background: #fff;
|
||||
border-radius: 16px;
|
||||
margin: -130px 0 40px 30px;
|
||||
padding: 100px 60px 40px 60px;
|
||||
box-sizing: border-box;
|
||||
display: flex;
|
||||
justify-content: space-between;
|
||||
position: relative;
|
||||
|
||||
.item {
|
||||
text-align: center;
|
||||
z-index: 99;
|
||||
|
||||
.num {
|
||||
font-family: DIN;
|
||||
font-size: 52px;
|
||||
font-weight: bold;
|
||||
line-height: 60px;
|
||||
}
|
||||
|
||||
.label {
|
||||
font-size: 28px;
|
||||
font-family: PingFangSC-Regular, PingFang SC;
|
||||
color: #999;
|
||||
line-height: 40px;
|
||||
margin-top: 10px;
|
||||
}
|
||||
|
||||
.color-5AAD6A {
|
||||
color: #5aad6a;
|
||||
}
|
||||
|
||||
.color-4185F5 {
|
||||
color: #4185f5;
|
||||
}
|
||||
|
||||
.color-CD413A {
|
||||
color: #cd413a;
|
||||
}
|
||||
}
|
||||
|
||||
img {
|
||||
position: absolute;
|
||||
width: 360px;
|
||||
height: 250px;
|
||||
top: -40px;
|
||||
right: 0;
|
||||
}
|
||||
}
|
||||
|
||||
.ranking-content {
|
||||
padding: 94px 30px 0;
|
||||
.item {
|
||||
display: inline-block;
|
||||
width: 216px;
|
||||
height: 320px;
|
||||
box-shadow: 0 4px 20px 0 rgba(0, 0, 0, 0.12);
|
||||
border-radius: 12px;
|
||||
padding: 40px 0 0 0;
|
||||
text-align: center;
|
||||
box-sizing: border-box;
|
||||
position: relative;
|
||||
vertical-align: top;
|
||||
background: #fff;
|
||||
|
||||
.user-name {
|
||||
font-size: 30px;
|
||||
font-family: PingFang-SC-Medium, PingFang-SC;
|
||||
font-weight: 500;
|
||||
color: #333;
|
||||
line-height: 42px;
|
||||
word-break: break-all;
|
||||
}
|
||||
|
||||
.item-num {
|
||||
font-size: 46px;
|
||||
font-weight: 6000;
|
||||
color: #2c51ce;
|
||||
line-height: 54px;
|
||||
}
|
||||
|
||||
.top-img {
|
||||
width: 100%;
|
||||
height: 34px;
|
||||
position: absolute;
|
||||
top: -11px;
|
||||
left: 0;
|
||||
}
|
||||
}
|
||||
|
||||
.item-top {
|
||||
margin: -46px 20px 0;
|
||||
height: 366px;
|
||||
|
||||
.user-img {
|
||||
width: 104px;
|
||||
height: 104px;
|
||||
}
|
||||
|
||||
.user-name-bg {
|
||||
width: 104px;
|
||||
height: 104px;
|
||||
border-radius: 50%;
|
||||
background-color: #4e8eee;
|
||||
font-size: 28px;
|
||||
line-height: 104px;
|
||||
text-align: center;
|
||||
color: #fff;
|
||||
}
|
||||
|
||||
.top-img-one {
|
||||
width: 100%;
|
||||
position: absolute;
|
||||
top: -22px;
|
||||
left: 0;
|
||||
height: 46px;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
.ranking-list {
|
||||
background-color: #fff;
|
||||
|
||||
.item {
|
||||
width: 100%;
|
||||
height: 120px;
|
||||
line-height: 120px;
|
||||
background: #fff;
|
||||
padding: 0 64px;
|
||||
box-sizing: border-box;
|
||||
|
||||
.item-num {
|
||||
display: inline-block;
|
||||
width: 68px;
|
||||
color: #858594;
|
||||
font-size: 28px;
|
||||
}
|
||||
|
||||
.user-img {
|
||||
margin-right: 24px;
|
||||
vertical-align: middle;
|
||||
}
|
||||
|
||||
.item-name {
|
||||
color: #333;
|
||||
font-size: 30px;
|
||||
display: inline-block;
|
||||
width: 240px;
|
||||
}
|
||||
|
||||
.item-point {
|
||||
display: inline-block;
|
||||
width: 210px;
|
||||
text-align: right;
|
||||
font-size: 30px;
|
||||
font-family: PingFangSC-Medium, PingFang SC;
|
||||
font-weight: 500;
|
||||
color: #333;
|
||||
}
|
||||
|
||||
.mar-r24 {
|
||||
margin-right: 24px;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
.user-img {
|
||||
width: 80px;
|
||||
height: 80px;
|
||||
border-radius: 50%;
|
||||
}
|
||||
|
||||
.user-name-bg {
|
||||
display: inline-block;
|
||||
width: 80px;
|
||||
height: 80px;
|
||||
border-radius: 50%;
|
||||
background-color: #4e8eee;
|
||||
font-size: 28px;
|
||||
line-height: 80px;
|
||||
text-align: center;
|
||||
color: #fff;
|
||||
}
|
||||
|
||||
.mar-b4 {
|
||||
margin-bottom: 8px;
|
||||
}
|
||||
|
||||
.mar-b8 {
|
||||
margin-bottom: 16px;
|
||||
}
|
||||
|
||||
.detail-content {
|
||||
width: 690px;
|
||||
background: #fff;
|
||||
border-radius: 16px;
|
||||
margin: 432px 0 0 32px;
|
||||
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-0 {
|
||||
color: #2c51ce !important;
|
||||
}
|
||||
|
||||
.color-1 {
|
||||
color: #e6736e !important;
|
||||
}
|
||||
|
||||
.fixed-top {
|
||||
z-index: 999;
|
||||
}
|
||||
|
||||
.header-tab {
|
||||
height: 96px;
|
||||
background-color: #3975C6;
|
||||
padding: 20px 0;
|
||||
display: flex;
|
||||
align-items: center;
|
||||
box-sizing: border-box;
|
||||
}
|
||||
|
||||
.header-tab .tab-item {
|
||||
flex: 1;
|
||||
text-align: center;
|
||||
position: relative;
|
||||
color: #fff;
|
||||
font-size: 28px;
|
||||
}
|
||||
|
||||
.header-tab .tab-active {
|
||||
font-weight: 500;
|
||||
}
|
||||
|
||||
.header-tab .active-line {
|
||||
position: absolute;
|
||||
width: 40px;
|
||||
height: 4px;
|
||||
background: #FFF;
|
||||
top: 48px;
|
||||
left: 50%;
|
||||
transform: translate(-50%, -50%);
|
||||
}
|
||||
|
||||
.area-content {
|
||||
padding: 32px;
|
||||
background-color: #fff;
|
||||
|
||||
img {
|
||||
width: 42px;
|
||||
vertical-align: middle;
|
||||
margin-right: 16px;
|
||||
}
|
||||
|
||||
.u-icon {
|
||||
margin-left: 6px;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
::v-deep .content {
|
||||
padding: 0;
|
||||
}
|
||||
}
|
||||
</style>
|
||||
BIN
src/project/fengdu/AppCreditPoints/components/img/line.png
Normal file
BIN
src/project/fengdu/AppCreditPoints/components/img/line.png
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 700 B |
BIN
src/project/fengdu/AppCreditPoints/components/img/local-icon.png
Normal file
BIN
src/project/fengdu/AppCreditPoints/components/img/local-icon.png
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 1.1 KiB |
260
src/project/fengdu/AppCreditPoints/gridIntegral.vue
Normal file
260
src/project/fengdu/AppCreditPoints/gridIntegral.vue
Normal file
@@ -0,0 +1,260 @@
|
||||
<template>
|
||||
<div class="gridIntegral">
|
||||
<div class="bg-blue"></div>
|
||||
<div class="header-content">
|
||||
<img src="https://cdn.cunwuyun.cn/dvcp/credit/head.png" alt="">
|
||||
<div class="headerDataPane">
|
||||
<div class="header-user" flex>
|
||||
<div class="user-name">{{info.userName}}</div>
|
||||
<div class="headerItem top">
|
||||
<div v-text="`积分余额`"/>
|
||||
<b v-text="info.nowIntegral||0"/>
|
||||
</div>
|
||||
</div>
|
||||
<div class="header-rank" flex>
|
||||
<div class="headerItem">
|
||||
<div v-text="`历史累计积分`"/>
|
||||
<b v-text="info.historyIntegralTotal||0"/>
|
||||
</div>
|
||||
<div class="divider"/>
|
||||
<div class="headerItem">
|
||||
<div v-text="`积分排名`"/>
|
||||
<b v-text="rankNum"/>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="detail-content" v-if="list.length">
|
||||
<div flex>
|
||||
<div class="title fill">积分明细</div>
|
||||
<!-- <u-icon name="question-circle" label="积分规则" color="#3F8DF5" label-color="#3F8DF5" @click="gotoRules"/> -->
|
||||
</div>
|
||||
<u-gap/>
|
||||
<div class="item" v-for="(item, index) in list" :key="index">
|
||||
<div class="item-info">
|
||||
<p v-text="item.eventDesc||item.integralRuleName"/>
|
||||
<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: "gridIntegral",
|
||||
computed: {
|
||||
...mapState(['user'])
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
info: {},
|
||||
list: [],
|
||||
current: 1,
|
||||
pages: 0,
|
||||
userId: '',
|
||||
rankNum: ''
|
||||
}
|
||||
},
|
||||
created() {
|
||||
this.getInfo()
|
||||
this.getList()
|
||||
},
|
||||
onLoad(option) {
|
||||
this.rankNum = option.rankNum
|
||||
this.userId = option.userId
|
||||
},
|
||||
methods: {
|
||||
// 积分排行
|
||||
getInfo() {
|
||||
this.$http.post(`/app/appintegraluser/integralUserInfoFD?integralUserId=${this.userId}`).then(res => {
|
||||
if (res?.data) {
|
||||
this.info = res.data
|
||||
}
|
||||
})
|
||||
},
|
||||
getList() {
|
||||
this.$http.post(`/app/appintegraldetail/list`, null, {
|
||||
params: {current: this.current, size: 10, integralUserId: this.userId}
|
||||
}).then(res => {
|
||||
if (res?.data) {
|
||||
this.list = [this.list, res.data.records || []].flat()
|
||||
}
|
||||
})
|
||||
},
|
||||
gotoRules() {
|
||||
uni.navigateTo({url: './integralRules'})
|
||||
}
|
||||
},
|
||||
onReachBottom() {
|
||||
this.current++
|
||||
this.getList()
|
||||
}
|
||||
}
|
||||
</script>
|
||||
<style scoped lang="scss">
|
||||
.gridIntegral {
|
||||
width: 100vw;
|
||||
min-height: 100vh;
|
||||
background-color: #f3f6f9;
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
align-items: center;
|
||||
|
||||
.bg-blue {
|
||||
width: 100%;
|
||||
height: 270px;
|
||||
background-color: #3975C6;
|
||||
}
|
||||
|
||||
.header-content {
|
||||
width: 690px;
|
||||
height: 408px;
|
||||
margin: -130px 0 40px;
|
||||
padding: 32px;
|
||||
box-sizing: border-box;
|
||||
position: relative;
|
||||
background: #FFF;
|
||||
border-radius: 16px;
|
||||
|
||||
.headerDataPane {
|
||||
|
||||
top: 76px;
|
||||
left: 0;
|
||||
right: 0;
|
||||
position: absolute;
|
||||
z-index: 9;
|
||||
|
||||
|
||||
.header-rank {
|
||||
flex-wrap: wrap;
|
||||
justify-content: space-around;
|
||||
}
|
||||
.header-user {
|
||||
padding: 0 64px;
|
||||
display: flex;
|
||||
justify-content: space-between;
|
||||
.user-name {
|
||||
font-size: 50px;
|
||||
font-weight: 500;
|
||||
}
|
||||
}
|
||||
.headerItem {
|
||||
text-align: center;
|
||||
font-size: 28px;
|
||||
font-family: PingFangSC-Regular, PingFang SC;
|
||||
font-weight: 400;
|
||||
color: #999999;
|
||||
line-height: 40px;
|
||||
|
||||
b {
|
||||
display: block;
|
||||
line-height: 50px;
|
||||
color: #000;
|
||||
font-size: 36px;
|
||||
font-family: DIN, DINAlternate-Bold, DINAlternate;
|
||||
margin-bottom: 10px;
|
||||
}
|
||||
|
||||
&.top {
|
||||
b {
|
||||
font-size: 104px;
|
||||
line-height: 122px;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
& > img {
|
||||
position: absolute;
|
||||
width: 342px;
|
||||
height: 220px;
|
||||
top: -60px;
|
||||
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;
|
||||
}
|
||||
|
||||
.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;
|
||||
}
|
||||
|
||||
.divider {
|
||||
width: 2px;
|
||||
height: 60px;
|
||||
background: #ededed;
|
||||
}
|
||||
}
|
||||
</style>
|
||||
@@ -58,7 +58,6 @@
|
||||
</div>
|
||||
</template>
|
||||
</u-waterfall>
|
||||
|
||||
</div>
|
||||
<!-- <AiEmpty v-else></AiEmpty> -->
|
||||
</div>
|
||||
|
||||
Reference in New Issue
Block a user