bank-card.vue 3.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194
  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. padding: 0 32rpx;
  81. box-sizing: border-box;
  82. .bank-box {
  83. width: 686rpx;
  84. height: 232rpx;
  85. background: #04A37E;
  86. border-radius: 16rpx;
  87. margin: 20rpx auto;
  88. padding: 0 60rpx;
  89. position: relative;
  90. box-sizing: border-box;
  91. .jiebang {
  92. position: absolute;
  93. bottom: 0;
  94. right: 0;
  95. width: 68rpx;
  96. line-height: 32rpx;
  97. background: rgba(255, 255, 255, 0.2);
  98. border-radius: 16rpx 0rpx 16rpx 0rpx;
  99. text-align: center;
  100. font-size: 20rpx;
  101. font-family: PingFangSC-Regular, PingFang SC;
  102. font-weight: 400;
  103. color: #F7F7F7;
  104. }
  105. .bank-num {
  106. .num {
  107. font-size: 30rpx;
  108. font-family: JDZhengHT-Regular, JDZhengHT;
  109. font-weight: 400;
  110. color: #F7F7F7;
  111. }
  112. .num-doc {
  113. margin-right: 12rpx;
  114. text {
  115. width: 12rpx;
  116. height: 12rpx;
  117. background: #FFFFFF;
  118. opacity: 0.3;
  119. border-radius: 100rpx;
  120. margin-right: 8rpx;
  121. }
  122. }
  123. }
  124. .bank-qiye {
  125. margin-bottom: 24rpx;
  126. text:first-child {
  127. font-size: 20rpx;
  128. font-family: PingFangSC-Regular, PingFang SC;
  129. font-weight: 400;
  130. color: #F7F7F7;
  131. margin-right: 12rpx;
  132. opacity: 0.6;
  133. }
  134. text:last-child {
  135. font-size: 20rpx;
  136. font-family: PingFangSC-Regular, PingFang SC;
  137. font-weight: 400;
  138. color: #F7F7F7;
  139. }
  140. }
  141. .bank-type {
  142. font-size: 20rpx;
  143. font-family: PingFangSC-Regular, PingFang SC;
  144. font-weight: 400;
  145. color: #F7F7F7;
  146. margin-bottom: 16rpx;
  147. opacity: 0.6;
  148. }
  149. .bank-name {
  150. font-size: 26rpx;
  151. font-family: PingFangSC-Medium, PingFang SC;
  152. font-weight: 500;
  153. color: #F7F7F7;
  154. }
  155. }
  156. .not-bank {
  157. padding: 134rpx 0;
  158. text:first-child {
  159. font-size: 40rpx;
  160. font-family: PingFangSC-Medium, PingFang SC;
  161. font-weight: 500;
  162. color: #333333;
  163. margin-bottom: 110rpx;
  164. }
  165. text:last-child {
  166. width: 602rpx;
  167. line-height: 96rpx;
  168. background: #0C66C2;
  169. border-radius: 20rpx;
  170. text-align: center;
  171. font-size: 36rpx;
  172. font-family: PingFangSC-Medium, PingFang SC;
  173. font-weight: 500;
  174. color: #FFFFFF;
  175. }
  176. }
  177. }
  178. </style>