小鹿骑行
This commit is contained in:
parent
b0d8e74c40
commit
9b9e24e65c
|
@ -1272,7 +1272,7 @@ function init() {
|
|||
|
||||
if (isnotexist) {
|
||||
devicesList.push(devices.devices[0]);
|
||||
console.log("devicesList",devicesList);
|
||||
// console.log("devicesList",devicesList);
|
||||
// let obj = {
|
||||
// 'type': mDeviceEvent.XBLUFI_TYPE.TYPE_GET_DEVICE_LISTS,
|
||||
// 'result': true,
|
||||
|
@ -1295,7 +1295,7 @@ function init() {
|
|||
|
||||
if (isnotexist) {
|
||||
devicesList.push(devices[0]);
|
||||
console.log("devicesList",devicesList);
|
||||
// console.log("devicesList",devicesList);
|
||||
// let obj = {
|
||||
// 'type': mDeviceEvent.XBLUFI_TYPE.TYPE_GET_DEVICE_LISTS,
|
||||
// 'result': true,
|
||||
|
|
|
@ -176,7 +176,7 @@ function listenSendRouterSsidAndPassword(isSetListener, funtion) {
|
|||
|
||||
|
||||
function notifySendCustomData(options) {
|
||||
console.log("设备数据",options)
|
||||
// console.log("设备数据",options)
|
||||
mOnFire.fire(OnFireEvent.EVENT_NOFITY_SEND_CUSTON_DATA, options);
|
||||
}
|
||||
/**
|
||||
|
|
|
@ -507,6 +507,10 @@
|
|||
},
|
||||
onLoad(option) {
|
||||
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) {
|
||||
|
@ -677,15 +681,21 @@
|
|||
},1500)
|
||||
},
|
||||
onShow() {
|
||||
xBlufi.notifyConnectBle({
|
||||
isStart: false,
|
||||
deviceId: this.deviceId,
|
||||
name: this.name
|
||||
})
|
||||
|
||||
},
|
||||
onHide() {
|
||||
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: {
|
||||
getQiniuToken() {
|
||||
|
@ -879,7 +889,7 @@
|
|||
// 判断离线连接蓝牙
|
||||
findDevice() {
|
||||
// 使用 find 方法查找匹配的设备
|
||||
console.log(this.devicesarr);
|
||||
// console.log(this.devicesarr);
|
||||
const matchedDevice = this.devicesarr.find(device => {
|
||||
// console.log(device.name, this.mac, '111')
|
||||
return device.name.slice(-12) == this.mac.slice(-12)
|
||||
|
|
File diff suppressed because it is too large
Load Diff
|
@ -47,6 +47,7 @@
|
|||
</template>
|
||||
|
||||
<script>
|
||||
var xBlufi = require("@/components/blufi/xBlufi.js")
|
||||
export default {
|
||||
data() {
|
||||
return {
|
||||
|
@ -145,6 +146,7 @@
|
|||
})
|
||||
},
|
||||
gethc(){
|
||||
if(this.flag == true){
|
||||
let data = {
|
||||
orderId:this.orderId,
|
||||
picture:this.videoUrl,
|
||||
|
@ -154,7 +156,6 @@
|
|||
}
|
||||
this.$u.put(`/app/order/end`,data).then(res =>{
|
||||
if (res.code == 200) {
|
||||
if(res.data.iot == true){
|
||||
this.fjflag = false
|
||||
uni.hideLoading()
|
||||
uni.showToast({
|
||||
|
@ -167,25 +168,6 @@
|
|||
url:'/page_user/yongche/orderxq?id=' + this.orderId
|
||||
})
|
||||
},1000)
|
||||
}else{
|
||||
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()
|
||||
uni.showToast({
|
||||
|
@ -202,6 +184,57 @@
|
|||
})
|
||||
}
|
||||
})
|
||||
}else{
|
||||
xBlufi.notifySendCustomData({
|
||||
customData: "11closesub300@"
|
||||
})
|
||||
let data = {
|
||||
orderId:this.orderId,
|
||||
picture:this.videoUrl,
|
||||
lon:this.lon,
|
||||
lat:this.lat,
|
||||
requiredIot: this.flag
|
||||
}
|
||||
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() {
|
||||
|
|
|
@ -258,7 +258,9 @@ export default {
|
|||
deviceId: this.deviceid,
|
||||
name: this.devicename
|
||||
})
|
||||
uni.navigateBack()
|
||||
uni.reLaunch({
|
||||
url:'/pages/myorder/returned/index'
|
||||
})
|
||||
},1000)
|
||||
}else{
|
||||
uni.hideLoading()
|
||||
|
|
|
@ -227,10 +227,16 @@
|
|||
<text v-if="selectedCoupon">{{selectedCoupon.name.length > 4 ? selectedCoupon.name.slice(0,4) + '...' : selectedCoupon.name}}(优惠¥{{youhuiobj.discountAmount}})</text>
|
||||
</view>
|
||||
<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 class="kefu" @click="getzhifu">
|
||||
{{channelobj[0].name}}<text style="font-weight: 400;">(¥{{info.totalFee}})</text>
|
||||
<text class="xiao">
|
||||
支付完成,全部押金返回账户
|
||||
</text>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
|
@ -288,7 +294,10 @@
|
|||
</view>
|
||||
</view>
|
||||
<view class="mask" v-if="kefuflag"></view>
|
||||
<view class="kfrens">
|
||||
<image class="kfren" @click="btntel" src="https://api.ccttiot.com/smartmeter/img/static/uJd9ccJt76zc7r2Nlpb8" mode=""></image>
|
||||
联系客服
|
||||
</view>
|
||||
</view>
|
||||
</template>
|
||||
|
||||
|
@ -885,17 +894,25 @@
|
|||
}
|
||||
}
|
||||
}
|
||||
.kfren{
|
||||
.kfrens{
|
||||
position: fixed;
|
||||
right: 30rpx;
|
||||
top: 40%;
|
||||
z-index: 99;
|
||||
width: 140rpx;
|
||||
height: 140rpx;
|
||||
.kfren{
|
||||
width: 80rpx;
|
||||
height: 80rpx;
|
||||
border-radius: 50%;
|
||||
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{
|
||||
animation: fadeIn 0.5s ease-in-out forwards;
|
||||
|
@ -974,17 +991,17 @@
|
|||
border-radius: 0rpx 0rpx 0rpx 0rpx;
|
||||
padding-bottom: 250rpx;
|
||||
box-sizing: border-box;
|
||||
.kefu{
|
||||
width: 48%;
|
||||
height: 100rpx;
|
||||
line-height: 100rpx;
|
||||
background-color: #4C97E7;
|
||||
color: #fff;
|
||||
font-size: 36rpx;
|
||||
font-weight: 600;
|
||||
text-align: center;
|
||||
border-radius: 20rpx;
|
||||
}
|
||||
// .kefu{
|
||||
// width: 48%;
|
||||
// height: 100rpx;
|
||||
// line-height: 100rpx;
|
||||
// background-color: #4C97E7;
|
||||
// color: #fff;
|
||||
// font-size: 36rpx;
|
||||
// font-weight: 600;
|
||||
// text-align: center;
|
||||
// border-radius: 20rpx;
|
||||
// }
|
||||
.qixing{
|
||||
width: 702rpx;
|
||||
height: 466rpx;
|
||||
|
@ -1130,13 +1147,19 @@
|
|||
.kefu {
|
||||
width: 100%;
|
||||
height: 100rpx;
|
||||
line-height: 100rpx;
|
||||
background-color: #4C97E7;
|
||||
color: #fff;
|
||||
font-size: 36rpx;
|
||||
font-weight: 600;
|
||||
text-align: center;
|
||||
border-radius: 20rpx;
|
||||
padding-top: 10rpx;
|
||||
box-sizing: border-box;
|
||||
.xiao{
|
||||
font-size: 20rpx;
|
||||
color: #efefef;
|
||||
display: block;
|
||||
}
|
||||
}
|
||||
}
|
||||
.coupon-popup {
|
||||
|
|
|
@ -278,6 +278,31 @@
|
|||
this.getorderdevice()
|
||||
},
|
||||
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() {
|
||||
uni.switchTab({
|
||||
|
@ -608,6 +633,7 @@
|
|||
getinfo(){
|
||||
this.$u.get("/getInfo").then(res => {
|
||||
if(res.code == 200){
|
||||
this.getzhifu()
|
||||
this.info = res.user
|
||||
this.getMyLocation()
|
||||
this.getgonggao()
|
||||
|
|
|
@ -87,7 +87,7 @@
|
|||
<image src="https://api.ccttiot.com/smartmeter/img/static/uTgSwUguPEJ56MSeZo4c" mode=""></image>
|
||||
<view class="zuqi">
|
||||
<view class="one">
|
||||
您已骑行<text>{{getRemainingTimeText}}</text>
|
||||
您已骑行<text>{{getRemainingTimeText == '-1分钟' ? '1分钟' : getRemainingTimeText}}</text>
|
||||
</view>
|
||||
<view class="two">
|
||||
预计金额¥{{qixingobj.rideFee}}
|
||||
|
@ -255,22 +255,26 @@
|
|||
}
|
||||
console.log(option);
|
||||
if(option.vate){
|
||||
this.ver_dataflag = 3
|
||||
this.devicesarr = option.vate
|
||||
// this.ver_dataflag = 3
|
||||
// this.devicesarr = option.vate
|
||||
setTimeout(()=>{
|
||||
this.ver_dataflag = 1
|
||||
},1000)
|
||||
}
|
||||
},
|
||||
onShow() {
|
||||
setTimeout(()=>{
|
||||
if(this.ver_dataflag == 3){
|
||||
// console.log('11')
|
||||
}else{
|
||||
xBlufi.initXBlufi(1)
|
||||
xBlufi.notifyStartDiscoverBle({
|
||||
'isStart': true
|
||||
})
|
||||
xBlufi.listenDeviceMsgEvent(true, this.funListenDeviceMsgEvent)
|
||||
if(this.devicesarr.length > 0){
|
||||
// console.log('11')
|
||||
}else{
|
||||
|
||||
}
|
||||
},500)
|
||||
xBlufi.listenDeviceMsgEvent(true, this.funListenDeviceMsgEvent)
|
||||
setTimeout(() => {
|
||||
this.getorderdevice()
|
||||
}, 100)
|
||||
|
@ -282,6 +286,11 @@
|
|||
}, 30000)
|
||||
},
|
||||
onHide() {
|
||||
xBlufi.notifyStartDiscoverBle({
|
||||
'isStart': false
|
||||
})
|
||||
xBlufi.listenDeviceMsgEvent(false, this.funListenDeviceMsgEvent)
|
||||
console.log('likai00');
|
||||
// 页面隐藏时清除定时器
|
||||
this.clearTimer();
|
||||
if (this.findDeviceTimer) {
|
||||
|
@ -291,6 +300,11 @@
|
|||
}
|
||||
},
|
||||
onUnload() {
|
||||
xBlufi.notifyStartDiscoverBle({
|
||||
'isStart': false
|
||||
})
|
||||
xBlufi.listenDeviceMsgEvent(false, this.funListenDeviceMsgEvent)
|
||||
console.log('likai00');
|
||||
// 页面卸载时清除定时器(防止内存泄漏)
|
||||
this.clearTimer();
|
||||
if (this.findDeviceTimer) {
|
||||
|
@ -319,6 +333,7 @@
|
|||
name: that.name
|
||||
})
|
||||
that.ver_dataflag = 1
|
||||
xBlufi.listenDeviceMsgEvent(false, that.funListenDeviceMsgEvent)
|
||||
} else if (res.cancel) {
|
||||
|
||||
}
|
||||
|
@ -589,8 +604,8 @@
|
|||
console.log("连接回调:" + JSON.stringify(options))
|
||||
if (options.result == true) {
|
||||
setTimeout(() => {
|
||||
this.ver_dataflag = 3
|
||||
this.ljflag = true
|
||||
this.ver_dataflag = 3
|
||||
}, 2000)
|
||||
xBlufi.notifyInitBleEsp32({
|
||||
deviceId: this.deviceid
|
||||
|
@ -795,6 +810,7 @@
|
|||
this.lslat = null
|
||||
}
|
||||
})
|
||||
if(this.ver_dataflag != 3){
|
||||
let that = this
|
||||
uni.showModal({
|
||||
title: '提示',
|
||||
|
@ -806,35 +822,78 @@
|
|||
title: '加载中...',
|
||||
mask: true
|
||||
})
|
||||
let flag = ''
|
||||
if(that.ver_dataflag == 3){
|
||||
flag = false
|
||||
}else{
|
||||
flag = true
|
||||
}
|
||||
let query = {
|
||||
orderId: that.deivceobj.orderId,
|
||||
lat: that.lslat,
|
||||
lon: that.lslon,
|
||||
requiredIot: flag
|
||||
requiredIot: true
|
||||
}
|
||||
|
||||
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) {
|
||||
if (res.code == 200) {
|
||||
uni.showToast({
|
||||
title: '解锁成功',
|
||||
icon: 'success',
|
||||
duration: 2000
|
||||
})
|
||||
that.deivceobj.deviceLockStatus = 1
|
||||
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{
|
||||
let that = this
|
||||
uni.showModal({
|
||||
title: '提示',
|
||||
content: '您是否要解锁车辆?',
|
||||
showCancel: true,
|
||||
success: function(res) {
|
||||
if (res.confirm) {
|
||||
xBlufi.notifySendCustomData({
|
||||
customData: "11opensub5@"
|
||||
})
|
||||
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@"
|
||||
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:'解锁',
|
||||
|
@ -844,48 +903,8 @@
|
|||
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({
|
||||
title: '解锁成功',
|
||||
icon: 'success',
|
||||
duration: 2000
|
||||
})
|
||||
that.deivceobj.deviceLockStatus = 1
|
||||
that.getorderdevice()
|
||||
}
|
||||
} else if(res.code == 20001){
|
||||
uni.hideLoading()
|
||||
if(that.ver_dataflag != 3){
|
||||
uni.showModal({
|
||||
title: '提示',
|
||||
content: '设备离线,请点击右上角连接车辆',
|
||||
|
@ -893,12 +912,9 @@
|
|||
success: function(res) {
|
||||
if (res.confirm) {
|
||||
|
||||
} else if (res.cancel) {
|
||||
|
||||
}
|
||||
}
|
||||
})
|
||||
}
|
||||
} else {
|
||||
uni.hideLoading()
|
||||
uni.showToast({
|
||||
|
@ -909,10 +925,11 @@
|
|||
}
|
||||
})
|
||||
} else if (res.cancel) {
|
||||
console.log('取消') // 用户点击取消
|
||||
|
||||
}
|
||||
}
|
||||
})
|
||||
}
|
||||
} else if (this.deivceobj.deviceLockStatus == 1) {
|
||||
uni.getLocation({
|
||||
type: 'gcj02', // 国内地图更兼容
|
||||
|
@ -929,13 +946,8 @@
|
|||
console.error('获取位置失败:', err)
|
||||
}
|
||||
})
|
||||
if(this.ver_dataflag != 3){
|
||||
let that = this
|
||||
let flag = ''
|
||||
if(that.ver_dataflag == 3){
|
||||
flag = false
|
||||
}else{
|
||||
flag = true
|
||||
}
|
||||
uni.showModal({
|
||||
title: '提示',
|
||||
content: '您是否要临时锁车?',
|
||||
|
@ -950,12 +962,66 @@
|
|||
orderId: that.deivceobj.orderId,
|
||||
lat: that.lat,
|
||||
lon: that.lon,
|
||||
requiredIot: flag
|
||||
requiredIot: true
|
||||
}
|
||||
let url = '/app/order/closeDevice?' + that.$tansParams(query)
|
||||
that.$u.put(url).then((res) => {
|
||||
if (res.code == 200 && res.data.db >= 1) {
|
||||
if(res.data.iot == false){
|
||||
if (res.code == 200) {
|
||||
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('取消') // 用户点击取消
|
||||
}
|
||||
}
|
||||
})
|
||||
}else{
|
||||
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({
|
||||
title: '加载中...',
|
||||
mask: true
|
||||
|
@ -992,8 +1058,6 @@
|
|||
success: function(res) {
|
||||
if (res.confirm) {
|
||||
|
||||
} else if (res.cancel) {
|
||||
|
||||
}
|
||||
}
|
||||
})
|
||||
|
@ -1009,19 +1073,8 @@
|
|||
console.log(res,'蓝牙')
|
||||
})
|
||||
}
|
||||
}else{
|
||||
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({
|
||||
title: '提示',
|
||||
content: '设备离线,请点击右上角连接车辆',
|
||||
|
@ -1029,12 +1082,9 @@
|
|||
success: function(res) {
|
||||
if (res.confirm) {
|
||||
|
||||
} else if (res.cancel) {
|
||||
|
||||
}
|
||||
}
|
||||
})
|
||||
}
|
||||
} else {
|
||||
uni.hideLoading()
|
||||
uni.showToast({
|
||||
|
@ -1050,6 +1100,7 @@
|
|||
}
|
||||
})
|
||||
}
|
||||
}
|
||||
},
|
||||
// 点击鸣笛寻车
|
||||
btnfm() {
|
||||
|
@ -1248,28 +1299,8 @@
|
|||
},
|
||||
// 还车统一调用
|
||||
gethuan() {
|
||||
if(this.deivceobj.deviceOnlineStatus == 0){
|
||||
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: '您确定要还车吗?',
|
||||
|
@ -1285,11 +1316,10 @@
|
|||
picture: that.imgs,
|
||||
lon: that.lon,
|
||||
lat: that.lat,
|
||||
requiredIot: flag
|
||||
requiredIot: true
|
||||
}
|
||||
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()
|
||||
|
@ -1303,39 +1333,6 @@
|
|||
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({
|
||||
|
@ -1344,20 +1341,23 @@
|
|||
duration: 2000
|
||||
})
|
||||
} else {
|
||||
uni.hideLoading()
|
||||
uni.showToast({
|
||||
title: res.msg,
|
||||
icon: 'none',
|
||||
duration: 2000
|
||||
})
|
||||
}
|
||||
})
|
||||
uni.showModal({
|
||||
title: '提示',
|
||||
content: res.msg,
|
||||
showCancel: false,
|
||||
success: function(res) {
|
||||
if (res.confirm) {
|
||||
|
||||
} else if (res.cancel) {
|
||||
|
||||
}
|
||||
}
|
||||
})
|
||||
}
|
||||
})
|
||||
}
|
||||
}
|
||||
})
|
||||
}else{
|
||||
let that = this
|
||||
uni.showModal({
|
||||
|
@ -1370,37 +1370,19 @@
|
|||
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
|
||||
lat: that.lat,
|
||||
requiredIot: false
|
||||
}
|
||||
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
|
||||
})
|
||||
xBlufi.notifyConnectBle({
|
||||
isStart: false,
|
||||
deviceId: that.deviceId,
|
||||
name: that.name
|
||||
})
|
||||
setTimeout(()=>{
|
||||
uni.navigateTo({
|
||||
url:'/page_user/yongche/orderxq?id=' + that.deivceobj.orderId
|
||||
})
|
||||
},1000)
|
||||
}else{
|
||||
xBlufi.notifySendCustomData({
|
||||
customData: "11llosesub300@"
|
||||
})
|
||||
setTimeout(()=>{
|
||||
xBlufi.notifySendCustomData({
|
||||
customData: "11reboot@"
|
||||
|
@ -1413,7 +1395,6 @@
|
|||
})
|
||||
},1000)
|
||||
},1000)
|
||||
}
|
||||
}else if(res.msg == null) {
|
||||
uni.hideLoading()
|
||||
uni.showToast({
|
||||
|
@ -1423,10 +1404,17 @@
|
|||
})
|
||||
} else {
|
||||
uni.hideLoading()
|
||||
uni.showToast({
|
||||
title: res.msg,
|
||||
icon: 'none',
|
||||
duration: 2000
|
||||
uni.showModal({
|
||||
title: '提示',
|
||||
content: res.msg,
|
||||
showCancel: false,
|
||||
success: function(res) {
|
||||
if (res.confirm) {
|
||||
|
||||
} else if (res.cancel) {
|
||||
|
||||
}
|
||||
}
|
||||
})
|
||||
}
|
||||
})
|
||||
|
|
Loading…
Reference in New Issue
Block a user