You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

219 lines
13 KiB

1 year ago
1 year ago
1 year ago
1 year ago
  1. <!--pages/Bluetooth/Bluetooth.wxml-->
  2. <view wx:if="{{selectindex !=4}}">
  3. <van-radio-group value="{{ selectRadio }}" bind:change="onChangeSelectRaio">
  4. <van-radio name="1" class="ma-2">注册绑定房间</van-radio>
  5. <van-radio name="2">仅注册</van-radio>
  6. <van-radio name="3">注册绑定已选房间</van-radio>
  7. </van-radio-group>
  8. <view class="">
  9. <view wx:if="{{deviceInfo.roomId}}" class="btnlist">
  10. <van-cell-group style="width:100%;">
  11. <van-cell title="蓝牙开锁" value="{{deviceInfo.deviceNum}}" bindtap="openTheDoor" is-link />
  12. <van-cell title="同步时间" value="{{lockStatus.lockTime}}" bindtap="synchronizationTime" is-link />
  13. <van-cell title="设置音量" value="" bindtap="setVoice" is-link />
  14. <van-cell title="读取锁状态" value="" bindtap="readLockStatus" is-link />
  15. <van-cell title="获取锁端私钥" value="{{privateKey}}" bindtap="getPirvateKey" is-link />
  16. <van-cell title="下发五组密钥" value="" bindtap="sendSetKey" is-link />
  17. <!-- sendSetKey ShowRoomMathods-->
  18. <van-cell title="重置门锁" value="" bindtap="resetLock" is-link />
  19. <van-cell title="设置WiFi" value="" bindtap="setWifi" is-link border="{{ false }}" />
  20. <van-cell title="WiFi" value="{{lockStatus.wifiSsid}}" label="" />
  21. <van-cell title="设置NB网关" value="" bindtap="setIP" is-link border="{{ false }}" />
  22. <van-cell title="网关" value="{{lockStatus.serverIp}}" label="" border="{{ false }}" />
  23. <van-cell title="端口" value="{{lockStatus.serverPort}}" label="" />
  24. <van-cell title="房间解绑" value="{{deviceInfo.roomName}} 解绑" bindtap="unbindRoomMethods" is-link />
  25. </van-cell-group>
  26. </view>
  27. <view class="bindRoom" wx:else>
  28. <van-cell title="已选房源" icon="location-o" value="{{selectRoomName}}" />
  29. <view wx:if="{{ selectRadio == 1 && !onlyResgiter }}">
  30. <van-button type="default" size="large" bindtap="bindroom">绑定房间</van-button>
  31. </view>
  32. <view wx:elif="{{ selectRadio == 2 && !onlyResgiter }}" class="mb-1">
  33. <van-button type="default" size="large" bindtap="addAdmin">注册设备</van-button>
  34. </view>
  35. <view wx:else="{{ selectRadio == 3 && !onlyResgiter }}" class="mb-1">
  36. <van-button type="default" size="large" bindtap="bindroom">注册绑定设备</van-button>
  37. </view>
  38. </view>
  39. <view wx:if="{{onlyResgiter && selectindex == 4}}">
  40. <van-cell title="蓝牙开锁" value="{{lockStatus.deviceNum}}" bindtap="openTheDoor" is-link />
  41. <van-cell title="同步时间" value="{{lockStatus.lockTime}}" bindtap="synchronizationTime" is-link />
  42. <van-cell title="设置音量" value="" bindtap="setVoice" is-link />
  43. <van-cell title="读取锁状态" value="" bindtap="readLockStatus" is-link />
  44. </view>
  45. <view class="locktext" wx:if="{{ lockStatus}}">
  46. <view class="lockli">版本号:{{lockStatus.softWareVersion}}</view>
  47. <view class="lockli">电量:{{lockStatus.power}}</view>
  48. <view class="lockli">NB信号:{{lockStatus.nbSignal}}</view>
  49. <view class="lockli">IMEI:{{lockStatus.nbIMEI}}</view>
  50. <view class="lockli">IMSI:{{lockStatus.nvIMSI}}</view>
  51. <view class="lockli">用户数量:{{lockStatus.appUserCount}}</view>
  52. <view class="lockli">黑名单用户数量:{{lockStatus.blackListCount}}</view>
  53. <view class="lockli">蓝牙扣数量:{{lockStatus.bleKeyCount}}</view>
  54. <view class="lockli">剩余可添加用户数量:{{lockStatus.remainCount}}</view>
  55. <view class="lockli">未上传开锁记录数量:{{lockStatus.notUploadCount}}</view>
  56. <view class="lockli">密码数量:{{lockStatus.pwdCount}}</view>
  57. <view class="lockli">指纹数量:{{lockStatus.fingerPrintsCount}}</view>
  58. <view class="lockli">门卡数量:{{lockStatus.RFCount}}</view>
  59. <view class="lockli">锁当前时间:{{lockStatus.lockTime}}</view>
  60. <view class="lockli">锁型号:{{lockStatus.lockerMode}}</view>
  61. <view class="lockli">锁SN号:{{lockStatus.lockSn}}</view>
  62. <view class="lockli">WiFi名:{{lockStatus.wifiSsid}}</view>
  63. <view class="lockli">服务器:{{lockStatus.serverIp}}</view>
  64. <view class="lockli">服务器端口:{{lockStatus.serverPort}}</view>
  65. </view>
  66. <van-popup show="{{ show }}" bind:close="onClose" position="bottom" custom-style="height: 60%">
  67. <tree dataTree="{{dataList}}" selectKey="{{selectKey}}" bind:select="handleSelect" isSelectLastNode="true" isOpenAll="{{false}}"></tree>
  68. </van-popup>
  69. <van-action-sheet show="{{ show1 }}" actions="{{ actions }}" bind:close="onClose1" bind:select="onSelect1" />
  70. <van-popup show="{{ showWifi }}" custom-style="width: 90%" bind:close="onCloseWifi" round>
  71. <view class="addword">
  72. <van-field value="{{ wifiName }}" placeholder="请输入wifi名称" label="wifi" border="{{ true }}" bind:change="onChangeWifi" />
  73. <van-field value="{{ wifiPassword }}" placeholder="请输入wifi密码" label="密码" border="{{ true }}" bind:change="onChangeWifi1" />
  74. <view class=""><button type="primary" bindtap="confirmSetWifi">确认设置</button></view>
  75. </view>
  76. </van-popup>
  77. <van-popup show="{{ showIP }}" custom-style="width: 90%" bind:close="onCloseIP" round>
  78. <view class="addword">
  79. <van-field value="{{ IPName }}" placeholder="请输入IP" label="IP" border="{{ true }}" bind:change="onChangeIP" />
  80. <van-field value="{{ IPport }}" placeholder="请输入端口" label="PORT" border="{{ true }}" bind:change="onChangeIP1" />
  81. <view class=""><button type="primary" bindtap="confirmSetIP">确认设置</button></view>
  82. </view>
  83. </van-popup>
  84. <van-popup show="{{ showRoom }}" custom-style="width: 90%" bind:close="onCloseRoom" round>
  85. <view class="addword">
  86. <van-cell-group>
  87. <picker bindchange="bindPickerChange" value="{{index}}" range="{{firstAuthList}}">
  88. <van-cell title="请选房源" value="{{selectRoomList[0].name}}" is-link />
  89. </picker>
  90. <picker bindchange="bindPickerChangeSecond" value="{{indexSecond}}" range="{{secondAuthList}}">
  91. <van-cell title="请选楼宇" value="{{selectRoomList[1].name}}" is-link />
  92. </picker>
  93. <picker bindchange="bindPickerChangeThree" value="{{indexThree}}" range="{{threeAuthList}}">
  94. <van-cell title="请选单元" value="{{selectRoomList[2].name}}" is-link />
  95. </picker>
  96. <picker bindchange="bindPickerChangeFour" value="{{indexFour}}" range="{{fourAuthList}}">
  97. <van-cell title="请选楼层" value="{{selectRoomList[3].name}}" is-link />
  98. </picker>
  99. <picker bindchange="bindPickerChangeFive" value="{{indexFive}}" range="{{romeLockerList}}">
  100. <van-cell title="请选房间" value="{{selectRoomList[4].name}}" is-link />
  101. </picker>
  102. </van-cell-group>
  103. <!-- <view class=""><button type="primary" bindtap="issueFiveSetKey">确认下发</button></view> -->
  104. <view class=""><button type="primary" bindtap="sendSetKey">确认下发</button></view>
  105. </view>
  106. </van-popup>
  107. </view>
  108. </view>
  109. <view class="containerOne" wx:else>
  110. <view class="lock-info">
  111. <view class="line-container">
  112. <text class="mac">设备MAC</text>
  113. <text class="type">{{lock.mac}}</text>
  114. </view>
  115. <view class="line-container">
  116. <view class="line" />
  117. </view>
  118. <view class="line-container">
  119. <text class="mac">设备类型</text>
  120. <text class="type">{{lock.lockType}}</text>
  121. </view>
  122. <view class="line-container">
  123. <text class="mac">绑定房间</text>
  124. <text class="type">{{deviceInfo.roomName}}</text>
  125. </view>
  126. </view>
  127. <view class='row'>
  128. <button class="button-action" type='primary' bindtap="bindLock" disabled="{{isBindLock}}">绑定管理员</button>
  129. <button class="button-action" type='primary' bindtap="unbindLock" disabled="{{!isBindLock}}">重置门锁</button>
  130. </view>
  131. <view class='row'>
  132. <button class="button-action" type='primary' bindtap="changemanId" disabled="{{!resgiterdevice}}">注册到平台</button>
  133. <!-- <button class="button-action" type='primary' bindtap="changemanId">注册到平台</button> -->
  134. <button class="button-action" type='primary' bindtap="bindRoomMethods" disabled="{{resgiterdevice}}">绑定房间</button>
  135. </view>
  136. <view class='row'>
  137. <button class="button-action" type='primary' bindtap="queryBindState">查询状态</button>
  138. <button class="button-action" type='primary' bindtap="queryBattery" disabled="{{isJack}}">查询电量</button>
  139. </view>
  140. <view class='row'>
  141. <button class="button-action" type='primary' bindtap="queryNbImei" disabled="{{!isNbLock}}">查询IMEI</button>
  142. <button class="button-action" type='primary' bindtap="login" disabled="{{!isBindLock | lockModel < 70 | isJack}}">进登录态</button>
  143. </view>
  144. <view class='row'>
  145. <button class="button-action" type='primary' bindtap="openLock" disabled="{{!isBindLock}}">{{isJack ? '蓝牙上电' : '蓝牙解锁'}}</button>
  146. <button class="button-action" type='primary' bindtap="syncClock" disabled="{{!isBindLock | isJack}}">同步时钟</button>
  147. </view>
  148. <view class='row'>
  149. <button class="button-action" type='primary' bindtap="addPincode" disabled="{{!isBindLock | isPincodeAdd | isJack}}">添加密码</button>
  150. <button class="button-action" type='primary' bindtap="delPincode" disabled="{{!isBindLock | !isPincodeAdd | isJack}}">删除密码</button>
  151. </view>
  152. <view class='row'>
  153. <button class="button-action" type='primary' bindtap="addRfCard" disabled="{{!isBindLock | isRfCardAdd | isJack}}">添加房卡</button>
  154. <button class="button-action" type='primary' bindtap="delRfCard" disabled="{{!isBindLock | !isRfCardAdd | isJack}}">删除房卡</button>
  155. </view>
  156. <view class='row'>
  157. <button class="button-action" type='primary' bindtap="addFingerprint" disabled="{{!isBindLock | !isFpLock | isFingerprintAdd}}">添加指纹</button>
  158. <button class="button-action" type='primary' bindtap="delFingerprint" disabled="{{!isBindLock | !isFpLock | !isFingerprintAdd}}">删除指纹</button>
  159. </view>
  160. <view class='row'>
  161. <button class="button-action" type='primary' bindtap="changeAdminPincode" disabled="{{!isBindLock | !isFpLock}}">修改管理密码</button>
  162. <button class="button-action" type='primary' bindtap="genOfflinePincode" disabled="{{!isBindLock | isJack}}">生成离线密码</button>
  163. </view>
  164. <view class='row'>
  165. <button class="button-action" type='primary' bindtap="queryLockSlotState" disabled="{{!isBindLock}}">查询方舌状态</button>
  166. <button class="button-action" type='primary' bindtap="queryLockUnlockState" disabled="{{!isBindLock}}">查询门锁状态</button>
  167. </view>
  168. <view class='row'>
  169. <button class="button-action" type='primary' bindtap="changeLockUnlockState" disabled="{{!isBindLock}}">{{isUnloked ? '退出常开模式' : '进入常开模式'}}</button>
  170. <button class="button-action" type='primary' bindtap="changeLockMutedState" disabled="{{!isBindLock}}">{{isMuted ? '退出静音模式' : '进入静音模式'}}</button>
  171. </view>
  172. <view class='row'>
  173. <button class="button-action" type='primary' bindtap="changeLockNbState" disabled="{{!isBindLock}}">{{isNbEnable ? '禁用NB功能' : '打开NB功能'}}</button>
  174. <button class="button-action" type='primary' bindtap="changeshow2">配网</button>
  175. </view>
  176. <!-- <view class="row">
  177. <button class="button-action" type="primary" bindtap="addFaceprint">添加人脸</button>
  178. <button class="button-action" type="primary" bindtap="delFaceprint">删除人脸</button>
  179. </view> -->
  180. <van-popup show="{{ show }}" bind:close="onClose" position="bottom" custom-style="height: 60%">
  181. <tree dataTree="{{dataList}}" selectKey="{{selectKey}}" bind:select="handleSelect" isSelectLastNode="true" isOpenAll="{{false}}"></tree>
  182. </van-popup>
  183. <van-popup show="{{ show2 }}" round bind:close="onClose1" custom-style="width: 90%;">
  184. <view class="wificontact">
  185. <van-field value="{{ WifiName }}" placeholder="请输入wifi名称" border="{{ false }}" bind:change="onChange" />
  186. <van-field value="{{ WifiPwd }}" placeholder="请输入wifi密码" border="{{ false }}" bind:change="onChange1" />
  187. <van-button block type="primary" bindtap="configurewifj">确定</van-button>
  188. </view>
  189. </van-popup>
  190. <!-- 注册到平台的弹出层 -->
  191. <van-popup show="{{ showreg }}" bind:close="onClosereg" custom-style="width: 85%;" round>
  192. <view class="regdevice">
  193. <view class="radiolists">
  194. <van-radio-group value="{{ selectRadio1 }}" bind:change="onChangeSelectRaio1">
  195. <van-radio name="1201" class="ma-2">NB智能锁</van-radio>
  196. <van-radio name="1221" class="ma-2">cat1智能锁</van-radio>
  197. <van-radio name="1231" class="ma-2">蓝牙锁</van-radio>
  198. <van-radio name="1241" class="ma-2">Wifi人脸智能锁</van-radio>
  199. </van-radio-group>
  200. </view>
  201. <view class="sheetlist" bindtap="changesheetshow">
  202. <span class="platformIdlist">选择运营商:</span>
  203. <span>{{platformname}}</span>
  204. </view>
  205. <van-button block type="primary" bindtap="resgiterDeviceMethods1">确定</van-button>
  206. </view>
  207. </van-popup>
  208. </view>
  209. <van-action-sheet show="{{ sheetshow }}" actions="{{ actions1 }}" bind:close="onClose1" bind:select="onSelect" />