This commit is contained in:
Sliverber 2024-06-05 18:11:17 +08:00
parent ebbb4f3b69
commit d4d8f0793e
7 changed files with 866 additions and 677 deletions

View File

@ -24,6 +24,7 @@ const install = (Vue, vm) => {
// baseUrl: 'http://192.168.2.6:8080',
// baseUrl: 'http://124.221.246.124:2289',
baseUrl: 'https://dche.ccttiot.com/prod-api',
// baseUrl: 'https://dianche.chuantewulian.cn/prod-api',
loadingText: '努力加载中~',
loadingTime: 800,
// 设置自定义头部content-type

View File

@ -1,3 +1,5 @@
复制代码
<template>
<view class="page">
<u-navbar title="地图" :border-bottom="false" :background="bgc" title-color='#2E4975' title-size='36'
@ -61,7 +63,6 @@
},
onShow() {
this.$store.dispatch('userInfo', this.$u).then(() => {
// ...
});
this.getArea()
@ -76,119 +77,89 @@
},
methods: {
onMarkerTap(e) {
if (e.type === 'markertap') {
console.log('点击了标记:', e.markerId);
//
//
this.sn = e.markerId
this.todetail()
}
console.log('点击了标记:', e);
this.sn = e.detail.markerId;
this.todetail();
},
todetail() {
for (let item of this.fixdata) {
if (item.sn == this.sn) {
uni.navigateTo({
url:'/page_fix/repair/repair_detail?id='+item.id
})
}
}
for (let item of this.eledata) {
if (item.sn == this.sn) {
uni.navigateTo({
url:'/page_fix/repair/repair_detail?id='+item.id
})
}
}
console.log("no");
url: '/page_fix/repair/repair_index?id=' + this.sn
});
},
getmarks() {
this.$u.get(`/appVerify/adminOrder/list?adminId=` + 2).then((res) => {
if (res.code == 200) {
console.log('调用了');
this.listData = res.rows;
this.fixdata = [];
this.eledata = [];
res.rows.forEach(item => {
if (item.type == 1) {
if (item.type == 1&&item.status==2) {
this.fixdata.push(item);
console.log(this.fixdata, 'this.fixdata');
} else if (item.type == 2) {
} else if (item.type == 2&&item.status==2) {
this.eledata.push(item);
}
//
});
setTimeout(() => {
this.fixdata.forEach(item => {
this.markers.push({
id: parseFloat(item.sn),
latitude: parseFloat(item.latitude),
longitude: parseFloat(item.longitude),
// title: item.deviceName,
width: 40,
height: 40,
iconPath: 'https://lxnapi.ccttiot.com/bike/img/static/u1UD93BU1vfshWFoDwgX',
})
})
}, 100)
setTimeout(() => {
this.eledata.forEach(item => {
this.markers.push({
id: parseFloat(item.sn),
latitude: parseFloat(item.latitude),
longitude: parseFloat(item.longitude),
// title: item.deviceName,
width: 40,
height: 40,
iconPath: 'https://lxnapi.ccttiot.com/bike/img/static/u4UKmB47AxOj3YKIaajM',
})
})
console.log(this.markers, ' this.markers this.markers');
}, 200)
// this.markers = markers;
this.updateMarkers();
} else {
//
console.error('接口返回错误:', res);
}
}).catch(error => {
//
console.error("接口请求失败:", error);
});
},
updateMarkers() {
this.markers = [];
const markerIds = new Set(); // id
const addMarker = (item, iconPath) => {
const id = parseFloat(item.sn);
if (!markerIds.has(id)) {
markerIds.add(id);
this.markers.push({
id: id,
latitude: parseFloat(item.latitude),
longitude: parseFloat(item.longitude),
width: 40,
height: 40,
iconPath: iconPath,
});
}
};
this.fixdata.forEach(item => {
addMarker(item, 'https://lxnapi.ccttiot.com/bike/img/static/u1UD93BU1vfshWFoDwgX');
});
this.eledata.forEach(item => {
addMarker(item, 'https://lxnapi.ccttiot.com/bike/img/static/u4UKmB47AxOj3YKIaajM');
});
console.log(this.markers, '更新后的标记');
},
topage() {
uni.navigateTo({
url: '/page_fix/repair/repair_index'
})
});
},
getordernum() {
//
this.$u.get('/appVerify/adminOrder/num?adminId=' + 2).then((res) => {
if (res.code === 200) {
// 线
this.infonum=res.data
// console.log(this.polyline);
this.infonum = res.data;
}
}).catch(error => {
console.error("Error fetching area data:", error);
console.error("获取订单数量数据失败:", error);
});
},
getArea() {
//
this.$u.get('/app/area/list').then((res) => {
if (res.code === 200) {
// 线
const polylines = res.rows
.filter(area => area.boundaryStr) // boundary
const polylines = res.rows.filter(area => area.boundaryStr)
.map(area => this.convertBoundaryToPolyline(area.boundaryStr));
// 线
this.polyline = polylines;
// console.log(this.polyline);
}
}).catch(error => {
console.error("Error fetching area data:", error);
console.error("获取区域数据失败:", error);
});
},
convertBoundaryToPolylines(boundaries) {
@ -198,11 +169,11 @@
try {
coords = JSON.parse(boundary);
} catch (error) {
console.error("Error parsing boundary JSON:", error);
console.error("解析边界 JSON 失败:", error);
return null;
}
if (!Array.isArray(coords)) {
console.error("Parsed boundary is not an array:", coords);
console.error("解析的边界不是数组:", coords);
return null;
}
const points = coords.map(coord => ({
@ -211,47 +182,37 @@
}));
return {
points: points,
fillColor: "#55888840", //
strokeColor: "#558888", //
strokeWidth: 2, //
zIndex: 1, //
fillColor: "#55888840",
strokeColor: "#558888",
strokeWidth: 2,
zIndex: 1,
};
}).filter(polyline => polyline !== null); // 线
}).filter(polyline => polyline !== null);
},
getParking() {
//
this.$u.get('/app/parking/list').then((res) => {
if (res.code === 200) {
//
const validBoundaries = res.rows.map(row => row.boundaryStr).filter(boundary =>
typeof boundary === 'string' && boundary.trim() !== '');
const validBoundaries = res.rows.map(row => row.boundaryStr).filter(boundary => boundary);
const polylines = this.convertBoundaryToPolylines(validBoundaries);
// this.polyline
this.polyline = this.polyline.concat(polylines);
console.log(this.polyline);
}
}).catch(error => {
console.error("Error fetching parking data:", error);
console.error("获取停车数据失败:", error);
});
},
convertBoundaryToPolyline(boundary) {
if (!boundary) return null;
const points = JSON.parse(boundary).map(coord => ({
latitude: coord[1],
longitude: coord[0]
}));
const polyline = {
return {
points: points,
fillColor: "#55888840", //
strokeColor: "#22FF00", //
strokeWidth: 2, //
zIndex: 1, //
fillColor: "#55888840",
strokeColor: "#22FF00",
strokeWidth: 2,
zIndex: 1,
};
return polyline;
},
}
}

View File

@ -111,14 +111,14 @@
</view>
<view class="info_li" @click="mapFun()">
<view class="info_li" @click="mapFun()" style="align-items: flex-start;">
<view class="info_li_left">
设备位置
</view>
<view class="info_li_right">
<view class="info_li_right" style="display: inline;width: 62%;">
{{info.address}}
</view>
<image src="https://lxnapi.ccttiot.com/bike/img/static/uklW7KIegcLR6E7DTOGO" mode=""></image>
<image src="https://lxnapi.ccttiot.com/bike/img/static/uklW7KIegcLR6E7DTOGO" mode="" style="width: 46rpx;"></image>
</view>
</view>
<view class="fix_info" v-if="info.type==1">
@ -182,11 +182,11 @@
<image src="https://lxnapi.ccttiot.com/bike/img/static/uCQgmzKCxtkLtZTeMgRC" mode=""></image>
换电信息
</view>
<view class="info_li">
<view class="info_li"style="align-items: flex-start;word-wrap: break-word;">
<view class="info_li_left">
换电单号
</view>
<view class="info_li_right">
<view class="info_li_right" style="display: inline;width: 70%;">
{{info.orderNo}}
</view>
</view>
@ -249,8 +249,8 @@
</view>
</view>
</view>
<view class="page2" v-if="curtitidx==1">
<view class="timebox">
<view class="page2" v-if="curtitidx==1" style="padding: 30rpx;padding-left: 80rpx;">
<view class="timebox" style="padding: 30rpx;">
<u-time-line >
<u-time-line-item v-for="(imte,index ) in history" :key="index" >
@ -603,6 +603,7 @@ page{
}
}
.page1{
padding-bottom: 250rpx;
.device_info{
margin: 32rpx auto;
padding: 32rpx 28rpx;
@ -696,6 +697,8 @@ page{
}
}
.bot_btn{
position: fixed;
bottom: 0;
display: flex;
flex-wrap: wrap;
padding: 40rpx 18rpx;

View File

@ -4,9 +4,9 @@
height='36'></u-navbar>
<view class="top">
<view class="search_box">
<view class="search_center">
<input type="text" class="ips" v-model="code" placeholder="编码/报修单号" placeholder-style='font-weight: 400;font-size: 36rpx;color: #808080;' />
<input type="text" class="ips" v-model="code" placeholder="编码/报修单号"
placeholder-style='font-weight: 400;font-size: 36rpx;color: #808080;' />
</view>
<view class="search_right">
搜索
@ -28,10 +28,12 @@
</view>
</view>
<view class="warp_box">
<swiper class="swiper" :style="{ height: swiperHeight + 'rpx' }" :current='curtitidx' @change="swiperchange" next-margin='-20rpx'>
<swiper class="swiper" :style="{ height: swiperHeight + 'rpx' }" :current='curtitidx' @change="swiperchange"
next-margin='-20rpx'>
<swiper-item>
<view class="swiper-item ">
<view class="card" v-for="(item,index) in listData" :key="index" v-if="item.status!=1" @click="todetail(item.id)">
<view class="card" v-for="(item, index) in filteredListData" :key="index" v-if="item.status!=1"
@click="todetail(item.id)">
<view class="card_top">
<view class="card_top_left">
<image src="https://lxnapi.ccttiot.com/bike/img/static/uacJ7fdNpS3llY54ZaUi" mode=""></image>
@ -91,7 +93,8 @@
</swiper-item>
<swiper-item>
<view class="swiper-item ">
<view class="card" v-for="(item,index) in eledata" :key="index" v-if="item.status!=1" @click="todetail(item.id)">
<view class="card" v-for="(item, index) in filteredEleData" :key="index" v-if="item.status!=1"
@click="todetail(item.id)">
<view class="card_top">
<view class="card_top_left">
<image src="https://lxnapi.ccttiot.com/bike/img/static/uacJ7fdNpS3llY54ZaUi" mode=""></image>
@ -106,7 +109,7 @@
报修单号
</view>
<view class="cont_info_right">
2126459452821387
{{item.orderNo}}
</view>
</view>
<view class="cont_info">
@ -114,7 +117,7 @@
设备编号
</view>
<view class="cont_info_right">
DS-21674651
{{item.sn}}
</view>
</view>
<view class="cont_info">
@ -122,7 +125,7 @@
故障部位
</view>
<view class="cont_info_right">
车把刹车
{{item.faultTypeStr}}
</view>
</view>
<view class="card_bot">
@ -149,7 +152,8 @@
</swiper-item>
<swiper-item>
<view class="swiper-item ">
<view class="card" v-for="(item,index) in fixdata" :key="index" v-if="item.status!=1" @click="todetail(item.id)">
<view class="card" v-for="(item, index) in filteredFixData" :key="index" v-if="item.status!=1"
@click="todetail(item.id)">
<view class="card_top">
<view class="card_top_left">
<image src="https://lxnapi.ccttiot.com/bike/img/static/uacJ7fdNpS3llY54ZaUi" mode=""></image>
@ -164,7 +168,7 @@
报修单号
</view>
<view class="cont_info_right">
2126459452821387
{{item.orderNo}}
</view>
</view>
<view class="cont_info">
@ -172,7 +176,7 @@
设备编号
</view>
<view class="cont_info_right">
DS-21674651
{{item.sn}}
</view>
</view>
<view class="cont_info">
@ -180,7 +184,7 @@
故障部位
</view>
<view class="cont_info_right">
车把刹车
{{item.faultTypeStr}}
</view>
</view>
<view class="card_bot">
@ -207,22 +211,21 @@
</swiper-item>
<swiper-item>
<view class="swiper-item ">
<view class="card" v-for="(item,index ) in alreadyList" :key="index" @click="todetail(item.id)">
<view class="card" v-for="(item, index) in filteredAlreadyList" :key="index" @click="todetail(item.id)">
<view class="card_top">
<view class="card_top_left">
<image src="https://lxnapi.ccttiot.com/bike/img/static/uacJ7fdNpS3llY54ZaUi" mode=""></image>
电单车
</view>
<view class="card_top_right">
2024-03-24 22:28:51
{{item.createTime}}
</view>
</view>
<view class="cont_info">
<view class="cont_info_left">
报修单号
{{item.orderNo}}
</view>
<view class="cont_info_right">
</view>
</view>
<view class="cont_info">
@ -230,7 +233,7 @@
设备编号
</view>
<view class="cont_info_right">
DS-21674651
{{item.sn}}
</view>
</view>
<view class="cont_info">
@ -244,7 +247,6 @@
<view class="card_bot">
<image src="https://lxnapi.ccttiot.com/bike/img/static/uklW7KIegcLR6E7DTOGO" mode=""></image>
嵛山岛芦竹村三沙路68号
<view class="stause" v-if="item.status==4" style="background-color: #3BBBA1 ;">
已完成
</view>
@ -283,57 +285,79 @@
eledata: [],
listData: [],
alreadyList: []
}
},
watch: {
curtitidx(newValue, oldValue) {
// userId
console.log('userId 发生变化', newValue, oldValue);
if(newValue==0){
this.swiperHeight=(this.listData.length*440)
}else if(newValue==1){
this.swiperHeight=this.eledata.length*440
}else if(newValue==1){
this.swiperHeight=this.fixdata.length*440
}
console.log('curtitidx 发生变化', newValue, oldValue);
this.updateSwiperHeight();
},
code(newValue, oldValue) {
console.log('code 发生变化', newValue, oldValue);
this.updateSwiperHeight();
}
},
onShow() {
this.getmarks()
computed: {
filteredListData() {
return this.filterData(this.listData);
},
filteredEleData() {
return this.filterData(this.eledata);
},
filteredFixData() {
return this.filterData(this.fixdata);
},
filteredAlreadyList() {
return this.filterData(this.alreadyList);
}
},
methods: {
updateSwiperHeight() {
if (this.curtitidx == 0) {
this.swiperHeight = (this.filteredListData.length * 440);
} else if (this.curtitidx == 1) {
this.swiperHeight = (this.filteredEleData.length * 440);
} else if (this.curtitidx == 2) {
this.swiperHeight = (this.filteredFixData.length * 440);
} else if (this.curtitidx == 3) {
this.swiperHeight = (this.filteredAlreadyList.length * 440);
}
},
filterData(data) {
if (this.code) {
const regex = new RegExp(this.code, 'i');
return data.filter(item => regex.test(item.orderNo) || regex.test(item.sn));
}
return data;
},
todetail(id) {
uni.navigateTo({
url: '/page_fix/repair/repair_detail?id=' + id
})
});
},
changeidx(idx) {
this.curtitidx=idx
this.curtitidx = idx;
},
swiperchange(e) {
this.curtitidx=e.detail.current
console.log(e,'eeeeeeeee');
this.curtitidx = e.detail.current;
},
getmarks() {
this.$u.get(`/appVerify/adminOrder/list?adminId=` + 2).then((res) => {
if (res.code == 200) {
console.log('调用了');
this.listData = res.rows;
this.fixdata = [];
this.eledata = [];
this.alreadyList = [];
res.rows.forEach(item => {
if (item.type == 1 && item.status != 4) {
this.fixdata.push(item);
console.log(this.fixdata, 'this.fixdata');
} else if (item.type == 2&item.status!=4) {
} else if (item.type == 2 && item.status != 4) {
this.eledata.push(item);
} else if (item.status == 4) {
this.alreadyList.push(item) }
//
this.alreadyList.push(item);
}
});
this.swiperHeight=(this.listData.length*440)
// this.markers = markers;
this.updateSwiperHeight();
} else {
//
}
@ -341,6 +365,17 @@
//
});
},
},
onLoad(e) {
console.log(e,'eeeeee');
if(e.id){
this.code = e.id;
}
},
onShow() {
this.getmarks();
}
}
</script>
@ -349,8 +384,10 @@
page {
background-color: #F3F3F3;
}
.page {
width: 750rpx;
.tip_box {
position: fixed;
left: 72rpx;
@ -406,10 +443,12 @@ page{
}
}
.top {
width: 750rpx;
background: #fff;
padding-top: 26rpx;
.tap {
margin-top: 24rpx;
width: 750rpx;
@ -427,11 +466,13 @@ page{
color: #3D3D3D;
border-bottom: 6rpx solid #fff;
}
.act1 {
border-bottom: 6rpx solid #4C97E7;
color: #4C97E7;
}
}
.search_box {
margin: 0 auto;
display: flex;
@ -441,6 +482,7 @@ page{
height: 68rpx;
border: 2rpx solid #4C97E7;
border-radius: 20rpx;
// .search_left{
// image{
// width: 56rpx;
@ -451,6 +493,7 @@ page{
margin-left: 40rpx;
width: 490rpx;
}
.search_right {
display: flex;
align-items: center;
@ -467,6 +510,7 @@ page{
}
}
}
.warp_box {
.swiper {
.swiper-item {
@ -476,24 +520,29 @@ page{
height: 408rpx;
background: #FFFFFF;
border-radius: 0rpx 0rpx 0rpx 0rpx;
.card_top {
padding: 32rpx 38rpx 28rpx 38rpx;
display: flex;
flex-wrap: nowrap;
align-items: center;
.card_top_left {
display: flex;
flex-wrap: nowrap;
align-items: center;
image {
width: 42rpx;
height: 42rpx;
margin-right: 18rpx;
}
font-weight: 500;
font-size: 32rpx;
color: #3D3D3D;
}
.card_top_right {
margin-left: auto;
font-weight: 400;
@ -501,37 +550,43 @@ page{
color: #808080;
}
}
.cont_info {
margin-left: 38rpx;
margin-bottom: 28rpx;
display: flex;
flex-wrap: nowrap;
align-items: center;
.cont_info_left {
margin-right: 44rpx;
font-weight: 400;
font-size: 28rpx;
color: #808080;
}
.cont_info_right {
font-weight: 400;
font-size: 28rpx;
color: #3D3D3D;
}
}
.card_bot {
display: flex;
align-items: center;
border-top: 2rpx dashed #D8D8D8;
height: 102rpx;
image {
margin-left: 40rpx;
margin-left: 20rpx;
margin-right: 18rpx;
width: 41.66rpx;
width: 46rpx;
height: 48rpx;
}
.card_bot_txt {
width: 80%;
width: 60%;
white-space: nowrap;
/* 禁止换行 */
overflow: hidden;
@ -541,11 +596,14 @@ page{
font-size: 28rpx;
color: #3D3D3D;
}
font-weight: 400;
font-size: 28rpx;
color: #3D3D3D;
.stause {
display: flex;align-items: center;
display: flex;
align-items: center;
justify-content: center;
margin-left: auto;
margin-right: 38rpx;

View File

@ -6,7 +6,7 @@
输入编号开锁
</view>
<view class="img">
<image src="https://api.ccttiot.com/smartmeter/img/static/udApqNjNoUrCp1zl5Eef" mode=""></image>
<image src="https://lxnapi.ccttiot.com/bike/img/static/uqSsMfUwtr8RKObEBCgr" mode=""></image>
</view>
<view class="ipt">
@ -174,7 +174,7 @@ page{
color: #FFFFFF;
}
.act1{
background: #02CBAF;
background: #4C97E7;
}
}

View File

@ -4,8 +4,11 @@
<image src="https://lxnapi.ccttiot.com/bike/img/static/uVcMTydm81zCMhHomXl1" mode="" @click="topage(6)">
</image>
<view class="txts">
出行
出行
</view>
<!-- <view class="txts">
嵛你出行
</view> -->
</view>
<!-- <u-navbar :is-back="false" title="共享电动车" :border-bottom="false" :background="bgc" title-color='#2E4975'
title-size='36' height='36'></u-navbar> -->
@ -14,12 +17,12 @@
@markertap="onMarkerTap">
</map>
<view class="my-location">
<image class="img" src="https://lxnapi.ccttiot.com/bike/img/static/u0Kyr2HWPvHq7CMHIv5r"
@click="setMapScale"></image>
<view class="my-location" @click="setMapScale">
<image class="img" src="https://lxnapi.ccttiot.com/bike/img/static/uBgKFW3JgiBfjM4ea3uV"
></image>
</view>
<view class="park" @click="toggleIconAndCallout">
<image src="https://lxnapi.ccttiot.com/bike/img/static/uWxERJKYTzGp1MVqS6Rc" mode=""></image>
<image src="https://lxnapi.ccttiot.com/bike/img/static/uRiYQZQEb3l2LsltEsyW" mode=""></image>
</view>
<view class="botmbox2" v-if="showdevice">
<view class="close" @click="close()">
@ -61,12 +64,13 @@
</view>
</view>
<view class="bot">
<view class="left_btn" @click="qecodelock()">
扫码用车
</view>
<view class="right_btn" @click="Reserve()">
<view class=" left_btn" @click="Reserve()">
预约用车
</view>
<view class="right_btn" @click="deviceInfo(1)">
解锁用车
</view>
</view>
<view class="tips" @click="topage(7)">
发现坏车 >
@ -333,7 +337,7 @@
</view>
</view>
<view class="botmbox" v-if="showindex==0">
<view class="top_btn" @click="qecodelock()">
<view class="top_btn" @tap="qecodelock()">
<image src="https://api.ccttiot.com/smartmeter/img/static/un6Wi8CefEjy04qzvn67" mode=""></image>
扫码开锁
</view>
@ -354,23 +358,23 @@
</view> -->
<view class="cont" @click="topage(3)">
<image src="https://api.ccttiot.com/smartmeter/img/static/utP4rdOzXLlQPx6Ug8cO" mode=""
style="width: 32rpx;height: 32rpx;"></image>
></image>
<view class="text">
用车指南
</view>
</view>
<view class="cont" @click="topage(4)">
<image src="https://api.ccttiot.com/smartmeter/img/static/uFaJV6NJGhmmodpEuWMy" mode=""
style="width: 32rpx;height: 32rpx;"></image>
></image>
<view class="text">
编号开锁
</view>
</view>
<view class="cont" @click="showindex=1">
<image src="https://api.ccttiot.com/smartmeter/img/static/udQjw62ubIRDIUQqlsTT" mode=""
style="width: 32rpx;height: 32rpx;"></image>
<view class="cont"@click="topage(5)">
<image src="https://api.ccttiot.com/smartmeter/img/static/uucc9g8b2MM6G9vp8HWa" mode=""
></image>
<view class="text">
更多
故障上报
</view>
</view>
</view>
@ -378,22 +382,58 @@
<image src="https://lxnapi.ccttiot.com/bike/img/static/uvHYQhuouHZQQL3qfLzP" mode=""></image>
</view>
</view>
<view class="tipss_box">
<!-- <view class="tipss" v-if="orderinfo.status" @click="starTime"> -->
<swiper class="swiper" circular :autoplay="autoplay" :interval="interval" :duration="duration">
<swiper-item v-if="orderinfo.status">
<view class="tipss" v-if="orderinfo.status" @click="starTime">
您有正在进行中的订单 <view class="iconfont icon-xiangyou1" style="margin-left: 20rpx;">
</view>
</view>
</swiper-item>
<swiper-item>
<view class="tipss">
点击车辆可以预约用车
</view>
</swiper-item>
<swiper-item>
<view class="tipss" @click="changetips">
<image src="https://lxnapi.ccttiot.com/bike/img/static/uJnO5qX8ggJvL1Nf7PQt" mode=""></image> 文明骑行,须知
<image src="https://lxnapi.ccttiot.com/bike/img/static/uJnO5qX8ggJvL1Nf7PQt" mode=""></image>
文明骑行,须知
<view class="iconfont icon-xiangyou1">
</view>
</view>
</swiper-item>
</swiper>
<!-- <swiper class="swiper" :style="{ height: swiperHeight + 'rpx' }" :current='curtitidx' circular :autoplay="autoplay" interval='500'>
<swiper-item>
<view class="tipss" v-if="orderinfo.status" @click="starTime">
您有正在进行中的订单 <view class="iconfont icon-xiangyou1" style="margin-left: 20rpx;">
</view>
</view>
</swiper-item>
<swiper-item>
<view class="tipss">
点击车辆可以预约用车
</view>
</swiper-item>
<swiper-item>
<view class="tipss" @click="changetips">
<image src="https://lxnapi.ccttiot.com/bike/img/static/uJnO5qX8ggJvL1Nf7PQt" mode=""></image>
文明骑行,须知
<view class="iconfont icon-xiangyou1">
</view>
</view>
</swiper-item>
</swiper> -->
<!-- <view class="tipss" v-if="orderinfo.status" @click="starTime"> -->
</view>
<u-mask :show="showtcs" @click="showtc = false" :z-index='100' />
@ -428,11 +468,14 @@
我已知晓
</view>
</view>
<view class="pops" v-if="showTips" @click="changetips">
<view class="pops" v-if="showTips" >
<view class="tit">
安全骑行 禁止超载
</view>
<view class="text">
<view class="cont" v-html="areaInfo.agreement" >
</view>
<!-- <view class="text">
<view class="yuan">
</view>
@ -459,8 +502,8 @@
</view>
<span>请爱护车辆且注意查看车辆剩余电量</span>
</view>
<view class="btn">
</view> -->
<view class="btn" @click="changetips()">
我已阅读同意
</view>
</view>
@ -675,8 +718,18 @@
seeDetail: false,
showmap: true,
userinfo: {},
parkingList: []
parkingList: [],
timer: null,
listData: [],
oldMarkers: [],
curtitidx: 0,
swiperHeight: 50,
background: ['color1', 'color2', 'color3'],
indicatorDots: true,
autoplay: true,
interval: 2000,
duration: 500,
showTips:false,
// userId:this.$store.getters.userId,
}
},
@ -687,6 +740,7 @@
this.getisInOrder()
}
},
onLoad(e) {
console.log(e, 'eeeeeeeeeeeeeeeeeee');
if (e.q) {
@ -713,10 +767,10 @@
setTimeout(() => {
if (!this.orderinfo.status) {
this.deviceInfo()
this.showdevice = true
this.deviceIndex = 1
this.type = 1
this.deviceInfo(1)
// this.showdevice = true
// this.deviceIndex = 1
// this.type = 1
}
}, 1000)
@ -729,16 +783,19 @@
if (this.sn != '') {
setTimeout(() => {
if (!this.orderinfo.status) {
this.deviceInfo()
this.showdevice = true
this.deviceIndex = 1
this.type = 1
this.deviceInfo(1)
// this.showdevice = true
// this.deviceIndex = 1
// this.type = 1
}
}, 1000)
}
}
setTimeout(()=>{
this.$store.commit('SET_SHOWTIPS', true);
},500)
},
onShow() {
if (this.seeDetail == false) {
@ -783,10 +840,29 @@
} else {
this.getinfo()
}
this.timer = setInterval(() => {
// console.log('...');
this.getmarks()
//
}, 3000); //
},
onHide() {
//
if (this.timer) {
clearInterval(this.timer);
this.timer = null;
console.log('定时器已清除');
}
},
onUnload() {
//
if (this.timer) {
clearInterval(this.timer);
this.timer = null;
console.log('定时器已清除');
}
},
computed: {
appointmentServiceFee() {
return this.$store.getters.appointmentServiceFee;
@ -812,9 +888,9 @@
userId() {
return this.$store.getters.userId;
},
showTips() {
return this.$store.getters.showTips;
},
// showTips() {
// return this.$store.getters.showTips;
// },
isMeal() {
return this.$store.getters.isMeal;
},
@ -822,9 +898,12 @@
methods: {
changetips() {
if (this.showTips) {
this.$store.commit('SET_SHOWTIPS', false);
uni.setStorageSync('hasShownPopup', false);
this.showTips=uni.getStorageSync('hasShownPopup')
} else {
this.$store.commit('SET_SHOWTIPS', true);
uni.setStorageSync('hasShownPopup', true);
this.showTips=uni.getStorageSync('hasShownPopup')
}
},
@ -893,6 +972,7 @@
},
//
qecodelock() {
this.seeDetail = true
uni.scanCode({
onlyFromCamera: true,
scanType: ['qrCode'],
@ -914,7 +994,7 @@
if (this.sn != '') {
setTimeout(() => {
if (!this.orderinfo.status) {
this.deviceInfo()
this.deviceInfo(1)
}
}, 1000)
@ -923,11 +1003,11 @@
},
fail: err => {
console.error('扫描失败:', err);
uni.showToast({
title: '扫描失败',
icon: 'none'
});
// console.error('', err);
// uni.showToast({
// title: '',
// icon: 'none'
// });
}
});
},
@ -1995,21 +2075,30 @@
//
// \
this.sn = e.markerId
this.deviceInfo()
this.deviceInfo(0)
}
},
deviceInfo() {
deviceInfo(num) {
let that = this
if (uni.getStorageSync('token')) {
this.$u.get('/app/device/info?sn=' + this.sn).then((res) => {
if (res.code === 200) {
this.deviceInfos = res.data
this.showindex = 0
if (num == 0) {
// this.showindex = 0
this.showdevice = true
this.type = 0
} else {
// this.showindex = 1
this.showdevice = true
this.type = 1
this.deviceIndex = 1
}
} else {
this.showdevice = false
this.deviceIndex = 0
@ -2081,38 +2170,30 @@
// //
// },
getmarks() {
this.listData = []
this.markers = []
let data = {
areaId: this.areaInfo.areaId
}
};
this.$u.get(`/app/allVehicleByArea`, data).then((res) => {
if (res.code === 200) {
this.listData = res.data;
// const markers = data.map(item => {
// return {
// id: item.deviceId,
// latitude: parseFloat(item.latitude),
// longitude: parseFloat(item.longitude),
// title: item.deviceName,
// width : 25,
// height : 30,
// iconPath: 'https://api.ccttiot.com/smartmeter/img/static/uF9qLejuAZErNTrRuHq7',
// };
// });
this.listData.forEach(item => {
this.markers.push({
const newMarkers = this.listData.map(item => ({
id: parseFloat(item.sn),
latitude: parseFloat(item.latitude),
longitude: parseFloat(item.longitude),
// title: item.deviceName,
width: 40,
height: 28,
iconPath: 'https://api.ccttiot.com/smartmeter/img/static/uF9qLejuAZErNTrRuHq7',
})
})
// this.markers = markers;
// console.log(this.markers, ' this.markers this.markers');
}));
//
if (this.oldMarkers.length === 0 || this.isMarkersChanged(newMarkers)) {
console.log('有变化');
this.markers = newMarkers;
this.oldMarkers = [...newMarkers];
}
} else {
//
}
@ -2120,6 +2201,21 @@
//
});
},
isMarkersChanged(newMarkers) {
if (this.oldMarkers.length !== newMarkers.length) {
return true;
}
for (let i = 0; i < newMarkers.length; i++) {
if (this.oldMarkers[i].id !== newMarkers[i].id ||
this.oldMarkers[i].latitude !== newMarkers[i].latitude ||
this.oldMarkers[i].longitude !== newMarkers[i].longitude) {
return true;
}
}
return false;
},
getinfo() {
if (uni.getStorageSync('token')) {
this.$u.get("/getAppInfo").then((res) => {
@ -2206,7 +2302,28 @@
this.getisInOrder()
}
const hasShownPopup = uni.getStorageSync('hasShownPopup');
console.log(hasShownPopup, 'hasShownPopup');
if (hasShownPopup === '' || hasShownPopup === null) {
console.log('1111111111');
this.showTips = true;
uni.setStorageSync('hasShownPopup', true);
} else {
console.log('222');
this.showTips = uni.getStorageSync('hasShownPopup');
console.log(this.showTips, 'this.showTips');
}
this.setMapScale()
// if(!hasShownPopup){
// console.log(typeof(hasShownPopup),'hasShownPopuphasShownPopup');
// this.showTips=uni.getStorageSync('hasShownPopup')
// }else{
// this.showTips=true
// uni.setStorageSync('hasShownPopup', true);
// }
// this.$store.commit('SET_SHOWTIPS', true);
// console.log(this.polyline);
} else {
uni.showToast({
@ -2341,6 +2458,43 @@
}
}
</script>
<style>
.uni-margin-wrap {
width: 690rpx;
width: 100%;
}
.swiper {
height: 300rpx;
}
.swiper-item {
display: block;
height: 300rpx;
line-height: 300rpx;
text-align: center;
}
.swiper-list {
margin-top: 40rpx;
margin-bottom: 0;
}
.uni-common-mt {
margin-top: 60rpx;
position: relative;
}
.info {
position: absolute;
right: 20rpx;
}
.uni-padding-wrap {
width: 550rpx;
padding: 0 100rpx;
}
</style>
<style lang="scss">
page {
@ -2386,16 +2540,16 @@
align-items: center;
justify-content: center;
right: 30rpx;
bottom: 450rpx;
background-color: #fff;
bottom: 520rpx;
// background-color: #fff;
border-radius: 50%;
width: 60rpx;
height: 60rpx;
width: 82rpx;
height: 82rpx;
z-index: 10;
.img {
width: 50rpx;
height: 50rpx;
width: 82rpx;
height: 82rpx;
}
}
@ -2405,16 +2559,16 @@
align-items: center;
justify-content: center;
right: 30rpx;
bottom: 530rpx;
background-color: #fff;
bottom: 600rpx;
// background-color: #fff;
border-radius: 50%;
width: 60rpx;
height: 60rpx;
width: 82rpx;
height: 82rpx;
z-index: 10;
.img {
width: 50rpx;
height: 50rpx;
width: 82rpx;
height: 82rpx;
}
}
@ -2486,10 +2640,15 @@
}
.tipss_box {
width: 370rpx;
height: 73rpx;
position: fixed;
bottom: 450rpx;
bottom: 520rpx;
left: 38rpx;
.swiper {
height: 80rpx;
.tipss {
// position: fixed;
margin-top: 15rpx;
@ -2512,6 +2671,8 @@
}
}
}
.map {
width: 750rpx;
@ -3132,7 +3293,7 @@
image {
width: 686rpx;
height: 116rpx;
height: 160rpx;
border-radius: 10rpx 10rpx 10rpx 10rpx;
}
}
@ -3169,19 +3330,19 @@
display: flex;
flex-wrap: wrap;
justify-content: center;
width: 80rpx;
width: 112rpx;
image {
width: 29.33rpx;
height: 31.97rpx;
width: 44rpx;
height:44rpx;
}
.text {
margin-top: 12rpx;
width: 80px;
width: 112rpx;
text-align: center;
font-weight: 400;
font-size: 20rpx;
font-size: 28rpx;
color: #3D3D3D;
}
}
@ -3206,7 +3367,11 @@
font-size: 48rpx;
color: #4C97E7;
}
.cont{
height: 300rpx;
overflow-x: hidden;
overflow-y: auto;
}
.tit {
// width: 604rpx;
text-align: center;

View File

@ -4,7 +4,8 @@
<view class="topbg">
<view class="topbox">
<view class="info" >
<image :src='item.avatar' mode=""></image>
<image v-if="info.avatar!=''" :src='info.avatar' mode=""></image>
<image v-if="info.avatar==''" src="https://lxnapi.ccttiot.com/bike/img/static/uSRzzLXhnbnWLB8jMKmr" mode=""></image>
<view class="cont">
<view class="name" v-if="info.realName!=null">
{{maskedName}}