This commit is contained in:
Sliverber 2024-07-01 20:57:18 +08:00
parent e166cdcbfe
commit a65b8312e1
9 changed files with 667 additions and 387 deletions

View File

@ -19,13 +19,13 @@ const install = (Vue, vm) => {
// },
// });
uni.setStorageSync('deptId', 100);
uni.setStorageSync('deptId', 101);
Vue.prototype.$u.http.setConfig({
// baseUrl: 'http://61.174.243.28:15861',
// baseUrl: 'http://192.168.2.14:8080',
// baseUrl: 'http://124.221.246.124:2289',
// baseUrl: 'https://dianche.chuantewulian.cn/prod-api',
baseUrl: 'https://dche.ccttiot.com/prod-api',
baseUrl: 'https://dianche.chuantewulian.cn/prod-api',
// baseUrl: 'https://dche.ccttiot.com/prod-api',
loadingText: '努力加载中~',
// loadingTime: 2000,
// 设置自定义头部content-type

View File

@ -51,7 +51,7 @@
/* */
"mp-weixin" : {
"libVersion" : "latest",
"appid" : "wx3428c498d5061192",
"appid" : "wx4d178f8c80348214",
"setting" : {
"urlCheck" : false
},

View File

@ -24,11 +24,52 @@
<view class="iconfont icon-xiangyou1"></view>
</view>
</view>
<view class="btn" @click="callPhone">
<view class="btn" @click="isbackcar=true">
<image src="https://lxnapi.ccttiot.com/bike/img/static/uEM1RpP3J0K51qTjtnA5" mode=""></image>
电话咨询{{areaInfo.servicePhone}}
电话咨询
</view>
<u-mask :show="isbackcar" :z-index='100' duration='0' @click="isbackcar = false" />
<view class="pops" v-if="isbackcar">
<view class="tits" style="font-weight: 600;text-align: center;display: flex;justify-content: center;">
联系电话
</view>
<view class="cont_box" >
<view class="pohone_li" v-if="areaInfo.serviceName1!=''&&areaInfo.serviceName1&&areaInfo.servicePhone1!=''&&areaInfo.servicePhone1" @click="callPhone(areaInfo.servicePhone1)">
<view class="name">
{{areaInfo.serviceName1}}
</view>
<view class="pohone">
{{areaInfo.servicePhone1}}
</view>
</view>
<view class="pohone_li" v-if="areaInfo.serviceName2!=''&&areaInfo.serviceName2&&areaInfo.servicePhone2!=''&&areaInfo.servicePhone2" @click="callPhone(areaInfo.servicePhone2)">
<view class="name">
{{areaInfo.serviceName2}}
</view>
<view class="pohone">
{{areaInfo.servicePhone2}}
</view>
</view>
<view class="pohone_li" v-if="areaInfo.serviceName3!=''&&areaInfo.serviceName3&&areaInfo.servicePhone3!=''&&areaInfo.servicePhone3" @click="callPhone(areaInfo.servicePhone3)">
<view class="name">
{{areaInfo.serviceName3}}
</view>
<view class="pohone">
{{areaInfo.servicePhone3}}
</view>
</view>
</view>
<view class="btn_box">
<view class="btn1" @click="isbackcar = false">
取消
</view>
<!-- <view class="btn2" @click="backDevice()">
确定
</view> -->
</view>
</view>
</view>
</template>
@ -42,7 +83,8 @@
areaInfo: {},
tabindex:0,
classlist:[],
wordlist:[]
wordlist:[],
isbackcar:false
}
},
onShow() {
@ -121,7 +163,8 @@
if (res.code == 200) {
this.areaInfo = res.data
// this.areaInfo.serviceName1=''
// this.areaInfo.servicePhone1='17795402553'
} else {
// uni.showToast({
// title: res.msg,
@ -177,9 +220,10 @@
}
});
},
callPhone(){
callPhone(phone){
this.isbackcar=false
uni.makePhoneCall({
phoneNumber:this.areaInfo.servicePhone
phoneNumber:phone
})
}
}
@ -193,6 +237,190 @@
.page {
width: 750rpx;
.pops {
padding: 46rpx 36rpx;
position: fixed;
top: 400rpx;
left: 74rpx;
width: 604rpx;
// height: 606rpx;
background: #fff;
border-radius: 20rpx 20rpx 20rpx 20rpx;
z-index: 110;
.close {
position: absolute;
left: 266rpx;
bottom: -100rpx;
image {
width: 80rpx;
height: 80rpx;
}
}
.loading_box {
width: 100%;
// height: 200rpx;
display: flex;
align-items: center;
justify-content: center;
image {
width: 336rpx;
height: 154rpx;
}
// .loader {
// width: 120rpx;
// aspect-ratio: 1;
// border-radius: 50%;
// clip-path: inset(-360rpx); /* 4 */
// box-shadow: -240rpx 60rpx, -240rpx 60rpx, -240rpx 60rpx; /* 4 */
// transform: translateY(-60rpx); /* 4 */
// animation: l19 1s infinite linear;
// }
// @keyframes l19 {
// 16.67% {box-shadow:-240rpx 60rpx,-240rpx 60rpx, 76rpx 60rpx} /* 4 */
// 33.33% {box-shadow:-240rpx 60rpx, 0px 60rpx, 76rpx 60rpx} /* 4 */
// 40%,60%{box-shadow: -76rpx 60rpx, 0px 60rpx, 76rpx 60rpx} /* 4 */
// 66.67% {box-shadow: -76rpx 60rpx, 0px 60rpx, 240rpx 60rpx} /* 4 */
// 83.33% {box-shadow: -76rpx 60rpx, 240rpx 60rpx,240rpx 60rpx} /* 4 */
// 100% {box-shadow: 240rpx 60rpx, 240rpx 60rpx,240rpx 60rpx} /* 4 */
// }
}
.btn_box {
margin-top: 80rpx;
display: flex;
align-items: center;
justify-content: center;
.btn1 {
display: flex;
align-items: center;
justify-content: center;
width: 216rpx;
height: 90rpx;
background: #989898;
border-radius: 54rpx 54rpx 54rpx 54rpx;
font-weight: 500;
font-size: 40rpx;
color: #FFFFFF;
}
.btn2 {
display: flex;
align-items: center;
justify-content: center;
width: 268rpx;
height: 90rpx;
background: #4C97E7;
border-radius: 54rpx 54rpx 54rpx 54rpx;
font-weight: 500;
font-size: 40rpx;
color: #FFFFFF;
}
}
.time {
margin-top: 20rpx;
text-align: center;
font-weight: 500;
font-size: 48rpx;
color: #4C97E7;
}
.cont {
height: 500rpx;
overflow-x: hidden;
overflow-y: auto;
}
.tits {
// width: 604rpx;
text-align: center;
font-weight: 500;
font-size: 36rpx;
color: #3D3D3D;
margin-bottom: 54rpx;
}
.cont_box {
margin-top: 36rpx;
display: flex;
flex-wrap: wrap;
align-items: center;
justify-content: center;
.pohone_li{
margin-top: 10rpx;
display: flex;
flex-wrap: nowrap;
.name{
font-weight: 500;
font-size: 36rpx;
color: #3D3D3D;
margin-bottom: 54rpx;
}
.pohone{
margin-left: 20rpx;
font-weight: 500;
font-size: 36rpx;
color: #3D3D3D;
margin-bottom: 54rpx;
}
}
}
.text {
margin-top: 36rpx;
display: flex;
flex-wrap: wrap;
// align-items: center;
.yuan {
margin-top: 10rpx;
margin-right: 12rpx;
width: 20rpx;
height: 20rpx;
background: #000;
border-radius: 50%;
}
span {
width: 90%;
font-weight: 400;
font-size: 28rpx;
color: #3D3D3D;
}
}
.btn {
margin-left: 40rpx;
margin-top: 50rpx;
display: flex;
align-items: center;
justify-content: center;
width: 470rpx;
height: 90rpx;
background: #4C97E7;
border-radius: 54rpx 54rpx 54rpx 54rpx;
font-weight: 500;
font-size: 40rpx;
color: #FFFFFF;
}
.act1 {
background-color: #ccc;
}
}
.backimg{
position: fixed;
width: 750rpx;

View File

@ -61,7 +61,7 @@
content = content.replace(/<img([^>]*)>/g, (match, group1) => {
//
let cleanedGroup = group1.replace(/\s*\/$/, '');
return `<img ${cleanedGroup} style="width: 350rpx; height: auto;" />`;
return `<img style="width: 85vw ; height: auto;" ${cleanedGroup} />`;
});
return content;
@ -80,7 +80,7 @@
width: 750rpx;
.cont {
margin-top: 34rpx;
margin-top: 34rpx ;
margin: 0 auto;
width: 634rpx;

View File

@ -2,37 +2,9 @@
<view class="page">
<u-navbar title="用车指南" :border-bottom="false" :background="bgc" title-color='#000' title-size='36'
height='45'></u-navbar>
<view class="cont">
<view class="tit">
请在运营区内骑行否则将断电
</view>
<view class="txt">
地图上 <span style="color: #4C97E7;">蓝色区域</span>即为运营区
</view>
<view class="txt">
1.在运营区外骑行时车辆可能断电
</view>
<view class="txt">
2.在运营区外还车时车辆无法及时维修将额外收
取调度费
</view>
<view class="img">
<image src="https://api.ccttiot.com/smartmeter/img/static/unYY6S6EsKRM0AMI2AER" mode=""></image>
</view>
<view class="tit" style="margin-top: 58rpx;">
提前确认目的地是否有还车P点
</view>
<view class="txt">
地图上 <span style="color: #34C24D ;">绿色区域</span>标有P即为还车P点
</view>
<view class="txt">
请在P点内关锁还车否则将在骑行费用以外额外 收取调度费
</view>
<view class="img">
<image src="https://api.ccttiot.com/smartmeter/img/static/udVueXhudGgkoyD3tszY" mode=""></image>
</view>
</view>
<view class="cont" v-html="content"></view>
</view>
</template>
@ -43,56 +15,80 @@
bgc: {
backgroundColor: "#fff",
},
content: ''
}
},
onLoad() {
this.getword()
},
methods: {
// getclass() {
// this.$u.get("/app/classify/list?&parentId=111?&classifyId=114" ).then((res) => {
// if (res.code == 200) {
// this.classlist = res.data
// let id =this.classlist[0].classifyId
// this.getword(id)
// } else {
// // uni.showToast({
// // title: res.msg,
// // icon: 'none',
// // duration: 2000
// // });
// }
// });
// },
getword() {
this.$u.get("/app/article/list?classifyId=" + 100).then((res) => {
if (res.code == 200) {
let abb = res.rows.find(item => item.articleId == 19);
this.content = abb.content
this.content = this.replaceImgWithImage(this.content)
} else {
// uni.showToast({
// title: res.msg,
// icon: 'none',
// duration: 2000
// });
}
});
},
replaceImgWithImage(content) {
// &nbsp; \u00A0
content = content.replace(/&nbsp;/g, '\u00A0');
// <img>
content = content.replace(/<img([^>]*)>/g, (match, group1) => {
//
let cleanedGroup = group1.replace(/\s*\/$/, '');
return `<img style="width: 85vw ; height: auto;" ${cleanedGroup} />`;
});
return content;
}
}
}
</script>
<style lang="scss" >
page{
background-color: #fff;
}
.page{
width: 750rpx;
.cont{
margin-top: 34rpx;
margin: 0 auto;
width: 634rpx;
.tit{
margin-bottom: 32rpx;
width: 610rpx;
height: 88rpx;
display: flex;
align-items: center;
// justify-content: center;
padding-left: 30rpx;
background: linear-gradient( 90deg, #91C4FA 0%, rgba(243,243,243,0) 100%);
border-radius: 12rpx 12rpx 12rpx 12rpx;
font-family: AlibabaPuHuiTi, AlibabaPuHuiTi;
font-weight: 500;
font-size: 32rpx;
color: #3D3D3D;
line-height: 44rpx;
}
.txt{
margin-top: 16rpx;
font-weight: 400;
font-size: 28rpx;
color: #3D3D3D;
line-height: 38rpx;
}
.img{
margin-top: 38rpx;
width: 634rpx;
height: 348rpx;
image{
width: 634rpx;
height: 348rpx;
}
}
<style lang="scss">
page {
background-color: #fff;
}
}
</style>
.page {
width: 750rpx;
padding-bottom: 100rpx;
.cont {
margin-top: 34rpx;
margin: 0 auto;
width: 634rpx;
}
}
</style>

View File

@ -364,6 +364,15 @@
"enablePullDownRefresh" : false,
"navigationStyle": "custom"
}
},
{
"path" : "bulelink",
"style" :
{
"navigationBarTitleText" : "",
"enablePullDownRefresh" : false,
"navigationStyle": "custom"
}
}
// userpages ...

View File

@ -1,16 +1,25 @@
<template>
<view class="page">
<view class="tab_top">
<image src="https://lxnapi.ccttiot.com/bike/img/static/uVcMTydm81zCMhHomXl1" mode="" @click="topage(6)">
</image>
<view class="txts" v-if="gps.deptId==100">
创享电动车
<!-- {{areaInfo.areaName}} -->
</view>
<view class="txts" v-if="gps.deptId==101">
嵛你出行
<!-- 自定义导航栏 -->
<view class="navBarBox">
<!-- 状态栏占位 -->
<view class="statusBar" :style="{ paddingTop:statusBarHeight+'px' }"></view>
<!-- 真正的导航栏内容 -->
<view class="navBar" :style="{ height:navBarHeight+'px' }">
<!-- <view>导航栏标题</view> -->
<image src="https://lxnapi.ccttiot.com/bike/img/static/uVcMTydm81zCMhHomXl1" mode="" @tap="topage(6)">
</image>
<view class="txts" v-if="gps.deptId==100">
创享电动车
<!-- {{areaInfo.areaName}} -->
</view>
<view class="txts" v-if="gps.deptId==101">
嵛你出行
</view>
</view>
</view>
<!-- <u-navbar :is-back="false" title="共享电动车" :border-bottom="false" :background="bgc" title-color='#2E4975'
title-size='36' height='36'></u-navbar> -->
<map class="map" id="map" ref="map" :scale="zoomSize" show-location v-if="showmap" :latitude="latitude"
@ -667,7 +676,9 @@
</view>
</view>
<view class="masktips" style="width: 100%;">
未在停车点需支付管理费 <span style="color: coral;font-size: 42rpx;font-weight: 600;">{{areaInfo.vehicleManagementFee}}</span> <!-- 你可查看最近 停车点 -->
未在停车点需支付管理费 <span
style="color: coral;font-size: 42rpx;font-weight: 600;">{{areaInfo.vehicleManagementFee}}</span>
<!-- 你可查看最近 停车点 -->
</view>
<view class="tipsimg">
<image src="https://lxnapi.ccttiot.com/bike/img/static/ur95KSdL2SBEojQHzyEv" mode=""></image>
@ -692,7 +703,7 @@
<view class="masktips" style="width: 100%;">
需连接蓝牙才可解锁,请确保手机蓝牙打开并且授权小程序使用蓝牙权限
</view>
<view class="masktips" @click="totxtpage()"
<view class="masktips" @click="totxtpage()"
style="width: 100%;color: #4C97E7;text-decoration-line: underline;margin-top: 0; font-size: 28rpx;">
点击查看教程
</view>
@ -896,13 +907,16 @@
maskepage: 0,
backgps: {},
buletxt: '',
buleclose:false,
buleopen:false,
buleback:false,
bulepayback:false,
bulebindcar:false,
backfalse:0
buleclose: false,
buleopen: false,
buleback: false,
bulepayback: false,
bulebindcar: false,
backfalse: 0,
statusBarHeight: 0,
//
navBarHeight: 0,
}
},
watch: {
@ -915,8 +929,23 @@
},
onLoad(e) {
//
this.statusBarHeight = uni.getSystemInfoSync()['statusBarHeight'];
// #ifdef MP-WEIXIN
// width,height,top,right,left,bottom
const custom = wx.getMenuButtonBoundingClientRect()
// () = + ( - ) * 2
this.navBarHeight = custom.height + (custom.top - this.statusBarHeight) * 2
// #endif
this.gps.deptId = uni.getStorageSync('deptId');
console.log(e, 'eeeeeeeeeeeeeeeeeee');
if (e.q) {
this.qParam = e.q
@ -967,10 +996,10 @@
if (this.OrderdeviceInfos.onlineStatus != res.data.onlineStatus) {
this.OrderdeviceInfos = res.data
// this.OrderdeviceInfos.onlineStatus ='0'
// if (this.OrderdeviceInfos.onlineStatus == 0 && this.orderinfo.status !=
// 3) {
// if (this.carstause == false) {
// this.isnoline = true
@ -991,40 +1020,40 @@
}, 3000); //
//
uni.getBluetoothAdapterState({
success: function (res) {
if (!res.available) {
console.log('蓝牙不可用');
return;
}
if (!res.discovering) {
console.log('蓝牙正在搜索中');
//
}
if (res.authorized) {
console.log('已授权');
//
} else if (res.authorizing) {
console.log('正在授权');
//
} else {
console.log('未授权');
//
uni.authorize({
scope: 'scope.bluetooth',
success() {
console.log('授权成功');
//
},
fail() {
console.log('授权失败');
//
}
});
}
},
fail: function (err) {
console.log('获取蓝牙状态失败', err);
}
success: function(res) {
if (!res.available) {
console.log('蓝牙不可用');
return;
}
if (!res.discovering) {
console.log('蓝牙正在搜索中');
//
}
if (res.authorized) {
console.log('已授权');
//
} else if (res.authorizing) {
console.log('正在授权');
//
} else {
console.log('未授权');
//
uni.authorize({
scope: 'scope.bluetooth',
success() {
console.log('授权成功');
//
},
fail() {
console.log('授权失败');
//
}
});
}
},
fail: function(err) {
console.log('获取蓝牙状态失败', err);
}
});
if (this.seeDetail == false) {
@ -1175,32 +1204,32 @@
},
},
methods: {
totxtpage(){
this.seeDetail=true
// uni.navigateTo({
// url:
// })
totxtpage() {
this.seeDetail = true
uni.navigateTo({
url:'/page_user/bulelink'
})
},
offopencar(){
this.bulebindcar=true
offopencar() {
this.bulebindcar = true
this.Binddevice()
},
bluesub1() {
// uni.showLoading({});
let data = {
userId: this.userId,
sn: this.sn,
ruleId: this.freeInfo.ruleId,
mark: "确认开锁",
type: '1',
isBluetooth:true,
lon:this.backgps.longitude,
lat:this.backgps.latitude
isBluetooth: true,
lon: this.backgps.longitude,
lat: this.backgps.latitude
};
if(this.carstause){
if (this.carstause) {
this.$u.post('/appVerify/device/snSwitch', data).then((res) => {
// uni.hideLoading();
this.seeDetail = false;
@ -1219,9 +1248,9 @@
// this.maskloading = false;
this.maskepage = 6
// this.showYjTip = true;
} else if(res.msg=='【扫码/编号开锁骑行】发送开锁命令失败'){
this.maskepage=3
} else{
} else if (res.msg == '【扫码/编号开锁骑行】发送开锁命令失败') {
this.maskepage = 3
} else {
// uni.showToast({
// title: res.msg,
// icon: 'none',
@ -1230,16 +1259,16 @@
this.toploadtxt = '开锁失败';
setTimeout(() => {
this.maskloading = false;
}, 800);
}
}
});
}else{
this.bulebindcar=true
} else {
this.bulebindcar = true
this.Binddevice()
}
},
taploadmask(num) {
this.maskepage = 0
@ -1339,7 +1368,7 @@
console.log('获取蓝牙状态失败')
}
})
this.devicesList=[]
this.devicesList = []
this.maskepage = 4
this.buletxt = '蓝牙连接中'
// uni.showLoading({
@ -1433,16 +1462,19 @@
if (res.code == 200) {
// let parkingReturn = true
// let isInParkingArea = false
let parkingReturn = res.data.parkingReturn /** 强制停车点还车 true:开启false:关闭*/
let isInParkingArea = res.data.isInParkingArea /** 是否在停车区内*/
let parkingReturn = res.data
.parkingReturn /** 强制停车点还车 true:开启false:关闭*/
let isInParkingArea = res.data.isInParkingArea /** 是否在停车区内*/
if (parkingReturn) {
//
if (isInParkingArea) {
//
if (that.OrderdeviceInfos.onlineStatus == 1&&that.backfalse<1) {
if (that.OrderdeviceInfos.onlineStatus == 1 && that.backfalse <
1) {
// 线
that.backDevice()
} else if(that.OrderdeviceInfos.onlineStatus == 0||that.backfalse>=1) {
} else if (that.OrderdeviceInfos.onlineStatus == 0 || that
.backfalse >= 1) {
if (that.carstause) {
that.$u.post(
@ -1470,13 +1502,13 @@
setTimeout(() => {
that.maskloading = false;
}, 1000);
}
})
} else {
that.buleback=true
that.buleback = true
that.Binddevice()
}
}
} else {
@ -1485,10 +1517,12 @@
} else {
if (isInParkingArea) {
//
if (that.OrderdeviceInfos.onlineStatus == 1&&that.backfalse<1) {
if (that.OrderdeviceInfos.onlineStatus == 1 && that.backfalse <
1) {
// 线
that.backDevice()
}else if(that.OrderdeviceInfos.onlineStatus == 0||that.backfalse>=1) {
} else if (that.OrderdeviceInfos.onlineStatus == 0 || that
.backfalse >= 1) {
if (that.carstause) {
that.$u.post(
@ -1521,7 +1555,7 @@
}
})
} else {
that.buleback=true
that.buleback = true
that.Binddevice()
// that.isbackdevice = false
// that.isnoline = true
@ -1593,8 +1627,8 @@
})
},
payback() {
console.log(this.OrderdeviceInfos.onlineStatus,'this.OrderdeviceInfosthis.OrderdeviceInfos');
if (this.OrderdeviceInfos.onlineStatus == 1&&this.backfalse<1) {
console.log(this.OrderdeviceInfos.onlineStatus, 'this.OrderdeviceInfosthis.OrderdeviceInfos');
if (this.OrderdeviceInfos.onlineStatus == 1 && this.backfalse < 1) {
// 线
console.log('在线还车');
this.maskepage = 0
@ -1613,7 +1647,7 @@
this.backDevice()
}, 2100);
} else if(this.OrderdeviceInfos.onlineStatus == 0||this.backfalse>=1) {
} else if (this.OrderdeviceInfos.onlineStatus == 0 || this.backfalse >= 1) {
console.log('离线还车');
this.maskepage = 0
this.maskloading = true;
@ -1628,7 +1662,7 @@
}
}, 20); // 40
setTimeout(() => {
if (this.carstause==true) {
if (this.carstause == true) {
this.$u.post('/appVerify/device/return?returnType=1&orderNo=' + this.orderinfo
.orderNo + '&isBluetooth=true' + '&lon=' + this.backgps.longitude +
@ -1666,7 +1700,7 @@
}
})
} else {
this.bulepayback=true
this.bulepayback = true
this.Binddevice()
// this.maskepage = 3
// that.isbackdevice = false
@ -1675,13 +1709,13 @@
}, 1100);
}
},
backDevice() {
this.$u.post('/appVerify/device/return?returnType=1&orderNo=' + this.orderinfo.orderNo).then((
res) => {
if (res.code === 200) {
this.loadimg = 'https://lxnapi.ccttiot.com/bike/img/static/upNvRa9ZQMyiwxLliF5z';
this.toploadtxt = '还车成功!';
@ -1692,7 +1726,7 @@
}, 800);
} else {
this.backfalse=this.backfalse+1
this.backfalse = this.backfalse + 1
this.toploadtxt = '还车失败';
setTimeout(() => {
this.maskloading = false;
@ -1892,10 +1926,10 @@
// this.maskloading = false;
this.maskepage = 6
// this.showYjTip = true;
} else if(res.msg=='【扫码/编号开锁骑行】发送开锁命令失败'){
} else if (res.msg == '【扫码/编号开锁骑行】发送开锁命令失败') {
// this.maskepage=3
this.offopencar()
} else{
} else {
// uni.showToast({
// title: res.msg,
// icon: 'none',
@ -1904,7 +1938,7 @@
this.toploadtxt = '开锁失败';
setTimeout(() => {
this.maskloading = false;
}, 800);
}
}
@ -2211,7 +2245,7 @@
});
},
unloackdevices() {
if (this.OrderdeviceInfos.onlineStatus == 1&&this.backfalse<1) {
if (this.OrderdeviceInfos.onlineStatus == 1 && this.backfalse < 1) {
// uni.showLoading({
// title: '...'
// })
@ -2223,27 +2257,27 @@
this.loadimg =
'https://lxnapi.ccttiot.com/bike/img/static/upNvRa9ZQMyiwxLliF5z';
this.toploadtxt = '开锁成功';
this.buleopen=false
this.buleopen = false
setTimeout(() => {
this.maskloading = false;
this.getisInOrder();
}, 1000);
} else {
this.backfalse=this.backfalse+1
this.backfalse = this.backfalse + 1
this.toploadtxt = '开锁失败';
setTimeout(() => {
this.maskloading = false;
}, 1000);
// if (res.msg == '10500-----') {
// uni.showToast({
// title: '',
// icon: 'none',
// duration: 2000
// });
// } else {
// uni.showToast({
// title: res.msg,
// icon: 'none',
@ -2253,7 +2287,7 @@
}
})
} else if(this.OrderdeviceInfos.onlineStatus == 0||this.backfalse>=1) {
} else if (this.OrderdeviceInfos.onlineStatus == 0 || this.backfalse >= 1) {
if (this.carstause) {
@ -2275,20 +2309,20 @@
if (res.code === 200) {
that.opencar()
that.buleopen=false
that.buleopen = false
// console.log('线');
// that.getisInOrder()
that.loadimg =
'https://lxnapi.ccttiot.com/bike/img/static/upNvRa9ZQMyiwxLliF5z';
that.buletxt = '解锁成功';
that.toploadtxt='解锁成功'
that.toploadtxt = '解锁成功'
setTimeout(() => {
that.maskloading = false;
that.getisInOrder();
}, 1000);
} else {
that.toploadtxt='开锁失败'
that.toploadtxt = '开锁失败'
that.buletxt = '开锁失败';
setTimeout(() => {
that.maskloading = false;
@ -2325,7 +2359,7 @@
} else {
// this.maskepage = 3
this.buleopen=true
this.buleopen = true
this.Binddevice()
}
@ -2334,7 +2368,7 @@
},
//
loackdevice() {
if (this.OrderdeviceInfos.onlineStatus == 1&&this.backfalse<1) {
if (this.OrderdeviceInfos.onlineStatus == 1 && this.backfalse < 1) {
// uni.showLoading({
// title: '...'
// })
@ -2347,18 +2381,18 @@
this.loadimg =
'https://lxnapi.ccttiot.com/bike/img/static/upNvRa9ZQMyiwxLliF5z';
this.toploadtxt = '锁车成功';
this.buleclose=false
this.buleclose = false
setTimeout(() => {
this.maskloading = false;
this.getisInOrder();
}, 1000);
} else {
this.backfalse=this.backfalse+1
this.backfalse = this.backfalse + 1
this.toploadtxt = '锁车失败';
setTimeout(() => {
this.maskloading = false;
}, 1000);
// if (res.msg == '10500-----') {
// uni.showToast({
// title: '',
@ -2375,7 +2409,7 @@
}
})
} else if(this.OrderdeviceInfos.onlineStatus == 0||this.backfalse>=1) {
} else if (this.OrderdeviceInfos.onlineStatus == 0 || this.backfalse >= 1) {
if (this.carstause) {
@ -2401,23 +2435,23 @@
that.closecar()
// console.log('线');
// that.getisInOrder()
that.buleclose=false
that.buleclose = false
that.loadimg =
'https://lxnapi.ccttiot.com/bike/img/static/upNvRa9ZQMyiwxLliF5z';
that.buletxt = '锁车成功';
that.toploadtxt='锁车成功'
that.toploadtxt = '锁车成功'
setTimeout(() => {
that.maskloading = false;
that.getisInOrder();
}, 1000);
} else {
that.toploadtxt='锁车失败'
that.toploadtxt = '锁车失败'
that.buletxt = '锁车失败';
setTimeout(() => {
that.maskloading = false;
}, 1000);
// if (res.msg == '10500-----') {
// uni.showToast({
// title: '',
@ -2448,7 +2482,7 @@
})
} else {
this.buleclose=true
this.buleclose = true
this.Binddevice()
// this.maskepage = 3
}
@ -2551,41 +2585,42 @@
if (options.data) {
this.carstause = true
if (this.maskloading && this.maskepage == 4) {
// setTimeout(() => {
// this.maskloading = false
// }, 700)
if(this.buleback==false&&this.buleopen==false&&this.buleclose==false&&this.bulebindcar==false){
if(this.buletxt=='蓝牙连接中'){
this.buletxt = '蓝牙连接成功!'
if (this.buleback == false && this.buleopen == false && this.buleclose == false && this
.bulebindcar == false) {
if (this.buletxt == '蓝牙连接中') {
this.buletxt = '蓝牙连接成功!'
}
}
if(this.buleclose){
this.buleclose=false
if (this.buleclose) {
this.buleclose = false
this.loackdevice()
}
if(this.buleopen){
this.buleopen=false
if (this.buleopen) {
this.buleopen = false
this.unloackdevices()
}
if(this.buleback){
this.buleback=false
if (this.buleback) {
this.buleback = false
this.cheackgps()
}
if(this.bulepayback){
this.bulepayback=false
if (this.bulepayback) {
this.bulepayback = false
this.payback()
}
if(this.bulebindcar){
this.bulebindcar=false
if (this.bulebindcar) {
this.bulebindcar = false
this.bluesub1()
}
}
@ -2784,7 +2819,7 @@
// this.OrderdeviceInfos.onlineStatus = '0'
this.mac = this.OrderdeviceInfos.mac
if (this.OrderdeviceInfos.onlineStatus == 0 && this.orderinfo.status != 3) {
if (this.carstause == false) {
// this.isnoline = true
@ -3815,41 +3850,41 @@
},
getmarks() {
let data = {
areaId: this.areaInfo.areaId
};
if (this.areaInfo.areaId) {
this.$u.get(`/app/allVehicleByArea`, data).then((res) => {
if (res.code === 200 && res.data != '') {
this.listData = res.data
// this.listData[0].onlineStatus=0
// this.listData = res.data.filter(item => item.onlineStatus != 0);
const newDeviceMarkers = this.listData.map(item => ({
id: parseFloat(item.sn),
latitude: parseFloat(item.latitude),
longitude: parseFloat(item.longitude),
width: 40,
height: 28, //
iconPath: 'https://api.ccttiot.com/smartmeter/img/static/uF9qLejuAZErNTrRuHq7',
isDeviceMarker: true //
}));
//
const preservedMarkers = this.markers.filter(marker => marker.isParkingMarker);
// markers
this.markers = [...newDeviceMarkers, ...preservedMarkers];
this.$set(this, 'markers', [...this.markers]);
this.oldMarkers = [...this.markers];
}
}).catch(error => {
console.error("Error fetching device data:", error);
});
}
let data = {
areaId: this.areaInfo.areaId
};
if (this.areaInfo.areaId) {
this.$u.get(`/app/allVehicleByArea`, data).then((res) => {
if (res.code === 200 && res.data != '') {
this.listData = res.data
// this.listData[0].onlineStatus=0
// this.listData = res.data.filter(item => item.onlineStatus != 0);
const newDeviceMarkers = this.listData.map(item => ({
id: parseFloat(item.sn),
latitude: parseFloat(item.latitude),
longitude: parseFloat(item.longitude),
width: 40,
height: 28, //
iconPath: 'https://api.ccttiot.com/smartmeter/img/static/uF9qLejuAZErNTrRuHq7',
isDeviceMarker: true //
}));
//
const preservedMarkers = this.markers.filter(marker => marker.isParkingMarker);
// markers
this.markers = [...newDeviceMarkers, ...preservedMarkers];
this.$set(this, 'markers', [...this.markers]);
this.oldMarkers = [...this.markers];
}
}).catch(error => {
console.error("Error fetching device data:", error);
});
}
},
isMarkersChanged(newMarkers) {
if (this.oldMarkers.length !== newMarkers.length) {
@ -4024,103 +4059,104 @@
});
},
toggleIconAndCallout() {
this.showIconAndCallout = !this.showIconAndCallout;
this.markers = this.markers.map(marker => {
if (this.showIconAndCallout) {
//
if (marker.isParkingMarker) {
marker.callout.display = 'ALWAYS';
marker.isCalloutVisible = true;
}
} else {
//
if (marker.isParkingMarker) {
marker.callout.display = 'BYCLICK';
marker.isCalloutVisible = false;
}
}
return marker;
});
// markers
this.$set(this, 'markers', [...this.markers]);
this.showIconAndCallout = !this.showIconAndCallout;
this.markers = this.markers.map(marker => {
if (this.showIconAndCallout) {
//
if (marker.isParkingMarker) {
marker.callout.display = 'ALWAYS';
marker.isCalloutVisible = true;
}
} else {
//
if (marker.isParkingMarker) {
marker.callout.display = 'BYCLICK';
marker.isCalloutVisible = false;
}
}
return marker;
});
// markers
this.$set(this, 'markers', [...this.markers]);
},
getParking() {
//
let data = {
areaId: this.areaInfo.areaId
}
this.$u.get('/app/parking/list?', data).then((res) => {
if (res.code === 200) {
//
const type1Data = [];
const type2Data = [];
const type3Data = [];
res.rows.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.rows;
//
const newParkingMarkers = res.rows.map(item => ({
id: parseFloat(item.parkingId),
latitude: parseFloat(item.latitude),
longitude: parseFloat(item.longitude),
width: 20,
height: 29,
iconPath: item.type == 1 ?
'https://lxnapi.ccttiot.com/bike/img/static/up2xXqAgwCX5iER600k3' : item
.type == 2 ?
'https://lxnapi.ccttiot.com/bike/img/static/u53BAQcFIX3vxsCzEZ7t' :
'https://lxnapi.ccttiot.com/bike/img/static/uDNY5Q4zOiZTCBTA2Jdq',
callout: {
content: item.parkingName,
color: '#ffffff',
fontSize: 14,
borderRadius: 10,
bgColor: item.type == 1 ? '#3A7EDB' : item.type == 2 ?
'#FFC107' : '#FF473E',
padding: 6,
display: 'BYCLICK' //
},
isCalloutVisible: false, //
isParkingMarker: true //
}));
//
const preservedMarkers = this.markers.filter(marker => marker.isDeviceMarker);
//
this.markers = [...newParkingMarkers, ...preservedMarkers];
this.$set(this, 'markers', [...this.markers]);
}
}).catch(error => {
console.error("Error fetching parking data:", error);
});
//
let data = {
areaId: this.areaInfo.areaId
}
this.$u.get('/app/parking/list?', data).then((res) => {
if (res.code === 200) {
//
const type1Data = [];
const type2Data = [];
const type3Data = [];
res.rows.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.rows;
//
const newParkingMarkers = res.rows.map(item => ({
id: parseFloat(item.parkingId),
latitude: parseFloat(item.latitude),
longitude: parseFloat(item.longitude),
width: 20,
height: 29,
iconPath: item.type == 1 ?
'https://lxnapi.ccttiot.com/bike/img/static/up2xXqAgwCX5iER600k3' :
item
.type == 2 ?
'https://lxnapi.ccttiot.com/bike/img/static/u53BAQcFIX3vxsCzEZ7t' :
'https://lxnapi.ccttiot.com/bike/img/static/uDNY5Q4zOiZTCBTA2Jdq',
callout: {
content: item.parkingName,
color: '#ffffff',
fontSize: 14,
borderRadius: 10,
bgColor: item.type == 1 ? '#3A7EDB' : item.type == 2 ?
'#FFC107' : '#FF473E',
padding: 6,
display: 'BYCLICK' //
},
isCalloutVisible: false, //
isParkingMarker: true //
}));
//
const preservedMarkers = this.markers.filter(marker => marker.isDeviceMarker);
//
this.markers = [...newParkingMarkers, ...preservedMarkers];
this.$set(this, 'markers', [...this.markers]);
}
}).catch(error => {
console.error("Error fetching parking data:", error);
});
},
convertBoundaryToPolyline(boundary) {
if (!boundary) return null;
@ -4409,6 +4445,7 @@
url: '/page_user/gzsb'
})
} else if (num == 6) {
console.log('点击了');
uni.navigateTo({
url: '/pages/my'
})
@ -4433,8 +4470,8 @@
this.$u.get('/app/device/info?sn=' + this.sn).then((res) => {
if (res.code === 200) {
this.deviceInfos = res.data;
if(!this.orderinfo.sn){
this.mac=res.data.mac
if (!this.orderinfo.sn) {
this.mac = res.data.mac
}
if (num == 0) {
this.showdevice = true;
@ -4829,36 +4866,42 @@
}
.tab_top {
.navBarBox {
position: fixed;
top: 0rpx;
left: 0;
width: 750rpx;
height: 250rpx;
z-index: 1;
background: linear-gradient(to bottom, rgba(255, 255, 255, 0.8), transparent);
display: flex;
padding-top: 104rpx;
// align-items: center;
// justify-content: center;
z-index: 10;
image {
position: absolute;
top: 100rpx;
left: 30rpx;
width: 60rpx;
height: 60rpx;
}
.navBar {
width: 100vw;
// padding-top: 85rpx;
.txts {
width: 100%;
// position: absolute;
display: flex;
flex-direction: row;
justify-content: center;
align-items: center;
// align-items: center;
// justify-content: center;
image {
margin-left: 20rpx;
// position: absolute;
width: 60rpx;
height: 60rpx;
z-index: 11;
}
.txts {
margin-left: -80rpx;
width: 100%;
// position: absolute;
z-index: 10;
text-align: center;
font-weight: 500;
font-size: 36rpx;
color: #3D3D3D;
font-family: AlibabaPuHuiTi, AlibabaPuHuiTi;
}
text-align: center;
font-weight: 500;
font-size: 36rpx;
color: #3D3D3D;
font-family: AlibabaPuHuiTi, AlibabaPuHuiTi;
}
}

View File

@ -113,8 +113,8 @@
confirm(e){
// console.log(e);
uni.setStorageSync('adminAreaid', e[0].value);
this.areaId= e[0].value
this.getArea()
},
getArea() {

View File

@ -610,7 +610,7 @@
'isStart': true
});
}
}, 2000)
}, 5000)
}
@ -743,6 +743,10 @@
if (res.code === 200) {
this.deviceInfos = res.data
this.mac = res.data.mac
// this.deviceInfos.onlineStatus=0
if(this.deviceInfos.onlineStatus==0){
this.Binddevice()
}
this.latitude = parseFloat(this.deviceInfos.latitude)
this.longitude = parseFloat(this.deviceInfos.longitude)
this.getArea()