aaa
This commit is contained in:
parent
db9769f8bb
commit
f13de0eafd
|
@ -20,8 +20,8 @@ const install = (Vue, vm) => {
|
||||||
// },
|
// },
|
||||||
// });
|
// });
|
||||||
Vue.prototype.$u.http.setConfig({
|
Vue.prototype.$u.http.setConfig({
|
||||||
// baseUrl: 'http://192.168.2.184:3000/dev-api',
|
baseUrl: 'http://192.168.2.17:3000/dev-api',
|
||||||
baseUrl: 'https://kg.chuantewulian.cn/prod-api',
|
// baseUrl: 'https://kg.chuantewulian.cn/prod-api',
|
||||||
loadingText: '努力加载中~',
|
loadingText: '努力加载中~',
|
||||||
loadingTime: 1000,
|
loadingTime: 1000,
|
||||||
// 设置自定义头部content-type
|
// 设置自定义头部content-type
|
||||||
|
|
|
@ -219,6 +219,7 @@
|
||||||
if (res.code == 200) {
|
if (res.code == 200) {
|
||||||
this.mac = 'CTKG-' + res.data.mac
|
this.mac = 'CTKG-' + res.data.mac
|
||||||
this.onlineStatus = res.data.onlineStatus
|
this.onlineStatus = res.data.onlineStatus
|
||||||
|
// console.log(this.mac,'期初');
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
},
|
},
|
||||||
|
@ -313,8 +314,9 @@
|
||||||
content: '支付的时候请靠近设备并打开蓝牙',
|
content: '支付的时候请靠近设备并打开蓝牙',
|
||||||
success: function(res) {
|
success: function(res) {
|
||||||
if (res.confirm) {
|
if (res.confirm) {
|
||||||
|
console.log(that.deviceId,that.name);
|
||||||
xBlufi.initXBlufi(1);
|
xBlufi.initXBlufi(1);
|
||||||
xBlufi.listenDeviceMsgEvent(true, this.funListenDeviceMsgEvent);
|
xBlufi.listenDeviceMsgEvent(true, that.funListenDeviceMsgEvent);
|
||||||
xBlufi.notifyStartDiscoverBle({
|
xBlufi.notifyStartDiscoverBle({
|
||||||
'isStart': true
|
'isStart': true
|
||||||
})
|
})
|
||||||
|
@ -322,11 +324,11 @@
|
||||||
xBlufi.notifyStartDiscoverBle({
|
xBlufi.notifyStartDiscoverBle({
|
||||||
'isStart': false
|
'isStart': false
|
||||||
})
|
})
|
||||||
if (this.devicesList.length > 0) {
|
if (that.devicesList.length > 0) {
|
||||||
xBlufi.notifyConnectBle({
|
xBlufi.notifyConnectBle({
|
||||||
isStart: true,
|
isStart: true,
|
||||||
deviceId: this.deviceId,
|
deviceId: that.deviceId,
|
||||||
name: this.name
|
name: that.name
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
}, 2000)
|
}, 2000)
|
||||||
|
@ -407,9 +409,11 @@
|
||||||
let devicesarr = options.data
|
let devicesarr = options.data
|
||||||
devicesarr.forEach(device => {
|
devicesarr.forEach(device => {
|
||||||
const mac = device.name.substring(4);
|
const mac = device.name.substring(4);
|
||||||
|
console.log(device.name,this.mac,'111');
|
||||||
if (device.name == this.mac) {
|
if (device.name == this.mac) {
|
||||||
this.deviceId = device.deviceId
|
this.deviceId = device.deviceId
|
||||||
this.name = device.name
|
this.name = device.name
|
||||||
|
console.log(device.name,this.mac,'222');
|
||||||
this.devicesList.push(device);
|
this.devicesList.push(device);
|
||||||
let uniqueDevicesList = Array.from(new Set(this.devicesList));
|
let uniqueDevicesList = Array.from(new Set(this.devicesList));
|
||||||
// 将去重后的数组重新赋值给 this.devicesList
|
// 将去重后的数组重新赋值给 this.devicesList
|
||||||
|
|
|
@ -225,7 +225,7 @@
|
||||||
if (!options.result) {
|
if (!options.result) {
|
||||||
console.log("蓝牙未开启", options);
|
console.log("蓝牙未开启", options);
|
||||||
uni.showToast({
|
uni.showToast({
|
||||||
title: '蓝牙未开启,如有疑问请查看查看常见问题',
|
title: '蓝牙未开启,请打开手机蓝牙',
|
||||||
icon: 'none',
|
icon: 'none',
|
||||||
duration: 3000
|
duration: 3000
|
||||||
});
|
});
|
||||||
|
|
|
@ -333,6 +333,7 @@
|
||||||
},
|
},
|
||||||
|
|
||||||
handleMarkerClick(e) {
|
handleMarkerClick(e) {
|
||||||
|
console.log(e);
|
||||||
this.$u.get("/app/store/" + e.markerId).then(res => {
|
this.$u.get("/app/store/" + e.markerId).then(res => {
|
||||||
if (res.code == 200) {
|
if (res.code == 200) {
|
||||||
this.listobj = res.data
|
this.listobj = res.data
|
||||||
|
|
|
@ -233,6 +233,15 @@
|
||||||
"navigationBarTextStyle": "#FFFFFF",
|
"navigationBarTextStyle": "#FFFFFF",
|
||||||
"navigationStyle": "custom"
|
"navigationStyle": "custom"
|
||||||
}
|
}
|
||||||
|
},{
|
||||||
|
"path": "zhuce",
|
||||||
|
"style": {
|
||||||
|
"navigationBarTitleText": "",
|
||||||
|
"enablePullDownRefresh": false,
|
||||||
|
"navigationBarBackgroundColor": "#3996FD",
|
||||||
|
"navigationBarTextStyle": "#FFFFFF",
|
||||||
|
"navigationStyle": "custom"
|
||||||
|
}
|
||||||
},{
|
},{
|
||||||
"path": "device/lianjie",
|
"path": "device/lianjie",
|
||||||
"style": {
|
"style": {
|
||||||
|
|
|
@ -125,17 +125,11 @@
|
||||||
uni.navigateTo({
|
uni.navigateTo({
|
||||||
url: '/page_user/sbdetail?id=' +that.deviceobj.deviceId
|
url: '/page_user/sbdetail?id=' +that.deviceobj.deviceId
|
||||||
})
|
})
|
||||||
// uni.showModal({
|
}else {
|
||||||
// title: '提示',
|
if(res.msg == '设备未录入'){
|
||||||
// content: '绑定成功,需前去设置吗?',
|
uni.navigateTo({
|
||||||
// success: function(res) {
|
url:'/page_fenbao/zhuce?sn=' + id
|
||||||
// if (res.confirm) {
|
})
|
||||||
|
|
||||||
// } else if (res.cancel) {
|
|
||||||
|
|
||||||
// }
|
|
||||||
// }
|
|
||||||
// })
|
|
||||||
}else{
|
}else{
|
||||||
uni.showToast({
|
uni.showToast({
|
||||||
title: res.msg,
|
title: res.msg,
|
||||||
|
@ -143,6 +137,7 @@
|
||||||
duration: 1000
|
duration: 1000
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
}
|
||||||
})
|
})
|
||||||
} else if (res.cancel) {
|
} else if (res.cancel) {
|
||||||
// uni.navigateTo({
|
// uni.navigateTo({
|
||||||
|
@ -375,7 +370,7 @@
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
fail: (error) => {
|
fail: (error) => {
|
||||||
console.error('获取地图缩放级别失败:', error);
|
// console.error('获取地图缩放级别失败:', error);
|
||||||
},
|
},
|
||||||
})
|
})
|
||||||
},
|
},
|
||||||
|
|
Loading…
Reference in New Issue
Block a user