电动车

This commit is contained in:
吴鹏 2025-07-15 17:36:34 +08:00
parent 9b9e24e65c
commit 10eff1ab30
15 changed files with 5726 additions and 2493 deletions

View File

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

View File

@ -157,7 +157,7 @@
let sceneValue = res.result let sceneValue = res.result
let decodedValue = decodeURIComponent(sceneValue) let decodedValue = decodeURIComponent(sceneValue)
this.sn = getQueryParam(decodedValue, 's') this.sn = getQueryParam(decodedValue, 's')
this.$u.get("/app/orderDevice/mineUsing").then(res =>{ this.$u.get("/app/order/mineProcessing").then(res =>{
if(res.code == 200){ if(res.code == 200){
if(res.data){ if(res.data){
uni.switchTab({ uni.switchTab({

View File

@ -36,7 +36,7 @@
methods: { methods: {
// //
btnkaisuo(){ btnkaisuo(){
this.$u.get("/app/orderDevice/mineUsing").then(res =>{ this.$u.get("/app/order/mineProcessing").then(res =>{
if(res.code == 200){ if(res.code == 200){
if(res.data){ if(res.data){
uni.switchTab({ uni.switchTab({

File diff suppressed because it is too large Load Diff

View File

@ -54,7 +54,7 @@
<view class="lypic" v-if="ver_dataflag == 1" @click="btnly"> <view class="lypic" v-if="ver_dataflag == 1" @click="btnly">
<image class="glow-image" <image class="glow-image"
src="https://api.ccttiot.com/smartmeter/img/static/uCdHjNaNfD9aikVg9Cuk" src="https://api.ccttiot.com/smartmeter/img/static/uCdHjNaNfD9aikVg9Cuk"
mode="aspectFit" :class="{ 'visible': isVisible, 'hidden': !isVisible }" /> mode="aspectFit" />
</view> </view>
</view> </view>
</view> </view>
@ -226,7 +226,7 @@
二维码 二维码
</view> </view>
<!-- 蓝牙控制 --> <!-- 蓝牙控制 -->
<view class="dangeanniu" @click="lanya(0)" v-if="ver_dataflag != 3"> <!-- <view class="dangeanniu" @click="lanya(0)" v-if="ver_dataflag != 3">
<view class="pic"> <view class="pic">
<image src="https://api.ccttiot.com/smartmeter/img/static/uqUiYiMtGTjkPNgmCjvP" mode=""></image> <image src="https://api.ccttiot.com/smartmeter/img/static/uqUiYiMtGTjkPNgmCjvP" mode=""></image>
</view> </view>
@ -261,7 +261,7 @@
<image src="https://api.ccttiot.com/smartmeter/img/static/uqUiYiMtGTjkPNgmCjvP" mode=""></image> <image src="https://api.ccttiot.com/smartmeter/img/static/uqUiYiMtGTjkPNgmCjvP" mode=""></image>
</view> </view>
蓝牙开坐垫锁 蓝牙开坐垫锁
</view> </view> -->
</view> </view>
<view class="zuche"> <view class="zuche">
<view class=""> <view class="">
@ -502,7 +502,9 @@
isVisible: true, isVisible: true,
glowInterval: null, glowInterval: null,
lat:'', lat:'',
lon:'' lon:'',
shibainum:0,
jiance:false
} }
}, },
onLoad(e) { onLoad(e) {
@ -511,6 +513,11 @@
this.deptId = uni.getStorageSync('deptId') this.deptId = uni.getStorageSync('deptId')
}, },
onShow() { onShow() {
xBlufi.initXBlufi(1)
xBlufi.notifyStartDiscoverBle({
'isStart': true
})
xBlufi.listenDeviceMsgEvent(true, this.funListenDeviceMsgEvent)
this.getyunying() this.getyunying()
uni.getLocation({ uni.getLocation({
type: 'gcj02', // type: 'gcj02', //
@ -738,9 +745,7 @@
duration: 2000 duration: 2000
}) })
} }
setTimeout(() => {
this.jieliuflag = true this.jieliuflag = true
}, 3000)
} }
}, },
getlanya() { getlanya() {
@ -797,6 +802,7 @@
if (options.result == true) { if (options.result == true) {
setTimeout(() => { setTimeout(() => {
this.ver_dataflag = 3 this.ver_dataflag = 3
this.jiance = false
}, 2000) }, 2000)
xBlufi.notifyInitBleEsp32({ xBlufi.notifyInitBleEsp32({
deviceId: this.deviceid deviceId: this.deviceid
@ -815,6 +821,7 @@
case xBlufi.XBLUFI_TYPE.TYPE_GET_DEVICE_LISTS_START: case xBlufi.XBLUFI_TYPE.TYPE_GET_DEVICE_LISTS_START:
if (!options.result) { if (!options.result) {
console.log('蓝牙未开启') console.log('蓝牙未开启')
this.jiance = true
return return
} else { } else {
this.lanyaflag = false this.lanyaflag = false
@ -1143,15 +1150,21 @@
this.showvehicle = false this.showvehicle = false
}, },
btn(num) { btn(num) {
if(this.jiance == true){
xBlufi.initXBlufi(1)
xBlufi.notifyStartDiscoverBle({
'isStart': true
})
xBlufi.listenDeviceMsgEvent(true, this.funListenDeviceMsgEvent)
}
if (this.jieliuflag == true) { if (this.jieliuflag == true) {
this.jieliuflag = false this.jieliuflag = false
this.showbtntip = false this.showbtntip = false
let data = [this.sn] let data = [this.sn]
if (num == 0) { if (num == 0) {
uni.showLoading({ uni.showLoading({
title: '加载中...' title: '车辆开锁中...'
}) })
console.log('点击了....1')
if (this.ver_dataflag == 3) { if (this.ver_dataflag == 3) {
xBlufi.notifySendCustomData({ xBlufi.notifySendCustomData({
customData: "11opensub5@" customData: "11opensub5@"
@ -1173,9 +1186,7 @@
result:'成功' result:'成功'
} }
this.$u.post(`/app/commandLog/bluetooth`,data).then(res => {}) this.$u.post(`/app/commandLog/bluetooth`,data).then(res => {})
setTimeout(() => {
this.jieliuflag = true this.jieliuflag = true
}, 2000)
} else { } else {
uni.hideLoading() uni.hideLoading()
uni.showToast({ uni.showToast({
@ -1183,13 +1194,41 @@
icon: 'none', icon: 'none',
duration: 2000 duration: 2000
}) })
setTimeout(() => {
this.jieliuflag = true this.jieliuflag = true
}, 2000)
} }
}) })
} else { } else {
this.$u.put(`/bst/device/iot/unlock?id=${this.sn}&requiredIot=true`).then((res) => { this.$u.put(`/bst/device/iot/unlock?id=${this.sn}&requiredIot=true`).then((res) => {
if (res.code == 200) {
if(res.data.db == 1 && res.data.iot == false){
uni.hideLoading()
uni.showLoading({
title: '蓝牙开锁中...',
mask: true
})
const findDevice = () =>{
this.ver_dataflag = 2
const matchedDevice = this.devicesarr.find(device => {
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
setTimeout(()=>{
if(this.ver_dataflag == 3){
uni.hideLoading()
xBlufi.notifySendCustomData({
customData: "11opensub5@"
})
this.$u.put(`/bst/device/iot/unlock?id=${this.sn}&requiredIot=false`).then((res) => {
if (res.code == 200) { if (res.code == 200) {
this.deviceInfo() this.deviceInfo()
uni.showToast({ uni.showToast({
@ -1197,21 +1236,18 @@
icon: 'success', icon: 'success',
duration: 3000 duration: 3000
}) })
setTimeout(() => { let data = {
this.jieliuflag = true mac:this.mac,
}, 2000) reason:'商户开锁',
}else if(res.code == 20001){ command:'11opensub5@',
uni.hideLoading() longitude:this.lon,
uni.showModal({ latitude:this.lat,
title: '提示', result:'成功'
content: '设备离线,请进行连接蓝牙开锁', }
showCancel: false, this.$u.post(`/app/commandLog/bluetooth`,data).then(res => {})
success: function(res) {
if (res.confirm) { this.jieliuflag = true
}
}
})
} else { } else {
uni.hideLoading() uni.hideLoading()
uni.showToast({ uni.showToast({
@ -1219,17 +1255,154 @@
icon: 'none', icon: 'none',
duration: 2000 duration: 2000
}) })
setTimeout(() => {
this.jieliuflag = true this.jieliuflag = true
}, 2000)
}
})
}else{
this.ver_dataflag = 1
this.shibainum = 0
this.jieliuflag = true
uni.hideLoading()
uni.showModal({
title: '提示',
content: '车辆开锁失败,请检查手机蓝牙是否打开或微信蓝牙是否授权,开启手机定位',
showCancel: false,
success: function(res) {
if (res.confirm) {
} else if (res.cancel) {
}
}
})
}
},4000)
} else {
if(this.shibainum < 3){
this.shibainum++
this.findDeviceTimer = setTimeout(findDevice.bind(this), 1000) // 使 bind this
}else{
this.jieliuflag = true
this.ver_dataflag = 1
this.shibainum = 0
uni.hideLoading()
uni.showModal({
title: '提示',
content: '车辆开启失败,可让用户在车辆旁边点击解锁骑行',
showCancel: false,
success: function(res) {
if (res.confirm) {
} else if (res.cancel) {
}
}
})
}
}
}
findDevice()
}else{
this.deviceInfo()
uni.showToast({
title: '操作成功',
icon: 'success',
duration: 3000
})
}
this.jieliuflag = true
} else {
uni.hideLoading()
uni.showToast({
title: res.msg,
icon: 'none',
duration: 2000
})
this.jieliuflag = true
} }
}) })
} }
} else if (num == 1) { } else if (num == 1) {
uni.showLoading({ uni.showLoading({
title: '加载中...' title: '锁车中...'
}) })
if (this.ver_dataflag == 3) { if (this.ver_dataflag == 3) {
xBlufi.notifySendCustomData({
customData: "11closesub200@"
})
setTimeout(()=>{
xBlufi.notifySendCustomData({
customData: "11reboot@"
})
},2000)
this.$u.put(`/bst/device/iot/lock?id=${this.sn}&requiredIot=false`).then((res) => {
if (res.code == 200) {
this.deviceInfo()
uni.showToast({
title: '操作成功',
icon: 'success',
duration: 3000
})
let data = {
mac:this.mac,
reason:'商户关锁',
command:'11closesub200@',
result:'成功'
}
this.$u.post(`/app/commandLog/bluetooth`,data).then(res => {})
this.jieliuflag = true
}else{
uni.hideLoading()
uni.showToast({
title: res.msg,
icon: 'none',
duration: 2000
})
this.jieliuflag = true
}
})
} else {
this.$u.put(`/bst/device/iot/lock?id=${this.sn}&requiredIot=true`).then((res) => {
if (res.code == 200) {
this.deviceInfo()
uni.showToast({
title: '操作成功',
icon: 'success',
duration: 3000
})
this.jieliuflag = true
}else if(res.code == 20001){
uni.showLoading({
title: '蓝牙关锁中...',
mask: true
})
const findDevice = () =>{
this.ver_dataflag = 2
const matchedDevice = this.devicesarr.find(device => {
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
setTimeout(()=>{
if(this.ver_dataflag == 3){
uni.hideLoading()
xBlufi.notifySendCustomData({ xBlufi.notifySendCustomData({
customData: "11closesub200@" customData: "11closesub200@"
}) })
@ -1244,28 +1417,71 @@
let data = { let data = {
mac:this.mac, mac:this.mac,
reason:'商户关锁', reason:'商户关锁',
command:'11', command:'11closesub200@',
longitude:this.lon,
latitude:this.lat,
result:'成功' result:'成功'
} }
this.$u.post(`/app/commandLog/bluetooth`,data).then(res => {}) this.$u.post(`/app/commandLog/bluetooth`,data).then(res => {})
setTimeout(() => {
// closesub200@',
// longitude:this.lon,
// latitude:this.lat,
this.jieliuflag = true this.jieliuflag = true
}, 2000)
}else if(res.code == 20001){ } else {
uni.hideLoading()
uni.showToast({
title: res.msg,
icon: 'none',
duration: 2000
})
this.jieliuflag = true
}
})
}else{
this.jieliuflag = true
this.ver_dataflag = 1
this.shibainum = 0
uni.hideLoading() uni.hideLoading()
uni.showModal({ uni.showModal({
title: '提示', title: '提示',
content: '设备离线,请进行连接蓝牙关锁', content: '车辆开锁失败,请检查手机蓝牙是否打开或微信蓝牙是否授权,开启手机定位',
showCancel: false, showCancel: false,
success: function(res) { success: function(res) {
if (res.confirm) { if (res.confirm) {
} else if (res.cancel) {
} }
} }
}) })
}
},4000)
} else {
if(this.shibainum < 3){
this.shibainum++
this.findDeviceTimer = setTimeout(findDevice.bind(this), 1000) // 使 bind this
}else{
this.jieliuflag = true
this.ver_dataflag = 1
this.shibainum = 0
uni.hideLoading()
uni.showModal({
title: '提示',
content: '车辆解锁失败,请检查手机蓝牙是否打开或微信蓝牙是否授权,开启手机定位',
showCancel: false,
success: function(res) {
if (res.confirm) {
} else if (res.cancel) {
}
}
})
}
}
}
findDevice()
} else{ } else{
uni.hideLoading() uni.hideLoading()
uni.showToast({ uni.showToast({
@ -1273,33 +1489,9 @@
icon: 'none', icon: 'none',
duration: 2000 duration: 2000
}) })
setTimeout(() => {
this.jieliuflag = true this.jieliuflag = true
}, 2000)
}
})
} else {
this.$u.put(`/bst/device/iot/lock?id=${this.sn}&requiredIot=true`).then((res) => {
if (res.code == 200) {
this.deviceInfo()
uni.showToast({
title: '操作成功',
icon: 'success',
duration: 3000
})
setTimeout(() => {
this.jieliuflag = true
}, 2000)
} else{
uni.hideLoading()
uni.showToast({
title: res.msg,
icon: 'none',
duration: 2000
})
setTimeout(() => {
this.jieliuflag = true
}, 2000)
} }
}) })
} }
@ -1316,18 +1508,16 @@
}); });
// 线 // 线
this.deviceInfo() this.deviceInfo()
setTimeout(() => {
this.jieliuflag = true this.jieliuflag = true
}, 2000)
} else { } else {
uni.showToast({ uni.showToast({
title: res.msg, title: res.msg,
icon: 'none', icon: 'none',
duration: 2000 duration: 2000
}) })
setTimeout(() => {
this.jieliuflag = true this.jieliuflag = true
}, 2000)
} }
}) })
} else if (num == 3) { } else if (num == 3) {
@ -1343,9 +1533,7 @@
duration: 2000 duration: 2000
}) })
this.deviceInfo() this.deviceInfo()
setTimeout(() => {
this.jieliuflag = true this.jieliuflag = true
}, 2000)
} else { } else {
uni.showToast({ uni.showToast({
@ -1353,14 +1541,12 @@
icon: 'none', icon: 'none',
duration: 2000 duration: 2000
}) })
setTimeout(() => {
this.jieliuflag = true this.jieliuflag = true
}, 2000)
} }
}) })
} else if (num == 4) { } else if (num == 4) {
uni.showLoading({ uni.showLoading({
title: '加载中...' title: '响铃中...'
}) })
this.$u.put('/bst/device/iot/ring?id=' + this.sn).then((res) => { this.$u.put('/bst/device/iot/ring?id=' + this.sn).then((res) => {
if (res.code == 200) { if (res.code == 200) {
@ -1370,11 +1556,79 @@
icon: 'success', icon: 'success',
duration: 2000 duration: 2000
}) })
setTimeout(() => {
this.jieliuflag = true this.jieliuflag = true
}, 2000) } else if (res.code == 20001) {
} else if (res.code == 200001) { uni.showLoading({
title: '响铃中...',
mask: true
})
const findDevice = () =>{
this.ver_dataflag = 2
const matchedDevice = this.devicesarr.find(device => {
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
setTimeout(()=>{
if(this.ver_dataflag == 3){
xBlufi.notifySendCustomData({
customData: "11play1@"
})
this.jieliuflag = true
uni.hideLoading()
}else{
this.jieliuflag = true
this.ver_dataflag = 1
this.shibainum = 0
uni.hideLoading()
uni.showModal({
title: '提示',
content: '响铃失败,请检查手机蓝牙是否打开或微信蓝牙是否授权,开启手机定位',
showCancel: false,
success: function(res) {
if (res.confirm) {
} else if (res.cancel) {
}
}
})
}
},4000)
} else {
if(this.shibainum < 3){
this.shibainum++
this.findDeviceTimer = setTimeout(findDevice.bind(this), 1000) // 使 bind this
}else{
this.jieliuflag = true
this.ver_dataflag = 1
this.shibainum = 0
uni.hideLoading()
uni.showModal({
title: '提示',
content: '响铃失败,请检查手机蓝牙是否打开或微信蓝牙是否授权,开启手机定位',
showCancel: false,
success: function(res) {
if (res.confirm) {
} else if (res.cancel) {
}
}
})
}
}
}
findDevice()
} else { } else {
uni.hideLoading() uni.hideLoading()
uni.showToast({ uni.showToast({
@ -1382,9 +1636,7 @@
icon: 'none', icon: 'none',
duration: 2000 duration: 2000
}) })
setTimeout(() => {
this.jieliuflag = true this.jieliuflag = true
}, 2000)
} }
}) })
} else if (num == 5) { } else if (num == 5) {
@ -1399,18 +1651,14 @@
duration: 2000 duration: 2000
}); });
this.deviceInfo() this.deviceInfo()
setTimeout(() => {
this.jieliuflag = true this.jieliuflag = true
}, 2000)
} else { } else {
uni.showToast({ uni.showToast({
title: res.msg, title: res.msg,
icon: 'none', icon: 'none',
duration: 2000 duration: 2000
}) })
setTimeout(() => {
this.jieliuflag = true this.jieliuflag = true
}, 2000)
} }
}) })
} else if (num == 6) { } else if (num == 6) {
@ -1425,25 +1673,21 @@
icon: 'success', icon: 'success',
duration: 2000 duration: 2000
}) })
setTimeout(() => {
this.jieliuflag = true this.jieliuflag = true
}, 2000)
} else { } else {
uni.showToast({ uni.showToast({
title: res.msg, title: res.msg,
icon: 'none', icon: 'none',
duration: 2000 duration: 2000
}) })
setTimeout(() => {
this.jieliuflag = true this.jieliuflag = true
}, 2000)
} }
}) })
} else if (num == 7) { } else if (num == 7) {
this.showvehicle = true this.showvehicle = true
} else if (num == 8) { } else if (num == 8) {
uni.showLoading({ uni.showLoading({
title: '加载中...' title: '重启中...'
}) })
this.$u.put('/bst/device/iot/reboot?id=' + this.sn).then((res) => { this.$u.put('/bst/device/iot/reboot?id=' + this.sn).then((res) => {
if (res.code == 200) { if (res.code == 200) {
@ -1453,18 +1697,88 @@
icon: 'success', icon: 'success',
duration: 2000 duration: 2000
}) })
setTimeout(() => {
this.jieliuflag = true this.jieliuflag = true
}, 2000) }else if(res.code == 20001){
this.jieliuflag = true
uni.showLoading({
title: '重启中...',
mask: true
})
const findDevice = () =>{
this.ver_dataflag = 2
const matchedDevice = this.devicesarr.find(device => {
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
setTimeout(()=>{
if(this.ver_dataflag == 3){
xBlufi.notifySendCustomData({
customData: "11reboot@"
})
this.jieliuflag = true
uni.hideLoading()
}else{
this.jieliuflag = true
this.ver_dataflag = 1
this.shibainum = 0
uni.hideLoading()
uni.showModal({
title: '提示',
content: '重启失败,请检查手机蓝牙是否打开或微信蓝牙是否授权,开启手机定位',
showCancel: false,
success: function(res) {
if (res.confirm) {
} else if (res.cancel) {
}
}
})
}
},4000)
} else {
if(this.shibainum < 3){
this.shibainum++
this.findDeviceTimer = setTimeout(findDevice.bind(this), 1000) // 使 bind this
}else{
this.jieliuflag = true
this.ver_dataflag = 1
this.shibainum = 0
uni.hideLoading()
uni.showModal({
title: '提示',
content: '重启失败,请检查手机蓝牙是否打开或微信蓝牙是否授权,开启手机定位',
showCancel: false,
success: function(res) {
if (res.confirm) {
} else if (res.cancel) {
}
}
})
}
}
}
findDevice()
} else { } else {
uni.showToast({ uni.showToast({
title: res.msg, title: res.msg,
icon: 'none', icon: 'none',
duration: 3000 duration: 3000
}) })
setTimeout(() => {
this.jieliuflag = true this.jieliuflag = true
}, 2000)
} }
}) })
} else if (num == 9) { } else if (num == 9) {
@ -1479,18 +1793,14 @@
icon: 'success', icon: 'success',
duration: 2000 duration: 2000
}) })
setTimeout(() => {
this.jieliuflag = true this.jieliuflag = true
}, 2000)
} else { } else {
uni.showToast({ uni.showToast({
title: res.msg, title: res.msg,
icon: 'none', icon: 'none',
duration: 2000 duration: 2000
}) })
setTimeout(() => {
this.jieliuflag = true this.jieliuflag = true
}, 2000)
} }
}) })
} else if (num == 10) { } else if (num == 10) {
@ -1505,21 +1815,30 @@
icon: 'success', icon: 'success',
duration: 2000 duration: 2000
}) })
setTimeout(() => {
this.jieliuflag = true this.jieliuflag = true
}, 2000)
} else { } else {
uni.showToast({ uni.showToast({
title: res.msg, title: res.msg,
icon: 'none', icon: 'none',
duration: 2000 duration: 2000
}) })
setTimeout(() => {
this.jieliuflag = true this.jieliuflag = true
}, 2000)
} }
}) })
} }
}else{
this.jieliuflag = true
uni.hideLoading()
uni.showModal({
title: '提示',
content: '请不要频繁点击',
showCancel: false,
success: function(res) {
if (res.confirm) {
}
}
})
} }
}, },
btnyc() { btnyc() {
@ -1544,7 +1863,7 @@
this.deviceInfos = res.data this.deviceInfos = res.data
this.mac = res.data.mac this.mac = res.data.mac
if (this.ver_dataflag != 3) { if (this.ver_dataflag != 3) {
this.getlanya() // this.getlanya()
} }
if (this.getnum == 0) { if (this.getnum == 0) {
this.getArea() this.getArea()
@ -1943,7 +2262,6 @@
.page { .page {
padding-bottom: 400rpx; padding-bottom: 400rpx;
width: 750rpx; width: 750rpx;
.new_infocard { .new_infocard {
width: 750rpx; width: 750rpx;
max-height: 100vh; max-height: 100vh;

View File

@ -74,7 +74,9 @@
this.getQiniuToken() this.getQiniuToken()
}, },
onLoad(e) { onLoad(e) {
if(e.sn){
this.sn = e.sn
}
}, },
computed: { computed: {
appointmentServiceFee() { appointmentServiceFee() {

View File

@ -146,6 +146,10 @@
}) })
}, },
gethc(){ gethc(){
uni.showLoading({
title: '还车中...',
mask: true
})
if(this.flag == true){ if(this.flag == true){
let data = { let data = {
orderId:this.orderId, orderId:this.orderId,
@ -198,12 +202,6 @@
this.$u.put(`/app/order/end`,data).then(res =>{ this.$u.put(`/app/order/end`,data).then(res =>{
if (res.code == 200) { if (res.code == 200) {
this.fjflag = false this.fjflag = false
uni.hideLoading()
setTimeout(()=>{
uni.redirectTo({
url:'/page_user/yongche/orderxq?id=' + this.orderId
})
},1000)
let data = { let data = {
mac:this.mac, mac:this.mac,
reason:'还车', reason:'还车',
@ -215,9 +213,18 @@
this.$u.post(`/app/commandLog/bluetooth`,data).then(res => { this.$u.post(`/app/commandLog/bluetooth`,data).then(res => {
console.log(res,'蓝牙') console.log(res,'蓝牙')
}) })
setTimeout(()=>{
xBlufi.notifySendCustomData({ xBlufi.notifySendCustomData({
customData: "11reboot@" customData: "11reboot@"
}) })
setTimeout(()=>{
uni.hideLoading()
uni.redirectTo({
url:'/page_user/yongche/orderxq?id=' + this.orderId
})
},1000)
},2000)
}else if(res.msg == null) { }else if(res.msg == null) {
uni.hideLoading() uni.hideLoading()
uni.showToast({ uni.showToast({

View File

@ -1,7 +1,7 @@
<template> <template>
<view class="page"> <view class="page">
<u-navbar title="添加设备" :border-bottom="false" :background="bgc" title-color='#262B37' title-size='38' <u-navbar title="添加设备" :border-bottom="false" :background="bgc" title-color='#262B37' title-size='38'
height='50'></u-navbar> height='50' :custom-back="btnfh"></u-navbar>
<view class="iptbox" @click="backpage()"> <view class="iptbox" @click="backpage()">
<input type="text" class="ips" v-model="mac" placeholder=" " style="margin-left: 32rpx;" disabled <input type="text" class="ips" v-model="mac" placeholder=" " style="margin-left: 32rpx;" disabled
@ -39,9 +39,9 @@
确认添加 确认添加
</view> </view>
<view class="bot_btn"> <view class="bot_btn">
<!-- <view class="btn1" @click="btngx()"> <view class="btn1" @click="btnfh">
设备更新 返回
</view> --> </view>
<view class="btn1" @click="findDevice()"> <view class="btn1" @click="findDevice()">
蓝牙链接 蓝牙链接
</view> </view>
@ -181,6 +181,11 @@
}, },
methods: { methods: {
btnfh(){
uni.reLaunch({
url:'/page_user/luru/index'
})
},
btngx(){ btngx(){
// this.$u.post('/app/device/ring?sn=' + this.sn).then((res) => { // this.$u.post('/app/device/ring?sn=' + this.sn).then((res) => {
// if (res.code == 200) { // if (res.code == 200) {

View File

@ -3,10 +3,13 @@
<u-navbar :title="tit" :border-bottom="false" :background="bgc" back-icon-color="#262B37" title-color='#262B37' <u-navbar :title="tit" :border-bottom="false" :background="bgc" back-icon-color="#262B37" title-color='#262B37'
title-size='36' height='36' id="navbar"> title-size='36' height='36' id="navbar">
</u-navbar> </u-navbar>
<view style="padding: 20rpx;box-sizing: border-box;" v-html="obj"> <!-- <view style="padding: 20rpx;box-sizing: border-box;" v-html="obj">
</view> -->
<view class="" v-if="obj == ''">
</view> </view>
<u-parse v-else :html="obj" style="width: 100%;height: 100%;padding: 10rpx;box-sizing: border-box;"></u-parse>
</view> </view>
</template> </template>
@ -19,7 +22,7 @@
backgroundColor: "#fff", backgroundColor: "#fff",
}, },
type:'', type:'',
obj:{}, obj:'',
tit:'' tit:''
} }
}, },
@ -27,6 +30,8 @@
this.type = option.type this.type = option.type
if(option.type == 0){ if(option.type == 0){
this.tit = '租车指南' this.tit = '租车指南'
}else if(option.type == 2){
this.tit = '查看教程'
} else{ } else{
this.tit = '用车指南' this.tit = '用车指南'
} }

View File

@ -336,8 +336,9 @@
channelobj:{} channelobj:{}
} }
}, },
onLoad(e) { onLoad(option) {
this.id = e.id this.id = option.id
console.log(option,this.id,'020202020');
this.getyouhui() this.getyouhui()
this.updateTrackData() this.updateTrackData()
this.orderInfo() this.orderInfo()
@ -579,7 +580,7 @@
const refunded = parseFloat(payRefunded) || 0; const refunded = parseFloat(payRefunded) || 0;
const refunding = parseFloat(payRefunding) || 0; const refunding = parseFloat(payRefunding) || 0;
const actualAmount = amount - (refunded + refunding); const actualAmount = amount - (refunded + refunding);
return `${actualAmount.toFixed(2)}`; return `${actualAmount}`;
}, },
// //
btnkefu(){ btnkefu(){

View File

@ -4,6 +4,13 @@
}, },
"lazyCodeLoading": "requiredComponents", "lazyCodeLoading": "requiredComponents",
"pages": [{ "pages": [{
"path": "pages/nearbystores/index",
"style": {
"navigationBarTitleText": "",
"enablePullDownRefresh": false,
"navigationStyle": "custom"
}
},{
"path": "pages/index/index", "path": "pages/index/index",
"style": { "style": {
"navigationBarTitleText": "首页", "navigationBarTitleText": "首页",
@ -12,13 +19,6 @@
"navigationBarTextStyle": "#FFFFFF", "navigationBarTextStyle": "#FFFFFF",
"navigationStyle": "custom" "navigationStyle": "custom"
} }
},{
"path": "pages/nearbystores/index",
"style": {
"navigationBarTitleText": "",
"enablePullDownRefresh": false,
"navigationStyle": "custom"
}
},{ },{
"path": "pages/login/login", "path": "pages/login/login",
"style": { "style": {

File diff suppressed because it is too large Load Diff

View File

@ -1,7 +1,7 @@
<template> <template>
<view class="page"> <view class="page">
<u-navbar :is-back="false" title="我的" :border-bottom="false" back-icon-color="000" :background="bgc" title-color='#000' title-size='36' <u-navbar title="我的" :border-bottom="false" back-icon-color="000" :background="bgc" title-color='#000' title-size='36'
height='44' id="navbar"> height='44' id="navbar" :custom-back="btnfh">
</u-navbar> </u-navbar>
<view class="dahezi"> <view class="dahezi">
<view class="caozuo"> <view class="caozuo">
@ -122,7 +122,7 @@
</scroll-view> </scroll-view>
</view> </view>
</view> </view>
<tab-bar :indexs='4'></tab-bar> <!-- <tab-bar :indexs='4'></tab-bar> -->
</view> </view>
</template> </template>
@ -157,6 +157,12 @@
// this.getlunbo() // this.getlunbo()
}, },
methods: { methods: {
//
btnfh(){
uni.reLaunch({
url:'/pages/nearbystores/index'
})
},
// //
btnshangjia(){ btnshangjia(){
uni.navigateTo({ uni.navigateTo({

View File

@ -18,17 +18,18 @@
车牌号{{deivceobj.deviceVehicleNum == null ? '--' : deivceobj.deviceVehicleNum}} 车牌号{{deivceobj.deviceVehicleNum == null ? '--' : deivceobj.deviceVehicleNum}}
<text>SN{{deivceobj.deviceSn == null ? '--' : deivceobj.deviceSn}}</text> <text>SN{{deivceobj.deviceSn == null ? '--' : deivceobj.deviceSn}}</text>
</view> </view>
<view class="lanya" @click="btndk" v-if="ver_dataflag == 3" style="display: flex;align-items: center;color: #1890ff;"> <!-- @click="btndk" @click="findDevice"-->
<view class="lanya" v-if="ver_dataflag == 3" style="display: flex;align-items: center;color: #1890ff;">
<image src="https://api.ccttiot.com/smartmeter/img/static/uFfCiqhjHpbTBXcZvKl6" class="ljimg" <image src="https://api.ccttiot.com/smartmeter/img/static/uFfCiqhjHpbTBXcZvKl6" class="ljimg"
mode=""></image> 点击断开 mode=""></image> 已连接
</view> </view>
<view class="lanya" v-if="ver_dataflag == 2" style="display: flex;align-items: center;color: rgb(245, 108, 108);"> <view class="lanya" v-if="ver_dataflag == 2" style="display: flex;align-items: center;color: rgb(245, 108, 108);">
<image src="https://api.ccttiot.com/smartmeter/img/static/uO1TOFA1vdxQlz3NJenN" class="ljimg" <image src="https://api.ccttiot.com/smartmeter/img/static/uO1TOFA1vdxQlz3NJenN" class="ljimg"
mode=""></image> 连接中... mode=""></image> 连接中...
</view> </view>
<view class="lanya" @click="findDevice" v-if="ver_dataflag == 1" style="display: flex;align-items: center;color: rgb(245, 108, 108);"> <view class="lanya" v-if="ver_dataflag == 1" style="display: flex;align-items: center;color: rgb(245, 108, 108);">
<image src="https://api.ccttiot.com/smartmeter/img/static/uO1TOFA1vdxQlz3NJenN" class="ljimg" <image src="https://api.ccttiot.com/smartmeter/img/static/uO1TOFA1vdxQlz3NJenN" class="ljimg"
mode=""></image> 点击连接 mode=""></image> 连接
</view> </view>
</view> </view>
<view class="dianliang"> <view class="dianliang">
@ -60,9 +61,13 @@
<image src="https://api.ccttiot.com/smartmeter/img/static/uWwAFNbsKSwnHl6ZjBLx" mode=""></image> <image src="https://api.ccttiot.com/smartmeter/img/static/uWwAFNbsKSwnHl6ZjBLx" mode=""></image>
鸣笛寻车 鸣笛寻车
</view> </view>
<view class="" @click="btnqd"> <view class="" @click="btnqd(0)">
<image src="https://api.ccttiot.com/smartmeter/img/static/uqTfyigsAuNX67k5QY4m" mode=""></image> <image src="https://api.ccttiot.com/smartmeter/img/static/uqTfyigsAuNX67k5QY4m" mode=""></image>
{{deivceobj.deviceLockStatus == 0 ? '点击开锁' : '临时锁车'}} 点击开锁
</view>
<view class="" @click="btnqd(1)">
<image style=" filter: sepia(50%)" src="https://api.ccttiot.com/smartmeter/img/static/uqTfyigsAuNX67k5QY4m" mode=""></image>
临时锁车
</view> </view>
<view class="" v-if="deivceobj.deviceModelEnableSeat == true" @click="btnkzds"> <view class="" v-if="deivceobj.deviceModelEnableSeat == true" @click="btnkzds">
<image src="https://api.ccttiot.com/smartmeter/img/static/uKcx6eIfOavWEygp5o9n" mode=""></image> <image src="https://api.ccttiot.com/smartmeter/img/static/uKcx6eIfOavWEygp5o9n" mode=""></image>
@ -238,7 +243,8 @@
isRefreshing: false, isRefreshing: false,
orderid:'', orderid:'',
qixingobj:{}, qixingobj:{},
shibainum:0 shibainum:0,
jiance:false
}; };
}, },
computed: { computed: {
@ -381,7 +387,6 @@
title: '加载中...', title: '加载中...',
mask: true mask: true
}) })
// console.log(that.lslat,that.lslon,'');
if (that.ver_dataflag == 3) { if (that.ver_dataflag == 3) {
xBlufi.notifySendCustomData({ xBlufi.notifySendCustomData({
customData: "11hpen@" customData: "11hpen@"
@ -437,9 +442,41 @@
} else if(res.code == 20001){ } else if(res.code == 20001){
uni.hideLoading() uni.hideLoading()
if(that.ver_dataflag != 3){ if(that.ver_dataflag != 3){
uni.showLoading({
title: '坐垫锁开启中...',
mask: true
})
this.ver_dataflag = 2
const matchedDevice = this.devicesarr.find(device => {
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
setTimeout(()=>{
uni.hideLoading()
xBlufi.notifySendCustomData({
customData: "11hpen@"
})
},4000)
} else {
if(this.shibainum < 3){
this.shibainum++
this.findDeviceTimer = setTimeout(this.findDevice.bind(this), 1000) // 使 bind this
}else{
this.ver_dataflag = 1
this.shibainum = 0
uni.showModal({ uni.showModal({
title: '提示', title: '提示',
content: '设备离线,请点击右上角连接车辆', content: '开启坐垫锁失败,请重试',
showCancel: false, showCancel: false,
success: function(res) { success: function(res) {
if (res.confirm) { if (res.confirm) {
@ -450,6 +487,8 @@
} }
}) })
} }
}
}
} else { } else {
uni.hideLoading() uni.hideLoading()
uni.showToast({ uni.showToast({
@ -514,15 +553,6 @@
if (res.code == 200) { if (res.code == 200) {
if (res.data) { if (res.data) {
this.mac = res.data.deviceMac this.mac = res.data.deviceMac
// if(this.ver_dataflag != 3){
// setTimeout(()=>{
// console.log('11ly',this.ljflag)
// if(this.ljflag == true){
// this.ljflag = false
// this.findDevice()
// }
// },1000)
// }
this.cheflag = false this.cheflag = false
this.orderAreaReturnVerify = res.data.orderAreaReturnVerify this.orderAreaReturnVerify = res.data.orderAreaReturnVerify
this.deivceobj = res.data this.deivceobj = res.data
@ -592,6 +622,7 @@
this.ver_dataflag = 1 this.ver_dataflag = 1
console.log(this.ver_dataflag,'断开断开'); console.log(this.ver_dataflag,'断开断开');
clearTimeout(this.uploadTimer) // clearTimeout(this.uploadTimer) //
this.jiance = true
// this.findDevice() // this.findDevice()
} }
break; break;
@ -624,6 +655,7 @@
case xBlufi.XBLUFI_TYPE.TYPE_GET_DEVICE_LISTS_START: case xBlufi.XBLUFI_TYPE.TYPE_GET_DEVICE_LISTS_START:
if (!options.result) { if (!options.result) {
console.log('蓝牙未开启') console.log('蓝牙未开启')
this.jiance = true
return return
} else { } else {
this.lanyaflag = false this.lanyaflag = false
@ -793,8 +825,30 @@
}, },
// and // and
btnqd() { btnqd(deviceLockStatus) {
if (this.deivceobj.deviceLockStatus == 0) { if(this.jiance == true){
xBlufi.initXBlufi(1)
xBlufi.notifyStartDiscoverBle({
'isStart': true
})
xBlufi.listenDeviceMsgEvent(true, this.funListenDeviceMsgEvent)
}
this.$u.get("/app/orderDevice/mineUsing").then((res) => {
if (res.code == 200) {
if(res.data){
if(res.data.deviceStatus == 9){
uni.showModal({
title: '提示',
content: '车辆已被强制锁车,请联系客服',
showCancel: false,
success: function(res) {
if (res.confirm) {
}
}
})
}else{
if (deviceLockStatus == 0) {
uni.getLocation({ uni.getLocation({
type: 'gcj02', // type: 'gcj02', //
isHighAccuracy: true, isHighAccuracy: true,
@ -810,7 +864,6 @@
this.lslat = null this.lslat = null
} }
}) })
if(this.ver_dataflag != 3){
let that = this let that = this
uni.showModal({ uni.showModal({
title: '提示', title: '提示',
@ -819,7 +872,7 @@
success: function(res) { success: function(res) {
if (res.confirm) { if (res.confirm) {
uni.showLoading({ uni.showLoading({
title: '加载中...', title: '车辆解锁中...',
mask: true mask: true
}) })
let query = { let query = {
@ -828,56 +881,47 @@
lon: that.lslon, lon: that.lslon,
requiredIot: true requiredIot: true
} }
let url = '/app/order/openDevice?' + that.$tansParams(query) let url = '/app/order/openDevice?' + that.$tansParams(query)
that.$u.put(url).then((res) => { that.$u.put(url).then((res) => {
if (res.code == 200) { if (res.code == 200) {
uni.hideLoading()
uni.showToast({ uni.showToast({
title: '解锁成功', title: '解锁成功',
icon: 'success', icon: 'success',
duration: 2000 duration: 2000
}) })
that.deivceobj.deviceLockStatus = 1 that.deivceobj.deviceLockStatus = 1
that.getorderdevice() // that.getorderdevice()
} else if(res.code == 20001){ } else if(res.code == 20001){
uni.hideLoading() console.log(111);
uni.showModal({ uni.showLoading({
title: '提示', title: '蓝牙解锁中...',
content: '设备离线,请点击右上角连接车辆', mask: true
showCancel: false, })
success: function(res) { const findDevice = () =>{
if (res.confirm) {
} that.ver_dataflag = 2
} const matchedDevice = that.devicesarr.find(device => {
return device.name.slice(-12) == that.mac.slice(-12)
}) })
} else { if (matchedDevice) {
xBlufi.notifyStartDiscoverBle({
'isStart': false
})
xBlufi.notifyConnectBle({
isStart: true,
deviceId: matchedDevice.deviceId,
name: matchedDevice.name
})
that.deviceid = matchedDevice.deviceId
that.devicename = matchedDevice.name
setTimeout(()=>{
if(that.ver_dataflag == 3){
uni.hideLoading() uni.hideLoading()
uni.showToast({
title: res.msg,
icon: 'none',
duration: 2000
})
}
})
}
}
})
}else{
let that = this
uni.showModal({
title: '提示',
content: '您是否要解锁车辆?',
showCancel: true,
success: function(res) {
if (res.confirm) {
xBlufi.notifySendCustomData({ xBlufi.notifySendCustomData({
customData: "11opensub5@" customData: "11opensub5@"
}) })
uni.showLoading({ that.deivceobj.deviceLockStatus = 1
title: '加载中...',
mask: true
})
let query = { let query = {
orderId: that.deivceobj.orderId, orderId: that.deivceobj.orderId,
lat: that.lslat, lat: that.lslat,
@ -885,36 +929,49 @@
requiredIot: false requiredIot: false
} }
let url = '/app/order/openDevice?' + that.$tansParams(query) let url = '/app/order/openDevice?' + that.$tansParams(query)
that.$u.put(url).then((res) => { that.$u.put(url).then((res) =>{})
if (res.code == 200) { }else{
uni.showToast({ that.ver_dataflag = 1
title: '解锁成功', that.shibainum = 0
icon: 'success',
duration: 2000
})
that.deivceobj.deviceLockStatus = 1
that.getorderdevice()
let data = {
mac:that.mac,
reason:'解锁',
command:'11opensub5@',
longitude:that.lslon,
latitude:that.lslat,
result:'成功'
}
that.$u.post(`/app/commandLog/bluetooth`,data).then(res => {})
} else if(res.code == 20001){
uni.hideLoading() uni.hideLoading()
uni.showModal({ uni.showModal({
title: '提示', title: '提示',
content: '设备离线,请点击右上角连接车辆', content: '车辆解锁失败,请检查手机蓝牙是否打开或微信蓝牙是否授权,开启手机定位',
showCancel: false, showCancel: false,
success: function(res) { success: function(res) {
if (res.confirm) { if (res.confirm) {
} else if (res.cancel) {
} }
} }
}) })
}
},4000)
} else {
if(that.shibainum < 3){
that.shibainum++
that.findDeviceTimer = setTimeout(findDevice.bind(that), 1000) // 使 bind this
}else{
that.ver_dataflag = 1
that.shibainum = 0
uni.hideLoading()
uni.showModal({
title: '提示',
content: '车辆解锁失败,请检查手机蓝牙是否打开或微信蓝牙是否授权,开启手机定位',
showCancel: false,
success: function(res) {
if (res.confirm) {
} else if (res.cancel) {
}
}
})
}
}
}
findDevice()
} else { } else {
uni.hideLoading() uni.hideLoading()
uni.showToast({ uni.showToast({
@ -924,13 +981,10 @@
}) })
} }
}) })
} else if (res.cancel) {
} }
} }
}) })
} } else if (deviceLockStatus == 1) {
} else if (this.deivceobj.deviceLockStatus == 1) {
uni.getLocation({ uni.getLocation({
type: 'gcj02', // type: 'gcj02', //
isHighAccuracy: true, isHighAccuracy: true,
@ -946,7 +1000,6 @@
console.error('获取位置失败:', err) console.error('获取位置失败:', err)
} }
}) })
if(this.ver_dataflag != 3){
let that = this let that = this
uni.showModal({ uni.showModal({
title: '提示', title: '提示',
@ -955,7 +1008,7 @@
success: function(res) { success: function(res) {
if (res.confirm) { if (res.confirm) {
uni.showLoading({ uni.showLoading({
title: '加载中...', title: '临时锁车中...',
mask: true mask: true
}) })
let query = { let query = {
@ -974,63 +1027,33 @@
duration: 2000 duration: 2000
}) })
that.deivceobj.deviceLockStatus = 0 that.deivceobj.deviceLockStatus = 0
that.getorderdevice() // that.getorderdevice()
} else if(res.code == 20001){ } else if(res.code == 20001){
uni.hideLoading() console.log(222);
uni.showModal({ // uni.hideLoading()
title: '提示',
content: '设备离线,请点击右上角连接车辆',
showCancel: false,
success: function(res) {
if (res.confirm) {
}
}
})
} else {
uni.hideLoading()
uni.showToast({
title: res.msg,
icon: 'none',
duration: 2000
})
}
})
} else if (res.cancel) {
console.log('取消') //
}
}
})
}else{
let that = this
uni.showModal({
title: '提示',
content: '您是否要临时锁车?',
showCancel: true,
success: function(res) {
if (res.confirm) {
uni.showLoading({ uni.showLoading({
title: '加载中...', title: '蓝牙锁车中...',
mask: true mask: true
}) })
let query = { const findDevice = () =>{
orderId: that.deivceobj.orderId, that.ver_dataflag = 2
lat: that.lat, const matchedDevice = that.devicesarr.find(device => {
lon: that.lon, return device.name.slice(-12) == that.mac.slice(-12)
requiredIot: false
}
let url = '/app/order/closeDevice?' + that.$tansParams(query)
that.$u.put(url).then((res) => {
if (res.code == 200) {
uni.showLoading({
title: '加载中...',
mask: true
}) })
if (matchedDevice) {
xBlufi.notifyStartDiscoverBle({
'isStart': false
})
xBlufi.notifyConnectBle({
isStart: true,
deviceId: matchedDevice.deviceId,
name: matchedDevice.name
})
that.deviceid = matchedDevice.deviceId
that.devicename = matchedDevice.name
setTimeout(()=>{
if(that.ver_dataflag == 3){ if(that.ver_dataflag == 3){
xBlufi.notifySendCustomData({ uni.hideLoading()
customData: "11llosesub300@",
})
that.deivceobj.deviceLockStatus = 0
let data = { let data = {
mac:that.mac, mac:that.mac,
reason:'临时锁车', reason:'临时锁车',
@ -1042,49 +1065,67 @@
that.$u.post(`/app/commandLog/bluetooth`,data).then(res => { that.$u.post(`/app/commandLog/bluetooth`,data).then(res => {
console.log(res,'蓝牙') console.log(res,'蓝牙')
}) })
xBlufi.notifySendCustomData({
customData: "11llosesub300@",
})
that.deivceobj.deviceLockStatus = 0
let query = {
orderId: that.deivceobj.orderId,
lat: that.lat,
lon: that.lon,
requiredIot: false
}
let url = '/app/order/closeDevice?' + that.$tansParams(query)
that.$u.put(url).then((res) =>{})
setTimeout(()=>{ setTimeout(()=>{
xBlufi.notifySendCustomData({ xBlufi.notifySendCustomData({
customData: "11reboot@" customData: "11reboot@"
}) })
uni.hideLoading() uni.hideLoading()
},2000) },3000)
}else{ }else{
that.ver_dataflag = 1
that.shibainum = 0
uni.hideLoading() uni.hideLoading()
let that = this
uni.showModal({ uni.showModal({
title: '提示', title: '提示',
content: '请点击右上角连接蓝牙控制,蓝牙连接需尽可能靠近车辆!', content: '车辆临时锁车失败,请检查手机蓝牙是否打开或微信蓝牙是否授权,开启手机定位',
showCancel: false, showCancel: false,
success: function(res) { success: function(res) {
if (res.confirm) { if (res.confirm) {
} } else if (res.cancel) {
}
})
let data = {
mac:that.mac,
reason:'临时锁车',
command:'close',
longitude:that.lon,
latitude:that.lat,
result:'蓝牙未连接'
}
that.$u.post(`/app/commandLog/bluetooth`,data).then(res => {
console.log(res,'蓝牙')
})
}
} else if(res.code == 20001){
uni.hideLoading()
uni.showModal({
title: '提示',
content: '设备离线,请点击右上角连接车辆',
showCancel: false,
success: function(res) {
if (res.confirm) {
} }
} }
}) })
}
},4000)
} else {
if(that.shibainum < 3){
that.shibainum++
that.findDeviceTimer = setTimeout(findDevice.bind(that), 1000) // 使 bind this
}else{
that.ver_dataflag = 1
that.shibainum = 0
uni.hideLoading()
uni.showModal({
title: '提示',
content: '车辆临时锁车失败,请检查手机蓝牙是否打开或微信蓝牙是否授权,开启手机定位',
showCancel: false,
success: function(res) {
if (res.confirm) {
} else if (res.cancel) {
}
}
})
}
}
}
findDevice()
} else { } else {
uni.hideLoading() uni.hideLoading()
uni.showToast({ uni.showToast({
@ -1101,11 +1142,27 @@
}) })
} }
} }
}else{
uni.showToast({
title: '获取数据失败',
icon: 'none',
duration: 2000
})
}
}
})
}, },
// //
btnfm() { btnfm() {
if(this.jiance == true){
xBlufi.initXBlufi(1)
xBlufi.notifyStartDiscoverBle({
'isStart': true
})
xBlufi.listenDeviceMsgEvent(true, this.funListenDeviceMsgEvent)
}
uni.showLoading({ uni.showLoading({
title: '加载中...', title: '响铃中...',
mask: true mask: true
}) })
this.$u.put(`/app/device/iot/ring?id=${this.deivceobj.deviceId}`).then((res) => { this.$u.put(`/app/device/iot/ring?id=${this.deivceobj.deviceId}`).then((res) => {
@ -1117,29 +1174,76 @@
duration: 2000 duration: 2000
}) })
} else if (res.code == 20001) { } else if (res.code == 20001) {
if (this.ver_dataflag == 3) { uni.showLoading({
title: '响铃中...',
mask: true
})
let that = this
const findDevice = () =>{
that.ver_dataflag = 2
const matchedDevice = that.devicesarr.find(device => {
return device.name.slice(-12) == that.mac.slice(-12)
})
if (matchedDevice) {
xBlufi.notifyStartDiscoverBle({
'isStart': false
})
xBlufi.notifyConnectBle({
isStart: true,
deviceId: matchedDevice.deviceId,
name: matchedDevice.name
})
that.deviceid = matchedDevice.deviceId
that.devicename = matchedDevice.name
setTimeout(()=>{
if(that.ver_dataflag == 3){
uni.hideLoading() uni.hideLoading()
xBlufi.notifySendCustomData({ xBlufi.notifySendCustomData({
customData: "11play1@" customData: "11play1@"
}) })
}else{ }else{
that.ver_dataflag = 1
that.shibainum = 0
uni.hideLoading() uni.hideLoading()
let that = this
uni.showModal({ uni.showModal({
title: '提示', title: '提示',
content: '请点击右上角连接蓝牙控制,蓝牙连接需尽可能靠近车辆!', content: '车辆响铃失败,请检查手机蓝牙是否打开或微信蓝牙是否授权,开启手机定位',
showCancel: false, showCancel: false,
success: function(res) { success: function(res) {
if (res.confirm) { if (res.confirm) {
if(that.ver_dataflag != 3){
}
} else if (res.cancel) { } else if (res.cancel) {
} }
} }
}) })
} }
},4000)
} else {
if(that.shibainum < 3){
that.shibainum++
that.findDeviceTimer = setTimeout(findDevice.bind(that), 1000) // 使 bind this
}else{
that.ver_dataflag = 1
that.shibainum = 0
uni.hideLoading()
uni.showModal({
title: '提示',
content: '车辆响铃失败,请检查手机蓝牙是否打开或微信蓝牙是否授权,开启手机定位',
showCancel: false,
success: function(res) {
if (res.confirm) {
} else if (res.cancel) {
}
}
})
}
}
}
findDevice()
} else { } else {
uni.hideLoading() uni.hideLoading()
uni.showToast({ uni.showToast({
@ -1153,15 +1257,40 @@
// //
btnghbike() { btnghbike() {
if(this.deivceobj.deviceOnlineStatus == 0){ if(this.deivceobj.deviceOnlineStatus == 0){
uni.hideLoading()
const findDevice = () =>{
uni.showLoading({
title: '蓝牙连接中...',
mask: true
})
this.ver_dataflag = 2
const matchedDevice = this.devicesarr.find(device => {
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
setTimeout(()=>{
if(this.ver_dataflag == 3){ if(this.ver_dataflag == 3){
uni.hideLoading()
uni.navigateTo({ uni.navigateTo({
url: '/page_user/huanbike?sn=' + this.deivceobj.deviceSn + '&orderid=' + this.deivceobj.orderId + '&deviceid=' + this.deviceid + '&devicename=' + this.devicename url: '/page_user/huanbike?sn=' + this.deivceobj.deviceSn + '&orderid=' + this.deivceobj.orderId + '&deviceid=' + this.deviceid + '&devicename=' + this.devicename
}) })
}else{ }else{
let that = this this.ver_dataflag = 1
this.shibainum = 0
uni.hideLoading()
uni.showModal({ uni.showModal({
title: '提示', title: '提示',
content: '请点击右上角连接蓝牙控制,蓝牙连接需尽可能靠近车辆!', content: '蓝牙连接失败,请检查手机蓝牙是否打开或微信蓝牙是否授权,开启手机定位',
showCancel: false, showCancel: false,
success: function(res) { success: function(res) {
if (res.confirm) { if (res.confirm) {
@ -1172,6 +1301,31 @@
} }
}) })
} }
},4000)
} else {
if(this.shibainum < 3){
this.shibainum++
this.findDeviceTimer = setTimeout(findDevice.bind(this), 1000) // 使 bind this
}else{
this.ver_dataflag = 1
this.shibainum = 0
uni.hideLoading()
uni.showModal({
title: '提示',
content: '蓝牙连接失败,请检查蓝牙是否打开再重试',
showCancel: false,
success: function(res) {
if (res.confirm) {
} else if (res.cancel) {
}
}
})
}
}
}
findDevice()
}else{ }else{
uni.navigateTo({ uni.navigateTo({
url: '/page_user/huanbike?sn=' + this.deivceobj.deviceSn + '&orderid=' + this.deivceobj.orderId + '&deviceid=' + this.deviceid + '&devicename=' + this.devicename url: '/page_user/huanbike?sn=' + this.deivceobj.deviceSn + '&orderid=' + this.deivceobj.orderId + '&deviceid=' + this.deviceid + '&devicename=' + this.devicename
@ -1200,16 +1354,41 @@
btnhc() { btnhc() {
if (this.orderAreaReturnVerify == true) { if (this.orderAreaReturnVerify == true) {
if(this.deivceobj.deviceOnlineStatus == 0){ if(this.deivceobj.deviceOnlineStatus == 0){
if(this.ver_dataflag == 3){ uni.hideLoading()
let that = this
const findDevice = () =>{
uni.showLoading({
title: '蓝牙连接中...',
mask: true
})
that.ver_dataflag = 2
const matchedDevice = that.devicesarr.find(device => {
return device.name.slice(-12) == that.mac.slice(-12)
})
if (matchedDevice) {
xBlufi.notifyStartDiscoverBle({
'isStart': false
})
xBlufi.notifyConnectBle({
isStart: true,
deviceId: matchedDevice.deviceId,
name: matchedDevice.name
})
that.deviceid = matchedDevice.deviceId
that.devicename = matchedDevice.name
setTimeout(()=>{
if(that.ver_dataflag == 3){
let flag = false let flag = false
uni.navigateTo({ uni.navigateTo({
url: '/page_user/hcshenhe?sn=' + this.deivceobj.deviceSn + '&orderid=' + this.deivceobj.orderId + '&orderAreaId=' + this.deivceobj.orderAreaId + '&flag=' + flag + '&mac=' + this.mac url: '/page_user/hcshenhe?sn=' + that.deivceobj.deviceSn + '&orderid=' + that.deivceobj.orderId + '&orderAreaId=' + that.deivceobj.orderAreaId + '&flag=' + flag + '&mac=' + that.mac
}) })
}else{ }else{
let that = this that.ver_dataflag = 1
that.shibainum = 0
uni.hideLoading()
uni.showModal({ uni.showModal({
title: '提示', title: '提示',
content: '请点击右上角连接蓝牙还车,蓝牙连接需尽可能靠近车辆!', content: '蓝牙连接失败,请检查手机蓝牙是否打开或微信蓝牙是否授权,开启手机定位',
showCancel: false, showCancel: false,
success: function(res) { success: function(res) {
if (res.confirm) { if (res.confirm) {
@ -1220,6 +1399,31 @@
} }
}) })
} }
},4000)
} else {
if(that.shibainum < 3){
that.shibainum++
that.findDeviceTimer = setTimeout(findDevice.bind(that), 1000) // 使 bind this
}else{
that.ver_dataflag = 1
that.shibainum = 0
uni.hideLoading()
uni.showModal({
title: '提示',
content: '蓝牙连接失败,请检查手机蓝牙是否打开或微信蓝牙是否授权,开启手机定位',
showCancel: false,
success: function(res) {
if (res.confirm) {
} else if (res.cancel) {
}
}
})
}
}
}
findDevice()
}else{ }else{
let flag = true let flag = true
uni.navigateTo({ uni.navigateTo({
@ -1299,7 +1503,6 @@
}, },
// //
gethuan() { gethuan() {
if(this.ver_dataflag != 3){
let that = this let that = this
uni.showModal({ uni.showModal({
title: '提示', title: '提示',
@ -1333,43 +1536,8 @@
url:'/page_user/yongche/orderxq?id=' + that.deivceobj.orderId url:'/page_user/yongche/orderxq?id=' + that.deivceobj.orderId
}) })
},1000) },1000)
}else if(res.msg == null) { }else if(res.code == 20001){
uni.hideLoading() if(that.ver_dataflag == 3){
uni.showToast({
title: '未知错误',
icon: 'none',
duration: 2000
})
} else {
uni.showModal({
title: '提示',
content: res.msg,
showCancel: false,
success: function(res) {
if (res.confirm) {
} else if (res.cancel) {
}
}
})
}
})
}
}
})
}else{
let that = this
uni.showModal({
title: '提示',
content: '您确定要还车吗?',
showCancel: true,
success: function(res) {
if (res.confirm) {
uni.showLoading({
title: '还车中...',
mask: true
})
xBlufi.notifySendCustomData({ xBlufi.notifySendCustomData({
customData: "11llosesub300@" customData: "11llosesub300@"
}) })
@ -1418,12 +1586,146 @@
}) })
} }
}) })
}else{
// uni.hideLoading()
const findDevice = () =>{
uni.showLoading({
title: '蓝牙还车中...',
mask: true
})
that.ver_dataflag = 2
const matchedDevice = that.devicesarr.find(device => {
return device.name.slice(-12) == that.mac.slice(-12)
})
if (matchedDevice) {
xBlufi.notifyStartDiscoverBle({
'isStart': false
})
xBlufi.notifyConnectBle({
isStart: true,
deviceId: matchedDevice.deviceId,
name: matchedDevice.name
})
that.deviceid = matchedDevice.deviceId
that.devicename = matchedDevice.name
setTimeout(()=>{
if(that.ver_dataflag == 3){
xBlufi.notifySendCustomData({
customData: "11closesub300@"
})
that.fjflag = false
let data = {
orderId: that.deivceobj.orderId,
picture: that.imgs,
lon: that.lon,
lat: that.lat,
requiredIot: false
}
that.$u.put(`/app/order/end`, data).then(res => {
if (res.code == 200) {
setTimeout(()=>{
xBlufi.notifySendCustomData({
customData: "11reboot@"
})
uni.hideLoading()
that.getorderdevice()
setTimeout(()=>{
uni.navigateTo({
url:'/page_user/yongche/orderxq?id=' + that.deivceobj.orderId
})
},1000)
},1000)
}else if(res.msg == null) {
uni.hideLoading()
uni.showToast({
title: '未知错误',
icon: 'none',
duration: 2000
})
} else {
uni.hideLoading()
uni.showModal({
title: '提示',
content: res.msg,
showCancel: false,
success: function(res) {
if (res.confirm) {
} else if (res.cancel) { } else if (res.cancel) {
} }
} }
}) })
} }
})
}else{
that.ver_dataflag = 1
that.shibainum = 0
uni.hideLoading()
uni.showModal({
title: '提示',
content: '车辆还车失败,请检查手机蓝牙是否打开或微信蓝牙是否授权,开启手机定位',
showCancel: false,
success: function(res) {
if (res.confirm) {
} else if (res.cancel) {
}
}
})
}
},4000)
} else {
if(that.shibainum < 3){
that.shibainum++
that.findDeviceTimer = setTimeout(findDevice.bind(that), 1000) // 使 bind this
}else{
that.ver_dataflag = 1
that.shibainum = 0
uni.hideLoading()
uni.showModal({
title: '提示',
content: '车辆还车失败,请检查手机蓝牙是否打开或微信蓝牙是否授权,开启手机定位',
showCancel: false,
success: function(res) {
if (res.confirm) {
} else if (res.cancel) {
}
}
})
}
}
}
findDevice()
}
} else if(res.msg == null) {
uni.hideLoading()
uni.showToast({
title: '未知错误',
icon: 'none',
duration: 2000
})
} else {
uni.showModal({
title: '提示',
content: res.msg,
showCancel: false,
success: function(res) {
if (res.confirm) {
} else if (res.cancel) {
}
}
})
}
})
}
}
})
}, },
// //
btntcd() { btntcd() {

File diff suppressed because it is too large Load Diff