onlineInformationBtn.vue 1.2 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465
  1. <template>
  2. <span class="zxzx-btn" @click="btnClick" :class="topClass">在线咨询</span>
  3. </template>
  4. <script>
  5. export default {
  6. name: "onlineInformation",
  7. props: {
  8. myType: {
  9. type: String,
  10. default: '1'
  11. }
  12. },
  13. methods: {
  14. btnClick() {
  15. this.$router.push({name: 'courseware'});
  16. }
  17. },
  18. computed: {
  19. topClass() {
  20. const obj = {
  21. 1: 'level_1',
  22. 2: 'level_2',
  23. 3: 'level_3',
  24. 4: 'level_4',
  25. }
  26. return [obj[this.myType]];
  27. }
  28. }
  29. }
  30. </script>
  31. <style lang="scss">
  32. .zxzx-btn {
  33. &.level_1 {
  34. width: 154px;
  35. height: 48px;
  36. line-height: 48px;
  37. color: #00b96b;
  38. border-radius: 24px;
  39. background: #fff;
  40. border: 1px solid #00b96b;
  41. cursor: pointer;
  42. display: inline-block;
  43. text-align: center;
  44. }
  45. &.level_2 {
  46. width: 154px;
  47. height: 48px;
  48. line-height: 48px;
  49. color: #fff;
  50. border-radius: 24px;
  51. background: #00B96B;
  52. border: 1px solid #00b96b;
  53. cursor: pointer;
  54. text-align: center;
  55. }
  56. @media (max-width: 768px) {
  57. &.level_1 {width: 44%;height:35px;line-height:35px;max-width: 120px;margin: 0 3%;
  58. display: inline-block;padding: 0;text-align: center;font-size: 14px;}
  59. }
  60. }
  61. </style>