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

register-step1.vue 3.3KB

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