电动车
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,35 +1194,125 @@
|
|||
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) {
|
||||
this.deviceInfo()
|
||||
uni.showToast({
|
||||
title: '操作成功',
|
||||
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) {
|
||||
|
||||
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({
|
||||
title: '操作成功',
|
||||
icon: 'success',
|
||||
duration: 3000
|
||||
})
|
||||
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({
|
||||
title: res.msg,
|
||||
icon: 'none',
|
||||
duration: 2000
|
||||
})
|
||||
|
||||
this.jieliuflag = true
|
||||
|
||||
}
|
||||
})
|
||||
}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({
|
||||
|
@ -1219,20 +1320,25 @@
|
|||
icon: 'none',
|
||||
duration: 2000
|
||||
})
|
||||
setTimeout(() => {
|
||||
|
||||
this.jieliuflag = true
|
||||
}, 2000)
|
||||
|
||||
}
|
||||
})
|
||||
}
|
||||
} 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()
|
||||
|
@ -1244,38 +1350,21 @@
|
|||
let data = {
|
||||
mac:this.mac,
|
||||
reason:'商户关锁',
|
||||
command:'11',
|
||||
command:'11closesub200@',
|
||||
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){
|
||||
uni.hideLoading()
|
||||
uni.showModal({
|
||||
title: '提示',
|
||||
content: '设备离线,请进行连接蓝牙关锁',
|
||||
showCancel: false,
|
||||
success: function(res) {
|
||||
if (res.confirm) {
|
||||
|
||||
}
|
||||
}
|
||||
})
|
||||
} else{
|
||||
}else{
|
||||
uni.hideLoading()
|
||||
uni.showToast({
|
||||
title: res.msg,
|
||||
icon: 'none',
|
||||
duration: 2000
|
||||
})
|
||||
setTimeout(() => {
|
||||
|
||||
this.jieliuflag = true
|
||||
}, 2000)
|
||||
|
||||
}
|
||||
})
|
||||
} else {
|
||||
|
@ -1287,9 +1376,112 @@
|
|||
icon: 'success',
|
||||
duration: 3000
|
||||
})
|
||||
setTimeout(() => {
|
||||
|
||||
this.jieliuflag = true
|
||||
}, 2000)
|
||||
|
||||
}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@"
|
||||
})
|
||||
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@',
|
||||
longitude:this.lon,
|
||||
latitude:this.lat,
|
||||
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.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({
|
||||
|
@ -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,'蓝牙')
|
||||
})
|
||||
xBlufi.notifySendCustomData({
|
||||
customData: "11reboot@"
|
||||
})
|
||||
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> -->
|
||||
<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({
|
||||
|
|
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
Loading…
Reference in New Issue
Block a user