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.

transfer-verification.vue 6.1KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308
  1. <template>
  2. <view class="oderPage">
  3. <u-form :model="form" ref="myForm">
  4. <view class="from">
  5. <u-form-item prop="cardState">
  6. <view class="from_item">
  7. <text><text style="color: red">*</text>是否保留卡签:</text>
  8. <u-radio-group v-model="form.serviceTypeName">
  9. <u-radio :customStyle="{ marginBottom: '8px' }" activeColor="#2CE242"
  10. v-for="(item, index) in radiolist1" :key="index" :label="item.disabled"
  11. :name="item.name">
  12. {{ item.name }}
  13. </u-radio>
  14. </u-radio-group>
  15. </view>
  16. </u-form-item>
  17. <!-- <u-form-item prop="phone">
  18. <view class="from_item" style="background-color: #f7f7f7">
  19. <text><text style="color: red"></text>手机号:</text>
  20. <u-input v-model="form.mobile" :disabled="true" class="input" />
  21. </view>
  22. </u-form-item>
  23. <u-form-item prop="code">
  24. <view class="from_item">
  25. <text><text style="color: red"></text>验证码:</text>
  26. <u-input v-model="form.code" placeholder="请输入验证码" class="input" />
  27. <view class="hint2">
  28. <view class="green">{{ codeDuration === 0 ? "" : codeDuration }}</view>
  29. <view class="grey" @click="getCode">{{
  30. codeDuration === 0 ? "发送验证码" : "秒后可重发"
  31. }}</view>
  32. </view>
  33. </view>
  34. </u-form-item> -->
  35. </view>
  36. </u-form>
  37. <button class="submit" @click="toPage()">下一步</button>
  38. </view>
  39. </template>
  40. <script setup lang="ts">
  41. import {
  42. ref,
  43. reactive
  44. } from "vue";
  45. import {
  46. navTo
  47. } from "../../utils/utils";
  48. import {
  49. onLoad
  50. } from "@dcloudio/uni-app";
  51. import {
  52. request
  53. } from "../../utils/network/request.js";
  54. import {
  55. sendCode,
  56. checkCode,
  57. changeCardApply
  58. } from "@/utils/network/api.js";
  59. import {
  60. stringToJson
  61. } from "@/utils/network/encryption";
  62. import {
  63. msg
  64. } from "@/utils/utils";
  65. // 表单数据
  66. const form = reactive({
  67. serviceType: '',
  68. serviceTypeName: '保留卡签',
  69. mobile: "",
  70. code: '',
  71. });
  72. // 单选数据列表
  73. const radiolist1 = reactive([{
  74. name: "保留卡签",
  75. disabled: false,
  76. },
  77. {
  78. name: "不保留卡签",
  79. disabled: false,
  80. }
  81. ]);
  82. //倒计时时常
  83. const codeDuration = ref(0);
  84. let interval = null;
  85. /* 验证码倒计时 */
  86. const codeInterval = () => {
  87. codeDuration.value = 60;
  88. interval = setInterval(() => {
  89. codeDuration.value--;
  90. if (codeDuration.value === 0) {
  91. if (interval) {
  92. clearInterval(interval);
  93. interval = null;
  94. }
  95. }
  96. }, 1000);
  97. };
  98. onLoad((option) => {
  99. form.mobile = option.mobile
  100. });
  101. const getCode = () => {
  102. if (codeDuration.value !== 0) {
  103. return;
  104. }
  105. const options = {
  106. type: 2,
  107. data: {
  108. mobile: form.mobile
  109. },
  110. method: "POST",
  111. showLoading: true,
  112. };
  113. request(sendCode, options)
  114. .then((res) => {
  115. codeInterval();
  116. msg("验证码发送成功!");
  117. })
  118. .catch((err) => {
  119. console.log(err);
  120. });
  121. }
  122. //下一步
  123. const toPage = () => {
  124. if (form.serviceTypeName === '保留卡签') {
  125. form.serviceType = 'WITHVEHICLE'
  126. } else {
  127. form.serviceType = 'WITHCUSTOMER'
  128. }
  129. // const options = {
  130. // type: 2,
  131. // data: {
  132. // mobile: form.mobile,
  133. // code: form.code
  134. // },
  135. // method: "POST",
  136. // showLoading: true,
  137. // };
  138. // request(checkCode, options)
  139. // .then((res) => {
  140. uni.$emit('queryCardlossStatus', {
  141. type: form.serviceType
  142. })
  143. uni.navigateBack()
  144. // })
  145. // .catch((err) => {
  146. // console.log(err);
  147. // });
  148. };
  149. </script>
  150. <style>
  151. page {
  152. width: 100%;
  153. height: 100%;
  154. display: flex;
  155. flex-direction: column;
  156. background-color: ##eef7f7;
  157. }
  158. </style>
  159. <style lang="scss" scoped>
  160. .hint2 {
  161. display: flex;
  162. .green {
  163. font-size: 28rpx;
  164. color: #00b38b;
  165. }
  166. .grey {
  167. font-size: 24rpx;
  168. color: #000000;
  169. margin-left: 16rpx;
  170. }
  171. }
  172. .oderPage {
  173. flex: 1;
  174. width: 100%;
  175. .from1 {
  176. background-color: #fff;
  177. margin-top: 30rpx;
  178. padding: 0 30rpx;
  179. ::v-deep .uni-forms-item {
  180. border-bottom: 1rpx solid #ccc;
  181. padding: 15rpx 0;
  182. margin-bottom: 0;
  183. .uni-forms-item__label {
  184. font-size: 28rpx;
  185. height: 50rpx;
  186. }
  187. .uni-forms-item__content {
  188. display: flex;
  189. }
  190. .uni-easyinput__content-input {
  191. font-size: 28rpx;
  192. height: 50rpx;
  193. }
  194. }
  195. .btn {
  196. line-height: 38rpx;
  197. font-size: 24rpx;
  198. font-family: Microsoft YaHei;
  199. font-weight: 400;
  200. color: #ffffff;
  201. background: #00b38b;
  202. border-radius: 10rpx;
  203. padding: 10rpx 15rpx;
  204. }
  205. }
  206. .from {
  207. background-color: #fff;
  208. margin-top: 30rpx;
  209. padding: 0 30rpx;
  210. ::v-deep .u-form-item {
  211. padding: 0;
  212. line-height: normal;
  213. .u-form-item__message {
  214. margin-bottom: 12rpx;
  215. }
  216. }
  217. .from_item {
  218. display: flex;
  219. flex-wrap: nowrap;
  220. justify-content: space-between;
  221. align-items: center;
  222. height: 80rpx;
  223. border-bottom: 1rpx solid #dcdcdc;
  224. .btn {
  225. font-size: 24rpx;
  226. font-family: Microsoft YaHei;
  227. font-weight: 400;
  228. color: #ffffff;
  229. background: #00b38b;
  230. border-radius: 10rpx;
  231. padding: 10rpx 15rpx;
  232. }
  233. ::v-deep .input {
  234. text-align: left;
  235. flex: 1;
  236. input {
  237. text-align: left;
  238. }
  239. }
  240. }
  241. .from_item1 {
  242. display: flex;
  243. flex-wrap: nowrap;
  244. flex-direction: column;
  245. justify-content: space-between;
  246. padding: 30rpx;
  247. border-bottom: #dcdcdc 1px solid;
  248. input {
  249. text-align: right;
  250. }
  251. .textarea {
  252. background-color: #f1f1f1;
  253. width: 100%;
  254. border-radius: 20rpx;
  255. margin-top: 10rpx;
  256. text-indent: 1rem;
  257. height: 180rpx;
  258. padding: 20rpx;
  259. box-sizing: border-box;
  260. }
  261. }
  262. }
  263. }
  264. .submit {
  265. background: linear-gradient(to left, #43a1e0 0%, #13e7c1 100%);
  266. width: 670rpx;
  267. height: 80rpx;
  268. color: #fff;
  269. border-radius: 100rpx;
  270. position: fixed;
  271. left: 50%;
  272. transform: translate(-50%);
  273. bottom: 60rpx;
  274. font-size: 32rpx;
  275. }
  276. </style>