Commit b6d076ec by 匡雅琴

排名组件开发

1 parent 4e49c3a1
<template>
<div>
<div v-for="(item, index) in rankingsList" :key="index" class="ranking-box-item">
<div class="ranking-box-item-left">
<div class="circle" :style="{ 'background-image': index < 3 ? RankColor[index] : '' }">{{ index + 1 }}</div>
<div class="text">{{ item.name }}</div>
</div>
<div class="ranking-box-item-right">{{ item.value }}</div>
</div>
</div>
</template>
<script>
import datas from '@/utils/data'
export default {
name: 'Ranking',
props: {
rankingsList: {
type: Array,
default: () => []
}
},
data() {
return {
RankColor: datas.RankColor
}
},
mounted() {
},
methods: {}
}
</script>
<style lang="scss" scoped>
.ranking-box-item {
display: flex;
justify-content: space-between;
align-items: center;
padding-bottom: 4px;
&-left {
display: flex;
.circle {
width: 20px;
height: 20px;
border-radius: 20px;
font-size: 14px;
color: #ffffff;
text-align: center;
background: #1e3372;
}
.text {
font-weight: 400;
font-size: 14px;
color: #ffffff;
margin-left: 1.11vw;
cursor: default;
}
.text:hover {
padding-bottom: 1px;
border-bottom: 1px solid #fff;
}
}
&-right {
font-family: PingFangSC-Regular;
font-weight: 400;
font-size: 14px;
color: #95acd9;
text-align: right;
}
}
</style>
......@@ -20,6 +20,9 @@ const DefaultData = {
]
}
const RankColor = ['linear-gradient(180deg, #FFDA0B 0%, #FFBC24 100%)', 'linear-gradient(180deg, #EBE5D6 0%, #BDB4A6 100%)', 'linear-gradient(180deg, #EEC08E 0%, #B86E3A 100%)']
export default Object.freeze({
DefaultData
DefaultData,
RankColor
})
......@@ -23,13 +23,14 @@
</div>
<!-- 门店排行 -->
<div class="merchant-box">
<div v-for="(item, index) in merchantsList" :key="index" class="merchant-box-item">
<!-- <div v-for="(item, index) in merchantsList" :key="index" class="merchant-box-item">
<div class="merchant-box-item-left">
<div class="circle" :style="{ 'background-image': index < 3 ? perchaseColorList[index] : '' }">{{ index + 1 }}</div>
<div class="text">{{ item.name }}</div>
</div>
<div class="merchant-box-item-right">{{ item.value }}</div>
</div>
</div> -->
<ranking :rankingsList="merchantsList"></ranking>
</div>
</div>
</div>
......@@ -64,7 +65,7 @@ export default {
// 采购额排名当前选中值
purchase: '商城采购',
// 采购额排名前三图标颜色
perchaseColorList: ['linear-gradient(180deg, #FFDA0B 0%, #FFBC24 100%)', 'linear-gradient(180deg, #EBE5D6 0%, #BDB4A6 100%)', 'linear-gradient(180deg, #EEC08E 0%, #B86E3A 100%)'],
// perchaseColorList: ['linear-gradient(180deg, #FFDA0B 0%, #FFBC24 100%)', 'linear-gradient(180deg, #EBE5D6 0%, #BDB4A6 100%)', 'linear-gradient(180deg, #EEC08E 0%, #B86E3A 100%)'],
// 采购额排名门店数据
merchantsList: [
{
......@@ -267,42 +268,6 @@ export default {
}
.merchant-box {
margin-top: 2.06vh;
&-item {
display: flex;
justify-content: space-between;
align-items: center;
padding-bottom: 1vh;
&-left {
display: flex;
.circle {
width: 20px;
height: 20px;
border-radius: 20px;
font-size: 14px;
color: #ffffff;
text-align: center;
background: #1e3372;
}
.text {
font-weight: 400;
font-size: 14px;
color: #ffffff;
margin-left: 1.11vw;
cursor: default;
}
.text:hover {
padding-bottom: 1px;
border-bottom: 1px solid #fff;
}
}
&-right {
font-family: PingFangSC-Regular;
font-weight: 400;
font-size: 14px;
color: #95acd9;
text-align: right;
}
}
}
}
......
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!