cardMixins.js 2.8 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192
  1. // 收银台
  2. import Vue from 'vue'
  3. const cardMixins = {
  4. data() {
  5. return {
  6. popupShow: false, // 控制支付记录弹窗
  7. popupShow1: false, // 控制快捷支付银行弹窗
  8. tabCurrentIndex: 0,
  9. weChatFlag: false, // 微信支付开关
  10. B2BpayFlag: false, //企业网银支付开关
  11. QuickPayFlag: false, // 快捷支付开发
  12. buttonText: '微信支付',
  13. btnColor: '#0ABC64',
  14. cardsList:[],//查看银行列表
  15. defaultCards: null,
  16. }
  17. },
  18. filters:{
  19. bankNumeberFilter(value){
  20. return value.substring(value.length-4,value.length)
  21. }
  22. },
  23. computed: {
  24. showWeChatPayMode() {
  25. return this.weChatFlag
  26. },
  27. showB2BpayMode() {
  28. return this.B2BpayFlag
  29. },
  30. showQuickpayMode() {
  31. return this.QuickPayFlag
  32. }
  33. },
  34. methods: {
  35. handleChoiceaCards(data) {
  36. //选择的银行
  37. this.tabCurrentIndex = 3
  38. this.tabClick(3)
  39. this.defaultCards = data
  40. this.quickParams = { ...this.quickParams , ...data}
  41. },
  42. hanldeShowPopup(index) {
  43. switch (index) {
  44. case 0:
  45. this.popupShow = true
  46. break
  47. case 1:
  48. this.popupShow1 = true
  49. break
  50. default:
  51. break
  52. }
  53. },
  54. tabClick(index) { //tab切换
  55. this.tabCurrentIndex = index
  56. switch (index) {
  57. case 0:
  58. this.btnColor = '#0ABC64'
  59. this.buttonText = '微信支付'
  60. break
  61. case 1:
  62. this.btnColor = '#007ACC'
  63. this.buttonText = '企业网银支付'
  64. break
  65. case 2:
  66. this.btnColor = '#16AFE8'
  67. this.buttonText = '个人网银支付'
  68. break
  69. case 3:
  70. this.btnColor = '#F3B574'
  71. this.buttonText = '使用银行卡快捷支付'
  72. break
  73. }
  74. },
  75. checkPayMode(range) {
  76. // 校验支付模式
  77. // 1微信 2支付宝 3个人网银 4企业网银 5快捷支付
  78. this.weChatFlag = range.indexOf('1') > -1
  79. this.B2BpayFlag = range.indexOf('4') > -1
  80. this.QuickPayFlag = range.indexOf('5') > -1
  81. // // 设置默认支付方式
  82. // if(this.QuickPayFlag){
  83. // this.tabCurrentIndex = 3
  84. // }else{
  85. // this.tabCurrentIndex = this.weChatFlag ? 0 : this.B2BpayFlag ? 1 : 2
  86. // }
  87. this.tabClick(0)
  88. }
  89. }
  90. }
  91. export default cardMixins