index.wxml 2.2 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677
  1. <!--index.wxml-->
  2. <view class="container">
  3. <!-- 用户 openid -->
  4. <view class="userinfo">
  5. <block wx:if="{{canIUseOpenData}}" class="userinfo-opendata">
  6. <view class="userinfo-block-avatar" bindtap="bindViewTap">
  7. <open-data type="userAvatarUrl"></open-data>
  8. </view>
  9. </block>
  10. <block wx:elif="{{!hasUserInfo}}">
  11. <button
  12. wx:if="{{canIUseGetUserProfile}}"
  13. bindtap="getUserProfile"
  14. class="userinfo-avatar"
  15. style="background-image: url({{avatarUrl}})"
  16. size="default"
  17. ></button>
  18. <button
  19. wx:else
  20. open-type="getUserInfo"
  21. bindgetuserinfo="onGetUserInfo"
  22. class="userinfo-avatar"
  23. style="background-image: url({{avatarUrl}})"
  24. size="default"
  25. ></button>
  26. </block>
  27. <block wx:else>
  28. <image bindtap="bindViewTap" class="userinfo-block-avatar" src="{{avatarUrl}}" mode="cover"></image>
  29. </block>
  30. <view class="userinfo-nickname-wrapper">
  31. <button class="userinfo-nickname" bindtap="onGetOpenid">点击获取 openid</button>
  32. </view>
  33. </view>
  34. <!-- 上传图片 -->
  35. <view class="uploader">
  36. <view class="uploader-text" bindtap="doUpload">
  37. <text>上传图片</text>
  38. </view>
  39. <view class="uploader-container" wx:if="{{imgUrl}}">
  40. <image class="uploader-image" src="{{imgUrl}}" mode="aspectFit" bindtap="previewImg"></image>
  41. </view>
  42. </view>
  43. <!-- 操作数据库 -->
  44. <view class="uploader">
  45. <navigator url="../databaseGuide/databaseGuide" open-type="navigate" class="uploader-text">
  46. <text>前端操作数据库</text>
  47. </navigator>
  48. </view>
  49. <!-- 即时通信 -->
  50. <view class="uploader">
  51. <navigator url="../im/im" open-type="navigate" class="uploader-text">
  52. <text>即时通信 Demo</text>
  53. </navigator>
  54. </view>
  55. <!-- 新建云函数 -->
  56. <view class="uploader">
  57. <navigator url="../addFunction/addFunction" open-type="navigate" class="uploader-text">
  58. <text>快速新建云函数</text>
  59. </navigator>
  60. </view>
  61. <!-- 云调用 -->
  62. <view class="uploader">
  63. <navigator url="../openapi/openapi" open-type="navigate" class="uploader-text">
  64. <text>云调用</text>
  65. </navigator>
  66. </view>
  67. </view>