select-bank.vue 2.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112
  1. <template>
  2. <view class="margin-20">
  3. <u-radio-group v-model="radio" active-color="#ff9447" size="40">
  4. <view @click="radio=item.id" v-for="(item,index) in bankList" :key="index" class="bank" v-if="!$isEmpty(bankList)">
  5. <view class="left center">
  6. <image :src="'/static/bank/'+item.bankType+'.png'" mode=""></image>
  7. <view class="content">
  8. <text>{{item.bankTypeLabel}}</text>
  9. <text>{{item.cardNo}}</text>
  10. </view>
  11. </view>
  12. <view class="center">
  13. <u-radio :name="item.id"></u-radio>
  14. </view>
  15. </view>
  16. </u-radio-group>
  17. <view class="">
  18. <view class="" style="height: 120rpx;"></view>
  19. <view style="background-color: #FFFFFF ;height: 120rpx;" class="footer-fixed center">
  20. <view @click="confirm" class="cu-btn df btn-bg-color radius " style="width: 86%;height: 80rpx;">
  21. <text>确认</text>
  22. </view>
  23. </view>
  24. </view>
  25. </view>
  26. </template>
  27. <script>
  28. export default {
  29. name: '',
  30. data() {
  31. return {
  32. bankList: [],
  33. radio: ''
  34. };
  35. },
  36. onLoad() {
  37. this.fetchCardList()
  38. },
  39. methods: {
  40. fetchCardList() {
  41. let params = {
  42. userId:this.vuex_shopId || '-1',
  43. size: 10
  44. }
  45. this.$api.userBank.appList(params).then(res => {
  46. if (!this.$isEmpty(res.data.records)) {
  47. this.bankList = res.data.records
  48. this.radio = this.bankList[0].id
  49. }
  50. })
  51. },
  52. confirm(){
  53. let bank= this.bankList.filter(item=>item.id==this.radio)[0]
  54. let params={
  55. bank
  56. }
  57. this.$util.backWithParams(params)
  58. }
  59. }
  60. };
  61. </script>
  62. <style lang="scss" scoped>
  63. .bank {
  64. margin-bottom: 20rpx;
  65. border-radius: 20rpx;
  66. background-color: #FFFFFF;
  67. padding: 44rpx;
  68. display: flex;
  69. justify-content: space-between;
  70. .left {
  71. display: flex;
  72. image {
  73. width: 90rpx;
  74. height: 90rpx;
  75. margin-right: 20rpx;
  76. }
  77. .content {
  78. display: flex;
  79. flex-direction: column;
  80. text:first-child {
  81. color: #252525;
  82. font-weight: 800;
  83. font-size: 34rpx;
  84. }
  85. text:last-child {
  86. margin-top: 15rpx;
  87. color: #888888;
  88. font-size: 26rpx;
  89. }
  90. }
  91. }
  92. }
  93. .card_add {}
  94. .submit-btn {
  95. background-color: #EE9230;
  96. color: #FFFFFF;
  97. border-radius: 10rpx;
  98. }
  99. </style>