Commit 5722a638 by huyue

学习之星修改为可配置

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