promo页面

This commit is contained in:
2026-06-10 15:49:37 +08:00
parent 91d698f682
commit 45d67f3778
4 changed files with 164 additions and 9 deletions

View File

@@ -12,10 +12,11 @@ export function getWallet(id: string | number) {
}) })
} }
export function postWallet(id: string | number, score: string | number) { export function postWallet(id: string | number, score: string | number, memo: string = '管理员手动调整') {
const formData = new FormData() const formData = new FormData()
formData.append('id', String(id)) formData.append('id', String(id))
formData.append('score', String(score)) formData.append('score', String(score))
formData.append('memo', String(memo))
return createAxios({ return createAxios({
url: url + 'wallet', url: url + 'wallet',
method: 'post', method: 'post',

View File

@@ -24,10 +24,9 @@ export default {
}, },
'Game Ticket' : '游戏门票', 'Game Ticket' : '游戏门票',
'game_type': { 'game_type': {
1001 : 'Lucky Wheel', 268 : 'plinko ball',
1002 : 'Golden Eggs', 269 : 'smash eggs',
1003 : 'Daily Mission', 270 : 'spin wheel'
1004 : 'Plinko Ball'
}, },
'bank_id': '银行账户', 'bank_id': '银行账户',
annualReport: { annualReport: {

View File

@@ -7,9 +7,8 @@ export default {
'Please enter change remarks / description': '请输入变更备注/说明', 'Please enter change remarks / description': '请输入变更备注/说明',
'Game type' : '游戏', 'Game type' : '游戏',
'game_type': { 'game_type': {
1001 : 'Lucky Wheel', 268 : 'plinko ball',
1002 : 'Golden Eggs', 269 : 'smash eggs',
1003 : 'Daily Mission', 270 : 'spin wheel'
1004 : 'Plinko Ball'
} }
} }

View File

@@ -0,0 +1,156 @@
<!--suppress TypeScriptValidateTypes -->
<template>
<div class="default-main ba-table-box">
<el-alert class="ba-table-alert" v-if="baTable.table.remark" :title="baTable.table.remark" type="info" show-icon />
<!-- 表格顶部菜单 -->
<TableHeader
:buttons="['refresh', 'add', 'edit', 'delete', 'comSearch', 'quickSearch', 'columnDisplay']"
:quick-search-placeholder="t('Quick search placeholder', { fields: t('user.user.User name') + '/' + t('user.user.nickname') })"
/>
<!-- 表格 -->
<!-- 要使用`el-table`组件原有的属性直接加在Table标签上即可 -->
<Table />
<!-- 表单 -->
<PopupForm />
<MembersPopupForm v-model="customFormVisible" :row="customFormRow" :wallet-data="customFormData" />
</div>
</template>
<script setup lang="ts">
import { provide, ref } from 'vue'
import { getWallet } from '/@/api/backend/user/wallet'
import baTableClass from '/@/utils/baTable'
import PopupForm from './popupForm.vue'
import MembersPopupForm from './membersPopupForm.vue'
import Table from '/@/components/table/index.vue'
import TableHeader from '/@/components/table/header/index.vue'
import { defaultOptButtons } from '/@/components/table'
import { baTableApi } from '/@/api/common'
import { useI18n } from 'vue-i18n'
defineOptions({
name: 'user/user',
})
const { t } = useI18n()
const customFormVisible = ref(false)
const customFormRow = ref<TableRow | null>(null)
const customFormData = ref<anyObj | null>(null)
const walletLoadingId = ref<number | string | null>(null)
let walletRequestSeq = 0
const optButtons: OptButton[] = [
{
render: 'tipButton',
name: 'customAction',
title: 'Members Promotion',
text: '',
type: 'primary',
icon: 'el-icon-Wallet',
class: 'table-row-custom',
disabledTip: false,
loading: (row: TableRow) => walletLoadingId.value === row.id,
click: async (row: TableRow) => {
const requestSeq = ++walletRequestSeq
walletLoadingId.value = row.id
try {
const res = await getWallet(row.id)
if (requestSeq !== walletRequestSeq) return
customFormRow.value = { ...row }
customFormData.value = res.data?.row ?? res.data ?? {}
customFormVisible.value = true
} finally {
if (requestSeq === walletRequestSeq) {
walletLoadingId.value = null
}
}
},
},
...defaultOptButtons(['edit', 'delete']),
]
const baTable = new baTableClass(
new baTableApi('/admin/user.User/'),
{
column: [
{ type: 'selection', align: 'center', operator: false },
{ label: t('Id'), prop: 'id', align: 'center', operator: '=', operatorPlaceholder: t('Id'), width: 70 },
{ label: t('user.user.User name'), prop: 'jk_username', align: 'center', operator: 'LIKE', operatorPlaceholder: t('Fuzzy query') },
{ label: t('user.user.nickname'), prop: 'nickname', align: 'center', operator: 'LIKE', operatorPlaceholder: t('Fuzzy query') },
{ label: t('user.user.jk user id'), prop: 'jk_user_id', align: 'center', operator: 'LIKE', operatorPlaceholder: t('Fuzzy query') },
{ label: t('user.user.referrer code'), prop: 'referrer_code', align: 'center', operator: 'LIKE', operatorPlaceholder: t('Fuzzy query'), width: 120,},
{
label: t('user.user.group'),
prop: 'userGroup.name',
align: 'center',
operator: 'LIKE',
operatorPlaceholder: t('Fuzzy query'),
render: 'tag',
},
{ label: t('user.user.avatar'), prop: 'avatar', align: 'center', render: 'image', operator: false },
{
label: t('user.user.Gender'),
prop: 'gender',
align: 'center',
render: 'tag',
custom: { '0': 'info', '1': '', '2': 'success' },
replaceValue: { '0': t('Unknown'), '1': t('user.user.male'), '2': t('user.user.female') },
},
{ label: t('user.user.mobile'), prop: 'mobile', align: 'center', operator: 'LIKE', operatorPlaceholder: t('Fuzzy query') },
{
label: t('user.user.Last login IP'),
prop: 'last_login_ip',
align: 'center',
operator: 'LIKE',
operatorPlaceholder: t('Fuzzy query'),
render: 'tag',
},
{
label: t('user.user.Last login'),
prop: 'last_login_time',
align: 'center',
render: 'datetime',
sortable: 'custom',
operator: 'RANGE',
width: 160,
},
{ label: t('Create time'), prop: 'create_time', align: 'center', render: 'datetime', sortable: 'custom', operator: 'RANGE', width: 160 },
{
label: t('State'),
prop: 'status',
align: 'center',
render: 'tag',
custom: { disable: 'danger', enable: 'success' },
replaceValue: { disable: t('Disable'), enable: t('Enable') },
},
{
label: t('Operate'),
align: 'center',
width: '160',
render: 'buttons',
buttons: optButtons,
operator: false,
}
],
dblClickNotEditColumn: [undefined],
},
{
defaultItems: {
gender: 0,
money: '0',
score: '0',
status: 'enable',
},
}
)
baTable.mount()
baTable.getData()
provide('baTable', baTable)
</script>
<style scoped lang="scss"></style>