电动车
This commit is contained in:
parent
9b9e24e65c
commit
10eff1ab30
|
|
@ -1,7 +1,7 @@
|
|||
const install = (Vue, vm) => {
|
||||
uni.setStorageSync('deptId', 100);
|
||||
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: 'https://ele.ccttiot.com/prod-api', //线上
|
||||
// baseUrl: 'https://cc.ccttiot.com/prod-api', //叉车线上
|
||||
|
|
|
|||
|
|
@ -157,7 +157,7 @@
|
|||
let sceneValue = res.result
|
||||
let decodedValue = decodeURIComponent(sceneValue)
|
||||
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.data){
|
||||
uni.switchTab({
|
||||
|
|
|
|||
|
|
@ -36,7 +36,7 @@
|
|||
methods: {
|
||||
// 确认开锁
|
||||
btnkaisuo(){
|
||||
this.$u.get("/app/orderDevice/mineUsing").then(res =>{
|
||||
this.$u.get("/app/order/mineProcessing").then(res =>{
|
||||
if(res.code == 200){
|
||||
if(res.data){
|
||||
uni.switchTab({
|
||||
|
|
|
|||
File diff suppressed because it is too large
Load Diff
|
|
@ -54,7 +54,7 @@
|
|||
<view class="lypic" v-if="ver_dataflag == 1" @click="btnly">
|
||||
<image class="glow-image"
|
||||
src="https://api.ccttiot.com/smartmeter/img/static/uCdHjNaNfD9aikVg9Cuk"
|
||||
mode="aspectFit" :class="{ 'visible': isVisible, 'hidden': !isVisible }" />
|
||||
mode="aspectFit" />
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
|
|
@ -226,7 +226,7 @@
|
|||
二维码
|
||||
</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">
|
||||
<image src="https://api.ccttiot.com/smartmeter/img/static/uqUiYiMtGTjkPNgmCjvP" mode=""></image>
|
||||
</view>
|
||||
|
|
@ -261,7 +261,7 @@
|
|||
<image src="https://api.ccttiot.com/smartmeter/img/static/uqUiYiMtGTjkPNgmCjvP" mode=""></image>
|
||||
</view>
|
||||
蓝牙开坐垫锁
|
||||
</view>
|
||||
</view> -->
|
||||
</view>
|
||||
<view class="zuche">
|
||||
<view class="">
|
||||
|
|
@ -502,7 +502,9 @@
|
|||
isVisible: true,
|
||||
glowInterval: null,
|
||||
lat:'',
|
||||
lon:''
|
||||
lon:'',
|
||||
shibainum:0,
|
||||
jiance:false
|
||||
}
|
||||
},
|
||||
onLoad(e) {
|
||||
|
|
@ -511,6 +513,11 @@
|
|||
this.deptId = uni.getStorageSync('deptId')
|
||||
},
|
||||
onShow() {
|
||||
xBlufi.initXBlufi(1)
|
||||
xBlufi.notifyStartDiscoverBle({
|
||||
'isStart': true
|
||||
})
|
||||
xBlufi.listenDeviceMsgEvent(true, this.funListenDeviceMsgEvent)
|
||||
this.getyunying()
|
||||
uni.getLocation({
|
||||
type: 'gcj02', // 国内地图更兼容
|
||||
|
|
@ -738,9 +745,7 @@
|
|||
duration: 2000
|
||||
})
|
||||
}
|
||||
setTimeout(() => {
|
||||
this.jieliuflag = true
|
||||
}, 3000)
|
||||
}
|
||||
},
|
||||
getlanya() {
|
||||
|
|
@ -797,6 +802,7 @@
|
|||
if (options.result == true) {
|
||||
setTimeout(() => {
|
||||
this.ver_dataflag = 3
|
||||
this.jiance = false
|
||||
}, 2000)
|
||||
xBlufi.notifyInitBleEsp32({
|
||||
deviceId: this.deviceid
|
||||
|
|
@ -815,6 +821,7 @@
|
|||
case xBlufi.XBLUFI_TYPE.TYPE_GET_DEVICE_LISTS_START:
|
||||
if (!options.result) {
|
||||
console.log('蓝牙未开启')
|
||||
this.jiance = true
|
||||
return
|
||||
} else {
|
||||
this.lanyaflag = false
|
||||
|
|
@ -1143,15 +1150,21 @@
|
|||
this.showvehicle = false
|
||||
},
|
||||
btn(num) {
|
||||
if(this.jiance == true){
|
||||
xBlufi.initXBlufi(1)
|
||||
xBlufi.notifyStartDiscoverBle({
|
||||
'isStart': true
|
||||
})
|
||||
xBlufi.listenDeviceMsgEvent(true, this.funListenDeviceMsgEvent)
|
||||
}
|
||||
if (this.jieliuflag == true) {
|
||||
this.jieliuflag = false
|
||||
this.showbtntip = false
|
||||
let data = [this.sn]
|
||||
if (num == 0) {
|
||||
uni.showLoading({
|
||||
title: '加载中...'
|
||||
title: '车辆开锁中...'
|
||||
})
|
||||
console.log('点击了....1')
|
||||
if (this.ver_dataflag == 3) {
|
||||
xBlufi.notifySendCustomData({
|
||||
customData: "11opensub5@"
|
||||
|
|
@ -1173,9 +1186,7 @@
|
|||
result:'成功'
|
||||
}
|
||||
this.$u.post(`/app/commandLog/bluetooth`,data).then(res => {})
|
||||
setTimeout(() => {
|
||||
this.jieliuflag = true
|
||||
}, 2000)
|
||||
} else {
|
||||
uni.hideLoading()
|
||||
uni.showToast({
|
||||
|
|
@ -1183,13 +1194,41 @@
|
|||
icon: 'none',
|
||||
duration: 2000
|
||||
})
|
||||
setTimeout(() => {
|
||||
this.jieliuflag = true
|
||||
}, 2000)
|
||||
}
|
||||
})
|
||||
} else {
|
||||
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) {
|
||||
this.deviceInfo()
|
||||
uni.showToast({
|
||||
|
|
@ -1197,21 +1236,18 @@
|
|||
icon: 'success',
|
||||
duration: 3000
|
||||
})
|
||||
setTimeout(() => {
|
||||
this.jieliuflag = true
|
||||
}, 2000)
|
||||
}else if(res.code == 20001){
|
||||
uni.hideLoading()
|
||||
uni.showModal({
|
||||
title: '提示',
|
||||
content: '设备离线,请进行连接蓝牙开锁',
|
||||
showCancel: false,
|
||||
success: function(res) {
|
||||
if (res.confirm) {
|
||||
let data = {
|
||||
mac:this.mac,
|
||||
reason:'商户开锁',
|
||||
command:'11opensub5@',
|
||||
longitude:this.lon,
|
||||
latitude:this.lat,
|
||||
result:'成功'
|
||||
}
|
||||
this.$u.post(`/app/commandLog/bluetooth`,data).then(res => {})
|
||||
|
||||
this.jieliuflag = true
|
||||
|
||||
}
|
||||
}
|
||||
})
|
||||
} else {
|
||||
uni.hideLoading()
|
||||
uni.showToast({
|
||||
|
|
@ -1219,17 +1255,154 @@
|
|||
icon: 'none',
|
||||
duration: 2000
|
||||
})
|
||||
setTimeout(() => {
|
||||
|
||||
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) {
|
||||
uni.showLoading({
|
||||
title: '加载中...'
|
||||
title: '锁车中...'
|
||||
})
|
||||
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({
|
||||
customData: "11closesub200@"
|
||||
})
|
||||
|
|
@ -1244,52 +1417,71 @@
|
|||
let data = {
|
||||
mac:this.mac,
|
||||
reason:'商户关锁',
|
||||
command:'11',
|
||||
command:'11closesub200@',
|
||||
longitude:this.lon,
|
||||
latitude:this.lat,
|
||||
result:'成功'
|
||||
}
|
||||
this.$u.post(`/app/commandLog/bluetooth`,data).then(res => {})
|
||||
setTimeout(() => {
|
||||
// closesub200@',
|
||||
// longitude:this.lon,
|
||||
// latitude:this.lat,
|
||||
|
||||
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.showModal({
|
||||
title: '提示',
|
||||
content: '设备离线,请进行连接蓝牙关锁',
|
||||
content: '车辆开锁失败,请检查手机蓝牙是否打开或微信蓝牙是否授权,开启手机定位',
|
||||
showCancel: false,
|
||||
success: function(res) {
|
||||
if (res.confirm) {
|
||||
|
||||
} else if (res.cancel) {
|
||||
|
||||
}
|
||||
}
|
||||
})
|
||||
} else{
|
||||
uni.hideLoading()
|
||||
uni.showToast({
|
||||
title: res.msg,
|
||||
icon: 'none',
|
||||
duration: 2000
|
||||
})
|
||||
setTimeout(() => {
|
||||
this.jieliuflag = true
|
||||
}, 2000)
|
||||
}
|
||||
})
|
||||
},4000)
|
||||
} 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(() => {
|
||||
if(this.shibainum < 3){
|
||||
this.shibainum++
|
||||
this.findDeviceTimer = setTimeout(findDevice.bind(this), 1000) // 使用 bind 保持 this 上下文
|
||||
}else{
|
||||
this.jieliuflag = true
|
||||
}, 2000)
|
||||
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{
|
||||
uni.hideLoading()
|
||||
uni.showToast({
|
||||
|
|
@ -1297,9 +1489,9 @@
|
|||
icon: 'none',
|
||||
duration: 2000
|
||||
})
|
||||
setTimeout(() => {
|
||||
|
||||
this.jieliuflag = true
|
||||
}, 2000)
|
||||
|
||||
}
|
||||
})
|
||||
}
|
||||
|
|
@ -1316,18 +1508,16 @@
|
|||
});
|
||||
// 处理接口返回的数据,将边界数据转换为地图组件需要的折线结构
|
||||
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) {
|
||||
|
|
@ -1343,9 +1533,7 @@
|
|||
duration: 2000
|
||||
})
|
||||
this.deviceInfo()
|
||||
setTimeout(() => {
|
||||
this.jieliuflag = true
|
||||
}, 2000)
|
||||
} else {
|
||||
|
||||
uni.showToast({
|
||||
|
|
@ -1353,14 +1541,12 @@
|
|||
icon: 'none',
|
||||
duration: 2000
|
||||
})
|
||||
setTimeout(() => {
|
||||
this.jieliuflag = true
|
||||
}, 2000)
|
||||
}
|
||||
})
|
||||
} else if (num == 4) {
|
||||
uni.showLoading({
|
||||
title: '加载中...'
|
||||
title: '响铃中...'
|
||||
})
|
||||
this.$u.put('/bst/device/iot/ring?id=' + this.sn).then((res) => {
|
||||
if (res.code == 200) {
|
||||
|
|
@ -1370,11 +1556,79 @@
|
|||
icon: 'success',
|
||||
duration: 2000
|
||||
})
|
||||
setTimeout(() => {
|
||||
this.jieliuflag = true
|
||||
}, 2000)
|
||||
} else if (res.code == 200001) {
|
||||
} 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){
|
||||
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 {
|
||||
uni.hideLoading()
|
||||
uni.showToast({
|
||||
|
|
@ -1382,9 +1636,7 @@
|
|||
icon: 'none',
|
||||
duration: 2000
|
||||
})
|
||||
setTimeout(() => {
|
||||
this.jieliuflag = true
|
||||
}, 2000)
|
||||
}
|
||||
})
|
||||
} else if (num == 5) {
|
||||
|
|
@ -1399,18 +1651,14 @@
|
|||
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) {
|
||||
|
|
@ -1425,25 +1673,21 @@
|
|||
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) {
|
||||
this.showvehicle = true
|
||||
} else if (num == 8) {
|
||||
uni.showLoading({
|
||||
title: '加载中...'
|
||||
title: '重启中...'
|
||||
})
|
||||
this.$u.put('/bst/device/iot/reboot?id=' + this.sn).then((res) => {
|
||||
if (res.code == 200) {
|
||||
|
|
@ -1453,18 +1697,88 @@
|
|||
icon: 'success',
|
||||
duration: 2000
|
||||
})
|
||||
setTimeout(() => {
|
||||
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 {
|
||||
uni.showToast({
|
||||
title: res.msg,
|
||||
icon: 'none',
|
||||
duration: 3000
|
||||
})
|
||||
setTimeout(() => {
|
||||
this.jieliuflag = true
|
||||
}, 2000)
|
||||
}
|
||||
})
|
||||
} else if (num == 9) {
|
||||
|
|
@ -1479,18 +1793,14 @@
|
|||
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) {
|
||||
|
|
@ -1505,21 +1815,30 @@
|
|||
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{
|
||||
this.jieliuflag = true
|
||||
uni.hideLoading()
|
||||
uni.showModal({
|
||||
title: '提示',
|
||||
content: '请不要频繁点击',
|
||||
showCancel: false,
|
||||
success: function(res) {
|
||||
if (res.confirm) {
|
||||
|
||||
}
|
||||
}
|
||||
})
|
||||
}
|
||||
},
|
||||
btnyc() {
|
||||
|
|
@ -1544,7 +1863,7 @@
|
|||
this.deviceInfos = res.data
|
||||
this.mac = res.data.mac
|
||||
if (this.ver_dataflag != 3) {
|
||||
this.getlanya()
|
||||
// this.getlanya()
|
||||
}
|
||||
if (this.getnum == 0) {
|
||||
this.getArea()
|
||||
|
|
@ -1943,7 +2262,6 @@
|
|||
.page {
|
||||
padding-bottom: 400rpx;
|
||||
width: 750rpx;
|
||||
|
||||
.new_infocard {
|
||||
width: 750rpx;
|
||||
max-height: 100vh;
|
||||
|
|
|
|||
|
|
@ -74,7 +74,9 @@
|
|||
this.getQiniuToken()
|
||||
},
|
||||
onLoad(e) {
|
||||
|
||||
if(e.sn){
|
||||
this.sn = e.sn
|
||||
}
|
||||
},
|
||||
computed: {
|
||||
appointmentServiceFee() {
|
||||
|
|
|
|||
|
|
@ -146,6 +146,10 @@
|
|||
})
|
||||
},
|
||||
gethc(){
|
||||
uni.showLoading({
|
||||
title: '还车中...',
|
||||
mask: true
|
||||
})
|
||||
if(this.flag == true){
|
||||
let data = {
|
||||
orderId:this.orderId,
|
||||
|
|
@ -198,12 +202,6 @@
|
|||
this.$u.put(`/app/order/end`,data).then(res =>{
|
||||
if (res.code == 200) {
|
||||
this.fjflag = false
|
||||
uni.hideLoading()
|
||||
setTimeout(()=>{
|
||||
uni.redirectTo({
|
||||
url:'/page_user/yongche/orderxq?id=' + this.orderId
|
||||
})
|
||||
},1000)
|
||||
let data = {
|
||||
mac:this.mac,
|
||||
reason:'还车',
|
||||
|
|
@ -215,9 +213,18 @@
|
|||
this.$u.post(`/app/commandLog/bluetooth`,data).then(res => {
|
||||
console.log(res,'蓝牙')
|
||||
})
|
||||
setTimeout(()=>{
|
||||
xBlufi.notifySendCustomData({
|
||||
customData: "11reboot@"
|
||||
})
|
||||
setTimeout(()=>{
|
||||
uni.hideLoading()
|
||||
uni.redirectTo({
|
||||
url:'/page_user/yongche/orderxq?id=' + this.orderId
|
||||
})
|
||||
},1000)
|
||||
},2000)
|
||||
|
||||
}else if(res.msg == null) {
|
||||
uni.hideLoading()
|
||||
uni.showToast({
|
||||
|
|
|
|||
|
|
@ -1,7 +1,7 @@
|
|||
<template>
|
||||
<view class="page">
|
||||
<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()">
|
||||
|
||||
<input type="text" class="ips" v-model="mac" placeholder=" " style="margin-left: 32rpx;" disabled
|
||||
|
|
@ -39,9 +39,9 @@
|
|||
确认添加
|
||||
</view>
|
||||
<view class="bot_btn">
|
||||
<!-- <view class="btn1" @click="btngx()">
|
||||
设备更新
|
||||
</view> -->
|
||||
<view class="btn1" @click="btnfh">
|
||||
返回
|
||||
</view>
|
||||
<view class="btn1" @click="findDevice()">
|
||||
蓝牙链接
|
||||
</view>
|
||||
|
|
@ -181,6 +181,11 @@
|
|||
|
||||
},
|
||||
methods: {
|
||||
btnfh(){
|
||||
uni.reLaunch({
|
||||
url:'/page_user/luru/index'
|
||||
})
|
||||
},
|
||||
btngx(){
|
||||
// this.$u.post('/app/device/ring?sn=' + this.sn).then((res) => {
|
||||
// if (res.code == 200) {
|
||||
|
|
|
|||
|
|
@ -3,10 +3,13 @@
|
|||
<u-navbar :title="tit" :border-bottom="false" :background="bgc" back-icon-color="#262B37" title-color='#262B37'
|
||||
title-size='36' height='36' id="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>
|
||||
|
||||
<u-parse v-else :html="obj" style="width: 100%;height: 100%;padding: 10rpx;box-sizing: border-box;"></u-parse>
|
||||
|
||||
</view>
|
||||
</template>
|
||||
|
|
@ -19,7 +22,7 @@
|
|||
backgroundColor: "#fff",
|
||||
},
|
||||
type:'',
|
||||
obj:{},
|
||||
obj:'',
|
||||
tit:''
|
||||
}
|
||||
},
|
||||
|
|
@ -27,7 +30,9 @@
|
|||
this.type = option.type
|
||||
if(option.type == 0){
|
||||
this.tit = '租车指南'
|
||||
}else{
|
||||
}else if(option.type == 2){
|
||||
this.tit = '查看教程'
|
||||
} else{
|
||||
this.tit = '用车指南'
|
||||
}
|
||||
this.getqingqiu()
|
||||
|
|
|
|||
|
|
@ -336,8 +336,9 @@
|
|||
channelobj:{}
|
||||
}
|
||||
},
|
||||
onLoad(e) {
|
||||
this.id = e.id
|
||||
onLoad(option) {
|
||||
this.id = option.id
|
||||
console.log(option,this.id,'020202020');
|
||||
this.getyouhui()
|
||||
this.updateTrackData()
|
||||
this.orderInfo()
|
||||
|
|
@ -579,7 +580,7 @@
|
|||
const refunded = parseFloat(payRefunded) || 0;
|
||||
const refunding = parseFloat(payRefunding) || 0;
|
||||
const actualAmount = amount - (refunded + refunding);
|
||||
return `${actualAmount.toFixed(2)}`;
|
||||
return `${actualAmount}`;
|
||||
},
|
||||
// 点击隐藏客服
|
||||
btnkefu(){
|
||||
|
|
|
|||
14
pages.json
14
pages.json
|
|
@ -4,6 +4,13 @@
|
|||
},
|
||||
"lazyCodeLoading": "requiredComponents",
|
||||
"pages": [{
|
||||
"path": "pages/nearbystores/index",
|
||||
"style": {
|
||||
"navigationBarTitleText": "",
|
||||
"enablePullDownRefresh": false,
|
||||
"navigationStyle": "custom"
|
||||
}
|
||||
},{
|
||||
"path": "pages/index/index",
|
||||
"style": {
|
||||
"navigationBarTitleText": "首页",
|
||||
|
|
@ -12,13 +19,6 @@
|
|||
"navigationBarTextStyle": "#FFFFFF",
|
||||
"navigationStyle": "custom"
|
||||
}
|
||||
},{
|
||||
"path": "pages/nearbystores/index",
|
||||
"style": {
|
||||
"navigationBarTitleText": "",
|
||||
"enablePullDownRefresh": false,
|
||||
"navigationStyle": "custom"
|
||||
}
|
||||
},{
|
||||
"path": "pages/login/login",
|
||||
"style": {
|
||||
|
|
|
|||
File diff suppressed because it is too large
Load Diff
12
pages/my.vue
12
pages/my.vue
|
|
@ -1,7 +1,7 @@
|
|||
<template>
|
||||
<view class="page">
|
||||
<u-navbar :is-back="false" title="我的" :border-bottom="false" back-icon-color="000" :background="bgc" title-color='#000' title-size='36'
|
||||
height='44' id="navbar">
|
||||
<u-navbar title="我的" :border-bottom="false" back-icon-color="000" :background="bgc" title-color='#000' title-size='36'
|
||||
height='44' id="navbar" :custom-back="btnfh">
|
||||
</u-navbar>
|
||||
<view class="dahezi">
|
||||
<view class="caozuo">
|
||||
|
|
@ -122,7 +122,7 @@
|
|||
</scroll-view>
|
||||
</view>
|
||||
</view>
|
||||
<tab-bar :indexs='4'></tab-bar>
|
||||
<!-- <tab-bar :indexs='4'></tab-bar> -->
|
||||
</view>
|
||||
</template>
|
||||
|
||||
|
|
@ -157,6 +157,12 @@
|
|||
// this.getlunbo()
|
||||
},
|
||||
methods: {
|
||||
// 点击返回首页
|
||||
btnfh(){
|
||||
uni.reLaunch({
|
||||
url:'/pages/nearbystores/index'
|
||||
})
|
||||
},
|
||||
// 点击跳转到商家合作
|
||||
btnshangjia(){
|
||||
uni.navigateTo({
|
||||
|
|
|
|||
|
|
@ -18,17 +18,18 @@
|
|||
车牌号:{{deivceobj.deviceVehicleNum == null ? '--' : deivceobj.deviceVehicleNum}}
|
||||
<text>SN:{{deivceobj.deviceSn == null ? '--' : deivceobj.deviceSn}}</text>
|
||||
</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"
|
||||
mode=""></image> 点击断开
|
||||
mode=""></image> 已连接
|
||||
</view>
|
||||
<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"
|
||||
mode=""></image> 连接中...
|
||||
</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"
|
||||
mode=""></image> 点击连接
|
||||
mode=""></image> 未连接
|
||||
</view>
|
||||
</view>
|
||||
<view class="dianliang">
|
||||
|
|
@ -60,9 +61,13 @@
|
|||
<image src="https://api.ccttiot.com/smartmeter/img/static/uWwAFNbsKSwnHl6ZjBLx" mode=""></image>
|
||||
鸣笛寻车
|
||||
</view>
|
||||
<view class="" @click="btnqd">
|
||||
<view class="" @click="btnqd(0)">
|
||||
<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 class="" v-if="deivceobj.deviceModelEnableSeat == true" @click="btnkzds">
|
||||
<image src="https://api.ccttiot.com/smartmeter/img/static/uKcx6eIfOavWEygp5o9n" mode=""></image>
|
||||
|
|
@ -238,7 +243,8 @@
|
|||
isRefreshing: false,
|
||||
orderid:'',
|
||||
qixingobj:{},
|
||||
shibainum:0
|
||||
shibainum:0,
|
||||
jiance:false
|
||||
};
|
||||
},
|
||||
computed: {
|
||||
|
|
@ -381,7 +387,6 @@
|
|||
title: '加载中...',
|
||||
mask: true
|
||||
})
|
||||
// console.log(that.lslat,that.lslon,'开坐垫锁');
|
||||
if (that.ver_dataflag == 3) {
|
||||
xBlufi.notifySendCustomData({
|
||||
customData: "11hpen@"
|
||||
|
|
@ -437,9 +442,41 @@
|
|||
} else if(res.code == 20001){
|
||||
uni.hideLoading()
|
||||
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({
|
||||
title: '提示',
|
||||
content: '设备离线,请点击右上角连接车辆',
|
||||
content: '开启坐垫锁失败,请重试',
|
||||
showCancel: false,
|
||||
success: function(res) {
|
||||
if (res.confirm) {
|
||||
|
|
@ -450,6 +487,8 @@
|
|||
}
|
||||
})
|
||||
}
|
||||
}
|
||||
}
|
||||
} else {
|
||||
uni.hideLoading()
|
||||
uni.showToast({
|
||||
|
|
@ -514,15 +553,6 @@
|
|||
if (res.code == 200) {
|
||||
if (res.data) {
|
||||
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.orderAreaReturnVerify = res.data.orderAreaReturnVerify
|
||||
this.deivceobj = res.data
|
||||
|
|
@ -592,6 +622,7 @@
|
|||
this.ver_dataflag = 1
|
||||
console.log(this.ver_dataflag,'断开断开');
|
||||
clearTimeout(this.uploadTimer) //清除每十秒传一次的定时
|
||||
this.jiance = true
|
||||
// this.findDevice()
|
||||
}
|
||||
break;
|
||||
|
|
@ -624,6 +655,7 @@
|
|||
case xBlufi.XBLUFI_TYPE.TYPE_GET_DEVICE_LISTS_START:
|
||||
if (!options.result) {
|
||||
console.log('蓝牙未开启')
|
||||
this.jiance = true
|
||||
return
|
||||
} else {
|
||||
this.lanyaflag = false
|
||||
|
|
@ -793,8 +825,30 @@
|
|||
},
|
||||
|
||||
// 点击启动and关闭
|
||||
btnqd() {
|
||||
if (this.deivceobj.deviceLockStatus == 0) {
|
||||
btnqd(deviceLockStatus) {
|
||||
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({
|
||||
type: 'gcj02', // 国内地图更兼容
|
||||
isHighAccuracy: true,
|
||||
|
|
@ -810,7 +864,6 @@
|
|||
this.lslat = null
|
||||
}
|
||||
})
|
||||
if(this.ver_dataflag != 3){
|
||||
let that = this
|
||||
uni.showModal({
|
||||
title: '提示',
|
||||
|
|
@ -819,7 +872,7 @@
|
|||
success: function(res) {
|
||||
if (res.confirm) {
|
||||
uni.showLoading({
|
||||
title: '加载中...',
|
||||
title: '车辆解锁中...',
|
||||
mask: true
|
||||
})
|
||||
let query = {
|
||||
|
|
@ -828,56 +881,47 @@
|
|||
lon: that.lslon,
|
||||
requiredIot: true
|
||||
}
|
||||
|
||||
let url = '/app/order/openDevice?' + that.$tansParams(query)
|
||||
that.$u.put(url).then((res) => {
|
||||
if (res.code == 200) {
|
||||
uni.hideLoading()
|
||||
uni.showToast({
|
||||
title: '解锁成功',
|
||||
icon: 'success',
|
||||
duration: 2000
|
||||
})
|
||||
that.deivceobj.deviceLockStatus = 1
|
||||
that.getorderdevice()
|
||||
// that.getorderdevice()
|
||||
} else if(res.code == 20001){
|
||||
uni.hideLoading()
|
||||
uni.showModal({
|
||||
title: '提示',
|
||||
content: '设备离线,请点击右上角连接车辆',
|
||||
showCancel: false,
|
||||
success: function(res) {
|
||||
if (res.confirm) {
|
||||
console.log(111);
|
||||
uni.showLoading({
|
||||
title: '蓝牙解锁中...',
|
||||
mask: true
|
||||
})
|
||||
const findDevice = () =>{
|
||||
|
||||
}
|
||||
}
|
||||
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.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({
|
||||
customData: "11opensub5@"
|
||||
})
|
||||
uni.showLoading({
|
||||
title: '加载中...',
|
||||
mask: true
|
||||
})
|
||||
that.deivceobj.deviceLockStatus = 1
|
||||
let query = {
|
||||
orderId: that.deivceobj.orderId,
|
||||
lat: that.lslat,
|
||||
|
|
@ -885,36 +929,49 @@
|
|||
requiredIot: false
|
||||
}
|
||||
let url = '/app/order/openDevice?' + that.$tansParams(query)
|
||||
that.$u.put(url).then((res) => {
|
||||
if (res.code == 200) {
|
||||
uni.showToast({
|
||||
title: '解锁成功',
|
||||
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){
|
||||
that.$u.put(url).then((res) =>{})
|
||||
}else{
|
||||
that.ver_dataflag = 1
|
||||
that.shibainum = 0
|
||||
uni.hideLoading()
|
||||
uni.showModal({
|
||||
title: '提示',
|
||||
content: '设备离线,请点击右上角连接车辆',
|
||||
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 {
|
||||
uni.hideLoading()
|
||||
uni.showToast({
|
||||
|
|
@ -924,13 +981,10 @@
|
|||
})
|
||||
}
|
||||
})
|
||||
} else if (res.cancel) {
|
||||
|
||||
}
|
||||
}
|
||||
})
|
||||
}
|
||||
} else if (this.deivceobj.deviceLockStatus == 1) {
|
||||
} else if (deviceLockStatus == 1) {
|
||||
uni.getLocation({
|
||||
type: 'gcj02', // 国内地图更兼容
|
||||
isHighAccuracy: true,
|
||||
|
|
@ -946,7 +1000,6 @@
|
|||
console.error('获取位置失败:', err)
|
||||
}
|
||||
})
|
||||
if(this.ver_dataflag != 3){
|
||||
let that = this
|
||||
uni.showModal({
|
||||
title: '提示',
|
||||
|
|
@ -955,7 +1008,7 @@
|
|||
success: function(res) {
|
||||
if (res.confirm) {
|
||||
uni.showLoading({
|
||||
title: '加载中...',
|
||||
title: '临时锁车中...',
|
||||
mask: true
|
||||
})
|
||||
let query = {
|
||||
|
|
@ -974,63 +1027,33 @@
|
|||
duration: 2000
|
||||
})
|
||||
that.deivceobj.deviceLockStatus = 0
|
||||
that.getorderdevice()
|
||||
// that.getorderdevice()
|
||||
} else if(res.code == 20001){
|
||||
uni.hideLoading()
|
||||
uni.showModal({
|
||||
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) {
|
||||
console.log(222);
|
||||
// uni.hideLoading()
|
||||
uni.showLoading({
|
||||
title: '加载中...',
|
||||
title: '蓝牙锁车中...',
|
||||
mask: true
|
||||
})
|
||||
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) => {
|
||||
if (res.code == 200) {
|
||||
uni.showLoading({
|
||||
title: '加载中...',
|
||||
mask: true
|
||||
const findDevice = () =>{
|
||||
that.ver_dataflag = 2
|
||||
const matchedDevice = that.devicesarr.find(device => {
|
||||
return device.name.slice(-12) == that.mac.slice(-12)
|
||||
})
|
||||
if (that.ver_dataflag == 3) {
|
||||
xBlufi.notifySendCustomData({
|
||||
customData: "11llosesub300@",
|
||||
if (matchedDevice) {
|
||||
xBlufi.notifyStartDiscoverBle({
|
||||
'isStart': false
|
||||
})
|
||||
that.deivceobj.deviceLockStatus = 0
|
||||
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()
|
||||
let data = {
|
||||
mac:that.mac,
|
||||
reason:'临时锁车',
|
||||
|
|
@ -1042,49 +1065,67 @@
|
|||
that.$u.post(`/app/commandLog/bluetooth`,data).then(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(()=>{
|
||||
xBlufi.notifySendCustomData({
|
||||
customData: "11reboot@"
|
||||
})
|
||||
uni.hideLoading()
|
||||
},2000)
|
||||
},3000)
|
||||
}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()
|
||||
let that = this
|
||||
uni.showModal({
|
||||
title: '提示',
|
||||
content: '请点击右上角连接蓝牙控制,蓝牙连接需尽可能靠近车辆!',
|
||||
content: '车辆临时锁车失败,请检查手机蓝牙是否打开或微信蓝牙是否授权,开启手机定位',
|
||||
showCancel: false,
|
||||
success: function(res) {
|
||||
if (res.confirm) {
|
||||
|
||||
}
|
||||
}
|
||||
})
|
||||
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) {
|
||||
} else if (res.cancel) {
|
||||
|
||||
}
|
||||
}
|
||||
})
|
||||
}
|
||||
}
|
||||
}
|
||||
findDevice()
|
||||
} else {
|
||||
uni.hideLoading()
|
||||
uni.showToast({
|
||||
|
|
@ -1101,11 +1142,27 @@
|
|||
})
|
||||
}
|
||||
}
|
||||
}else{
|
||||
uni.showToast({
|
||||
title: '获取数据失败',
|
||||
icon: 'none',
|
||||
duration: 2000
|
||||
})
|
||||
}
|
||||
}
|
||||
})
|
||||
},
|
||||
// 点击鸣笛寻车
|
||||
btnfm() {
|
||||
if(this.jiance == true){
|
||||
xBlufi.initXBlufi(1)
|
||||
xBlufi.notifyStartDiscoverBle({
|
||||
'isStart': true
|
||||
})
|
||||
xBlufi.listenDeviceMsgEvent(true, this.funListenDeviceMsgEvent)
|
||||
}
|
||||
uni.showLoading({
|
||||
title: '加载中...',
|
||||
title: '响铃中...',
|
||||
mask: true
|
||||
})
|
||||
this.$u.put(`/app/device/iot/ring?id=${this.deivceobj.deviceId}`).then((res) => {
|
||||
|
|
@ -1117,29 +1174,76 @@
|
|||
duration: 2000
|
||||
})
|
||||
} 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()
|
||||
xBlufi.notifySendCustomData({
|
||||
customData: "11play1@"
|
||||
})
|
||||
} else {
|
||||
}else{
|
||||
that.ver_dataflag = 1
|
||||
that.shibainum = 0
|
||||
uni.hideLoading()
|
||||
let that = this
|
||||
uni.showModal({
|
||||
title: '提示',
|
||||
content: '请点击右上角连接蓝牙控制,蓝牙连接需尽可能靠近车辆!',
|
||||
content: '车辆响铃失败,请检查手机蓝牙是否打开或微信蓝牙是否授权,开启手机定位',
|
||||
showCancel: false,
|
||||
success: function(res) {
|
||||
if (res.confirm) {
|
||||
if(that.ver_dataflag != 3){
|
||||
|
||||
}
|
||||
} 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 {
|
||||
uni.hideLoading()
|
||||
uni.showToast({
|
||||
|
|
@ -1153,15 +1257,40 @@
|
|||
// 点击去进行换车
|
||||
btnghbike() {
|
||||
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){
|
||||
uni.hideLoading()
|
||||
uni.navigateTo({
|
||||
url: '/page_user/huanbike?sn=' + this.deivceobj.deviceSn + '&orderid=' + this.deivceobj.orderId + '&deviceid=' + this.deviceid + '&devicename=' + this.devicename
|
||||
})
|
||||
}else{
|
||||
let that = this
|
||||
this.ver_dataflag = 1
|
||||
this.shibainum = 0
|
||||
uni.hideLoading()
|
||||
uni.showModal({
|
||||
title: '提示',
|
||||
content: '请点击右上角连接蓝牙控制,蓝牙连接需尽可能靠近车辆!',
|
||||
content: '蓝牙连接失败,请检查手机蓝牙是否打开或微信蓝牙是否授权,开启手机定位',
|
||||
showCancel: false,
|
||||
success: function(res) {
|
||||
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{
|
||||
uni.navigateTo({
|
||||
url: '/page_user/huanbike?sn=' + this.deivceobj.deviceSn + '&orderid=' + this.deivceobj.orderId + '&deviceid=' + this.deviceid + '&devicename=' + this.devicename
|
||||
|
|
@ -1200,16 +1354,41 @@
|
|||
btnhc() {
|
||||
if (this.orderAreaReturnVerify == true) {
|
||||
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
|
||||
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{
|
||||
let that = this
|
||||
that.ver_dataflag = 1
|
||||
that.shibainum = 0
|
||||
uni.hideLoading()
|
||||
uni.showModal({
|
||||
title: '提示',
|
||||
content: '请点击右上角连接蓝牙还车,蓝牙连接需尽可能靠近车辆!',
|
||||
content: '蓝牙连接失败,请检查手机蓝牙是否打开或微信蓝牙是否授权,开启手机定位',
|
||||
showCancel: false,
|
||||
success: function(res) {
|
||||
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{
|
||||
let flag = true
|
||||
uni.navigateTo({
|
||||
|
|
@ -1299,7 +1503,6 @@
|
|||
},
|
||||
// 还车统一调用
|
||||
gethuan() {
|
||||
if(this.ver_dataflag != 3){
|
||||
let that = this
|
||||
uni.showModal({
|
||||
title: '提示',
|
||||
|
|
@ -1333,43 +1536,8 @@
|
|||
url:'/page_user/yongche/orderxq?id=' + that.deivceobj.orderId
|
||||
})
|
||||
},1000)
|
||||
}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) {
|
||||
|
||||
}
|
||||
}
|
||||
})
|
||||
}
|
||||
})
|
||||
}
|
||||
}
|
||||
})
|
||||
}else{
|
||||
let that = this
|
||||
uni.showModal({
|
||||
title: '提示',
|
||||
content: '您确定要还车吗?',
|
||||
showCancel: true,
|
||||
success: function(res) {
|
||||
if (res.confirm) {
|
||||
uni.showLoading({
|
||||
title: '还车中...',
|
||||
mask: true
|
||||
})
|
||||
}else if(res.code == 20001){
|
||||
if(that.ver_dataflag == 3){
|
||||
xBlufi.notifySendCustomData({
|
||||
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{
|
||||
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() {
|
||||
|
|
|
|||
File diff suppressed because it is too large
Load Diff
Loading…
Reference in New Issue
Block a user