You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
172 lines
3.5 KiB
172 lines
3.5 KiB
<template>
|
|
<view>
|
|
<!-- 添加 -->
|
|
<button class="shadow round bg-cyan add-btn iconfont icon-plus" hover-class="cc-active" @tap="openPage('/pages/add-stroke/add-stroke')"></button>
|
|
<view v-if="tableList && tableList.length>0" class="cu-timeline" :key="index" v-for="(item,index) in tableList">
|
|
<view class="cu-time">{{ item.startTime }}</view>
|
|
<!-- <view class="cu-time">{{ $moment(+item.date).format('MM-DD') }}</view> -->
|
|
<view class="cu-item cuIcon-timefill">
|
|
<view class="content shadow-blur">
|
|
{{ item.startTime }} 到 {{ item.endTime }}
|
|
</view>
|
|
</view>
|
|
<view class="cu-item cuIcon-tagfill text-blue">
|
|
<view class="content shadow-blur bg-blue light">
|
|
<view>
|
|
<text class="radius bg-blue margin-tb padding-xs" v-if="item.journeyType === '0'">返校行程</text>
|
|
<text class="radius bg-blue margin-tb padding-xs" v-if="item.journeyType === '1'">日常外出</text>
|
|
</view>
|
|
<view class="margin-top" v-if="item.together">
|
|
同行人:{{ item.together }}
|
|
</view>
|
|
<view v-for="trip in transports" :key="trip.id" class="margin-top" v-if="trip.value === item.tripMode">
|
|
出行方式:
|
|
{{ trip.name }}
|
|
</view>
|
|
<view class="margin-top">
|
|
乘坐航班车次或车牌号码及座位号:
|
|
{{ item.carNo }}
|
|
</view>
|
|
</view>
|
|
</view>
|
|
</view>
|
|
|
|
</view>
|
|
|
|
</template>
|
|
|
|
<script>
|
|
import {
|
|
showToast
|
|
} from 'common/script/util';
|
|
import { mapState,mapMutations } from 'vuex';
|
|
import {
|
|
GET_JOURNEYS
|
|
} from 'api/api';
|
|
|
|
export default {
|
|
data() {
|
|
return {
|
|
tableList: [],
|
|
transports: [
|
|
{
|
|
value: '0',
|
|
name: '铁路',
|
|
},
|
|
{
|
|
value: '1',
|
|
name: '飞机',
|
|
},
|
|
{
|
|
value: '2',
|
|
name: '客运车辆',
|
|
},
|
|
{
|
|
value: '3',
|
|
name: '自驾',
|
|
},
|
|
{
|
|
value: '4',
|
|
name: '船',
|
|
},
|
|
{
|
|
value: '5',
|
|
name: '其他',
|
|
}
|
|
],
|
|
// tableList: [
|
|
// {
|
|
// startTime: '02-04',
|
|
// endTime: '02-05',
|
|
// journeyType: '1',
|
|
// carNo: '35212',
|
|
// tripMode: '3',
|
|
// together: '张三'
|
|
// },
|
|
// ],
|
|
};
|
|
},
|
|
|
|
computed: mapState('user', ['token']),
|
|
|
|
created() {
|
|
this.getJourneys()
|
|
},
|
|
|
|
methods: {
|
|
// 查询行程
|
|
async getJourneys() {
|
|
try {
|
|
const { token } = this;
|
|
const params = {
|
|
param: {
|
|
token
|
|
}
|
|
};
|
|
const res = await this.$http.post(GET_JOURNEYS, params);
|
|
const {
|
|
success,
|
|
code,
|
|
msg,
|
|
data
|
|
} = res.data;
|
|
if (success && code === 200) {
|
|
this.success = true;
|
|
this.tableList = data;
|
|
} else {
|
|
uni.showToast({
|
|
title: msg || '获取健康打卡记录成功',
|
|
icon: 'none'
|
|
});
|
|
}
|
|
} catch (error) {
|
|
console.log('error: ', error);
|
|
if (error.msg) {
|
|
uni.showToast({
|
|
title: error.msg || '获取健康打卡记录失败',
|
|
icon: 'none'
|
|
});
|
|
}
|
|
}
|
|
},
|
|
|
|
},
|
|
};
|
|
</script>
|
|
|
|
<style lang="scss" scoped>
|
|
.data-wrap {
|
|
display: flex;
|
|
flex-direction: column;
|
|
align-items: left;
|
|
justify-content: flex-start;
|
|
padding: 40rpx 0;
|
|
|
|
.data-item {
|
|
display: flex;
|
|
flex-wrap: wrap;
|
|
align-items: left;
|
|
font-size: 36rpx;
|
|
margin-bottom: 20rpx;
|
|
|
|
.data-title{
|
|
line-height: 60rpx;
|
|
color: $black;
|
|
}
|
|
}
|
|
}
|
|
|
|
.add-btn{
|
|
position: fixed;
|
|
bottom: 40rpx;
|
|
right: 40rpx;
|
|
width: 96rpx;
|
|
height: 96rpx;
|
|
line-height: 96rpx;
|
|
padding: 0;
|
|
z-index: 1;
|
|
}
|
|
.add-btn::after{
|
|
border: none;
|
|
}
|
|
</style>
|
|
|