From 0cbf62ad20ce14743ce5c3b3790465f21121b876 Mon Sep 17 00:00:00 2001 From: inc904 Date: Mon, 3 Apr 2023 15:19:27 +0800 Subject: [PATCH] =?UTF-8?q?feat:=20=E7=94=A8=E6=88=B7=E4=BF=A1=E6=81=AF?= =?UTF-8?q?=E6=8E=A5=E5=8F=A3=E5=AF=B9=E6=8E=A5?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/api/basic.ts | 121 ++++++- src/router/modules/basicData.ts | 82 +++-- src/utils/http/index.ts | 2 +- .../basic/queryUser/components/empty.vue | 9 + src/views/basic/queryUser/indexHook.ts | 2 + src/views/basic/queryUser/infoHook.ts | 10 +- src/views/basic/queryUser/queryUser.vue | 128 ++++---- src/views/basic/queryUser/queryUserHook.ts | 20 +- src/views/basic/queryUser/user/BasicInfo.vue | 307 +++++++++++------- src/views/basic/queryUser/user/GameRecord.vue | 62 +++- src/views/basic/queryUser/user/index.vue | 3 +- src/views/basic/queryUser/user/index2.vue | 69 ++++ vite.config.ts | 2 +- 13 files changed, 581 insertions(+), 236 deletions(-) create mode 100644 src/views/basic/queryUser/components/empty.vue create mode 100644 src/views/basic/queryUser/user/index2.vue diff --git a/src/api/basic.ts b/src/api/basic.ts index 56e5af3..199b6e9 100644 --- a/src/api/basic.ts +++ b/src/api/basic.ts @@ -34,16 +34,18 @@ export type CurrentDayData = { data: Array } -interface OHistoricalData { - play_account: number +interface IHistoricalData { + user_name: string register_account: number active_account: number channel: string } export type HistoricalData = { - success: boolean - data: Array + count: number + data: { + list: Array + } } /** 当日用户数据 */ @@ -75,3 +77,114 @@ export const getUserData = (data?: object) => { data }) } + +// export type IGameInfo = { +// uid?: string +// play: string //总玩牌局数 +// totalhands: string //总手数 +// r_in: string //入池率 +// r_win: string //入池胜率 +// r_fc: string //翻牌前 +// r_ds: string //3bet率 +// r_jin: string //激进度 +// r_sd: string //摊牌率 +// r_100hands: string //百手盈利 +// totalwin: string //总盈利 +// } +export interface IGameInfo { + uid: number + cb: string + rDs: string + rD3b: string + rFbt: number + rFc: string + rRuwin: string + rSd: string + rSf: string + r100hands: number + rSdw: string + rRuTimes: number + '3b': string + play: number + rCh: string + rJin: string + totalwin: string + rRu: string + totalbuyin: number + utime: string + bmaxlose: number + hmaxwin: number + rWin: string + maxcard: string + bmaxwin: number + totalhands: number + rIn: string +} + +export interface GameInfo { + ploFive: IGameInfo + ploSix: IGameInfo + omaha: IGameInfo + texas: IGameInfo +} + +export type IUserInfo = { + data: { + base_info: {} + game_info: GameInfo + join_club_list?: any[] + create_club_list?: any[] + } +} +export interface BaseInfo { + lastName: string + uid: number + registerChannel: string + user_phone: string + street: string + postalCode: string + enterCount: number + gbgCheck: string + isHideFlag: number + city: string + firstName: string + houseNumber: string + enterTime: number + playTime: number + user_name: string + channel: string + scrapAmount: number + diamond: number + regTime: number + birthday: number + remarks: string + nationality: string + usersig: string + nickname: string + createGroupLimit: number + icon: string + regIp: string + identityCard: string + country: string + gender: number + userCategory: number + user_email: string +} + +type Result = { + code: number + data?: { + /** 列表数据 */ + base_info: BaseInfo + create_club_list: Array + join_club_list: Array + game_info: GameInfo + } +} +/** 搜索用户 基本信息 */ +export const getUserInfo = (data?: object) => { + console.log('_', data) + return http.request('post', baseUrlApi('/cms/user/info'), { + data + }) +} diff --git a/src/router/modules/basicData.ts b/src/router/modules/basicData.ts index 6d47262..86932bf 100644 --- a/src/router/modules/basicData.ts +++ b/src/router/modules/basicData.ts @@ -31,29 +31,69 @@ export default { { path: '/basic/queryUser', name: 'QueryUser', - component: () => import('@/views/basic/queryUser/queryUser.vue'), + redirect: '/basic/queryUser/index', + // component: () => import('@/views/basic/queryUser/components/empty.vue'), meta: { - title: $t('menus.searchUser') - } - }, - { - path: '/basic/queryUser/users/:id', - name: 'UserInfo', - component: () => import('@/views/basic/queryUser/user/index.vue'), - meta: { - title: '用户信息', - showLink: false - } - }, - { - path: '/basic/queryUser/users/:id/basicInfo', - name: 'UserBasicInfo', - component: () => import('@/views/basic/queryUser/user/basicInfo.vue'), - meta: { - title: '基础信息', - showLink: false - } + // title: $t('menus.searchUser'), + title: '搜索用户1' + }, + children: [ + { + path: '/basic/queryUser/index', + name: 'QueryUser', + component: () => import('@/views/basic/queryUser/queryUser.vue'), + meta: { + // title: $t('menus.searchUser') + title: '搜索用户2' + } + }, + { + path: '/basic/queryUser/users/', + name: 'UserInformation', + component: () => import('@/views/basic/queryUser/user/index.vue'), + meta: { + title: '用户信息q', + showLink: false + } + }, + { + path: '/basic/queryUser/users-params/:id', + name: 'UserInformation2', + component: () => import('@/views/basic/queryUser/user/index2.vue'), + meta: { + title: '用户信息p', + showLink: false + } + }, + { + path: '/basic/queryUser/users/:id/basicInfo', + name: 'UserBasicInfo', + component: () => import('@/views/basic/queryUser/user/basicInfo.vue'), + meta: { + title: '基础信息', + showLink: false + } + } + ] }, + // { + // path: '/basic/queryUser/users/:id', + // name: 'UserInfo', + // component: () => import('@/views/basic/queryUser/user/index.vue'), + // meta: { + // title: '用户信息', + // showLink: false + // } + // }, + // { + // path: '/basic/queryUser/users/:id/basicInfo', + // name: 'UserBasicInfo', + // component: () => import('@/views/basic/queryUser/user/basicInfo.vue'), + // meta: { + // title: '基础信息', + // showLink: false + // } + // }, { path: '/basic/gameData', name: 'GameData', diff --git a/src/utils/http/index.ts b/src/utils/http/index.ts index d711a0a..d02ede7 100644 --- a/src/utils/http/index.ts +++ b/src/utils/http/index.ts @@ -58,7 +58,7 @@ const defaultConfig: AxiosRequestConfig = { tz_name: 'Asia%2FShanghai', tz_delta: 'GMT%2B8' }, - request: { method: 'sysversion%23getsysversion' }, + request: { method: 'sysversion%23getsysversion', ...data }, public: { channel: 'POKIO_H5_NORMAL', version: 1311, diff --git a/src/views/basic/queryUser/components/empty.vue b/src/views/basic/queryUser/components/empty.vue new file mode 100644 index 0000000..c3faa50 --- /dev/null +++ b/src/views/basic/queryUser/components/empty.vue @@ -0,0 +1,9 @@ + + + + + diff --git a/src/views/basic/queryUser/indexHook.ts b/src/views/basic/queryUser/indexHook.ts index ef22b04..64e665b 100644 --- a/src/views/basic/queryUser/indexHook.ts +++ b/src/views/basic/queryUser/indexHook.ts @@ -72,6 +72,8 @@ export function useUser() { function onSearchHistory() { console.log('onSearchHistory1', form.dateRange) console.log('onSearchHistory2', form.dateRange[0]) + loading.value = false + getHistoricalData({ start_date: form.dateRange[0], end_date: form.dateRange[1] diff --git a/src/views/basic/queryUser/infoHook.ts b/src/views/basic/queryUser/infoHook.ts index ade2820..2b3f20d 100644 --- a/src/views/basic/queryUser/infoHook.ts +++ b/src/views/basic/queryUser/infoHook.ts @@ -15,7 +15,7 @@ export function useDetail() { // 保存信息到标签页 useMultiTagsStoreHook().handleTags('push', { path: `/basic/queryUser/users/`, - name: 'UserInfo', + name: 'UserInformation', query: { id: String(index) }, meta: { title: { @@ -27,11 +27,11 @@ export function useDetail() { } }) // 路由跳转 - router.push({ name: 'TabQueryDetail', query: { id: String(index) } }) + router.push({ name: 'UserInformation', query: { id: String(index) } }) } else { useMultiTagsStoreHook().handleTags('push', { - path: `/basic/queryUser/users/:id`, - name: 'UserInfo', + path: `/basic/queryUser/users-params/:id`, + name: 'UserInformation2', params: { id: String(index) }, meta: { title: { @@ -40,7 +40,7 @@ export function useDetail() { } } }) - router.push({ name: 'UserInfo', params: { id: String(index) } }) + router.push({ name: 'UserInformation2', params: { id: String(index) } }) } } diff --git a/src/views/basic/queryUser/queryUser.vue b/src/views/basic/queryUser/queryUser.vue index 987d8cf..26e62f3 100644 --- a/src/views/basic/queryUser/queryUser.vue +++ b/src/views/basic/queryUser/queryUser.vue @@ -12,6 +12,7 @@ defineOptions({ }) const { toDetail, router } = useDetail() +console.log('router:', router) const formRef = ref() const { form, historicalData, historicalColumns, loading, onSearchUser } = @@ -25,67 +26,63 @@ const { form, historicalData, historicalColumns, loading, onSearchUser } = 搜索用户 -
- - - - - - - - - - - - - - - - 搜索 - - - -
+ + + + + + + + + + + + + + + + + 搜索 + + + + - -
+ + +
+

query传参模式:

+ + 打开{{ index }}详情页 +
diff --git a/src/views/basic/queryUser/queryUserHook.ts b/src/views/basic/queryUser/queryUserHook.ts index 0296a41..513e932 100644 --- a/src/views/basic/queryUser/queryUserHook.ts +++ b/src/views/basic/queryUser/queryUserHook.ts @@ -10,7 +10,7 @@ export function useUser() { }, { label: '所属俱乐部', - prop: 'club_name' + prop: 'first_joined_club' }, { label: '注册渠道', @@ -18,7 +18,7 @@ export function useUser() { }, { label: '绑定手机/邮箱', - prop: 'mobile' + prop: 'user_email/user_phone' }, { label: '注册IP及归属地', @@ -26,11 +26,11 @@ export function useUser() { }, { label: '最后登录', - prop: 'last_login_date' + prop: 'enter_time' }, { label: '最后登录IP及归属地', - prop: 'last_area' + prop: 'login_ip' } ] @@ -47,10 +47,14 @@ export function useUser() { function onSearchUser() { console.log(form.dateRange) console.log(form.dateRange[0]) - getUserData({ date: form }).then(res => { - historicalData.value = res.data - loading.value = false - }) + getUserData({ date: form }) + .then(res => { + historicalData.value = res.data.list + loading.value = false + }) + .catch(() => { + loading.value = false + }) } // const resetHistoryForm = formEl => { diff --git a/src/views/basic/queryUser/user/BasicInfo.vue b/src/views/basic/queryUser/user/BasicInfo.vue index dc1c976..630d870 100644 --- a/src/views/basic/queryUser/user/BasicInfo.vue +++ b/src/views/basic/queryUser/user/BasicInfo.vue @@ -1,135 +1,116 @@ - + diff --git a/src/views/basic/queryUser/user/GameRecord.vue b/src/views/basic/queryUser/user/GameRecord.vue index e3f063a..b848674 100644 --- a/src/views/basic/queryUser/user/GameRecord.vue +++ b/src/views/basic/queryUser/user/GameRecord.vue @@ -41,11 +41,7 @@ - - - - - + @@ -101,26 +97,56 @@ const handleClick = (tab: TabsPaneContext, event: Event) => { console.log(tab, event) } +const tableRecordColumn: TableColumnList = [ + { + label: '时间', + prop: 'date' + }, + { + label: '级别/玩法', + prop: 'club_name' + }, + { + label: '牌局名称', + prop: 'club_integral' + }, + { + label: '创建者', + prop: 'club_integral' + }, + { + label: '牌局ID', + prop: 'club_integral' + }, + { + label: '战绩', + prop: 'club_integral' + }, + { + label: '服务费贡献', + prop: 'club_integral' + }, + { + label: '保险贡献', + prop: 'club_integral' + } +] + const tableData = [ { + club_name: 'Tom-club', date: '2016-05-03', - name: 'Tom', - address: 'No. 189, Grove St, Los Angeles' + club_integral: '299' }, { - date: '2016-05-02', - name: 'Tom', - address: 'No. 189, Grove St, Los Angeles' + club_name: 'Tom-club', + date: '2016-05-03', + club_integral: '299' }, { - date: '2016-05-04', - name: 'Tom', - address: 'No. 189, Grove St, Los Angeles' - }, - { - date: '2016-05-01', - name: 'Tom', - address: 'No. 189, Grove St, Los Angeles' + club_name: 'Tom-club', + date: '2016-05-03', + club_integral: '299' } ] diff --git a/src/views/basic/queryUser/user/index.vue b/src/views/basic/queryUser/user/index.vue index 3c12ad1..ccdae2a 100644 --- a/src/views/basic/queryUser/user/index.vue +++ b/src/views/basic/queryUser/user/index.vue @@ -31,7 +31,8 @@ defineOptions({ const { initToDetail, id } = useDetail() -initToDetail('params') +// initToDetail('params') +initToDetail('query') const activeName = ref('basicInfo') diff --git a/src/views/basic/queryUser/user/index2.vue b/src/views/basic/queryUser/user/index2.vue new file mode 100644 index 0000000..6959b35 --- /dev/null +++ b/src/views/basic/queryUser/user/index2.vue @@ -0,0 +1,69 @@ + + + + + diff --git a/vite.config.ts b/vite.config.ts index b4b32db..3dc2924 100644 --- a/vite.config.ts +++ b/vite.config.ts @@ -46,7 +46,7 @@ export default ({ command, mode }: ConfigEnv): UserConfigExport => { proxy: { '^/dev-api/.*': { // 这里填写后端地址 - target: 'http://192.168.100.87:8000', + target: 'http://192.168.100.71:8000', changeOrigin: true, rewrite: path => path.replace(/^\/dev-api/, '') }