123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146 |
- <template>
- <div class="bg101010">
- <van-skeleton :row="4" :loading="isLoading" avatar-shape="square" />
- <div v-for="item in list" :key="item.id" class="box-card">
- <div class="fcs">
- <img class="wh40 m15" :src="iconURL(item.gameFileKey)" alt="">
- <span class="txt1">{{item.gameName.length > 10 ? item.gameName.slice(0, 10) + '...' : item.gameName}}</span>
- </div>
- <span class="txt2">你有{{item.gameGiftBagList.length}}个礼包待领取</span>
- <div class="fncb mt6">
- <div class="ml15 fnc">
- <div v-for="(ele, index) in item.gameGiftBagList" :key="ele.id"><div v-if="index < 4" class="ibox"><img class="ibox" src="~/assets/image/activity/welfare-community/box.png" alt="" /></div></div>
- <div v-if="item.gameGiftBagList.length > 4" class="ibox"><img class="ibox" src="~/assets/image/activity/welfare-community/icon_more@2x.png" alt="" /></div>
- </div>
- <div class="view-btn mr10" @click="view(item.id, item.gameName)">立即查看</div>
- </div>
- </div>
- </div>
- </template>
- <script>
- import { fileKeyToUrl } from '@/plugins/file-center.js';
- export default {
- auth: false,
- data() {
- return {
- list: [],
- isLoading: false
- }
- },
- async fetch() {
- if (this.$userAgent.isSzx && this.$userAgent.isAndroid) {
- this.token = await window.native.getToken();
- } else {
- this.token = this.$route.query.token;
- }
- this.getAppGameGiftActivityList()
- },
- head: {
- title: '福利社区',
- },
- computed: {
- iconURL() {
- return (key) => {
- return fileKeyToUrl(key)
- }
- }
- },
- methods: {
- view(id, gameName) {
- this.$router.push({ path: '/welfare-community/list', query: { token: this.$route.query.token, id, user: this.$route.query.user, gameName } })
- },
- async getAppGameGiftActivityList() {
- try {
- this.isLoading = true;
- const res = await this.$axios.$post('/activity/game/giftActivity/getAppGameGiftActivityList', {}, { headers: { Authorization: this.token } });
- this.list = res.data;
- } finally {
- this.isLoading = false;
- }
- }
- }
- }
- </script>
- <style scoped>
- .fcs {
- display: flex;
- align-items: center;
- justify-content: flex-start;
- }
- .mr10 {
- margin-right: 10px;
- }
- .view-btn {
- width: 78px;
- height: 28px;
- background: #3B7FFF;
- border-radius: 4px;
- font-size: 14px;
- font-weight: 400;
- color: #FFFFFF;
- line-height: 28px;
- text-align: center;
- }
- .mt6 {
- margin-top: 6px;
- }
- .fncb {
- display: flex;
- align-items: center;
- justify-content: space-between;
- }
- .bg101010 {
- background: #101010;
- min-height: 100vh;
- padding-top: 15px;
- }
- .box-card {
- width: 345px;
- height: 136px;
- margin: 0 auto 15px;
- background: url('~/assets/image/activity/welfare-community/bj@2x.png');
- background-size: 100% 100%;
- border-radius: 15px;
- overflow: hidden;
- }
- .wh40 {
- width: 40px;
- height: 40px;
- }
- .m15 {
- margin: 15px;
- }
- .fnc {
- display: flex;
- align-items: center;
- justify-content: center;
- }
- .txt1 {
- font-size: 20px;
- font-weight: 500;
- color: #FFFFFF;
- line-height: 28px;
- }
- .txt2 {
- font-size: 14px;
- color: #CFD1D4;
- line-height: 20px;
- margin-left: 15px;
- }
- .ibox {
- width: 26px;
- height: 26px;
- background: rgba(216, 216, 216, 0.1);
- border-radius: 3px;
- margin-right: 6px;
- }
- .ibox img {
- width: 100%;
- height: 100%;
- }
- .ml15 {
- margin-left: 15px;
- }
- </style>
|