|
@@ -3,7 +3,7 @@
|
|
|
|
|
|
|
|
<div v-if="token">
|
|
<div v-if="token">
|
|
|
<loading v-if="isLoading" :style="{ height: viewWidth + 'px' }" />
|
|
<loading v-if="isLoading" :style="{ height: viewWidth + 'px' }" />
|
|
|
- <div v-else class="w1000" style="margin: 20px auto;">
|
|
|
|
|
|
|
+ <div v-else >
|
|
|
<!-- <h2>我的游戏</h2> -->
|
|
<!-- <h2>我的游戏</h2> -->
|
|
|
<!-- <IndexList :list="mineGame" :prefix="prefix"></IndexList>
|
|
<!-- <IndexList :list="mineGame" :prefix="prefix"></IndexList>
|
|
|
<div class="more df aic jcc" v-if="(total > 10 ? true : false)">
|
|
<div class="more df aic jcc" v-if="(total > 10 ? true : false)">
|
|
@@ -12,7 +12,7 @@
|
|
|
<div v-if="mineGame.length > 0">
|
|
<div v-if="mineGame.length > 0">
|
|
|
<IndexList :list="mineGame" :prefix="prefix">
|
|
<IndexList :list="mineGame" :prefix="prefix">
|
|
|
<template #custom-button="scope">
|
|
<template #custom-button="scope">
|
|
|
- <el-button @click="showGifts(scope.row)">查看礼包</el-button>
|
|
|
|
|
|
|
+ <el-button style="color: #fff;" color="#ed8c0f" @click="showGifts(scope.row)">查看礼包</el-button>
|
|
|
</template>
|
|
</template>
|
|
|
</IndexList>
|
|
</IndexList>
|
|
|
<div class="more df aic jcc" v-if="params.page * params.pagesize <= mineGame.length">
|
|
<div class="more df aic jcc" v-if="params.page * params.pagesize <= mineGame.length">
|
|
@@ -32,29 +32,23 @@
|
|
|
</el-empty>
|
|
</el-empty>
|
|
|
</div>
|
|
</div>
|
|
|
<el-dialog v-model="dialogVisible" title="游戏礼包">
|
|
<el-dialog v-model="dialogVisible" title="游戏礼包">
|
|
|
- <el-collapse v-model="activeName" accordion>
|
|
|
|
|
- <div style="display: flex;justify-content: space-between; align-items: center;">
|
|
|
|
|
- <el-collapse-item title="新手礼包" name="1" style="width: 70%;">
|
|
|
|
|
- <div>
|
|
|
|
|
- 礼包内容:守护符[武器]*1,守护符[防具]*1,强化石*1幸运符(5%)*5
|
|
|
|
|
- </div>
|
|
|
|
|
- <div>使用方法: 活动-礼包码兑换-邮件领取</div>
|
|
|
|
|
- <div>有效期:2023-08-02-2025-12-31</div>
|
|
|
|
|
|
|
+ <el-collapse v-if="giftData.length" v-model="activeName" accordion>
|
|
|
|
|
+ <div v-for="(item, index) in giftData" :key="index" style="display: flex;justify-content: space-between; align-items: center;">
|
|
|
|
|
+ <el-collapse-item :title="item.gift_name" :name="item.id" style="width: 70%;">
|
|
|
|
|
+ <el-form label-width="120px">
|
|
|
|
|
+ <el-form-item label="礼包内容:">{{ item.gift_content }}</el-form-item>
|
|
|
|
|
+ <el-form-item label="使用方法:">{{ item.usage }}</el-form-item>
|
|
|
|
|
+ <el-form-item label="有效期:">{{ item.start_at+'-'+item.end_at }}</el-form-item>
|
|
|
|
|
+ </el-form>
|
|
|
</el-collapse-item>
|
|
</el-collapse-item>
|
|
|
<div style="width: 20%;">
|
|
<div style="width: 20%;">
|
|
|
- <el-button @click="dialogVisible = false">领取礼包</el-button>
|
|
|
|
|
|
|
+ <el-button :disabled="item.user_get_at !== ''" color="#ed8c0f" style="color: #fff;" @click="receiveGift(item.id)">领取礼包</el-button>
|
|
|
</div>
|
|
</div>
|
|
|
</div>
|
|
</div>
|
|
|
|
|
|
|
|
</el-collapse>
|
|
</el-collapse>
|
|
|
- <!-- <template #footer>
|
|
|
|
|
- <span class="dialog-footer">
|
|
|
|
|
- <el-button @click="dialogVisible = false">Cancel</el-button>
|
|
|
|
|
- <el-button type="primary" @click="dialogVisible = false">
|
|
|
|
|
- Confirm
|
|
|
|
|
- </el-button>
|
|
|
|
|
- </span>
|
|
|
|
|
- </template> -->
|
|
|
|
|
|
|
+ <el-empty v-else description="暂无礼包" />
|
|
|
|
|
+
|
|
|
</el-dialog>
|
|
</el-dialog>
|
|
|
</div>
|
|
</div>
|
|
|
|
|
|
|
@@ -62,7 +56,7 @@
|
|
|
|
|
|
|
|
<script setup lang="ts">
|
|
<script setup lang="ts">
|
|
|
import { onMounted, ref, reactive, watch } from 'vue'
|
|
import { onMounted, ref, reactive, watch } from 'vue'
|
|
|
-import { getMineGame } from '@/api/index'
|
|
|
|
|
|
|
+import { getMineGame, getGiftHttp, receiveGiftHttp } from '@/api/index'
|
|
|
import { useStore } from '@/store/index'
|
|
import { useStore } from '@/store/index'
|
|
|
import { useRouter, useRoute, onBeforeRouteUpdate } from 'vue-router'
|
|
import { useRouter, useRoute, onBeforeRouteUpdate } from 'vue-router'
|
|
|
import Message from '@/utils/Message'
|
|
import Message from '@/utils/Message'
|
|
@@ -132,9 +126,27 @@ const goLogin = () => {
|
|
|
router.push({ path: 'p_login' })
|
|
router.push({ path: 'p_login' })
|
|
|
local.remove('headerPath')
|
|
local.remove('headerPath')
|
|
|
}
|
|
}
|
|
|
-const showGifts = (row:any) => {
|
|
|
|
|
- console.log(row);
|
|
|
|
|
- dialogVisible.value = true
|
|
|
|
|
|
|
+const giftData = ref<any[]>([])
|
|
|
|
|
+const showGifts = async(row:any) => {
|
|
|
|
|
+// console.log(row);
|
|
|
|
|
+ await getGiftHttp({game_id: row.game_id}).then((res) => {
|
|
|
|
|
+ // console.log(res.data.data)
|
|
|
|
|
+ giftData.value = res.data.data || []
|
|
|
|
|
+ dialogVisible.value = true
|
|
|
|
|
+ }).catch((error) => {
|
|
|
|
|
+ console.log(error)
|
|
|
|
|
+ })
|
|
|
|
|
+
|
|
|
|
|
+}
|
|
|
|
|
+const receiveGift = async(id:number) => {
|
|
|
|
|
+ await receiveGiftHttp({id}).then((res) => {
|
|
|
|
|
+ console.log(res)
|
|
|
|
|
+ Message.error(res.data.msg)
|
|
|
|
|
+ dialogVisible.value = false
|
|
|
|
|
+ }).catch((error) => {
|
|
|
|
|
+ console.log(error)
|
|
|
|
|
+ Message.error(error.data.msg)
|
|
|
|
|
+ })
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
</script>
|
|
</script>
|