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.

237 lines
4.1 KiB

1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
  1. <template>
  2. <view class="content">
  3. <view v-if="step === 1">
  4. <view style="height: 138rpx; width: 100%;"></view>
  5. <view class="a1 flex">
  6. <image src="/static/icons/icon7.png" style="width: 29rpx;height: 32rpx; margin-right: 10rpx" />
  7. <span>手机号快捷登录</span>
  8. </view>
  9. <view class="a2">未注册手机号将自动创建账号</view>
  10. <view class="a3"></view>
  11. <view class="a4 flex">
  12. <view class="left-area">+86</view>
  13. <input placeholder="请输入手机号" />
  14. </view>
  15. <button class="a5" @click="clickSendCode">下一步</button>
  16. </view>
  17. <view v-if="step === 2">
  18. <view class="b1">
  19. <span>输入验证码</span>
  20. </view>
  21. <view class="b2">
  22. 验证码已发送至{{ phone }}
  23. </view>
  24. <view>
  25. <view class="flex flex-sb" style="padding: 40rpx; width: calc(100% - 80rpx)">
  26. <input v-for="i in 6" class="input-m" type="number" :class="{active: i === code.length+1}"
  27. :focus="i === code.length+1" :value="code[i-1]" @click="clickNum(i)" @input="inputNum" />
  28. </view>
  29. </view>
  30. <view class="b3">
  31. 没收到验证码?<span>重新发送</span>
  32. </view>
  33. <view class="b4">
  34. 确认绑定
  35. </view>
  36. </view>
  37. </view>
  38. </template>
  39. <script>
  40. import md5 from '@/utils/md5.js'
  41. export default {
  42. data() {
  43. return {
  44. step: 1,
  45. openid: '',
  46. code: '',
  47. phone : '156**3437'
  48. }
  49. },
  50. onShow() {
  51. },
  52. methods: {
  53. clickCancel() {
  54. uni.switchTab({
  55. url: '/pages/index/index'
  56. })
  57. },
  58. clickSendCode() {
  59. this.step = 2
  60. },
  61. clickNum(i) {
  62. this.code = this.code.substring(0, i - 1)
  63. },
  64. inputNum(event) {
  65. if (event) {
  66. this.code = this.code + event.detail.value.toString().substring(0, 1)
  67. if (this.code.length === 6) {
  68. this.checkCode()
  69. }
  70. }
  71. },
  72. checkCode() {
  73. this.clickCancel()
  74. },
  75. }
  76. }
  77. </script>
  78. <style>
  79. .b1 {
  80. width: 100%;
  81. height: 56rpx;
  82. font-size: 40rpx;
  83. font-family: PingFang SC, PingFang SC-Heavy;
  84. font-weight: 800;
  85. text-align: center;
  86. color: #333333;
  87. margin-top: 38rpx;
  88. }
  89. .b2 {
  90. width: 100%;
  91. height: 40rpx;
  92. font-size: 28rpx;
  93. font-family: PingFang SC, PingFang SC-Regular;
  94. font-weight: 400;
  95. text-align: center;
  96. color: #a5a5a5;
  97. margin-top: 20rpx;
  98. }
  99. .input-m {
  100. width: 96rpx;
  101. height: 136rpx;
  102. background: #f8f8f8;
  103. border-radius: 16rpx;
  104. line-height: 136rpx;
  105. font-size: 52rpx;
  106. font-family: PingFang SC, PingFang SC-Heavy;
  107. font-weight: 800;
  108. text-align: center;
  109. color: #333333;
  110. }
  111. .input-m.active {
  112. width: 90rpx;
  113. height: 130rpx;
  114. border: 3rpx solid #F6BEC3;
  115. }
  116. .b3 {
  117. font-size: 28rpx;
  118. font-family: PingFang SC, PingFang SC-Regular;
  119. font-weight: 400;
  120. text-align: center;
  121. color: #666666;
  122. }
  123. .b3 span {
  124. color: #F6BEC3;
  125. }
  126. .b4 {
  127. width: 556rpx;
  128. height: 90rpx;
  129. line-height: 90rpx;
  130. border-radius: 46rpx;
  131. background: #F6BEC3;
  132. font-size: 28rpx;
  133. font-family: PingFang SC, PingFang SC-Regular;
  134. font-weight: 400;
  135. text-align: center;
  136. color: #ffffff;
  137. margin: 94rpx auto;
  138. }
  139. .a1 {
  140. font-size: 32rpx;
  141. line-height: 38rpx;
  142. font-family: PingFang SC, PingFang SC-Heavy, serif;
  143. font-weight: 800;
  144. text-align: left;
  145. color: #333333;
  146. margin-left: 98rpx;
  147. margin-bottom: 12rpx;
  148. }
  149. .a2 {
  150. font-size: 28rpx;
  151. font-family: PingFang SC, PingFang SC-Regular;
  152. font-weight: 400;
  153. text-align: left;
  154. color: #a5a5a5;
  155. margin-left: 98rpx;
  156. }
  157. .a3 {
  158. width: 100%;
  159. height: 120rpx;
  160. background: #fff;
  161. }
  162. .a4 {
  163. width: 556rpx;
  164. height: 90rpx;
  165. line-height: 90rpx;
  166. background: #f5f5f5;
  167. border-radius: 45rpx;
  168. margin: 0 auto;
  169. }
  170. .left-area {
  171. width: 136rpx;
  172. font-size: 32rpx;
  173. font-family: PingFang SC, PingFang SC-Bold;
  174. font-weight: 700;
  175. text-align: center;
  176. color: #333333;
  177. }
  178. .a4 input {
  179. line-height: 90rpx;
  180. padding: 22rpx 0;
  181. font-size: 32rpx;
  182. font-family: PingFang SC, PingFang SC-Bold;
  183. font-weight: 700;
  184. color: #333333;
  185. }
  186. .a5 {
  187. width: 556rpx;
  188. height: 90rpx;
  189. line-height: 90rpx;
  190. background: #F6BEC3;
  191. border-radius: 46px;
  192. margin: 60rpx auto;
  193. font-size: 28rpx;
  194. font-family: PingFang SC, PingFang SC-Regular;
  195. font-weight: 400;
  196. text-align: center;
  197. color: #ffffff;
  198. }
  199. </style>