update
init
This commit is contained in:
@@ -0,0 +1,284 @@
|
||||
<template>
|
||||
<div class="ride-number">
|
||||
<div class="ride-top">
|
||||
<div class="tab-time">
|
||||
<div
|
||||
class="tab-time-item"
|
||||
v-for="(item, i) in dynamicText"
|
||||
:key="i"
|
||||
:class="[activeTab == i ? 'active' : '']"
|
||||
@click="setActiveTab(i)"
|
||||
v-text="item.text"
|
||||
></div>
|
||||
</div>
|
||||
<div class="date-panel">
|
||||
<van-icon name="arrow-left" />
|
||||
<span class="date-time">9月4日至9月10日</span>
|
||||
<van-icon name="arrow" />
|
||||
</div>
|
||||
<div class="statistics-container panel-m b-12">
|
||||
<div class="img-container">
|
||||
<img class="img" :src="dynamicText[activeTab].img" alt="" />
|
||||
</div>
|
||||
<div class="data-container">
|
||||
<div class="data-count">
|
||||
<p class="data-number">487</p>
|
||||
<p class="data-text">累计{{ dynamicText[activeTab].text }}里程</p>
|
||||
</div>
|
||||
<div class="data-count">
|
||||
<p class="data-number">123</p>
|
||||
<p class="data-text">平均时速(km/h)</p>
|
||||
</div>
|
||||
<div class="data-count">
|
||||
<p class="data-number">123</p>
|
||||
<p class="data-text">累计{{ dynamicText[activeTab].text }}时长(分钟)</p>
|
||||
</div>
|
||||
<div class="data-count">
|
||||
<p class="data-number">123</p>
|
||||
<p class="data-text">累计{{ dynamicText[activeTab].text }}消耗/千卡</p>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="statistics-chart panel-m card-bg b-12">
|
||||
<div class="statistics-chart-inner"> 图表1图表1 图表1图表1</div>
|
||||
</div>
|
||||
<div class="bar-data panel-m card-bg b-12">
|
||||
<div class="bar-data-item">
|
||||
<p>{{ cardText.text1 }}</p>
|
||||
<p><span class="bar-data-number">123</span> <span>km/h</span></p>
|
||||
</div>
|
||||
<div class="bar-data-item">
|
||||
<p>{{ cardText.text2 }}</p>
|
||||
<p><span class="bar-data-number">34</span> <span>分钟</span></p>
|
||||
</div>
|
||||
<div class="bar-data-item">
|
||||
<p>{{ cardText.text3 }}</p>
|
||||
<p><span class="bar-data-number">23</span> <span>千卡</span></p>
|
||||
</div>
|
||||
</div>
|
||||
<div class="highest-record panel-m">
|
||||
<p>{{ getHighestText(activeTab) }}</p>
|
||||
<div class="highest-content card-bg b-12">
|
||||
<div class="icon-time">
|
||||
<img class="first-icon" :src="firstIcon" alt="" />
|
||||
<span class="highest-time">2020-11-28</span>
|
||||
</div>
|
||||
<div class="highest-info">
|
||||
<span style="opacity: 0"> </span>
|
||||
<span>1362 <span>公里</span></span>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="ride-btn">录入</div>
|
||||
</div>
|
||||
</template>
|
||||
<script lang="ts" setup>
|
||||
import { useTabHooks } from '/@/hooks/useTab';
|
||||
import { dateText, firstIcon, getHighestText } from '/@/views/motion-data/common.data';
|
||||
import { rideCardText } from './hooks';
|
||||
import { computed } from 'vue';
|
||||
|
||||
const { activeTab, setActiveTab } = useTabHooks(0);
|
||||
let query = 'ride';
|
||||
const dynamicText = computed(() => {
|
||||
if (query == 'ride') {
|
||||
return dateText;
|
||||
}
|
||||
});
|
||||
const cardText = computed(() => {
|
||||
if (query == 'ride') {
|
||||
return rideCardText[activeTab.value];
|
||||
}
|
||||
});
|
||||
</script>
|
||||
|
||||
<style lang="less" scoped>
|
||||
@import '/@/assets/less/index.less';
|
||||
|
||||
p {
|
||||
margin: 0;
|
||||
}
|
||||
|
||||
.panel-m {
|
||||
margin: 6px 16px;
|
||||
}
|
||||
|
||||
.card-bg {
|
||||
background: #ffffff;
|
||||
}
|
||||
|
||||
.b-12 {
|
||||
border-radius: 12px;
|
||||
}
|
||||
|
||||
.ride-number {
|
||||
height: 100vh;
|
||||
background: #eeeeee;
|
||||
box-sizing: border-box;
|
||||
//padding-top: 16px;
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
justify-content: space-between;
|
||||
|
||||
.ride-top {
|
||||
height: calc(100vh - 80px);
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
overflow: auto;
|
||||
|
||||
.tab-time {
|
||||
margin: 10px 20px;
|
||||
padding: 2px;
|
||||
height: 35px;
|
||||
background: #ffffff;
|
||||
border-radius: 35px;
|
||||
display: flex;
|
||||
|
||||
.tab-time-item {
|
||||
flex: 1;
|
||||
color: #666666;
|
||||
font-size: 16px;
|
||||
.flex-center();
|
||||
|
||||
&.active {
|
||||
color: #fff;
|
||||
border-radius: 20px;
|
||||
background: #52c41a;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
.date-panel {
|
||||
display: flex;
|
||||
justify-content: center;
|
||||
align-items: center;
|
||||
font-size: 16px;
|
||||
|
||||
.date-time {
|
||||
margin: 0 10px;
|
||||
}
|
||||
}
|
||||
|
||||
.statistics-container {
|
||||
height: 140px;
|
||||
padding: 6px 0;
|
||||
background: #ffffff;
|
||||
.flex-center();
|
||||
|
||||
.img-container {
|
||||
width: 60px;
|
||||
height: 60px;
|
||||
margin: 0 16px;
|
||||
|
||||
.img {
|
||||
width: 100%;
|
||||
height: 100%;
|
||||
}
|
||||
}
|
||||
|
||||
.data-container {
|
||||
flex: 4;
|
||||
display: flex;
|
||||
flex-wrap: wrap;
|
||||
|
||||
.data-count {
|
||||
width: 50%;
|
||||
text-align: center;
|
||||
|
||||
.data-number {
|
||||
font-size: 20px;
|
||||
font-weight: bold;
|
||||
color: #333333;
|
||||
}
|
||||
|
||||
.data-text {
|
||||
font-size: 14px;
|
||||
font-weight: 500;
|
||||
color: #666666;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
.statistics-chart {
|
||||
//min-height: 240px;
|
||||
.statistics-chart-inner {
|
||||
min-height: 240px;
|
||||
}
|
||||
}
|
||||
|
||||
.bar-data {
|
||||
display: flex;
|
||||
flex-wrap: wrap;
|
||||
padding: 16px;
|
||||
|
||||
.bar-data-item {
|
||||
width: 50%;
|
||||
|
||||
& p,
|
||||
span {
|
||||
font-size: 14px;
|
||||
font-weight: 500;
|
||||
color: #666666;
|
||||
}
|
||||
|
||||
.bar-data-number {
|
||||
font-size: 20px;
|
||||
font-weight: bold;
|
||||
color: #333333;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
.highest-record {
|
||||
& > p {
|
||||
margin-bottom: 6px;
|
||||
font-size: 16px;
|
||||
}
|
||||
|
||||
.highest-content {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
padding: 16px;
|
||||
|
||||
.icon-time {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
}
|
||||
|
||||
.first-icon {
|
||||
width: 36px;
|
||||
height: 36px;
|
||||
}
|
||||
|
||||
.highest-time {
|
||||
flex: 1;
|
||||
margin: 0 15px 0 6px;
|
||||
}
|
||||
}
|
||||
|
||||
.highest-info {
|
||||
flex: 1;
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: space-between;
|
||||
font-size: 14px;
|
||||
font-weight: bold;
|
||||
color: #333333;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
.ride-btn {
|
||||
margin: 12px 15% 28px 15%;
|
||||
height: 40px;
|
||||
.flex-center();
|
||||
.qs-btn();
|
||||
border-radius: 40px;
|
||||
font-size: 20px;
|
||||
font-weight: 500;
|
||||
color: #ffffff;
|
||||
}
|
||||
}
|
||||
</style>
|
||||
Reference in New Issue
Block a user