answerPromptPopup.vue 2.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132
  1. <template>
  2. <u-popup :show="showPopup" mode="center" round="30" @close="close">
  3. <view class="dialog-box">
  4. <template v-if="~~typeStatus === 1">
  5. <view class="dialog-title">恭喜你,回答正确</view>
  6. <view class="points-text">
  7. 获得<text class="red-num">20</text>积分,自动到账
  8. </view>
  9. </template>
  10. <template v-if="~~typeStatus === 2">
  11. <view class="dialog-title">很遗憾答错了</view>
  12. <view class="points-text">请继续努力哦</view>
  13. </template>
  14. <template v-if="~~typeStatus === 3">
  15. <view class="dialog-title">今天答题次数已用完</view>
  16. <view class="points-text">明天再来哦</view>
  17. </template>
  18. <view class="tips-text">每节课拥有3次答题机会</view>
  19. <view v-if="~~typeStatus === 1" class="btn primary-btn">前往积分商城兑换</view>
  20. <view class="btn outline-btn" @tap="close">继续观看</view>
  21. </view>
  22. </u-popup>
  23. </template>
  24. <script>
  25. export default {
  26. props: {
  27. isShow: {
  28. type: Boolean,
  29. default: false
  30. },
  31. typeStatus: {
  32. type: Number,
  33. default: 1, //提示类型:1、回答正确,2、回答错误,3、答题次数用完
  34. }
  35. },
  36. data() {
  37. return {
  38. showPopup: false,
  39. }
  40. },
  41. watch: {
  42. isShow(newVal) {
  43. this.showPopup = newVal
  44. }
  45. },
  46. methods: {
  47. // 关闭弹框
  48. close() {
  49. this.$emit('closeMethod')
  50. },
  51. }
  52. }
  53. </script>
  54. <style lang="scss" scoped>
  55. @mixin u-flex($flexD, $alignI, $justifyC) {
  56. display: flex;
  57. flex-direction: $flexD;
  58. align-items: $alignI;
  59. justify-content: $justifyC;
  60. }
  61. .dialog-box {
  62. width: calc(100vw - 160rpx);
  63. min-height: 440rpx;
  64. background: #ffffff;
  65. border-radius: 30rpx;
  66. padding: 40rpx 40rpx 60rpx;
  67. box-sizing: border-box;
  68. @include u-flex(column, center, center);
  69. }
  70. /* 标题文字 */
  71. .dialog-title {
  72. font-weight: 600;
  73. font-size: 40rpx;
  74. color: #000000;
  75. margin-bottom: 40rpx;
  76. }
  77. /* 积分文字行 */
  78. .points-text {
  79. font-weight: 600;
  80. font-size: 36rpx;
  81. color: rgba(0, 0, 0, 0.85);
  82. line-height: 50rpx;
  83. margin-bottom: 36rpx;
  84. }
  85. /* 红色积分数字 */
  86. .red-num {
  87. font-weight: 600;
  88. font-size: 56rpx;
  89. color: #FF233C;
  90. }
  91. /* 底部灰色小字 */
  92. .tips-text {
  93. font-weight: 400;
  94. font-size: 32rpx;
  95. color: rgba(0, 0, 0, 0.65);
  96. margin-bottom: 40rpx;
  97. }
  98. /* 按钮通用样式 */
  99. .btn {
  100. width: 390rpx;
  101. height: 84rpx;
  102. line-height: 78rpx;
  103. text-align: center;
  104. font-size: 32rpx;
  105. border-radius: 42rpx;
  106. margin-bottom: 32rpx;
  107. font-weight: 600;
  108. }
  109. /* 红色实心主按钮 */
  110. .primary-btn {
  111. background: linear-gradient(135deg, #FF5267 0%, #FF233C 100%);
  112. color: #ffffff;
  113. }
  114. /* 红色边框空心按钮 */
  115. .outline-btn {
  116. border: 2rpx solid #FF233C;
  117. color: #FF233CFF;
  118. background: transparent;
  119. margin-bottom: 0;
  120. }
  121. </style>