cardsMixns.js 1.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566
  1. // 快捷支付银行卡
  2. var cardsMixns = function () {
  3. return {
  4. data() {
  5. return {
  6. isPopup:true,
  7. tabsIndex:0,
  8. bankIndex:'',
  9. isCardStep:0,
  10. checkedCards:{},
  11. params: {
  12. name: '',
  13. cardNumber: '',
  14. cardtype:0
  15. },
  16. }
  17. },
  18. filters: {
  19. cardsFormat(valus) {
  20. // 银行卡只显示最后四位数 ,隐藏信息用*代替
  21. return valus.replace(/^(\d{4})\d+(\d{4})$/,"$1****$2")
  22. },
  23. },
  24. computed: {
  25. disabled() {
  26. return !(this.bankIndex === 0 || this.bankIndex > 0);
  27. },
  28. disabled1() {
  29. return !(this.params.name && this.params.cardNumber.length > 18);
  30. },
  31. },
  32. methods: {
  33. handleCardStep(){
  34. // 选择银行下一步
  35. if(this.disabled){ return }
  36. this.isCardStep = 1
  37. },
  38. handleConfirm(){
  39. //确认信息并跳转银行页面
  40. },
  41. handleTabsClick(index){
  42. // 切换
  43. console.log('tabsIndex',index)
  44. this.tabsIndex = index
  45. },
  46. handleShowPopup(){
  47. //显示添加银行卡弹窗
  48. this.getBankList();
  49. this.isPopup = true
  50. },
  51. hanldeChooseBanks(cards,index){
  52. //选择银行
  53. this.bankIndex = index
  54. this.checkedCards = cards
  55. console.log('bank',cards)
  56. },
  57. handleCloseModel(){
  58. //关闭窗口
  59. this.tabsIndex = 0
  60. this.bankIndex = ''
  61. this.isCardStep = 0
  62. this.isPopup = false
  63. },
  64. }
  65. }
  66. }();