cm-cards-popup.vue 4.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220
  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-xiayibu"></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. idCard:cards.idCard,
  97. cvvCode:cards.cvvCode
  98. }
  99. this.$emit('handleChoiceaCards', data)
  100. this.hidePopup()
  101. },
  102. handleAddCard(index) {
  103. //跳转添加卡号
  104. this.$emit('addCards', index)
  105. },
  106. hidePopup() {
  107. this.$parent.popupShow1 = false
  108. }
  109. }
  110. }
  111. </script>
  112. <style lang="scss">
  113. .record-template {
  114. width: 100%;
  115. height: auto;
  116. background: #ffffff;
  117. float: left;
  118. margin-top: 24rpx;
  119. }
  120. .tui-popup-box {
  121. position: relative;
  122. box-sizing: border-box;
  123. min-height: 220rpx;
  124. padding: 24rpx 32rpx 0 32rpx;
  125. .title {
  126. font-size: $font-size-32;
  127. color: $text-color;
  128. line-height: 68rpx;
  129. text-align: center;
  130. float: left;
  131. width: 100%;
  132. height: 68rpx;
  133. box-sizing: border-box;
  134. padding: 0 24rpx;
  135. position: relative;
  136. font-weight: bold;
  137. .title-close {
  138. width: 68rpx;
  139. height: 68rpx;
  140. text-align: center;
  141. line-height: 68rpx;
  142. position: absolute;
  143. right: 0;
  144. top: 0;
  145. .iconfont {
  146. color: #b2b2b2;
  147. font-size: 40rpx;
  148. }
  149. }
  150. }
  151. .tui-popup-main {
  152. width: 100%;
  153. float: left;
  154. padding-top: 10rpx;
  155. .tui-popup-scroll {
  156. width: 100%;
  157. height: 600rpx;
  158. .pay-card-main {
  159. width: 100%;
  160. height: auto;
  161. float: left;
  162. box-sizing: border-box;
  163. .pay-item-cell {
  164. height: 100rpx;
  165. box-sizing: border-box;
  166. padding: 26rpx 0;
  167. background-color: #ffffff;
  168. border-bottom: 1px solid #e1e1e1;
  169. .item-icon {
  170. width: 48rpx;
  171. height: 48rpx;
  172. margin-right: 20rpx;
  173. float: left;
  174. image {
  175. width: 48rpx;
  176. height: 48rpx;
  177. display: block;
  178. }
  179. .iconfont {
  180. font-size: 48rpx;
  181. &.icon-gerenwangyinzhifu {
  182. color: #004889;
  183. }
  184. }
  185. }
  186. .item-texts {
  187. line-height: 48rpx;
  188. font-size: $font-size-28;
  189. color: $text-color;
  190. float: left;
  191. &.add {
  192. font-weight: bold;
  193. }
  194. }
  195. .item-checked {
  196. width: 48rpx;
  197. height: 48rpx;
  198. float: right;
  199. text-align: center;
  200. line-height: 48rpx;
  201. font-size: $font-size-40;
  202. color: #ffffff;
  203. .icon-weixuanze {
  204. color: #b2b2b2;
  205. }
  206. .icon-yixuanze3 {
  207. color: #ff5b00;
  208. }
  209. .icon-xiayibu {
  210. color: #b2b2b2;
  211. }
  212. }
  213. }
  214. }
  215. }
  216. }
  217. }
  218. </style>