小鹿骑行

This commit is contained in:
吴鹏 2025-06-07 13:47:14 +08:00
parent b465d27040
commit 2350478404
7 changed files with 562 additions and 456 deletions

View File

@ -1,7 +1,7 @@
const install = (Vue, vm) => {
uni.setStorageSync('deptId', 100);
Vue.prototype.$u.http.setConfig({
// baseUrl: 'http://192.168.160.197:4101', //键辉本地
// baseUrl: 'http://192.168.2.89:4101', //键辉本地
// baseUrl: 'http://192.168.0.102:4101', //景森本地
baseUrl: 'https://ele.ccttiot.com/prod-api', //线上
// baseUrl: 'https://cc.ccttiot.com/prod-api', //叉车线上

View File

@ -484,6 +484,7 @@
huiyuanlist:[],
huiyuanobj:{},
zfflag:true,
jieliuflag:true
}
},
onLoad(option) {
@ -911,6 +912,8 @@
},
//
btnzhifu() {
if(this.jieliuflag == true){
this.jieliuflag = false
if(this.bikeobj.onlineStatus == 0){
if(this.ver_dataflag == 3){
this.getlyzf()
@ -1019,6 +1022,10 @@
this.getzf()
}
}
setTimeout(()=>{
this.jieliuflag = true
},5000)
}
},
//
getlyzf(){

View File

@ -478,7 +478,6 @@
const power = device.remainingPower
return power >= minPower && power <= maxPower
})
//
this.status0 = []
this.status1 = []
@ -488,7 +487,6 @@
this.status8 = []
this.status9 = []
this.status6 = []
//
this.listData.forEach(item => {
if (item.status == 0) {
@ -509,7 +507,6 @@
this.status9.push(item)
}
})
//
this.markers = []
this.markstause()
@ -533,7 +530,6 @@
}
}
},
getArea() {
let id = this.areaId
this.$u.get(`/bst/area/${id}`).then((res) => { //
@ -679,9 +675,7 @@
width: 30,
height: 34,
// joinCluster: true,
iconPath: item.onlineStatus == 0 ?
'https://lxnapi.ccttiot.com/bike/img/static/uG13E7BpUFF44wVYC9no' :
'https://lxnapi.ccttiot.com/bike/img/static/uHQIdWCTmtUztl49wBKU',
iconPath: item.onlineStatus == 0 ? 'https://lxnapi.ccttiot.com/bike/img/static/uG13E7BpUFF44wVYC9no' : 'https://lxnapi.ccttiot.com/bike/img/static/uHQIdWCTmtUztl49wBKU',
callout: {
content: '' + parseInt(item.remainingPower) + '%', //
color: '#2679D1', //
@ -702,9 +696,7 @@
width: 30,
height: 34,
// joinCluster: true,
iconPath: item.onlineStatus == 0 ?
'https://lxnapi.ccttiot.com/bike/img/static/uRod2zf3t9dAOYafWoWt' :
'https://lxnapi.ccttiot.com/bike/img/static/uZpXq3TBtM5gVgJJeImY',
iconPath: item.onlineStatus == 0 ? 'https://lxnapi.ccttiot.com/bike/img/static/uRod2zf3t9dAOYafWoWt' : 'https://lxnapi.ccttiot.com/bike/img/static/uZpXq3TBtM5gVgJJeImY',
callout: {
content: '' + parseInt(item.remainingPower) + '%', //
color: '#2679D1', //
@ -794,13 +786,11 @@
this.status8 = []
this.status9 = []
this.status6 = []
// 使
if (this.allDeviceData.length > 0) {
this.filterDevicesByPowerRange()
return
}
if (this.statusidx != 7 && this.statusidx != 20 && this.statusidx != 10) {
this.$u.get(`/bst/device/all?areaId=${this.areaId}&status=${this.statusidx}&powerRange=${this.rangeValue[0] + ',' + this.rangeValue[1]}&refresh=true`).then((res) => {
if (res.code == 200) {
@ -915,7 +905,7 @@
},
//
calculateDistance(lat1, lon1, lat2, lon2) {
const p = 0.017453292519943295; // Math.PI / 180
const p = 0.017453292519943295 // Math.PI / 180
const c = Math.cos;
const a = 0.5 - c((lat2 - lat1) * p) / 2 +
c(lat1 * p) * c(lat2 * p) *
@ -948,7 +938,7 @@
} else if (row.type == 3) {
type3Data.push(row)
}
console.log(row,'121212');
console.log(row,'121212')
newMarkers.push({
id: row.id,
latitude: row.latitude,
@ -967,7 +957,7 @@
},
isParking: true
})
console.log(newMarkers,'newMarkersnewMarkersnewMarkers');
console.log(newMarkers,'newMarkersnewMarkersnewMarkers')
})
this.$set(this, 'markers', [...this.markers, ...newMarkers])
const validBoundaries1 = type1Data.map(row => row.boundaryStr).filter(boundary =>
@ -985,7 +975,7 @@
}
}).catch(error => {
console.error("22222", error)
});
})
},
convertBoundaryToPolyline(boundary) {
if (!boundary) return null
@ -1032,33 +1022,27 @@
background: #FFFFFF80;
border-radius: 0 40rpx 40rpx 0;
box-shadow: 0rpx 4rpx 10rpx 0rpx rgba(0, 0, 0, 0.3);
.scrollable-content::-webkit-scrollbar {
display: none;
}
.scrollable-content {
height: 100%;
overflow-y: auto;
.divce_li:last-child {
border-bottom: 1rpx solid #fff;
}
.divce_li {
padding: 10rpx 0;
display: flex;
flex-wrap: nowrap;
align-items: center;
border-bottom: 1rpx solid #D8D8D8;
.left_img {
image {
width: 44rpx;
height: 70rpx;
}
}
.right_cont {
margin-left: 20rpx;
display: flex;
@ -1066,29 +1050,23 @@
font-weight: 400;
font-size: 24rpx;
color: #3D3D3D;
.right_top {
width: 100%;
display: flex;
flex-wrap: nowrap;
align-items: center;
.right_top_left {
margin-left: auto;
display: flex;
flex-wrap: nowrap;
align-items: center;
image {
margin-right: 6rpx;
width: 12rpx;
height: 26rpx;
}
}
.right_top_right {}
}
.right_bot {
width: 100%;
display: flex;
@ -1100,23 +1078,18 @@
}
}
}
.decice_cont {
display: flex;
flex-wrap: wrap;
align-items: center;
padding: 10rpx 28rpx;
.cont:nth-child(5n) {
margin-right: 0;
}
.cont {
margin-top: 8rpx;
margin-right: 9rpx;
// display: flex;
width: 130rpx;
.text {
width: 100%;
text-align: center;
@ -1125,7 +1098,6 @@
line-height: 38rpx;
color: #3D3D3D;
}
.act1 {
color: #4C97E7;
}

View File

@ -8,6 +8,10 @@
<cover-image class="img" src="https://lxnapi.ccttiot.com/bike/img/static/uRiYQZQEb3l2LsltEsyW"
mode=""></cover-image>
</cover-view>
<cover-view class="park" style="bottom: 240rpx;width: 70rpx;height: 70rpx;right: 40rpx;" @click="btnsjyc">
<cover-image class="img" src="https://api.ccttiot.com/smartmeter/img/static/uBluMsnJyV5Judyx7SYx"
mode=""></cover-image>
</cover-view>
<!-- <cover-view class="track" @click="toTrack">
<cover-image class="img" src="https://lxnapi.ccttiot.com/bike/img/static/ufaAAtlirJYs1QwJF25P"
mode=""></cover-image>
@ -434,7 +438,10 @@
deviceid: '',
devicename: '',
devicesarr: [],
findDeviceTimer: null
findDeviceTimer: null,
jieliuflag:true,
isMarkerVisible: true
}
},
onLoad(e) {
@ -458,6 +465,24 @@
}
},
methods: {
//
btnsjyc() {
this.isMarkerVisible = !this.isMarkerVisible;
this.markers = this.markers.map(item => {
if(item.id === 0.1) {
return {
...item,
alpha: this.isMarkerVisible ? 1 : 0, // 01
callout: {
...item.callout,
display: this.isMarkerVisible ? 'ALWAYS' : 'NONE'
}
}
}
return item;
});
this.$forceUpdate(); //
},
//
btndd(){
uni.navigateTo({
@ -565,6 +590,8 @@
},
//
lanya(num) {
if(this.jieliuflag == true){
this.jieliuflag = false
if(num == 0){
uni.showLoading({
title: '连接中...', //
@ -617,6 +644,10 @@
duration: 2000
})
}
setTimeout(()=>{
this.jieliuflag = true
},1000)
}
},
getlanya() {
xBlufi.notifyStartDiscoverBle({
@ -834,12 +865,18 @@
this.showbtntip = false
},
checkbtn(num) {
if(this.jieliuflag = true){
this.jieliuflag = false
if (this.deviceInfos.status == 3 || this.deviceInfos.status == 2 || this.deviceInfos.status == 4) {
this.showbtntip = true
this.btnnum = num
} else {
this.btn(num)
}
setTimeout(()=>{
this.jieliuflag = true
},3000)
}
},
putvehicle() {
let data = {
@ -888,6 +925,8 @@
this.showvehicle = false
},
btn(num) {
if(this.jieliuflag == true){
this.jieliuflag = false
this.showbtntip = false
let data = [this.sn]
if (num == 0) {
@ -904,7 +943,13 @@
icon: 'success',
duration: 2000
})
setTimeout(()=>{
this.jieliuflag = true
},2000)
} else if(res.code == 20001){
setTimeout(()=>{
this.jieliuflag = true
},2000)
let that = this
uni.showModal({
title: '提示',
@ -925,6 +970,9 @@
icon: 'none',
duration: 2000
})
setTimeout(()=>{
this.jieliuflag = true
},2000)
}
})
} else if (num == 1) {
@ -940,8 +988,14 @@
title: '操作成功',
icon: 'success',
duration: 2000
});
})
setTimeout(()=>{
this.jieliuflag = true
},2000)
}else if(res.code == 20001){
setTimeout(()=>{
this.jieliuflag = true
},2000)
let that = this
uni.showModal({
title: '提示',
@ -962,11 +1016,14 @@
icon: 'none',
duration: 2000
})
setTimeout(()=>{
this.jieliuflag = true
},2000)
}
})
} else if (num == 2) {
uni.showLoading({
title: 'zzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzz加载中...'
title: '加载中...'
})
this.$u.put('/bst/device/disable', data).then((res) => {
if (res.code == 200) {
@ -977,12 +1034,18 @@
});
// 线
this.deviceInfo()
setTimeout(()=>{
this.jieliuflag = true
},2000)
} else {
uni.showToast({
title: res.msg,
icon: 'none',
duration: 2000
})
setTimeout(()=>{
this.jieliuflag = true
},2000)
}
})
} else if (num == 3) {
@ -996,14 +1059,20 @@
title: '解禁成功',
icon: 'success',
duration: 2000
});
})
this.deviceInfo()
setTimeout(()=>{
this.jieliuflag = true
},2000)
} else {
uni.showToast({
title: res.msg,
icon: 'none',
duration: 2000
});
})
setTimeout(()=>{
this.jieliuflag = true
},2000)
}
})
} else if (num == 4) {
@ -1017,14 +1086,20 @@
title: '操作成功',
icon: 'success',
duration: 2000
});
})
setTimeout(()=>{
this.jieliuflag = true
},2000)
} else {
uni.hideLoading()
uni.showToast({
title: res.msg,
icon: 'none',
duration: 2000
});
})
setTimeout(()=>{
this.jieliuflag = true
},2000)
}
})
} else if (num == 5) {
@ -1039,12 +1114,18 @@
duration: 2000
});
this.deviceInfo()
setTimeout(()=>{
this.jieliuflag = true
},2000)
} else {
uni.showToast({
title: res.msg,
icon: 'none',
duration: 2000
})
setTimeout(()=>{
this.jieliuflag = true
},2000)
}
})
} else if (num == 6) {
@ -1059,12 +1140,18 @@
icon: 'success',
duration: 2000
})
setTimeout(()=>{
this.jieliuflag = true
},2000)
} else {
uni.showToast({
title: res.msg,
icon: 'none',
duration: 2000
})
setTimeout(()=>{
this.jieliuflag = true
},2000)
}
})
} else if (num == 7) {
@ -1081,12 +1168,18 @@
icon: 'success',
duration: 2000
})
setTimeout(()=>{
this.jieliuflag = true
},2000)
} else {
uni.showToast({
title: res.msg,
icon: 'none',
duration: 2000
duration: 3000
})
setTimeout(()=>{
this.jieliuflag = true
},2000)
}
})
} else if (num == 9) {
@ -1101,12 +1194,18 @@
icon: 'success',
duration: 2000
})
setTimeout(()=>{
this.jieliuflag = true
},2000)
} else {
uni.showToast({
title: res.msg,
icon: 'none',
duration: 2000
})
setTimeout(()=>{
this.jieliuflag = true
},2000)
}
})
} else if (num == 10) {
@ -1121,15 +1220,22 @@
icon: 'success',
duration: 2000
})
setTimeout(()=>{
this.jieliuflag = true
},2000)
} else {
uni.showToast({
title: res.msg,
icon: 'none',
duration: 2000
})
setTimeout(()=>{
this.jieliuflag = true
},2000)
}
})
}
}
},
btnyc() {
this.titleflag = false
@ -1160,6 +1266,23 @@
this.getModelList()
this.latitude = this.deviceInfos.latitude
this.longitude = this.deviceInfos.longitude
this.markers.push({
id: 0.1,
latitude: this.deviceInfos.mobileLat,
longitude: this.deviceInfos.mobileLon,
width: 40,
height: 47,
iconPath: 'https://api.ccttiot.com/smartmeter/img/static/uvMzjOvKi58e8VAAS8t6',
callout: {
content: '手机定位', //
color: '#ffffff', //
fontSize: 10, //
borderRadius: 10, //
bgColor: '#000000', //
padding: 2, //
display: 'ALWAYS', //
}
})
if (this.deviceInfos.status == 0) {
this.markers.push({
id: parseFloat(this.deviceInfos.sn),

View File

@ -132,13 +132,11 @@
<view class="yingshouprice" style="border: 0;">
折扣<span>{{orderxqobj.vipDiscountValue == null ? '--' : orderxqobj.vipDiscountValue + '折'}}</span>
</view>
<view class="yingshouprice" style="border: 0;">
<!-- <view class="yingshouprice" style="border: 0;">
骑行费优惠<span>{{orderxqobj.ridingDiscount == null ? '0.00' : orderxqobj.ridingDiscount}}</span>
</view> -->
</view>
</view>
</view>
<view class="xingchengxx" style="padding-bottom: 30rpx;box-sizing: border-box;">
<view class="name">
行程信息
@ -1016,27 +1014,6 @@
},
unpass() {
this.huancheflag = true
// let data = {
// id: this.orderxqobj.id,
// pass: pass
// }
// this.$u.put('/bst/order/verify', data).then((res) => {
// if (res.code === 200) {
// uni.showToast({
// title: '',
// icon: 'success',
// duration: 2000
// })
// this.deviceInfo()
// this.getorderxq()
// } else {
// uni.showToast({
// title: res.msg,
// icon: 'none',
// duration: 2000
// })
// }
// })
},
parsePictures(pictureString) {
console.log(pictureString, '45454545454');

View File

@ -861,11 +861,11 @@
}
}
</script>
<style lang="scss" >
page{
<style lang="scss">
page{
background-color: #F7FAFE;
}
.map {
}
.map {
position: relative;
width: 750rpx;
height: 752rpx;
@ -912,7 +912,7 @@ page{
-webkit-box-shadow: 0 0 20rpx #7C7C7C;
-moz-box-shadow: 0 0 20rpx #7C7C7C;
}
.kefutc{
.kefutc{
animation: fadeIn 0.5s ease-in-out forwards;
position: fixed;
top: 660rpx;
@ -983,7 +983,7 @@ page{
background-color: rgba(0,0,0,0.3);
z-index: 9;
}
.page{
.page{
width: 750rpx;
background: #F7F7F7;
border-radius: 0rpx 0rpx 0rpx 0rpx;

View File

@ -346,10 +346,19 @@
})
that.getorderdevice()
} else {
uni.showToast({
title: res.msg,
icon: 'none',
duration: 2000
uni.showModal({
title: '提示',
content: '设备离线,请前往车辆详情连接车辆操作',
showCancel: false,
success: function(res) {
if (res.confirm) {
uni.switchTab({
url:'/pages/myorder/returned/index'
})
} else if (res.cancel) {
}
}
})
}
})
@ -393,10 +402,19 @@
})
that.getorderdevice()
} else {
uni.showToast({
title: res.msg,
icon: 'none',
duration: 2000
uni.showModal({
title: '提示',
content: '设备离线,请前往车辆详情连接车辆操作',
showCancel: false,
success: function(res) {
if (res.confirm) {
uni.switchTab({
url:'/pages/myorder/returned/index'
})
} else if (res.cancel) {
}
}
})
}
})
@ -499,10 +517,19 @@
that.orderflag = false
},1000)
} else {
uni.showToast({
title: res.msg,
icon: 'none',
duration: 2000
uni.showModal({
title: '提示',
content: '设备离线,请前往车辆详情连接车辆操作',
showCancel: false,
success: function(res) {
if (res.confirm) {
uni.switchTab({
url:'/pages/myorder/returned/index'
})
} else if (res.cancel) {
}
}
})
}
})