answerFloatBox.vue 2.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111
  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">
  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. }
  41. }
  42. </script>
  43. <style scoped lang="scss">
  44. @mixin u-flex($flexD, $alignI, $justifyC) {
  45. display: flex;
  46. flex-direction: $flexD;
  47. align-items: $alignI;
  48. justify-content: $justifyC;
  49. }
  50. .complaintViewClass {
  51. @include u-flex(column, center, center);
  52. position: fixed;
  53. right: 34rpx;
  54. bottom: 400rpx;
  55. image {
  56. width: 210rpx;
  57. height: 90rpx;
  58. }
  59. .complaintViewTextClass {
  60. @include u-flex(column, center, center);
  61. margin-top: -15rpx;
  62. z-index: 10;
  63. width: 210rpx;
  64. min-height: 120rpx;
  65. background: linear-gradient(180deg, #FFF9DC 0%, #FFDC97 100%);
  66. border-radius: 20rpx;
  67. border: 2rpx solid linear-gradient(180deg, rgba(255, 228, 105, 1), rgba(255, 178, 30, 1));
  68. padding: 10rpx 10rpx 20rpx;
  69. box-sizing: border-box;
  70. text-align: center;
  71. overflow: hidden;
  72. }
  73. }
  74. .pointsOkTextClass {
  75. font-weight: 400;
  76. font-size: 28rpx;
  77. color: #FF2E3F;
  78. line-height: 40rpx;
  79. }
  80. .pointsNumTextClass {
  81. font-weight: 600;
  82. font-size: 56rpx;
  83. color: #FF2E3F;
  84. }
  85. .pointsOkTowTextClass {
  86. font-weight: 600;
  87. font-size: 32rpx;
  88. color: #FF2E3F;
  89. }
  90. .answerBtnClass {
  91. width: 150rpx;
  92. height: 60rpx;
  93. background: linear-gradient(135deg, #FF515F 0%, #F72234 100%);
  94. border-radius: 30rpx;
  95. margin-top: 10rpx;
  96. font-weight: 600;
  97. font-size: 32rpx;
  98. color: #FFF2C3;
  99. line-height: 55rpx;
  100. text-align: center;
  101. }
  102. </style>