userBank.vue 2.5 KB

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