udp-socket.wxml 1.4 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546
  1. <import src="../../../common/head.wxml"/>
  2. <import src="../../../common/foot.wxml"/>
  3. <view class="container page" data-weui-theme="{{theme}}">
  4. <template is="head" data="{{title: 'startSoterAuthentication'}}"/>
  5. <view class="page-body">
  6. <view wx:if="{{startUDP}}" style="text-align: center">
  7. 本机port: {{port}} 模拟远程port: {{remote_port}}
  8. </view>
  9. <view wx:if="{{!startUDP}}" class="btn-area">
  10. <button type="primary"
  11. disabled="{{!canIUse}}"
  12. bind:tap="handleCreateUDPTap">
  13. 开启 UDPSocket
  14. </button>
  15. </view>
  16. <block wx:else>
  17. <view class="btn-area">
  18. <button type="primary" bind:tap="handleSendMessage">
  19. 本机发送测试
  20. </button>
  21. </view>
  22. <view class="btn-area">
  23. <button type="primary" bind:tap="changeMode">
  24. 远程发送测试
  25. </button>
  26. </view>
  27. <block wx:if="{{mode === 'remote'}}">
  28. <input placeholder="请输入目标主机 IP 地址 默认: 127.0.0.1" bind:input="handleInputChange"></input>
  29. <view class="btn-area">
  30. <button type="primary" bind:tap="handleSendRemoteMessage">
  31. 发送
  32. </button>
  33. </view>
  34. </block>
  35. <view class="btn-area">
  36. <button type="primary" bind:tap="handleCloseUDPTap">
  37. 关闭 UDPSocket
  38. </button>
  39. </view>
  40. </block>
  41. </view>
  42. <template is="foot"/>
  43. </view>