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.

142 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="top">
  6. <view class="top-list">
  7. <view class="left">
  8. <img src="/static/my/bindedPhone.png" />
  9. <text class="label">已绑手机号{{ phone }}</text>
  10. </view>
  11. </view>
  12. <view class="top-list">
  13. <view class="left">
  14. <img src="/static/my/changeBindPhone.png" />
  15. <text class="label">+86</text>
  16. <input type="number" placeholder="请输入您的换绑手机号" class="input" />
  17. </view>
  18. <view class="right">
  19. <button class="verification" :class="{ 'disabled': gettingCode }" @click="getVerification"
  20. :disabled="gettingCode">
  21. {{ gettingCode ? `重新发送 ${time}s` : '获取验证码' }}
  22. </button>
  23. </view>
  24. </view>
  25. <view class="top-list">
  26. <view class="left">
  27. <img src="/static/my/verification.png" />
  28. <input type="text" placeholder="请输入验证码" class="input" />
  29. </view>
  30. </view>
  31. </view>
  32. <view class="bottom">
  33. <button class="change-btn">换绑</button>
  34. </view>
  35. </view>
  36. </template>
  37. <script setup>
  38. import {
  39. ref,
  40. onMounted
  41. } from 'vue'
  42. const iSMT = ref(0)
  43. const phone = ref('15105421566')
  44. const gettingCode = ref(false)
  45. const time = ref(60)
  46. const getVerification = () => {
  47. if (gettingCode.value) return
  48. gettingCode.value = true
  49. time.value = 60
  50. const timer = setInterval(() => {
  51. time.value--
  52. if (time.value <= 0) {
  53. clearInterval(timer)
  54. gettingCode.value = false
  55. }
  56. }, 1000)
  57. }
  58. onMounted(() => {
  59. // 状态栏高度
  60. iSMT.value = uni.getSystemInfoSync().statusBarHeight;
  61. console.log('看看高度', iSMT.value)
  62. })
  63. </script>
  64. <style>
  65. .top {
  66. height: auto;
  67. background-color: white;
  68. display: flex;
  69. flex-direction: column;
  70. align-items: center;
  71. justify-content: 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. .label {
  87. font-size: 28rpx;
  88. margin-left: 10rpx;
  89. }
  90. .right {
  91. display: flex;
  92. align-items: center;
  93. justify-content: center;
  94. }
  95. .input {
  96. flex: 1;
  97. height: 70rpx;
  98. font-size: 29rpx;
  99. margin-left: 20rpx;
  100. }
  101. .verification {
  102. font-size: 24rpx;
  103. border-radius: 10rpx;
  104. background-color: rgb(230, 230, 230);
  105. }
  106. .bottom {
  107. height: 22vh;
  108. background-color: white;
  109. display: flex;
  110. align-items: center;
  111. justify-content: center;
  112. }
  113. .change-btn {
  114. height: 85rpx;
  115. width: 610rpx;
  116. padding:0 20rpx;
  117. background-color: black;
  118. color: white;
  119. border-radius: 40rpx;
  120. display: flex;
  121. align-items: center;
  122. justify-content: center;
  123. }
  124. </style>