Nelze vybrat více než 25 témat Téma musí začínat písmenem nebo číslem, může obsahovat pomlčky („-“) a může být dlouhé až 35 znaků.

transfer-verification.vue 6.8KB

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