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

register-step3.vue 2.8KB

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