|
@@ -1,55 +1,62 @@
|
|
|
<script setup lang="ts">
|
|
|
import HeaderCard from '@/components/dataAnalysis/HeaderCard.vue'
|
|
|
+
|
|
|
import { reactive, onMounted, ref } from 'vue'
|
|
|
import { initLoadResouce } from '@/utils/resource'
|
|
|
import { copyText } from '@/utils/common'
|
|
|
+import axiosInstance from '@/utils/axios/axiosInstance'
|
|
|
+import { useRequest } from '@/hooks/useRequest'
|
|
|
+import { useCommonStore } from '@/stores/useCommon'
|
|
|
+
|
|
|
+const { AllApi } = useRequest()
|
|
|
+const { selectInfo } = useCommonStore()
|
|
|
|
|
|
interface AppInfo {
|
|
|
- name: string
|
|
|
- pf: string
|
|
|
- appType: string
|
|
|
- createDate: string
|
|
|
- AppletsID: string
|
|
|
- AppID: string
|
|
|
+ gameName: string
|
|
|
+ gid: string
|
|
|
+ ttAppid: string // 抖音App ID
|
|
|
+ ttSecret: string // 抖音App Secret
|
|
|
+ wxAppid: string // 微信App ID
|
|
|
+ wxSecret: string // 微信App Secret
|
|
|
img: string
|
|
|
}
|
|
|
|
|
|
// 返回的APP信息
|
|
|
const appInfo = reactive<AppInfo>({
|
|
|
- img: '/img/default/defaultGameImg.svg',
|
|
|
- name: '消消乐',
|
|
|
- pf: '微信',
|
|
|
- appType: '游戏娱乐',
|
|
|
- createDate: '2024-1-1',
|
|
|
- AppletsID: 'ASJDFJAHSJDF',
|
|
|
- AppID: 'A12312312412JAHSJDF'
|
|
|
+ gameName: '',
|
|
|
+ gid: '',
|
|
|
+ ttAppid: '',
|
|
|
+ ttSecret: '',
|
|
|
+ wxAppid: '',
|
|
|
+ wxSecret: '',
|
|
|
+ img: '/img/default/defaultGame.svg'
|
|
|
})
|
|
|
|
|
|
-// 信息对应的字段
|
|
|
const fieldsInfo = {
|
|
|
- name: '应用名称',
|
|
|
- pf: '应用平台',
|
|
|
- appType: '游戏平台',
|
|
|
- createDate: '创建日期',
|
|
|
- AppletsID: '小程序ID',
|
|
|
- AppID: 'App ID'
|
|
|
+ gameName: '游戏名称',
|
|
|
+
|
|
|
+ ttAppid: '抖音App ID',
|
|
|
+ ttSecret: '抖音App Secret',
|
|
|
+ wxAppid: '微信App ID',
|
|
|
+ wxSecret: '微信App Secret',
|
|
|
+ gid: '游戏ID'
|
|
|
}
|
|
|
|
|
|
// 资源的加载路径
|
|
|
const resourceInfo: Record<string, string> = {
|
|
|
- defaultHead: `/img/default/defaultHead.png`
|
|
|
+ defaultHead: `/img/default/defaultGame.svg`
|
|
|
}
|
|
|
|
|
|
// 使用blob的资源路径信息
|
|
|
const blobUrlInfo = reactive<Record<string, string>>({})
|
|
|
|
|
|
-const AppID = ref<Array<HTMLSpanElement> | null>(null)
|
|
|
+const Gid = ref<Array<HTMLSpanElement> | null>(null)
|
|
|
|
|
|
-const copyAppID = () => {
|
|
|
- copyText(appInfo.AppID).then(() => {
|
|
|
- if (AppID.value) {
|
|
|
+const copyGid = () => {
|
|
|
+ copyText(appInfo.gid).then(() => {
|
|
|
+ if (Gid.value) {
|
|
|
const range = document.createRange()
|
|
|
- range.selectNodeContents(AppID.value[0])
|
|
|
+ range.selectNodeContents(Gid.value[0])
|
|
|
|
|
|
const selection = window.getSelection()
|
|
|
if (selection) {
|
|
@@ -60,23 +67,41 @@ const copyAppID = () => {
|
|
|
})
|
|
|
}
|
|
|
|
|
|
+const getGameInfo = () => {
|
|
|
+ axiosInstance
|
|
|
+ .post(AllApi.getGameTable, {
|
|
|
+ appSecret: '6YJSuc50uJ18zj45'
|
|
|
+ })
|
|
|
+ .then((data) => {
|
|
|
+ let info = data.data
|
|
|
+ let nowGame = info.find((item: any) => {
|
|
|
+ console.log(item.gid, selectInfo.gid)
|
|
|
+ return item.gid === selectInfo.gid
|
|
|
+ })
|
|
|
+ console.log(nowGame)
|
|
|
+ Object.assign(appInfo, nowGame)
|
|
|
+ })
|
|
|
+}
|
|
|
+
|
|
|
onMounted(() => {
|
|
|
// 去加载所有需要的资源
|
|
|
initLoadResouce(resourceInfo).then((data) => {
|
|
|
Object.assign(blobUrlInfo, data)
|
|
|
})
|
|
|
+
|
|
|
+ getGameInfo()
|
|
|
})
|
|
|
</script>
|
|
|
|
|
|
<template>
|
|
|
<div class="baseInfo">
|
|
|
- <HeaderCard :title="'基本信息'"></HeaderCard>
|
|
|
+ <HeaderCard :title="'基本信息'" :need-pf-select="false"></HeaderCard>
|
|
|
<div class="body">
|
|
|
<div class="info">
|
|
|
<div class="infoItem" v-for="[key, val] in Object.entries(fieldsInfo)">
|
|
|
<span class="itmeTitle">{{ val }}</span>
|
|
|
<span class="text" :ref="key">{{ appInfo[key as keyof AppInfo] }}</span>
|
|
|
- <span class="copy" v-if="key === 'AppID'" @click="copyAppID">复制</span>
|
|
|
+ <span class="copy" v-if="key === 'gid'" @click="copyGid">复制</span>
|
|
|
</div>
|
|
|
</div>
|
|
|
<div class="photo">
|
|
@@ -135,7 +160,7 @@ onMounted(() => {
|
|
|
|
|
|
.itmeTitle {
|
|
|
display: inline-block;
|
|
|
- width: 80px;
|
|
|
+ width: 110px;
|
|
|
text-align: left;
|
|
|
padding-right: 0;
|
|
|
font-size: 14px;
|
|
@@ -147,7 +172,7 @@ onMounted(() => {
|
|
|
font-weight: 600;
|
|
|
color: #1c2438;
|
|
|
font-size: 14px;
|
|
|
- margin-left: 106px;
|
|
|
+ margin-left: 30px;
|
|
|
line-height: 20px;
|
|
|
}
|
|
|
|