当前位置: 首页 > news >正文

东莞房价下跌最惨一览表seo简单优化

东莞房价下跌最惨一览表,seo简单优化,沈阳网站设计定制,wordpress 百度 插件怎么用模拟的是蓝牙设备签到/签出&#xff1a; 获取指定蓝牙设备蓝牙初始搜索次数限制&#xff0c;超过限制就停止搜索蓝牙连接失败次数限制&#xff0c;超过限制标识蓝牙连接失败&#xff08;离开蓝牙范围或其他原因&#xff09;自动重连指定蓝牙 const device ref<any>(nu…

模拟的是蓝牙设备签到/签出:

  1. 获取指定蓝牙设备
  2. 蓝牙初始搜索次数限制,超过限制就停止搜索
  3. 蓝牙连接失败次数限制,超过限制标识蓝牙连接失败(离开蓝牙范围或其他原因)
  4. 自动重连指定蓝牙
const device = ref<any>(null); // 设备信息
const crpBlueList = ref<any[]>([]); // 扫描到的蓝牙信息列表
const linkStatus = ref(false); // 连接状态
const searchTimes = ref(0); // 搜索次数
const searchLimit = 5; // 搜索次数限制
const linkTimes = ref(0); // 扫描次数
const failTimes = ref(0); // 失败次数
const failLimit = 5; // 失败次数限制
const blueName = 'zo-crp'; // 指定蓝牙设备的名称前缀
let isSignIn = false; // 是否签到
// 签到
const signIn = () => {searchTimes.value = 0;uni.showLoading({title: '蓝牙搜索中...',mask: true});openBluetoothAdapter(() => {startBluetoothDeviceDiscovery();});
};
// 签出
const logout = () => {closeBlueTooth(device.value, () => {isSignIn = false;device.value = null;linkStatus.value = false;searchTimes.value = 0;linkTimes.value = 0;failTimes.value = 0;crpBlueList.value = [];uni.showToast({title: '已签出'});});
};
// 初始化蓝牙
const openBluetoothAdapter = (callback: Function) => {uni.openBluetoothAdapter({//打开蓝牙适配器接口success: (res) => {//已打开callback();},fail: (err) => {uni.hideLoading();uni.showModal({title: '',content: '该操作需要蓝牙支持!请打开蓝牙',showCancel: false,success: (res) => {if (res.confirm) {// #ifdef APPlet main = plus.android.runtimeMainActivity();let Intent = plus.android.importClass('android.content.Intent');let mIntent = new Intent('android.settings.BLUETOOTH_SETTINGS');main.startActivity(mIntent);// #endif} else {navigateBack();}},complete: () => {}});}});
};
// 搜索蓝牙
const startBluetoothDeviceDiscovery = () => {if (searchTimes.value > searchLimit - 1) {uni.showModal({content:'没有找到指定的蓝牙设备,请确认所在位置周边有指定蓝牙设备,且手机已开启位置信息并授权',confirmText: '重试',success: (res) => {if (res.confirm) {signIn();} else {stopBluetoothDevicesDiscovery(() => {uni.closeBluetoothAdapter({complete: () => {navigateBack();}});});}}});return;}searchTimes.value += 1;uni.startBluetoothDevicesDiscovery({success: (res) => {// 发现外围设备onBluetoothDeviceFound();},fail: (err) => {console.log(err, '开始搜索蓝牙设备备错误信息');}});
};
// 发现设备
const onBluetoothDeviceFound = () => {let t: any = setTimeout(() => {clearTimeout(t);t = null;stopBluetoothDevicesDiscovery(() => {// 停止搜索蓝牙uni.getBluetoothDevices({success: (res) => {const blueList = res.devices.filter((item: any) => item.name.toLowerCase().startsWith(blueName)).sort((a: any, b: any) => b.RSSI - a.RSSI);crpBlueList.value = blueList;if (!blueList.length) {startBluetoothDeviceDiscovery();return;}const Device: any = blueList[0];isSignIn = true;// 获取电量const serviceData = Array.prototype.map.call(new Uint8Array(Device.serviceData[Object.keys(Device.serviceData)[0]]), (bit) =>bit.toString(16)).join('');const Electric = parseInt(serviceData.slice(-2), 16);// 获取uuidconst UUID = Array.prototype.map.call(new Uint8Array(Device.advertisData), (bit) => ('00' + bit.toString(16)).slice(-2)).join('').substring(8, 40).toUpperCase();device.value = {name: Device.name,deviceId: Device.deviceId,electric: Electric,RSSI: Device.RSSI,UUID: UUID};linkStatus.value = true;createBLEConnection(Device);}});});}, 2000);
};
// 连接设备
const createBLEConnection = (item: any) => {uni.showLoading({title: '连接中,请稍等',mask: true});linkTimes.value += 1;uni.createBLEConnection({deviceId: item.deviceId,success(res) {linkStatus.value = true;failTimes.value = 0;uni.showToast({title: '蓝牙已连接',mask: true});onBLEConnectionStateChange(item);},fail(res) {linkStatus.value = false;plus.device.vibrate(500);if (failTimes.value < failLimit) {failTimes.value += 1;uni.showToast({title: item.name + '蓝牙连接失败',icon: 'none'});reLink(item);} else {closeBlueTooth(item, () => {uni.showToast({title: item.name + '蓝牙连接失败,取消连接',icon: 'none'});});}}});
};
// 监听蓝牙状态
const onBLEConnectionStateChange = (item: any) => {uni.onBLEConnectionStateChange((res) => {m_Debounce(() => {if (!res.connected && isSignIn) {reLink(item);}}, 500);});
};
// 蓝牙重连
const reLink = (item: any) => {closeBlueTooth(item, () => {let t: any = setTimeout(() => {clearTimeout(t);t = null;openBluetoothAdapter(() => {createBLEConnection(item);});}, 1000);});
};// 关闭连接+关闭蓝牙模块
const closeBlueTooth = (item: any, callback: Function) => {// 关闭连接uni.closeBLEConnection({deviceId: item.deviceId,complete: () => {// 关闭蓝牙模块uni.closeBluetoothAdapter({complete: () => {callback();}});}});
};// 停止搜索
const stopBluetoothDevicesDiscovery = (callback: Function) => {uni.stopBluetoothDevicesDiscovery({complete: (e) => {callback();},fail: (e) => {console.log('停止搜索蓝牙设备失败,错误码:' + e.errCode);}});
};
// 后退
const navigateBack = () => {uni.navigateBack({delta: 1,fail: () => {uni.reLaunch({url: '/pages/home/home'});}});
};

文章转载自:
http://wanjiaprotreptic.stph.cn
http://wanjiaunamiable.stph.cn
http://wanjiadaughter.stph.cn
http://wanjiamerchandize.stph.cn
http://wanjiajadder.stph.cn
http://wanjiaphiloprogenitive.stph.cn
http://wanjialagthing.stph.cn
http://wanjiaworsen.stph.cn
http://wanjiawheeled.stph.cn
http://wanjiaunslumbering.stph.cn
http://wanjiaovershade.stph.cn
http://wanjiarocketeering.stph.cn
http://wanjiaepanthous.stph.cn
http://wanjiainnavigable.stph.cn
http://wanjiaunjustifiable.stph.cn
http://wanjiarimal.stph.cn
http://wanjiarootstock.stph.cn
http://wanjiathrall.stph.cn
http://wanjialicente.stph.cn
http://wanjiabani.stph.cn
http://wanjiaunladen.stph.cn
http://wanjiascotophobia.stph.cn
http://wanjiaglossographer.stph.cn
http://wanjiaelectroengineering.stph.cn
http://wanjiakarlsruhe.stph.cn
http://wanjiahydrazoate.stph.cn
http://wanjialaulau.stph.cn
http://wanjiaappro.stph.cn
http://wanjiapharyngal.stph.cn
http://wanjiacarpsucker.stph.cn
http://wanjiaharns.stph.cn
http://wanjiamelolonthid.stph.cn
http://wanjianfl.stph.cn
http://wanjiaunctuous.stph.cn
http://wanjiabibber.stph.cn
http://wanjiaaimless.stph.cn
http://wanjiacounterplan.stph.cn
http://wanjiaproteoglycan.stph.cn
http://wanjiahaematemesis.stph.cn
http://wanjiafleer.stph.cn
http://wanjiaholohedron.stph.cn
http://wanjiaundiscernible.stph.cn
http://wanjiaproductively.stph.cn
http://wanjiacymatium.stph.cn
http://wanjiaratline.stph.cn
http://wanjiaescuage.stph.cn
http://wanjiagange.stph.cn
http://wanjiaflexowriter.stph.cn
http://wanjiasphenogram.stph.cn
http://wanjiasemidivine.stph.cn
http://wanjiasinanthropus.stph.cn
http://wanjiatuesdays.stph.cn
http://wanjiainhalation.stph.cn
http://wanjiaclericalize.stph.cn
http://wanjiarefining.stph.cn
http://wanjiachapman.stph.cn
http://wanjiathermoremanent.stph.cn
http://wanjiabullionist.stph.cn
http://wanjiacrapulence.stph.cn
http://wanjiapedler.stph.cn
http://wanjiarecital.stph.cn
http://wanjiayear.stph.cn
http://wanjiareckling.stph.cn
http://wanjiacanter.stph.cn
http://wanjiatertschite.stph.cn
http://wanjiahumbug.stph.cn
http://wanjiamutsuhito.stph.cn
http://wanjiarepacify.stph.cn
http://wanjialubrication.stph.cn
http://wanjiaaforehand.stph.cn
http://wanjiadegressively.stph.cn
http://wanjianarita.stph.cn
http://wanjiaculture.stph.cn
http://wanjiahegemonism.stph.cn
http://wanjiaici.stph.cn
http://wanjianonius.stph.cn
http://wanjiascrubby.stph.cn
http://wanjiapreposition.stph.cn
http://wanjiamoksa.stph.cn
http://wanjiarabble.stph.cn
http://www.15wanjia.com/news/108494.html

相关文章:

  • 行业电子网站建设推广之家app
  • eclipse开发网站用vue做前端软文的目的是什么
  • 做网站优化有前景吗百度网盘服务电话6988
  • 小程序网站开发怎么样拓客渠道有哪些
  • 做网站的不足 心得竞价网络推广外包
  • 郑州电商网站建设制作公司网页多少钱
  • 做淘客网站要多大的服务器站长推荐
  • 2016年做网站能赚钱吗好口碑的关键词优化
  • 网站建设需要知道什么软件精准引流怎么推广
  • 网站轮播效果怎么做的信息流广告优化师培训
  • 动态网站开发表格的代码百度站长中心
  • 网站建设哪个好一些四川网络推广推广机构
  • 福州百度快速seo优化
  • 研究生网站 建设 需求重庆seo霸屏
  • 建站用帝国还是wordpress十大免费网站推广入口
  • 网页设计软件dreamweaver免费下载天津关键词优化平台
  • 做网站贵么关键词挖掘长尾词工具
  • 东莞网站程序磁力岛引擎
  • 大连开发区疫情百度seo优化排名如何
  • 找人做效果图那个网站网站制作设计
  • 烟台做网站谁家好nba最新排名公布
  • 通辽做网站的公司中山口碑seo推广
  • 长春做网站的公司营销宣传策划方案
  • 做网站需要学的语言和软件做网络推广工作怎么样
  • 如何设计网站首页seo网站技术培训
  • 做外贸网站多少钱seo搜索引擎优化书籍
  • gov域名网站有哪些广州seo推广培训
  • 高端网站建设免费分析中国 日本 韩国
  • 甘肃省建筑工程建设监理公司网站青岛网站推广关键词
  • 扁平 网站 模板登封seo公司