bank-card.vue 3.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190
  1. <template>
  2. <view class="bank-card">
  3. <view class="bank-box u-flex-col u-row-center" v-if="bankdata.bank_name && bankdata.bank_no">
  4. <view class="bank-name">{{bankdata.bank_name}}</view>
  5. <view class="bank-type">储蓄卡</view>
  6. <view class="bank-qiye u-flex">
  7. <text>企业全称</text>
  8. <text>{{bankdata.name}}</text>
  9. </view>
  10. <view class="bank-num u-flex">
  11. <view v-for="(a,b) in 3" :key="b" class="num-doc u-flex">
  12. <text v-for="(c,d) in 4" :key="d"></text>
  13. </view>
  14. <view class="num">
  15. {{bankdata.bank_no.substring(bankdata.bank_no.length - 4)}}
  16. </view>
  17. </view>
  18. <view class="jiebang" @click="jiebang">解绑</view>
  19. </view>
  20. <view class="not-bank u-flex-col u-col-center" v-else>
  21. <text>暂未绑定银行卡</text>
  22. <text @click="toadd">绑定银行卡</text>
  23. </view>
  24. </view>
  25. </template>
  26. <script>
  27. import {
  28. getBank,
  29. deleteBank
  30. } from "@/units/inquire.js"
  31. export default {
  32. data() {
  33. return {
  34. bankdata: {}
  35. }
  36. },
  37. onLoad() {
  38. },
  39. onShow() {
  40. this.getdata()
  41. },
  42. methods: {
  43. jiebang() {
  44. uni.showModal({
  45. title: "提示",
  46. content: "确定解绑吗",
  47. success: (e) => {
  48. if (e.confirm) {
  49. uni.showLoading({
  50. mask: true,
  51. title: "请稍后"
  52. })
  53. deleteBank().then(res => {
  54. this.$u.toast(res.msg)
  55. if (res.code == 1) {
  56. setTimeout(() => {
  57. this.getdata()
  58. }, 800)
  59. }
  60. })
  61. }
  62. }
  63. })
  64. },
  65. toadd() {
  66. uni.navigateTo({
  67. url: "/pagesD/bank-add"
  68. })
  69. },
  70. getdata() {
  71. getBank().then(res => {
  72. this.bankdata = res.data || {}
  73. })
  74. },
  75. }
  76. }
  77. </script>
  78. <style lang="scss">
  79. .bank-card {
  80. .bank-box {
  81. width: 686rpx;
  82. height: 232rpx;
  83. background: #04A37E;
  84. border-radius: 16rpx;
  85. margin: 20rpx auto;
  86. padding: 0 60rpx;
  87. position: relative;
  88. .jiebang {
  89. position: absolute;
  90. bottom: 0;
  91. right: 0;
  92. width: 68rpx;
  93. line-height: 32rpx;
  94. background: rgba(255, 255, 255, 0.2);
  95. border-radius: 16rpx 0rpx 16rpx 0rpx;
  96. text-align: center;
  97. font-size: 20rpx;
  98. font-family: PingFangSC-Regular, PingFang SC;
  99. font-weight: 400;
  100. color: #F7F7F7;
  101. }
  102. .bank-num {
  103. .num {
  104. font-size: 30rpx;
  105. font-family: JDZhengHT-Regular, JDZhengHT;
  106. font-weight: 400;
  107. color: #F7F7F7;
  108. }
  109. .num-doc {
  110. margin-right: 12rpx;
  111. text {
  112. width: 12rpx;
  113. height: 12rpx;
  114. background: #FFFFFF;
  115. opacity: 0.3;
  116. border-radius: 100rpx;
  117. margin-right: 8rpx;
  118. }
  119. }
  120. }
  121. .bank-qiye {
  122. margin-bottom: 24rpx;
  123. text:first-child {
  124. font-size: 20rpx;
  125. font-family: PingFangSC-Regular, PingFang SC;
  126. font-weight: 400;
  127. color: #F7F7F7;
  128. margin-right: 12rpx;
  129. opacity: 0.6;
  130. }
  131. text:last-child {
  132. font-size: 20rpx;
  133. font-family: PingFangSC-Regular, PingFang SC;
  134. font-weight: 400;
  135. color: #F7F7F7;
  136. }
  137. }
  138. .bank-type {
  139. font-size: 20rpx;
  140. font-family: PingFangSC-Regular, PingFang SC;
  141. font-weight: 400;
  142. color: #F7F7F7;
  143. margin-bottom: 16rpx;
  144. opacity: 0.6;
  145. }
  146. .bank-name {
  147. font-size: 26rpx;
  148. font-family: PingFangSC-Medium, PingFang SC;
  149. font-weight: 500;
  150. color: #F7F7F7;
  151. }
  152. }
  153. .not-bank {
  154. padding: 134rpx 0;
  155. text:first-child {
  156. font-size: 40rpx;
  157. font-family: PingFangSC-Medium, PingFang SC;
  158. font-weight: 500;
  159. color: #333333;
  160. margin-bottom: 110rpx;
  161. }
  162. text:last-child {
  163. width: 602rpx;
  164. line-height: 96rpx;
  165. background: #0C66C2;
  166. border-radius: 20rpx;
  167. text-align: center;
  168. font-size: 36rpx;
  169. font-family: PingFangSC-Medium, PingFang SC;
  170. font-weight: 500;
  171. color: #FFFFFF;
  172. }
  173. }
  174. }
  175. </style>