index.vue 2.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113
  1. <template>
  2. <div class="question" :class="{qmobile:isMobile}">
  3. <div
  4. class="qcon"
  5. :style="{
  6. backgroundImage: `url(${require('@/assets/images/question/bg.jpg')})`,
  7. }"
  8. >
  9. <div v-if="!dati" class="qbody">
  10. <div class="start_page">
  11. <img
  12. class="qicon"
  13. :src="require('@/assets/images/question/icon.png')"
  14. alt=""
  15. />
  16. <div class="qbtn" @click="dati = true">
  17. <span>开始答题</span>
  18. <img
  19. :src="require('@/assets/images/question/jiantou.png')"
  20. alt=""
  21. />
  22. </div>
  23. </div>
  24. </div>
  25. <div v-else class="qbody">
  26. <datiing @lingjiang="datiing = false" v-if="datiing" />
  27. <prize v-else />
  28. </div>
  29. <img
  30. class="qclose"
  31. :src="require('@/assets/images/question/close.png')"
  32. alt=""
  33. @click="$emit('close')"
  34. />
  35. </div>
  36. </div>
  37. </template>
  38. <script>
  39. import datiing from "./datiing";
  40. import prize from "./prize";
  41. import browser from '@/util/browser'
  42. export default {
  43. components: {
  44. datiing,
  45. prize,
  46. },
  47. data() {
  48. return {
  49. dati: false,
  50. datiing: true,
  51. isMobile: browser.mobile,
  52. };
  53. },
  54. created(){}
  55. };
  56. </script>
  57. <style lang="less" scoped>
  58. .question {
  59. position: fixed;
  60. width: 100%;
  61. height: 100%;
  62. left: 0;
  63. color: #fff;
  64. .qcon {
  65. width: 930px;
  66. height: 550px;
  67. background-size: 100% auto;
  68. top: 50%;
  69. left: 50%;
  70. transform: translate(-50%, -50%);
  71. position: fixed;
  72. .qbody {
  73. position: absolute;
  74. top: 50%;
  75. left: 50%;
  76. transform: translate(-50%, -50%);
  77. width: 100%;
  78. height: 100%;
  79. text-align: center;
  80. .start_page {
  81. width: 100%;
  82. top: 48%;
  83. position: absolute;
  84. left: 50%;
  85. transform: translate(-50%, -50%);
  86. .qicon {
  87. margin-bottom: 50px;
  88. }
  89. }
  90. }
  91. .qclose {
  92. position: absolute;
  93. right: 10px;
  94. top: 10px;
  95. cursor: pointer;
  96. }
  97. }
  98. }
  99. .qmobile {
  100. position: relative;
  101. height:calc(100% - 35px);
  102. .qcon {
  103. width: 96%;
  104. height: 98%;
  105. position: absolute;
  106. }
  107. }
  108. </style>