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.6KB

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