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.

143 lines
2.7 KiB

  1. <template>
  2. <view class="main">
  3. <view :style="{height:iSMT+'px'}"></view>
  4. <view style="height:1.5vh;" />
  5. <view class="title">
  6. <text class="label">确认新密码</text>
  7. </view>
  8. <view class="top">
  9. <view class="top-list">
  10. <view class="left">
  11. <img src="/static/my/unlock.png" />
  12. <input type="password" :type="pwdType" placeholder="请输入新密码" class="input" />
  13. <img :src="pwdType === 1 ? '/static/my/hideEye.png' : '/static/my/openEye.png'"
  14. @click="changeEye(1)" />
  15. </view>
  16. </view>
  17. <view class="top-list">
  18. <view class="left">
  19. <img src="/static/my/unlock.png" />
  20. <input type="password" :type="pwdType2" placeholder="再次确认" class="input" />
  21. <img :src="pwdType === 1 ? '/static/my/hideEye.png' : '/static/my/openEye.png'"
  22. @click="changeEye(2)" />
  23. </view>
  24. </view>
  25. <text class="tips">密码最少8位数</text>
  26. </view>
  27. <view class="bottom">
  28. <button class="change-btn">确认</button>
  29. </view>
  30. </view>
  31. </template>
  32. <script setup>
  33. import {
  34. ref,
  35. onMounted
  36. } from 'vue'
  37. const iSMT = ref(0)
  38. const pwdType = ref('password')
  39. const pwdType2 = ref('password')
  40. const changeEye = (type) => {
  41. if (type === 1) {
  42. pwdType.value = pwdType.value === 'password' ? 'text' : 'password'
  43. } else {
  44. pwdType2.value = pwdType2.value === 'password' ? 'text' : 'password'
  45. }
  46. }
  47. onMounted(() => {
  48. // 状态栏高度
  49. iSMT.value = uni.getSystemInfoSync().statusBarHeight;
  50. console.log('看看高度', iSMT.value)
  51. })
  52. </script>
  53. <style>
  54. .title {
  55. height: 8.5vh;
  56. background-color: white;
  57. }
  58. .label {
  59. height: 8.5vh;
  60. font-size: 40rpx;
  61. font-weight: bold;
  62. display: flex;
  63. align-items: center;
  64. padding: 0 60rpx;
  65. }
  66. .top {
  67. height: auto;
  68. background-color: white;
  69. display: flex;
  70. flex-direction: column;
  71. align-items: center;
  72. }
  73. .top-list {
  74. width: 630rpx;
  75. height: 7vh;
  76. margin: 0rpx 40rpx;
  77. display: flex;
  78. align-items: center;
  79. border-bottom: 1rpx solid #eee;
  80. }
  81. .left {
  82. flex: 1;
  83. display: flex;
  84. align-items: center;
  85. }
  86. .input {
  87. flex: 1;
  88. height: 70rpx;
  89. font-size: 29rpx;
  90. margin-left: 20rpx;
  91. }
  92. .bottom {
  93. height: 22vh;
  94. background-color: white;
  95. display: flex;
  96. align-items: center;
  97. justify-content: center;
  98. }
  99. .change-btn {
  100. height: 85rpx;
  101. width: 610rpx;
  102. padding: 0 20rpx;
  103. background-color: black;
  104. color: white;
  105. border-radius: 40rpx;
  106. display: flex;
  107. align-items: center;
  108. justify-content: center;
  109. }
  110. .img {
  111. position: absolute;
  112. right: 0;
  113. top: 50%;
  114. transform: translateY(-50%);
  115. }
  116. .tips {
  117. font-size: 24rpx;
  118. color: #999;
  119. margin-top: 20rpx;
  120. margin-left: 60rpx;
  121. align-self: flex-start;
  122. /* 这是左对齐 */
  123. }
  124. </style>