diff --git a/manifest.json b/manifest.json index 66725fc..5cd8fd9 100644 --- a/manifest.json +++ b/manifest.json @@ -62,7 +62,7 @@ }, "permission" : { "scope.userLocation" : { - "desc" : "你的位置信息将用来记录位置" + "desc" : "小程序将获取您的位置信息来查询附近可用设备" } }, "requiredPrivateInfos" : [ "getLocation", "chooseAddress", "chooseLocation" ] diff --git a/page_components/fuwu/index.vue b/page_components/fuwu/index.vue index 80574a0..8d78545 100644 --- a/page_components/fuwu/index.vue +++ b/page_components/fuwu/index.vue @@ -526,60 +526,62 @@ export default { // console.log(this.deviceId,Number(this.deviceId.slice(-1)) + 2,this.deviceId.slice(0, -1),this.deviceId.slice(0, -1) + ((Number(this.deviceId.slice(-1)) + 2))); let that = this if (that.deviceId != '') { - let systemInfo = uni.getSystemInfoSync() - if (systemInfo.platform == 'android') { - if(that.modelId == 'LX'){ - console.log('有wifi配网'); - let zuih = '' - if(that.deviceId.slice(-1) == 8){ - zuih = 'A' - }else if(that.deviceId.slice(-1) == 9){ - zuih = 'B' - }else if(that.deviceId.slice(-1) == 'A'){ - zuih = 'C' - }else if(that.deviceId.slice(-1) == 'B'){ - zuih = 'D' - }else if(that.deviceId.slice(-1) == 'C'){ - zuih = 'E' - }else if(that.deviceId.slice(-1) == 'D'){ - zuih = 'F' - } else{ - zuih = Number(that.deviceId.slice(-1)) + 2 - } - that.deviceId = that.deviceId.slice(0, -1) + zuih - console.log(that.modelId,zuih,that.deviceId.slice(0, -1),'...........') - xBlufi.notifyStartDiscoverBle({ - 'isStart': false - }) - console.log("进入蓝牙连接", that.deviceId) - console.log("进入that.name", that.name) - xBlufi.notifyConnectBle({ - isStart: true, - deviceId: that.deviceId, - name: that.name - }) - }else{ - console.log('无wifi配网'); - xBlufi.notifyStartDiscoverBle({ - 'isStart': false - }) - console.log("进入蓝牙连接", that.deviceId) - console.log("进入that.name", that.name) - xBlufi.notifyConnectBle({ - isStart: true, - deviceId: that.deviceId, - name: that.name - }) - } - } else if (systemInfo.platform == 'ios') { - // 当前设备是 iOS - that.findDevice() - } + that.findDevice() + // let systemInfo = uni.getSystemInfoSync() + // if (systemInfo.platform == 'android') { + // if(that.modelId == 'LX'){ + // console.log('有wifi配网'); + // let zuih = '' + // if(that.deviceId.slice(-1) == 8){ + // zuih = 'A' + // }else if(that.deviceId.slice(-1) == 9){ + // zuih = 'B' + // }else if(that.deviceId.slice(-1) == 'A'){ + // zuih = 'C' + // }else if(that.deviceId.slice(-1) == 'B'){ + // zuih = 'D' + // }else if(that.deviceId.slice(-1) == 'C'){ + // zuih = 'E' + // }else if(that.deviceId.slice(-1) == 'D'){ + // zuih = 'F' + // } else{ + // zuih = Number(that.deviceId.slice(-1)) + 2 + // } + // that.deviceId = that.deviceId.slice(0, -1) + zuih + // console.log(that.modelId,zuih,that.deviceId.slice(0, -1),'...........') + // xBlufi.notifyStartDiscoverBle({ + // 'isStart': false + // }) + // console.log("进入蓝牙连接", that.deviceId) + // console.log("进入that.name", that.name) + // xBlufi.notifyConnectBle({ + // isStart: true, + // deviceId: that.deviceId, + // name: that.name + // }) + // }else{ + // console.log('无wifi配网'); + // xBlufi.notifyStartDiscoverBle({ + // 'isStart': false + // }) + // console.log("进入蓝牙连接", that.deviceId) + // console.log("进入that.name", that.name) + // xBlufi.notifyConnectBle({ + // isStart: true, + // deviceId: that.deviceId, + // name: that.name + // }) + // } + // } else if (systemInfo.platform == 'ios') { + // // 当前设备是 iOS + // that.findDevice() + // } } } }, findDevice() { // 使用 find 方法查找匹配的设备 + console.log(this.devicesarr,'所有设备'); const matchedDevice = this.devicesarr.find(device => { console.log(device.name, this.mac, '111') console.log("IOSMAC", device) diff --git a/page_fenbao/statulist/myshop/shopxx/index.vue b/page_fenbao/statulist/myshop/shopxx/index.vue index c8ecfdf..5848d35 100644 --- a/page_fenbao/statulist/myshop/shopxx/index.vue +++ b/page_fenbao/statulist/myshop/shopxx/index.vue @@ -163,8 +163,8 @@ regiontext: '请选择省市区', regionvalue: '', selector: [], - latitude: '请输入纬度', - longitude: '请输入经度', + latitude: '', + longitude: '', shopname: '', yetime: '', lxname: '', @@ -316,13 +316,7 @@ icon: 'none', duration: 1000 }) - } else if (this.longitude == '请输入经度') { - uni.showToast({ - title: '请点击地图图标选择位置', - icon: 'none', - duration: 1000 - }) - } else if (this.xqdz == '') { + } else if (this.xqdz == '') { uni.showToast({ title: '请输入详细地址', icon: 'none', @@ -341,7 +335,7 @@ let data = { name: this.shopname, picture: urlString, - address: this.jtdz, + address: this.xqdz, lng: this.longitude, lat: this.latitude, businessTimeStart: this.ksyy, @@ -349,7 +343,7 @@ province: this.province, city: this.city, county: this.area, - specificAddress: this.xqdz, + // specificAddress: , contactName: this.shopname, contactMobile: this.lxphone, typeId: this.selectorvalue, diff --git a/page_user/sbdetail.vue b/page_user/sbdetail.vue index 2674dfd..e70a6d6 100644 --- a/page_user/sbdetail.vue +++ b/page_user/sbdetail.vue @@ -1435,11 +1435,11 @@ } else if (num == 5) { this.btnmsk = false let that = this - uni.openBluetoothAdapter({ + uni.openBluetoothAdapter({ success: function (res) { - uni.getLocation({ - type: 'wgs84', - success: (res) => { + // uni.getLocation({ + // type: 'wgs84', + // success: (res) => { if(that.deviceInfo.wifi == null){ let systemInfo = uni.getSystemInfoSync() if (systemInfo.platform == 'android') { @@ -1499,16 +1499,16 @@ }) } } - }, - fail: (err) => { - console.error('获取位置失败:', err) - uni.showToast({ - title: '位置信息未打开,无法配网,请授权后重试', - icon: 'none', - duration:2000 - }) - } - }) + // }, + // fail: (err) => { + // console.error('获取位置失败:', err) + // uni.showToast({ + // title: '位置信息未打开,无法配网,请授权后重试', + // icon: 'none', + // duration:2000 + // }) + // } + // }) }, fail: function (err) { console.error('蓝牙适配器初始化失败', err) diff --git a/pages/index/index.vue b/pages/index/index.vue index ea5f61d..95d1e56 100644 --- a/pages/index/index.vue +++ b/pages/index/index.vue @@ -345,7 +345,16 @@ onLoad() { this.pagenum = 1 this.getgroup() - this.getlist() + if(uni.getStorageSync('paixu')){ + console.log(uni.getStorageSync('paixu')); + this.paixutxt = uni.getStorageSync('paixu').label + this.pxzt = uni.getStorageSync('paixu').value + this.getlist() + }else{ + this.paixutxt = '名称排序' + this.pxzt = 'deviceName' + this.getlist() + } this.deviceId = uni.getStorageSync('deviceIds') this.name = uni.getStorageSync('name') let that = this @@ -388,11 +397,12 @@ console.log(uni.getStorageSync('paixu')); this.paixutxt = uni.getStorageSync('paixu').label this.pxzt = uni.getStorageSync('paixu').value + this.getlists() }else{ this.paixutxt = '名称排序' this.pxzt = 'deviceName' + this.getlists() } - this.getlists() },1000) if(uni.getStorageSync('lianjie')){ uni.removeStorageSync({ diff --git a/pages/shouye/index.vue b/pages/shouye/index.vue index 2a2021f..b31b000 100644 --- a/pages/shouye/index.vue +++ b/pages/shouye/index.vue @@ -177,8 +177,8 @@ second: false }, dateindex: 1, - latitude: '', // 初始纬度 - longitude: '', // 初始经度 + latitude: '39.9042', // 初始纬度 + longitude: '116.4074', // 初始经度 covers: [], // 覆盖物数组 jinweidu: '', userType: '', @@ -217,21 +217,22 @@ this.bangdingid = option.id } let that = this - wx.openBluetoothAdapter({ - success: function (res) { - console.log('蓝牙适配器初始化成功') - xBlufi.initXBlufi(1) - that.chushihua = 1 - }, - fail: function (err) { - uni.showToast({ - title: '蓝牙权限获取失败,请打开系统蓝牙和定位', - icon: 'none', - duration:3000 - }) - console.error('蓝牙适配器初始化失败,可能是因为没有权限', err) - } - }) + xBlufi.initXBlufi(1) + // wx.openBluetoothAdapter({ + // success: function (res) { + // console.log('蓝牙适配器初始化成功') + // xBlufi.initXBlufi(1) + // that.chushihua = 1 + // }, + // fail: function (err) { + // uni.showToast({ + // title: '蓝牙权限获取失败,请打开系统蓝牙和定位', + // icon: 'none', + // duration:3000 + // }) + // console.error('蓝牙适配器初始化失败,可能是因为没有权限', err) + // } + // }) }, // 分享到好友(会话) onShareAppMessage: function() { @@ -255,9 +256,9 @@ // this.getzf() this.gethuidaio() this.getshiy() - setTimeout(()=>{ - this.onControltap() - },1000) + // setTimeout(()=>{ + // this.onControltap() + // },30000) }, onReady() { this.mapContext = uni.createMapContext('map', this) @@ -581,6 +582,7 @@ }, btnindex(num) { + this.onControltap() if (this.wangluo = true) { //判断是否有网络在进行点击 if (num == 2) { uni.navigateTo({