cardMixins.js 2.5 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283
  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. console.log('选择的银行', data)
  34. this.quickParams = { ...this.quickParams , ...data }
  35. this.tabClick(3)
  36. },
  37. hanldeShowPopup(index) {
  38. switch (index) {
  39. case 0:
  40. this.popupShow = true
  41. break
  42. case 1:
  43. this.popupShow1 = true
  44. break
  45. default:
  46. break
  47. }
  48. },
  49. tabClick(index) { //tab切换
  50. this.tabCurrentIndex = index
  51. switch (index) {
  52. case 0:
  53. this.btnColor = '#0ABC64'
  54. this.buttonText = '微信支付'
  55. break
  56. case 1:
  57. this.btnColor = '#007ACC'
  58. this.buttonText = '企业网银支付'
  59. break
  60. case 2:
  61. this.btnColor = '#16AFE8'
  62. this.buttonText = '个人网银支付'
  63. break
  64. case 3:
  65. this.btnColor = 'linear-gradient(90deg, #FF9300 0%, #FF5B00 100%)'
  66. this.buttonText = '使用银行卡快捷支付'
  67. break
  68. }
  69. },
  70. checkPayMode(range) {
  71. // 校验支付模式
  72. // test range = '4'
  73. // 1微信 2支付宝 3个人网银 4企业网银
  74. this.weChatFlag = range.indexOf('1') > -1
  75. this.B2BpayFlag = range.indexOf('4') > -1
  76. // 设置默认支付方式
  77. this.tabCurrentIndex = this.weChatFlag ? 0 : this.B2BpayFlag ? 1 : 2
  78. this.tabClick(this.tabCurrentIndex)
  79. }
  80. }
  81. }
  82. export default cardMixins