chuangte_bike_newxcx/page_shanghu/guanli/device_detail.vue

1775 lines
51 KiB
Vue
Raw Normal View History

2025-04-01 21:35:30 +08:00
<template>
<view class="page">
2025-04-11 18:23:16 +08:00
<u-navbar title="车辆详情" :border-bottom="false" :background="bgc" title-color='#2E4975' title-size='36'
2025-04-01 21:35:30 +08:00
height='45'></u-navbar>
<map class="map" id="map" ref="map" :scale="zoomSize" :latitude="latitude" :longitude="longitude"
:show-location="true" :markers="markers" :polygons="polyline">
<cover-view class="park" @click="toggleIconAndCallout">
<cover-image class="img" src="https://lxnapi.ccttiot.com/bike/img/static/uRiYQZQEb3l2LsltEsyW"
mode=""></cover-image>
</cover-view>
2025-04-11 18:23:16 +08:00
<!-- <cover-view class="track" @click="toTrack">
2025-04-01 21:35:30 +08:00
<cover-image class="img" src="https://lxnapi.ccttiot.com/bike/img/static/ufaAAtlirJYs1QwJF25P"
mode=""></cover-image>
2025-04-11 18:23:16 +08:00
</cover-view> -->
2025-04-01 21:35:30 +08:00
</map>
2025-04-11 18:23:16 +08:00
<view class="new_infocard">
<view class="topsn">
<view class="lt">
2025-04-23 18:30:04 +08:00
车牌{{deviceInfos.vehicleNum == null ? '--' : deviceInfos.vehicleNum}}
</view>
<view class="" style="display: flex;justify-content: space-between;">
<view class="cent">
<view class="lypic" v-if="ver_dataflag == 3 && deviceInfos.onlineStatus == 0" @click="btnly">
<image src="https://api.ccttiot.com/smartmeter/img/static/uLw46jus4X9fposAvVD7" mode=""></image>
</view>
<view class="lypic" v-if="ver_dataflag == 1 && deviceInfos.onlineStatus == 0" @click="btnly">
<image src="https://api.ccttiot.com/smartmeter/img/static/uCdHjNaNfD9aikVg9Cuk" mode=""></image>
</view>
<view class="lypic" v-if="deviceInfos.music == 0" @click="btnsy">
<image src="https://api.ccttiot.com/smartmeter/img/static/uDORYeTuc2EQ1lSI2dbe" mode=""></image>
</view>
<view class="lypic" v-if="deviceInfos.music == 1" @click="btnsy">
<image src="https://api.ccttiot.com/smartmeter/img/static/u8ii1aiUgREfYyMVIjpO" mode=""></image>
</view>
<view class="lypic" v-if="deviceInfos.music == 2" @click="btnsy">
<image src="https://api.ccttiot.com/smartmeter/img/static/uP7BOVsjvWaGItgHtoKV" mode=""></image>
</view>
</view>
2025-04-11 18:23:16 +08:00
</view>
<view class="rt">
<view class="stutas">
2025-04-23 18:30:04 +08:00
<span style="background-color: #979797;" v-if="deviceInfos.status == 0">仓库</span>
2025-04-11 18:23:16 +08:00
<span style="background-color: #4c97e7;" v-if="deviceInfos.status == 1">待租</span>
<span style="background-color: #28c445;" v-if="deviceInfos.status == 2">预约中</span>
<span style="background-color: #ffc757;" v-if="deviceInfos.status == 3">骑行中</span>
2025-04-23 18:30:04 +08:00
<span style="background-color: #ff7429;" v-if="deviceInfos.status == 4">临时锁车</span>
2025-04-11 18:23:16 +08:00
<span style="background-color: #986cf0;" v-if="deviceInfos.status == 6">调度中</span>
2025-04-23 18:30:04 +08:00
<span style="background-color: #343a40;" v-if="deviceInfos.status == 8">禁用</span>
2025-04-11 18:23:16 +08:00
<span style="background-color: #ff7429;" v-if="deviceInfos.status == 9">强制锁车</span>
</view>
<view class="issuo" v-if="deviceInfos.lockStatus == 0">
锁已关
</view>
<view class="issuo" style="background-color: #4C97E7;color: #fff;" v-if="deviceInfos.lockStatus == 1">
锁已开
</view>
</view>
2025-04-01 21:35:30 +08:00
</view>
2025-04-23 18:30:04 +08:00
2025-04-23 17:50:42 +08:00
<view class="bikesn">
<view class="">
SN{{deviceInfos.sn == null ? '--' : deviceInfos.sn}}
</view>
<view class="">
MAC{{deviceInfos.mac == null ? '--' : deviceInfos.mac}}
</view>
<view class="">
车型{{deviceInfos.modelName == null ? '--' : deviceInfos.modelName}}
</view>
</view>
2025-04-11 18:23:16 +08:00
<view class="bikexx">
<view class="dianliang">
2025-04-23 17:50:42 +08:00
<image v-if="deviceInfos.remainingPower >= 0 && deviceInfos.remainingPower < 20 " src="https://api.ccttiot.com/smartmeter/img/static/u8M9KmIfHXpmeifTwCzj" mode=""></image>
<image v-if="deviceInfos.remainingPower >= 20 && deviceInfos.remainingPower < 50 " src="https://api.ccttiot.com/smartmeter/img/static/u2gp2pE9kPGwaJ4MKUxE" mode=""></image>
<image v-if="deviceInfos.remainingPower >= 50 && deviceInfos.remainingPower < 80 " src="https://api.ccttiot.com/smartmeter/img/static/umm5Ruc5vhNSjeacslwX" mode=""></image>
<image v-if="deviceInfos.remainingPower >= 80 && deviceInfos.remainingPower <= 100 " src="https://api.ccttiot.com/smartmeter/img/static/uo75cOfYZiQoxZQAI3FH" mode=""></image>
2025-04-11 18:23:16 +08:00
<view class="dl">
2025-04-23 18:30:04 +08:00
电量<span style="font-size: 30rpx;color: #333;font-weight: 600;">{{deviceInfos.remainingPower == null ? '--' : deviceInfos.remainingPower.toFixed(1)}}</span><span style="color: #ccc;font-size: 22rpx;">%</span>
2025-04-01 21:35:30 +08:00
</view>
2025-04-11 18:23:16 +08:00
<view class="dy">
2025-04-23 18:30:04 +08:00
电压<span style="font-size: 30rpx;color: #333;font-weight: 600;">{{deviceInfos.voltage == null ? '--' : deviceInfos.voltage.toFixed(1)}}</span><span style="color: #ccc;font-size: 22rpx;">V</span>
2025-04-01 21:35:30 +08:00
</view>
</view>
2025-04-11 18:23:16 +08:00
<view class="xuhang">
<view class="">
2025-04-23 18:30:04 +08:00
<image src="https://api.ccttiot.com/smartmeter/img/static/uBueutMzheLZWktEFWVR" mode=""></image> 续航 <span style="font-size: 30rpx;color: #333;font-weight: 600;">{{deviceInfos.remainEndurance == null ? '--' : deviceInfos.remainEndurance}}</span> km
2025-04-01 21:35:30 +08:00
</view>
2025-04-23 17:50:42 +08:00
<!-- <view class="" style="margin-top: 20rpx;">
2025-04-11 18:23:16 +08:00
<image src="https://api.ccttiot.com/smartmeter/img/static/ur7Q7YC9AOkkTpvaLEUU" mode=""></image> 车型 {{deviceInfos.modelName}}
2025-04-23 17:50:42 +08:00
</view> -->
2025-04-01 21:35:30 +08:00
</view>
2025-04-11 18:23:16 +08:00
<view class="ewm">
2025-04-23 17:50:42 +08:00
<!-- <view class="" @click="generateQrcode()">
2025-04-11 18:23:16 +08:00
<image src="https://api.ccttiot.com/smartmeter/img/static/uiCssXpb4SpuFAQYOp2A" mode=""></image> 二维码
2025-04-23 17:50:42 +08:00
</view> -->
<view class="" @click="toTrack">
2025-04-11 18:23:16 +08:00
<image src="https://api.ccttiot.com/smartmeter/img/static/uJtMZ16iR2q8agQ4iLm3" mode=""></image> 轨迹
</view>
<view class="" style="margin-top: 14rpx;" @click="btndaohang">
<image src="https://api.ccttiot.com/smartmeter/img/static/u3De0EsfW6ZctTFCH9p7" mode=""></image> 导航
</view>
2025-04-01 21:35:30 +08:00
</view>
</view>
2025-04-11 18:23:16 +08:00
<view class="caozuoanniu">
<view class="dangeanniu" @click="checkbtn(0)">
<view class="pic">
<image src="https://api.ccttiot.com/smartmeter/img/static/uuHHQU2Yg2sReTadF51Y" mode=""></image>
2025-04-01 21:35:30 +08:00
</view>
2025-04-11 18:23:16 +08:00
开锁
</view>
<view class="dangeanniu" @click="checkbtn(1)">
<view class="pic">
<image src="https://api.ccttiot.com/smartmeter/img/static/uKear247uKM7Axwgh3Jc" mode=""></image>
2025-04-01 21:35:30 +08:00
</view>
2025-04-11 18:23:16 +08:00
关锁
</view>
<view class="dangeanniu" @click="btn(4)">
<view class="pic">
<image src="https://api.ccttiot.com/smartmeter/img/static/uE7zUe5bXdtGGyWA9WGG" mode=""></image>
2025-04-01 21:35:30 +08:00
</view>
2025-04-11 18:23:16 +08:00
响铃寻车
2025-04-01 21:35:30 +08:00
</view>
2025-04-11 18:23:16 +08:00
<view class="dangeanniu" v-if="this.deviceInfos.hardwareVersion && this.deviceInfos.hardwareVersion.toLowerCase().includes('x')" @click="btn(9)">
<view class="pic">
<image src="https://api.ccttiot.com/smartmeter/img/static/ujhsaJeL6KVrYgFSEKkj" mode=""></image>
2025-04-01 21:35:30 +08:00
</view>
2025-04-11 18:23:16 +08:00
坐垫锁
</view>
<view class="dangeanniu" @click="btn(8)">
<view class="pic">
<image src="https://api.ccttiot.com/smartmeter/img/static/uWnOOwRQYpZxB14stYl8" mode=""></image>
2025-04-01 21:35:30 +08:00
</view>
2025-04-11 18:23:16 +08:00
重启
2025-04-01 21:35:30 +08:00
</view>
2025-04-11 18:23:16 +08:00
<view class="dangeanniu" @click="btn(2)" v-if="deviceInfos.status!=8">
<view class="pic">
<image src="https://api.ccttiot.com/smartmeter/img/static/u1PlutiYn3alAcF2VuTH" mode=""></image>
2025-04-01 21:35:30 +08:00
</view>
2025-04-11 18:23:16 +08:00
禁用
</view>
<view class="dangeanniu" @click="btn(3)" v-if="deviceInfos.status==8">
<view class="pic">
<image src="https://api.ccttiot.com/smartmeter/img/static/u1PlutiYn3alAcF2VuTH" mode=""></image>
2025-04-01 21:35:30 +08:00
</view>
2025-04-11 18:23:16 +08:00
解禁
2025-04-01 21:35:30 +08:00
</view>
2025-04-11 18:23:16 +08:00
<view class="dangeanniu" @click="btn(5)" v-if="deviceInfos.status!=0">
<view class="pic">
<image src="https://api.ccttiot.com/smartmeter/img/static/uJvI9lLyEkA2QdSr74LX" mode=""></image>
</view>
回仓
2025-04-01 21:35:30 +08:00
</view>
2025-04-11 18:23:16 +08:00
<view class="dangeanniu" @click="btn(6)" v-if="deviceInfos.status==0">
<view class="pic">
<image src="https://api.ccttiot.com/smartmeter/img/static/uJvI9lLyEkA2QdSr74LX" mode=""></image>
</view>
出仓
2025-04-01 21:35:30 +08:00
</view>
2025-04-11 18:23:16 +08:00
<view class="dangeanniu" @click="btn(7)">
<view class="pic">
<image src="https://api.ccttiot.com/smartmeter/img/static/u277Tj0k5M7I8EO4V3ki" mode=""></image>
</view>
车牌修改
2025-04-01 21:35:30 +08:00
</view>
2025-04-11 18:23:16 +08:00
<view class="dangeanniu" @click="changeShwoList">
<view class="pic">
<image src="https://api.ccttiot.com/smartmeter/img/static/ua7Xl6Eew8AvjeKJFKXI" mode=""></image>
</view>
修改车型
2025-04-01 21:35:30 +08:00
</view>
2025-04-23 17:50:42 +08:00
<view class="dangeanniu" @click="yunyingflag = true">
<view class="pic">
<image src="https://api.ccttiot.com/smartmeter/img/static/uZuY3hgJBtCwnSnWTIC3" mode=""></image>
</view>
划拨
</view>
2025-04-21 18:00:19 +08:00
<view class="dangeanniu" v-if="Number(deviceInfos.softwareVersion) > 6000" @click="btnjingyin">
2025-04-11 18:23:16 +08:00
<view class="pic">
<image src="https://api.ccttiot.com/smartmeter/img/static/uUJGVRpPIRC34vF7240K" mode=""></image>
</view>
2025-04-23 17:50:42 +08:00
声音
2025-04-01 21:35:30 +08:00
</view>
2025-04-11 18:23:16 +08:00
<view class="dangeanniu" @click="btn(10)">
<view class="pic">
<image src="https://api.ccttiot.com/smartmeter/img/static/uuuFxDo4XNzXJDTOQIeZ" mode=""></image>
</view>
定位更新
2025-04-01 21:35:30 +08:00
</view>
2025-04-23 17:50:42 +08:00
<view class="dangeanniu" @click="generateQrcode()">
<view class="pic">
<image src="https://api.ccttiot.com/smartmeter/img/static/uQdKTkDuXlwaZT5WFL2l" mode=""></image>
</view>
二维码
</view>
2025-04-12 18:01:40 +08:00
<!-- 蓝牙控制 -->
<view class="dangeanniu" @click="lanya(1)" v-if="ver_dataflag == 3 && deviceInfos.onlineStatus == 0">
<view class="pic">
<image src="https://api.ccttiot.com/smartmeter/img/static/uqUiYiMtGTjkPNgmCjvP" mode=""></image>
</view>
蓝牙开锁
</view>
<view class="dangeanniu" @click="lanya(2)" v-if="ver_dataflag == 3 && deviceInfos.onlineStatus == 0">
<view class="pic">
<image src="https://api.ccttiot.com/smartmeter/img/static/uqUiYiMtGTjkPNgmCjvP" mode=""></image>
</view>
蓝牙关锁
</view>
<view class="dangeanniu" @click="lanya(3)" v-if="ver_dataflag == 3 && deviceInfos.onlineStatus == 0">
<view class="pic">
<image src="https://api.ccttiot.com/smartmeter/img/static/uqUiYiMtGTjkPNgmCjvP" mode=""></image>
</view>
蓝牙重启
</view>
<view class="dangeanniu" @click="lanya(4)" v-if="ver_dataflag == 3 && deviceInfos.onlineStatus == 0">
<view class="pic">
<image src="https://api.ccttiot.com/smartmeter/img/static/uqUiYiMtGTjkPNgmCjvP" mode=""></image>
</view>
蓝牙响铃
</view>
2025-04-11 18:23:16 +08:00
</view>
2025-04-23 17:50:42 +08:00
<view class="zuche">
<view class="">
运营区域<span>{{deviceInfos.areaName == null ? '--' : deviceInfos.areaName}}</span>
2025-04-01 21:35:30 +08:00
</view>
2025-04-23 17:50:42 +08:00
<view class="one">
最后租车客户 <span @click="btntel" style="color: #4C97E7;"><image src="https://api.ccttiot.com/smartmeter/img/static/uCa86z0tr5WHiymtRJYt" mode=""></image>{{deviceInfos.lastUserPhone == null ? '--' : deviceInfos.lastUserPhone}}</span>
2025-04-11 18:23:16 +08:00
</view>
2025-04-23 17:50:42 +08:00
<view class="one" style="display: flex;justify-content: space-between;align-items: center;">
最后定位时间
<view class="one" style="margin-bottom: 0;">
<image src="https://api.ccttiot.com/smartmeter/img/static/uesvOKQAO4eIFWSTIuQD" mode=""></image> {{deviceInfos.satellites == null ? '--' : deviceInfos.satellites}}
2025-04-01 21:35:30 +08:00
</view>
2025-04-23 17:50:42 +08:00
<span>{{deviceInfos.lastLocationTime == null ? '--' : deviceInfos.lastLocationTime}}</span>
2025-04-01 21:35:30 +08:00
</view>
2025-04-23 17:50:42 +08:00
<view class="one" style="display: flex;justify-content: space-between;align-items: center;">
最后在线时间
<view class="one" style="margin-bottom: 0;">
<image src="https://api.ccttiot.com/smartmeter/img/static/u5ouYhbxDvAVM6pImusK" mode=""></image> {{deviceInfos.signalStrength == null ? '--' : deviceInfos.signalStrength}}
</view>
<span>{{deviceInfos.lastOnlineTime == null ? '--' : deviceInfos.lastOnlineTime}}</span>
2025-04-11 18:23:16 +08:00
</view>
2025-04-01 21:35:30 +08:00
</view>
</view>
<u-mask :show="false" @click="show = false" :z-index='100' />
<u-mask :show="maskloading" :z-index='100' duration='0' />
<u-mask :show="showvehicle" @click="closevehicle()" :z-index='100' />
<view class="tip_box" v-if="showvehicle">
<view class="top" v-if="showvehicle">
<view class="tip">
设备信息修改
</view>
<view class="ipt_box">
<view class="text">
车牌号
</view>
<view class="ipt">
<input type="text" v-model="vehicleNum" placeholder=" " class="input"
placeholder-style="color:#C7CDD3">
</view>
</view>
</view>
<view class="bots">
<view class="bot_left" @click="closevehicle()">
取消
</view>
<view class="bot_right" @click="putvehicle()">
确定
</view>
</view>
</view>
<u-mask :show="showqr" @click="closeQr()" :z-index='100' />
2025-04-10 08:57:21 +08:00
<view class="tip_box" v-if="showqr">
2025-04-01 21:35:30 +08:00
<view class="ewm" style="padding-top: 50rpx;">
<canvas id="qrcode" canvas-id="qrcode" style="width: 350rpx;height:350rpx;margin-left: 164rpx;" />
</view>
<view class="saveQr" @click="saveQrcode()">
保存二维码
</view>
</view>
<u-mask :show="showbtntip" @click="closevehicle()" :z-index='100' />
<view class="tip_box" v-if="showbtntip">
<view class="top" v-if="showbtntip">
<view class="tip">
操作提示
</view>
<view class="ipt_box" style="justify-content: center;">
<view class="text" style="width: 80%;text-align: center;">
车辆有正在进行中的订单是否进行该操作
</view>
</view>
</view>
<view class="bots">
<view class="bot_left" @click="closeshowtip() ">
取消
</view>
<view class="bot_right" @click="btn(btnnum)">
确定
</view>
</view>
</view>
<u-select v-model="showModelList" :list="ModelList" title='修改车型' @confirm="confirm"></u-select>
2025-04-23 17:50:42 +08:00
<u-select v-model="yunyingflag" :list="yunyingList" title='修改运营区' @confirm="yunyingconfirm"></u-select>
2025-04-21 18:00:19 +08:00
<u-select v-model="shengyin" :list="shengyinlist" title='修改声音' @confirm="shengyinaniu"></u-select>
2025-04-01 21:35:30 +08:00
</view>
</template>
<script>
const app = getApp()
var xBlufi = require("@/components/blufi/xBlufi.js")
let _this = null
export default {
data() {
return {
2025-04-21 18:00:19 +08:00
shengyin:false,
shengyinlist:[{label:'静音',value:0},{label:'语音',value:1},{label:'彩铃',value:2}],
2025-04-23 17:50:42 +08:00
2025-04-01 21:35:30 +08:00
devicesList: [],
searching: false,
texts: '正在扫描蓝牙设备...',
btnflag: true,
tishiflag: false,
option: '',
bluthlist: [], //蓝牙数组
statusflag: false,
Bluetoothmac: '',
mac: '',
ishave: false,
ver_data: null,
deviceInfoss: {},
gps: {},
isband: false,
deviceIds: '',
name: '',
orderinfo: {},
dl: 0,
czmoney: true,
iscz: true,
bgc: {
backgroundColor: "#F7FAFE",
},
show: true,
showgj: true,
searchKeyword: '11',
latitude: '',
longitude: '',
isMap: false,
zoomSize: 15,
markers: [],
polyline: [],
polygons: [],
cardId: '001区域',
sn: '',
deviceInfos: {},
carstause: false,
maskloading: false,
toploadtxt: "开锁中0%",
loadimg: 'https://lxnapi.ccttiot.com/bike/img/static/urJQJnOI1DEjWatFqHYh',
tiptxt: '请定点停放,规范用车',
maskepage: 0,
backgps: {},
buletxt: '',
buleclose: false,
buleopen: false,
bulering: false,
bulerebort: false,
getnum: 0,
showvehicle: false,
vehicleNum: '',
showbtntip: false,
btnnum: null,
showqr: false,
canvasWidth: 300,
2025-04-10 08:57:21 +08:00
deptId: null,
showModelList: false,
ModelList: [],
2025-04-23 17:50:42 +08:00
yunyingflag: false,
yunyingList: [],
2025-04-21 18:00:19 +08:00
jytxt: '',
2025-04-10 08:57:21 +08:00
ver_dataflag: 1,
mac: '',
deviceid: '',
devicename: '',
devicesarr: [],
findDeviceTimer: null
2025-04-01 21:35:30 +08:00
}
},
onLoad(e) {
this.sn = e.id
this.deviceInfo()
this.deptId = uni.getStorageSync('deptId');
},
2025-04-10 08:57:21 +08:00
onShow() {
2025-04-23 17:50:42 +08:00
this.getyunying()
2025-04-01 21:35:30 +08:00
xBlufi.notifyStartDiscoverBle({
2025-04-10 08:57:21 +08:00
'isStart': true
2025-04-01 21:35:30 +08:00
})
2025-04-10 08:57:21 +08:00
xBlufi.listenDeviceMsgEvent(true, this.funListenDeviceMsgEvent)
2025-04-01 21:35:30 +08:00
},
2025-04-10 08:57:21 +08:00
onUnload: function() {
xBlufi.notifyConnectBle({
isStart: false,
deviceId: this.deviceId,
name: this.name
})
if (this.findDeviceTimer) {
clearTimeout(this.findDeviceTimer)
this.findDeviceTimer = null
}
2025-04-01 21:35:30 +08:00
},
methods: {
2025-04-23 18:30:04 +08:00
// 点击提示什么声音模式
btnsy(){
if(this.deviceInfos.music == 0){
uni.showToast({
title: '当前设备为静音模式',
icon: 'none',
duration: 2000
})
}else if(this.deviceInfos.music == 1){
uni.showToast({
title: '当前设备为语音模式',
icon: 'none',
duration: 2000
})
}else{
uni.showToast({
title: '当前设备为彩铃模式',
icon: 'none',
duration: 2000
})
}
},
// 点击提示蓝牙
btnly(){
if(this.ver_dataflag == 3){
uni.showToast({
title: '当前设备蓝牙已连接',
icon: 'none',
duration: 2000
})
}else{
uni.showToast({
title: '当前设备蓝牙未连接',
icon: 'none',
duration: 2000
})
}
},
2025-04-23 17:50:42 +08:00
// 请求自己所有运营区
getyunying(){
this.$u.get(`/bst/area/list?pageNum=1&pageSize=999`).then(res =>{
if(res.code == 200){
this.yunyingList = res.rows.map(item => ({
value: item.id,
label: item.name
}))
}
})
},
2025-04-21 18:00:19 +08:00
// 点击拨打最近租车人电话
btntel(){
uni.makePhoneCall({
phoneNumber: this.deviceInfos.lastUserPhone,
success: function(res) {
console.log('拨打电话成功', res)
},
fail: function(err) {
console.error('拨打电话失败', err)
}
})
},
// 选择彩铃
shengyinaniu(e){
2025-04-23 17:50:42 +08:00
this.$u.put(`/bst/device/iot/music?id=${this.sn}&music=${e[0].value}`).then(res => {
2025-04-21 18:00:19 +08:00
if (res.code == 200) {
this.jytxt = e[0].label
2025-04-23 17:50:42 +08:00
this.deviceInfos.music = e[0].value
2025-04-21 18:00:19 +08:00
uni.showToast({
title: '操作成功',
icon: 'success',
duration: 2000
})
}else{
uni.showToast({
title: res.msg,
icon: 'none',
duration: 2000
})
}
})
},
2025-04-11 18:23:16 +08:00
// 点击进行导航
btndaohang(){
uni.openLocation({
latitude: this.deviceInfos.latitude, //纬度-目的地/坐标点
longitude: this.deviceInfos.longitude, //经度-目的地/坐标点
name: '', //地点名称
address:'' //详细地点名称
})
},
// 连接蓝牙
2025-04-10 08:57:21 +08:00
lanya(num) {
if (num == 1) {
xBlufi.notifySendCustomData({
customData: "11open@"
})
} else if (num == 2) {
xBlufi.notifySendCustomData({
customData: "11close@"
})
2025-04-12 18:01:40 +08:00
}else if (num == 3) {
xBlufi.notifySendCustomData({
customData: "11reboot@"
})
2025-04-10 08:57:21 +08:00
} else {
xBlufi.notifySendCustomData({
customData: "11play1@"
})
}
},
getlanya() {
console.log("进入111蓝牙连接")
if (this.ver_dataflag != 3) {
2025-04-12 18:01:40 +08:00
this.ver_dataflag = 1
2025-04-10 08:57:21 +08:00
this.findDevice()
}
},
findDevice() {
// 使用 find 方法查找匹配的设备
const matchedDevice = this.devicesarr.find(device => {
console.log(device.name, this.mac, '111')
return device.name.slice(-12) == this.mac.slice(-12)
})
if (matchedDevice) {
// 找到匹配的设备
xBlufi.notifyStartDiscoverBle({
'isStart': false
})
xBlufi.notifyConnectBle({
isStart: true,
deviceId: matchedDevice.deviceId,
name: matchedDevice.name
})
this.deviceid = matchedDevice.deviceId
this.devicename = matchedDevice.name
console.log(this.deviceid, '11221')
} else {
console.log("未找到匹配的设备,继续查找...")
this.findDeviceTimer = setTimeout(this.findDevice.bind(this), 1000) // 使用 bind 保持 this 上下文
}
},
// 获取附近蓝牙设备列表
funListenDeviceMsgEvent: function(options) {
switch (options.type) {
case xBlufi.XBLUFI_TYPE.TYPE_GET_DEVICE_LISTS:
if (options.result) {
this.devicesarr = options.data
}
break;
case xBlufi.XBLUFI_TYPE.TYPE_CONNECTED:
console.log("连接回调:" + JSON.stringify(options))
if (options.result == true) {
setTimeout(() => {
this.ver_dataflag = 3
}, 2000)
xBlufi.notifyInitBleEsp32({
deviceId: this.deviceid
})
this.deviceid = options.data.deviceId
this.name = this.name
}
break;
case xBlufi.XBLUFI_TYPE.TYPE_RECIEVE_CUSTON_DATA:
this.ver_dataflag = 3
console.log("1收到设备发来的自定义数据结果", options.data)
break;
case xBlufi.XBLUFI_TYPE.TYPE_GET_DEVICE_LISTS_START:
if (!options.result) {
console.log('蓝牙未开启')
return
} else {
this.lanyaflag = false
}
break;
}
},
2025-04-01 21:35:30 +08:00
// 静音
2025-04-10 08:57:21 +08:00
btnjingyin() {
2025-04-21 18:00:19 +08:00
this.shengyin = true
2025-04-01 21:35:30 +08:00
},
2025-04-10 08:57:21 +08:00
toTrack() {
2025-04-01 21:35:30 +08:00
uni.navigateTo({
2025-04-10 08:57:21 +08:00
url: '/page_shanghu/guanli/bike_track?sn=' + this.deviceInfos.sn + '&type=1'
2025-04-01 21:35:30 +08:00
})
},
2025-04-10 08:57:21 +08:00
changeShwoList() {
2025-04-01 21:35:30 +08:00
console.log('diaoyongle')
2025-04-10 08:57:21 +08:00
this.showModelList = true
2025-04-01 21:35:30 +08:00
},
2025-04-23 17:50:42 +08:00
// 修改运营区
yunyingconfirm(e){
let areaId = e[0].value
let data = {
ids: [this.sn],
areaId: areaId
}
this.$u.put('/bst/device/transfer', data).then((res) => {
if (res.code == 200) {
this.showModelList = false
this.deviceInfo()
uni.showToast({
title: '修改成功',
icon: 'none',
duration: 2000
})
} else {
uni.showToast({
title: res.msg,
icon: 'none',
duration: 2000
})
}
})
},
// 修改车型
2025-04-01 21:35:30 +08:00
confirm(e) {
2025-04-10 08:57:21 +08:00
let modelId = e[0].value
2025-04-01 21:35:30 +08:00
let data = {
2025-04-10 08:57:21 +08:00
id: this.sn,
modelId: modelId
2025-04-01 21:35:30 +08:00
}
2025-04-10 08:57:21 +08:00
this.$u.put('/bst/device', data).then((res) => {
2025-04-01 21:35:30 +08:00
if (res.code == 200) {
2025-04-10 08:57:21 +08:00
this.showModelList = false
2025-04-01 21:35:30 +08:00
this.deviceInfo()
uni.showToast({
title: '修改成功',
icon: 'none',
duration: 2000
})
} else {
uni.showToast({
title: res.msg,
icon: 'none',
duration: 2000
})
}
})
},
2025-04-10 08:57:21 +08:00
getModelList() {
2025-04-01 21:35:30 +08:00
this.$u.get(`/bst/model/list?pageNum=1&pageSize=999`).then((res) => {
if (res.code == 200) {
2025-04-10 08:57:21 +08:00
this.ModelList = res.rows.map(item => ({
2025-04-01 21:35:30 +08:00
value: item.id,
label: item.name
}))
} else {
uni.showToast({
title: res.msg,
icon: 'none',
duration: 2000
})
}
})
},
2025-04-10 08:57:21 +08:00
closeQr() {
this.showqr = false
2025-04-01 21:35:30 +08:00
},
generateQrcode() {
uni.navigateTo({
2025-04-10 08:57:21 +08:00
url: '/page_shanghu/guanli/Qrcode?sn=' + this.deviceInfos.sn
2025-04-01 21:35:30 +08:00
})
},
saveQrcode() {
uni.canvasToTempFilePath({
2025-04-10 08:57:21 +08:00
canvasId: 'qrcode',
x: -10, // 裁剪区域的 x
y: 0, // 裁剪区域的 y
width: 155, // 裁剪区域的宽度,包含边距
height: 157 + 15, // 裁剪区域的高度,包含边距
success: (res) => {
uni.saveImageToPhotosAlbum({
filePath: res.tempFilePath,
success: () => {
uni.showToast({
title: '保存成功',
icon: 'success'
})
this.showqr = false
},
fail: (err) => {
uni.showToast({
title: '保存失败',
icon: 'none'
})
}
})
},
fail: (err) => {
uni.showToast({
title: '生成二维码失败',
icon: 'none'
})
}
2025-04-01 21:35:30 +08:00
})
},
closeshowtip() {
this.showbtntip = false
},
checkbtn(num) {
if (this.deviceInfos.status == 3 || this.deviceInfos.status == 2 || this.deviceInfos.status == 4) {
this.showbtntip = true
this.btnnum = num
} else {
this.btn(num)
}
},
putvehicle() {
let data = {
2025-04-10 08:57:21 +08:00
id: this.sn,
vehicleNum: this.vehicleNum
2025-04-01 21:35:30 +08:00
}
2025-04-10 08:57:21 +08:00
this.$u.put('/bst/device', data).then((res) => {
2025-04-01 21:35:30 +08:00
if (res.code == 200) {
this.deviceInfo()
this.showvehicle = false
uni.showToast({
title: '修改成功',
icon: 'none',
duration: 2000
})
} else {
uni.showToast({
title: res.msg,
icon: 'none',
duration: 2000
})
}
})
},
closemask() {
this.maskloading = false
},
statuss() {
2025-04-10 08:57:21 +08:00
if (this.deviceInfos.sn) {
2025-04-01 21:35:30 +08:00
if (this.deviceInfos.etOrders[0]) {
if (this.deviceInfos.etOrders[0].status == 0) {
return '预约中'
} else if (this.deviceInfos.etOrders[0].status == 1) {
return '取消预约'
} else if (this.deviceInfos.etOrders[0].status == 2) {
return '骑行中'
} else if (this.deviceInfos.etOrders[0].status == 3) {
return '骑行结束'
} else if (this.deviceInfos.etOrders[0].status == 4) {
return '订单完成'
}
}
}
},
closevehicle() {
this.showvehicle = false
},
btn(num) {
this.showbtntip = false
let data = [this.sn]
if (num == 0) {
uni.showLoading({
title: '加载中...'
})
console.log('点击了....1');
this.$u.put('/bst/device/iot/unlock?id=' + this.sn).then((res) => {
if (res.code == 200) {
// 处理接口返回的数据,将边界数据转换为地图组件需要的折线结构
this.deviceInfo()
uni.showToast({
title: '操作成功',
icon: 'success',
duration: 2000
})
} else {
uni.hideLoading()
2025-04-10 08:57:21 +08:00
uni.showToast({
title: res.msg,
icon: 'none',
duration: 2000
})
2025-04-01 21:35:30 +08:00
}
})
} else if (num == 1) {
uni.showLoading({
title: '加载中...'
})
console.log('点击了....2');
this.$u.put('/bst/device/iot/lock?id=' + this.sn).then((res) => {
if (res.code == 200) {
// 处理接口返回的数据,将边界数据转换为地图组件需要的折线结构
this.deviceInfo()
uni.showToast({
title: '操作成功',
icon: 'success',
duration: 2000
});
} else {
uni.hideLoading()
2025-04-10 08:57:21 +08:00
uni.showToast({
title: res.msg,
icon: 'none',
duration: 2000
})
2025-04-01 21:35:30 +08:00
}
})
} else if (num == 2) {
uni.showLoading({
title: '加载中...'
})
2025-04-10 08:57:21 +08:00
this.$u.put('/bst/device/disable', data).then((res) => {
2025-04-01 21:35:30 +08:00
if (res.code == 200) {
uni.showToast({
title: '解禁成功',
icon: 'success',
duration: 2000
});
// 处理接口返回的数据,将边界数据转换为地图组件需要的折线结构
this.deviceInfo()
} else {
uni.showToast({
title: res.msg,
icon: 'none',
duration: 2000
})
}
})
} else if (num == 3) {
uni.showLoading({
title: '加载中...'
})
2025-04-10 08:57:21 +08:00
this.$u.put('/bst/device/enable', data).then((res) => {
2025-04-01 21:35:30 +08:00
if (res.code == 200) {
// 处理接口返回的数据,将边界数据转换为地图组件需要的折线结构
uni.showToast({
title: '解禁成功',
icon: 'success',
duration: 2000
});
this.deviceInfo()
} else {
uni.showToast({
title: res.msg,
icon: 'none',
duration: 2000
});
}
})
} else if (num == 4) {
uni.showLoading({
title: '加载中...'
})
this.$u.put('/bst/device/iot/ring?id=' + this.sn).then((res) => {
if (res.code == 200) {
uni.hideLoading()
uni.showToast({
title: '操作成功',
icon: 'success',
duration: 2000
});
} else {
uni.hideLoading()
uni.showToast({
title: res.msg,
icon: 'none',
duration: 2000
});
}
})
} else if (num == 5) {
uni.showLoading({
title: '加载中...'
})
2025-04-10 08:57:21 +08:00
this.$u.put('/bst/device/in', data).then((res) => {
2025-04-01 21:35:30 +08:00
if (res.code == 200) {
uni.showToast({
title: '回仓成功',
icon: 'success',
duration: 2000
});
this.deviceInfo()
} else {
uni.showToast({
title: res.msg,
icon: 'none',
duration: 2000
})
}
})
} else if (num == 6) {
uni.showLoading({
title: '加载中...'
})
2025-04-10 08:57:21 +08:00
this.$u.put('/bst/device/out', data).then((res) => {
2025-04-01 21:35:30 +08:00
if (res.code == 200) {
this.deviceInfo()
uni.showToast({
title: '出仓成功',
icon: 'success',
duration: 2000
})
} else {
uni.showToast({
title: res.msg,
icon: 'none',
duration: 2000
})
}
})
} else if (num == 7) {
this.showvehicle = true
} else if (num == 8) {
uni.showLoading({
title: '加载中...'
})
this.$u.put('/bst/device/iot/reboot?id=' + this.sn).then((res) => {
if (res.code == 200) {
this.deviceInfo()
uni.showToast({
title: '操作成功',
icon: 'success',
duration: 2000
})
} else {
uni.showToast({
title: res.msg,
icon: 'none',
duration: 2000
})
}
})
} else if (num == 9) {
uni.showLoading({
title: '加载中...'
})
this.$u.put('/bst/device/iot/unlockSeat?id=' + this.sn).then((res) => {
if (res.code == 200) {
this.deviceInfo()
uni.showToast({
title: '操作成功',
icon: 'success',
duration: 2000
})
} else {
uni.showToast({
title: res.msg,
icon: 'none',
duration: 2000
})
}
})
} else if (num == 10) {
uni.showLoading({
title: '加载中...'
})
this.$u.put('/bst/device/iot/refresh?id=' + this.sn).then((res) => {
if (res.code == 200) {
this.deviceInfo()
uni.showToast({
title: '操作成功',
icon: 'success',
duration: 2000
})
} else {
uni.showToast({
title: res.msg,
icon: 'none',
duration: 2000
})
}
})
}
},
btnyc() {
this.titleflag = false
},
// 点击隐藏没有设备提示
btnhd() {
this.tishiflag = false
},
deviceInfo() {
this.markers = []
this.$u.get(`/bst/device?id=${this.sn}`).then((res) => {
console.log(res, 'rererer')
if (res.code === 200) {
2025-04-21 18:00:19 +08:00
if(res.data.music == 0){
this.jytxt = '静音'
}else if(res.data.music == 1){
this.jytxt = '语音'
}else if(res.data.music == 2){
this.jytxt = '彩铃'
}
2025-04-01 21:35:30 +08:00
this.deviceInfos = res.data
2025-04-10 08:57:21 +08:00
this.mac = res.data.mac
2025-04-12 18:01:40 +08:00
if (res.data.onlineStatus == 0) {
this.getlanya()
}
2025-04-21 18:00:19 +08:00
// if (res.data.isSound == 0) {
// this.jytxt = '关'
// } else {
// this.jytxt = '开'
// }
2025-04-01 21:35:30 +08:00
if (this.getnum == 0) {
this.getArea()
}
this.getnum = 1
2025-04-21 18:00:19 +08:00
this.vehicleNum = res.data.vehicleNum
2025-04-01 21:35:30 +08:00
this.getModelList()
this.latitude = this.deviceInfos.latitude
this.longitude = this.deviceInfos.longitude
if (this.deviceInfos.status == 0) {
this.markers.push({
id: parseFloat(this.deviceInfos.sn),
latitude: this.deviceInfos.latitude,
longitude: this.deviceInfos.longitude,
// title: item.deviceName,
width: 40,
height: 47,
// iconPath: 'https://lxnapi.ccttiot.com/bike/img/static/u6jBvj7S50FPgsHaHXai',
iconPath: this.deviceInfos.onlineStatus == 0 ?
'https://lxnapi.ccttiot.com/bike/img/static/uQRng4QNKA38Amk8Wgt5' :
'https://lxnapi.ccttiot.com/bike/img/static/uocjFo8Ar2BJVpzC2G2f',
callout: {
content: this.deviceInfos.remainingPower + '%', // 修改为你想要显示的文字内容
color: '#ffffff', // 修改为文字颜色
fontSize: 10, // 修改为文字大小
borderRadius: 10, // 修改为气泡圆角大小
bgColor: '#000000', // 修改为气泡背景颜色
padding: 2, // 修改为气泡内边距
display: 'ALWAYS', // 修改为气泡的显示策略
}
})
} else if (this.deviceInfos.status == 1) {
this.markers.push({
id: parseFloat(this.deviceInfos.sn),
latitude: this.deviceInfos.latitude,
longitude: this.deviceInfos.longitude,
// title: item.deviceName,
width: 40,
height: 47,
iconPath: this.deviceInfos.onlineStatus == 0 ?
'https://lxnapi.ccttiot.com/bike/img/static/uzhMeExOQJbMcZtrfGUV' :
'https://lxnapi.ccttiot.com/bike/img/static/uheL17wVZn24BwCwEztT',
callout: {
content: this.deviceInfos.remainingPower + '%', // 修改为你想要显示的文字内容
color: '#2679D1', // 修改为文字颜色
fontSize: 10, // 修改为文字大小
borderRadius: 10, // 修改为气泡圆角大小
bgColor: '#D4ECFF', // 修改为气泡背景颜色
padding: 2, // 修改为气泡内边距
display: 'ALWAYS', // 修改为气泡的显示策略
}
})
} else if (this.deviceInfos.status == 2) {
this.markers.push({
id: parseFloat(this.deviceInfos.sn),
latitude: this.deviceInfos.latitude,
longitude: this.deviceInfos.longitude,
// title: item.deviceName,
width: 40,
height: 47,
iconPath: this.deviceInfos.onlineStatus == 0 ?
'https://lxnapi.ccttiot.com/bike/img/static/uR3DQEssiK62ovhh88y8' :
'https://lxnapi.ccttiot.com/bike/img/static/u460R1NKWHEpHbt0U4H7',
callout: {
content: this.deviceInfos.remainingPower + '%', // 修改为你想要显示的文字内容
color: '#2679D1', // 修改为文字颜色
fontSize: 10, // 修改为文字大小
borderRadius: 10, // 修改为气泡圆角大小
bgColor: '#D4ECFF', // 修改为气泡背景颜色
padding: 2, // 修改为气泡内边距
display: 'ALWAYS', // 修改为气泡的显示策略
}
})
} else if (this.deviceInfos.status == 3) {
this.markers.push({
id: parseFloat(this.deviceInfos.sn),
latitude: this.deviceInfos.latitude,
longitude: this.deviceInfos.longitude,
// title: item.deviceName,
width: 40,
height: 47,
2025-04-10 08:57:21 +08:00
iconPath: this.deviceInfos.onlineStatus == 0 ?
2025-04-01 21:35:30 +08:00
'https://lxnapi.ccttiot.com/bike/img/static/uG13E7BpUFF44wVYC9no' :
'https://lxnapi.ccttiot.com/bike/img/static/uHQIdWCTmtUztl49wBKU',
callout: {
content: this.deviceInfos.remainingPower + '%', // 修改为你想要显示的文字内容
color: '#2679D1', // 修改为文字颜色
fontSize: 10, // 修改为文字大小
borderRadius: 10, // 修改为气泡圆角大小
bgColor: '#D4ECFF', // 修改为气泡背景颜色
padding: 2, // 修改为气泡内边距
display: 'ALWAYS', // 修改为气泡的显示策略
}
})
2025-04-11 18:23:16 +08:00
} else if (this.deviceInfos.status == 4 || this.deviceInfos.status == 9) {
2025-04-01 21:35:30 +08:00
this.markers.push({
id: parseFloat(this.deviceInfos.sn),
latitude: this.deviceInfos.latitude,
longitude: this.deviceInfos.longitude,
// title: item.deviceName,
width: 40,
height: 47,
// joinCluster: true,
iconPath: this.deviceInfos.onlineStatus == 0 ?
'https://lxnapi.ccttiot.com/bike/img/static/uRod2zf3t9dAOYafWoWt' :
'https://lxnapi.ccttiot.com/bike/img/static/uZpXq3TBtM5gVgJJeImY',
callout: {
content: this.deviceInfos.remainingPower + '%', // 修改为你想要显示的文字内容
color: '#2679D1', // 修改为文字颜色
fontSize: 10, // 修改为文字大小
borderRadius: 10, // 修改为气泡圆角大小
bgColor: '#D4ECFF', // 修改为气泡背景颜色
padding: 2, // 修改为气泡内边距
display: 'ALWAYS', // 修改为气泡的显示策略
}
})
} else if (this.deviceInfos.status == 6) {
this.markers.push({
id: parseFloat(this.deviceInfos.sn),
latitude: this.deviceInfos.latitude,
longitude: this.deviceInfos.longitude,
// title: item.deviceName,
width: 40,
height: 47,
iconPath: this.deviceInfos.onlineStatus == 0 ?
'https://lxnapi.ccttiot.com/bike/img/static/uhZudZM3nEKj0tYKlho2' :
'https://lxnapi.ccttiot.com/bike/img/static/ujur6TezvPf4buFAqPHo',
callout: {
content: '' + this.deviceInfos.remainingPower + '%',
color: '#2679D1', // 修改为文字颜色
fontSize: 10, // 修改为文字大小
borderRadius: 10, // 修改为气泡圆角大小
bgColor: '#D4ECFF', // 修改为气泡背景颜色
padding: 2, // 修改为气泡内边距
display: 'ALWAYS', // 修改为气泡的显示策略
}
})
} else if (this.deviceInfos.status == 8) {
this.markers.push({
id: parseFloat(this.deviceInfos.sn),
latitude: this.deviceInfos.latitude,
longitude: this.deviceInfos.longitude,
// title: item.deviceName,
width: 40,
height: 47,
iconPath: this.deviceInfos.onlineStatus == 0 ?
'https://lxnapi.ccttiot.com/bike/img/static/ucBKG3ebYRAToVweJihu' :
'https://lxnapi.ccttiot.com/bike/img/static/uyK7Vg4Lu8xb3oNVuG2l',
callout: {
content: this.deviceInfos.remainingPower + '%', // 修改为你想要显示的文字内容
color: '#ffffff', // 修改为文字颜色
fontSize: 10, // 修改为文字大小
borderRadius: 10, // 修改为气泡圆角大小
bgColor: '#000000', // 修改为气泡背景颜色
padding: 2, // 修改为气泡内边距
display: 'ALWAYS', // 修改为气泡的显示策略
}
})
}
this.$forceUpdate()
} else {
uni.showToast({
title: res.msg,
icon: 'none',
duration: 2000
})
}
})
},
convertBoundaryToPolyline(boundary) {
if (!boundary) return null
const points = JSON.parse(boundary).map(coord => ({
latitude: coord[1],
longitude: coord[0]
}))
const polyline = {
points: points,
fillColor: "#55888840", //填充颜色
strokeColor: "#22FF00", //描边颜色
strokeWidth: 2, //描边宽度
zIndex: 1, //层级
}
return polyline
},
convertBoundaryToPolylines(boundaries, num) {
if (num == 1) {
console.log('判断')
return boundaries.map(boundary => {
if (!boundary) return null
let coords
try {
coords = JSON.parse(boundary)
} catch (error) {
console.error("Error parsing boundary JSON:", error)
return null
}
if (!Array.isArray(coords)) {
console.error("Parsed boundary is not an array:", coords)
return null
}
2025-04-10 08:57:21 +08:00
console.log(coords, '1111111');
2025-04-01 21:35:30 +08:00
const points = coords.map(coord => ({
latitude: coord[1],
longitude: coord[0]
}))
return {
points: points,
fillColor: "#3A7EDB40", //填充颜色
strokeColor: "#3A7EDB", //描边颜色
strokeWidth: 2, //描边宽度
zIndex: 1, //层级
};
}).filter(polyline => polyline !== null) // 过滤掉无效的折线数据
} else if (num == 2) {
return boundaries.map(boundary => {
if (!boundary) return null
let coords
try {
coords = JSON.parse(boundary)
} catch (error) {
console.error("Error parsing boundary JSON:", error)
return null;
}
if (!Array.isArray(coords)) {
console.error("Parsed boundary is not an array:", coords)
return null;
}
2025-04-10 08:57:21 +08:00
console.log(coords, '2222222222222');
2025-04-01 21:35:30 +08:00
const points = coords.map(coord => ({
latitude: coord[1],
longitude: coord[0]
}))
return {
points: points,
fillColor: "#FFF5D640", //填充颜色
2025-04-12 18:01:40 +08:00
strokeColor: "#FF473E", //描边颜色
2025-04-01 21:35:30 +08:00
strokeWidth: 2, //描边宽度
zIndex: 1, //层级
}
}).filter(polyline => polyline !== null) // 过滤掉无效的折线数据
} else if (num == 3) {
return boundaries.map(boundary => {
if (!boundary) return null
let coords
try {
coords = JSON.parse(boundary)
} catch (error) {
console.error("Error parsing boundary JSON:", error)
return null
}
if (!Array.isArray(coords)) {
console.error("Parsed boundary is not an array:", coords)
return null
}
2025-04-10 08:57:21 +08:00
console.log(coords, '333333333333');
2025-04-01 21:35:30 +08:00
const points = coords.map(coord => ({
latitude: coord[1],
longitude: coord[0]
}));
return {
points: points,
fillColor: "#FFD1CF40", //填充颜色
2025-04-12 18:01:40 +08:00
strokeColor: "#FFC107", //描边颜色
2025-04-01 21:35:30 +08:00
strokeWidth: 2, //描边宽度
zIndex: 1, //层级
};
}).filter(polyline => polyline !== null) // 过滤掉无效的折线数据
}
},
toggleIconAndCallout() {
this.showIconAndCallout = !this.showIconAndCallout
if (this.showIconAndCallout) {
const newMarkers = []
this.parkingList.forEach(item => {
newMarkers.push({
id: parseFloat(item.id),
latitude: parseFloat(item.latitude),
longitude: parseFloat(item.longitude),
width: 20,
height: 28.95,
iconPath: item.type == 1 ?
'https://lxnapi.ccttiot.com/bike/img/static/up2xXqAgwCX5iER600k3' : item
.type == 2 ?
2025-04-12 18:01:40 +08:00
'https://lxnapi.ccttiot.com/bike/img/static/uDNY5Q4zOiZTCBTA2Jdq' :
'https://lxnapi.ccttiot.com/bike/img/static/u53BAQcFIX3vxsCzEZ7t',
2025-04-01 21:35:30 +08:00
callout: {
content: item.name,
color: '#ffffff',
fontSize: 14,
borderRadius: 10,
2025-04-12 18:01:40 +08:00
bgColor: item.type == 1 ? '#3A7EDB' : item.type == 2 ? '#FF473E' :
'#FFC107',
2025-04-01 21:35:30 +08:00
padding: 6,
display: 'ALWAYS'
},
isCalloutVisible: true // 添加标记
})
})
this.$set(this, 'markers', [...this.markers, ...newMarkers])
} else {
// 过滤掉所有气泡显示的标记
this.$set(this, 'markers', this.markers.filter(marker => !marker.isCalloutVisible))
}
},
getParking() {
// 发送请求获取数据
let data = {
areaId: this.deviceInfos.areaId,
2025-04-10 08:57:21 +08:00
type: ''
2025-04-01 21:35:30 +08:00
}
2025-04-10 08:57:21 +08:00
this.$u.get(`/bst/areaSub/listByAreaId`, data).then((res) => {
2025-04-01 21:35:30 +08:00
if (res.code === 200) {
// 处理接口返回的数据
const type1Data = []
const type2Data = []
const type3Data = []
res.data.forEach(row => {
if (row.type == 1) {
type1Data.push(row)
} else if (row.type == 2) {
type2Data.push(row)
} else if (row.type == 3) {
type3Data.push(row)
}
})
const validBoundaries = type1Data.map(row => row.boundaryStr).filter(boundary =>
typeof boundary === 'string' && boundary.trim() !== '')
const polylines = this.convertBoundaryToPolylines(validBoundaries, 1)
const validBoundaries1 = type2Data.map(row => row.boundaryStr).filter(boundary =>
typeof boundary === 'string' && boundary.trim() !== '')
const polylines1 = this.convertBoundaryToPolylines(validBoundaries1, 2)
const validBoundaries2 = type3Data.map(row => row.boundaryStr).filter(boundary =>
typeof boundary === 'string' && boundary.trim() !== '')
const polylines2 = this.convertBoundaryToPolylines(validBoundaries2, 3)
// 将处理后的数据添加到 this.polyline 中
this.polyline = this.polyline.concat(polylines2)
this.polyline = this.polyline.concat(polylines1)
this.polyline = this.polyline.concat(polylines)
this.parkingList = res.data
// console.log(this.polyline);
}
}).catch(error => {
console.error("Error fetching parking data:", error)
})
},
getArea() {
// 发送请求获取数据
let id = this.deviceInfos.areaId
this.$u.get(`/bst/area/${id}`).then((res) => {
if (res.code === 200) {
// 处理接口返回的数据,将边界数据转换为地图组件需要的折线结构
const polylines = this.convertBoundaryToPolyline(res.data.boundaryStr)
// 更新折线数据
this.polyline.push(polylines)
console.log(this.polyline);
this.getParking()
}
}).catch(error => {
console.error("Error fetching area data:", error)
})
},
}
}
</script>
<style lang="scss">
page {
overflow-x: hidden;
2025-04-10 08:57:21 +08:00
background-color: #F6F8FA; // 更改背景色为更柔和的色调
2025-04-01 21:35:30 +08:00
}
2025-04-10 08:57:21 +08:00
2025-04-01 21:35:30 +08:00
.page {
padding-bottom: 400rpx;
width: 750rpx;
2025-04-11 18:23:16 +08:00
.new_infocard{
width: 750rpx;
max-height: 1384rpx;
overflow: scroll;
background: #FFFFFF;
border-radius: 30rpx;
padding: 30rpx;
box-sizing: border-box;
position: absolute;
z-index: 99;
top: 900rpx;
.zuche{
margin-top: 26rpx;
.one{
display: flex;
align-items: center;
image{
width: 32rpx;
height: 32rpx;
margin-right: 4rpx;
}
span{
font-size: 28rpx;
2025-04-23 17:50:42 +08:00
color: #3D3D3D;
2025-04-11 18:23:16 +08:00
}
}
view{
font-size: 28rpx;
color: #808080;
margin-bottom: 26rpx;
2025-04-23 17:50:42 +08:00
display: flex;
justify-content: space-between;
2025-04-11 18:23:16 +08:00
span{
color: #3D3D3D;
}
}
}
.bikejcxx{
margin-top: 26rpx;
border-bottom: 1rpx solid #D8D8D8;
.wai{
display: flex;
justify-content: space-between;
margin-bottom: 26rpx;
.lt{
width: 46%;
text-align: left;
2025-04-16 09:14:52 +08:00
font-size: 24rpx;
2025-04-11 18:23:16 +08:00
color: #808080;
span{
color: #3D3D3D;
}
}
}
}
.caozuoanniu{
display: flex;
flex-wrap: wrap;
margin-top: 26rpx;
border-bottom: 1rpx solid #D8D8D8;
.dangeanniu{
width: 20%;
text-align: center;
margin-bottom: 28rpx;
.pic{
width: 88rpx;
height: 88rpx;
background: #F1F1F1;
border-radius: 6rpx 6rpx 6rpx 6rpx;
margin: auto;
margin-bottom: 14rpx;
image{
2025-04-23 17:50:42 +08:00
width: 42rpx;
height: 42rpx;
margin-top: 24rpx;
2025-04-11 18:23:16 +08:00
}
}
}
}
.ewm{
view{
width: 140rpx;
height: 44rpx;
background: #4C97E7;
border-radius: 6rpx 6rpx 6rpx 6rpx;
font-size: 24rpx;
color: #FFFFFF;
display: flex;
align-items: center;
padding: 0 8rpx;
padding-left: 18rpx !important;
text-align: center;
box-sizing: border-box;
image{
width: 26rpx;
height: 26rpx;
margin-right: 10rpx;
}
}
}
.xuhang{
view{
width: 284rpx;
2025-04-23 17:50:42 +08:00
height: 102rpx;
2025-04-11 18:23:16 +08:00
background: #F1F1F1;
border-radius: 8rpx 8rpx 8rpx 8rpx;
display: flex;
align-items: center;
2025-04-23 17:50:42 +08:00
font-size: 30rpx;
2025-04-23 18:30:04 +08:00
color: #847f7f;
2025-04-11 18:23:16 +08:00
padding-left: 18rpx;
box-sizing: border-box;
image{
2025-04-23 17:50:42 +08:00
width: 56rpx;
height: 56rpx;
2025-04-11 18:23:16 +08:00
margin-right: 14rpx;
}
}
}
2025-04-23 17:50:42 +08:00
.bikesn{
font-size: 24rpx;
color: #7C7C7C;
display: flex;
align-items: center;
justify-content: space-between;
border-bottom: 1rpx solid #D8D8D8;
padding-bottom: 26rpx;
}
.cent{
display: flex;
.lypic{
display: flex;
align-items: center;
font-size: 24rpx;
color: #3D3D3D;
margin-right: 22rpx;
image{
width: 36rpx;
height: 36rpx;
margin-right: 8rpx;
}
}
}
2025-04-11 18:23:16 +08:00
.bikexx{
margin-top: 26rpx;
display: flex;
justify-content: space-between;
border-bottom: 1rpx solid #D8D8D8;
padding-bottom: 26rpx;
box-sizing: border-box;
.dianliang{
position: relative;
2025-04-23 17:50:42 +08:00
background: linear-gradient(to right, #c0dfff, #fff);
border-radius: 10rpx;
2025-04-11 18:23:16 +08:00
.dl{
2025-04-23 17:50:42 +08:00
margin-top: 10rpx;
padding-left: 52rpx;
box-sizing: border-box;
2025-04-23 18:30:04 +08:00
color: #847f7f;
font-size: 24rpx;
2025-04-11 18:23:16 +08:00
}
.dy{
margin-top: 2rpx;
2025-04-23 17:50:42 +08:00
padding-left: 52rpx;
box-sizing: border-box;
2025-04-23 18:30:04 +08:00
color: #847f7f;
font-size: 24rpx;
2025-04-11 18:23:16 +08:00
}
view{
padding-left: 14rpx;
box-sizing: border-box;
font-size: 24rpx;
color: #3D3D3D;
span{
2025-04-23 18:30:04 +08:00
font-size: 28rpx;
2025-04-11 18:23:16 +08:00
}
}
image{
position: absolute;
2025-04-23 17:50:42 +08:00
width: 22rpx;
height: 48rpx;
left: 20rpx;
top: 30rpx;
2025-04-11 18:23:16 +08:00
}
}
}
2025-04-23 17:50:42 +08:00
2025-04-11 18:23:16 +08:00
.topsn{
display: flex;
justify-content: space-between;
2025-04-23 18:30:04 +08:00
padding-bottom: 13rpx;
2025-04-11 18:23:16 +08:00
box-sizing: border-box;
2025-04-23 17:50:42 +08:00
2025-04-11 18:23:16 +08:00
.lt{
font-weight: 600;
2025-04-23 17:50:42 +08:00
font-size: 30rpx;
2025-04-11 18:23:16 +08:00
color: #3D3D3D;
2025-04-12 18:01:40 +08:00
display: flex;
align-items: center;
2025-04-11 18:23:16 +08:00
}
.rt{
display: flex;
.issuo{
width: 104rpx;
height: 42rpx;
background: #F1F1F1;
border-radius: 6rpx 6rpx 6rpx 6rpx;
text-align: center;
line-height: 42rpx;
2025-04-23 18:30:04 +08:00
margin-left: 10rpx;
2025-04-11 18:23:16 +08:00
font-size: 24rpx;
color: #3D3D3D;
}
.stutas{
span{
display: inline-block;
width: 104rpx;
height: 42rpx;
// background: #DBFDD6;
border-radius: 6rpx 6rpx 6rpx 6rpx;
text-align: center;
line-height: 42rpx;
margin-left: 28rpx;
font-size: 24rpx;
color: #fff;
}
}
}
}
}
2025-04-10 08:57:21 +08:00
2025-04-01 21:35:30 +08:00
.tip_box {
position: fixed;
left: 72rpx;
top: 628rpx;
width: 610rpx;
2025-04-10 08:57:21 +08:00
// height: 282rpx;
2025-04-01 21:35:30 +08:00
background: #FFFFFF;
border-radius: 30rpx 30rpx 30rpx 30rpx;
z-index: 110;
padding-bottom: 100rpx;
2025-04-10 08:57:21 +08:00
.saveQr {
2025-04-01 21:35:30 +08:00
margin: 0 auto;
margin-top: 30rpx;
display: flex;
align-items: center;
justify-content: center;
width: 502rpx;
height: 68rpx;
background: #4C97E7;
border-radius: 10rpx 10rpx 10rpx 10rpx;
font-weight: 500;
font-size: 36rpx;
color: #FFFFFF;
}
2025-04-10 08:57:21 +08:00
2025-04-01 21:35:30 +08:00
.top {
padding: 52rpx 38rpx 42rpx 36rpx;
.ipt_box {
margin-top: 22rpx;
display: flex;
flex-wrap: nowrap;
align-items: center;
.text {
width: 350rpx;
font-weight: 400;
font-size: 32rpx;
color: #3D3D3D;
}
.ipt {
padding: 10rpx 18rpx;
display: flex;
align-items: center;
justify-content: space-between;
margin-left: 26rpx;
width: 420rpx;
height: 64rpx;
border-radius: 0rpx 0rpx 0rpx 0rpx;
border: 2rpx solid #979797;
.input {
width: 80%;
}
}
}
.tip {
width: 100%;
text-align: center;
font-weight: 700;
font-size: 32rpx;
color: #3D3D3D;
}
.txt {
margin-top: 32rpx;
width: 100%;
text-align: center;
font-weight: 500;
font-size: 32rpx;
color: #3D3D3D;
}
}
.bots {
position: absolute;
width: 610rpx;
display: flex;
flex-wrap: nowrap;
bottom: -20rpx;
.bot_left {
border-radius: 0rpx 0rpx 0rpx 30rpx;
width: 50%;
height: 86rpx;
display: flex;
align-items: center;
justify-content: center;
font-weight: 500;
font-size: 32rpx;
color: #3D3D3D;
background: #EEEEEE;
}
.bot_right {
border-radius: 0rpx 0rpx 30rpx 0rpx;
width: 50%;
height: 86rpx;
background: #4C97E7;
display: flex;
align-items: center;
justify-content: center;
color: #FFFFFF;
font-weight: 500;
font-size: 32rpx;
}
}
}
2025-04-10 08:57:21 +08:00
.map {
position: relative;
width: 750rpx;
height: 752rpx;
2025-04-01 21:35:30 +08:00
2025-04-10 08:57:21 +08:00
.track,
.park {
position: absolute;
width: 88rpx;
height: 88rpx;
bottom: 40rpx;
border-radius: 50%;
2025-04-01 21:35:30 +08:00
display: flex;
2025-04-10 08:57:21 +08:00
align-items: center;
justify-content: center;
transition: all 0.3s ease;
2025-04-01 21:35:30 +08:00
2025-04-10 08:57:21 +08:00
&:active {
transform: scale(0.95);
2025-04-01 21:35:30 +08:00
}
2025-04-10 08:57:21 +08:00
.img {
width: 80rpx;
height: 80rpx;
}
2025-04-01 21:35:30 +08:00
}
2025-04-10 08:57:21 +08:00
.track {
left: 30rpx;
}
2025-04-01 21:35:30 +08:00
2025-04-10 08:57:21 +08:00
.park {
right: 30rpx;
2025-04-01 21:35:30 +08:00
}
}
}
</style>