bankCard.vue 1.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384
  1. <template>
  2. <view class="bank-card">
  3. <view class="card" v-for="(item,index) in list" :key="index">
  4. <image class="icon" src="https://img0.baidu.com/it/u=3079143123,3184684096&fm=253&fmt=auto&app=138&f=JPEG?w=500&h=500" mode=""></image>
  5. <view class="info">
  6. <view class="title">
  7. {{item.bankName}}
  8. </view>
  9. <view class="type">
  10. {{item.type || '储蓄卡'}}
  11. </view>
  12. <view class="num">
  13. {{item.bankCardNo}}
  14. </view>
  15. </view>
  16. </view>
  17. <button class="add-btn" type="default" @click="addCard">+ 添加银行卡</button>
  18. </view>
  19. </template>
  20. <script>
  21. import {addBankCard,bankList} from '@/api/common.js'
  22. export default {
  23. data() {
  24. return {
  25. list: []
  26. }
  27. },
  28. methods: {
  29. addCard() {
  30. uni.navigateTo({
  31. url:'../../pages/income/addCard'
  32. })
  33. },
  34. bankList(){
  35. bankList().then(res=>{
  36. this.list = res.content
  37. })
  38. }
  39. },
  40. created() {
  41. this.bankList()
  42. }
  43. }
  44. </script>
  45. <style lang="scss" scoped>
  46. .bank-card{
  47. padding: 0 30rpx 60rpx;
  48. .card{
  49. border-radius: 12px;
  50. background: linear-gradient(90deg,rgb(116,142,251),rgb(32,181,255));
  51. display: flex;
  52. padding: 30rpx 30rpx 60rpx ;
  53. margin: 30rpx 0;
  54. color: #fff;
  55. .icon{
  56. width: 100rpx;
  57. height: 100rpx;
  58. border-radius: 50%;
  59. }
  60. .info{
  61. margin-left: 30rpx;
  62. .title{
  63. font-size: 34rpx;
  64. }
  65. .type{
  66. font-size: 28rpx;
  67. margin: 20rpx 0;
  68. }
  69. .num{
  70. font-size: 28rpx;
  71. }
  72. }
  73. }
  74. .add-btn{
  75. background: #fff;
  76. font-size: $btn-size;
  77. }
  78. }
  79. </style>