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

change-phone.vue 3.6KB

10 个月前
10 个月前
10 个月前
10 个月前
10 个月前
10 个月前
10 个月前
10 个月前
10 个月前
10 个月前
10 个月前
10 个月前
10 个月前
10 个月前
10 个月前
10 个月前
10 个月前
123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187
  1. <!-- 注册第1步 -->
  2. <template>
  3. <view class="register-main">
  4. <view class="title">修改手机号</view>
  5. <view class="hint">请输入ETC预留手机号</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="请输入ETC预留手机号" placeholder-class="form-placeholder"
  10. type="number" maxlength="11" />
  11. </view>
  12. <view class="form-input">
  13. <input class="input" v-model="state.code" focus placeholder="请输入验证码" placeholder-class="form-placeholder"
  14. type="number" maxlength="6" />
  15. <verification-code :mobile="state.phone" :type="2" :customerId="state.customerId"></verification-code>
  16. </view>
  17. </view>
  18. <view class="btn">
  19. <submit-button title="下一步" @submit="nextStep"></submit-button>
  20. </view>
  21. </template>
  22. <script setup lang="ts">
  23. import {
  24. reactive
  25. } from "vue";
  26. import {
  27. checkStr,
  28. msg,
  29. navTo
  30. } from "@/utils/utils";
  31. import {
  32. etcSmsCodeValid
  33. } from "@/utils/network/api.js";
  34. import {requestNew} from "@/utils/network/request.js";
  35. import { onLoad } from "@dcloudio/uni-app"
  36. const state = reactive({
  37. phone: "", //电话
  38. checked: false, //是否勾选阅读协议
  39. code:"",
  40. customerId:"",
  41. userType:"",
  42. changeMobileType:"",// 修改手机号类型
  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. const options = {
  63. type: 2,
  64. data: {
  65. mobile: state.phone,
  66. customerId: state.customerId,
  67. code: state.code,
  68. changeMobileType: state.changeMobileType,
  69. },
  70. method: "POST",
  71. showLoading: true,
  72. };
  73. requestNew(etcSmsCodeValid, options)
  74. .then((res) => {
  75. navTo(`/subpackage/personal-center/personal-information/setting/change-phone-newphone?phone=${state.phone}&orderId=${res.orderId}`);
  76. })
  77. .catch((err) => {
  78. console.log(err);
  79. });
  80. };
  81. onLoad((options) => {
  82. state.customerId=options.customerId
  83. state.userType=options.userType
  84. state.changeMobileType=options.changeMobileType
  85. })
  86. </script>
  87. <style lang="scss" scoped>
  88. .tips {
  89. color: red;
  90. padding: 30rpx 20rpx 0rpx 0rpx;
  91. font-size: 30rpx;
  92. }
  93. .group {
  94. display: flex;
  95. align-items: center;
  96. }
  97. .register-main {
  98. border-top: 1rpx solid #dcdcdc;
  99. padding: 78rpx 30rpx 50rpx;
  100. .title {
  101. font-size: 32rpx;
  102. color: #333333;
  103. font-weight: 600;
  104. }
  105. .hint {
  106. font-size: 24rpx;
  107. color: #999999;
  108. margin-top: 20rpx;
  109. }
  110. .form-input {
  111. margin-top: 80rpx;
  112. display: flex;
  113. flex-direction: row;
  114. align-items: center;
  115. height: 90rpx;
  116. border-bottom: 1rpx solid #dcdcdc;
  117. padding: 0rpx 12rpx;
  118. font-size: 28rpx;
  119. color: #333333;
  120. &:last-child {
  121. margin-top: 50rpx;
  122. }
  123. .input {
  124. flex: 1;
  125. padding-right: 48rpx;
  126. background: transparent;
  127. }
  128. .arror {
  129. width: 28rpx;
  130. height: 25rpx;
  131. margin-left: 16rpx;
  132. margin-right: 40rpx;
  133. }
  134. .eye {
  135. width: 48rpx;
  136. height: 48rpx;
  137. }
  138. }
  139. .form-placeholder {
  140. color: #999999;
  141. }
  142. .agreement {
  143. font-size: 24rpx;
  144. display: flex;
  145. align-items: center;
  146. margin-top: 60rpx;
  147. .txt-grey {
  148. color: #666666;
  149. }
  150. .txt-green {
  151. color: #00b38b;
  152. }
  153. :deep(.u-checkbox) {
  154. margin-right: -20rpx;
  155. }
  156. }
  157. }
  158. .btn {
  159. margin: 200rpx 40rpx 0px;
  160. }
  161. </style>