您最多选择25个主题 主题必须以字母或数字开头,可以包含连字符 (-),并且长度不得超过35个字符

forget-pwd-step1.vue 2.7KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137
  1. <!-- 注册第1步 -->
  2. <template>
  3. <view class="register-main">
  4. <view class="title">忘记密码</view>
  5. <view class="hint">请输入手机号</view>
  6. <view class="form-input">
  7. <view> +86</view>
  8. <image :src="`${$imgUrl}common/arror_down_black.png`" class="arror" />
  9. <input
  10. class="input"
  11. v-model="state.phone"
  12. focus
  13. placeholder="请输入手机号"
  14. placeholder-class="form-placeholder"
  15. type="number"
  16. maxlength="11"
  17. />
  18. </view>
  19. </view>
  20. <view class="btn">
  21. <submit-button
  22. title="验证手机号"
  23. @submit="nextStep"
  24. ></submit-button>
  25. </view>
  26. </template>
  27. <script setup lang="ts">
  28. import uCheckBox from "@/uni_modules/vk-uview-ui/components/u-checkbox/u-checkbox.vue";
  29. import { reactive } from "vue";
  30. import { checkStr, msg, navTo } from "@/utils/utils";
  31. import { sendCode, regist } from "@/utils/network/api.js";
  32. import { request } from "@/utils/network/request.js";
  33. const state = reactive({
  34. phone: "", //电话
  35. });
  36. /* 下一步 */
  37. const nextStep = () => {
  38. if (!state.phone) {
  39. msg("请输入手机号!");
  40. return;
  41. }
  42. if (!checkStr(state.phone, "mobile")) {
  43. msg("请输入正确的手机号!");
  44. return;
  45. }
  46. const options = {
  47. type: 2,
  48. data: { mobile: state.phone },
  49. method: "POST",
  50. showLoading: true,
  51. };
  52. request(sendCode, options)
  53. .then((res) => {
  54. msg("验证码发送成功!");
  55. navTo(`/login/forget-pwd-step2?phone=${state.phone}`);
  56. })
  57. .catch((err) => {
  58. console.log(err);
  59. });
  60. };
  61. </script>
  62. <style lang="scss" scoped>
  63. .register-main {
  64. border-top: 1rpx solid #dcdcdc;
  65. padding: 78rpx 30rpx 50rpx;
  66. .title {
  67. font-size: 32rpx;
  68. color: #333333;
  69. font-weight: 600;
  70. }
  71. .hint {
  72. font-size: 24rpx;
  73. color: #999999;
  74. margin-top: 20rpx;
  75. }
  76. .form-input {
  77. margin-top: 80rpx;
  78. display: flex;
  79. flex-direction: row;
  80. align-items: center;
  81. height: 90rpx;
  82. border-bottom: 1rpx solid #dcdcdc;
  83. padding: 0rpx 12rpx;
  84. font-size: 28rpx;
  85. color: #333333;
  86. &:last-child {
  87. margin-top: 50rpx;
  88. }
  89. .input {
  90. flex: 1;
  91. padding-right: 48rpx;
  92. background: transparent;
  93. }
  94. .arror {
  95. width: 28rpx;
  96. height: 25rpx;
  97. margin-left: 16rpx;
  98. margin-right: 40rpx;
  99. }
  100. .eye {
  101. width: 48rpx;
  102. height: 48rpx;
  103. }
  104. }
  105. .form-placeholder {
  106. color: #999999;
  107. }
  108. .agreement {
  109. font-size: 24rpx;
  110. display: flex;
  111. align-items: center;
  112. margin-top: 60rpx;
  113. .txt-grey {
  114. color: #666666;
  115. }
  116. .txt-green {
  117. color: #00b38b;
  118. }
  119. :deep(.u-checkbox) {
  120. margin-right: -20rpx;
  121. }
  122. }
  123. }
  124. .btn {
  125. margin: 200rpx 40rpx 0px;
  126. }
  127. </style>