Você não pode selecionar mais de 25 tópicos Os tópicos devem começar com uma letra ou um número, podem incluir traços ('-') e podem ter até 35 caracteres.

change-phone.vue 3.7KB

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