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.

verification.vue 4.7KB

2 anni fa
1 anno fa
2 anni fa
1 anno fa
2 anni fa
2 anni fa
2 anni fa
2 anni fa
2 anni fa
2 anni fa
2 anni fa
2 anni fa
2 anni fa
2 anni fa
2 anni fa
2 anni fa
2 anni fa
2 anni fa
2 anni fa
2 anni fa
2 anni fa
2 anni fa
2 anni fa
2 anni fa
2 anni fa
1 anno fa
2 anni fa
123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225
  1. <template>
  2. <view class="formBox">
  3. <view class="from_item">
  4. <text class="label">手机号码</text>
  5. <input type="number" placeholder="请输入手机号码" v-model="model1.mobile" placeholder-style="color:#9a9a9a"
  6. maxlength="11">
  7. </view>
  8. <view class="from_item">
  9. <text class="label">验证码</text>
  10. <input type="text" placeholder="请输入验证码" v-model="model1.code" placeholder-style="color:#9a9a9a">
  11. <text class="btn" @click="getCode" v-if="waitTime==0">获取验证码</text>
  12. <text class="btn" v-else>{{waitTime}}</text>
  13. </view>
  14. <button class="submit" @click="submit">验证</button>
  15. </view>
  16. </template>
  17. <script setup lang="ts">
  18. import {
  19. reactive,
  20. ref
  21. } from "vue";
  22. import {
  23. navTo
  24. } from "@/utils/utils"
  25. import {
  26. onLoad,
  27. onShow
  28. } from "@dcloudio/uni-app";
  29. import {
  30. stringToJson
  31. } from "@/utils/network/encryption.js";
  32. import {
  33. request
  34. } from "@/utils/network/request.js";
  35. import {
  36. sendCode,
  37. relieveCarId
  38. } from "@/utils/network/api.js"
  39. const model1 = reactive({
  40. vehiclePlate: '',
  41. vehiclePlatecolor: '',
  42. openid: '',
  43. idcardFrontImgUrl: '',
  44. idcardBacktImgUrl: '',
  45. vehPosImgUrl: '',
  46. vehNegImgUrl: '',
  47. peopleVehicleImgUrl: '',
  48. commitmentUrl: '',
  49. mobile: '',
  50. code: '',
  51. proxyUrl: "", //委托书
  52. })
  53. let waitTime = ref(0)
  54. const getCode = () => {
  55. console.log(123);
  56. if (model1.mobile) {
  57. sendCodeApi()
  58. codeInterval()
  59. } else {
  60. uni.showToast({
  61. title: '请输入手机号',
  62. icon: 'none'
  63. });
  64. }
  65. }
  66. //倒计时函数
  67. const codeInterval = () => {
  68. waitTime.value = 60
  69. let timer = setInterval(() => {
  70. if (waitTime.value == 1) {
  71. clearInterval(timer)
  72. }
  73. waitTime.value -= 1
  74. }, 1000)
  75. }
  76. // 发送验证码
  77. const sendCodeApi = (type) => {
  78. //参数说明
  79. let options = {
  80. type: 2, //type: 2,JSON格式提交数据(默认表单形式提交)
  81. data: {
  82. mobile: model1.mobile
  83. }, //请求参数
  84. method: "POST", //提交方式(默认POST)
  85. showLoading: true, //是否显示加载中(默认显示)
  86. };
  87. //调用方式
  88. request(sendCode, options)
  89. .then((res) => {
  90. let data = stringToJson(res.bizContent)
  91. console.log(data, "#################");
  92. if (data.info == "成功.") {
  93. console.log('######################CCCCCCCCCCCCCCCCC');
  94. }
  95. })
  96. .catch((err) => {
  97. console.log(err);
  98. });
  99. }
  100. const submit = () => {
  101. console.log("111");
  102. console.log(model1);
  103. let options = {
  104. type: 2, //type: 2,JSON格式提交数据(默认表单形式提交)
  105. data: model1,
  106. method: "POST", //提交方式(默认POST)
  107. showLoading: true, //是否显示加载中(默认显示)
  108. };
  109. //调用方式
  110. request(relieveCarId, options)
  111. .then((res) => {
  112. stringToJson(res.bizContent)
  113. const data = stringToJson(res.bizContent);
  114. console.log(data, "数据");
  115. if (data.info == "成功.") {
  116. navTo(`/subpackage/after-sale/rescind-carId/result?carid=${model1.vehiclePlate}`)
  117. }
  118. })
  119. .catch((err) => {
  120. console.log(err);
  121. });
  122. }
  123. onLoad((option) => {
  124. console.log(option, "这是传过来的参数");
  125. console.log(JSON.parse(option.fromData), "这是传过来的参数");
  126. let data = JSON.parse(option.fromData)
  127. model1.vehiclePlate = data.vehiclePlate
  128. model1.vehiclePlatecolor = data.vehiclePlatecolor
  129. model1.openid = data.openid
  130. model1.idcardFrontImgUrl = data.idcardFrontImgUrl
  131. model1.idcardBacktImgUrl = data.idcardBacktImgUrl
  132. model1.vehPosImgUrl = data.vehPosImgUrl
  133. model1.vehNegImgUrl = data.vehNegImgUrl
  134. model1.peopleVehicleImgUrl = data.peopleVehicleImgUrl
  135. model1.commitmentUrl = data.commitmentUrl
  136. model1.proxyUrl = data.proxyUrl
  137. })
  138. </script>
  139. <style>
  140. page {
  141. width: 100%;
  142. height: 100%;
  143. }
  144. </style>
  145. <style lang="scss" scoped>
  146. .formBox {
  147. height: 90%;
  148. width: 100%;
  149. // background-color: red;
  150. .from_item {
  151. padding: 30rpx;
  152. padding-top: 60rpx;
  153. position: relative;
  154. .label {
  155. font-size: 28rpx;
  156. font-family: Microsoft YaHei;
  157. font-weight: 400;
  158. color: #777777;
  159. }
  160. input {
  161. font-size: 32rpx;
  162. font-family: Microsoft YaHei;
  163. font-weight: 400;
  164. color: #9a9a9a;
  165. line-height: 58rpx;
  166. border-bottom: 1rpx solid #DCDCDC;
  167. margin-top: 50rpx;
  168. padding-bottom: 10rpx;
  169. }
  170. .btn {
  171. position: absolute;
  172. right: 45rpx;
  173. bottom: 48rpx;
  174. background: transparent;
  175. font-size: 30rpx;
  176. color: #15E5C1;
  177. z-index: 999;
  178. }
  179. }
  180. .submit {
  181. background: linear-gradient(to left, #43A1E0 0%, #13E7C1 100%);
  182. width: 670rpx;
  183. height: 80rpx;
  184. line-height: 80rpx;
  185. color: #fff;
  186. border-radius: 100rpx;
  187. position: fixed;
  188. bottom: 100rpx;
  189. left: 50%;
  190. transform: translate(-50%);
  191. font-size: 32rpx;
  192. font-family: Microsoft YaHei;
  193. font-weight: 400;
  194. color: #FFFFFF;
  195. line-height: 80rpx;
  196. }
  197. }
  198. </style>