You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

cardloss.vue 3.0KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167
  1. <template>
  2. <view class="formBox">
  3. <view class="from_item">
  4. <text class="label">账号验证</text>
  5. </view>
  6. <view class="from_item">
  7. <text class="label">手机号码</text>
  8. <input type="text" placeholder="" v-model="model.mobile" placeholder-style="color:#000" disabled="true">
  9. </view>
  10. <view class="from_item">
  11. <text class="label">验证码</text>
  12. <input type="text" placeholder="请输入验证码" v-model="model.code" placeholder-style="color:#000">
  13. <text class="btn" @click="getCode">获取验证码</text>
  14. </view>
  15. <button class="submit" @click="submit">验证</button>
  16. </view>
  17. </template>
  18. <script setup lang="ts">
  19. import {
  20. reactive,
  21. ref
  22. } from "vue";
  23. import {
  24. navTo
  25. } from "@/utils/utils"
  26. import {
  27. onLoad,
  28. onShow
  29. } from "@dcloudio/uni-app";
  30. import {
  31. stringToJson
  32. } from "../../utils/network/encryption.js";
  33. import {
  34. request
  35. } from "../../utils/network/request.js";
  36. import {
  37. sendCode,
  38. checkCode
  39. } from "@/utils/network/api.js";
  40. const type = ref('')
  41. let model = reactive({
  42. code: '',
  43. mobile: '',
  44. })
  45. const getCode = () => {
  46. const options = {
  47. type: 2,
  48. data: {
  49. mobile: model.mobile
  50. },
  51. method: "POST",
  52. showLoading: true,
  53. };
  54. request(sendCode, options)
  55. .then((res) => {
  56. msg("验证码发送成功!");
  57. })
  58. .catch((err) => {
  59. console.log(err);
  60. });
  61. }
  62. onLoad((options: any) => {
  63. type.value = options.type
  64. })
  65. const submit = () => {
  66. const options = {
  67. type: 2,
  68. data: {
  69. mobile: model.mobile,
  70. code: model.code
  71. },
  72. method: "POST",
  73. showLoading: true,
  74. };
  75. request(checkCode, options)
  76. .then((res) => {
  77. uni.$emit('queryCardlossStatus', {
  78. type: type.value
  79. })
  80. })
  81. .catch((err) => {
  82. console.log(err);
  83. });
  84. }
  85. </script>
  86. <style>
  87. page {
  88. width: 100%;
  89. height: 100%;
  90. }
  91. </style>
  92. <style lang="scss" scoped>
  93. .formBox {
  94. height: 90%;
  95. width: 100%;
  96. // background-color: red;
  97. .from_item {
  98. padding: 30rpx;
  99. padding-top: 60rpx;
  100. position: relative;
  101. .label {
  102. font-size: 28rpx;
  103. font-family: Microsoft YaHei;
  104. font-weight: 400;
  105. color: #777777;
  106. }
  107. input {
  108. font-size: 32rpx;
  109. font-family: Microsoft YaHei;
  110. font-weight: 400;
  111. color: #333333;
  112. line-height: 58rpx;
  113. border-bottom: 1rpx solid #DCDCDC;
  114. margin-top: 50rpx;
  115. padding-bottom: 10rpx;
  116. }
  117. .btn {
  118. position: absolute;
  119. right: 45rpx;
  120. bottom: 48rpx;
  121. background: transparent;
  122. font-size: 30rpx;
  123. color: #15E5C1;
  124. z-index: 999;
  125. }
  126. }
  127. .submit {
  128. background: linear-gradient(to left, #43A1E0 0%, #13E7C1 100%);
  129. width: 670rpx;
  130. height: 80rpx;
  131. line-height: 80rpx;
  132. color: #fff;
  133. border-radius: 100rpx;
  134. position: fixed;
  135. bottom: 100rpx;
  136. left: 50%;
  137. transform: translate(-50%);
  138. font-size: 32rpx;
  139. font-family: Microsoft YaHei;
  140. font-weight: 400;
  141. color: #FFFFFF;
  142. line-height: 80rpx;
  143. }
  144. }
  145. </style>