index.wxml 1.6 KB

1234567891011121314151617181920212223242526272829303132333435363738394041
  1. <!--index.wxml-->
  2. <view class="container">
  3. <view class="header"></view>
  4. <view class="header">
  5. <view class="state-info" bindtap="tapState">
  6. <led color="{{connectStateMap[ble.state].color}}" width="15"/> {{connectStateMap[ble.state].text}}
  7. </view>
  8. <view class="state-msg" wx:if="{{ble.state == 3}}">
  9. {{remoteDev.devName}}
  10. </view>
  11. <view class="state-msg" wx:if="{{ble.state == 0}}">
  12. <view class="custom-info-btn" bindtap="searchDevice" >扫描</view>
  13. </view>
  14. <view class="state-msg" wx:if="{{ble.state == 2}}">
  15. <view class="custom-info-btn" bindtap="searchDevice" >重新扫描</view>
  16. </view>
  17. </view>
  18. <view class="control">
  19. </view>
  20. <view class="userinfo">
  21. <block wx:if="{{canIUseOpenData}}">
  22. <view class="userinfo-avatar" bindtap="bindViewTap">
  23. <open-data type="userAvatarUrl"></open-data>
  24. </view>
  25. <open-data type="userNickName"></open-data>
  26. </block>
  27. <block wx:elif="{{!hasUserInfo}}">
  28. <button wx:if="{{canIUseGetUserProfile}}" bindtap="getUserProfile"> 获取头像昵称 </button>
  29. <button wx:elif="{{canIUse}}" open-type="getUserInfo" bindgetuserinfo="getUserInfo"> 获取头像昵称 </button>
  30. <view wx:else> 请使用1.4.4及以上版本基础库 </view>
  31. </block>
  32. <block wx:else>
  33. <image bindtap="bindViewTap" class="userinfo-avatar" src="{{userInfo.avatarUrl}}" mode="cover"></image>
  34. <text class="userinfo-nickname">{{userInfo.nickName}}</text>
  35. </block>
  36. </view>
  37. <view class="usermotto">
  38. <text class="user-motto">{{motto}}</text>
  39. </view>
  40. </view>