开关
This commit is contained in:
parent
deebccdd98
commit
8d471b8031
|
@ -19,8 +19,8 @@ const install = (Vue, vm) => {
|
||||||
// },
|
// },
|
||||||
// });
|
// });
|
||||||
Vue.prototype.$u.http.setConfig({
|
Vue.prototype.$u.http.setConfig({
|
||||||
baseUrl: 'http://192.168.2.100:10002',
|
// baseUrl: 'http://192.168.2.100:10002',
|
||||||
// baseUrl: 'https://kg.chuangtewl.com/prod-api',
|
baseUrl: 'https://kg.chuangtewl.com/prod-api',
|
||||||
// loadingText: '加载中...',
|
// loadingText: '加载中...',
|
||||||
// loadingTime: 1000,
|
// loadingTime: 1000,
|
||||||
// 设置自定义头部content-type
|
// 设置自定义头部content-type
|
||||||
|
|
|
@ -515,7 +515,7 @@
|
||||||
|
|
||||||
// 开启和关闭
|
// 开启和关闭
|
||||||
btnkq() {
|
btnkq() {
|
||||||
if (this.onlineStatus == 1) {
|
if (this.onlineStatus == 0) {
|
||||||
if (this.tdtxt == '开启') {
|
if (this.tdtxt == '开启') {
|
||||||
this.$u.put(`/app/bill/switchDevice?billId=${this.billId}&open=false`).then((res) => {
|
this.$u.put(`/app/bill/switchDevice?billId=${this.billId}&open=false`).then((res) => {
|
||||||
if (res.code == 200) {
|
if (res.code == 200) {
|
||||||
|
@ -558,18 +558,97 @@
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
if (this.tdtxt == '开启') {
|
if (this.ver_data == null) {
|
||||||
this.tdtxt = '关闭'
|
this.jieshufalg = true
|
||||||
getApp().ble_send("close");
|
uni.showLoading({
|
||||||
getApp().ble_send("11close");
|
title: '切换中'
|
||||||
|
})
|
||||||
|
xBlufi.initXBlufi(1)
|
||||||
|
xBlufi.listenDeviceMsgEvent(true, this.funListenDeviceMsgEvent)
|
||||||
|
xBlufi.notifyStartDiscoverBle({
|
||||||
|
'isStart': true
|
||||||
|
})
|
||||||
|
// 停止蓝牙搜索
|
||||||
|
setTimeout(() => {
|
||||||
|
xBlufi.notifyStartDiscoverBle({
|
||||||
|
'isStart': false
|
||||||
|
})
|
||||||
|
xBlufi.notifyConnectBle({
|
||||||
|
isStart: true,
|
||||||
|
deviceId: this.deviceId,
|
||||||
|
name: this.name
|
||||||
|
})
|
||||||
|
xBlufi.notifyInitBleEsp32({
|
||||||
|
deviceId: this.deviceId
|
||||||
|
})
|
||||||
|
let name = ''
|
||||||
|
let index = this.name.indexOf('-')
|
||||||
|
if (index !== -1) {
|
||||||
|
name = this.name.slice(index + 1)
|
||||||
|
}
|
||||||
|
if (this.sbobj.powerStatus == 0) {
|
||||||
|
this.imgflag = false
|
||||||
|
} else {
|
||||||
|
this.imgflag = true
|
||||||
|
}
|
||||||
|
}, 1000)
|
||||||
|
} else {
|
||||||
|
// console.log(this.tdtxt,'020202');
|
||||||
|
if (this.tdtxt == '开启') {
|
||||||
|
let that = this
|
||||||
|
uni.getNetworkType({
|
||||||
|
success(res) {
|
||||||
|
if (res.networkType !== 'none') {
|
||||||
|
uni.getConnectedBluetoothDevices({
|
||||||
|
success(res) {
|
||||||
|
setTimeout(() => {
|
||||||
|
// console.log('close关闭');
|
||||||
|
that.tdtxt = '关闭'
|
||||||
|
that.imgflag = false
|
||||||
|
xBlufi.notifySendCustomData({
|
||||||
|
customData: 'close'
|
||||||
|
})
|
||||||
|
xBlufi.notifySendCustomData({
|
||||||
|
customData: '11close'
|
||||||
|
})
|
||||||
|
}, 1000)
|
||||||
|
},
|
||||||
|
fail(err) {
|
||||||
|
console.error('获取已连接蓝牙设备信息失败:', err)
|
||||||
|
}
|
||||||
|
})
|
||||||
|
}
|
||||||
|
}
|
||||||
|
})
|
||||||
|
} else {
|
||||||
|
let that = this
|
||||||
|
uni.getNetworkType({
|
||||||
|
success(res) {
|
||||||
|
if (res.networkType !== 'none') {
|
||||||
|
uni.getConnectedBluetoothDevices({
|
||||||
|
success(res) {
|
||||||
|
setTimeout(() => {
|
||||||
|
// console.log('open开启');
|
||||||
|
that.tdtxt = '开启'
|
||||||
|
that.imgflag = true
|
||||||
|
xBlufi.notifySendCustomData({
|
||||||
|
customData: 'open'
|
||||||
|
})
|
||||||
|
xBlufi.notifySendCustomData({
|
||||||
|
customData: '11open'
|
||||||
|
})
|
||||||
|
}, 1000)
|
||||||
|
},
|
||||||
|
fail(err) {
|
||||||
|
console.error('获取已连接蓝牙设备信息失败:', err)
|
||||||
|
}
|
||||||
|
})
|
||||||
|
}
|
||||||
|
}
|
||||||
|
})
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
else
|
|
||||||
{
|
|
||||||
this.tdtxt = '开启'
|
|
||||||
getApp().ble_send("open");
|
|
||||||
getApp().ble_send("11open");
|
|
||||||
}
|
|
||||||
}
|
|
||||||
},
|
},
|
||||||
|
|
||||||
|
|
||||||
|
@ -670,7 +749,7 @@
|
||||||
this.getzfqd()
|
this.getzfqd()
|
||||||
this.getprice()
|
this.getprice()
|
||||||
if (this.detaobj.suitFeeMode == 1) {
|
if (this.detaobj.suitFeeMode == 1) {
|
||||||
if (this.onlineStatus == 1) {
|
if (this.onlineStatus == 0) {
|
||||||
let that = this
|
let that = this
|
||||||
uni.showModal({
|
uni.showModal({
|
||||||
title: '提示',
|
title: '提示',
|
||||||
|
@ -692,7 +771,7 @@
|
||||||
uni.reLaunch({
|
uni.reLaunch({
|
||||||
url: '/pages/shouye/index'
|
url: '/pages/shouye/index'
|
||||||
})
|
})
|
||||||
},1000)
|
},1500)
|
||||||
}else{
|
}else{
|
||||||
uni.reLaunch({
|
uni.reLaunch({
|
||||||
url: '/pages/shouye/index'
|
url: '/pages/shouye/index'
|
||||||
|
@ -710,15 +789,38 @@
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
} else {
|
} else {
|
||||||
// if (this.temperature == null) {
|
if (this.temperature == null) {
|
||||||
|
this.jieshufalg = true
|
||||||
|
uni.showLoading({
|
||||||
|
title: '切换中'
|
||||||
|
})
|
||||||
|
let that = this
|
||||||
|
xBlufi.initXBlufi(1);
|
||||||
|
xBlufi.listenDeviceMsgEvent(true, that.funListenDeviceMsgEvent);
|
||||||
|
xBlufi.notifyStartDiscoverBle({
|
||||||
|
'isStart': true
|
||||||
|
})
|
||||||
|
setTimeout(() => {
|
||||||
|
xBlufi.notifyStartDiscoverBle({
|
||||||
|
'isStart': false
|
||||||
|
})
|
||||||
|
if (that.devicesList.length > 0) {
|
||||||
|
xBlufi.notifyConnectBle({
|
||||||
|
isStart: true,
|
||||||
|
deviceId: that.deviceId,
|
||||||
|
name: that.name
|
||||||
|
})
|
||||||
|
}
|
||||||
|
}, 2000)
|
||||||
uni.showModal({
|
uni.showModal({
|
||||||
title: '温馨提示',
|
title: '温馨提示',
|
||||||
content: `检测到该设备未联网,为您切换为蓝牙模式,支付的时候靠近该设备,并打开蓝牙`,
|
content: `检测到该设备未联网,为您切换为蓝牙模式,支付的时候靠近该设备,并打开蓝牙`,
|
||||||
showCancel: false,
|
showCancel: false,
|
||||||
success: function(res) {
|
success: function(res) {
|
||||||
|
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
|
} else {
|
||||||
this.jieshufalg = true
|
this.jieshufalg = true
|
||||||
let data = {
|
let data = {
|
||||||
billId: this.billId,
|
billId: this.billId,
|
||||||
|
@ -731,8 +833,12 @@
|
||||||
uni.getConnectedBluetoothDevices({
|
uni.getConnectedBluetoothDevices({
|
||||||
success(res) {
|
success(res) {
|
||||||
setTimeout(() => {
|
setTimeout(() => {
|
||||||
getApp().ble_send("close");
|
xBlufi.notifySendCustomData({
|
||||||
getApp().ble_send("11close");
|
customData: 'close'
|
||||||
|
})
|
||||||
|
xBlufi.notifySendCustomData({
|
||||||
|
customData: '11close'
|
||||||
|
})
|
||||||
uni.showToast({
|
uni.showToast({
|
||||||
title: res.msg,
|
title: res.msg,
|
||||||
icon: 'success',
|
icon: 'success',
|
||||||
|
@ -743,8 +849,8 @@
|
||||||
uni.reLaunch({
|
uni.reLaunch({
|
||||||
url: '/pages/shouye/index'
|
url: '/pages/shouye/index'
|
||||||
})
|
})
|
||||||
}, 500)
|
}, 1000)
|
||||||
}, 1000)
|
}, 1500)
|
||||||
},
|
},
|
||||||
fail(err) {
|
fail(err) {
|
||||||
console.error('获取已连接蓝牙设备信息失败:', err)
|
console.error('获取已连接蓝牙设备信息失败:', err)
|
||||||
|
@ -764,7 +870,7 @@
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
// }
|
}
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
this.getsb()
|
this.getsb()
|
||||||
|
@ -792,7 +898,7 @@
|
||||||
uni.reLaunch({
|
uni.reLaunch({
|
||||||
url: '/pages/shouye/index'
|
url: '/pages/shouye/index'
|
||||||
})
|
})
|
||||||
}, 1000)
|
}, 1500)
|
||||||
} else {
|
} else {
|
||||||
this.getDevice()
|
this.getDevice()
|
||||||
this.jieshuflag = false
|
this.jieshuflag = false
|
||||||
|
@ -832,7 +938,7 @@
|
||||||
uni.reLaunch({
|
uni.reLaunch({
|
||||||
url: '/pages/shouye/index'
|
url: '/pages/shouye/index'
|
||||||
})
|
})
|
||||||
}, 1000)
|
}, 1500)
|
||||||
},
|
},
|
||||||
fail(err) {
|
fail(err) {
|
||||||
that.getDevice()
|
that.getDevice()
|
||||||
|
@ -886,7 +992,7 @@
|
||||||
uni.reLaunch({
|
uni.reLaunch({
|
||||||
url: '/pages/shouye/index'
|
url: '/pages/shouye/index'
|
||||||
})
|
})
|
||||||
}, 1000)
|
}, 1500)
|
||||||
},
|
},
|
||||||
fail(err) {
|
fail(err) {
|
||||||
that.jieshuflag = false
|
that.jieshuflag = false
|
||||||
|
@ -913,37 +1019,38 @@
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
// if (this.temperature == null) {
|
// console.log(this.temperature,'this.temperature');
|
||||||
// uni.showModal({
|
if (this.temperature == null) {
|
||||||
// title: '温馨提示',
|
uni.showLoading({
|
||||||
// content: `检测到该设备未联网,为您切换为蓝牙模式,支付的时候靠近该设备,并打开蓝牙`,
|
title: '切换中'
|
||||||
// showCancel: false,
|
})
|
||||||
// success: function(res) {
|
let that = this
|
||||||
// // uni.showLoading({
|
xBlufi.initXBlufi(1);
|
||||||
// // title: '请稍等'
|
xBlufi.listenDeviceMsgEvent(true, that.funListenDeviceMsgEvent);
|
||||||
// // })
|
xBlufi.notifyStartDiscoverBle({
|
||||||
// }
|
'isStart': true
|
||||||
// })
|
})
|
||||||
// let that = this
|
setTimeout(() => {
|
||||||
// xBlufi.initXBlufi(1);
|
xBlufi.notifyStartDiscoverBle({
|
||||||
// xBlufi.listenDeviceMsgEvent(true, that.funListenDeviceMsgEvent);
|
'isStart': false
|
||||||
// xBlufi.notifyStartDiscoverBle({
|
})
|
||||||
// 'isStart': true
|
if (that.devicesList.length > 0) {
|
||||||
// })
|
xBlufi.notifyConnectBle({
|
||||||
// setTimeout(() => {
|
isStart: true,
|
||||||
// xBlufi.notifyStartDiscoverBle({
|
deviceId: that.deviceId,
|
||||||
// 'isStart': false
|
name: that.name
|
||||||
// })
|
})
|
||||||
// if (that.devicesList.length > 0) {
|
}
|
||||||
// xBlufi.notifyConnectBle({
|
}, 2000)
|
||||||
// isStart: true,
|
uni.showModal({
|
||||||
// deviceId: that.deviceId,
|
title: '温馨提示',
|
||||||
// name: that.name
|
content: `检测到该设备未联网,为您切换为蓝牙模式,支付的时候靠近该设备,并打开蓝牙`,
|
||||||
// })
|
showCancel: false,
|
||||||
// }
|
success: function(res) {
|
||||||
// }, 2000)
|
|
||||||
|
}
|
||||||
// } else {
|
})
|
||||||
|
} else {
|
||||||
if (this.detaobj.suitFeeType == 1 || this.detaobj.suitFeeType == 2) {
|
if (this.detaobj.suitFeeType == 1 || this.detaobj.suitFeeType == 2) {
|
||||||
let data = {
|
let data = {
|
||||||
billId: this.billId,
|
billId: this.billId,
|
||||||
|
@ -957,15 +1064,19 @@
|
||||||
uni.getConnectedBluetoothDevices({
|
uni.getConnectedBluetoothDevices({
|
||||||
success(res) {
|
success(res) {
|
||||||
setTimeout(() => {
|
setTimeout(() => {
|
||||||
getApp().ble_send("close");
|
xBlufi.notifySendCustomData({
|
||||||
getApp().ble_send("11close");
|
customData: 'close',
|
||||||
|
})
|
||||||
|
xBlufi.notifySendCustomData({
|
||||||
|
customData: '11close',
|
||||||
|
})
|
||||||
setTimeout(() => {
|
setTimeout(() => {
|
||||||
this.jieshuflag = false
|
this.jieshuflag = false
|
||||||
uni.reLaunch({
|
uni.reLaunch({
|
||||||
url: '/pages/shouye/index'
|
url: '/pages/shouye/index'
|
||||||
})
|
})
|
||||||
}, 500)
|
}, 1000)
|
||||||
}, 1000)
|
}, 1500)
|
||||||
},
|
},
|
||||||
fail(err) {
|
fail(err) {
|
||||||
console.error('获取已连接蓝牙设备信息失败:', err)
|
console.error('获取已连接蓝牙设备信息失败:', err)
|
||||||
|
@ -1000,8 +1111,12 @@
|
||||||
uni.getConnectedBluetoothDevices({
|
uni.getConnectedBluetoothDevices({
|
||||||
success(res) {
|
success(res) {
|
||||||
setTimeout(() => {
|
setTimeout(() => {
|
||||||
getApp().ble_send("close");
|
xBlufi.notifySendCustomData({
|
||||||
getApp().ble_send("11close");
|
customData: 'close',
|
||||||
|
})
|
||||||
|
xBlufi.notifySendCustomData({
|
||||||
|
customData: '11close',
|
||||||
|
})
|
||||||
setTimeout(() => {
|
setTimeout(() => {
|
||||||
let data = {
|
let data = {
|
||||||
billNo: that.orderno,
|
billNo: that.orderno,
|
||||||
|
@ -1030,7 +1145,7 @@
|
||||||
uni.reLaunch({
|
uni.reLaunch({
|
||||||
url: '/pages/shouye/index'
|
url: '/pages/shouye/index'
|
||||||
})
|
})
|
||||||
},1000)
|
},1500)
|
||||||
},
|
},
|
||||||
fail(err) {
|
fail(err) {
|
||||||
that.jieshuflag = false
|
that.jieshuflag = false
|
||||||
|
@ -1068,8 +1183,8 @@
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|
||||||
// }
|
}
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
|
||||||
|
@ -1258,6 +1373,79 @@
|
||||||
url: "/page_components/eletj?id=" + this.id
|
url: "/page_components/eletj?id=" + this.id
|
||||||
})
|
})
|
||||||
},
|
},
|
||||||
|
|
||||||
|
funListenDeviceMsgEvent: function(options) {
|
||||||
|
switch (options.type) {
|
||||||
|
case xBlufi.XBLUFI_TYPE.TYPE_GET_DEVICE_LISTS:
|
||||||
|
if (options.result) {
|
||||||
|
let devicesarr = options.data
|
||||||
|
// console.log(devicesarr, this.mac, '111')
|
||||||
|
devicesarr.forEach(device => {
|
||||||
|
const mac = device.name.substring(4)
|
||||||
|
if (device.name.slice(5, 17) == this.qrResult) {
|
||||||
|
this.deviceId = device.deviceId
|
||||||
|
this.name = device.name
|
||||||
|
// console.log(device.name,this.mac,'222');
|
||||||
|
this.devicesList.push(device)
|
||||||
|
let uniqueDevicesList = Array.from(new Set(this.devicesList))
|
||||||
|
// 将去重后的数组重新赋值给 this.devicesList
|
||||||
|
this.devicesList = uniqueDevicesList
|
||||||
|
}
|
||||||
|
})
|
||||||
|
}
|
||||||
|
break;
|
||||||
|
case xBlufi.XBLUFI_TYPE.TYPE_CONNECTED:
|
||||||
|
console.log("连接回调:" + JSON.stringify(options))
|
||||||
|
if (options.result) {
|
||||||
|
// console.log('125451245')
|
||||||
|
{
|
||||||
|
xBlufi.notifyInitBleEsp32({
|
||||||
|
deviceId: this.deviceId
|
||||||
|
})
|
||||||
|
xBlufi.listenDeviceMsgEvent(true, this.funListenDeviceMsgEvents)
|
||||||
|
this.deviceIds = options.data.deviceId
|
||||||
|
this.name = this.name
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
break;
|
||||||
|
case xBlufi.XBLUFI_TYPE.TYPE_RECIEVE_CUSTON_DATA:
|
||||||
|
this.ver_data = this.parseCustomData(options.data)
|
||||||
|
console.log("1收到设备发来的自定义数据结果:", this.ver_data)
|
||||||
|
this.temperature = this.ver_data.temperature / 1000
|
||||||
|
setTimeout(() => {
|
||||||
|
// this.czflag = false
|
||||||
|
this.jieshuflag = false
|
||||||
|
this.jieshufalg = false
|
||||||
|
uni.hideLoading()
|
||||||
|
}, 1000)
|
||||||
|
break
|
||||||
|
case xBlufi.XBLUFI_TYPE.TYPE_GET_DEVICE_LISTS_STOP:
|
||||||
|
if (options.result) {
|
||||||
|
let uniqueDevicesList = Array.from(new Set(this.devicesList));
|
||||||
|
let filteredDevices = uniqueDevicesList.filter(device => device.name.substring(0, 4) === "CTKG");
|
||||||
|
// 将过滤后的数组重新赋值给 this.devicesList
|
||||||
|
this.devicesList = filteredDevices
|
||||||
|
}
|
||||||
|
break
|
||||||
|
case xBlufi.XBLUFI_TYPE.TYPE_GET_DEVICE_LISTS_START:
|
||||||
|
if (!options.result) {
|
||||||
|
this.lanyaflag = true
|
||||||
|
uni.showToast({
|
||||||
|
title: '蓝牙未开启',
|
||||||
|
icon: 'none',
|
||||||
|
duration: 3000
|
||||||
|
})
|
||||||
|
return
|
||||||
|
} else {
|
||||||
|
this.lanyaflag = false
|
||||||
|
}
|
||||||
|
break
|
||||||
|
}
|
||||||
|
},
|
||||||
|
|
||||||
parseCustomData(data) {
|
parseCustomData(data) {
|
||||||
// 将字符串按照 "@" 分割成数组
|
// 将字符串按照 "@" 分割成数组
|
||||||
const dataArray = data.split('@')
|
const dataArray = data.split('@')
|
||||||
|
|
|
@ -7,7 +7,13 @@
|
||||||
<view class="nav">
|
<view class="nav">
|
||||||
<text class="shen">订单号</text><text class="qian">{{detailobj.billNo == undefined ? '--' : detailobj.billNo}}</text>
|
<text class="shen">订单号</text><text class="qian">{{detailobj.billNo == undefined ? '--' : detailobj.billNo}}</text>
|
||||||
</view>
|
</view>
|
||||||
<view class="nav">
|
<view class="nav" v-if="detailobj.isFinished == false && detailobj.isUsing == false && detailobj.status == 2">
|
||||||
|
<text class="shen">订单状态</text>
|
||||||
|
<text class="qian">
|
||||||
|
未开始
|
||||||
|
</text>
|
||||||
|
</view>
|
||||||
|
<view class="nav" v-else>
|
||||||
<text class="shen">订单状态</text>
|
<text class="shen">订单状态</text>
|
||||||
<text class="qian" v-if="detailobj.status == 2">
|
<text class="qian" v-if="detailobj.status == 2">
|
||||||
已支付
|
已支付
|
||||||
|
|
|
@ -11,7 +11,12 @@
|
||||||
<view class="wz">订单号:{{item.billNo}}</view>
|
<view class="wz">订单号:{{item.billNo}}</view>
|
||||||
<view class="wz">消费时间:{{item.createTime}}</view>
|
<view class="wz">消费时间:{{item.createTime}}</view>
|
||||||
</view>
|
</view>
|
||||||
<view class="rt">
|
<view class="rt" v-if="item.isFinished == false && item.isUsing == false && item.status == 2">
|
||||||
|
<view class="top">
|
||||||
|
未开始 <u-icon name="arrow-right" color="#808080" size="20" style="margin-left: 10rpx;"></u-icon>
|
||||||
|
</view>
|
||||||
|
</view>
|
||||||
|
<view class="rt" v-else>
|
||||||
<view class="top" v-if="item.status == 2">
|
<view class="top" v-if="item.status == 2">
|
||||||
已支付 <u-icon name="arrow-right" color="#808080" size="20" style="margin-left: 10rpx;"></u-icon>
|
已支付 <u-icon name="arrow-right" color="#808080" size="20" style="margin-left: 10rpx;"></u-icon>
|
||||||
</view>
|
</view>
|
||||||
|
|
|
@ -99,6 +99,14 @@
|
||||||
margin-top: 30rpx;align-items: center;">
|
margin-top: 30rpx;align-items: center;">
|
||||||
退款
|
退款
|
||||||
</view>
|
</view>
|
||||||
|
<view class="sb" v-if="userflag && detailobj.isFinished == false" @click="btnjs" style="width:680rpx;height: 100rpx;background: #8883F0;
|
||||||
|
border-radius: 50rpx;
|
||||||
|
margin: auto;font-weight: 600;
|
||||||
|
padding: 32rpx 24rpx;color:#fff;font-size: 32rpx;
|
||||||
|
box-sizing: border-box;text-align: center;
|
||||||
|
margin-top: 30rpx;align-items: center;">
|
||||||
|
结束订单
|
||||||
|
</view>
|
||||||
</view>
|
</view>
|
||||||
<!-- 退款弹窗 -->
|
<!-- 退款弹窗 -->
|
||||||
<view class="tanc" v-if="maskflag">
|
<view class="tanc" v-if="maskflag">
|
||||||
|
@ -178,6 +186,44 @@
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
methods: {
|
methods: {
|
||||||
|
// 点击结束订单
|
||||||
|
btnjs(){
|
||||||
|
let that = this
|
||||||
|
uni.showModal({
|
||||||
|
title: '提示',
|
||||||
|
content: '您确定要提前结束用户订单吗?',
|
||||||
|
success: function(res) {
|
||||||
|
if (res.confirm) {
|
||||||
|
let data = {
|
||||||
|
billId: that.billId
|
||||||
|
}
|
||||||
|
that.$u.put(`/app/bill/endUse`, data).then(res => {
|
||||||
|
if (res.code == 200) {
|
||||||
|
if(res.data.deviceResult == false){
|
||||||
|
uni.showToast({
|
||||||
|
title: res.data.deviceMsg,
|
||||||
|
icon: 'none',
|
||||||
|
duration: 2000
|
||||||
|
})
|
||||||
|
}else{
|
||||||
|
uni.showToast({
|
||||||
|
title:'结束成功',
|
||||||
|
icon: 'success',
|
||||||
|
duration: 2000
|
||||||
|
})
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
uni.showToast({
|
||||||
|
title: res.msg,
|
||||||
|
icon: 'none',
|
||||||
|
duration: 1000
|
||||||
|
})
|
||||||
|
}
|
||||||
|
})
|
||||||
|
}
|
||||||
|
}
|
||||||
|
})
|
||||||
|
},
|
||||||
// 点击去提交
|
// 点击去提交
|
||||||
btntijiao(){
|
btntijiao(){
|
||||||
this.tiflag = false
|
this.tiflag = false
|
||||||
|
|
Loading…
Reference in New Issue
Block a user