不需要代码片段,你们随便找一个动画,点分享的时候动画都会停止,我看了好多别人的小程序也是这样的,另外wx.showLoading的时候,动画也会停止
小程序点击分享按钮时页面动画停止住,取消分享动画继续执行小程序点击分享按钮时页面动画停止住,取消分享动画继续执行 <button open-type='share' class="share_text animationSlow">分享</button> .animationSlow { width: 100rpx; height: 100rpx; background-color: orange; animation-name: myfirst; /*动画的名称 */ animation-duration: 4000ms; /*动画从开始到结束的时间*/ animation-timing-function: linear; /*动画执行快慢的参数*/ animation-iteration-count: infinite; /*动画执行多少次的参数*//*以下是兼容ios所需,参数意义与上相同*/ -webkit-animation-name: myfirst; -webkit-animation-duration: 4000ms; -webkit-animation-timing-function: linear; -webkit-animation-iteration-count: infinite; } @keyframes myfirst { /*开始转的角度*/ from { transform: rotate(0deg); }/*结束的角度*/ to { transform: rotate(360deg); } } /*兼容ios*/ @-webkit-keyframes myfirst { from { transform: rotate(0deg); } to { transform: rotate(360deg); } }
2019-08-09麻烦大佬们看看怎么解决
急急急!wx.onBLECharacteristicValueChange不回调安卓和ios在wx.notifyBLECharacteristicValueChange成功之后调用wx.onBLECharacteristicValueChange没有回调,具体代码请见代码片段链接,谢谢!
2019-07-19楼主是怎么解决的呀?
wx.onBLECharacteristicValueChange 在安卓无回调help,wx.onBLECharacteristicValueChange 在android上无法接受返回值,notify开启是成功的,有趣的是在iOS下面一切正常,问了好多人,又说开启notify之后立即就调用了write会发生问题,尝试了延迟和重发依旧没有任何返回值,下图是测试返回的结果 ···························································································································· [图片] 上图是在ios设备的截图,能接收到返回值 ·································································································· [图片] 这实在android设备的,没有返回值 ··································································································· - 求问技术支持,这问题该如何解决,是否有解决方案,下面贴出我的代码,帮忙看看是不是我写的有问题 [代码]Page({[代码] [代码] [代码][代码]/** 页面的初始数据 */[代码][代码] [代码][代码]data: {[代码][代码] [代码][代码]deviceId: [代码][代码]'FD:76:74:35:99:92'[代码][代码],[代码][代码] [代码][代码]serviceId: [代码][代码]''[代码][代码],[代码][代码] [代码][代码]services: [],[代码][代码] [代码][代码]writeCharacteristicsId: [代码][代码]""[代码][代码], [代码][代码]// 可写特征值uuid[代码][代码] [代码][代码]readCharacteristicsId: [代码][代码]""[代码][代码], [代码][代码]// 可读特征值uuid[代码][代码] [代码][代码]notifyCharacteristicsId: [代码][代码]""[代码][代码], [代码][代码]// 通知特征值uuid[代码][代码] [代码][代码]},[代码] [代码] [代码][代码]/** 生命周期函数--监听页面加载 */[代码][代码] [代码][代码]onLoad: [代码][代码]function[代码] [代码](opt) {[代码][代码] [代码][代码]//初始化蓝牙适配器[代码][代码] [代码][代码]wx.openBluetoothAdapter({[代码][代码] [代码][代码]success: [代码][代码]function[代码] [代码](res) {[代码][代码] [代码][代码]console.log([代码][代码]"初始化蓝牙适配器成功"[代码][代码], res);[代码][代码] [代码][代码]},[代码][代码] [代码][代码]fail: [代码][代码]function[代码] [代码](err) {[代码][代码] [代码][代码]console.log([代码][代码]"初始化失败"[代码][代码], err)[代码][代码] [代码][代码]}[代码][代码] [代码][代码]})[代码] [代码] [代码][代码]//监听蓝牙适配器状态变化事件[代码][代码] [代码][代码]wx.onBluetoothAdapterStateChange(res => {[代码][代码] [代码][代码]console.log([代码][代码]"状态变化"[代码][代码], res)[代码][代码] [代码][代码]})[代码][代码] [代码][代码]},[代码] [代码] [代码][代码]start: [代码][代码]function[代码][代码]() {[代码][代码] [代码][代码]let that = [代码][代码]this[代码][代码];[代码] [代码] [代码][代码]console.log([代码][代码]'监听设备的连接状态'[代码][代码]);[代码] [代码] [代码][代码]/** 连接设备 */[代码][代码] [代码][代码]wx.createBLEConnection({[代码][代码] [代码][代码]deviceId: that.data.deviceId,[代码][代码] [代码][代码]success: [代码][代码]function[代码] [代码](res) {[代码][代码] [代码][代码]console.log([代码][代码]'连接设备'[代码][代码], res);[代码] [代码] [代码][代码]/** 监听设备的连接状态 */[代码][代码] [代码][代码]wx.onBLEConnectionStateChanged([代码][代码]function[代码] [代码](res) {[代码][代码] [代码][代码]console.log(`device ${res.deviceId} state has changed, connected: ${res.connected}`)[代码][代码] [代码][代码]});[代码] [代码] [代码][代码]/** 连接成功,后开始获取设备的服务列表 */[代码][代码] [代码][代码]wx.getBLEDeviceServices({[代码][代码] [代码][代码]deviceId: that.data.deviceId,[代码][代码] [代码][代码]success: [代码][代码]function[代码] [代码](res) {[代码][代码] [代码][代码]console.log([代码][代码]'device services:'[代码][代码], res);[代码] [代码] [代码][代码]that.setData({ services: res.services, serviceId: res.services[0].uuid }, () => {[代码] [代码] [代码][代码]wx.getBLEDeviceCharacteristics({[代码][代码] [代码][代码]deviceId: that.data.deviceId,[代码][代码] [代码][代码]serviceId: that.data.serviceId,[代码][代码] [代码][代码]success: [代码][代码]function[代码] [代码](res) {[代码][代码] [代码][代码]console.log([代码][代码]'device getBLEDeviceCharacteristics:'[代码][代码], res.characteristics);[代码] [代码] [代码][代码]for[代码] [代码]([代码][代码]var[代码] [代码]i = 0; i < res.characteristics.length; i++) {[代码][代码] [代码][代码]if[代码] [代码](res.characteristics[i].properties.notify) {[代码][代码] [代码][代码]that.setData({[代码][代码] [代码][代码]notifyCharacteristicsId: res.characteristics[i].uuid[代码][代码] [代码][代码]})[代码][代码] [代码][代码]}[代码][代码] [代码][代码]if[代码] [代码](res.characteristics[i].properties.write) {[代码][代码] [代码][代码]that.setData({[代码][代码] [代码][代码]writeCharacteristicsId: res.characteristics[i].uuid[代码][代码] [代码][代码]})[代码][代码] [代码][代码]}[代码][代码] [代码][代码]if[代码] [代码](res.characteristics[i].properties.read) {[代码][代码] [代码][代码]that.setData({[代码][代码] [代码][代码]readCharacteristicsId: res.characteristics[i].uuid[代码][代码] [代码][代码]})[代码][代码] [代码][代码]}[代码][代码] [代码][代码]}[代码] [代码] [代码][代码]/** 顺序开发设备特征notifiy */[代码][代码] [代码][代码]wx.notifyBLECharacteristicValueChanged({[代码][代码] [代码][代码]deviceId: that.data.deviceId,[代码][代码] [代码][代码]serviceId: that.data.serviceId,[代码][代码] [代码][代码]characteristicId: that.data.notifyCharacteristicsId,[代码][代码] [代码][代码]state: [代码][代码]true[代码][代码],[代码][代码] [代码][代码]success: [代码][代码]function[代码] [代码](res) {[代码][代码] [代码][代码]console.log([代码][代码]'notifyBLECharacteristicValueChanged success'[代码][代码], res);[代码][代码] [代码][代码]},[代码][代码] [代码][代码]fail: [代码][代码]function[代码] [代码](res) { console.log([代码][代码]'notifyBLECharacteristicValueChanged fail :'[代码][代码], res) },[代码][代码] [代码][代码]complete: [代码][代码]function[代码] [代码](res) { }[代码][代码] [代码][代码]});[代码] [代码] [代码][代码]/** 回调获取 设备发过来的数据 */[代码][代码] [代码][代码]wx.onBLECharacteristicValueChange([代码][代码]function[代码] [代码](res) {[代码][代码] [代码][代码]console.log([代码][代码]'characteristic value comed:'[代码][代码], res.value);[代码][代码] [代码][代码]//{value: ArrayBuffer, deviceId: "D8:00:D2:4F:24:17", serviceId: "ba11f08c-5f14-0b0d-1080-007cbe238851-0x600000460240", characteristicId: "0000cd04-0000-1000-8000-00805f9b34fb-0x60800069fb80"}[代码] [代码] [代码][代码]let buffer = res.value[代码][代码] [代码][代码]let dataView = [代码][代码]new[代码] [代码]DataView(buffer)[代码][代码] [代码][代码]let dataResult = [][代码][代码] [代码][代码]for[代码] [代码](let i = 0; i < dataView.byteLength; i++) {[代码][代码] [代码][代码]dataResult.push(dataView.getUint8(i).toString(16))[代码][代码] [代码][代码]}[代码][代码] [代码][代码]const result = dataResult[代码][代码] [代码][代码]console.log(result);[代码][代码] [代码][代码]});[代码] [代码] [代码][代码]/** 发送开锁命令 */[代码][代码] [代码][代码]that.send();[代码] [代码] [代码][代码]}, fail: [代码][代码]function[代码] [代码](res) {[代码][代码] [代码][代码]console.log(res);[代码][代码] [代码][代码]}[代码][代码] [代码][代码]})[代码] [代码] [代码][代码]});[代码][代码] [代码][代码]}[代码][代码] [代码][代码]})[代码][代码] [代码][代码]},[代码][代码] [代码][代码]fail: [代码][代码]function[代码] [代码](res) {[代码][代码] [代码][代码]console.log([代码][代码]'失败'[代码][代码], res);[代码][代码] [代码][代码]}[代码][代码] [代码][代码]})[代码][代码] [代码][代码]},[代码] [代码] [代码][代码]/** 发送 数据到设备中 */[代码][代码] [代码][代码]send: [代码][代码]function[代码] [代码]() {[代码][代码] [代码][代码]let that = [代码][代码]this[代码][代码], hex = [代码][代码]'100031B0000018FFFFFFFF0000008900'[代码][代码];[代码][代码] [代码][代码]const typedArray = [代码][代码]new[代码] [代码]Uint8Array(hex.match(/[\da-f]{2}/gi).map([代码][代码]function[代码] [代码](h) { [代码][代码]return[代码] [代码]parseInt(h, 16) }))[代码][代码] [代码][代码]console.log(typedArray);[代码][代码] [代码][代码]const buffer1 = typedArray.buffer[代码][代码] [代码][代码]console.log(buffer1)[代码] [代码] [代码][代码]wx.writeBLECharacteristicValue({[代码][代码] [代码][代码]deviceId: that.data.deviceId,[代码][代码] [代码][代码]serviceId: that.data.serviceId,[代码][代码] [代码][代码]characteristicId: that.data.writeCharacteristicsId,[代码][代码] [代码][代码]value: buffer1,[代码] [代码] [代码][代码]success: [代码][代码]function[代码] [代码](res) {[代码][代码] [代码][代码]console.log([代码][代码]"success 指令发送成功"[代码][代码]);[代码][代码] [代码][代码]console.log(res);[代码] [代码] [代码][代码]/** 读取设备 */[代码][代码] [代码][代码]// setTimeout(() => {[代码][代码] [代码][代码]// wx.readBLECharacteristicValue({[代码][代码] [代码][代码]// deviceId: that.data.deviceId,[代码][代码] [代码][代码]// serviceId: that.data.serviceId,[代码][代码] [代码][代码]// characteristicId: that.data.readCharacteristicsId,[代码][代码] [代码][代码]// success: function (res) {[代码][代码] [代码][代码]// console.log('readBLECharacteristicValue:', res);[代码][代码] [代码][代码]// }[代码][代码] [代码][代码]// })[代码][代码] [代码][代码]// }, 3000)[代码][代码] [代码][代码]},[代码][代码] [代码][代码]fail: [代码][代码]function[代码] [代码](res) { console.log(res); }[代码][代码] [代码][代码]})[代码][代码] [代码][代码]},[代码] [代码] [代码][代码]/** 生命周期函数--监听页面初次渲染完成 */[代码][代码] [代码][代码]onReady: [代码][代码]function[代码] [代码]() { },[代码] [代码] [代码][代码]/** 生命周期函数--监听页面显示 */[代码][代码] [代码][代码]onShow: [代码][代码]function[代码] [代码]() { },[代码] [代码] [代码][代码]/** 生命周期函数--监听页面隐藏 */[代码][代码] [代码][代码]onHide: [代码][代码]function[代码] [代码]() { },[代码] [代码] [代码][代码]/** 生命周期函数--监听页面卸载, 同时断开蓝牙 */[代码][代码] [代码][代码]onUnload: [代码][代码]function[代码] [代码]() {[代码][代码] [代码][代码]let me = [代码][代码]this[代码][代码];[代码][代码] [代码][代码]wx.closeBLEConnection({[代码][代码] [代码][代码]deviceId: me.data.deviceId,[代码][代码] [代码][代码]success: [代码][代码]function[代码] [代码](res) {[代码][代码] [代码][代码]console.log([代码][代码]"蓝牙断开"[代码][代码], res)[代码][代码] [代码][代码]me.setData({ deviceId: [代码][代码]""[代码][代码], })[代码][代码] [代码][代码]}[代码][代码] [代码][代码]})[代码][代码] [代码][代码]},[代码] [代码]})[代码] 在线等。
2019-07-18请问楼主解决了吗?
微信小程序低功耗蓝牙订阅特征值成功后无法收到回调我连接的是一个蓝牙体温计,在调用wx.notifyBLECharacteristicValueChange订阅成功后,调用 wx.onBLECharacteristicValueChange监听特征值变化,之后测量体温成功后无法收到回调,所有具有notify的特征值我都试过了,都不行。这是什么原因呢,有什么结局方案? [图片]
2019-07-18你的纯网页通过审核了吗?
小程序web-view能做首页吗- 需求的场景描述(希望解决的问题) 小程序首页用web-view能审核通过吗? - 希望提供的能力 小程序纯web-view开发
2019-05-08