Vous ne pouvez pas sélectionner plus de 25 sujets Les noms de sujets doivent commencer par une lettre ou un nombre, peuvent contenir des tirets ('-') et peuvent comporter jusqu'à 35 caractères.

change-phone.vue 3.7KB

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