addBankCard.vue 4.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208
  1. <template>
  2. <view class="bankCard-main">
  3. <view class="card-box ">
  4. <view class="font-title">*请填写您名下有效的储蓄卡</view>
  5. <CustForm :column="column" ref="cust_form_ref" />
  6. <up-button type="primary" text="确定" @click="onSubmit"></up-button>
  7. </view>
  8. </view>
  9. </template>
  10. <script setup>
  11. import { ref } from 'vue';
  12. import CustForm from "@/components/cust-form/index.vue";
  13. const cust_form_ref = ref(null);
  14. const rules = {
  15. name: [
  16. {
  17. type: 'string',
  18. required: true,
  19. message: '请填写姓名',
  20. trigger: ['blur', 'change']
  21. },
  22. ],
  23. }
  24. const column = [
  25. {
  26. label: "户名",
  27. key: "name",
  28. type: "input",
  29. rules: rules.name,
  30. required:true
  31. },
  32. {
  33. label: "银行",
  34. key: "name",
  35. type: "input",
  36. rules: rules.name,
  37. required:true
  38. },
  39. {
  40. label: "卡号",
  41. key: "name",
  42. type: "input",
  43. rules: rules.name,
  44. required:true
  45. },
  46. {
  47. label: "预留手机号",
  48. key: "phonenumber",
  49. type: "phone-code",
  50. },
  51. ]
  52. function onSubmit() {
  53. try {
  54. // 校验表单并获取数据
  55. cust_form_ref.value.onSubmit().then(async (res) => {
  56. console.log('提交',res);
  57. // return;
  58. // 提交接口,注册人员
  59. // const submit_res = await add(parmas);
  60. // if(submit_res.code == 200){
  61. // uni.showToast({
  62. // title: '注册成功',
  63. // icon: 'none'
  64. // })
  65. // uni.navigateBack();
  66. // return;
  67. // }
  68. // uni.showToast({
  69. // title: res.msg,
  70. // icon: 'none'
  71. // })
  72. // console.log('==submit_res====>', submit_res);
  73. })
  74. } catch (error) {
  75. console.log('error', error);
  76. } finally {
  77. }
  78. }
  79. </script>
  80. <style lang="scss" scoped>
  81. .card-box {
  82. border-radius: 8px;
  83. background: rgba(255, 255, 255, 1);
  84. padding: 20px;
  85. margin-bottom: 12px;
  86. }
  87. .bank-box {
  88. border-radius: 8px;
  89. margin-bottom: 12px;
  90. }
  91. .bankCard-main {
  92. position: fixed;
  93. top: 0px;
  94. left: 0px;
  95. right: 0px;
  96. bottom: 0px;
  97. background: rgba(245, 245, 245, 1);
  98. padding: 12px;
  99. overflow: auto;
  100. .bankCard-hi-title {
  101. font-size: 20px;
  102. font-weight: 700;
  103. line-height: 28.96px;
  104. color: rgba(51, 51, 51, 1);
  105. }
  106. .bankCard-hi-text {
  107. font-size: 14px;
  108. font-weight: 500;
  109. line-height: 20.27px;
  110. color: rgba(153, 153, 153, 1);
  111. }
  112. .bankCard-active {
  113. font-size: 14px;
  114. font-weight: 500;
  115. line-height: 20.27px;
  116. color: rgba(255, 87, 4, 1);
  117. }
  118. .bankCard-hi {
  119. margin-bottom: 20px;
  120. }
  121. .bankCard-box-title {
  122. font-size: 12px;
  123. font-weight: 500;
  124. line-height: 17.38px;
  125. color: rgba(199, 199, 199, 1);
  126. margin-bottom: 8px;
  127. }
  128. .bankCard-box-price {
  129. font-size: 30px;
  130. font-weight: 500;
  131. line-height: 35.16px;
  132. color: rgba(252, 228, 187, 1);
  133. }
  134. .bankCard-box-price2 {
  135. font-size: 24px;
  136. font-weight: 400;
  137. line-height: 28.13px;
  138. color: rgba(252, 228, 187, 1);
  139. }
  140. .bankCard-box {
  141. border-radius: 12px;
  142. background: linear-gradient(131.81deg, rgba(65, 65, 95, 1) 0%, rgba(45, 48, 74, 1) 100%);
  143. margin-bottom: 14px;
  144. .bankCard-box-top {
  145. display: flex;
  146. align-content: center;
  147. justify-content: space-between;
  148. .bankCard-box-btn1 {
  149. width: 78px;
  150. height: 30px;
  151. opacity: 1;
  152. border-radius: 4px;
  153. background: linear-gradient(222.81deg, rgba(255, 227, 194, 1) 0%, rgba(255, 226, 192, 1) 0%, rgba(255, 225, 189, 1) 0%, rgba(251, 204, 147, 1) 100%);
  154. margin-bottom: 14px;
  155. font-size: 16px;
  156. font-weight: 700;
  157. line-height: 23.17px;
  158. color: rgba(50, 52, 80, 1);
  159. }
  160. .bankCard-box-btn2 {
  161. width: 78px;
  162. height: 30px;
  163. opacity: 1;
  164. border-radius: 4px;
  165. border: 1px solid rgba(255, 218, 172, 1);
  166. font-size: 16px;
  167. font-weight: 500;
  168. letter-spacing: 0px;
  169. line-height: 23.17px;
  170. color: rgba(255, 218, 172, 1);
  171. }
  172. }
  173. .bankCard-box-bottom{
  174. display: flex;
  175. align-items: center;
  176. justify-content: space-around;
  177. }
  178. }
  179. }
  180. </style>