清除小程序员工积分

This commit is contained in:
aixianling
2022-05-20 08:58:33 +08:00
parent ddc6741756
commit c67b8ddac5
2 changed files with 4 additions and 271 deletions

View File

@@ -3,12 +3,12 @@
<div class="credit-points">
<div class="fixed-top">
<div class="header-tab">
<div class="tab-item" v-for="(item, index) in tabList" :key="index" @click="tabClick(index)">{{ item }}<span class="active-line" v-if="tabIndex == index"></span></div>
<div class="tab-item" v-for="(item, index) in tabList" :key="index" @click="tabClick(index)">{{ item }}
<span class="active-line" v-if="tabIndex == index"/></div>
</div>
</div>
<family-rank v-if="tabIndex == 0" :showDetail="showDetail"></family-rank>
<user-rank v-if="tabIndex == 1" :showDetail="showDetail"></user-rank>
<work-rank v-if="tabIndex == 2"></work-rank>
</div>
</div>
</template>
@@ -16,14 +16,14 @@
import {mapState} from 'vuex'
import userRank from './components/userRank.vue'
import familyRank from './components/familyRank.vue'
import workRank from './components/workRank.vue'
export default {
name: "AppCreditPoints",
appName: "我的积分",
computed: {
...mapState(['user', 'token'])
},
components: {userRank, familyRank, workRank},
components: {userRank, familyRank},
data() {
return {
tabList: ['家庭积分', '个人积分'],

View File

@@ -1,267 +0,0 @@
<template>
<div class="page">
<div class="bg-blue"></div>
<div class="header-content">
<!-- <div class="item">
<div class="num color-5AAD6A">{{ info['家庭积分'] || '0' }}</div>
<div class="label">家庭总分</div>
</div>
<div class="item">
<div class="num color-4185F5">{{ info['剩余总分'] || '0' }}</div>
<div class="label">剩余总分</div>
</div>
<div class="item">
<div class="num color-CD413A">{{ info['家庭排行'] || '0' }}</div>
<div class="label">家庭排名</div>
</div> -->
<div class="left-content">
<p class="info"><span>绑定账号</span>当前未绑定账号</p>
<p class="info num"><span>总积分</span>4233</p>
</div>
<div class="cancel-btn">解除账号绑定</div>
<img src="https://cdn.cunwuyun.cn/dvcp/credit/head.png" alt="">
</div>
<div class="btn" @click="toBind()">进行账号绑定</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>{{ item.residentName + ':' }}{{ item.ruleName }}</p>
<span>&nbsp;&nbsp;&nbsp;{{ item.doTime }}</span>
</div>
<div class="item-num" :class="'color-'+ (item.changeIntegral >= 0 ? 0 : 1)">
{{ item.changeIntegral > 0 ? '+' + item.changeIntegral : item.changeIntegral }}
</div>
</div>
</div>
</div>
</template>
<script>
import {mapState} from 'vuex'
export default {
name: "workRank",
appName: "员工积分",
computed: {
...mapState(['user', 'token'])
},
data() {
return {
info: {},
current: 1,
list: [],
}
},
mounted() {
this.getInfo()
},
methods: {
// 积分排行
getInfo() {
this.info = {}
// var url = `/app/appresident/rank?id=00255e188d1225f3fe022cb4eed44a84&type=${this.tabIndex}` //积分排行
var url = `/app/appresident/rank?id=${this.user.residentId}&type=0&areaId=${this.user?.areaId}` //积分排行
this.$instance.post(url).then(res => {
if (res.code === 0) {
this.info = res.data
}
})
},
getList() {
// var url = `/app/appvillagerintegraldetail/IntegralList?residentId=00255e188d1225f3fe022cb4eed44a84&type=${this.tabIndex}&current=${this.current}&size=10` //积分明细
let url = `/app/appvillagerintegraldetail/IntegralList?residentId=${this.user.residentId}&type=1&current=${this.current}&size=10` //积分明细
this.$instance.post(url).then(res => {
if (res?.data) {
if (this.current > res.data.pages) {
return
}
this.list = this.current > 1 ? [...this.list, ...res.data.records] : res.data.records
}
})
},
toBind() {
console.log(123)
uni.$emit('toBindWorkUser')
}
},
onReachBottom() {
if (this.list.length < 50) {
this.current++;
this.getList()
}
},
}
</script>
<style scoped lang="scss">
.page {
width: 100vw;
overflow-x: hidden;
background-color: #f3f6f9;
.bg-blue {
width: 100%;
height: 176px;
background-color: #4181FF;
}
.header-content {
width: 690px;
height: 184px;
background: #FFF;
border-radius: 16px;
margin: -130px 0 40px 30px;
padding: 32px;
box-sizing: border-box;
position: relative;
.left-content{
position: absolute;
top: 32px;
left: 32px;
z-index: 99;
}
.info{
height: 40px;
font-size: 28px;
font-family: PingFangSC-Regular, PingFang SC;
color: #333;
line-height: 40px;
span{
display: inline-block;
width: 140px;
color: #999;
}
}
.num{
margin-top: 40px;
font-size: 40px;
font-family: DINAlternate-Bold, DINAlternate;
font-weight: bold;
color: #5AAD6A;
line-height: 48px;
span{
display: inline-block;
width: 140px;
color: #999;
font-weight: 400;
font-size: 28px;
line-height: 40px;
}
}
.cancel-btn{
width: 198px;
height: 56px;
line-height: 56px;
text-align: center;
border-radius: 28px;
border: 1px solid #4181FF;;
font-size: 26px;
font-family: PingFangSC-Regular, PingFang SC;
font-weight: 400;
color: #4181FF;
position: absolute;
bottom: 32px;
right: 32px;
z-index: 99
;
}
img {
position: absolute;
width: 360px;
height: 250px;
top: -40px;
right: 0;
}
}
.btn{
width: 480px;
height: 88px;
line-height: 88px;
text-align: center;
background: #4181FF;
border-radius: 44px;
margin: 160px 0 0 136px;
font-size: 34px;
font-family: PingFangSC-Medium, PingFang SC;
font-weight: 500;
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;
}
}
</style>