错误提示信息: [图片] 并且在调用过程中唤起了OS蓝牙提示信息: [图片]
wx.makeBluetoothPair 调用后返回 status:-1?小程序搜索到BLE设备,并获取了特征值连接后,不能够按照预期使用 wx.makeBluetoothPair 代码片段摘取: 1、查找到BLE设备,并通过 wx.onBluetoothDeviceFound 查找到指定设备 2、根据搜索到的设备信息,取得deviceId [图片] 返回结果 :fail {status: -1 }
2020-12-25wx.onBluetoothDeviceFound 查找到BLE设备,取得 device.deviceId [图片] wx.makeBluetoothPair fail:返回 status:-1
BLE主动发起加密请求的API?您好,在API文档中看到有makepair接口,需要输入PIN码。 在BLE双方连接后,需要有一方先发起加密请求,请问makepair会发起加密请求的SMP包给对端设备吗? 目前我们抓包发现makepair并没有发起SMP加密请求包,请问BLE的API中是否有发起SMP包的API供开发者调用? makepair的介绍少之又少,我的理解是此API用来接管某一方发起加密后,手机端输入PIN码的动作
2020-12-23对 BLE write characteristicId 有什么特殊要求么?
writeBleCharacteristic iphone6p 与ble 设备链接,返回信息错误?发送buffer信息成功,蓝牙设备能正确接收信息,但是writeBleCharacteristic api 一直返回错误: [图片] 后测试固定数据写入,使用iphone6p手机依然写入失败 let buffer= new ArrayBuffer(4) let dataView = new DataView(buffer) dataView.setUint8(0, 0x1b) dataView.setUint8(1, 0x84) dataView.setUint8(2, 0x00) dataView.setUint8(3, 0x84) wx.writeBLECharacteristicValue({ deviceId: this._deviceId, serviceId: this._serviceId, characteristicId: this._characteristicId, value: buffer, success: (res) => { this.setPrcess(` uuid:${this._characteristicId}写入二进制数据成功: ${res.errMsg}`) console.log('writeBLECharacteristicValue success', res.errMsg) }, fail: (res) => { this.setPrcess(` uuid:${this._characteristicId}写入二进制数据失败`) this.setData({ writeErrorMsg: `写入失败:${e.errMsg}` }) }
2020-04-28 unionid 是与打开小程序的微信号相关的。是微信在公众平台上操作的唯一标示。
同一开放平台不同主体小程序unionid是否相同同一开放平台绑定了不同主体的小程序和公众号,请问他们的unionid是否相同,如果相同的话,怎么获取,谢谢
2018-06-20我的是华为荣耀,我的代码片段里有。正常输入应该是。133 3333 3333 这种格式的。但是android将空格去掉了,其他机型不会的
input 组件问题小程序input 组件中 type 类型:如果选了 number 则 android中 通过wxs处理后返回的 ➕空格处理,会被去掉空格, 此问题在ios没有出现。请尽快调整,谢谢。 type 有效值: 值说明text文本输入键盘number数字输入键盘
2018-05-31这个问题还不是统一不支持,我这边只有IOS 10.2.1(14D27) 不支持Object.values()
弹窗时模拟器正常,真机报错弹不出真机报错 Error:Expect START descriptor with depth 2 but get another /wxf.../0/page_frame.html:15:6835 由下面的方法触发的 [代码]setModalStatus(e) {[代码][代码] [代码][代码]this[代码][代码].timers && clearTimeout([代码][代码]this[代码][代码].timers);[代码][代码] [代码][代码]const animation = wx.createAnimation({[代码][代码] [代码][代码]duration: 200,[代码][代码] [代码][代码]timingFunction: [代码][代码]'linear'[代码][代码],[代码][代码] [代码][代码]delay: 0,[代码][代码] [代码][代码]});[代码][代码] [代码][代码]this[代码][代码].animation = animation;[代码][代码] [代码][代码]const window_height = getIn(getApp(), [[代码][代码]'globalData'[代码][代码], [代码][代码]'window_height'[代码][代码]]);[代码][代码] [代码][代码]animation.translateY(window_height).step();[代码][代码] [代码][代码]const _height = 0;[代码][代码] [代码][代码]this[代码][代码].setData({ animationData: animation.export() });[代码][代码] [代码][代码]if[代码] [代码](e.currentTarget.dataset.status == 1) {[代码][代码] [代码][代码]//获取弹出数据[代码][代码] [代码][代码]let idx = e.currentTarget.dataset.index;[代码][代码] [代码][代码]if[代码] [代码](getIn([代码][代码]this[代码][代码].data.orderObject,[[代码][代码]'coupon'[代码][代码],idx])){[代码][代码] [代码][代码]const coupon = {[代码][代码] [代码][代码]selected: [代码][代码]this[代码][代码].data.coupon.selected,[代码][代码] [代码][代码]list: [代码][代码]this[代码][代码].data.orderObject.coupon[idx].coupon_list,[代码][代码] [代码][代码]muid_mtype: idx[代码][代码] [代码][代码]}[代码][代码] [代码][代码]this[代码][代码].setData({ coupon, showModalStatus: [代码][代码]true[代码] [代码]});[代码][代码] [代码][代码]}[代码][代码]else[代码][代码]{[代码][代码] [代码][代码]return[代码] [代码]false[代码][代码];[代码][代码] [代码][代码]}[代码][代码] [代码][代码]}[代码][代码] [代码][代码]this[代码][代码].times = setTimeout(() => {[代码][代码] [代码][代码]animation.translateY(_height).step();[代码][代码] [代码][代码]this[代码][代码].setData({[代码][代码] [代码][代码]animationData: animation.export(),[代码][代码] [代码][代码]});[代码][代码] [代码][代码]if[代码] [代码](e.currentTarget.dataset.status == 0) {[代码][代码] [代码][代码]//刷新每个店铺的结算价格[代码][代码] [代码][代码]let total_member_total = 0.00;[代码][代码] [代码][代码]Object.values([代码][代码]this[代码][代码].data.orderObject.data).map((o)=>{[代码][代码] [代码][代码]total_member_total += parseFloat(o.member_total, 2);[代码][代码] [代码][代码]});[代码][代码] [代码][代码]this[代码][代码].setData([代码][代码] [代码][代码]{[代码][代码] [代码][代码]'orderObject.total_member_total'[代码][代码]: total_member_total,[代码][代码] [代码][代码]showModalStatus: [代码][代码]false[代码][代码] [代码][代码]}[代码][代码] [代码][代码]);[代码][代码] [代码][代码]this[代码][代码].getTotalPrice([代码][代码]this[代码][代码].data.countMoney, [代码][代码]this[代码][代码].freight);[代码][代码] [代码][代码]}[代码][代码] [代码][代码]}, 200);[代码][代码] [代码][代码]},[代码] [代码] [代码][代码]// 提交订单[代码][代码] [代码][代码]submitOrder() {[代码][代码] [代码][代码]const token = getIn([代码][代码]this[代码][代码].data, [[代码][代码]'auth'[代码][代码], [代码][代码]'token'[代码][代码]]);[代码][代码] [代码][代码]// const token = "8e401730f575dc80f4b612fc8f85f7d8";[代码][代码] [代码][代码]const address_id = getIn([代码][代码]this[代码][代码].data, [[代码][代码]'addressObject'[代码][代码], [代码][代码]'id'[代码][代码]]);[代码][代码] [代码][代码]const _this = [代码][代码]this[代码][代码];[代码][代码] [代码][代码]if[代码] [代码](!address_id) {[代码][代码] [代码][代码]showFail([代码][代码]'请选择收货地址'[代码][代码]);[代码][代码] [代码][代码]}[代码][代码] [代码][代码]if[代码] [代码](![代码][代码]this[代码][代码].data.isAreaAddress) {[代码][代码] [代码][代码]showFail([代码][代码]'收货地址不在产品销售区域'[代码][代码]);[代码][代码] [代码][代码]}[代码][代码] [代码][代码]wx.showLoading();[代码][代码] [代码][代码]const order_client = 5;[代码][代码] [代码][代码]const exchange_score = [代码][代码]this[代码][代码].data.scoreValue;[代码][代码] [代码][代码]const cart = getIn([代码][代码]this[代码][代码].data, [[代码][代码]'orderObject'[代码][代码], [代码][代码]'cart_product'[代码][代码]]);[代码][代码] [代码][代码]const remark = []; [代码][代码]// 留言[代码][代码] [代码][代码]//处理选择的优惠券---begin[代码][代码] [代码][代码]const selected = [代码][代码]this[代码][代码].data.coupon.selected;[代码][代码] [代码][代码]const selected_arr = [];[代码][代码] [代码][代码]Object.keys(selected).map((x) => {[代码][代码] [代码][代码]selected_arr.push(selected[x]+[代码][代码]'-'[代码][代码]+x);[代码][代码] [代码][代码]})[代码][代码] [代码][代码]const coupon = selected_arr.join([代码][代码]','[代码][代码]);[代码][代码] [代码][代码]//---over[代码][代码] [代码][代码]const params = {[代码][代码] [代码][代码]token, address_id, order_client, exchange_score, cart, remark, coupon, shipping_type: 1[代码][代码] [代码][代码]};[代码][代码] [代码][代码]this[代码][代码].createOrder(params, (status, result) => {[代码][代码] [代码][代码]if[代码] [代码](status == SUCCESS) {[代码][代码] [代码][代码]const order_id = result.data.order_ids.join && result.data.order_ids.join([代码][代码]','[代码][代码]);[代码][代码] [代码][代码]const pay_way = 2;[代码][代码] [代码][代码]const trade_type = [代码][代码]'JSAPI'[代码][代码];[代码][代码] [代码][代码]const domain = getIn(config, [[代码][代码]'domain'[代码][代码]]);[代码][代码] [代码][代码]const openid = getIn([代码][代码]this[代码][代码].data.auth, [[代码][代码]'user'[代码][代码], [代码][代码]'openid'[代码][代码]]);[代码][代码] [代码][代码]const payParams = {[代码][代码] [代码][代码]token, order_id, pay_way, trade_type, domain, openid,[代码][代码] [代码][代码]};[代码][代码] [代码][代码]const queryString = `id=${order_id}`;[代码][代码] [代码][代码]// 刷新购物车[代码][代码] [代码][代码]notify && notify([代码][代码]'updateShippingCart'[代码][代码]);[代码][代码] [代码][代码]this[代码][代码].fetchPayOrder(token, payParams, (status, result) => {[代码][代码] [代码][代码]if[代码] [代码](status == SUCCESS) {[代码][代码] [代码][代码]wx.requestPayment({[代码][代码] [代码][代码]timeStamp: getIn(result, [[代码][代码]'data'[代码][代码], [代码][代码]'times'[代码][代码]]),[代码][代码] [代码][代码]nonceStr: getIn(result, [[代码][代码]'data'[代码][代码], [代码][代码]'nonce_str'[代码][代码]]),[代码][代码] [代码][代码]package: getIn(result, [[代码][代码]'data'[代码][代码], [代码][代码]'prepay_id'[代码][代码]]),[代码][代码] [代码][代码]signType: [代码][代码]'MD5'[代码][代码],[代码][代码] [代码][代码]paySign: getIn(result, [[代码][代码]'data'[代码][代码], [代码][代码]'sign'[代码][代码]]),[代码][代码] [代码][代码]success(res) {[代码][代码] [代码][代码]_this.onRedirectToOrder(ORDER_DETAIL_PATH, queryString);[代码][代码] [代码][代码]},[代码][代码] [代码][代码]fail(res) {[代码][代码] [代码][代码]_this.onRedirectToOrder(ORDER_DETAIL_PATH, queryString);[代码][代码] [代码][代码]},[代码][代码] [代码][代码]complete(res) {[代码][代码] [代码][代码]wx.hideLoading();[代码][代码] [代码][代码]},[代码][代码] [代码][代码]});[代码][代码] [代码][代码]} [代码][代码]else[代码] [代码]if[代码] [代码](status == FAIL) {[代码][代码] [代码][代码]wx.hideLoading();[代码][代码] [代码][代码]_this.onRedirectToOrder(ORDER_DETAIL_PATH, queryString);[代码][代码] [代码][代码]}[代码][代码] [代码][代码]});[代码][代码] [代码][代码]} [代码][代码]else[代码] [代码]if[代码] [代码](status == FAIL) {[代码][代码] [代码][代码]wx.hideLoading();[代码][代码] [代码][代码]showFail([代码][代码]'提交订单失败'[代码][代码]);[代码][代码] [代码][代码]}[代码][代码] [代码][代码]});[代码][代码] [代码][代码]},[代码][代码] [代码][代码]onRedirectToOrder(pathname, queryString) {[代码][代码] [代码][代码]global.navigateHelper && global.navigateHelper.redirectTo && global.navigateHelper.redirectTo({ pathname, queryString });[代码][代码] [代码][代码]},[代码][代码]};[代码]由下面wxml 的优惠方式触发 [代码]<[代码][代码]view[代码] [代码]class[代码][代码]=[代码][代码]"container"[代码][代码]>[代码][代码] [代码][代码]<[代码][代码]view[代码] [代码]style[代码][代码]=[代码][代码]"flex:1;margin-bottom: 50px"[代码][代码]>[代码][代码] [代码][代码]<[代码][代码]import[代码] [代码]src[代码][代码]=[代码][代码]"./cell/OrderAddressCell.wxml"[代码] [代码]/>[代码][代码] [代码][代码]<[代码][代码]template[代码] [代码]is[代码][代码]=[代码][代码]"OrderAddressCell"[代码] [代码]data[代码][代码]=[代码][代码]"{{window_width, ...addressObject}}"[代码] [代码]/>[代码] [代码] [代码][代码]<[代码][代码]view[代码] [代码]wx:for[代码][代码]=[代码][代码]"{{orderObject.data}}"[代码] [代码]wx:for-index[代码][代码]=[代码][代码]"idx"[代码] [代码]wx:key[代码][代码]=[代码][代码]"{{idx}}"[代码] [代码]wx:for-item[代码][代码]=[代码][代码]"item"[代码][代码]>[代码][代码] [代码][代码]<[代码][代码]view[代码] [代码]wx:for[代码][代码]=[代码][代码]"{{item.list}}"[代码] [代码]wx:for-index[代码][代码]=[代码][代码]"indexs"[代码] [代码]wx:key[代码][代码]=[代码][代码]"{{indexs}}"[代码] [代码]wx:for-item[代码][代码]=[代码][代码]"activityItem"[代码][代码]>[代码][代码] [代码][代码]<[代码][代码]block[代码] [代码]wx:if[代码][代码]=[代码][代码]"{{activityItem.activity_id}}"[代码][代码]>[代码][代码] [代码][代码]<[代码][代码]import[代码] [代码]src[代码][代码]=[代码][代码]'./cell/FullReductionCell.wxml'[代码] [代码]/>[代码][代码] [代码][代码]<[代码][代码]template[代码] [代码]is[代码][代码]=[代码][代码]"FullReductionCell"[代码] [代码]data[代码][代码]=[代码][代码]"{{fullReductionItem: activityItem, window_width}}"[代码] [代码]/>[代码][代码] [代码][代码]</[代码][代码]block[代码][代码]>[代码] [代码] [代码][代码]<[代码][代码]block[代码] [代码]wx:else>[代码][代码] [代码][代码]<[代码][代码]view[代码] [代码]class[代码][代码]=[代码][代码]"blackStyle"[代码] [代码]/>[代码][代码] [代码][代码]<[代码][代码]block[代码] [代码]wx:for[代码][代码]=[代码][代码]"{{activityItem.list}}"[代码] [代码]wx:for-index[代码][代码]=[代码][代码]"_index"[代码] [代码]wx:key[代码][代码]=[代码][代码]"{{_index}}"[代码] [代码]wx:for-item[代码][代码]=[代码][代码]"_productItem"[代码][代码]>[代码][代码] [代码][代码]<[代码][代码]import[代码] [代码]src[代码][代码]=[代码][代码]'./cell/OrderProductCell'[代码] [代码]/>[代码][代码] [代码][代码]<[代码][代码]template[代码] [代码]is[代码][代码]=[代码][代码]"OrderProductCell"[代码] [代码]data[代码][代码]=[代码][代码]"{{..._productItem, window_width}}"[代码] [代码]/>[代码][代码] [代码][代码]</[代码][代码]block[代码][代码]>[代码] [代码] [代码][代码]</[代码][代码]block[代码][代码]>[代码][代码] [代码][代码]</[代码][代码]view[代码][代码]>[代码][代码] [代码][代码]<[代码][代码]view[代码] [代码]wx:if="{{orderObject.coupon[item.muid_mtype].coupon_list.length > 0}}" class="couponContent" bindtap="setModalStatus" data-status="1" data-index="{{idx}}">[代码][代码] [代码][代码]<[代码][代码]text[代码] [代码]class[代码][代码]=[代码][代码]"couponText"[代码][代码]>优惠方式</[代码][代码]text[代码][代码]>[代码][代码] [代码][代码]<[代码][代码]view[代码] [代码]class[代码][代码]=[代码][代码]"endContent"[代码][代码]>[代码][代码] [代码][代码]<[代码][代码]view[代码] [代码]wx:if="{{item.reduce_amount > 0}}">[代码][代码] [代码][代码]满{{item.reach_amount}}元[代码][代码] [代码][代码]<[代码][代码]text[代码] [代码]wx:if[代码][代码]=[代码][代码]"{{item.type!=2}}"[代码][代码]>减{{item.face_value}}元</[代码][代码]text[代码][代码]>[代码][代码] [代码][代码]<[代码][代码]text[代码] [代码]wx:else>打{{item.discount}}折</[代码][代码]text[代码][代码]> [代码][代码] [代码][代码]省:{{item.reduce_amount}}元[代码][代码] [代码][代码]</[代码][代码]view[代码][代码]>[代码][代码] [代码][代码]<[代码][代码]view[代码] [代码]wx:else>不使用优惠券</[代码][代码]view[代码][代码]>[代码][代码] [代码][代码]<[代码][代码]span[代码] [代码]class[代码][代码]=[代码][代码]"arrow_icon arrowIcon"[代码] [代码]/>[代码][代码] [代码][代码]</[代码][代码]view[代码][代码]>[代码][代码] [代码][代码]</[代码][代码]view[代码][代码]>[代码][代码] [代码][代码]<[代码][代码]view[代码] [代码]class[代码][代码]=[代码][代码]"couponContent"[代码][代码]>[代码][代码] [代码][代码]<[代码][代码]text[代码] [代码]class[代码][代码]=[代码][代码]"couponText"[代码][代码]>配送方式</[代码][代码]text[代码][代码]>[代码][代码] [代码][代码]<[代码][代码]view[代码] [代码]class[代码][代码]=[代码][代码]"endContent"[代码][代码]>[代码][代码] [代码][代码]<[代码][代码]text[代码] [代码]class[代码][代码]=[代码][代码]"couponText"[代码][代码]>快递</[代码][代码]text[代码][代码]>[代码][代码] [代码][代码]</[代码][代码]view[代码][代码]>[代码][代码] [代码][代码]</[代码][代码]view[代码][代码]>[代码][代码] [代码][代码]<[代码][代码]view[代码] [代码]class[代码][代码]=[代码][代码]"couponContent"[代码][代码]>[代码][代码] [代码][代码]<[代码][代码]text[代码] [代码]class[代码][代码]=[代码][代码]"couponText"[代码][代码]>买家留言:</[代码][代码]text[代码][代码]>[代码][代码] [代码][代码]<[代码][代码]input[代码] [代码]placeholder[代码][代码]=[代码][代码]"选填,对本次交易的"[代码] [代码]placeholder-style[代码][代码]=[代码][代码]"color: #cccccc; font-size: 14px;"[代码] [代码]车[代码][代码]=[代码][代码]"saveRemark"[代码] [代码]data-member_id[代码][代码]=[代码][代码]"{{item.member_id}}"[代码] [代码]data-type_id[代码][代码]=[代码][代码]"{{item.type_id}}"[代码] [代码]/>[代码][代码] [代码][代码]</[代码][代码]view[代码][代码]>[代码][代码] [代码][代码]<[代码][代码]block[代码] [代码]wx:if="{{orderObject.data.length > 1}}">[代码][代码] [代码][代码]<[代码][代码]import[代码] [代码]src[代码][代码]=[代码][代码]"../../shippingcart/cell/ShopFootCell"[代码] [代码]/>[代码][代码] [代码][代码]<[代码][代码]template[代码] [代码]is[代码][代码]=[代码][代码]"ShopFootCell"[代码] [代码]data[代码][代码]=[代码][代码]"{{num: item.member_num, total: item.member_total}}"[代码] [代码]/>[代码][代码] [代码][代码]</[代码][代码]block[代码][代码]>[代码][代码] [代码][代码]<[代码][代码]view[代码] [代码]class[代码][代码]=[代码][代码]"blackStyle"[代码] [代码]/>[代码][代码] [代码][代码]</[代码][代码]view[代码][代码]>[代码][代码] [代码][代码]<[代码][代码]block[代码] [代码]wx:if[代码][代码]=[代码][代码]"{{isOpenScore}}"[代码][代码]>[代码][代码] [代码][代码]<[代码][代码]import[代码] [代码]src[代码][代码]=[代码][代码]"./cell/OrderScoreCell.wxml"[代码] [代码]/>[代码][代码] [代码][代码]<[代码][代码]template[代码] [代码]is[代码][代码]=[代码][代码]"OrderScoreCell"[代码] [代码]data[代码][代码]=[代码][代码]"{{isScoreCheck, credit_scale: orderObject.credit_scale, scoreValue, consume_credit: orderObject.consume_credit, countMoney}}"[代码] [代码]/>[代码][代码] [代码][代码]</[代码][代码]block[代码][代码]>[代码][代码] [代码][代码]<[代码][代码]view[代码] [代码]class[代码][代码]=[代码][代码]"blackStyle"[代码] [代码]/>[代码][代码] [代码][代码]</[代码][代码]view[代码][代码]>[代码][代码] [代码][代码]<[代码][代码]import[代码] [代码]src[代码][代码]=[代码][代码]"./cell/SubmitFootCell.wxml"[代码] [代码]/>[代码][代码] [代码][代码]<[代码][代码]template[代码] [代码]is[代码][代码]=[代码][代码]"SubmitFootCell"[代码] [代码]data[代码][代码]=[代码][代码]"{{isScoreCheck, total_num: orderObject.total_num, total_member_total: totalPrice, countMoney, freight}}"[代码] [代码]/>[代码][代码]</[代码][代码]view[代码][代码]>[代码][代码]<[代码][代码]import[代码] [代码]src[代码][代码]=[代码][代码]"../../coupon/template/couponSelect.wxml"[代码] [代码]/> [代码][代码]<[代码][代码]template[代码] [代码]is[代码][代码]=[代码][代码]"couponSelect"[代码] [代码]data[代码][代码]=[代码][代码]"{{showModalStatus, animationData,couponList:coupon.list,muid_mtype:coupon.muid_mtype}}"[代码] [代码]/>[代码] 百度资料甚少,官方帮忙下~真机都会报,模拟器都没问题。
2018-05-22我也遇到这问题,我是小程序,只是在IOS10 特定版本才有
unhandled promise rejection使用第三方引擎编写小游戏(语言:ts) ``` private async share() { console.log("11111"); } ``` 微信开发者中正常打印, 真机调试报错 [图片]
2018-05-22