用微信小程序看直播的功能是什么

作者:小飞燕 发布时间:2021-04-12 10:49:05

导语本文整理了全网深受用户关注的个用微信小程序看直播的功能是什么经验知识,可以帮助您全面了解代理怎么做,小白也能成为高手,跟随小编一起来看一看吧!

用微信小程序看直播有什么作用?各位朋友,知道怎么用微信小程序看直播吗?想知道怎么做,请看微信小程序直播功能介绍。

微信小程序数据需要一些操作才能打开。如果不知道怎么找,怎么打开微信小程序。

小程序在哪里?如何找到微信小程序

言归正传。微信首页底部的小程序,按钮。步骤截图如下:

底部小程序开发,步骤截图如下:

进入小程序后,右上角的【搜索】按钮,步骤截图如下:

在搜索框中输入“荣耀锦标赛”,键盘右下角的【搜索】按钮搜索小程序。步骤截图如下:

搜索结果【荣耀事件】,步骤截图如下:

你可以在【首页】看到春运精彩回顾自动播放,下面有比较近的日程安排,保证你不会错过赛事。也可以在下方的【视频】中查看其他赛事的视频,在【数据】中可以查看团队对抗的相关数据。步骤截图如下:

下面是题目的开头。微信小程序蓝牙开发怎么操作?标题到此结束

小程序蓝牙功能的开启满足了很多人对小程序的技术要求,但是如果要使用这个功能,需要先开发蓝牙,那么微信小程序蓝牙开发怎么操作呢?以下是开发过程。小编还提供了正确的小程序代码。希望大家都能发展成功。

首先,搜索小程序蓝牙设备

/* * *搜索设备接口*/page ({data: {logs: [],list3360 [],},onload : function { console . log(' onl oad ')varit=this;//const sdkversion=wx . getsysteminfosync . sdkversion | | ' 1 . 0 . 0 '/const[main,minor,patch]=sdkversion.split(' . ').map(number)//console . log(sdkversion);//console.log(专业);//console.log(小调);//console.log(补丁);//const can use=api name=;{//if(api name===' show modal . cancel '){//return m品牌or;=1分;=1//}//返回true/}//wx . show modal({//success : function(res){//if(canuse(' show modal . cancel ')){//console . log(res . cancel)/}/}/}/}/})//获取适配器wx . openbluetoothadapter({ success 3360 function(res){//success console . log('-success-'));console . log(res);//开始搜索wx . startbluetoothdevicesidovery({ service :[],success 3360 function(res){//successconsole . log('-startbluetoothdevicesidovery-success ');console . log(res);},fail : function(res){//fail console . log(res);},complete : function(res){//complete console . log(res);}}) },fail : function(res){ console . log('-fail-');//fail console . log(res);},complete : function(res){//complete console . log('-complete-');console . log(res);} })wx . getbluetoothdevices({ success : function(res){//success//{ devices : array[11],errmsg : ' getbluetoothdevices 3360 ok ' } console . log(' getbluetoothdevices ');console . log(res);that . setdata({ list : res . devices });console . log(that . data . list);},fail: function (res) {//fail},complete : function(res){//complete } })},onshow: function {},//click event processing bindviewtap 3360 function(e){ console . log(e . current target . dataset)console . log(e . current target . dataset . name);console . log(e . current target . dataset . advertisedata);var title=e . current target . dataset . title;var name=e . current target . dataset . name;wx.redirectto({ url: './conn/conn?deviceid=' title 'name=' name,success : function(res){//success },fail: function(res) { //fail },complete : function(res){//complete } })},})

二、连接获取蓝牙数据

/** * 连接设备。获取数据*/page({ data : {座右铭: ' hello world ',userinfo: {},deviceid: " ",name: " ",serviceid: " ",service :[],cd 203: " ",cd 043: " ",cd02: " ",cd 043: " ",特性s 203: null,特性s01: null,特性控制台。日志('加载时');控制台。日志('设备id=' opt。设备id);控制台。日志(' name=' opt。姓名);那个。setdata({设备id : opt。设备id });/** * 监听设备的连接状态*/wx。onblacconnectionstate已更改(功能(res){控制台。日志(`设备$ { res . device id }状态已更改,connected : $ { res . connected } `)})/* * *连接设备*/wx。createbleconnection({设备id :数据。设备id,成功:功能(res){//成功控制台。日志(res);/** * 连接成功,后开始获取设备的服务列表*/wx.getbledeviceservices({ //这里的标识需要在上面的获取蓝牙设备中获取设备id :数据。设备id,成功:功能(res){控制台。日志('设备服务3360 ',资源服务)。设置数据({ service 3360 res . services });console.log('设备服务: ',即。data.services[1].uuid);那个。setdata({ service id :数据。服务[1]).uuid });控制台。log('-');console.log('设备设备的id: ',即。数据。设备id);console.log('设备设备的服务id: ',即。数据。服务id);/** * 延迟3秒,根据服务获取特征*/settimeout(函数{ wx。getbledevicecharactersists({//这里的标识需要在上面的getbluetoothdevicesdeviced :数据。设备id,//这里的法业务类型需要在上面的getbledeviceservices接口中获取服务id :数据。服务id,成功:功能(res){控制台。log(' 000000000000 '表示。数据。服务id);控制台。日志(' devicegetbledevicecharacterstics 3360 ',res . attributes)为(var i=0;i5;i){ if(res . attributes[i]。uuid。的索引(' cd20 ')!=-1){那个。setdata(cd 20: res . attributes[i]).uuid,特性20: res . attributes[i]});} if(res . attributes[i]。uuid。的索引(' cd01 ')!=-1){那个。设置数据.uuid,特性s01: res。特性[i]});} if(res . attributes[i]。uuid。的索引(' cd02 ')!=-1){那个。设置数据.uuid,特性s02: res。特性[i]});} if(res . attributes[i]。uuid。的索引(' cd03 ')!=-1){那个。设置数据.uuid,特性s03: res。特性[i]});} if(res . attributes[i]。uuid。的索引(' cd04 ')!=-1){那个。设置数据.uuid,特性s04: res。特性[i]});} }控制台。日志(' cd01=' that。数据。cd01 ' cd02=' that。数据。cd02 ' cd03=' that。数据。cd03 ' cd04=' that。数据。cd04 ' cd20=' that。数据。cd20);/** *回调获取设备发过来的数据*/wx。onblecharacteristivaluechange(函数(特性){console.log('特性值comed: ',特性。value)/{ value : arraybuffer,device id :003360d 2:4 f :24:17 ',service id : ' ba 11 f 08 c-5 f14-0 b 0d-1080-007 cbe 2监听cd04cd04中的结果*/if(特性。特性id.indexof('cd01 ')!=-1){ const result=字符。价值;const hex=that.buf2hex(结果);console.log(十六进制);} if(特性。特性id.indexof('cd04 ')!=-1){ const result=字符。价值;const hex=that.buf2hex(结果);console.log(十六进制);那个。setdata({ result : hex });} }) /** * 顺序开发设备特征notifiy */wx。notifybleattributevaluechan

ged({设备id :数据。设备id,服务id :数据。服务id,特定id :数据。cd01,state: true,success : function(res){//successconsole。日志(' notifybletionvaluechanged success ',res);},fail:function (res) { //fail },complete : function(res){//complete } })wx。notifybleattributevaluechanged({ device id : }该。数据。设备id,服务id :数据。服务id,特性id: that.data.cd02,state: true,success 3360 function(res){//successconsole。日志(' notifybleattributevaluechanged success ',res);},fail:function (res) { //fail },complete : function(res){//complete } })wx。notifybleattributevaluechanged({ device id : }该。数据。设备id,服务id :数据。服务id,属性id :数据。cd03,state: true,success : function(res){//successconsole。日志(' notifybleattributevaluechanged success ',res);},fail:function (res) { //fail },complete : function(res){//complete } })wx。notifybleattributevaluechanged({//启用通知功能//这里的标识需要在上面的获取蓝牙设备或onbluetoothdevicefound接口中获取设备id :数据。设备id,服务id :数据。服务id,specificid :数据。cd04,state: true,success : function(res){ console。log(' notifybleinctionchangedsuccess ',res)}),fail : function(res){ console。日志(res);} }) } , 1500);} }) }、fail: function (res) { //fail }、complete : function(res){//complete } })}、/** *发送数据到设备中*/bindviewtap:函数{ var=thisvar hex=' aa 5504 b 10000 b5 ' var typedarray=new uint 8数组(十六进制。match(/[da-f]{ 2 }/gi).map(function(h){ return par send(h,16)}))控制台。log(typedarray)控制台。log([0xa a,0x55,0x04,0xb1,0x00,0 xb5])var buffer 1=typedarray。缓冲控制台。log(缓冲区1)wx。writellettervalue({ device id :数据。设备id,服务id 3360。数据。服务id,specificid 3360。数据。cd20,值:指令发送成功');控制台。日志(res);},fail : function(res){//fail console。日志(res);},完成:函数(res){//完成} })},/** * arraybuffer转换为hex */buf2hex:函数(缓冲){//缓冲是arraybuffer返回数组。原型。地图。call(new uint 8 array(buffer),x=;(' 00' x.tostring(16)).切片(-2))。join(');}})

效果展示

发送校验指令。获取结果

查看全文

猜你喜欢

微商怎么找货源

频道查询入口

微商代理怎么做