Du kannst nicht mehr als 25 Themen auswählen Themen müssen mit entweder einem Buchstaben oder einer Ziffer beginnen. Sie können Bindestriche („-“) enthalten und bis zu 35 Zeichen lang sein.

change-phone-newphone.vue 3.3KB

vor 7 Monaten
123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181
  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="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="3" :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. newMobileSmsCodeValid
  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. orderId:""
  41. });
  42. const checkboxChange = (e) => {
  43. console.log(e);
  44. state.checked = !state.checked;
  45. };
  46. // 去协议页面
  47. const toRead = () => {
  48. navTo("/login/agreement")
  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. const options = {
  61. type: 2,
  62. data: {
  63. mobile: state.phone,
  64. code: state.code,
  65. orderId:state.orderId
  66. },
  67. method: "POST",
  68. showLoading: true,
  69. };
  70. requestNew(newMobileSmsCodeValid, options)
  71. .then((res) => {
  72. msg('验证通过,已将手机号修改为'+state.phone)
  73. })
  74. .catch((err) => {
  75. console.log(err);
  76. });
  77. };
  78. onLoad((options) => {
  79. state.orderId=options.orderId
  80. })
  81. </script>
  82. <style lang="scss" scoped>
  83. .tips {
  84. color: red;
  85. padding: 30rpx 20rpx 0rpx 0rpx;
  86. font-size: 30rpx;
  87. }
  88. .group {
  89. display: flex;
  90. align-items: center;
  91. }
  92. .register-main {
  93. border-top: 1rpx solid #dcdcdc;
  94. padding: 78rpx 30rpx 50rpx;
  95. .title {
  96. font-size: 32rpx;
  97. color: #333333;
  98. font-weight: 600;
  99. }
  100. .hint {
  101. font-size: 24rpx;
  102. color: #999999;
  103. margin-top: 20rpx;
  104. }
  105. .form-input {
  106. margin-top: 80rpx;
  107. display: flex;
  108. flex-direction: row;
  109. align-items: center;
  110. height: 90rpx;
  111. border-bottom: 1rpx solid #dcdcdc;
  112. padding: 0rpx 12rpx;
  113. font-size: 28rpx;
  114. color: #333333;
  115. &:last-child {
  116. margin-top: 50rpx;
  117. }
  118. .input {
  119. flex: 1;
  120. padding-right: 48rpx;
  121. background: transparent;
  122. }
  123. .arror {
  124. width: 28rpx;
  125. height: 25rpx;
  126. margin-left: 16rpx;
  127. margin-right: 40rpx;
  128. }
  129. .eye {
  130. width: 48rpx;
  131. height: 48rpx;
  132. }
  133. }
  134. .form-placeholder {
  135. color: #999999;
  136. }
  137. .agreement {
  138. font-size: 24rpx;
  139. display: flex;
  140. align-items: center;
  141. margin-top: 60rpx;
  142. .txt-grey {
  143. color: #666666;
  144. }
  145. .txt-green {
  146. color: #00b38b;
  147. }
  148. :deep(.u-checkbox) {
  149. margin-right: -20rpx;
  150. }
  151. }
  152. }
  153. .btn {
  154. margin: 200rpx 40rpx 0px;
  155. }
  156. </style>