Commit 5722a638 by huyue

学习之星修改为可配置

1 parent ab09f500
......@@ -181,5 +181,13 @@ module.exports = {
projectName: 'boutique',
...data
})
},
/** 查询勋章列表 */
searchLevelConfig(data) {
return http.post({
method: 'dj.api.car.boutique.resident.level.config.page',
projectName: 'boutique',
...data
})
}
}
......@@ -75,6 +75,11 @@
</view>
</template>
<script>
const GROUP_LIST = [
{ title: '学习之星', style: 'background: #FFFAED;', medalType: 1, logo: require('@/assets/images/point/study_star.png'), logo_grey: require('@/assets/images/point/study_grey.png'), content: '月度学习类积分排名前10名' },
{ title: '全勤之星', style: 'background: #FFFAED;', medalType: 2, logo: require('@/assets/images/point/time_star.png'), logo_grey: require('@/assets/images/point/time_grey.png'), content: '当月全勤准时打卡,不包含请假特批' },
{ title: '平板接待精英', style: 'background: #FFFAED;', medalType: 3, logo: require('@/assets/images/point/elite_star.png'), logo_grey: require('@/assets/images/point/elite_grey.png'), content: '平板接待月度无扣分记录' }
]
import point from '@/mixin/point'
export default {
mixins: [point],
......@@ -85,15 +90,11 @@ export default {
isHigh: false,
currentIndex: 0,
levelIndex: 100,
groupList: [
// { title: '学习之星', style: 'background: #FFFAED;', medalType: 1, logo: require('@/assets/images/point/study_star.png'), logo_grey: require('@/assets/images/point/study_grey.png'), content: '月度学习类积分排名前10名' },
{ title: '全勤之星', style: 'background: #FFFAED;', medalType: 2, logo: require('@/assets/images/point/time_star.png'), logo_grey: require('@/assets/images/point/time_grey.png'), content: '当月全勤准时打卡,不包含请假特批' },
{ title: '平板接待精英', style: 'background: #FFFAED;', medalType: 3, logo: require('@/assets/images/point/elite_star.png'), logo_grey: require('@/assets/images/point/elite_grey.png'), content: '平板接待月度无扣分记录' }
],
groupList: [],
couponList: [],
badgeList: [],
tabelTh: [{ title: '积分区间', width: 8 }],
tabelTr: [{ content: '奖惩规则(每月)' }]
tabelTr: [{ content: '奖惩规则(每月)' }],
}
},
props: {
......@@ -105,10 +106,19 @@ export default {
mounted() {
const { isHigh } = this.transfer || {}
this.isHigh = isHigh
console.log(this.transfer);
this.getLevelConfig()
},
methods: {
getLevelConfig() {
GROUP_LIST.forEach(item => {
if (this.transfer.levelConfig.find(i => i.levelName == item.title)) {
this.groupList.push(item)
}
})
},
getHtml(val) {
return val.replace(/\n/g, '<br/>')
if (val) return val.replace(/\n/g, '<br/>')
},
getDetail(countDate) {
this.getRule(1)
......@@ -140,7 +150,6 @@ export default {
const findData = res.find(i => i.medalType == item.medalType)
return { ...item, ...findData }
})
console.log(this.groupList)
}
if (levelType == 1) {
const th = res.map(item => {
......
......@@ -30,20 +30,34 @@
<view class="point-body">
<view class="point-detail">
<view class="point-item" v-for="(item, index) in pointList" :key="index">
<view class="item-header"><image :src="item.src" /></view>
<view class="item-header">
<image :src="item.src" />
</view>
<view class="item-body" :style="item.style">
<view class="item-logo" v-if="item.ranking > 3">{{ item.ranking }}</view>
<view class="item-image" v-else><image :src="require(`@/assets/images/point/${index == 0 ? 'crown_' : 'prize_'}${item.ranking || 1}.png`)" /></view>
<view class="item-image" v-else>
<image
:src="require(`@/assets/images/point/${index == 0 ? 'crown_' : 'prize_'}${item.ranking || 1}.png`)" />
</view>
<view class="item-name">{{ item.staffName }}</view>
<view v-if="item.badgeList && item.badgeList.length" :class="{ 'item-prize': index == 0, 'item-medal': index != 0 }"><image :src="index == 0 ? pointImg[item.badgeList[0].growthType - 1] : starImg[index - 1]" /></view>
<view v-if="item.badgeList && item.badgeList.length"
:class="{ 'item-prize': index == 0, 'item-medal': index != 0 }">
<image :src="index == 0 ? pointImg[item.badgeList[0].growthType - 1] : starImg[index - 1]" />
</view>
<view class="item-num">{{ item.pointValue }}</view>
</view>
<view class="desc-wrap">
<view class="item-body" v-for="(l, i) in item.list" :key="i">
<view class="item-logo" v-if="l.ranking > 3">{{ l.ranking }}</view>
<view class="item-image" v-else><image :src="require(`@/assets/images/point/${index == 0 ? 'crown_' : 'prize_'}${l.ranking || 0}.png`)" /></view>
<view class="item-image" v-else>
<image
:src="require(`@/assets/images/point/${index == 0 ? 'crown_' : 'prize_'}${l.ranking || 0}.png`)" />
</view>
<view class="item-name">{{ l.staffName }}</view>
<view v-if="l.badgeList && l.badgeList.length" :class="{ 'item-prize': index == 0, 'item-medal': index != 0 }"><image :src="index == 0 ? pointImg[l.badgeList[0].growthType - 1] : starImg[index - 1]" /></view>
<view v-if="l.badgeList && l.badgeList.length"
:class="{ 'item-prize': index == 0, 'item-medal': index != 0 }">
<image :src="index == 0 ? pointImg[l.badgeList[0].growthType - 1] : starImg[index - 1]" />
</view>
<view class="item-num">{{ l.pointValue }}</view>
</view>
</view>
......@@ -53,6 +67,33 @@
</view>
</template>
<script>
const POINT_LIST = [
{
id: 0,
title: '积分排行',
src: require('@/assets/images/point/point_bg.png'),
style: 'background: #fef2cb99;',
isCrown: true
},
{
id: 1,
title: '学习之星',
src: require('@/assets/images/point/study_bg.png'),
style: 'background-image: linear-gradient(270deg, #c2d8fc59 0%, #d1e9ff59 100%);'
},
{
id: 2,
title: '全勤之星',
src: require('@/assets/images/point/diligent_bg.png'),
style: 'background-image: linear-gradient(270deg, #c2d8fc59 0%, #d1e9ff59 100%);'
},
{
id: 3,
title: '平板接待精英',
src: require('@/assets/images/point/ipad_bg.png'),
style: 'background-image: linear-gradient(270deg, #c2d8fc59 0%, #d1e9ff59 100%);'
}
]
import point from '@/mixin/point'
import { get } from 'lodash'
export default {
......@@ -64,52 +105,47 @@ export default {
currentIndex: 0,
pointImg: [require('@/assets/images/point/bronze_ranking.png'), require('@/assets/images/point/silver_ranking.png'), require('@/assets/images/point/masonry_ranking.png')],
starImg: [require('@/assets/images/point/study_star.png'), require('@/assets/images/point/time_star.png'), require('@/assets/images/point/elite_star.png')],
pointList: [
{
src: require('@/assets/images/point/point_bg.png'),
style: 'background: #fef2cb99;',
isCrown: true
},
// {
// src: require('@/assets/images/point/study_bg.png'),
// style: 'background-image: linear-gradient(270deg, #c2d8fc59 0%, #d1e9ff59 100%);'
// },
{
src: require('@/assets/images/point/diligent_bg.png'),
style: 'background-image: linear-gradient(270deg, #c2d8fc59 0%, #d1e9ff59 100%);'
},
{
src: require('@/assets/images/point/ipad_bg.png'),
style: 'background-image: linear-gradient(270deg, #c2d8fc59 0%, #d1e9ff59 100%);'
}
],
pointList: [],
}
},
props: {
transfer: {
type: Object,
default: () => { }
}
},
mounted() {},
mounted() {
},
methods: {
getDetail(countDate) {
for (let i = 0; i < 3; i++) {
if(i != 0) {
this.getList(countDate, i + 1)
getLevelConfig(countDate) {
let i = 0
POINT_LIST.forEach(item => {
if (item.title == '积分排行') {
this.pointList.push(item)
this.getList(countDate, item.id, i)
i++
} else if (this.transfer.levelConfig.find(i => i.levelName == item.title)) {
this.pointList.push(item)
this.getList(countDate, item.id, i)
i++
}
}
this.getList(countDate)
})
},
getDetail(countDate) {
this.getLevelConfig(countDate)
},
updateDetail(countDate) {
this.getDetail(countDate)
},
getList(countDate, rankingType) {
console.log(rankingType);
uni.$api.pointApi.pointMonthRanking({ countDate, rankingType }).then(res => {
const i = rankingType ? rankingType : 0
getList(countDate, rankingType, index) {
const params = {
countDate
}
if (rankingType!= 0) params.rankingType = rankingType
uni.$api.pointApi.pointMonthRanking(params).then(res => {
const userInfo = uni.$storage.get('userInfo')
let myInfo = res.find(i => i.staffPhone == userInfo.phone)
if (rankingType) {
this.$set(this.pointList, i-1, { ...this.pointList[i-1], list: res, ...myInfo })
} else {
this.$set(this.pointList, i, { ...this.pointList[i], list: res, ...myInfo })
}
console.log(this.pointList);
this.$set(this.pointList, index, { ...this.pointList[index], list: res, ...myInfo })
})
}
}
......@@ -119,6 +155,7 @@ export default {
.point-box {
position: relative;
}
.nav-bar {
width: 100%;
height: 96rpx;
......@@ -126,6 +163,7 @@ export default {
margin-bottom: 12rpx;
display: flex;
align-items: center;
.back {
height: 100%;
aspect-ratio: 1/1;
......@@ -134,18 +172,22 @@ export default {
justify-content: center;
pointer-events: auto;
}
.month-box {
flex: 1;
.month-tabs {
display: flex;
justify-content: center;
align-items: center;
.tab-mid {
font-size: 32rpx;
color: #1a1a1a;
margin: 0 120rpx;
}
}
.tab-prev,
.tab-next {
display: flex;
......@@ -155,11 +197,13 @@ export default {
border-radius: 50%;
height: 48rpx;
background: #ffffff;
.tab-icon {
margin-left: -4rpx;
margin-top: 4rpx;
}
}
.tab-next {
.tab-icon {
margin-left: 2rpx;
......@@ -167,32 +211,39 @@ export default {
}
}
}
.point-body {
border-radius: 32rpx;
width: calc(100vw - 128rpx);
margin: 0 64rpx;
height: calc(100vh - 100rpx);
.body-top {
display: flex;
align-items: center;
margin-left: 80rpx;
.level-image {
width: 120rpx;
height: 120rpx;
}
.level-desc {
margin-left: 40rpx;
.level-name {
font-size: 36rpx;
color: #1a1a1a;
line-height: 60rpx;
font-weight: 700;
}
.level-num {
font-size: 24rpx;
color: #808291;
}
}
.level-score {
font-weight: 700;
font-size: 80rpx;
......@@ -200,24 +251,28 @@ export default {
margin-left: 64rpx;
}
}
.point-detail {
display: flex;
flex-wrap: nowrap;
width: 100%;
overflow-x: auto;
gap: 48rpx;
.point-item {
width: 688rpx;
background: #ffffff73;
box-shadow: inset 0 0 16rpx 0 #ffffff;
border-radius: 32rpx;
height: calc(100vh - 200rpx);
.item-header {
image {
width: 688rpx;
height: 128rpx;
}
}
.item-body {
height: 128rpx;
border-radius: 24rpx;
......@@ -225,6 +280,7 @@ export default {
display: flex;
align-items: center;
padding: 0 32rpx;
.item-logo {
width: 80rpx;
height: 80rpx;
......@@ -237,6 +293,7 @@ export default {
text-align: center;
box-sizing: border-box;
}
.item-image {
width: 80rpx;
box-sizing: border-box;
......@@ -247,38 +304,46 @@ export default {
display: flex;
align-items: center;
justify-content: center;
image {
width: 56rpx;
height: 56rpx;
}
}
.item-name {
font-size: 30rpx;
color: #181a1f;
margin-left: 20rpx;
}
.item-prize {
flex: 1;
text-align: right;
margin-right: 48rpx;
image {
width: 148rpx;
height: 56rpx;
}
}
.item-medal {
margin-left: 16rpx;
image {
width: 48rpx;
height: 48rpx;
}
}
.item-num {
font-size: 32rpx;
color: #181a1f;
margin-left: auto;
}
}
.desc-wrap {
height: calc(100% - 292rpx);
overflow-y: auto;
......
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!