1<import-sjs from="../netCfg/netCfg.sjs" name="netCfg"></import-sjs>
2<view class="page">
3  <view class="page-section">
4    <view class="page-section-title">设备三元组信息</view>
5    <view class="form-row">
6      <view class="form-row-label" style="width:35%">ProductKey</view>
7      <view class="form-row-content">
8        <input class="input" placeholder="ProductKey" value="{{ProductKey}}" onInput = "pkOnInput" />
9      </view>
10    </view>
11    <view class="form-row">
12      <view class="form-row-label" style="width:35%">DeviceName</view>
13      <view class="form-row-content">
14        <input class="input" placeholder="DeviceName" value="{{DeviceName}}" onInput = "dnOnInput" />
15      </view>
16    </view>
17    <view class="form-row">
18      <view class="form-row-label" style="width:35%">DeviceSecret</view>
19      <view class="form-row-content">
20        <input class="input" placeholder="DeviceSecret" value="{{DeviceSecret}}" onInput = "dsOnInput" />
21      </view>
22    </view>
23    <view class="form-row">
24      <button class="form-button" size="default" type="primary" onTap="scanTriadQr">扫码获取三元组</button>
25    </view>
26  </view>
27  <view class="page-section">
28    <view class="page-section-title">三元组下发</view>
29    <view class="form-row">
30      <view class="form-row-label">选择设备</view>
31      <view class="form-row-content">
32        <picker value="{{selected_device_index}}" range="{{netCfg.getDeviceNameList(link_lp_devices)}}" onChange="bindDevicePickerChange">
33          <view style="display:flex; align-items: center; justify-content: space-between;">
34            <text>{{link_lp_devices.length>0?netCfg.getDeviceNameList(link_lp_devices)[selected_device_index]:'未找到设备'}}</text>
35            <image mode="scaleToFill" style="width:30rpx; height:30rpx" src="../../resource/image/picker.png"/>
36          </view>
37        </picker>
38      </view>
39    </view>
40    <view class="form-row">
41      <button class="form-button" size="default" type="primary" disabled="{{LinkLpState.scanning}}" onTap="startLinkLpDevicesDiscovery">扫描设备</button>
42    </view>
43  </view>
44  <view class="page-section">
45    <button size="default" type="primary" disabled="{{link_lp_devices.length<=0 || LinkLpState.linking}}" loading="{{LinkLpState.linking}}" onTap="sendTriad">下发三元组</button>
46  </view>
47  <view class="page-section">
48    <view class="page-section-title">设备状态</view>
49    <view class="form-row">
50      <view class="form-row-label">设备状态</view>
51      <view class="form-row-content">{{LinkState?"三元组下发成功":"未接收到三元组"}}</view>
52    </view>
53  </view>
54</view>