cardMixins.js 2.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384
  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. buttonText: '微信支付',
  12. btnColor: '#0ABC64',
  13. cardsList:[],//查看银行列表
  14. defaultCards: null,
  15. }
  16. },
  17. filters:{
  18. bankNumeberFilter(value){
  19. return value.substring(value.length-4,value.length)
  20. }
  21. },
  22. computed: {
  23. showWeChatPayMode() {
  24. return this.weChatFlag
  25. },
  26. showB2BpayMode() {
  27. return this.B2BpayFlag
  28. }
  29. },
  30. methods: {
  31. handleChoiceaCards(data) {
  32. //选择的银行
  33. this.tabCurrentIndex = 3
  34. this.tabClick(3)
  35. this.defaultCards = data
  36. this.quickParams = { ...this.quickParams , ...data}
  37. },
  38. hanldeShowPopup(index) {
  39. switch (index) {
  40. case 0:
  41. this.popupShow = true
  42. break
  43. case 1:
  44. this.popupShow1 = true
  45. break
  46. default:
  47. break
  48. }
  49. },
  50. tabClick(index) { //tab切换
  51. this.tabCurrentIndex = index
  52. switch (index) {
  53. case 0:
  54. this.btnColor = '#0ABC64'
  55. this.buttonText = '微信支付'
  56. break
  57. case 1:
  58. this.btnColor = '#007ACC'
  59. this.buttonText = '企业网银支付'
  60. break
  61. case 2:
  62. this.btnColor = '#16AFE8'
  63. this.buttonText = '个人网银支付'
  64. break
  65. case 3:
  66. this.btnColor = 'linear-gradient(90deg, #FF9300 0%, #FF5B00 100%)'
  67. this.buttonText = '使用银行卡快捷支付'
  68. break
  69. }
  70. },
  71. checkPayMode(range) {
  72. // 校验支付模式
  73. // test range = '4'
  74. // 1微信 2支付宝 3个人网银 4企业网银
  75. this.weChatFlag = range.indexOf('1') > -1
  76. this.B2BpayFlag = range.indexOf('4') > -1
  77. // 设置默认支付方式
  78. this.tabCurrentIndex = this.weChatFlag ? 0 : this.B2BpayFlag ? 1 : 2
  79. this.tabClick(this.tabCurrentIndex)
  80. }
  81. }
  82. }
  83. export default cardMixins