Эх сурвалжийг харах

fix(广告用户列表、用户趋势、游戏列表): 修改游戏列表获取方式,更新部分表格字段

1.广告用户-去掉用户收益字段、修改参数
2.用户趋势-去掉周、月字段
23.游戏列表获取方式修改
fxs 5 сар өмнө
parent
commit
0240044a51

+ 2 - 2
src/hooks/useRequest.ts

@@ -21,8 +21,8 @@ export function useRequest() {
   const baseURL = BASE_URL
 
   const AllApi = {
-    getGidList: `/user/gidList`, // 获取游戏列表-专用于顶部导航栏的游戏选择框
-    getGameTable: `/user/getGidConfig`, // 获取游戏列表
+    getGidList: `/user/gidList`, // 获取游戏列表-通用需要游戏列表的地方
+    getGameTable: `/user/getGidConfig`, // 获取游戏列表,仅用于游戏管理页面,此接口需要鉴权
     getUserTable: `/user/userList`, // 获取用户列表
     addGame: `/user/addGidConfig`, // 添加/修改 游戏配置
     userLogin: `/user/login`, // 登录

+ 3 - 2
src/utils/table/table.ts

@@ -35,13 +35,14 @@ export const getAllGameInfo = async () => {
     // 如果已经有了,那么直接用缓存
     if (tableStore.allGameInfo.length) return tableStore.allGameInfo
 
-    const response = (await axiosInstance.post(AllApi.getGameTable, {
-      appSecret: '6YJSuc50uJ18zj45'
+    const response = (await axiosInstance.post(AllApi.getGidList, {
+      active: false
     })) as ResponseInfo
     if (!response || response.code !== 0) {
       console.log('获取游戏列表失败')
       return []
     }
+
     const result = JSON.parse(JSON.stringify(response))
     const data = result.data
     const returnData: Array<any> = formatGameInfo(data, result.code)

+ 6 - 5
src/views/AppManage/BaseInfoView.vue

@@ -9,7 +9,7 @@ import axiosInstance from '@/utils/axios/axiosInstance'
 import HeaderCard from '@/components/dataAnalysis/HeaderCard.vue'
 
 const { AllApi } = useRequest()
-const { selectInfo } = useCommonStore()
+const { selectInfo, allGameInfo } = useCommonStore()
 
 interface AppInfo {
   gameName: string
@@ -47,8 +47,8 @@ const resourceInfo: Record<string, string> = {
   defaultHead: `/img/default/defaultGame.svg`
 }
 
-// 返回的所有数据
-const allGameInfo = reactive<Array<any>>([])
+// // 返回的所有数据
+// const allGameInfo = reactive<Array<any>>([])
 
 // 使用blob的资源路径信息
 const blobUrlInfo = reactive<Record<string, string>>({})
@@ -93,6 +93,9 @@ watch(
   () => selectInfo.gid,
   () => {
     getGameInfo()
+  },
+  {
+    immediate: true
   }
 )
 
@@ -101,8 +104,6 @@ onMounted(() => {
   initLoadResource(resourceInfo).then((data) => {
     Object.assign(blobUrlInfo, data)
   })
-
-  getGameInfo()
 })
 </script>
 

+ 36 - 38
src/views/Home/Analysis/AdvertisingUsers.vue

@@ -21,7 +21,7 @@ import { reactive, ref } from 'vue'
 import { useRequest } from '@/hooks/useRequest'
 import { useAnalysis } from '@/hooks/useAnalysis'
 import { useCommonStore } from '@/stores/useCommon'
-import { formatTimestamp } from '@/utils/common'
+import { formatTimestamp, resetTimeToMidnight } from '@/utils/common'
 import { usePage } from '@/hooks/usePage'
 
 import Table from '@/components/table/CustomTable.vue'
@@ -97,21 +97,21 @@ const filterInfo: Array<QueryInfo> = [
       valueValid: (val: any) => !isNaN(val)
     }
   },
-  {
-    name: 'revenue',
-    label: '用户收益',
-    type: FilterType.CUSTOM,
-    placeholder: '请输入筛选收益',
-    default: 0,
-    otherOption: {
-      customFilterValueType: CustomFilterValueType.INPUT,
-      valueFormat: (val: any) => {
-        if (val === '') return val
-        return parseFloat(val)
-      },
-      valueValid: (val: any) => !isNaN(val)
-    }
-  },
+  // {
+  //   name: 'revenue',
+  //   label: '用户收益',
+  //   type: FilterType.CUSTOM,
+  //   placeholder: '请输入筛选收益',
+  //   default: 0,
+  //   otherOption: {
+  //     customFilterValueType: CustomFilterValueType.INPUT,
+  //     valueFormat: (val: any) => {
+  //       if (val === '') return val
+  //       return parseFloat(val)
+  //     },
+  //     valueValid: (val: any) => !isNaN(val)
+  //   }
+  // },
   {
     name: 'duration',
     label: '总时长',
@@ -184,62 +184,60 @@ const tableFieldsInfo = reactive<Array<TableFieldInfo>>([
     needSort: false
   },
   {
-    name: 'pid',
-    cnName: '广告父级ID',
+    name: 'pf',
+    cnName: '渠道',
     isShow: true,
     needSort: false
   },
   {
-    name: 'aid',
-    cnName: '广告ID',
+    name: 'gid',
+    cnName: '游戏ID',
     isShow: true,
     needSort: false
   },
   {
-    name: 'cid',
-    cnName: '用户点击ID',
+    name: 'openId',
+    cnName: 'OpenID',
     isShow: true,
     needSort: false
   },
   {
-    name: 'createTime',
+    name: 'createdAt',
     cnName: '创建时间',
     isShow: true,
     needSort: false,
     specialEffect: {
       type: FieldSpecialEffectType.CUSTOM,
       otherInfo: {
-        render: formatTimestamp
+        render: (val: any) => {
+          console.log(val)
+          console.log(new Date(val))
+          return formatTimestamp(new Date(val).getTime() / 1000)
+        }
       }
     }
   },
   {
-    name: 'startNum',
-    cnName: '启动次数',
-    isShow: true,
-    needSort: false
-  },
-  {
-    name: 'revenue',
-    cnName: '用户收益',
+    name: 'duration',
+    cnName: '在线总时长',
     isShow: true,
     needSort: false
   },
   {
-    name: 'duration',
-    cnName: '总时长',
+    name: 'startNum',
+    cnName: '启动次数',
     isShow: true,
     needSort: false
   },
   {
-    name: 'req_count',
-    cnName: '看广告次数',
+    name: 'adCount',
+    cnName: '看广告次数',
     isShow: true,
     needSort: false
   },
   {
-    name: 'exp_count',
-    cnName: '看完广告次数',
+    name: 'adExpCount',
+    cnName: '看完广告次数',
     isShow: true,
     needSort: false
   }

+ 0 - 44
src/views/Home/Analysis/UserTrendView.vue

@@ -86,16 +86,6 @@ const dataTrendInfo = reactive<TemporalTrendInfo>({
       type: 1
     },
     {
-      name: 'dailyActiveUser',
-      tabTitle: '日活跃用户',
-      type: 2
-    },
-    {
-      name: 'weeklyActiveUser',
-      tabTitle: '周活跃用户',
-      type: 3
-    },
-    {
       name: 'detailDatalyActiveUser',
       tabTitle: '月活跃用户',
       type: 4
@@ -136,20 +126,6 @@ const dataTrendInfo = reactive<TemporalTrendInfo>({
         value: ''
       }
     ],
-    weeklyActiveUser: [
-      {
-        name: 'avg',
-        cnName: '均值',
-        value: ''
-      }
-    ],
-    detailDatalyActiveUser: [
-      {
-        name: 'avg',
-        cnName: '均值',
-        value: ''
-      }
-    ],
     launchCount: [
       {
         name: 'avg',
@@ -178,14 +154,6 @@ const dataTrendInfo = reactive<TemporalTrendInfo>({
       index: '日期',
       imeDistribution: '日活跃用户'
     },
-    weeklyActiveUser: {
-      index: '日期',
-      imeDistribution: '周活跃用户'
-    },
-    detailDatalyActiveUser: {
-      index: '日期',
-      imeDistribution: '月活跃用户'
-    },
     launchCount: {
       index: '日期',
       imeDistribution: '启动次数'
@@ -238,18 +206,6 @@ const detailDataTableInfo = reactive<{
       needSort: false
     },
     {
-      name: 'activeUserWeek',
-      cnName: '周活跃用户',
-      isShow: true,
-      needSort: false
-    },
-    {
-      name: 'activeUserMouth',
-      cnName: '月活跃用户',
-      isShow: true,
-      needSort: false
-    },
-    {
       name: 'activeStart',
       cnName: '启动次数',
       isShow: true,

+ 1 - 1
src/views/IndexView.vue

@@ -265,7 +265,7 @@ const setNavbarGameSelect = (optionsList: Array<GameSelectItemInfo>) => {
 }
 
 /**
- * TODO 这里好像没有必要
+ *
  *
  * 获取导航栏游戏选择框的数据
  */