onlineInformationBtn.vue 987 B

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657
  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. width: 154px;
  34. height: 48px;
  35. line-height: 48px;
  36. border-radius: 24px;
  37. border: 1px solid #00b96b;
  38. cursor: pointer;
  39. display: inline-block;
  40. text-align: center;
  41. &.level_1 {
  42. color: #00b96b;
  43. background: #fff;
  44. }
  45. &.level_2 {
  46. color: #fff;
  47. background: #00B96B;
  48. }
  49. @media (max-width: 768px) {
  50. width: 44%;height:35px;line-height:35px;max-width: 120px;margin: 0 3%;font-size: 14px;
  51. }
  52. }
  53. </style>