FreeExpBanner.vue 1.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081
  1. <template>
  2. <div class="free-exp-banner" :class="isGiving ? 'before-give-text' : ''">
  3. <div class="flex-r-c left">
  4. <span class="content-text">{{ contentText }}</span>
  5. <div class="exp-button" @click="toUnlock">{{ rightButtonText }}</div>
  6. </div>
  7. </div>
  8. </template>
  9. <script>
  10. export default {
  11. name: 'free-exp-banner',
  12. props: {
  13. isGiving: {
  14. type: Boolean,
  15. default: true
  16. },
  17. contentText: [String],
  18. rightButtonText: {
  19. type: String,
  20. default: '去解锁 >>'
  21. }
  22. },
  23. methods: {
  24. toUnlock () {
  25. this.$emit('rightButtonClick')
  26. }
  27. }
  28. }
  29. </script>
  30. <style lang="scss" scoped>
  31. .before-give-text {
  32. position: relative;
  33. &::before {
  34. content: "赠送";
  35. position: absolute;
  36. top: 0;
  37. left: 0;
  38. display: inline-block;
  39. width: 48px;
  40. height: 22px;
  41. font-size: 14px;
  42. padding-left: 8px;
  43. font-family: Microsoft YaHei-Regular, Microsoft YaHei;
  44. font-weight: 400;
  45. color: #FFFFFF;
  46. line-height: 22px;
  47. border-bottom-right-radius: 20px;
  48. background: linear-gradient(104deg, #D69C06 0%, #B16C05 100%);
  49. }
  50. }
  51. .free-exp-banner {
  52. margin: 0 !important;
  53. width: 100%;
  54. padding: 10px 136px;
  55. font-size: 18px;
  56. font-family: Microsoft YaHei-Regular, Microsoft YaHei;
  57. font-weight: 400;
  58. color: #663600;
  59. line-height: 28px;
  60. background-color: #F1D08F;
  61. background: url("~@/assets/images/free-exp-banner-bg.png") no-repeat;
  62. background-size: 100% 100%;
  63. .content-text {
  64. flex: 1;
  65. }
  66. .exp-button {
  67. cursor: pointer;
  68. text-align: center;
  69. width: 110px;
  70. height: 30px;
  71. line-height: 30px;
  72. font-size: 16px;
  73. font-family: Microsoft YaHei-Regular, Microsoft YaHei;
  74. font-weight: 400;
  75. color: #FFFFFF;
  76. background: linear-gradient(104deg, #D69C06 0%, #B16C05 100%);
  77. border-radius: 20px 20px 20px 20px
  78. }
  79. }
  80. </style>