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://192.168.2.6:8080',
// baseUrl: 'http://124.221.246.124:2289', // baseUrl: 'http://124.221.246.124:2289',
baseUrl: 'https://dche.ccttiot.com/prod-api', baseUrl: 'https://dche.ccttiot.com/prod-api',
// baseUrl: 'https://dianche.chuantewulian.cn/prod-api',
loadingText: '努力加载中~', loadingText: '努力加载中~',
loadingTime: 800, loadingTime: 800,
// 设置自定义头部content-type // 设置自定义头部content-type

View File

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

View File

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

File diff suppressed because it is too large Load Diff

View File

@ -6,7 +6,7 @@
输入编号开锁 输入编号开锁
</view> </view>
<view class="img"> <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>
<view class="ipt"> <view class="ipt">
@ -174,7 +174,7 @@ page{
color: #FFFFFF; color: #FFFFFF;
} }
.act1{ .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 src="https://lxnapi.ccttiot.com/bike/img/static/uVcMTydm81zCMhHomXl1" mode="" @click="topage(6)">
</image> </image>
<view class="txts"> <view class="txts">
出行 出行
</view> </view>
<!-- <view class="txts">
嵛你出行
</view> -->
</view> </view>
<!-- <u-navbar :is-back="false" title="共享电动车" :border-bottom="false" :background="bgc" title-color='#2E4975' <!-- <u-navbar :is-back="false" title="共享电动车" :border-bottom="false" :background="bgc" title-color='#2E4975'
title-size='36' height='36'></u-navbar> --> title-size='36' height='36'></u-navbar> -->
@ -14,12 +17,12 @@
@markertap="onMarkerTap"> @markertap="onMarkerTap">
</map> </map>
<view class="my-location"> <view class="my-location" @click="setMapScale">
<image class="img" src="https://lxnapi.ccttiot.com/bike/img/static/u0Kyr2HWPvHq7CMHIv5r" <image class="img" src="https://lxnapi.ccttiot.com/bike/img/static/uBgKFW3JgiBfjM4ea3uV"
@click="setMapScale"></image> ></image>
</view> </view>
<view class="park" @click="toggleIconAndCallout"> <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>
<view class="botmbox2" v-if="showdevice"> <view class="botmbox2" v-if="showdevice">
<view class="close" @click="close()"> <view class="close" @click="close()">
@ -61,12 +64,13 @@
</view> </view>
</view> </view>
<view class="bot"> <view class="bot">
<view class="left_btn" @click="qecodelock()">
扫码用车 <view class=" left_btn" @click="Reserve()">
</view>
<view class="right_btn" @click="Reserve()">
预约用车 预约用车
</view> </view>
<view class="right_btn" @click="deviceInfo(1)">
解锁用车
</view>
</view> </view>
<view class="tips" @click="topage(7)"> <view class="tips" @click="topage(7)">
发现坏车 > 发现坏车 >
@ -179,7 +183,7 @@
<view style="padding: 18rpx;"> <view style="padding: 18rpx;">
<view class="nmtxt text-ellipsis" v-for="(items, indexs) in item.ridingRuleJson.rule" <view class="nmtxt text-ellipsis" v-for="(items, indexs) in item.ridingRuleJson.rule"
:key="indexs" style="margin-top: 10rpx;" v-if="indexs<2"> :key="indexs" style="margin-top: 10rpx;" v-if="indexs<2">
<view class="left " style="font-size: 28rpx;"> <view class="left " style="font-size: 28rpx;">
{{items.start}}-{{items.end}}<span v-if="item.rentalUnit=='minutes'">分钟</span> {{items.start}}-{{items.end}}<span v-if="item.rentalUnit=='minutes'">分钟</span>
<span v-if="item.rentalUnit=='hours'">小时</span> <span v-if="item.rentalUnit=='hours'">小时</span>
@ -333,7 +337,7 @@
</view> </view>
</view> </view>
<view class="botmbox" v-if="showindex==0"> <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> <image src="https://api.ccttiot.com/smartmeter/img/static/un6Wi8CefEjy04qzvn67" mode=""></image>
扫码开锁 扫码开锁
</view> </view>
@ -345,7 +349,7 @@
押金充值 押金充值
</view> </view>
</view> </view>
<!-- <view class="cont" @click="topage(2)"> <!-- <view class="cont" @click="topage(2)">
<image src="https://api.ccttiot.com/smartmeter/img/static/uFHC2R6R3pgUOTShLxoQ" mode="" <image src="https://api.ccttiot.com/smartmeter/img/static/uFHC2R6R3pgUOTShLxoQ" mode=""
style="width: 28rpx;height: 28rpx;"></image> style="width: 28rpx;height: 28rpx;"></image>
<view class="text"> <view class="text">
@ -354,23 +358,23 @@
</view> --> </view> -->
<view class="cont" @click="topage(3)"> <view class="cont" @click="topage(3)">
<image src="https://api.ccttiot.com/smartmeter/img/static/utP4rdOzXLlQPx6Ug8cO" mode="" <image src="https://api.ccttiot.com/smartmeter/img/static/utP4rdOzXLlQPx6Ug8cO" mode=""
style="width: 32rpx;height: 32rpx;"></image> ></image>
<view class="text"> <view class="text">
用车指南 用车指南
</view> </view>
</view> </view>
<view class="cont" @click="topage(4)"> <view class="cont" @click="topage(4)">
<image src="https://api.ccttiot.com/smartmeter/img/static/uFaJV6NJGhmmodpEuWMy" mode="" <image src="https://api.ccttiot.com/smartmeter/img/static/uFaJV6NJGhmmodpEuWMy" mode=""
style="width: 32rpx;height: 32rpx;"></image> ></image>
<view class="text"> <view class="text">
编号开锁 编号开锁
</view> </view>
</view> </view>
<view class="cont" @click="showindex=1"> <view class="cont"@click="topage(5)">
<image src="https://api.ccttiot.com/smartmeter/img/static/udQjw62ubIRDIUQqlsTT" mode="" <image src="https://api.ccttiot.com/smartmeter/img/static/uucc9g8b2MM6G9vp8HWa" mode=""
style="width: 32rpx;height: 32rpx;"></image> ></image>
<view class="text"> <view class="text">
更多 故障上报
</view> </view>
</view> </view>
</view> </view>
@ -378,22 +382,58 @@
<image src="https://lxnapi.ccttiot.com/bike/img/static/uvHYQhuouHZQQL3qfLzP" mode=""></image> <image src="https://lxnapi.ccttiot.com/bike/img/static/uvHYQhuouHZQQL3qfLzP" mode=""></image>
</view> </view>
</view> </view>
<view class="tipss_box"> <view class="tipss_box">
<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>
文明骑行,须知
<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 class="tipss" v-if="orderinfo.status" @click="starTime"> -->
<view class="tipss" v-if="orderinfo.status" @click="starTime">
您有正在进行中的订单 <view class="iconfont icon-xiangyou1" style="margin-left: 20rpx;">
</view>
</view>
<view class="tipss">
点击车辆可以预约用车
</view>
<view class="tipss" @click="changetips">
<image src="https://lxnapi.ccttiot.com/bike/img/static/uJnO5qX8ggJvL1Nf7PQt" mode=""></image> 文明骑行,须知
<view class="iconfont icon-xiangyou1">
</view>
</view>
</view> </view>
<u-mask :show="showtcs" @click="showtc = false" :z-index='100' /> <u-mask :show="showtcs" @click="showtc = false" :z-index='100' />
@ -428,11 +468,14 @@
我已知晓 我已知晓
</view> </view>
</view> </view>
<view class="pops" v-if="showTips" @click="changetips"> <view class="pops" v-if="showTips" >
<view class="tit"> <view class="tit">
安全骑行 禁止超载 安全骑行 禁止超载
</view> </view>
<view class="text"> <view class="cont" v-html="areaInfo.agreement" >
</view>
<!-- <view class="text">
<view class="yuan"> <view class="yuan">
</view> </view>
@ -459,8 +502,8 @@
</view> </view>
<span>请爱护车辆且注意查看车辆剩余电量</span> <span>请爱护车辆且注意查看车辆剩余电量</span>
</view> </view> -->
<view class="btn"> <view class="btn" @click="changetips()">
我已阅读同意 我已阅读同意
</view> </view>
</view> </view>
@ -675,8 +718,18 @@
seeDetail: false, seeDetail: false,
showmap: true, showmap: true,
userinfo: {}, 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, // userId:this.$store.getters.userId,
} }
}, },
@ -687,6 +740,7 @@
this.getisInOrder() this.getisInOrder()
} }
}, },
onLoad(e) { onLoad(e) {
console.log(e, 'eeeeeeeeeeeeeeeeeee'); console.log(e, 'eeeeeeeeeeeeeeeeeee');
if (e.q) { if (e.q) {
@ -713,10 +767,10 @@
setTimeout(() => { setTimeout(() => {
if (!this.orderinfo.status) { if (!this.orderinfo.status) {
this.deviceInfo() this.deviceInfo(1)
this.showdevice = true // this.showdevice = true
this.deviceIndex = 1 // this.deviceIndex = 1
this.type = 1 // this.type = 1
} }
}, 1000) }, 1000)
@ -729,16 +783,19 @@
if (this.sn != '') { if (this.sn != '') {
setTimeout(() => { setTimeout(() => {
if (!this.orderinfo.status) { if (!this.orderinfo.status) {
this.deviceInfo() this.deviceInfo(1)
this.showdevice = true // this.showdevice = true
this.deviceIndex = 1 // this.deviceIndex = 1
this.type = 1 // this.type = 1
} }
}, 1000) }, 1000)
} }
} }
setTimeout(()=>{
this.$store.commit('SET_SHOWTIPS', true);
},500)
}, },
onShow() { onShow() {
if (this.seeDetail == false) { if (this.seeDetail == false) {
@ -783,10 +840,29 @@
} else { } else {
this.getinfo() 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: { computed: {
appointmentServiceFee() { appointmentServiceFee() {
return this.$store.getters.appointmentServiceFee; return this.$store.getters.appointmentServiceFee;
@ -812,9 +888,9 @@
userId() { userId() {
return this.$store.getters.userId; return this.$store.getters.userId;
}, },
showTips() { // showTips() {
return this.$store.getters.showTips; // return this.$store.getters.showTips;
}, // },
isMeal() { isMeal() {
return this.$store.getters.isMeal; return this.$store.getters.isMeal;
}, },
@ -822,9 +898,12 @@
methods: { methods: {
changetips() { changetips() {
if (this.showTips) { if (this.showTips) {
this.$store.commit('SET_SHOWTIPS', false);
uni.setStorageSync('hasShownPopup', false);
this.showTips=uni.getStorageSync('hasShownPopup')
} else { } else {
this.$store.commit('SET_SHOWTIPS', true); uni.setStorageSync('hasShownPopup', true);
this.showTips=uni.getStorageSync('hasShownPopup')
} }
}, },
@ -893,6 +972,7 @@
}, },
// //
qecodelock() { qecodelock() {
this.seeDetail = true
uni.scanCode({ uni.scanCode({
onlyFromCamera: true, onlyFromCamera: true,
scanType: ['qrCode'], scanType: ['qrCode'],
@ -914,7 +994,7 @@
if (this.sn != '') { if (this.sn != '') {
setTimeout(() => { setTimeout(() => {
if (!this.orderinfo.status) { if (!this.orderinfo.status) {
this.deviceInfo() this.deviceInfo(1)
} }
}, 1000) }, 1000)
@ -923,11 +1003,11 @@
}, },
fail: err => { fail: err => {
console.error('扫描失败:', err); // console.error('', err);
uni.showToast({ // uni.showToast({
title: '扫描失败', // title: '',
icon: 'none' // icon: 'none'
}); // });
} }
}); });
}, },
@ -1035,7 +1115,7 @@
} }
this.$u.post('/appVerify/device/snSwitch', data).then((res) => { this.$u.post('/appVerify/device/snSwitch', data).then((res) => {
if (res.code == 200) { if (res.code == 200) {
this.getisInOrder() this.getisInOrder()
} else { } else {
this.getisInOrder() this.getisInOrder()
@ -1460,7 +1540,7 @@
console.log('登录!', res); console.log('登录!', res);
let data = { let data = {
wxOpenId: res.code, wxOpenId: res.code,
}; };
let areaId = uni.getStorageSync('areaId'); let areaId = uni.getStorageSync('areaId');
that.$u.post('/loginByopenid?jsCode=' + res.code + '&areaId=' + areaId).then( that.$u.post('/loginByopenid?jsCode=' + res.code + '&areaId=' + areaId).then(
@ -1485,7 +1565,7 @@
url: '/pages/my' url: '/pages/my'
}) })
} }
} else { } else {
uni.showToast({ uni.showToast({
title: '未登录,请登录后尝试', title: '未登录,请登录后尝试',
@ -1494,15 +1574,15 @@
}); });
} }
}); });
} else { } else {
uni.navigateTo({ uni.navigateTo({
url: '/pages/my' url: '/pages/my'
}) })
} }
} else if (res.code == 501) { } else if (res.code == 501) {
uni.showToast({ uni.showToast({
title: res.msg, title: res.msg,
@ -1518,9 +1598,9 @@
}); });
} }
}, },
}); });
} else if (num == 7) { } else if (num == 7) {
uni.navigateTo({ uni.navigateTo({
url: '/page_user/gzsb?sn=' + this.sn url: '/page_user/gzsb?sn=' + this.sn
@ -1764,7 +1844,7 @@
} }
} }
}else{ } else {
if (this.freeInfo.ruleId) { if (this.freeInfo.ruleId) {
let data = { let data = {
userId: this.userId, userId: this.userId,
@ -1774,8 +1854,8 @@
// money: this.freeInfo.fee, // money: this.freeInfo.fee,
mark: "预约购买套餐", mark: "预约购买套餐",
type: '2' type: '2'
} }
this.$u.post('/appVerify/device/appointment?userId=' + this.userId + '&sn=' + this.sn + this.$u.post('/appVerify/device/appointment?userId=' + this.userId + '&sn=' + this.sn +
'&ruleId=' + '&ruleId=' +
@ -1791,7 +1871,7 @@
uni.hideLoading() uni.hideLoading()
}, 1000) }, 1000)
// this.freList=res.rows // this.freList=res.rows
} else { } else {
uni.showToast({ uni.showToast({
title: res.msg, title: res.msg,
@ -1995,21 +2075,30 @@
// //
// \ // \
this.sn = e.markerId this.sn = e.markerId
this.deviceInfo() this.deviceInfo(0)
} }
}, },
deviceInfo() { deviceInfo(num) {
let that = this let that = this
if (uni.getStorageSync('token')) { if (uni.getStorageSync('token')) {
this.$u.get('/app/device/info?sn=' + this.sn).then((res) => { this.$u.get('/app/device/info?sn=' + this.sn).then((res) => {
if (res.code === 200) { if (res.code === 200) {
this.deviceInfos = res.data this.deviceInfos = res.data
this.showindex = 0 if (num == 0) {
this.showdevice = true // this.showindex = 0
this.showdevice = true
this.type = 0
} else {
// this.showindex = 1
this.showdevice = true
this.type = 1
this.deviceIndex = 1
}
} else { } else {
this.showdevice = false this.showdevice = false
this.deviceIndex = 0 this.deviceIndex = 0
@ -2081,38 +2170,30 @@
// // // //
// }, // },
getmarks() { getmarks() {
this.listData = []
this.markers = []
let data = { let data = {
areaId: this.areaInfo.areaId areaId: this.areaInfo.areaId
} };
this.$u.get(`/app/allVehicleByArea`, data).then((res) => { this.$u.get(`/app/allVehicleByArea`, data).then((res) => {
if (res.code === 200) { if (res.code === 200) {
this.listData = res.data; this.listData = res.data;
// const markers = data.map(item => {
// return { const newMarkers = this.listData.map(item => ({
// id: item.deviceId, id: parseFloat(item.sn),
// latitude: parseFloat(item.latitude), latitude: parseFloat(item.latitude),
// longitude: parseFloat(item.longitude), longitude: parseFloat(item.longitude),
// title: item.deviceName, width: 40,
// width : 25, height: 28,
// height : 30, iconPath: 'https://api.ccttiot.com/smartmeter/img/static/uF9qLejuAZErNTrRuHq7',
// iconPath: 'https://api.ccttiot.com/smartmeter/img/static/uF9qLejuAZErNTrRuHq7', }));
// };
// }); //
this.listData.forEach(item => { if (this.oldMarkers.length === 0 || this.isMarkersChanged(newMarkers)) {
this.markers.push({ console.log('有变化');
id: parseFloat(item.sn), this.markers = newMarkers;
latitude: parseFloat(item.latitude), this.oldMarkers = [...newMarkers];
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');
} else { } 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() { getinfo() {
if (uni.getStorageSync('token')) { if (uni.getStorageSync('token')) {
this.$u.get("/getAppInfo").then((res) => { this.$u.get("/getAppInfo").then((res) => {
@ -2206,7 +2302,28 @@
this.getisInOrder() 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); // console.log(this.polyline);
} else { } else {
uni.showToast({ uni.showToast({
@ -2341,6 +2458,43 @@
} }
} }
</script> </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"> <style lang="scss">
page { page {
@ -2386,16 +2540,16 @@
align-items: center; align-items: center;
justify-content: center; justify-content: center;
right: 30rpx; right: 30rpx;
bottom: 450rpx; bottom: 520rpx;
background-color: #fff; // background-color: #fff;
border-radius: 50%; border-radius: 50%;
width: 60rpx; width: 82rpx;
height: 60rpx; height: 82rpx;
z-index: 10; z-index: 10;
.img { .img {
width: 50rpx; width: 82rpx;
height: 50rpx; height: 82rpx;
} }
} }
@ -2405,16 +2559,16 @@
align-items: center; align-items: center;
justify-content: center; justify-content: center;
right: 30rpx; right: 30rpx;
bottom: 530rpx; bottom: 600rpx;
background-color: #fff; // background-color: #fff;
border-radius: 50%; border-radius: 50%;
width: 60rpx; width: 82rpx;
height: 60rpx; height: 82rpx;
z-index: 10; z-index: 10;
.img { .img {
width: 50rpx; width: 82rpx;
height: 50rpx; height: 82rpx;
} }
} }
@ -2486,30 +2640,37 @@
} }
.tipss_box { .tipss_box {
width: 370rpx;
height: 73rpx;
position: fixed; position: fixed;
bottom: 450rpx; bottom: 520rpx;
left: 38rpx; left: 38rpx;
.tipss { .swiper {
// position: fixed; height: 80rpx;
margin-top: 15rpx;
display: flex;
align-items: center;
justify-content: center;
flex-wrap: nowrap;
image { .tipss {
margin-right: 15rpx; // position: fixed;
width: 24rpx; margin-top: 15rpx;
height: 24rpx; display: flex;
align-items: center;
justify-content: center;
flex-wrap: nowrap;
image {
margin-right: 15rpx;
width: 24rpx;
height: 24rpx;
}
width: 350rpx;
height: 64rpx;
background: #FFFFFF;
box-shadow: 0rpx 4rpx 10rpx 0rpx rgba(0, 0, 0, 0.3);
border-radius: 53rpx 53rpx 53rpx 53rpx;
} }
width: 350rpx;
height: 64rpx;
background: #FFFFFF;
box-shadow: 0rpx 4rpx 10rpx 0rpx rgba(0, 0, 0, 0.3);
border-radius: 53rpx 53rpx 53rpx 53rpx;
} }
} }
@ -3132,7 +3293,7 @@
image { image {
width: 686rpx; width: 686rpx;
height: 116rpx; height: 160rpx;
border-radius: 10rpx 10rpx 10rpx 10rpx; border-radius: 10rpx 10rpx 10rpx 10rpx;
} }
} }
@ -3169,19 +3330,19 @@
display: flex; display: flex;
flex-wrap: wrap; flex-wrap: wrap;
justify-content: center; justify-content: center;
width: 80rpx; width: 112rpx;
image { image {
width: 29.33rpx; width: 44rpx;
height: 31.97rpx; height:44rpx;
} }
.text { .text {
margin-top: 12rpx; margin-top: 12rpx;
width: 80px; width: 112rpx;
text-align: center; text-align: center;
font-weight: 400; font-weight: 400;
font-size: 20rpx; font-size: 28rpx;
color: #3D3D3D; color: #3D3D3D;
} }
} }
@ -3206,7 +3367,11 @@
font-size: 48rpx; font-size: 48rpx;
color: #4C97E7; color: #4C97E7;
} }
.cont{
height: 300rpx;
overflow-x: hidden;
overflow-y: auto;
}
.tit { .tit {
// width: 604rpx; // width: 604rpx;
text-align: center; text-align: center;

View File

@ -4,7 +4,8 @@
<view class="topbg"> <view class="topbg">
<view class="topbox"> <view class="topbox">
<view class="info" > <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="cont">
<view class="name" v-if="info.realName!=null"> <view class="name" v-if="info.realName!=null">
{{maskedName}} {{maskedName}}