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.

register-step1.vue 3.4KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162
  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 class="agreement">
  20. <checkbox-group @change="checkboxChange">
  21. <checkbox
  22. :checked="state.checked"
  23. activeColor="#00B38B"
  24. size="30"
  25. icon-size="30"
  26. label-size="24"
  27. >我已阅读并同意
  28. </checkbox>
  29. </checkbox-group>
  30. <!-- <view class="txt-grey">我已阅读并同意</view> -->
  31. <view class="txt-green" @click="msg('阅读协议')"
  32. >《平台用户服务隐私协议》</view
  33. >
  34. </view>
  35. </view>
  36. <view class="btn">
  37. <submit-button
  38. title="同意协议并获取验证码"
  39. @submit="nextStep"
  40. ></submit-button>
  41. </view>
  42. </template>
  43. <script setup lang="ts">
  44. // import uCheckBox from "@/uni_modules/vk-uview-ui/components/u-checkbox/u-checkbox.vue";
  45. import { reactive } from "vue";
  46. import { checkStr, msg, navTo } from "@/utils/utils";
  47. import { sendCode, regist } from "@/utils/network/api.js";
  48. import { request } from "@/utils/network/request.js";
  49. const state = reactive({
  50. phone: "", //电话
  51. checked: false, //是否勾选阅读协议
  52. });
  53. const checkboxChange = (e) => {
  54. console.log(e);
  55. state.checked = !state.checked;
  56. };
  57. /* 下一步 */
  58. const nextStep = () => {
  59. if (!state.phone) {
  60. msg("请输入手机号!");
  61. return;
  62. }
  63. if (!checkStr(state.phone, "mobile")) {
  64. msg("请输入正确的手机号!");
  65. return;
  66. }
  67. if (!state.checked) {
  68. msg("请勾选我已阅读并同意《平台用户服务隐私协议》");
  69. return;
  70. }
  71. const options = {
  72. type: 2,
  73. data: { mobile: state.phone },
  74. method: "POST",
  75. showLoading: true,
  76. };
  77. request(sendCode, options)
  78. .then((res) => {
  79. msg("验证码发送成功!");
  80. navTo(`/login/register-step2?phone=${state.phone}`);
  81. })
  82. .catch((err) => {
  83. console.log(err);
  84. });
  85. };
  86. </script>
  87. <style lang="scss" scoped>
  88. .register-main {
  89. border-top: 1rpx solid #dcdcdc;
  90. padding: 78rpx 30rpx 50rpx;
  91. .title {
  92. font-size: 32rpx;
  93. color: #333333;
  94. font-weight: 600;
  95. }
  96. .hint {
  97. font-size: 24rpx;
  98. color: #999999;
  99. margin-top: 20rpx;
  100. }
  101. .form-input {
  102. margin-top: 80rpx;
  103. display: flex;
  104. flex-direction: row;
  105. align-items: center;
  106. height: 90rpx;
  107. border-bottom: 1rpx solid #dcdcdc;
  108. padding: 0rpx 12rpx;
  109. font-size: 28rpx;
  110. color: #333333;
  111. &:last-child {
  112. margin-top: 50rpx;
  113. }
  114. .input {
  115. flex: 1;
  116. padding-right: 48rpx;
  117. }
  118. .arror {
  119. width: 28rpx;
  120. height: 25rpx;
  121. margin-left: 16rpx;
  122. margin-right: 40rpx;
  123. }
  124. .eye {
  125. width: 48rpx;
  126. height: 48rpx;
  127. }
  128. }
  129. .form-placeholder {
  130. color: #999999;
  131. }
  132. .agreement {
  133. font-size: 24rpx;
  134. display: flex;
  135. align-items: center;
  136. margin-top: 60rpx;
  137. .txt-grey {
  138. color: #666666;
  139. }
  140. .txt-green {
  141. color: #00b38b;
  142. }
  143. :deep(.u-checkbox) {
  144. margin-right: -20rpx;
  145. }
  146. }
  147. }
  148. .btn {
  149. margin: 200rpx 40rpx 0px;
  150. }
  151. </style>