login.wxml 1.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445
  1. <view class="container">
  2. <view class="userinfo">
  3. <block wx:if="{{canIUseOpenData}}">
  4. <view class="userinfo-avatar">
  5. <open-data type="userAvatarUrl"></open-data>
  6. </view>
  7. <open-data type="userNickName"></open-data>
  8. </block>
  9. <block wx:elif="{{!hasUserInfo}}">
  10. <button wx:if="{{canIUseGetUserProfile}}" bindtap="getUserProfile"> 获取头像昵称 </button>
  11. <button wx:elif="{{canIUse}}" open-type="getUserInfo" bindgetuserinfo="getUserInfo"> 获取头像昵称 </button>
  12. <view wx:else> 请使用1.4.4及以上版本基础库 </view>
  13. </block>
  14. <block wx:else>
  15. <image bindtap="bindViewTap" class="userinfo-avatar" src="{{userInfo.avatarUrl}}" mode="cover"></image>
  16. <text class="userinfo-nickname">{{userInfo.nickName}}</text>
  17. </block>
  18. </view>
  19. </view>
  20. <van-cell-group>
  21. <van-field
  22. model:value="{{ username }}"
  23. required
  24. clearable
  25. label="用户名"
  26. icon="question-o"
  27. placeholder="请输入用户名"
  28. bind:click-icon="onClickIcon"
  29. />
  30. <van-field
  31. model:value="{{ password }}"
  32. type="password"
  33. label="密码"
  34. placeholder="请输入密码"
  35. required
  36. border="{{ false }}"
  37. />
  38. </van-cell-group>
  39. <!-- <button open-type="getPhoneNumber" bindgetphonenumber="getPhoneNumber" style="width: 500rpx;line-height: 100rpx;height: 100rpx;background-color: rgb(21, 156, 55); color: antiquewhite;margin-bottom:30rpx">获取手机号</button> -->
  40. <button open-type="getPhoneNumber" bindgetphonenumber="getPhoneNumber">查看手机</button>
  41. <button bindtap="getinfo" style="width: 300rpx;line-height: 80rpx;height: 80rpx;margin-top: 30rpx;">登录</button>
  42. <van-notify id="van-notify" />