FestiveEvents.vue 11 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362
  1. <template>
  2. <div class="right-wrap">
  3. <div class="tab-header">
  4. <span class="tab-title">活动列表</span>
  5. </div>
  6. <div class="list-content">
  7. <div class="list-container">
  8. <el-empty v-if="goodsList.length==0" :image-size="200"></el-empty>
  9. <div v-else class="prize-list">
  10. <div v-for="(item, index) in goodsList" :key="index" class="prize-card prize-item">
  11. <div class="img-container">
  12. <img :src="item.imgUrl" alt="图片" class="prize-img">
  13. </div>
  14. <div class="content">
  15. <h3 :title="item.title" class="title">{{ item.title }}</h3>
  16. <p class="desc" v-if="item.startTime">
  17. <span :title="item.startTime+'~'+item.endTime">{{ item.startTime }} ~ {{ item.endTime }}</span>
  18. </p>
  19. <p class="desc" v-else></p>
  20. </div>
  21. <div class="btn-container">
  22. <button v-if="item.status==1" class="ui-btn default medium btn">活动未开始</button>
  23. <button v-else-if="item.status==3" class="ui-btn default medium btn">活动已结束</button>
  24. <button v-else @click="handleClickReceive(item)"
  25. class="ui-btn primary medium btn">
  26. 立即参与
  27. </button>
  28. </div>
  29. </div>
  30. </div>
  31. </div>
  32. </div>
  33. <el-dialog :visible.sync="dialogMsgVisible" width="400px">
  34. <div class="wrapper">
  35. <svg width="291" height="93" viewBox="0 0 291 93" fill="none" xmlns="http://www.w3.org/2000/svg" src="./success.svg" class="success-icon"><g filter="url(#filter0_f_6844:108643)"><circle cx="143" cy="56.5723" r="3" fill="#51F1E8"></circle></g><path d="M195.768 48.1699L195.768 39.5097L203.268 43.8398L195.768 48.1699Z" fill="#FF5E54"></path><path d="M232.39 10.953L230.149 2.58781L238.514 4.82925L232.39 10.953Z" fill="#9F54FF"></path><path d="M7.519 27.6623L1.39528 21.5385L9.76044 19.2971L7.519 27.6623Z" fill="#FF834E"></path><path d="M106.774 8.99609L96.2168 11.168C94.5498 27.4571 102.885 34.5158 107.886 36.6877C113.999 37.7736 120.031 35.8701 124 32.8869C111.22 33.4298 104.552 19.3126 106.774 8.99609Z" fill="#51F1E8"></path><path d="M283.89 68.9961L290.383 70.4176C292.692 77.5253 288.076 83.9223 283.89 84.9096C280.384 85.3438 277.597 84.0817 275 82.5007C284.452 83.364 285.768 73.9715 283.89 68.9961Z" fill="#FF5E54"></path><g filter="url(#filter1_f_6844:108643)"><path d="M50 82.4171L55.3529 77.9961C57.902 79.4698 63 83.3014 63 86.8382C59.8213 88.1508 58.6931 89.8153 58.427 90.9879C58.4503 91.3588 58.4426 91.6987 58.4118 91.9961C58.3461 91.7429 58.3346 91.395 58.427 90.9879C58.2575 88.2958 56.4523 83.9714 50 82.4171Z" fill="#FFCF8B"></path></g><defs data-v-50d84ad4=""><filter id="filter0_f_6844:108643" x="139" y="52.5723" width="8" height="8" filterUnits="userSpaceOnUse" color-interpolation-filters="sRGB"><feFlood flood-opacity="0" result="BackgroundImageFix"></feFlood><feBlend mode="normal" in="SourceGraphic" in2="BackgroundImageFix" result="shape"></feBlend><feGaussianBlur stdDeviation="0.5" result="effect1_foregroundBlur_6844:108643"></feGaussianBlur></filter><filter id="filter1_f_6844:108643" x="49" y="76.9961" width="15" height="16" filterUnits="userSpaceOnUse" color-interpolation-filters="sRGB"><feFlood flood-opacity="0" result="BackgroundImageFix"></feFlood><feBlend mode="normal" in="SourceGraphic" in2="BackgroundImageFix" result="shape"></feBlend><feGaussianBlur stdDeviation="0.5" result="effect1_foregroundBlur_6844:108643"></feGaussianBlur></filter></defs></svg>
  36. <h2 class="header">恭喜你,领取成功!</h2>
  37. <img :src="imgUrl" class="icon">
  38. <div class="desc">
  39. <span data-v-50d84ad4="">恭喜你成功领取{{ title }},随后你可在</span>
  40. <a href="/home/festiveEvents" class="link">个人中心</a>中查看领取的福利
  41. </div>
  42. </div>
  43. <div slot="footer" class="dialog-footer" style="text-align: center;">
  44. <router-link to="/home/festiveEvents">
  45. <el-button class="addButton-address" type="primary">
  46. 查看福利
  47. </el-button>
  48. </router-link>
  49. </div>
  50. </el-dialog>
  51. </div>
  52. </template>
  53. <script>
  54. import { actList } from "@/api/allApi";
  55. export default {
  56. data() {
  57. return {
  58. imgUrl: '',
  59. title:'',
  60. dialogMsgVisible:false,
  61. goodsList: []
  62. };
  63. },
  64. created() {
  65. this.getList();
  66. },
  67. methods: {
  68. getList() {
  69. actList().then(response => {
  70. this.goodsList = response.data.data;
  71. }).catch(() => {
  72. })
  73. },
  74. handleClickReceive(val){
  75. console.log(val);
  76. //节日游戏
  77. if(val.type=='1'){
  78. //中秋节签到
  79. if(val.actId==33){
  80. this.$router.push({
  81. path: '/home/festiveEvents/zhongQiuQianDao',
  82. query: {
  83. actId:val.actId
  84. }
  85. });
  86. return;
  87. }
  88. //元宵节答题
  89. else if(val.actId==13){
  90. this.$router.push({
  91. path: '/home/festiveEvents/lanternFestival',
  92. query: {
  93. actId:val.actId
  94. }
  95. });
  96. return;
  97. }
  98. //七夕节答题
  99. else if(val.actId==20){
  100. this.$router.push({
  101. path: '/home/festiveEvents/qiXiGame',
  102. query: {
  103. actId:val.actId
  104. }
  105. });
  106. return;
  107. }
  108. //每周竞技
  109. else{
  110. this.$router.push({
  111. path: '/home/festiveEvents/game',
  112. query: {
  113. url: val.activityUrl,
  114. actId:val.actId
  115. }
  116. });
  117. return;
  118. }
  119. }
  120. //答题
  121. if(val.type=='2'){
  122. //每日答题
  123. this.$router.push({
  124. path: '/home/festiveEvents/answerGame',
  125. query: {
  126. actId:val.actId
  127. }
  128. });
  129. return;
  130. }
  131. //抽奖
  132. if(val.type=='3'){
  133. //春节抽签
  134. if(val.actId==12){
  135. this.$router.push({
  136. path: '/home/festiveEvents/game',
  137. query: {
  138. url: val.activityUrl,
  139. actId:val.actId
  140. }
  141. });
  142. return;
  143. }
  144. //每月抽奖
  145. else{
  146. this.$router.push({
  147. path: '/home/festiveEvents/drawCarouselGame',
  148. query: {
  149. actId:val.actId
  150. }
  151. });
  152. return;
  153. }
  154. }
  155. //开奖
  156. if(val.type=='5'){
  157. //中秋节开奖
  158. if(val.actId==35){
  159. this.$router.push({
  160. path: '/home/festiveEvents/kaijiang',
  161. query: {
  162. actId:val.actId
  163. }
  164. });
  165. return;
  166. }
  167. }
  168. }
  169. }
  170. };
  171. </script>
  172. <style scoped>
  173. .right-wrap {
  174. background-color: #fff;
  175. }
  176. .tab-header {
  177. display: flex;
  178. align-items: center;
  179. justify-content: space-between;
  180. padding: 20px 20px 16px;
  181. border-bottom: 1px solid #e5e6eb;
  182. overflow: hidden;
  183. }
  184. .tab-header .tab-title {
  185. white-space: nowrap;
  186. font-size: 18px;
  187. font-weight: 500;
  188. color: #1d2129;
  189. }
  190. .list-content{
  191. padding: 0px 20px 40px;
  192. }
  193. .list-container .prize-item:nth-child(4n) {
  194. margin-right: 0;
  195. }
  196. .list-container {
  197. border-radius: 2px;
  198. background-color: transparent;
  199. }
  200. .list-container .prize-list {
  201. padding: 20px 0;
  202. background: #fff;
  203. display: flex;
  204. flex-flow: row wrap;
  205. box-sizing: border-box;
  206. }
  207. .list-container .prize-item {
  208. width: calc(25% - 15px);
  209. margin-right: 20px;
  210. margin-bottom: 20px;
  211. border-radius: 2px;
  212. }
  213. .prize-card {
  214. background: #fff;
  215. border: 1px solid #e4e6eb;
  216. box-sizing: border-box;
  217. border-radius: 2px;
  218. }
  219. .prize-card .img-container {
  220. height: 159px;
  221. background: #f7f8fa;
  222. border-radius: 2px 2px 0 0;
  223. display: flex;
  224. align-items: center;
  225. justify-content: center;
  226. }
  227. .prize-card .img-container .prize-img {
  228. width: 100%;
  229. height: 100%;
  230. /* max-height: 120px;
  231. max-width: 120px; */
  232. }
  233. .prize-card .content {
  234. padding: 0 16px;
  235. }
  236. .prize-card .content .desc,
  237. .prize-card .content .title {
  238. white-space: nowrap;
  239. overflow: hidden;
  240. text-overflow: ellipsis;
  241. }
  242. .prize-card .content .title {
  243. font-weight: 400;
  244. font-size: 16px;
  245. line-height: 24px;
  246. margin-top: 12px;
  247. color: #1d2129;
  248. margin-bottom: 0;
  249. }
  250. .prize-card .content .desc {
  251. margin: 10px 0;
  252. display: inline-block;
  253. font-size: 12px;
  254. line-height: 18px;
  255. height: 18px;
  256. width: 100%;
  257. }
  258. .prize-card .content .desc span {
  259. color: #ff7d00;
  260. background: #fff7e8;
  261. padding: 2px 4px;
  262. }
  263. .prize-card .content .redeem-info {
  264. margin-top: 0;
  265. margin-bottom: 0;
  266. display: flex;
  267. justify-content: space-between;
  268. white-space: nowrap;
  269. align-items: center;
  270. }
  271. .prize-card .content .price {
  272. font-weight: 500;
  273. font-size: 14px;
  274. line-height: 24px;
  275. color: #1e80ff;
  276. flex: auto;
  277. display: flex;
  278. align-items: center;
  279. justify-content: center;
  280. justify-content: flex-start;
  281. }
  282. .prize-card .content .price .icon {
  283. height: 16px;
  284. width: 16px;
  285. position: relative;
  286. margin-right: 4px;
  287. }
  288. .prize-card .content .count {
  289. font-size: 12px;
  290. line-height: 20px;
  291. margin-left: 12px;
  292. color: #8a919f;
  293. }
  294. .prize-card .btn {
  295. border-radius: 16px;
  296. }
  297. .ui-btn.medium {
  298. padding: 5px 16px;
  299. }
  300. .ui-btn.primary {
  301. background-color: #1d7dfa;
  302. }
  303. .ui-btn.default {
  304. color:#8a919f;
  305. /* background-color: #1d7dfa; */
  306. }
  307. .ui-btn {
  308. box-sizing: border-box;
  309. font-size: 14px;
  310. line-height: 22px;
  311. padding: 5px 16px;
  312. color: #fff;
  313. border: none;
  314. white-space: nowrap;
  315. cursor: pointer;
  316. }
  317. .prize-card .btn-container {
  318. border-top: 1px solid #e4e6eb;
  319. padding: 12px 16px;
  320. display: flex;
  321. align-items: center;
  322. justify-content: center;
  323. }
  324. </style>
  325. <style>
  326. .text-overflow {
  327. max-width: 400px;
  328. overflow: hidden;
  329. text-overflow: ellipsis;
  330. display: -webkit-box;
  331. -webkit-box-orient: vertical;
  332. -webkit-line-clamp: 1;
  333. }
  334. </style>