select-bank.vue 2.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110
  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(options) {
  37. this.radio=options.id
  38. this.fetchCardList()
  39. },
  40. methods: {
  41. async fetchCardList() {
  42. let params = {
  43. userId:this.vuex_shopId,
  44. size: 10
  45. }
  46. let res=await this.$api.userBank.appList(params)
  47. if (!this.$isEmpty(res.data.records)) {
  48. this.bankList = res.data.records
  49. }
  50. },
  51. confirm(){
  52. let bankList= this.bankList.filter(item=>item.id==this.radio)
  53. let params={
  54. bank:bankList[0]
  55. }
  56. this.$util.backWithParams(params)
  57. }
  58. }
  59. };
  60. </script>
  61. <style lang="scss" scoped>
  62. .bank {
  63. margin-bottom: 20rpx;
  64. border-radius: 20rpx;
  65. background-color: #FFFFFF;
  66. padding: 44rpx;
  67. display: flex;
  68. justify-content: space-between;
  69. .left {
  70. display: flex;
  71. image {
  72. width: 90rpx;
  73. height: 90rpx;
  74. margin-right: 20rpx;
  75. }
  76. .content {
  77. display: flex;
  78. flex-direction: column;
  79. text:first-child {
  80. color: #252525;
  81. font-weight: 800;
  82. font-size: 34rpx;
  83. }
  84. text:last-child {
  85. margin-top: 15rpx;
  86. color: #888888;
  87. font-size: 26rpx;
  88. }
  89. }
  90. }
  91. }
  92. .card_add {}
  93. .submit-btn {
  94. background-color: #EE9230;
  95. color: #FFFFFF;
  96. border-radius: 10rpx;
  97. }
  98. </style>