OfficeApp/subpkg/property/vehicle_a.vue

481 lines
9.3 KiB
Vue
Raw Normal View History

2023-08-24 18:32:34 +08:00
<template>
<view>
2023-08-25 10:16:31 +08:00
<!-- 有车辆 -->
<view v-if="1">
2023-08-24 18:32:34 +08:00
<view class="content">
2023-08-25 10:16:31 +08:00
<view :class="allMap?'map1':'map2'" style="position: relative;">
<map :class="mapClass" id="map" :enable-zoom="true" :polyline="polyline" :markers='markers'
:scale="scale" style="width:100%;height: 100%;" :latitude="markers[0].latitude"
:enable-scroll="true" :longitude="markers[0].longitude" @tap="allMap=!allMap">
2023-08-24 18:32:34 +08:00
</map>
</view>
2023-08-25 10:16:31 +08:00
<view v-if="!allMap">
<view class="query">
<!-- <u--input placeholder="请选择日期" suffixIcon="clock" class="ipt" border="surround"
v-model="queryData" @focus='fousFn'></u--input> -->
<view class="ipt" @click="showDate=true">
<text>{{queryData}}</text>
<u-icon name="clock" size="24"></u-icon>
2023-08-24 18:32:34 +08:00
</view>
2023-08-25 10:16:31 +08:00
<u-button type="primary" class='poline_btn' @click="showPloyline" text="显示轨迹"></u-button>
</view>
<view class="personnel_list" @click="toDetail('/subpkg/property/vehicle')">
<view class="cards">
<view class="cards_head">
<text>车牌号</text>
</view>
<view class="cards_content">
<view class="right">
<view class="li">
<text>行驶总里程: </text>
<text> { item.name }</text>
</view>
<view class="li">
<text>本公司签约时间: </text>
<text>{ item.phone }</text>
</view>
<view class="li">
<text>承租公司: </text>
<text> 所属片区 </text>
</view>
<view class="li">
<text>负责人: </text>
<text> 所属片区 </text>
</view>
<view class="li">
<text>联系方式: </text>
<text> 所属片区 </text>
</view>
<view class="li">
<text>所属区域: </text>
<text> 所属片区 </text>
</view>
<view class="li">
<text>承租时间: </text>
<text> 所属片区 </text>
</view>
2023-08-24 18:32:34 +08:00
</view>
</view>
</view>
</view>
2023-08-25 10:16:31 +08:00
</view>
2023-08-24 18:32:34 +08:00
</view>
2023-08-25 10:16:31 +08:00
<u-calendar @close='showDate=false' :show="showDate" @confirm="dataFn"></u-calendar>
2023-08-24 18:32:34 +08:00
</view>
2023-08-25 10:16:31 +08:00
<!-- 没有车辆 -->
2023-08-24 18:32:34 +08:00
<view class="" v-else>
<view class="" v-if="!isMycar">
<view class="empty_car">
<view>
您还没有所属车辆哦,请等待镇公司发放车辆或使用自有车辆并绑定系统
</view>
<u-button @click="showPop=true" type="primary" class="btn_cls">
上传自有车辆</u-button>
</view>
<view class="">
<u-modal :show="showPop" @close="showPop=false" @confirm="confirm" :closeOnClickOverlay="true"
title="请输入车牌号">
<view class="slot-content">
<u--input placeholder="请输入内容" v-model="myCarnum"></u--input>
</view>
</u-modal>
</view>
</view>
<view style="text-align: center;margin-top: 100rpx;" v-if="isMycar">
您上传自有车两,系统正在审核中,请耐心等待
</view>
</view>
</view>
</template>
<script>
import mybtn from "@/components/mybtn/mybtn.vue"
import {
taskTricycleDetail,
taskAddTricycleCoordinate
} from "@/api/task.js"
import {
Toast
} from "../../libs/uniApi";
export default {
components: {
mybtn
},
data() {
return {
2023-08-25 10:16:31 +08:00
allMap: false,
showDate: false,
2023-08-24 18:32:34 +08:00
isMycar: false,
2023-08-25 10:16:31 +08:00
showPop: false,
queryData: "请选择时间",
2023-08-24 18:32:34 +08:00
myCarnum: "",
mapClass: 'custom-map',
scale: 17,
markers: [
// 目的地
{
id: 1,
latitude: 28.8733,
longitude: 105.445717,
iconPath: '../../static/img/logistics/WZ.png', //显示的图标
},
// 当前所在位置
{
id: 2,
2023-08-25 10:16:31 +08:00
latitude: 28.8733,
longitude: 105.444828,
2023-08-24 18:32:34 +08:00
iconPath: '../../static/img/logistics/QS.png', //显示的图标
}
],
polyline: [],
2023-08-25 10:16:31 +08:00
2023-08-24 18:32:34 +08:00
}
},
onLoad(options) {
2023-08-25 10:16:31 +08:00
2023-08-24 18:32:34 +08:00
},
methods: {
2023-08-25 10:16:31 +08:00
fousFn() {
uni.hideKeyboard()
this.showDate = true
},
dataFn(e) {
console.log(e)
this.queryData = e[0]
this.showDate = false
},
2023-08-24 18:32:34 +08:00
confirm() {
if (this.myCarnum) {
console.log(this.myCarnum)
this.showPop = false
this.isMycar = true
}
},
2023-08-25 10:16:31 +08:00
showPloyline() {
// points: points,
// color: "#0091ff",
// dottedLine: true,
// width: 30,
let points = [{
latitude: 28.916022,
longitude: 105.442732,
2023-08-24 18:32:34 +08:00
},
2023-08-25 10:16:31 +08:00
{
latitude: 28.916848,
longitude: 105.443175,
},
{
latitude: 28.916918,
longitude: 105.443269,
2023-08-24 18:32:34 +08:00
},
2023-08-25 10:16:31 +08:00
{
latitude: 28.917041,
longitude: 105.443466,
},
{
latitude: 28.917073,
longitude: 105.443522,
},
{
latitude: 28.91705,
longitude: 105.443607,
},
{
latitude: 28.917057,
longitude: 105.443643,
},
{
latitude: 28.916925,
longitude: 105.443546,
},
{
latitude: 28.916796,
longitude: 105.443466,
},
{
latitude: 28.916615,
longitude: 105.443344,
},
{
latitude: 28.916437,
longitude: 105.443274,
},
{
latitude: 28.916356,
longitude: 105.443222,
},
{
latitude: 28.916515,
longitude: 105.442643,
},
{
latitude: 28.916591,
longitude: 105.442448,
},
{
latitude: 28.916944,
longitude: 105.442338,
},
{
latitude: 28.91706,
longitude: 105.442376,
},
{
latitude: 28.917169,
longitude: 105.442489,
},
{
latitude: 28.917345,
longitude: 105.442601,
},
{
latitude: 28.917433,
longitude: 105.442663,
},
{
latitude: 28.917461,
longitude: 105.442683,
},
{
latitude: 28.917461,
longitude: 105.442683,
},
{
latitude: 28.917518,
longitude: 105.442874,
},
{
latitude: 28.917537,
longitude: 105.443032,
},
{
latitude: 28.917537,
longitude: 105.443032,
},
{
latitude: 28.917497,
longitude: 105.443198,
},
{
latitude: 28.917409,
longitude: 105.443256,
},
{
latitude: 28.91732,
longitude: 105.443318,
},
{
latitude: 28.917234,
longitude: 105.443442,
},
{
latitude: 28.917072,
longitude: 105.443497,
},
{
latitude: 28.916977,
longitude: 105.443539,
},
{
latitude: 28.916867,
longitude: 105.443529,
},
{
latitude: 28.916867,
longitude: 105.443529,
},
{
latitude: 28.916761,
longitude: 105.443404,
},
{
latitude: 28.916722,
longitude: 105.443274,
},
{
latitude: 28.916762,
longitude: 105.443132,
},
]
this.polyline = [{
points: points,
color: "#0091ff",
dottedLine: true,
width: 30,
}]
2023-08-24 18:32:34 +08:00
},
},
onPullDownRefresh() {
// this.getOrderList();
// this.getIndexList()
uni.stopPullDownRefresh();
},
}
</script>
<style lang='scss' scoped>
.empty_car {
padding: 200rpx 50rpx;
.btn_cls {
background-color: #0122C7;
border: none;
width: 40vw;
margin: 20rpx auto;
}
}
2023-08-25 10:16:31 +08:00
.query {
display: flex;
background-color: #F5F5F5;
margin: 20rpx 0 0 0;
.ipt {
background-color: white;
width: 60vw;
border-radius: 10rpx;
padding: 10rpx;
display: flex;
justify-content: space-between;
line-height: 60rpx;
padding-left: 30rpx;
/* margin: 0 auto; */
/* line-height: auto; */
}
.poline_btn {
width: 20vw;
margin-left: 20rpx;
background-color: $theme-oa-color;
border: none;
}
}
2023-08-24 18:32:34 +08:00
.personnel_list {
padding: 28rpx 0;
margin-bottom: 130rpx;
.empty {
padding-top: 200rpx;
text-align: center;
.btn {
width: 30vw;
margin-top: 10rpx;
margin: 10rpx auto;
}
// height: 80vh;
// background-color: red;
}
.cards {
margin: 0 auto;
margin-bottom: 28rpx;
width: 694rpx;
background: #ffffff;
border-radius: 30rpx;
opacity: 1;
overflow: hidden;
// box-shadow: 2px 2px 4px rgba(0, 0, 0, 0.6);
.cards_head {
padding: 28rpx;
background-color: $theme-oa-color;
color: white;
height: 100rpx;
display: flex;
justify-content: space-between;
}
.cards_content {
padding: 10rpx 28rpx;
display: flex;
justify-content: space-between;
.left {
text-align: center;
// padding: 15rpx 25rpx;
padding-top: 20rpx;
width: 160rpx;
background-color: $theme-oa-color;
color: white;
border-radius: 40rpx;
.cir {
width: 120rpx;
height: 120rpx;
background-color: #ffffff;
margin-left: 25rpx;
border-radius: 120rpx;
position: relative;
}
}
.right {
display: flex;
flex-direction: column;
justify-content: space-between;
.li {
margin: 10rpx 0;
width: 85vw;
.check_box {
// background-color: #ff0000;
// color: red;
}
// background-color: red;
text:nth-child(1) {
margin-right: 20rpx;
}
}
}
}
}
}
.custom-map /deep/ .polyline {
stroke-width: 20px;
}
.content {
padding: 2vh 3vw;
background-color: #F5F5F5;
height: 100vh;
box-sizing: border-box;
}
2023-08-25 10:16:31 +08:00
.map1 {
height: 100vh;
width: 100vw;
2023-08-24 18:32:34 +08:00
border-radius: 2vw;
overflow: hidden;
}
2023-08-25 10:16:31 +08:00
.map2 {
height: 30vh;
border-radius: 2vw;
overflow: hidden;
2023-08-24 18:32:34 +08:00
}
</style>