小鹿骑行

This commit is contained in:
吴鹏 2025-06-25 17:07:51 +08:00
parent b0d8e74c40
commit 9b9e24e65c
10 changed files with 1207 additions and 816 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.19: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

@ -1272,7 +1272,7 @@ function init() {
if (isnotexist) { if (isnotexist) {
devicesList.push(devices.devices[0]); devicesList.push(devices.devices[0]);
console.log("devicesList",devicesList); // console.log("devicesList",devicesList);
// let obj = { // let obj = {
// 'type': mDeviceEvent.XBLUFI_TYPE.TYPE_GET_DEVICE_LISTS, // 'type': mDeviceEvent.XBLUFI_TYPE.TYPE_GET_DEVICE_LISTS,
// 'result': true, // 'result': true,
@ -1295,7 +1295,7 @@ function init() {
if (isnotexist) { if (isnotexist) {
devicesList.push(devices[0]); devicesList.push(devices[0]);
console.log("devicesList",devicesList); // console.log("devicesList",devicesList);
// let obj = { // let obj = {
// 'type': mDeviceEvent.XBLUFI_TYPE.TYPE_GET_DEVICE_LISTS, // 'type': mDeviceEvent.XBLUFI_TYPE.TYPE_GET_DEVICE_LISTS,
// 'result': true, // 'result': true,

View File

@ -176,7 +176,7 @@ function listenSendRouterSsidAndPassword(isSetListener, funtion) {
function notifySendCustomData(options) { function notifySendCustomData(options) {
console.log("设备数据",options) // console.log("设备数据",options)
mOnFire.fire(OnFireEvent.EVENT_NOFITY_SEND_CUSTON_DATA, options); mOnFire.fire(OnFireEvent.EVENT_NOFITY_SEND_CUSTON_DATA, options);
} }
/** /**

View File

@ -507,6 +507,10 @@
}, },
onLoad(option) { onLoad(option) {
xBlufi.initXBlufi(1) xBlufi.initXBlufi(1)
xBlufi.notifyStartDiscoverBle({
'isStart': true
})
xBlufi.listenDeviceMsgEvent(true, this.funListenDeviceMsgEvent)
this.$u.get("/app/orderDevice/mineUsing").then((res) => { this.$u.get("/app/orderDevice/mineUsing").then((res) => {
if (res.code == 200) { if (res.code == 200) {
if (res.data) { if (res.data) {
@ -677,15 +681,21 @@
},1500) },1500)
}, },
onShow() { onShow() {
xBlufi.notifyConnectBle({
isStart: false, },
deviceId: this.deviceId, onHide() {
name: this.name
})
xBlufi.notifyStartDiscoverBle({ xBlufi.notifyStartDiscoverBle({
'isStart': true 'isStart': false
}) })
xBlufi.listenDeviceMsgEvent(true, this.funListenDeviceMsgEvent) xBlufi.listenDeviceMsgEvent(false, this.funListenDeviceMsgEvent)
console.log('likai00');
},
onUnload() {
xBlufi.notifyStartDiscoverBle({
'isStart': false
})
xBlufi.listenDeviceMsgEvent(false, this.funListenDeviceMsgEvent)
console.log('likai11');
}, },
methods: { methods: {
getQiniuToken() { getQiniuToken() {
@ -879,7 +889,7 @@
// 线 // 线
findDevice() { findDevice() {
// 使 find // 使 find
console.log(this.devicesarr); // console.log(this.devicesarr);
const matchedDevice = this.devicesarr.find(device => { const matchedDevice = this.devicesarr.find(device => {
// console.log(device.name, this.mac, '111') // console.log(device.name, this.mac, '111')
return device.name.slice(-12) == this.mac.slice(-12) return device.name.slice(-12) == this.mac.slice(-12)

File diff suppressed because it is too large Load Diff

View File

@ -47,6 +47,7 @@
</template> </template>
<script> <script>
var xBlufi = require("@/components/blufi/xBlufi.js")
export default { export default {
data() { data() {
return { return {
@ -145,63 +146,95 @@
}) })
}, },
gethc(){ gethc(){
let data = { if(this.flag == true){
orderId:this.orderId, let data = {
picture:this.videoUrl, orderId:this.orderId,
lon:this.lon, picture:this.videoUrl,
lat:this.lat, lon:this.lon,
requiredIot: this.flag lat:this.lat,
} requiredIot: this.flag
this.$u.put(`/app/order/end`,data).then(res =>{ }
if (res.code == 200) { this.$u.put(`/app/order/end`,data).then(res =>{
if(res.data.iot == true){ if (res.code == 200) {
this.fjflag = false this.fjflag = false
uni.hideLoading()
uni.showToast({
title: '还车成功',
icon: 'success',
duration: 2000
})
setTimeout(()=>{
uni.redirectTo({
url:'/page_user/yongche/orderxq?id=' + this.orderId
})
},1000)
}else if(res.msg == null) {
uni.hideLoading() uni.hideLoading()
uni.showToast({ uni.showToast({
title: '还车成功', title: '未知错误',
icon: 'success', icon: 'none',
duration: 2000 duration: 2000
}) })
setTimeout(()=>{ } else {
uni.redirectTo({ uni.hideLoading()
url:'/page_user/yongche/orderxq?id=' + this.orderId uni.showToast({
}) title: res.msg,
},1000) icon: 'none',
}else{ duration: 2000
xBlufi.notifySendCustomData({
customData: "11closesub300@"
})
let data = {
mac:this.mac,
reason:'还车',
command:'11closesub300@',
longitude:this.lon,
latitude:this.lat,
result:'成功'
}
this.$u.post(`/app/commandLog/bluetooth`,data).then(res => {
console.log(res,'蓝牙')
})
xBlufi.notifySendCustomData({
customData: "11reboot@"
}) })
} }
}else if(res.msg == null) { })
uni.hideLoading() }else{
uni.showToast({ xBlufi.notifySendCustomData({
title: '未知错误', customData: "11closesub300@"
icon: 'none', })
duration: 2000 let data = {
}) orderId:this.orderId,
} else { picture:this.videoUrl,
uni.hideLoading() lon:this.lon,
uni.showToast({ lat:this.lat,
title: res.msg, requiredIot: this.flag
icon: 'none',
duration: 2000
})
} }
}) 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:'还车',
command:'11closesub300@',
longitude:this.lon,
latitude:this.lat,
result:'成功'
}
this.$u.post(`/app/commandLog/bluetooth`,data).then(res => {
console.log(res,'蓝牙')
})
xBlufi.notifySendCustomData({
customData: "11reboot@"
})
}else if(res.msg == null) {
uni.hideLoading()
uni.showToast({
title: '未知错误',
icon: 'none',
duration: 2000
})
} else {
uni.hideLoading()
uni.showToast({
title: res.msg,
icon: 'none',
duration: 2000
})
}
})
}
}, },
getisInOrder() { getisInOrder() {

View File

@ -258,7 +258,9 @@ export default {
deviceId: this.deviceid, deviceId: this.deviceid,
name: this.devicename name: this.devicename
}) })
uni.navigateBack() uni.reLaunch({
url:'/pages/myorder/returned/index'
})
},1000) },1000)
}else{ }else{
uni.hideLoading() uni.hideLoading()

View File

@ -227,10 +227,16 @@
<text v-if="selectedCoupon">{{selectedCoupon.name.length > 4 ? selectedCoupon.name.slice(0,4) + '...' : selectedCoupon.name}}(优惠{{youhuiobj.discountAmount}})</text> <text v-if="selectedCoupon">{{selectedCoupon.name.length > 4 ? selectedCoupon.name.slice(0,4) + '...' : selectedCoupon.name}}(优惠{{youhuiobj.discountAmount}})</text>
</view> </view>
<view class="kefu" @click="getyajin" v-if="info.suitDepositDeduction && info.isCredit == false"> <view class="kefu" @click="getyajin" v-if="info.suitDepositDeduction && info.isCredit == false">
押金抵扣<text style="font-weight: 400;">({{info.totalFee}})</text> 押金抵扣<text style="font-weight: 400;"></text>
<text class="xiao">
抵扣完成剩余押金返回账户
</text>
</view> </view>
<view class="kefu" @click="getzhifu"> <view class="kefu" @click="getzhifu">
{{channelobj[0].name}}<text style="font-weight: 400;">({{info.totalFee}})</text> {{channelobj[0].name}}<text style="font-weight: 400;">({{info.totalFee}})</text>
<text class="xiao">
支付完成全部押金返回账户
</text>
</view> </view>
</view> </view>
</view> </view>
@ -288,7 +294,10 @@
</view> </view>
</view> </view>
<view class="mask" v-if="kefuflag"></view> <view class="mask" v-if="kefuflag"></view>
<image class="kfren" @click="btntel" src="https://api.ccttiot.com/smartmeter/img/static/uJd9ccJt76zc7r2Nlpb8" mode=""></image> <view class="kfrens">
<image class="kfren" @click="btntel" src="https://api.ccttiot.com/smartmeter/img/static/uJd9ccJt76zc7r2Nlpb8" mode=""></image>
联系客服
</view>
</view> </view>
</template> </template>
@ -885,17 +894,25 @@
} }
} }
} }
.kfren{ .kfrens{
position: fixed; position: fixed;
right: 30rpx; right: 30rpx;
top: 40%; top: 40%;
z-index: 99; z-index: 99;
width: 80rpx; width: 140rpx;
height: 80rpx; height: 140rpx;
border-radius: 50%; .kfren{
box-shadow: 0 0 20rpx rgba(124, 124, 124, 0.3); width: 80rpx;
-webkit-box-shadow: 0 0 20rpx #7C7C7C; height: 80rpx;
-moz-box-shadow: 0 0 20rpx #7C7C7C; display: block;
box-shadow: 0 0 20rpx rgba(124, 124, 124, 0.3);
-webkit-box-shadow: 0 0 20rpx #7C7C7C;
-moz-box-shadow: 0 0 20rpx #7C7C7C;
border-radius: 50%;
margin: auto;
margin-bottom: 20rpx;
}
text-align: center;
} }
.kefutc{ .kefutc{
animation: fadeIn 0.5s ease-in-out forwards; animation: fadeIn 0.5s ease-in-out forwards;
@ -974,17 +991,17 @@
border-radius: 0rpx 0rpx 0rpx 0rpx; border-radius: 0rpx 0rpx 0rpx 0rpx;
padding-bottom: 250rpx; padding-bottom: 250rpx;
box-sizing: border-box; box-sizing: border-box;
.kefu{ // .kefu{
width: 48%; // width: 48%;
height: 100rpx; // height: 100rpx;
line-height: 100rpx; // line-height: 100rpx;
background-color: #4C97E7; // background-color: #4C97E7;
color: #fff; // color: #fff;
font-size: 36rpx; // font-size: 36rpx;
font-weight: 600; // font-weight: 600;
text-align: center; // text-align: center;
border-radius: 20rpx; // border-radius: 20rpx;
} // }
.qixing{ .qixing{
width: 702rpx; width: 702rpx;
height: 466rpx; height: 466rpx;
@ -1130,13 +1147,19 @@
.kefu { .kefu {
width: 100%; width: 100%;
height: 100rpx; height: 100rpx;
line-height: 100rpx;
background-color: #4C97E7; background-color: #4C97E7;
color: #fff; color: #fff;
font-size: 36rpx; font-size: 36rpx;
font-weight: 600; font-weight: 600;
text-align: center; text-align: center;
border-radius: 20rpx; border-radius: 20rpx;
padding-top: 10rpx;
box-sizing: border-box;
.xiao{
font-size: 20rpx;
color: #efefef;
display: block;
}
} }
} }
.coupon-popup { .coupon-popup {

View File

@ -278,6 +278,31 @@
this.getorderdevice() this.getorderdevice()
}, },
methods: { methods: {
//
getzhifu(){
this.$u.get("/app/order/unpaid").then((res) => {
if (res.code == 200) {
if(res.data){
let id = res.data.id
uni.showModal({
title: '提示',
content: '您当前还有未支付订单,是否前去支付?',
showCancel: true,
success: function (res) {
if (res.confirm) {
uni.navigateTo({
url:'/page_user/yongche/orderxq?id=' + id
})
} else if (res.cancel) {
console.log('取消'); //
}
}
})
}
}
})
},
// //
btntz() { btntz() {
uni.switchTab({ uni.switchTab({
@ -608,6 +633,7 @@
getinfo(){ getinfo(){
this.$u.get("/getInfo").then(res => { this.$u.get("/getInfo").then(res => {
if(res.code == 200){ if(res.code == 200){
this.getzhifu()
this.info = res.user this.info = res.user
this.getMyLocation() this.getMyLocation()
this.getgonggao() this.getgonggao()

View File

@ -87,7 +87,7 @@
<image src="https://api.ccttiot.com/smartmeter/img/static/uTgSwUguPEJ56MSeZo4c" mode=""></image> <image src="https://api.ccttiot.com/smartmeter/img/static/uTgSwUguPEJ56MSeZo4c" mode=""></image>
<view class="zuqi"> <view class="zuqi">
<view class="one"> <view class="one">
您已骑行<text>{{getRemainingTimeText}}</text> 您已骑行<text>{{getRemainingTimeText == '-1分钟' ? '1分钟' : getRemainingTimeText}}</text>
</view> </view>
<view class="two"> <view class="two">
预计金额{{qixingobj.rideFee}} 预计金额{{qixingobj.rideFee}}
@ -255,22 +255,26 @@
} }
console.log(option); console.log(option);
if(option.vate){ if(option.vate){
this.ver_dataflag = 3 // this.ver_dataflag = 3
this.devicesarr = option.vate // this.devicesarr = option.vate
setTimeout(()=>{
this.ver_dataflag = 1
},1000)
} }
}, },
onShow() { onShow() {
setTimeout(()=>{ setTimeout(()=>{
if(this.ver_dataflag == 3){ xBlufi.initXBlufi(1)
xBlufi.notifyStartDiscoverBle({
'isStart': true
})
xBlufi.listenDeviceMsgEvent(true, this.funListenDeviceMsgEvent)
if(this.devicesarr.length > 0){
// console.log('11') // console.log('11')
}else{ }else{
xBlufi.initXBlufi(1)
xBlufi.notifyStartDiscoverBle({
'isStart': true
})
} }
},500) },500)
xBlufi.listenDeviceMsgEvent(true, this.funListenDeviceMsgEvent)
setTimeout(() => { setTimeout(() => {
this.getorderdevice() this.getorderdevice()
}, 100) }, 100)
@ -282,6 +286,11 @@
}, 30000) }, 30000)
}, },
onHide() { onHide() {
xBlufi.notifyStartDiscoverBle({
'isStart': false
})
xBlufi.listenDeviceMsgEvent(false, this.funListenDeviceMsgEvent)
console.log('likai00');
// //
this.clearTimer(); this.clearTimer();
if (this.findDeviceTimer) { if (this.findDeviceTimer) {
@ -291,6 +300,11 @@
} }
}, },
onUnload() { onUnload() {
xBlufi.notifyStartDiscoverBle({
'isStart': false
})
xBlufi.listenDeviceMsgEvent(false, this.funListenDeviceMsgEvent)
console.log('likai00');
// //
this.clearTimer(); this.clearTimer();
if (this.findDeviceTimer) { if (this.findDeviceTimer) {
@ -319,6 +333,7 @@
name: that.name name: that.name
}) })
that.ver_dataflag = 1 that.ver_dataflag = 1
xBlufi.listenDeviceMsgEvent(false, that.funListenDeviceMsgEvent)
} else if (res.cancel) { } else if (res.cancel) {
} }
@ -589,8 +604,8 @@
console.log("连接回调:" + JSON.stringify(options)) console.log("连接回调:" + JSON.stringify(options))
if (options.result == true) { if (options.result == true) {
setTimeout(() => { setTimeout(() => {
this.ver_dataflag = 3
this.ljflag = true this.ljflag = true
this.ver_dataflag = 3
}, 2000) }, 2000)
xBlufi.notifyInitBleEsp32({ xBlufi.notifyInitBleEsp32({
deviceId: this.deviceid deviceId: this.deviceid
@ -795,86 +810,28 @@
this.lslat = null this.lslat = null
} }
}) })
let that = this if(this.ver_dataflag != 3){
uni.showModal({ let that = this
title: '提示', uni.showModal({
content: '您是否要解锁车辆?', title: '提示',
showCancel: true, content: '您是否要解锁车辆?',
success: function(res) { showCancel: true,
if (res.confirm) { success: function(res) {
uni.showLoading({ if (res.confirm) {
title: '加载中...', uni.showLoading({
mask: true title: '加载中...',
}) mask: true
let flag = '' })
if(that.ver_dataflag == 3){ let query = {
flag = false orderId: that.deivceobj.orderId,
}else{ lat: that.lslat,
flag = true lon: that.lslon,
} requiredIot: true
let query = { }
orderId: that.deivceobj.orderId,
lat: that.lslat, let url = '/app/order/openDevice?' + that.$tansParams(query)
lon: that.lslon, that.$u.put(url).then((res) => {
requiredIot: flag if (res.code == 200) {
}
let url = '/app/order/openDevice?' + that.$tansParams(query)
that.$u.put(url).then((res) => {
console.log(res,'0202020202');
if (res.code == 200 && res.data.db >= 1) {
if (res.data.iot == false) {
uni.showLoading({
title: '加载中...',
mask: true
})
console.log(that.lslat,that.lslon,'临时解锁');
console.log(that.ver_dataflag,'thatthat');
if (that.ver_dataflag == 3) {
xBlufi.notifySendCustomData({
customData: "11opensub5@"
})
that.deivceobj.deviceLockStatus = 1
let data = {
mac:that.mac,
reason:'解锁',
command:'11opensub5@',
longitude:that.lslon,
latitude:that.lslat,
result:'成功'
}
that.$u.post(`/app/commandLog/bluetooth`,data).then(res => {})
setTimeout(()=>{
uni.hideLoading()
},2000)
} else {
uni.hideLoading()
let that = this
uni.showModal({
title: '提示',
content: '请点击右上角连接蓝牙控制,蓝牙连接需尽可能靠近车辆!',
showCancel: false,
success: function(res) {
if (res.confirm) {
} else if (res.cancel) {
}
}
})
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 {
uni.showToast({ uni.showToast({
title: '解锁成功', title: '解锁成功',
icon: 'success', icon: 'success',
@ -882,10 +839,8 @@
}) })
that.deivceobj.deviceLockStatus = 1 that.deivceobj.deviceLockStatus = 1
that.getorderdevice() that.getorderdevice()
} } else if(res.code == 20001){
} else if(res.code == 20001){ uni.hideLoading()
uni.hideLoading()
if(that.ver_dataflag != 3){
uni.showModal({ uni.showModal({
title: '提示', title: '提示',
content: '设备离线,请点击右上角连接车辆', content: '设备离线,请点击右上角连接车辆',
@ -893,26 +848,88 @@
success: function(res) { success: function(res) {
if (res.confirm) { if (res.confirm) {
} else if (res.cancel) {
} }
} }
}) })
} else {
uni.hideLoading()
uni.showToast({
title: res.msg,
icon: 'none',
duration: 2000
})
} }
} 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) {
xBlufi.notifySendCustomData({
customData: "11opensub5@"
})
uni.showLoading({
title: '加载中...',
mask: true
})
let query = {
orderId: that.deivceobj.orderId,
lat: that.lslat,
lon: that.lslon,
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){
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) {
}
}
})
}
} else if (this.deivceobj.deviceLockStatus == 1) { } else if (this.deivceobj.deviceLockStatus == 1) {
uni.getLocation({ uni.getLocation({
type: 'gcj02', // type: 'gcj02', //
@ -929,33 +946,82 @@
console.error('获取位置失败:', err) console.error('获取位置失败:', err)
} }
}) })
let that = this if(this.ver_dataflag != 3){
let flag = '' let that = this
if(that.ver_dataflag == 3){ uni.showModal({
flag = false title: '提示',
}else{ content: '您是否要临时锁车?',
flag = true showCancel: true,
} success: function(res) {
uni.showModal({ if (res.confirm) {
title: '提示', uni.showLoading({
content: '您是否要临时锁车?', title: '加载中...',
showCancel: true, mask: true
success: function(res) { })
if (res.confirm) { let query = {
uni.showLoading({ orderId: that.deivceobj.orderId,
title: '加载中...', lat: that.lat,
mask: true lon: that.lon,
}) requiredIot: true
let query = { }
orderId: that.deivceobj.orderId, let url = '/app/order/closeDevice?' + that.$tansParams(query)
lat: that.lat, that.$u.put(url).then((res) => {
lon: that.lon, if (res.code == 200) {
requiredIot: flag uni.hideLoading()
uni.showToast({
title: '临时锁车成功',
icon: 'success',
duration: 2000
})
that.deivceobj.deviceLockStatus = 0
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('取消') //
} }
let url = '/app/order/closeDevice?' + that.$tansParams(query) }
that.$u.put(url).then((res) => { })
if (res.code == 200 && res.data.db >= 1) { }else{
if(res.data.iot == false){ let that = this
uni.showModal({
title: '提示',
content: '您是否要临时锁车?',
showCancel: true,
success: function(res) {
if (res.confirm) {
uni.showLoading({
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({ uni.showLoading({
title: '加载中...', title: '加载中...',
mask: true mask: true
@ -992,8 +1058,6 @@
success: function(res) { success: function(res) {
if (res.confirm) { if (res.confirm) {
} else if (res.cancel) {
} }
} }
}) })
@ -1009,19 +1073,8 @@
console.log(res,'蓝牙') console.log(res,'蓝牙')
}) })
} }
}else{ } else if(res.code == 20001){
uni.hideLoading() uni.hideLoading()
uni.showToast({
title: '临时锁车成功',
icon: 'success',
duration: 2000
})
that.deivceobj.deviceLockStatus = 0
that.getorderdevice()
}
} else if(res.code == 20001){
uni.hideLoading()
if(that.ver_dataflag != 3){
uni.showModal({ uni.showModal({
title: '提示', title: '提示',
content: '设备离线,请点击右上角连接车辆', content: '设备离线,请点击右上角连接车辆',
@ -1029,26 +1082,24 @@
success: function(res) { success: function(res) {
if (res.confirm) { if (res.confirm) {
} else if (res.cancel) {
} }
} }
}) })
} else {
uni.hideLoading()
uni.showToast({
title: res.msg,
icon: 'none',
duration: 2000
})
} }
} else { })
uni.hideLoading() } else if (res.cancel) {
uni.showToast({ console.log('取消') //
title: res.msg, }
icon: 'none',
duration: 2000
})
}
})
} else if (res.cancel) {
console.log('取消') //
} }
} })
}) }
} }
}, },
// //
@ -1248,117 +1299,7 @@
}, },
// //
gethuan() { gethuan() {
if(this.deivceobj.deviceOnlineStatus == 0){ if(this.ver_dataflag != 3){
if(this.ver_dataflag != 3){
uni.showModal({
title: '提示',
content: '请点击右上角连接蓝牙控制,蓝牙连接需尽可能靠近车辆!',
showCancel: false,
success: function(res) {
if (res.confirm) {
} else if (res.cancel) {
}
}
})
}else{
let that = this
let flag = ''
if(that.ver_dataflag == 3){
flag = false
}else{
flag = true
}
uni.showModal({
title: '提示',
content: '您确定要还车吗?',
showCancel: true,
success: function(res) {
if (res.confirm) {
uni.showLoading({
title: '还车中...',
mask: true
})
let data = {
orderId: that.deivceobj.orderId,
picture: that.imgs,
lon: that.lon,
lat: that.lat,
requiredIot: flag
}
that.$u.put(`/app/order/end`, data).then(res => {
if (res.code == 200) {
if(res.data.iot == true){
that.cheflag = true
that.fjflag = false
uni.hideLoading()
uni.showToast({
title: '还车成功',
icon: 'success',
duration: 2000
})
setTimeout(()=>{
uni.navigateTo({
url:'/page_user/yongche/orderxq?id=' + that.deivceobj.orderId
})
},1000)
}else{
xBlufi.notifySendCustomData({
customData: "11closesub300@"
})
let data = {
mac:that.mac,
reason:'还车',
command:'11closesub300@',
longitude:that.lon,
latitude:that.lat,
result:'成功'
}
that.$u.post(`/app/commandLog/bluetooth`,data).then(res => {
console.log(res,'蓝牙')
})
xBlufi.notifySendCustomData({
customData: "11reboot@"
})
setTimeout(()=>{
uni.hideLoading()
xBlufi.notifyConnectBle({
isStart: false,
deviceId: that.deviceId,
name: that.name
})
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.showToast({
title: res.msg,
icon: 'none',
duration: 2000
})
}
})
} else if (res.cancel) {
}
}
})
}
}else{
let that = this let that = this
uni.showModal({ uni.showModal({
title: '提示', title: '提示',
@ -1374,46 +1315,86 @@
orderId: that.deivceobj.orderId, orderId: that.deivceobj.orderId,
picture: that.imgs, picture: that.imgs,
lon: that.lon, lon: that.lon,
lat: that.lat lat: that.lat,
requiredIot: true
} }
that.$u.put(`/app/order/end`, data).then(res => { that.$u.put(`/app/order/end`, data).then(res => {
if (res.code == 200) { if (res.code == 200) {
if(res.data.iot == true){ that.cheflag = true
that.cheflag = true that.fjflag = false
that.fjflag = false uni.hideLoading()
uni.showToast({
title: '还车成功',
icon: 'success',
duration: 2000
})
setTimeout(()=>{
uni.navigateTo({
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
})
xBlufi.notifySendCustomData({
customData: "11llosesub300@"
})
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() uni.hideLoading()
uni.showToast({ that.getorderdevice()
title: '还车成功',
icon: 'success',
duration: 2000
})
xBlufi.notifyConnectBle({
isStart: false,
deviceId: that.deviceId,
name: that.name
})
setTimeout(()=>{ setTimeout(()=>{
uni.navigateTo({ uni.navigateTo({
url:'/page_user/yongche/orderxq?id=' + that.deivceobj.orderId url:'/page_user/yongche/orderxq?id=' + that.deivceobj.orderId
}) })
},1000) },1000)
}else{ },1000)
xBlufi.notifySendCustomData({
customData: "11llosesub300@"
})
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) { }else if(res.msg == null) {
uni.hideLoading() uni.hideLoading()
uni.showToast({ uni.showToast({
@ -1423,10 +1404,17 @@
}) })
} else { } else {
uni.hideLoading() uni.hideLoading()
uni.showToast({ uni.showModal({
title: res.msg, title: '提示',
icon: 'none', content: res.msg,
duration: 2000 showCancel: false,
success: function(res) {
if (res.confirm) {
} else if (res.cancel) {
}
}
}) })
} }
}) })