Vous ne pouvez pas sélectionner plus de 25 sujets Les noms de sujets doivent commencer par une lettre ou un nombre, peuvent contenir des tirets ('-') et peuvent comporter jusqu'à 35 caractères.

sigWithhold.vue 3.4KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134
  1. <template>
  2. <div style="padding-top: 20rpx">
  3. <form-builder-vue :formData="formData" :config="config" @submit="submit" @sendText="sendText" >
  4. </form-builder-vue>
  5. </div>
  6. </template>
  7. <script setup lang='ts'>
  8. import formBuilderVue from '@/components/form-builder/form-builder-vue3'
  9. import {
  10. ref,
  11. reactive
  12. } from 'vue'
  13. import {
  14. request
  15. } from '../../static/js/network/request'
  16. import {
  17. TypeData,
  18. Index
  19. } from '@/components/form-builder/tools'
  20. import {
  21. onLoad
  22. } from '@dcloudio/uni-app';
  23. import {
  24. storageKey
  25. } from '../../static/data/storageKey.js'
  26. let config = ({
  27. submitName: '代扣签约',
  28. titleWidth: 160
  29. })
  30. let formData = reactive([]);
  31. // let bestSignedInnerPath = ''; //绑定卡已签约入金汇路中最优汇路 00-入金汇路1(对应原行内代扣), 70-入金汇路2(对应原他行代扣), 20-入金汇路3(新增他行代扣,需要进行短信签约)
  32. let bestAvailableInnerPath = ''; //绑定卡所有可签约最优汇路 00-入金汇路1(对应原行内代扣) 70-入金汇路2(对应原他行代扣) 20-入金汇路3(新增他行代扣,需要进行短信签约)
  33. let signId = ''
  34. let index = Index('手机号', formData);
  35. let signObj = [{
  36. 'title': '手机号',
  37. 'type': 2,
  38. 'value': 'tel',
  39. 'required': true,
  40. 'disabled': true,
  41. 'tel': '18985009834',
  42. },
  43. {
  44. 'title': '短信验证码',
  45. 'type': 11,
  46. 'value': 'smsVerficationCode',
  47. 'required': true,
  48. 'hint': '请输入短信验证码',
  49. 'maxlength': 6,
  50. }
  51. ];
  52. formData = formData.concat(signObj);
  53. onLoad((res) => {
  54. if (res.signId) {
  55. signId = res.signId;
  56. formData[index][formData[index].value] = res.tel;
  57. // formData[index][formData[index].value] = res.tel.replace(/(\d{3})\d*(\d{4})/, '$1****$2')
  58. }
  59. })
  60. //发送短信
  61. function sendText(e: any, item: TypeData) {
  62. if (!formData[index][formData[index].value]) {
  63. uni.showToast({
  64. title: '手机号不能为空',
  65. icon: 'none',
  66. duration: 2000
  67. });
  68. return
  69. }
  70. //发送短信(入金汇路签约查询接口)
  71. request('IF01001202303200951', {
  72. data: {
  73. signId: signId,
  74. isSendSmsVerficationCode: "Y"
  75. }
  76. }).then((res) => {
  77. if (res.rd.data.bestSignedInnerPath) {//有值说明已经完成了代扣签约
  78. uni.showModal({
  79. title: '提示',
  80. content: "已完成代扣签约",
  81. showCancel:false,
  82. success: function(res) {
  83. if (res.confirm) {
  84. //添加车辆信息
  85. uni.navigateTo({
  86. url: '/pages/drivingLicense/drivingLicense?userIdType=' + uni.getStorageSync(storageKey
  87. .userIdType) + '&userIdNum=' + uni.getStorageSync(storageKey.userIdNum),
  88. });
  89. }
  90. }
  91. });
  92. return;
  93. }
  94. bestAvailableInnerPath = res.rd.data.bestAvailableInnerPath;
  95. })
  96. }
  97. /**
  98. * 提交
  99. */
  100. function submit(item: any) {
  101. console.log('提交内容', item);
  102. if (!bestAvailableInnerPath) {
  103. uni.showToast({
  104. title: '请先获取短信验证码',
  105. })
  106. return
  107. }
  108. item.signId = signId;
  109. item.bankInnerPathID = bestAvailableInnerPath;
  110. //代扣签约
  111. request('IF01001202304200959', {
  112. data: item
  113. }).then((res) => {
  114. //添加车辆信息
  115. uni.navigateTo({
  116. url: '/pages/drivingLicense/drivingLicense?userIdType=' + uni.getStorageSync(storageKey
  117. .userIdType) + '&userIdNum=' + uni.getStorageSync(storageKey.userIdNum),
  118. animationType: 'pop-in',
  119. animationDuration: 500
  120. });
  121. })
  122. }
  123. </script>
  124. <style lang='scss' scoped>
  125. </style>