- 企业微信中调用打印机最后总是报10008怎么解决?
首先需要在此说明一下,我们这儿有需要要在企业微信中调用打签机,然后看了文档,文档中说是可以支持蓝牙。 所以我就开始尝试,但是尝试过程中发现用官方的那种(wx.writeBLECharacteristicValue({})这样)调用方法根本不能用,所以我就用invoke的方法去调用,发现可以正常使用,但是在最后输出进制流数据到打签机时,总是会报err_msg"writeBLECharacteristicValue:fail_systemerr"'errCode":10008的错误。 之后怀疑是因为特征值和服务ID有问题,遂把设备所有支持write的都试了一遍还是不行,绝望了,请求帮助。 PS:但是有一个特征值在小程序中用了就可以正常打签 [视频] 截出部分关键代码: //打签时候调用的方法 let data = { deviceId: that.deviceId, serviceId:that.writeServiceId, characteristicId:that.writeCharaterId, value: buf, } console.log('deviceId:' + that.deviceId) console.log('serviceId:' + that.writeServiceId) console.log('characteristicId:' + that.writeCharaterId) console.log('value:' + buf) this.$wx.writeBLECharacteristicValue(data).then(res => { if (currentPrint == printNum) { uni.showToast({ title: '已打印第' + currentPrint + '张成功', }) } }) /* 写入数据调用方法 */ writeBLECharacteristicValue({deviceId,serviceId,characteristicId,value}){ return new Promise((resolve,reject) => { wx.invoke('writeBLECharacteristicValue', {deviceId,serviceId,characteristicId,value}, res => { console.log(JSON.stringify(res)) if (res.err_msg == "writeBLECharacteristicValue:ok") { resolve(res) }else { reject('失败') } }); }) } [图片]
2021-01-14 - 企业微信H5:JS-SDK无法调用openBluetoothAdapter(初始化蓝牙模块)接口?
初始化蓝牙模块接口的api地址:https://work.weixin.qq.com/api/doc/90000/90136/90500#wx.openBluetoothAdapter 一开始我以为是我没有通过config接口注入权限的问题,后来我发现在附录-所有JS接口列表(api地址:https://work.weixin.qq.com/api/doc/90000/90136/90507) 中,并不包含openBluetoothAdapter接口,且设备(api地址:https://work.weixin.qq.com/api/doc/90000/90136/90498) 相关的接口在附录-所有JS接口列表中都没有展示。 另外,我在JS-SDK的使用说明(api地址:https://work.weixin.qq.com/api/doc/90000/90136/90514)中,官方步骤一中需要引入的jweixin-1.2.0.js文件中,也并没有搜索到对openBluetoothAdapter接口的初始化定义。 之后,我调用了附录-所有JS接口列表中含有的接口,结果都可以调用成功,而附录-所有JS接口列表中没有的接口,则没能成功调用。 我的疑惑是: 1.企业微信应用的H5页,到底能不能调用设备-蓝牙的相关接口; 2.如果官方给出的api确实有问题的话,那么有没有别的方法实现:在基于企业微信内的网页中,实现蓝牙连接及使用; 3.附录-所有JS接口列表中,明明写的是所有接口,但实际上包含的并不全,这到底啥情况。 以上,新手求教,谢谢各位大神 ps: 1.之后的调试过程中发现,wx.openBluetoothAdapter == undefined,所以并没能进success、fail、complete三个回调函数,所以没有返回值; 2.使用了 jweixin.js 的1.3.2、1.4.0、1.5.0、1.6.0等版本,且保证过程中没有浏览器缓存。 3. 使用了uniapp进行开发,使用的是import引入的方式
2020-08-18 - 在IOS下使用CSS3的动画,展示效果没有过程,直接展示最后的结果
先来描述需求: 让三个圆转圈,用户不点击的时候自己慢慢动,用户点击后快速转一会儿,接着再过一段时间后恢复慢慢转的状态。 再来描述问题: IOS设备下,用户点击后,动画并不会快速地转。 在仔细模拟了问题后,得出结论:在IOS设备上执行使用动态class绑定的CSS动画是不会有过程的,会直接展示动画的结果。 而在安卓和模拟器上完全没问题。 IOS运行环境: [图片] 以下是摘取出来的代码(有点长,还请多多谅解,谢谢!): HTML部分 <view class="panel2_footer"> <view class="panel2_footerBtn {{panel2FooterBtn == 'active' ? 'active' : ''}}" bindtap='tapFooterBtn'> <image class="panel2_a" src="../images/icons/icon-panel2_a.png"></image> <image class="panel2_b" src="../images/icons/icon-panel2_b.png"></image> <image class="panel2_c" src="../images/icons/icon-panel2_c.svg"></image> </view> </view> JS部分 Page({ data: { panel2FooterBtn:'' }, tapFooterBtn(){ if(this.data.panel2FooterBtn == 'active'){return} this.setData({ panel2FooterBtn: 'active' }); setTimeout(() => { this.setData({ panel2FooterBtn: '' }); }, 2800) } }) CSS部分 @keyframes panel2FooterBtnC { from {transform: rotate(0deg);} to {transform: rotate(360deg);} } @-webkit-keyframes panel2FooterBtnB { from {transform: rotate(360deg);} to {transform: rotate(0deg);} } .panel2_footer .panel2_footerBtn { position: absolute; left: 50%; bottom: 50%; transform: translate(-50%, 0); width: 318rpx; } .panel2_footer .panel2_footerBtn .panel2_a, .panel2_footer .panel2_footerBtn .panel2_c, .panel2_footer .panel2_footerBtn .panel2_b{ position: absolute; } .panel2_footer .panel2_footerBtn .panel2_a { left: 9%; width: 260rpx; height: 260rpx; bottom: -63px; -webkit-animation: panel2FooterBtnC 10s linear infinite; animation: panel2FooterBtnC 10s linear infinite; } .panel2_footer .panel2_footerBtn .panel2_b { left: 5%; width: 290rpx; height: 290rpx; bottom: -70px; -webkit-animation: panel2FooterBtnB 10s linear infinite; animation: panel2FooterBtnB 10s linear infinite; } .panel2_footer .panel2_footerBtn .panel2_c { left: 0%; width: 322rpx; height: 327rpx; bottom: -78px; -webkit-animation: panel2FooterBtnC 10s linear infinite; animation: panel2FooterBtnC 10s linear infinite; } .panel2_footer .panel2_footerBtn.active image { transition: all 1s; animation-duration: 2s; }
2020-06-07 - 在开发者工具中的JS文件长按5s后就会丢失内容?
开发者工具:1.021911180 操作平台:windows10 操作系统版本:18362.720 问题描述: 在修改了一个js文件后,长按ctrl+s以来保存,偶现该js文件被清空的问题 问题后果: 因为这个破问题我已经砸坏三个键盘两个鼠标,就差一台显示器了
2020-04-18 - 文档需要完善
https://developers.weixin.qq.com/miniprogram/dev/reference/configuration/app.html [图片]
2020-03-16