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.

verify-phone.vue 3.8KB

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