cm-cards-popup.vue 4.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222
  1. <template name="record">
  2. <view class="record-template">
  3. <!-- 全部银行卡 -->
  4. <tui-bottom-popup :radius="true" :show="show">
  5. <view class="tui-popup-box clearfix">
  6. <view class="title">
  7. 全部银行卡
  8. <view class="title-close">
  9. <text class="iconfont icon-iconfontguanbi" @click="hidePopup"></text>
  10. </view>
  11. </view>
  12. <view class="tui-popup-main coupon">
  13. <scroll-view class="tui-popup-scroll" scroll-y="true">
  14. <view class="pay-card-main">
  15. <view
  16. class="pay-item-cell"
  17. v-for="(cards, index) in dataList"
  18. :key="index"
  19. @click="handleChoose(index, cards)"
  20. >
  21. <view class="item-icon"
  22. ><image
  23. :src="
  24. 'https://static.caimei365.com/app/img/pay/icon_' +
  25. cards.bankCode +
  26. '_@2x.png'
  27. "
  28. ></image
  29. ></view>
  30. <view class="item-texts"
  31. ><text
  32. >{{ cards.bankName }}( {{ cards.quickPayBankNumber | bankNumeberFilter }} )</text
  33. ></view
  34. >
  35. <view class="item-checked">
  36. <text
  37. class="iconfont"
  38. :class="[checkedIndex === index ? 'icon-yixuanze3' : 'icon-weixuanze']"
  39. ></text>
  40. </view>
  41. </view>
  42. <view class="pay-item-cell add" @click="handleAddCard(2)">
  43. <view class="item-icon"><text class="iconfont icon-gerenwangyinzhifu"></text></view>
  44. <view class="item-texts add"><text>添加新卡支付</text></view>
  45. <view class="item-checked"> <text class="iconfont icon-xiangyou"></text> </view>
  46. </view>
  47. </view>
  48. </scroll-view>
  49. </view>
  50. </view>
  51. </tui-bottom-popup>
  52. </view>
  53. </template>
  54. <script>
  55. export default {
  56. name: 'record',
  57. props: {
  58. show: {
  59. type: Boolean,
  60. default: false
  61. },
  62. list: {
  63. type: Array,
  64. default: []
  65. }
  66. },
  67. data() {
  68. return {
  69. isIphoneX: this.$store.state.isIphoneX,
  70. checkedIndex: '',
  71. dataList: []
  72. }
  73. },
  74. filters: {
  75. bankNumeberFilter(value) {
  76. return value.substring(value.length - 4, value.length)
  77. }
  78. },
  79. created() {
  80. this.initDataList(this.list)
  81. },
  82. methods: {
  83. initDataList(list){
  84. // 初始化
  85. this.dataList = list
  86. console.log('list',this.dataList)
  87. },
  88. handleChoose(index, cards) {
  89. //选择银行卡
  90. this.checkedIndex = index
  91. const data = {
  92. quickPayBankNumber:cards.quickPayBankNumber,
  93. quickPayMobile:cards.quickPayMobile,
  94. quickPayBankExpireTime:cards.quickPayBankExpireTime,
  95. quickPayUserName:cards.quickPayUserName,
  96. bankName:cards.bankName,
  97. bankCode:cards.bankCode,
  98. idCard:cards.idCard,
  99. cvvCode:cards.cvvCode
  100. }
  101. this.$emit('handleChoiceaCards', data)
  102. this.hidePopup()
  103. },
  104. handleAddCard(index) {
  105. //跳转添加卡号
  106. this.$emit('addCards', index)
  107. },
  108. hidePopup() {
  109. this.$parent.popupShow1 = false
  110. }
  111. }
  112. }
  113. </script>
  114. <style lang="scss">
  115. .record-template {
  116. width: 100%;
  117. height: auto;
  118. background: #ffffff;
  119. float: left;
  120. margin-top: 24rpx;
  121. }
  122. .tui-popup-box {
  123. position: relative;
  124. box-sizing: border-box;
  125. min-height: 220rpx;
  126. padding: 24rpx 32rpx 0 32rpx;
  127. .title {
  128. font-size: $font-size-32;
  129. color: $text-color;
  130. line-height: 68rpx;
  131. text-align: center;
  132. float: left;
  133. width: 100%;
  134. height: 68rpx;
  135. box-sizing: border-box;
  136. padding: 0 24rpx;
  137. position: relative;
  138. font-weight: bold;
  139. .title-close {
  140. width: 68rpx;
  141. height: 68rpx;
  142. text-align: center;
  143. line-height: 68rpx;
  144. position: absolute;
  145. right: 0;
  146. top: 0;
  147. .iconfont {
  148. color: #b2b2b2;
  149. font-size: 40rpx;
  150. }
  151. }
  152. }
  153. .tui-popup-main {
  154. width: 100%;
  155. float: left;
  156. padding-top: 10rpx;
  157. .tui-popup-scroll {
  158. width: 100%;
  159. height: 600rpx;
  160. .pay-card-main {
  161. width: 100%;
  162. height: auto;
  163. float: left;
  164. box-sizing: border-box;
  165. .pay-item-cell {
  166. height: 100rpx;
  167. box-sizing: border-box;
  168. padding: 26rpx 0;
  169. background-color: #ffffff;
  170. border-bottom: 1px solid #e1e1e1;
  171. .item-icon {
  172. width: 48rpx;
  173. height: 48rpx;
  174. margin-right: 20rpx;
  175. float: left;
  176. image {
  177. width: 48rpx;
  178. height: 48rpx;
  179. display: block;
  180. }
  181. .iconfont {
  182. font-size: 48rpx;
  183. &.icon-gerenwangyinzhifu {
  184. color: #004889;
  185. }
  186. }
  187. }
  188. .item-texts {
  189. line-height: 48rpx;
  190. font-size: $font-size-28;
  191. color: $text-color;
  192. float: left;
  193. &.add {
  194. font-weight: bold;
  195. }
  196. }
  197. .item-checked {
  198. width: 48rpx;
  199. height: 48rpx;
  200. float: right;
  201. text-align: center;
  202. line-height: 48rpx;
  203. font-size: $font-size-40;
  204. color: #ffffff;
  205. .icon-weixuanze {
  206. color: #b2b2b2;
  207. }
  208. .icon-yixuanze3 {
  209. color: #F3B574;
  210. }
  211. .icon-xiangyou {
  212. color: #b2b2b2;
  213. }
  214. }
  215. }
  216. }
  217. }
  218. }
  219. }
  220. </style>