feat:完善功能
This commit is contained in:
@@ -7,9 +7,10 @@
|
||||
</Title1>
|
||||
<div class="flex pt-20">
|
||||
<div
|
||||
v-for="(item, index) in homeData?.scenicSpot"
|
||||
class="item"
|
||||
:class="{ core: index == 0, queue: index == 1, congestion: index == 2 }"
|
||||
v-for="(item, index) in homeData?.scenicSpot"
|
||||
:key="index"
|
||||
>
|
||||
<span class="label">{{ item.name }}</span>
|
||||
<div class="flex align-end">
|
||||
@@ -146,9 +147,9 @@
|
||||
<Title2 title="景区购票数" />
|
||||
<div class="ticket-wrap">
|
||||
<img src="@/assets/images/ticket.png" />
|
||||
<div> <span class="label">当日购票量:</span><countup endVal="768578" /> </div>
|
||||
<div> <span class="label">未来3天购票量:</span><countup endVal="768578" /> </div>
|
||||
<div> <span class="label">3天后购票量:</span><countup endVal="768578" /> </div>
|
||||
<div v-for="(item, index) in homeData?.admission" :key="index">
|
||||
<span class="label">{{ item.name }}:</span><countup :end-val="item.value" />
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
@@ -157,8 +158,12 @@
|
||||
<div class="box-1">
|
||||
<Title3 title="年龄/性别占比" />
|
||||
<age />
|
||||
<div class="count">总人数:<countup endVal="124563" /></div>
|
||||
<div class="cell pt-20" v-for="item in homeData?.userPortrait.genderRate">
|
||||
<div class="count">总人数:<countup :end-val="ageRateTotal" /></div>
|
||||
<div
|
||||
class="cell pt-20"
|
||||
v-for="(item, index) in homeData?.userPortrait.genderRate"
|
||||
:key="index"
|
||||
>
|
||||
<img class="icon" src="@/assets/images/man.png" />
|
||||
<div class="bg">
|
||||
<span class="text">{{ item.name }}性</span>
|
||||
@@ -181,7 +186,7 @@
|
||||
</div>
|
||||
<div class="box-1">
|
||||
<Title3 title="购票来源" />
|
||||
<div class="count">总人数:<countup endVal="124563" /></div>
|
||||
<div class="count">总人数:<countup :end-val="channelTotal" /></div>
|
||||
<ticket />
|
||||
</div>
|
||||
</div>
|
||||
@@ -196,6 +201,19 @@
|
||||
import ticket from './ticket.vue'
|
||||
|
||||
const homeData = inject('homeData')
|
||||
|
||||
const ageRateTotal = computed(() => {
|
||||
return homeData.value?.userPortrait.genderRate.reduce(
|
||||
(total, current) => Number(current.count) + total,
|
||||
0
|
||||
)
|
||||
})
|
||||
const channelTotal = computed(() => {
|
||||
return homeData.value?.userPortrait.channel.reduce(
|
||||
(total, current) => Number(current.count) + total,
|
||||
0
|
||||
)
|
||||
})
|
||||
</script>
|
||||
|
||||
<style lang="scss" scoped>
|
||||
|
||||
Reference in New Issue
Block a user