forked from wechat-miniprogram/miniprogram-demo
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathweb-socket.wxml
30 lines (27 loc) · 1011 Bytes
/
web-socket.wxml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
<import src="../../../common/head.wxml" />
<import src="../../../common/foot.wxml" />
<view class="container">
<template is="head" data="{{title: 'WebSocket'}}"/>
<view class="page-body">
<view class="page-section">
<view class="weui-cells weui-cells_after-title">
<view class="weui-cell weui-cell_switch">
<view class="weui-cell__bd">Socket状态</view>
<view class="weui-cell__ft">
<switch bindchange="toggleSocket" disabled="{{!hasLogin}}"/>
</view>
</view>
<view class="weui-cell">
<view class="weui-cell__bd">消息</view>
<view class="weui-cell__ft">
Hello, 小程序!
</view>
</view>
</view>
</view>
<view class="btn-area">
<button type="primary" size="40" bindtap="sendMessage" disabled="{{socketStatus != 'connected'}}" loading="{{loading}}">点我发送</button>
</view>
</view>
<template is="foot" />
</view>