index.vue 2.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134
  1. <template>
  2. <view class="tabbar-container">
  3. <view class="tabbar-item left" @click="handleClick()">
  4. <view class="item-left">
  5. <i class="custom-icon custom-icon-before"></i>
  6. </view>
  7. <view class="item-right">
  8. <text>上一题</text>
  9. </view>
  10. </view>
  11. <view class="tabbar-item center" @click="handleClick()">
  12. <view class="center_content">
  13. 题卡
  14. </view>
  15. </view>
  16. <view class="tabbar-item right" @click="handleClick()">
  17. <view class="item-left">
  18. <text>下一题</text>
  19. </view>
  20. <view class="item-right">
  21. <i class="custom-icon custom-icon-next"></i>
  22. </view>
  23. </view>
  24. </view>
  25. </template>
  26. <script>
  27. export default {
  28. name: "QuestionTabbar",
  29. props: {
  30. },
  31. data() {
  32. return {
  33. };
  34. },
  35. mounted() {
  36. },
  37. methods: {
  38. handleClick(item) {
  39. }
  40. }
  41. };
  42. </script>
  43. <style lang="scss" scoped>
  44. .tabbar-container {
  45. position: fixed;
  46. bottom: 0;
  47. left: 0;
  48. z-index: 1;
  49. width: 100%;
  50. height: 120rpx;
  51. display: flex;
  52. align-items: center;
  53. justify-content: space-around;
  54. padding: 5rpx 0;
  55. box-shadow: 0 -20rpx 40rpx 4rpx rgba(0, 0, 0, 0.1);
  56. background-color: rgba(0, 0, 0, 0.1);
  57. .tabbar-item {
  58. width: 33%;
  59. height: 120rpx;
  60. display: flex;
  61. justify-content: center;
  62. align-items: center;
  63. // background-color: pink;
  64. .item-right {
  65. margin-left: 30rpx;
  66. font-size: 28rpx;
  67. }
  68. .custom-icon-before {
  69. margin-right: 10rpx;
  70. &::before {
  71. background: -webkit-linear-gradient(right, #f84a1a, #ffa53e);
  72. -webkit-background-clip: text;
  73. -webkit-text-fill-color: transparent;
  74. font-weight: bold;
  75. }
  76. }
  77. .custom-icon-next {
  78. margin-right: 10rpx;
  79. &::before {
  80. background: -webkit-linear-gradient(left, #f84a1a, #ffa53e);
  81. -webkit-background-clip: text;
  82. -webkit-text-fill-color: transparent;
  83. font-weight: bold;
  84. }
  85. }
  86. }
  87. .left {
  88. flex: 1;
  89. background-color: #fff;
  90. // display: flex;
  91. border-top-right-radius: 20rpx;
  92. }
  93. .center {
  94. width: 159rpx;
  95. background: radial-gradient(circle at 50% 0rpx, transparent 80rpx, white 0) top left 100% no-repeat;
  96. position: relative;
  97. .center_content {
  98. text-align: center;
  99. line-height: 130rpx;
  100. position: absolute;
  101. background: linear-gradient(45deg, #f84a1a, #ffa53e);
  102. border-radius: 50%;
  103. top: -60rpx;
  104. left: 50%;
  105. transform: translateX(-50%);
  106. width: 130rpx;
  107. height: 130rpx;
  108. color: #fff;
  109. font-size: 20px;
  110. }
  111. &+.right {
  112. border-top-left-radius: 20rpx;
  113. }
  114. }
  115. .right {
  116. flex: 1;
  117. background-color: #fff;
  118. display: flex;
  119. }
  120. }
  121. </style>