This commit is contained in:
Sliverber 2024-08-01 10:03:54 +08:00
parent 266d86da14
commit c3f818ae60
4 changed files with 288 additions and 238 deletions

View File

@ -22,10 +22,10 @@ const install = (Vue, vm) => {
uni.setStorageSync('deptId', 100); uni.setStorageSync('deptId', 100);
Vue.prototype.$u.http.setConfig({ Vue.prototype.$u.http.setConfig({
// baseUrl: 'http://61.174.243.28:15861', // baseUrl: 'http://61.174.243.28:15861',
baseUrl: 'http://192.168.2.46:8080', // baseUrl: 'http://192.168.2.46:8080',
// baseUrl: 'http://124.221.246.124:2289', // baseUrl: 'http://124.221.246.124:2289',
// baseUrl: 'https://dianche.chuantewulian.cn/prod-api', // baseUrl: 'https://dianche.chuantewulian.cn/prod-api',
// baseUrl: 'https://dche.ccttiot.com/prod-api', baseUrl: 'https://dche.ccttiot.com/prod-api',
loadingText: '努力加载中~', loadingText: '努力加载中~',
loadingTime: 50000, loadingTime: 50000,
@ -52,9 +52,9 @@ const install = (Vue, vm) => {
// 方式四如果token放在了Storage本地存储中拦截是每次请求都执行的 // 方式四如果token放在了Storage本地存储中拦截是每次请求都执行的
// 所以哪怕您重新登录修改了Storage下一次的请求将会是最新值 // 所以哪怕您重新登录修改了Storage下一次的请求将会是最新值
// const token = uni.getStorageSync('token'); const token = uni.getStorageSync('token');
const token = "Bearer eyJhbGciOiJIUzUxMiJ9.eyJsb2dpbl91c2VyX2tleSI6IjQ0ZDljYzBlLThjZjEtNGFkOC05OGFjLThlNThjMWIxYjQ3OSJ9.v-aMkp9t7Z_QfjfsZy6d_1Ng76hPYa0A--SWScMJY9to7UlNv9IxHQnTJylLKdYKGrr8fRZ47Bu12UPm1DgMQg" // const token = "Bearer eyJhbGciOiJIUzUxMiJ9.eyJsb2dpbl91c2VyX2tleSI6IjQ0ZDljYzBlLThjZjEtNGFkOC05OGFjLThlNThjMWIxYjQ3OSJ9.v-aMkp9t7Z_QfjfsZy6d_1Ng76hPYa0A--SWScMJY9to7UlNv9IxHQnTJylLKdYKGrr8fRZ47Bu12UPm1DgMQg"
// console.log("我是token", token) // console.log("我是token", token)
config.header.Authorization = token; config.header.Authorization = token;

View File

@ -2,59 +2,61 @@
<view class="page"> <view class="page">
<u-navbar title="添加设备" :border-bottom="false" :background="bgc" title-color='#262B37' title-size='38' <u-navbar title="添加设备" :border-bottom="false" :background="bgc" title-color='#262B37' title-size='38'
height='50'></u-navbar> height='50'></u-navbar>
<view class="iptbox" @click="backpage()"> <view class="iptbox" @click="backpage()">
<input type="text" class="ips" v-model="mac" placeholder=" " style="margin-left: 32rpx;" disabled <input type="text" class="ips" v-model="mac" placeholder=" " style="margin-left: 32rpx;" disabled
placeholder-class="my-placeholder" /> placeholder-class="my-placeholder" />
<view class="iconfont icon-xiangyou1 "> <view class="iconfont icon-xiangyou1 ">
</view>
</view> </view>
</view>
<view class="iptbox"> <view class="iptbox">
<view class="qrcode" @click="qrcode()"> <view class="qrcode" @click="qrcode()">
<image src="https://api.ccttiot.com/smartmeter/img/static/uy7BNwAMIKwvstqFnRhs" mode=""></image> <image src="https://api.ccttiot.com/smartmeter/img/static/uy7BNwAMIKwvstqFnRhs" mode=""></image>
</view> </view>
<input type="text" class="ips" v-model="sn" placeholder="请扫描设备上的二维码" style="margin-left: 32rpx;" <input type="text" class="ips" v-model="sn" placeholder="请扫描设备上的二维码" style="margin-left: 32rpx;"
placeholder-class="my-placeholder" /> placeholder-class="my-placeholder" />
</view> </view>
<view class="iptbox" @click="show=true"> <view class="iptbox" @click="show=true">
<view class=""> <view class="" v-if="hardwareInfo.version">
版本 版本id: 版本{{hardwareInfo.version}} 版本id:{{hardwareInfo.id}}
</view>
<view class="" v-else>
请点击选择版本
</view> </view>
</view> </view>
<view class="tips"> <view class="tips" v-if="hardwareInfo.version">
版本介绍 版本介绍{{hardwareInfo.instructions}}
</view> </view>
<u-select v-model="show" :list="list" title='选择运营区' @confirm="confirm"></u-select> <u-select v-model="show" :list="list" title='选择运营区' @confirm="confirm"></u-select>
<view class="btn" @click="bind()"> <view class="btn" @click="bind()">
确认添加 确认添加
</view> </view>
<view class="bot_btn" > <view class="bot_btn">
<view class="btn1" @click="Binddevice()"> <view class="btn1" @click="Binddevice()">
蓝牙链接 蓝牙链接
</view> </view>
<view class="btn1" @click="ring()" v-if="carstause"> <view class="btn1" @click="ring()" v-if="carstause">
响铃寻车 响铃寻车
</view> </view>
<view class="btn1" @click="open()" v-if="carstause"> <view class="btn1" @click="open()" v-if="carstause">
蓝牙开锁 蓝牙开锁
</view> </view>
<view class="btn1" @click="close()" v-if="carstause"> <view class="btn1" @click="close()" v-if="carstause">
蓝牙关锁 蓝牙关锁
</view> </view>
<view class="btn1" @click="reboot()" v-if="carstause"> <view class="btn1" @click="reboot()" v-if="carstause">
设备重启 设备重启
</view> </view>
<view class="btn1" @click="Binddevice()" v-if="isbands"> <view class="btn1" @click="Binddevice()" v-if="isbands">
接口响铃 接口响铃
</view> </view>
</view> </view>
<!-- <view class="bot"> <!-- <view class="bot">
<view class="btn"> <view class="btn">
退款 退款
@ -94,26 +96,27 @@
name: '', name: '',
orderinfo: {}, orderinfo: {},
dl: 0, dl: 0,
czmoney:true, czmoney: true,
iscz:true, iscz: true,
bgc: { bgc: {
backgroundColor: "#F7FAFE", backgroundColor: "#F7FAFE",
}, },
sn:'', sn: '',
carstause:false, carstause: false,
isbands:false, isbands: false,
show:false, show: false,
list:[] list: [],
hardwareInfo: {}
} }
}, },
onLoad(e) { onLoad(e) {
this.mac=e.mac this.mac = e.mac
this.Binddevice() this.Binddevice()
this.isbands=false this.isbands = false
this.carstause=false this.carstause = false
}, },
onShow() { onShow() {
this.getlist() this.getlist()
@ -124,97 +127,117 @@
'isStart': false 'isStart': false
}); });
}, },
onHide(){ onHide() {
xBlufi.listenDeviceMsgEvent(false, this.funListenDeviceMsgEvent); xBlufi.listenDeviceMsgEvent(false, this.funListenDeviceMsgEvent);
xBlufi.notifyStartDiscoverBle({ xBlufi.notifyStartDiscoverBle({
'isStart': false 'isStart': false
}); });
}, },
onBeforeUnmount(){ onBeforeUnmount() {
xBlufi.listenDeviceMsgEvent(false, this.funListenDeviceMsgEvent); xBlufi.listenDeviceMsgEvent(false, this.funListenDeviceMsgEvent);
xBlufi.notifyStartDiscoverBle({ xBlufi.notifyStartDiscoverBle({
'isStart': false 'isStart': false
}); });
}, },
watch: { watch: {
}, },
methods: { methods: {
confirm(e){ confirm(e) {
// console.log(e); // console.log(e);
uni.setStorageSync('adminAreaid', e[0].value); uni.setStorageSync('hardwareVersionId', e[0].value);
this.areaId= e[0].value this.hardwareVersionId = e[0].value
const hardwareVersionId =this.hardwareVersionId
if (hardwareVersionId) {
const matchedVersion = this.Versionlist.find(version => version.id ===
hardwareVersionId);
if (matchedVersion) {
this.hardwareInfo = matchedVersion;
}
}
}, },
getlist(){ getlist() {
this.$u.get('/app/hardwareVersion/list').then((res) => { this.$u.get('/app/hardwareVersion/list').then((res) => {
if (res.code === 200) { if (res.code === 200) {
this.Versionlist = res.data
const hardwareVersionId = uni.getStorageSync('hardwareVersionId');
if (hardwareVersionId) {
this.hardwareVersionId=hardwareVersionId
const matchedVersion = this.Versionlist.find(version => version.id ===
hardwareVersionId);
if (matchedVersion) {
this.hardwareInfo = matchedVersion;
}
}
this.list = res.data.map(item => ({ this.list = res.data.map(item => ({
value: item.id, value: item.id,
label: item.version label: item.version
})); }));
}else{
uni.showToast({
title: res.msg,
icon: 'none',
duration: 2000
});
}
})
},
send(){
this.$u.post('/app/device/ring?sn=' + this.sn).then((res) => {
if (res.code === 200) {
}else{
uni.showToast({
title: res.msg,
icon: 'none',
duration: 2000
});
}
})
},
backpage(){
uni.navigateBack({
delta: 1 // delta1
});
},
bind(){
this.$u.post(`/appVerify/band?sn=`+this.sn+'&mac='+this.mac).then((res) => {
if (res.code == 200) {
uni.showToast({
title: '绑定成功',
icon: 'none',
duration: 2000
});
setTimeout(()=>{
uni.navigateBack({
delta: 1 // delta1
});
},2000)
} else { } else {
uni.showToast({ uni.showToast({
title: res.msg, title: res.msg,
icon: 'none', icon: 'none',
duration: 2000 duration: 2000
}); });
} }
}) })
}, },
qrcode(){ send() {
this.$u.post('/app/device/ring?sn=' + this.sn).then((res) => {
if (res.code === 200) {
} else {
uni.showToast({
title: res.msg,
icon: 'none',
duration: 2000
});
}
})
},
backpage() {
uni.navigateBack({
delta: 1 // delta1
});
},
bind() {
this.$u.post(`/appVerify/band?sn=` + this.sn + '&mac=' + this.mac+'&hardwareVersionId='+this.hardwareVersionId).then((res) => {
if (res.code == 200) {
uni.showToast({
title: '绑定成功',
icon: 'none',
duration: 2000
});
setTimeout(() => {
uni.navigateBack({
delta: 1 // delta1
});
}, 2000)
} else {
uni.showToast({
title: res.msg,
icon: 'none',
duration: 2000
});
}
})
},
qrcode() {
uni.scanCode({ uni.scanCode({
onlyFromCamera: true, onlyFromCamera: true,
scanType: ['qrCode'], scanType: ['qrCode'],
success: res => { success: res => {
let sn = null; let sn = null;
let queryParams = res.result.split('?')[1]; let queryParams = res.result.split('?')[1];
if (queryParams) { if (queryParams) {
@ -226,13 +249,13 @@
} }
}); });
} }
this.sn = sn this.sn = sn
console.log(res.result); console.log(res.result);
if (this.sn != '') { if (this.sn != '') {
} }
}, },
fail: err => { fail: err => {
console.error('扫描失败:', err); console.error('扫描失败:', err);
@ -243,10 +266,10 @@
} }
}); });
}, },
Binddevice(){ Binddevice() {
uni.showLoading({ uni.showLoading({
title:'连接中..' title: '连接中..'
}) })
xBlufi.initXBlufi(1); xBlufi.initXBlufi(1);
console.log("xBlufi", xBlufi.XMQTT_SYSTEM); console.log("xBlufi", xBlufi.XMQTT_SYSTEM);
@ -254,14 +277,14 @@
xBlufi.notifyStartDiscoverBle({ xBlufi.notifyStartDiscoverBle({
'isStart': true 'isStart': true
}); });
// //
setTimeout(() => { setTimeout(() => {
xBlufi.notifyStartDiscoverBle({ xBlufi.notifyStartDiscoverBle({
'isStart': false 'isStart': false
}); });
setTimeout(()=>{ setTimeout(() => {
uni.hideLoading() uni.hideLoading()
if (this.devicesList.length == 0) { if (this.devicesList.length == 0) {
uni.showToast({ uni.showToast({
@ -270,14 +293,14 @@
}); });
} else { } else {
let uniqueDevicesList = Array.from(new Set(this.devicesList)); let uniqueDevicesList = Array.from(new Set(this.devicesList));
// this.devicesList // this.devicesList
this.devicesList = uniqueDevicesList; this.devicesList = uniqueDevicesList;
// console.log(this.devicesList,'this.devicesListthis.devicesList'); // console.log(this.devicesList,'this.devicesListthis.devicesList');
this.devicesList.forEach(device => { this.devicesList.forEach(device => {
// MAC MAC 6 // MAC MAC 6
let macFromName = device.name.substring(device.name.length - 12); let macFromName = device.name.substring(device.name.length - 12);
console.log(macFromName,'macFromNamemacFromName'); console.log(macFromName, 'macFromNamemacFromName');
// this.mac // this.mac
if (macFromName == this.mac) { if (macFromName == this.mac) {
// this.ishave true // this.ishave true
@ -285,22 +308,22 @@
this.deviceInfoss = device this.deviceInfoss = device
// this.ishave = true; // this.ishave = true;
this.createBLEConnection(device) this.createBLEConnection(device)
console.log('对比正确1111111111'); console.log('对比正确1111111111');
} else { } else {
console.log('对比错误'); console.log('对比错误');
} }
}); });
} }
},200) }, 200)
// //
// this.status = true // this.status = true
}, 2000) }, 2000)
}, },
reboot(){ reboot() {
let vm = this; // this vm let vm = this; // this vm
uni.getNetworkType({ uni.getNetworkType({
success(res) { success(res) {
@ -316,7 +339,7 @@
// vm.remakr() // vm.remakr()
}, },
fail(err) { fail(err) {
uni.hideLoading() uni.hideLoading()
console.error('获取已连接蓝牙设备信息失败:', err); console.error('获取已连接蓝牙设备信息失败:', err);
} }
}); });
@ -326,7 +349,7 @@
} }
}); });
}, },
open(){ open() {
let vm = this; // this vm let vm = this; // this vm
uni.getNetworkType({ uni.getNetworkType({
success(res) { success(res) {
@ -342,7 +365,7 @@
// vm.remakr() // vm.remakr()
}, },
fail(err) { fail(err) {
uni.hideLoading() uni.hideLoading()
console.error('获取已连接蓝牙设备信息失败:', err); console.error('获取已连接蓝牙设备信息失败:', err);
} }
}); });
@ -352,7 +375,7 @@
} }
}); });
}, },
close(){ close() {
let vm = this; // this vm let vm = this; // this vm
uni.getNetworkType({ uni.getNetworkType({
success(res) { success(res) {
@ -368,7 +391,7 @@
// vm.remakr() // vm.remakr()
}, },
fail(err) { fail(err) {
uni.hideLoading() uni.hideLoading()
console.error('获取已连接蓝牙设备信息失败:', err); console.error('获取已连接蓝牙设备信息失败:', err);
} }
}); });
@ -378,7 +401,7 @@
} }
}); });
}, },
ring(){ ring() {
let vm = this; // this vm let vm = this; // this vm
uni.getNetworkType({ uni.getNetworkType({
success(res) { success(res) {
@ -394,7 +417,7 @@
// vm.remakr() // vm.remakr()
}, },
fail(err) { fail(err) {
uni.hideLoading() uni.hideLoading()
console.error('获取已连接蓝牙设备信息失败:', err); console.error('获取已连接蓝牙设备信息失败:', err);
} }
}); });
@ -407,32 +430,32 @@
btnyc() { btnyc() {
this.titleflag = false this.titleflag = false
}, },
// //
funListenDeviceMsgEvent: function(options) { funListenDeviceMsgEvent: function(options) {
switch (options.type) { switch (options.type) {
case xBlufi.XBLUFI_TYPE.TYPE_GET_DEVICE_LISTS: case xBlufi.XBLUFI_TYPE.TYPE_GET_DEVICE_LISTS:
if (options.result) { if (options.result) {
let devicesarr = options.data let devicesarr = options.data
// this.devicesList = options.data // this.devicesList = options.data
devicesarr.forEach(device => { devicesarr.forEach(device => {
// this.$u.get(`/app/device/${mac}/isBind`, data).then((res) => { // this.$u.get(`/app/device/${mac}/isBind`, data).then((res) => {
// if (res.data == false) { // if (res.data == false) {
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
this.devicesList = uniqueDevicesList; this.devicesList = uniqueDevicesList;
}); });
} }
break; break;
case xBlufi.XBLUFI_TYPE.TYPE_CONNECTED: case xBlufi.XBLUFI_TYPE.TYPE_CONNECTED:
console.log("连接回调:" + JSON.stringify(options)); console.log("连接回调:" + JSON.stringify(options));
if (options.result) { if (options.result) {
@ -441,13 +464,13 @@
title: '连接成功', title: '连接成功',
icon: 'none' icon: 'none'
}); { }); {
xBlufi.notifyInitBleEsp32({ xBlufi.notifyInitBleEsp32({
deviceId: options.data.deviceId deviceId: options.data.deviceId
}); });
xBlufi.listenDeviceMsgEvent(true, this.funListenDeviceMsgEvents); xBlufi.listenDeviceMsgEvent(true, this.funListenDeviceMsgEvents);
this.deviceIds = options.data.deviceId this.deviceIds = options.data.deviceId
this.name = options.data.name this.name = options.data.name
// //
@ -458,7 +481,7 @@
let systemInfo = uni.getSystemInfoSync(); let systemInfo = uni.getSystemInfoSync();
if (systemInfo.platform === 'android') { if (systemInfo.platform === 'android') {
// Android // Android
} else if (systemInfo.platform === 'ios') { } else if (systemInfo.platform === 'ios') {
// iOS // iOS
// uni.navigateTo({ // uni.navigateTo({
@ -468,27 +491,27 @@
} }
} }
} }
break; break;
case xBlufi.XBLUFI_TYPE.TYPE_RECIEVE_CUSTON_DATA: case xBlufi.XBLUFI_TYPE.TYPE_RECIEVE_CUSTON_DATA:
// this.ver_data = this.parseCustomData(options.data) // this.ver_data = this.parseCustomData(options.data)
if(options.data){ if (options.data) {
this.carstause=true this.carstause = true
} }
// console.log("1", this.ver_data); // console.log("1", this.ver_data);
break; break;
case xBlufi.XBLUFI_TYPE.TYPE_GET_DEVICE_LISTS_STOP: case xBlufi.XBLUFI_TYPE.TYPE_GET_DEVICE_LISTS_STOP:
if (options.result) { if (options.result) {
let uniqueDevicesList = Array.from(new Set(this.devicesList)); let uniqueDevicesList = Array.from(new Set(this.devicesList));
// "CTPOW" // "CTPOW"
let filteredDevices = uniqueDevicesList.filter(device => device.name.substring(0, 4) === let filteredDevices = uniqueDevicesList.filter(device => device.name.substring(0, 4) ===
"BBLE"); "BBLE");
// this.devicesList // this.devicesList
this.devicesList = filteredDevices; this.devicesList = filteredDevices;
// console.log('ok',this.devicesList); // console.log('ok',this.devicesList);
} else { } else {
// //
@ -498,12 +521,12 @@
// _this.setData({ // _this.setData({
// searching: false // searching: false
// }); // });
break; break;
} }
}, },
//4 //4
createBLEConnection(e) { createBLEConnection(e) {
console.log('调用了'); console.log('调用了');
@ -523,7 +546,7 @@
}); });
// for (var i = 0; i < this.devicesList.length; i++) { // for (var i = 0; i < this.devicesList.length; i++) {
// if (e.deviceId === this.devicesList[i].deviceId) { // if (e.deviceId === this.devicesList[i].deviceId) {
// uni.showLoading({ // uni.showLoading({
// title: '...' // title: '...'
// }); // });
@ -567,16 +590,16 @@
} }
}, 2000) }, 2000)
} }
}, },
funListenDeviceMsgEvents: function(options) { funListenDeviceMsgEvents: function(options) {
let that = this; let that = this;
switch (options.type) { switch (options.type) {
case xBlufi.XBLUFI_TYPE.TYPE_STATUS_CONNECTED: { case xBlufi.XBLUFI_TYPE.TYPE_STATUS_CONNECTED: {
console.log('状态', options.result) console.log('状态', options.result)
if( options.result==false){ if (options.result == false) {
this.carstause=false this.carstause = false
uni.showToast({ uni.showToast({
title: '设备断开链接,请重新点击蓝牙链接', title: '设备断开链接,请重新点击蓝牙链接',
icon: 'none' icon: 'none'
@ -592,11 +615,11 @@
// } // }
// }); // });
// this.statusflag = false // this.statusflag = false
uni.hideLoading(); uni.hideLoading();
} }
} }
break; break;
case xBlufi.XBLUFI_TYPE.TYPE_RECIEVE_MY_DATA: case xBlufi.XBLUFI_TYPE.TYPE_RECIEVE_MY_DATA:
this.loadPercent = options.data; this.loadPercent = options.data;
this.loadText = '文件读取中' this.loadText = '文件读取中'
@ -606,19 +629,19 @@
// this.isband = true // this.isband = true
// this.ver_data = this.parseCustomData(options.data) // this.ver_data = this.parseCustomData(options.data)
console.log("1收到设备发来的自定义数据结果", options.data); console.log("1收到设备发来的自定义数据结果", options.data);
if(options.data){ if (options.data) {
this.carstause=true this.carstause = true
} }
break; break;
case xBlufi.XBLUFI_TYPE.TYPE_INIT_ESP32_RESULT: case xBlufi.XBLUFI_TYPE.TYPE_INIT_ESP32_RESULT:
uni.hideLoading(); uni.hideLoading();
if (options.result) { if (options.result) {
console.log('初始化成功'); console.log('初始化成功');
} else { } else {
console.log('初始化失败'); console.log('初始化失败');
} }
break; break;
} }
@ -627,25 +650,25 @@
btnhd() { btnhd() {
this.tishiflag = false this.tishiflag = false
}, },
} }
} }
</script> </script>
@ -659,7 +682,8 @@
.page { .page {
padding-bottom: 250rpx; padding-bottom: 250rpx;
width: 750rpx; width: 750rpx;
.btn{
.btn {
margin: 160rpx auto; margin: 160rpx auto;
// position: fixed; // position: fixed;
display: flex; display: flex;
@ -671,15 +695,17 @@
height: 88rpx; height: 88rpx;
background: #FFCC25; background: #FFCC25;
border-radius: 20rpx 20rpx 20rpx 20rpx; border-radius: 20rpx 20rpx 20rpx 20rpx;
font-weight: 500; font-weight: 500;
font-size: 32rpx; font-size: 32rpx;
color: #FFFFFF; color: #FFFFFF;
} }
.tips{
.tips {
margin: 28rpx auto 0; margin: 28rpx auto 0;
width: 658rpx; width: 658rpx;
} }
.iptbox { .iptbox {
display: flex; display: flex;
align-items: center; align-items: center;
@ -691,31 +717,35 @@
background: #FFFFFF; background: #FFFFFF;
box-shadow: 0rpx 0rpx 8rpx 0rpx rgba(0, 0, 0, 0.15); box-shadow: 0rpx 0rpx 8rpx 0rpx rgba(0, 0, 0, 0.15);
border-radius: 20rpx 20rpx 20rpx 20rpx; border-radius: 20rpx 20rpx 20rpx 20rpx;
.qrcode{
.qrcode {
padding-right: 20rpx; padding-right: 20rpx;
border-right: 2rpx solid #D8D8D8; border-right: 2rpx solid #D8D8D8;
image{
image {
width: 54rpx; width: 54rpx;
height: 54rpx; height: 54rpx;
} }
} }
.ips { .ips {
width: 630rpx; width: 630rpx;
} }
image { image {
width: 18rpx; width: 18rpx;
height: 32rpx; height: 32rpx;
} }
.my-placeholder { .my-placeholder {
font-weight: 400; font-weight: 400;
font-size: 32rpx; font-size: 32rpx;
color: #808080; color: #808080;
} }
} }
.bot_btn{
.bot_btn {
position: fixed; position: fixed;
bottom: 0; bottom: 0;
display: flex; display: flex;
@ -725,12 +755,14 @@
// height: 330rpx; // height: 330rpx;
background: #fff; background: #fff;
// background: linear-gradient( 180deg, #FFFFFF 0%, rgba(255,255,255,0) 100%); // background: linear-gradient( 180deg, #FFFFFF 0%, rgba(255,255,255,0) 100%);
box-shadow: 0rpx 10rpx 64rpx 0rpx rgba(0,0,0,0.08); box-shadow: 0rpx 10rpx 64rpx 0rpx rgba(0, 0, 0, 0.08);
border-radius: 0rpx 0rpx 0rpx 0rpx; border-radius: 0rpx 0rpx 0rpx 0rpx;
.btn:nth-child(4n) { .btn:nth-child(4n) {
margin-right: 0; margin-right: 0;
} }
.btn1{
.btn1 {
margin-top: 10rpx; margin-top: 10rpx;
margin-right: 12rpx; margin-right: 12rpx;
display: flex; display: flex;
@ -746,8 +778,8 @@
color: #3D3D3D; color: #3D3D3D;
} }
} }
} }
</style> </style>

View File

@ -42,13 +42,13 @@
<view class="iconfont icon-xiangzuo" v-if="isCollapsed" @click="toggleOrderTips"></view> <view class="iconfont icon-xiangzuo" v-if="isCollapsed" @click="toggleOrderTips"></view>
</view> </view>
<view class="swiper_tips" style="background: rgba(255, 197, 197, 0.7);" v-if="netonlines==false"> <view class="swiper_tips" style="background: rgba(255, 197, 197, 0.7);" v-if="netonlines==false">
<view class="cont"> <view class="cont">
<image src="https://lxnapi.ccttiot.com/bike/img/static/uJ4bst6OYzPYD8iEtyCJ" mode=""></image> <image src="https://lxnapi.ccttiot.com/bike/img/static/uJ4bst6OYzPYD8iEtyCJ" mode=""></image>
<view class="scroll-container" ref="scrollContainer"> <view class="scroll-container" ref="scrollContainer">
<text class="txt" <text class="txt"
style="font-weight: 400;font-size: 28rpx;color: #444444;">当前网络不可用请检查你的网络设置</text> style="font-weight: 400;font-size: 28rpx;color: #444444;">当前网络不可用请检查你的网络设置</text>
<!-- Duplicate the text for seamless scrolling --> <!-- Duplicate the text for seamless scrolling -->
</view> </view>
</view> </view>
@ -321,7 +321,7 @@
<view class="changebiketip" @click="tochange()"> <view class="changebiketip" @click="tochange()">
换车骑行 <view class="iconfont icon-xiangyou1"> 换车骑行 <view class="iconfont icon-xiangyou1">
</view> </view>
</view> </view>
<view class="btn" style=" margin-right: 16rpx;" <view class="btn" style=" margin-right: 16rpx;"
@ -1056,7 +1056,7 @@
isupload: false, isupload: false,
showparkinfo: false, showparkinfo: false,
parkinfo: {}, parkinfo: {},
netonlines:false netonlines: false
} }
}, },
watch: { watch: {
@ -1181,14 +1181,14 @@
}); });
if (this.seeDetail == false) { if (this.seeDetail == false) {
let that = this let that = this
uni.getNetworkType({ uni.getNetworkType({
success: function(res) { success: function(res) {
console.log(res.networkType); // "wifi", "4g", "3g", "2g", "none" console.log(res.networkType); // "wifi", "4g", "3g", "2g", "none"
if (res.networkType == 'none') { if (res.networkType == 'none') {
that.netonlines = false that.netonlines = false
} else { } else {
that.netonlines = true that.netonlines = true
uni.getLocation({ uni.getLocation({
@ -1198,16 +1198,16 @@
// that.longitude = 117.074552 // that.longitude = 117.074552
// that.gps.latitude = 23.440359 // that.gps.latitude = 23.440359
// that.gps.longitude = 117.074552; // that.gps.longitude = 117.074552;
that.gps.latitude = lb.latitude; that.gps.latitude = lb.latitude;
that.gps.longitude = lb.longitude; that.gps.longitude = lb.longitude;
that.latitude = lb.latitude; that.latitude = lb.latitude;
that.longitude = lb.longitude; that.longitude = lb.longitude;
console.log(that.areaInfo, 'that.areaInfo'); console.log(that.areaInfo, 'that.areaInfo');
that.getArea() that.getArea()
if (that.qParam != 'null' && that.showagre == false) { if (that.qParam != 'null' && that.showagre == false) {
@ -1215,7 +1215,7 @@
console.log(qParam, 'qParamqParamqParam'); console.log(qParam, 'qParamqParamqParam');
// 2: URLq // 2: URLq
let decodedUrl = decodeURIComponent(qParam); let decodedUrl = decodeURIComponent(qParam);
// 3: 使URL // 3: 使URL
let sn = null; let sn = null;
let queryParams = decodedUrl.split('?')[1]; let queryParams = decodedUrl.split('?')[1];
@ -1230,10 +1230,10 @@
} }
that.sn = sn that.sn = sn
if (that.sn != '') { if (that.sn != '') {
setTimeout(() => { setTimeout(() => {
if (!that.orderinfo.status) { if (!that.orderinfo.status) {
that.deviceInfo(1) that.deviceInfo(1)
that.qParam = null that.qParam = null
@ -1244,13 +1244,13 @@
// this.showtcs=true // this.showtcs=true
} }
}, 700) }, 700)
} }
} }
// that.getmarks() // that.getmarks()
// //
}, },
fail: function(error) { fail: function(error) {
@ -1262,19 +1262,19 @@
// that.getmarks() // that.getmarks()
// //
} }
}) })
// console.log('');\ // console.log('');\
} }
} }
}); });
} else { } else {
@ -4354,7 +4354,9 @@
this.gps.sn = this.sn this.gps.sn = this.sn
} }
} }
if (this.sn != '') {
this.gps.sn = this.sn
}
setTimeout(() => { setTimeout(() => {
this.setMapScale() this.setMapScale()
}, 300) }, 300)
@ -4811,10 +4813,17 @@
duration: 4000 duration: 4000
}); });
} else if (this.deviceInfos.status == 1) { } else if (this.deviceInfos.status == 1) {
if (this.areaId != res.data.areaId) {
this.getArea()
}
// this.routePlanning(res.data.latitude, res.data.longitude) // this.routePlanning(res.data.latitude, res.data.longitude)
this.showdevice = true setTimeout(() => {
this.type = 1; this.showdevice = true
this.deviceIndex = 1; this.type = 1;
this.deviceIndex = 1;
}, 500)
} }
} }
} else { } else {
@ -4937,9 +4946,16 @@
// this.routePlanning(res.data // this.routePlanning(res.data
// .latitude, res.data // .latitude, res.data
// .longitude) // .longitude)
this.showdevice = true; if (this.areaId != res.data
this.type = 1; .areaId) {
this.deviceIndex = 1; this.getArea()
}
// this.routePlanning(res.data.latitude, res.data.longitude)
setTimeout(() => {
this.showdevice = true
this.type = 1;
this.deviceIndex = 1;
}, 500)
} }
} }
} else { } else {
@ -6241,6 +6257,7 @@
box-shadow: 0rpx 10rpx 64rpx 0rpx rgba(0, 0, 0, 0.08), 0rpx 10rpx 64rpx 0rpx rgba(0, 0, 0, 0.08); box-shadow: 0rpx 10rpx 64rpx 0rpx rgba(0, 0, 0, 0.08), 0rpx 10rpx 64rpx 0rpx rgba(0, 0, 0, 0.08);
border-radius: 0rpx 0rpx 0rpx 0rpx; border-radius: 0rpx 0rpx 0rpx 0rpx;
padding-top: 30rpx; padding-top: 30rpx;
.changebiketip { .changebiketip {
bottom: 40rpx; bottom: 40rpx;
left: 320rpx; left: 320rpx;
@ -6252,6 +6269,7 @@
font-size: 28rpx; font-size: 28rpx;
color: #3D3D3D; color: #3D3D3D;
} }
.btn { .btn {
display: flex; display: flex;
justify-content: center; justify-content: center;

View File

@ -18,7 +18,7 @@
</view> --> </view> -->
<view class="pages2" v-if="deptId==100&&pageindex==0"> <view class="pages2" v-if="deptId==100&&pageindex==0">
<view class="imgbox"> <view class="imgbox">
<image src="https://lxnapi.ccttiot.com/bike/img/static/uX6A5Dlyr4lvGFNuqfPK" mode=""></image> <image src="https://lxnapi.ccttiot.com/bike/img/static/umJTSzDVtnfpyYrZY0VJ" mode=""></image>
</view> </view>
<button class="button" open-type="getPhoneNumber" @getphonenumber="getPhoneNumber" <button class="button" open-type="getPhoneNumber" @getphonenumber="getPhoneNumber"
style="margin-top: 30rpx;"> style="margin-top: 30rpx;">