answerFloatBox.vue 2.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114
  1. <template>
  2. <view class="complaintViewClass">
  3. <image src="/static/image/hall/baoxiang_icon.png" mode="aspectFill"></image>
  4. <view class="complaintViewTextClass">
  5. <view v-if="~~typeNum === 1" class="pointsOkTextClass">
  6. 已得<text class="pointsNumTextClass">{{pointsNum}}</text>积分
  7. </view>
  8. <view v-if="~~typeNum === 2" class="pointsOkTowTextClass" @tap="handleShowTomorrowTip">
  9. <text>未答对\n明天再来</text>
  10. </view>
  11. <view v-if="~~typeNum === 3" class="pointsOkTowTextClass">
  12. <text>未答对\n继续答题</text>
  13. <view class="answerBtnClass" @tap="handleShowAnswerMethods">答题</view>
  14. </view>
  15. <view v-if="~~typeNum === 4" class="pointsOkTowTextClass">
  16. <text>
  17. <text>再观看2:20</text>\n答题得奖励
  18. </text>
  19. <view class="answerBtnClass" @tap="handleShowAnswerMethods">答题</view>
  20. </view>
  21. </view>
  22. </view>
  23. </template>
  24. <script>
  25. export default {
  26. props: {
  27. typeNum: {
  28. type: Number,
  29. default: 1, //悬浮框类型:1、已得积分,2、未答对明天再来,3、未答对继续答题,4、答题得奖励
  30. },
  31. pointsNum: {
  32. type: Number,
  33. default: 20, //已得积分数量
  34. }
  35. },
  36. methods: {
  37. handleShowAnswerMethods() {
  38. this.$emit('handleShowAnswer')
  39. },
  40. handleShowTomorrowTip() {
  41. this.$emit('showTomorrowTipMethods')
  42. }
  43. }
  44. }
  45. </script>
  46. <style scoped lang="scss">
  47. @mixin u-flex($flexD, $alignI, $justifyC) {
  48. display: flex;
  49. flex-direction: $flexD;
  50. align-items: $alignI;
  51. justify-content: $justifyC;
  52. }
  53. .complaintViewClass {
  54. @include u-flex(column, center, center);
  55. position: fixed;
  56. right: 34rpx;
  57. bottom: 400rpx;
  58. image {
  59. width: 210rpx;
  60. height: 90rpx;
  61. }
  62. .complaintViewTextClass {
  63. @include u-flex(column, center, center);
  64. margin-top: -15rpx;
  65. z-index: 10;
  66. width: 210rpx;
  67. min-height: 120rpx;
  68. background: linear-gradient(180deg, #FFF9DC 0%, #FFDC97 100%);
  69. border-radius: 20rpx;
  70. border: 2rpx solid linear-gradient(180deg, rgba(255, 228, 105, 1), rgba(255, 178, 30, 1));
  71. padding: 10rpx 10rpx 20rpx;
  72. box-sizing: border-box;
  73. text-align: center;
  74. overflow: hidden;
  75. }
  76. }
  77. .pointsOkTextClass {
  78. font-weight: 400;
  79. font-size: 28rpx;
  80. color: #FF2E3F;
  81. line-height: 40rpx;
  82. }
  83. .pointsNumTextClass {
  84. font-weight: 600;
  85. font-size: 56rpx;
  86. color: #FF2E3F;
  87. }
  88. .pointsOkTowTextClass {
  89. font-weight: 600;
  90. font-size: 32rpx;
  91. color: #FF2E3F;
  92. }
  93. .answerBtnClass {
  94. width: 150rpx;
  95. height: 60rpx;
  96. background: linear-gradient(135deg, #FF515F 0%, #F72234 100%);
  97. border-radius: 30rpx;
  98. margin-top: 10rpx;
  99. font-weight: 600;
  100. font-size: 32rpx;
  101. color: #FFF2C3;
  102. line-height: 55rpx;
  103. text-align: center;
  104. }
  105. </style>