Kaijiang.vue 9.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387
  1. <template>
  2. <div class="timeline-container">
  3. <div class="timeline-content">
  4. <div class="timeline-entry-list">
  5. <div class="gameBox">
  6. <div class="home">
  7. <div :class="{ 'dim': isDim }">
  8. <div v-if="!isDim">
  9. <img class="rules" src="@/assets/image/answerGame/kaijiang/rules.png" alt="互动规则" @click="clickRuleWrapper">
  10. <div class="top" v-if="top">
  11. <span style="font-size: 18px;color: #fff;font-weight: 600;">当前拥有抽奖券:{{ top }}张</span>
  12. </div>
  13. <img class="answer" src="@/assets/image/answerGame/kaijiang/answer.png" alt="兑换抽奖券" @click="clickAnswer">
  14. <img class="exit" src="@/assets/image/answerGame/kaijiang/exit.png" alt="退出活动" @click="getOut">
  15. </div>
  16. </div>
  17. </div>
  18. <div class="ruleWrapper" v-if="isRuleWrapper">
  19. <el-card class="box-card">
  20. <div slot="header" class="clearfix">
  21. <span>活动规则</span>
  22. <span style="float: right; font-size: 20px;cursor: pointer;" @click="closeRuleWrapper">
  23. <i class="el-icon-close"></i>
  24. </span>
  25. </div>
  26. <div v-html="rule"></div>
  27. </el-card>
  28. </div>
  29. <div class="confirmWrapper" v-if="isConfirmWrapper">
  30. <img class="homeBtn" src="@/assets/image/answerGame/kaijiang/homeBtn.png" alt="返回主界面" @click="refresh">
  31. <img class="iPay" src="@/assets/image/answerGame/kaijiang/iPay.png" alt="前往充值" @click="clickIpay">
  32. <img class="confirm" src="@/assets/image/answerGame/kaijiang/confirm.png" alt="确认兑换" @click="clickConfirm">
  33. </div>
  34. <div class="closeWrapper" v-if="isCloseWrapper">
  35. <img class="goHome" src="@/assets/image/answerGame/kaijiang/goHome.png" alt="关闭" @click="refresh">
  36. </div>
  37. </div>
  38. </div>
  39. <SiderInfo></SiderInfo>
  40. </div>
  41. </div>
  42. </template>
  43. <script>
  44. import { homeData,MidAutumnSignIn } from "@/api/allApi";
  45. import SiderInfo from '@/components/SiderInfo.vue';
  46. export default{
  47. components: {
  48. SiderInfo
  49. },
  50. data() {
  51. return {
  52. actId:this.$route.query.actId,
  53. rule:'',
  54. top:'1',
  55. isConfirmWrapper:false,
  56. isCloseWrapper:false,
  57. isRuleWrapper: false,
  58. isDim:false,
  59. };
  60. },
  61. created(){
  62. this.getHomeData();
  63. },
  64. methods:{
  65. refresh() {
  66. location.reload();
  67. },
  68. getOut(){
  69. this.$router.push({
  70. path: '/home/festiveEvents',
  71. });
  72. },
  73. getHomeData(){
  74. homeData({actId:this.actId}).then(response=>{
  75. console.log(response.data.data);
  76. this.rule = response.data.data.rule;
  77. this.top = response.data.data.top;
  78. })
  79. },
  80. clickAnswer(){
  81. this.isDim = true;
  82. this.isConfirmWrapper = true;
  83. },
  84. clickConfirm(){
  85. MidAutumnSignIn({actId:this.actId}).then(response=>{
  86. this.isConfirmWrapper = false;
  87. this.isDim = true;
  88. this.isCloseWrapper = true;
  89. })
  90. },
  91. clickIpay(){
  92. this.$router.push({
  93. path: '/ipay',
  94. });
  95. },
  96. clickRuleWrapper(){
  97. this.isDim = true;
  98. this.isRuleWrapper = true;
  99. },
  100. closeRuleWrapper(){
  101. this.isDim = false;
  102. this.isRuleWrapper = false;
  103. }
  104. },
  105. }
  106. </script>
  107. <style scoped>
  108. .timeline-container{
  109. margin: 0 auto;
  110. }
  111. .timeline-entry-list{
  112. margin-right: 17.5rem;
  113. border-radius: 2px;
  114. width: 720px;
  115. position: relative;
  116. }
  117. .timeline-entry-list .gameBox{
  118. border-radius: 4px 4px 0 0;
  119. position: relative;
  120. padding: 2.667rem 0;
  121. z-index: 1;
  122. overflow: hidden;
  123. background-color: #fff;
  124. padding-left: 2.67rem;
  125. padding-right: 2.67rem;
  126. margin-bottom: 2rem;
  127. box-sizing: border-box;
  128. min-height: 280px;
  129. display: flex;
  130. justify-content: center;
  131. align-content: center;
  132. }
  133. .gameBox .item{
  134. position: relative;
  135. z-index: 10;
  136. background: url(@/assets/image/answerGame/item/itemBg.png) no-repeat;
  137. background-size: 100% 100%;
  138. width: 375px;
  139. height: 667px;
  140. }
  141. .item .integralBox{
  142. position: absolute;
  143. top: 7.3%;
  144. right: 8%;
  145. width: 90px;
  146. height: 35.2px;
  147. /* background: greenyellow; */
  148. display: flex;
  149. justify-content: center;
  150. line-height: 35.2px;
  151. }
  152. .integralBox .integral{
  153. font-size: 16px;
  154. color: orange;
  155. font-weight: 600;
  156. }
  157. .item .timer{
  158. position: absolute;
  159. background: url(@/assets/image/answerGame/item/timer.png) no-repeat;
  160. background-size: 100% 100%;
  161. width: 80px;
  162. height: 80px;
  163. top: 15%;
  164. right: 10%;
  165. display: flex;
  166. justify-content: center;
  167. align-items: center;
  168. }
  169. .timer .second{
  170. font-size: 16px;
  171. color: #fff;
  172. font-weight: 600;
  173. }
  174. .item .topicNum{
  175. position: absolute;
  176. background: url(@/assets/image/answerGame/item/topicNum.png) no-repeat;
  177. background-size: 100% 100%;
  178. width: 120px;
  179. height: 42px;
  180. top: 25%;
  181. left: 4.8%;
  182. display: flex;
  183. justify-content: center;
  184. align-items: center;
  185. }
  186. .topicNum .topic{
  187. font-size: 16px;
  188. color: #fff;
  189. font-weight: 600;
  190. }
  191. .item .questionBox{
  192. position: absolute;
  193. width: 375px;
  194. top: 28%;
  195. left: 0;
  196. right: 0;
  197. display: flex;
  198. flex-direction: column;
  199. justify-content: center;
  200. align-items: center;
  201. }
  202. .questionBox .title{
  203. margin:auto 50px;
  204. height: 180px;
  205. font-size: 18px;
  206. display: flex;
  207. flex-direction: column;
  208. justify-content: center;
  209. align-items: center;
  210. /* font-weight: 600; */
  211. }
  212. .content{
  213. width: 100%;
  214. display: flex;
  215. flex-direction: column;
  216. justify-content: center;
  217. align-items: center;
  218. }
  219. .answerItem{
  220. cursor: pointer;
  221. margin: 10px 0;
  222. color: #3883fa;
  223. background: rgb(221, 218, 218);
  224. border-radius: 20px;
  225. width: 80%;
  226. height: 40px;
  227. line-height: 40px;
  228. display: flex;
  229. justify-content: center;
  230. align-items: center;
  231. position: relative;
  232. }
  233. .right {
  234. /*选择正确的答案颜色*/
  235. background: #3ede58;
  236. color: #fff;
  237. }
  238. .error {
  239. /*选择错误的答案颜色*/
  240. background: #e53117;
  241. color: #fff;
  242. }
  243. .invisible{
  244. width: 25px;
  245. position: absolute;
  246. right: 15px;
  247. }
  248. .gameBox .home{
  249. position: relative;
  250. z-index: 10;
  251. background: url(@/assets/image/answerGame/kaijiang/homeBg.png) no-repeat;
  252. background-size: 100% 100%;
  253. width: 375px;
  254. height: 667px;
  255. }
  256. .home .rules{
  257. cursor: pointer;
  258. position: absolute;
  259. width: 35px;
  260. top: 35%;
  261. left: 5%;
  262. }
  263. .home .top{
  264. position: absolute;
  265. bottom: 20%;
  266. left: 0;
  267. right: 0;
  268. margin:auto;
  269. display: flex;
  270. justify-content: center;
  271. align-items: center;
  272. }
  273. .home .answer{
  274. cursor: pointer;
  275. position: absolute;
  276. width: 280px;
  277. bottom: 10%;
  278. left: 0;
  279. right: 0;
  280. margin:auto;
  281. }
  282. .home .exit{
  283. cursor: pointer;
  284. position: absolute;
  285. width: 280px;
  286. bottom: 2%;
  287. left: 0;
  288. right: 0;
  289. margin:auto;
  290. }
  291. .hidden {
  292. display: none;
  293. }
  294. .show {
  295. display: block;
  296. }
  297. .dim {
  298. /* opacity:0.6; */
  299. height:100%;
  300. width:100%;
  301. background: rgba(0,0,0,.4);
  302. pointer-events: none;
  303. }
  304. .clearfix:before,
  305. .clearfix:after {
  306. display: table;
  307. content: "";
  308. }
  309. .clearfix:after {
  310. clear: both
  311. }
  312. .ruleWrapper{
  313. position: absolute;
  314. top: 50%;
  315. left: 50%;
  316. transform: translate(-50%, -50%);
  317. z-index: 12;
  318. }
  319. .box-card {
  320. width: 350px;
  321. }
  322. .confirmWrapper{
  323. cursor: pointer;
  324. position: absolute;
  325. background: url(@/assets/image/answerGame/kaijiang/isConfirm.png) no-repeat;
  326. background-size: 100% 100%;
  327. width: 291px;
  328. height: 179px;
  329. top: 50%;
  330. left: 50%;
  331. transform: translate(-50%, -50%);
  332. z-index: 12;
  333. display: flex;
  334. justify-content:space-evenly;
  335. align-items: flex-end;
  336. }
  337. .confirmWrapper .homeBtn{
  338. position: absolute;
  339. right: 20px;
  340. top: 20px;
  341. width: 53px;
  342. }
  343. .confirmWrapper .iPay{
  344. cursor: pointer;
  345. width: 92px;
  346. margin-bottom: 10px;
  347. }
  348. .confirmWrapper .confirm{
  349. cursor: pointer;
  350. width: 92px;
  351. margin-bottom: 10px;
  352. }
  353. .closeWrapper{
  354. position: absolute;
  355. background: url(@/assets/image/answerGame/kaijiang/finish.png) no-repeat;
  356. background-size: 100% 100%;
  357. width: 258px;
  358. height: 258px;
  359. top: 50%;
  360. left: 50%;
  361. transform: translate(-50%, -50%);
  362. z-index: 12;
  363. display: flex;
  364. justify-content: center;
  365. align-items: flex-end;
  366. }
  367. .closeWrapper .goHome{
  368. cursor: pointer;
  369. width: 112px;
  370. height: 55px;
  371. }
  372. </style>
  373. <style>
  374. .el-card__header {
  375. padding: 10px 20px !important;
  376. }
  377. </style>