Nevar pievienot vairāk kā 25 tēmas Tēmai ir jāsākas ar burtu vai ciparu, tā var saturēt domu zīmes ('-') un var būt līdz 35 simboliem gara.

change-phone.vue 3.3KB

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