微信小程序-局域网通信

    在很多ktv或者家里电视上,都有一些遥控器控制、点歌和搜歌等功能。如果做手机app,那工作量大(兼容ios和android端)、使用频次低,这个时候,小程序就是非常快捷和方便的一种实现方式,对用户而言,使用成本低、占用内存小、用完即走。

     小程序也提供了websocket的方法供我们使用。

先创建ip和端口等输入界面,这里提供了连接和关闭按钮

<view class="container">
  <input class="input" placeholder="input ip" value="192.168.10.2" bindinput="onIpInput"></input>

  <input class="input" placeholder="input port" value="30609" bindinput="onPortInput"></input>
  <button class="button" style="margin-top:30rpx" bindtap="onConnectClick">连接</button>
  <button class="button" style="margin-top:30rpx" bindtap="onCloseClick">关闭</button>

  <scroll-view class="scrollview" scroll-y="true
评论 2
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值