- 同城配送配送费充值只能单个吗,可以充值一个总账户吗?
平台接入了同城配送 ,入驻的商家比较多,现在的问题是发现微信同城配送的门店运费需要单个单个的充值, 非常麻烦,而且每个门店需要的运力不同充值金额不好估算,能不能充值到一个公用账户上统一扣费,或者运费从商户号中扣除
09-28 - 小程序调用低耗蓝牙相关API,断开释放连接资源和重连失败?
当小程序第一次成功搜索到并了连接蓝牙后,成功调用wx.closeBLEConnection()断开蓝牙释放资源后,再次重新搜索连接蓝牙一直返回错误代码,(经过测试部分概率下 手动开关蓝牙再次搜索连接可以成功),我这里初步判断可能是wx.closeBLEConnection()调用后没有彻底断开蓝牙连接,导致再次搜索时无法连接,所以想问:小程序官方 是否有小程序彻底清除已连接的蓝牙连接资源的API或者解决这个问题的方案。调用wx.startBluetoothDevicesDiscovery() 能否搜索到已连接或者未成功 断开的蓝牙设备信息进行回调断开操作。 微信版本8.0.2,微信开发者工具版本1.05.2102010 //搜索蓝牙 function DiscoverBLE(ms) { return new Promise(function(resolve, reject) { if (m_Deviceid == "") { DevicesDiscovery(resolve, ms); } else { wx.closeBLEConnection({ deviceId: m_Deviceid, success: function(res) { console.log('DisconnectBLE', res) connectSuccess = ''; wx.closeBluetoothAdapter(); setTimeout(function() { DevicesDiscovery(resolve, ms); }, 2000); }, fail: (res) => { connectSuccess = ''; wx.closeBluetoothAdapter(); setTimeout(function() { DevicesDiscovery(resolve, ms); }, 2000); } }) receive_apdu = "" } }) } function ConnectDeviceid(s_Deviceid) { m_Deviceid = s_Deviceid; connectSuccess = ''; console.log('m_Deviceid:', m_Deviceid); wx.createBLEConnection({ deviceId: m_Deviceid, success: (res) => { console.log('createBLEConnection success:') console.log(' ', res) setTimeout(() => { getBLEDeviceServices(); }, 4000) wx.onBLEConnectionStateChange(function(res) { // 该方法回调中可以用于处理连接意外断开等异常情况 console.log(`device ${res.deviceId} state has changed, connected: ${res.connected}`); if ((!res.connected) && (connectSuccess == 1)) { DisconnectBLE(); } }) }, fail: (res) => { console.log('createBLEConnection fail:') console.log(' ', res) connectSuccess = '0'; //连接失败 if (res.errCode === 10003) { console.log('res.errCode === 10003') wx.closeBLEConnection({ deviceId: m_Deviceid, success: function(res) { console.log('DisconnectBLE success', res) connectSuccess = '0'; //蓝牙连接 }, fail: (res) => { console.log('DisconnectBLE fail', res) wx.closeBluetoothAdapter(); } }) } wx.showToast({ title: '连接失败', icon: '错误', duration: 2000 }) } }) } //检测连接配对 function CheckConnectBLE(mode) { return new Promise(function(resolve, reject) { var times = 0; var i = setInterval(function() { if (times >= 30) { resolve('0'); clearInterval(i) } else { console.log("times=", times); if (connectSuccess == '1') { times++; if (mode == 1) { CheckByMode1(); ReceiveCheckByMode1(2000, mode).then(function(_receive_apdu) { if (_receive_apdu == '01') { times = 30; resolve('1'); } }); } else if (mode == 2) { SendAPDU('00'); ReceiveAPDU(2000, mode).then(function(_receive_apdu) { if (_receive_apdu == '01') { times = 30; resolve('1'); } }); } } else if (connectSuccess == '0') { times = 30; resolve('0'); } else { console.log("wait connect..."); } } }, 2000); }); }
2021-04-07 - 华为mate30pro 屏幕适配
正常的css代码在其他机型和开发工具上调试都显示正常,但是在华为mate30pro的手机上就会出现css错乱
2020-04-11