選択できるのは25トピックまでです。 トピックは、先頭が英数字で、英数字とダッシュ('-')を使用した35文字以内のものにしてください。

register-step3.vue 2.8KB

1年前
123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136
  1. <!-- 注册第3步 -->
  2. <template>
  3. <view class="register-main">
  4. <view class="title">请设置登录密码</view>
  5. <view class="hint">设置登录密码用于登录</view>
  6. <view class="hint1">密码</view>
  7. <view class="form-input">
  8. <input
  9. class="input"
  10. v-model="state.password"
  11. placeholder="请输入密码"
  12. placeholder-class="form-placeholder"
  13. :password="state.isPwdType ? true : false"
  14. type="text"
  15. />
  16. <image
  17. :src="`${$imgUrl}login/${
  18. state.isPwdType ? 'icon_eye_close' : 'icon_eye_open'
  19. }.png`"
  20. class="eye"
  21. @click="state.isPwdType = !state.isPwdType"
  22. ></image>
  23. </view>
  24. <view class="hint4">{{ state.pwdHint }}</view>
  25. </view>
  26. <view class="btn">
  27. <submit-button title="确认注册" @submit="doRegister"></submit-button>
  28. </view>
  29. </template>
  30. <script setup lang="ts">
  31. import { msg, confirm, checkStr } from "@/utils/utils";
  32. import { reactive } from "vue";
  33. import { onLoad } from "@dcloudio/uni-app";
  34. import { request } from "@/utils/network/request";
  35. import { regist } from "@/utils/network/api";
  36. const state = reactive({
  37. isPwdType: true,
  38. password: "", //密码
  39. phone: "", //手机号
  40. code: "", //验证码
  41. pwdHint: "密码不少于10位,必须同时包含数字、大小写字母和特殊符号",
  42. });
  43. onLoad((options) => {
  44. state.phone = options.phone;
  45. state.code = options.code;
  46. });
  47. /* 注册 */
  48. const doRegister = () => {
  49. if (!state.password) {
  50. msg("请输入密码");
  51. return;
  52. }
  53. const options = {
  54. type: 2,
  55. data: {
  56. loginPass: state.password,
  57. mobile: state.phone,
  58. code: state.code,
  59. nickName: state.phone,
  60. },
  61. method: "POST",
  62. showLoading: true,
  63. };
  64. request(regist, options).then((res) => {
  65. confirm(
  66. "注册成功,请登录!",
  67. () => {
  68. uni.$emit("login", { phone: state.phone });
  69. uni.navigateBack({ delta: 3 });
  70. },
  71. "提示",
  72. false
  73. );
  74. });
  75. };
  76. </script>
  77. <style lang="scss" scoped>
  78. .register-main {
  79. border-top: 1rpx solid #dcdcdc;
  80. padding: 78rpx 30rpx 50rpx;
  81. .title {
  82. font-size: 32rpx;
  83. color: #333333;
  84. font-weight: 600;
  85. }
  86. .hint {
  87. font-size: 24rpx;
  88. color: #999999;
  89. margin-top: 20rpx;
  90. }
  91. .hint1 {
  92. color: #333333;
  93. font-size: 28rpx;
  94. margin-top: 100rpx;
  95. font-weight: 600;
  96. }
  97. .hint4 {
  98. margin-top: 30rpx;
  99. font-size: 26rpx;
  100. color: #00b38b;
  101. }
  102. }
  103. .form-input {
  104. display: flex;
  105. flex-direction: row;
  106. align-items: center;
  107. height: 90rpx;
  108. margin-top: 30rpx;
  109. border-bottom: 1rpx solid #dcdcdc;
  110. color: #333333;
  111. .input {
  112. flex: 1;
  113. padding-right: 48rpx;
  114. font-size: 26rpx;
  115. }
  116. .eye {
  117. width: 48rpx;
  118. height: 48rpx;
  119. }
  120. }
  121. .form-placeholder {
  122. color: #999999;
  123. }
  124. .btn {
  125. margin: 150rpx 40rpx 0px;
  126. }
  127. </style>