cm-cards-popup.vue 5.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244
  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"><image :src="handleLogo(cards.B2B)"></image></view>
  22. <view class="item-texts"
  23. ><text>{{ cards.name }}</text></view
  24. >
  25. <view class="item-checked">
  26. <text
  27. class="iconfont"
  28. :class="[checkedIndex === index ? 'icon-yixuanze3' : 'icon-weixuanze']"
  29. ></text>
  30. </view>
  31. </view>
  32. <view class="pay-item-cell add" @click="handleAddCard(3)">
  33. <view class="item-icon"><text class="iconfont icon-gerenwangyinzhifu"></text></view>
  34. <view class="item-texts add"><text>添加新卡支付</text></view>
  35. <view class="item-checked"> <text class="iconfont icon-xiayibu"></text> </view>
  36. </view>
  37. </view>
  38. </scroll-view>
  39. </view>
  40. </view>
  41. </tui-bottom-popup>
  42. </view>
  43. </template>
  44. <script>
  45. export default {
  46. name: 'record',
  47. props: {
  48. show: {
  49. type: Boolean,
  50. default: false
  51. },
  52. list: {
  53. type: Array,
  54. default: []
  55. }
  56. },
  57. data() {
  58. return {
  59. isIphoneX: this.$store.state.isIphoneX,
  60. checkedIndex: 0,
  61. dataList: [
  62. {
  63. type: 1,
  64. flag: 0,
  65. B2B: 'CCB',
  66. name: '建设银行借记卡(0023)',
  67. code: '45454545454521212'
  68. },
  69. {
  70. type: 1,
  71. flag: 0,
  72. B2B: 'ICBC',
  73. name: '工商银行借记卡(0023)',
  74. code: '45454545454521212'
  75. },
  76. {
  77. type: 0,
  78. flag: 0,
  79. B2B: 'ABC',
  80. name: '农业银行借记卡(0023)',
  81. code: '45454545454521212'
  82. }
  83. ]
  84. }
  85. },
  86. filters: {
  87. NumFormat(value) {
  88. //处理金额
  89. if (value) {
  90. return Number(value).toFixed(2)
  91. } else {
  92. return '0.00'
  93. }
  94. },
  95. payTypeText(vaule) {
  96. //处理支付记录文字
  97. const map = {
  98. 12: '企业网银',
  99. 13: '微信支付',
  100. 14: '支付宝',
  101. 15: '微信支付',
  102. 16: '余额抵扣',
  103. 17: '建设银行借记卡(0053)'
  104. }
  105. return map[vaule]
  106. }
  107. },
  108. created() {
  109. // this.dataList = this.list
  110. },
  111. methods: {
  112. handleChoose(index,cards) {
  113. //选择银行卡
  114. this.checkedIndex = index
  115. this.$emit('handleChoiceaCards', cards)
  116. this.hidePopup()
  117. },
  118. handleAddCard(index) {
  119. //跳转添加卡号
  120. this.$api.navigateTo(`/pages/user/pay/card-add?type=${index}`)
  121. },
  122. handleLogo(type) {
  123. const LogoMap = {
  124. 'CCB':'https://img2.baidu.com/it/u=4262210206,1883697020&fm=253&fmt=auto&app=138&f=JPEG?w=500&h=501',
  125. 'ICBC':'https://www.weixinyunduan.com/ups/2016/01/309212/edf5a48e69afa569eb31a52fc36de450.jpg',
  126. 'ABC':'https://userfile.yksup.com/userdata/18039/img/brand-20170315232223_e0p18k.jpg'
  127. }
  128. return LogoMap[type]
  129. },
  130. hidePopup() {
  131. this.$parent.popupShow1 = false
  132. }
  133. }
  134. }
  135. </script>
  136. <style lang="scss">
  137. .record-template {
  138. width: 100%;
  139. height: auto;
  140. background: #ffffff;
  141. float: left;
  142. margin-top: 24rpx;
  143. }
  144. .tui-popup-box {
  145. position: relative;
  146. box-sizing: border-box;
  147. min-height: 220rpx;
  148. padding: 24rpx 32rpx 0 32rpx;
  149. .title {
  150. font-size: $font-size-32;
  151. color: $text-color;
  152. line-height: 68rpx;
  153. text-align: center;
  154. float: left;
  155. width: 100%;
  156. height: 68rpx;
  157. box-sizing: border-box;
  158. padding: 0 24rpx;
  159. position: relative;
  160. font-weight: bold;
  161. .title-close {
  162. width: 68rpx;
  163. height: 68rpx;
  164. text-align: center;
  165. line-height: 68rpx;
  166. position: absolute;
  167. right: 0;
  168. top: 0;
  169. .iconfont {
  170. color: #b2b2b2;
  171. font-size: 40rpx;
  172. }
  173. }
  174. }
  175. .tui-popup-main {
  176. width: 100%;
  177. float: left;
  178. padding-top: 10rpx;
  179. .tui-popup-scroll {
  180. width: 100%;
  181. height: 600rpx;
  182. .pay-card-main {
  183. width: 100%;
  184. height: auto;
  185. float: left;
  186. box-sizing: border-box;
  187. .pay-item-cell {
  188. height: 100rpx;
  189. box-sizing: border-box;
  190. padding: 26rpx 0;
  191. background-color: #ffffff;
  192. border-bottom: 1px solid #e1e1e1;
  193. .item-icon {
  194. width: 48rpx;
  195. height: 48rpx;
  196. margin-right: 20rpx;
  197. float: left;
  198. image {
  199. width: 48rpx;
  200. height: 48rpx;
  201. display: block;
  202. }
  203. .iconfont {
  204. font-size: 48rpx;
  205. &.icon-gerenwangyinzhifu {
  206. color: #004889;
  207. }
  208. }
  209. }
  210. .item-texts {
  211. line-height: 48rpx;
  212. font-size: $font-size-28;
  213. color: $text-color;
  214. float: left;
  215. &.add {
  216. font-weight: bold;
  217. }
  218. }
  219. .item-checked {
  220. width: 48rpx;
  221. height: 48rpx;
  222. float: right;
  223. text-align: center;
  224. line-height: 48rpx;
  225. font-size: $font-size-40;
  226. color: #ffffff;
  227. .icon-weixuanze {
  228. color: #b2b2b2;
  229. }
  230. .icon-yixuanze3 {
  231. color: #ff5b00;
  232. }
  233. .icon-xiayibu {
  234. color: #b2b2b2;
  235. }
  236. }
  237. }
  238. }
  239. }
  240. }
  241. }
  242. </style>