userBank.vue 2.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139
  1. <template>
  2. <view>
  3. <view @click="add(item.id)" style="position: relative;" hover-class="none" v-for="(item,index) in bankList"
  4. :key="index" class="card card_bg">
  5. <view @click.stop="del(item.id)" style="position: absolute;right: 10rpx;top: 10rpx;">
  6. <u-icon name="close-circle" color="#fff" size="40"></u-icon>
  7. </view>
  8. <view class="top center" style="justify-content: flex-start;">
  9. <view class="center margin-top-10">
  10. <image :src="'/static/bank/'+'DEF'+'.png'"></image>
  11. </view>
  12. <view class="">
  13. <text class="bankType">{{item.bankName}}</text>
  14. <text class="bankAccountType">{{dealBankCodeType(item.bankCardType)}}</text>
  15. </view>
  16. </view>
  17. <view class="number">
  18. <text>{{dealAccountNo(item.accountNo)}}</text>
  19. </view>
  20. </view>
  21. <navigator url="./add" class="card_add" hover-class="none">
  22. <view class="margin-bottom-10">
  23. <u-icon name="plus-circle-fill" color="#F5A85B" size="80"></u-icon>
  24. </view>
  25. <view class="" style="color: #666666;">
  26. 添加新的银行卡
  27. </view>
  28. </navigator>
  29. </view>
  30. </template>
  31. <script>
  32. export default {
  33. data() {
  34. return {
  35. bankList: []
  36. }
  37. },
  38. onShow() {
  39. this.fetchCardList()
  40. },
  41. computed: {
  42. dealAccountNo() {
  43. return data => {
  44. return this.$util.dealAccountNo(data)
  45. }
  46. },
  47. dealBankCodeType() {
  48. return data => {
  49. return this.$getBankCodeType(data)
  50. }
  51. }
  52. },
  53. methods: {
  54. fetchCardList() {
  55. let params = {
  56. merchantNo: this.vuex_merchantNo
  57. }
  58. this.$api.yeepay.withdrawCardQuery(params).then(res => {
  59. let result = JSON.parse(res.data.result)
  60. this.bankList = result.bankCardAccountList
  61. })
  62. },
  63. del(id) {
  64. this.$dialog.showModal('确定要解绑?').then(() => {
  65. this.$api.userBank.remove(id).then(res => {
  66. if (res.success) {
  67. this.$u.toast('解绑成功!')
  68. this.fetchCardList()
  69. }
  70. })
  71. })
  72. },
  73. add(id) {
  74. return
  75. uni.navigateTo({
  76. url: `./add?id=${id}`
  77. })
  78. }
  79. }
  80. }
  81. </script>
  82. <style lang="scss" scoped>
  83. .card_add {
  84. margin: 30rpx;
  85. border-radius: 20rpx;
  86. padding: 40rpx 30rpx;
  87. background-color: #FFFFFF;
  88. display: flex;
  89. justify-content: center;
  90. align-items: center;
  91. flex-direction: column;
  92. }
  93. .card {
  94. margin: 30rpx;
  95. border-radius: 20rpx;
  96. padding: 40rpx 30rpx;
  97. background-image: linear-gradient(#F5A85B, #EF9944);
  98. display: flex;
  99. flex-direction: column;
  100. .top {
  101. display: flex;
  102. margin-bottom: 20rpx;
  103. image {
  104. border-radius: 50%;
  105. background-color: #FFFFFF;
  106. width: 70rpx;
  107. height: 70rpx;
  108. }
  109. .bankType {
  110. font-size: 36rpx;
  111. color: #FFFFFF;
  112. font-weight: 800;
  113. margin-left: 30rpx;
  114. }
  115. .bankAccountType {
  116. color: #F8E0C6;
  117. font-size: 26rpx;
  118. margin-left: 20rpx;
  119. }
  120. }
  121. .number {
  122. margin-left: 110rpx;
  123. color: #FFFFFF;
  124. font-weight: 800;
  125. font-size: 34rpx;
  126. }
  127. }
  128. </style>