diff --git a/src/api/modules/newuserList.ts b/src/api/modules/newuserList.ts index 7ae8241..7ed899c 100644 --- a/src/api/modules/newuserList.ts +++ b/src/api/modules/newuserList.ts @@ -136,4 +136,18 @@ export const userRelationList = params => { "/adminapi/User/user_relation_list", { params } ); -} \ No newline at end of file +} +// 获取封禁理由列表 +export const getBanReason = () => { + return http.request( + "get", + "/adminapi/User/getBanEason" + ); +}; +// 获取封禁时间列表 +export const getBanDay = () => { + return http.request( + "get", + "/adminapi/User/getBanDay" + ); +}; diff --git a/src/utils/http/config.ts b/src/utils/http/config.ts index 15ae20b..50666f0 100644 --- a/src/utils/http/config.ts +++ b/src/utils/http/config.ts @@ -1,7 +1,7 @@ -export const URL = "https://yushengapi.qxyushen.top"; +// export const URL = "https://yushengapi.qxyushen.top"; // 预测版 // export const URL = "https://vsyusheng.qxhs.xyz"; // 测试 -// export const URL = "https://test.vespa.qxyushen.top"; +export const URL = "https://test.vespa.qxyushen.top"; // 声网appId 在这里换 export const appIdBySw = "02f7339ec98947deaeab173599891932"; diff --git a/src/views/newuser/disableUser/form.vue b/src/views/newuser/disableUser/form.vue index d324978..d69d63d 100644 --- a/src/views/newuser/disableUser/form.vue +++ b/src/views/newuser/disableUser/form.vue @@ -1,8 +1,15 @@ diff --git a/src/views/newuser/newuserList/hook.tsx b/src/views/newuser/newuserList/hook.tsx index 6390e2c..e3d73f0 100644 --- a/src/views/newuser/newuserList/hook.tsx +++ b/src/views/newuser/newuserList/hook.tsx @@ -1,13 +1,13 @@ import { h, ref, nextTick } from "vue"; import editForm from "./form.vue"; import { ElMessageBox } from "element-plus"; -import ExportForm from '@/components/exportDialog/index.vue'; +import ExportForm from "@/components/exportDialog/index.vue"; import { utils, writeFile } from "xlsx"; -import detailView from './detail.vue'; -import banUserView from './banUser.vue'; -import changePassView from './password.vue'; -import setFundView from './fundSetting.vue'; -import searchMoreView from './searchMore.vue'; +import detailView from "./detail.vue"; +import banUserView from "./banUser.vue"; +import changePassView from "./password.vue"; +import setFundView from "./fundSetting.vue"; +import searchMoreView from "./searchMore.vue"; import { message } from "@/utils/message"; import { queryList, @@ -25,21 +25,21 @@ import { addDialog } from "@/components/ReDialog"; export function useData() { const formRef = ref(); const searchFormMore = ref({ - user_code: '', - login_device: '', - nickname: '', - status: '', - coin1: '', - coin2: '', - createtime: '' - }) + user_code: "", + login_device: "", + nickname: "", + status: "", + coin1: "", + coin2: "", + createtime: "" + }); const loading = ref(true); const tableList = ref([]); const isShow = ref(false); const totalPrice = ref({ total_coin: 0, total_earnings: 0 - }) + }); const pagination = ref({ total: 0, pageSize: 10, @@ -48,7 +48,7 @@ export function useData() { background: true }); const searchForm = ref({ - user_code: '', + user_code: "", search: "", is_sys_tester: "", is_real: "", @@ -81,8 +81,8 @@ export function useData() { prop: "order_type", type: "select", optionList: [ - { label: "金币", value: 'coin' }, - { label: "钻石", value: 'earnings' } + { label: "金币", value: "coin" }, + { label: "钻石", value: "earnings" } ] }, { @@ -136,7 +136,7 @@ export function useData() { label: "性别", prop: "sex", cellRenderer: ({ row }) => ( -
{row.sex === 1 ? '男' : row.sex === 2 ? '女' : '未知'}
+
{row.sex === 1 ? "男" : row.sex === 2 ? "女" : "未知"}
) }, { @@ -159,7 +159,7 @@ export function useData() { }, { label: "实名状态", - prop: "is_real_str", + prop: "is_real_str" }, { label: "邀请码", @@ -169,7 +169,13 @@ export function useData() { label: "登录状态", prop: "status", cellRenderer: ({ row }) => ( - {row.status_str} + + {row.status_str} + ) }, { @@ -179,17 +185,17 @@ export function useData() { slot: "operation" } ]); - const onSearch = async (formData) => { + const onSearch = async formData => { loading.value = true; - searchForm.value = { ...formData } + searchForm.value = { ...formData }; // console.log(searchForm.value, formData, 111) if (!formData) { - resetFieldsSearch() + resetFieldsSearch(); } const { data, code } = await queryList({ ...formData, - coin1: searchForm.value.coin1 !== '' ? searchForm.value.coin1 : '', - coin2: searchForm.value.coin2 !== '' ? searchForm.value.coin2 : '', + coin1: searchForm.value.coin1 !== "" ? searchForm.value.coin1 : "", + coin2: searchForm.value.coin2 !== "" ? searchForm.value.coin2 : "", page: pagination.value.currentPage, page_limit: pagination.value.pageSize }); @@ -199,7 +205,7 @@ export function useData() { ...ele, coin: Number(ele.coin), earnings: Number(ele.earnings) - } + }; }); pagination.value.total = data.count; totalPrice.value.total_coin = Number(data.total_coin); @@ -218,10 +224,10 @@ export function useData() { }; // 编辑会员 const openDialog = async (title = "新增", rowData: any) => { - const userInfoRes = await getUserInfo({ user_id: rowData.id }) + const userInfoRes = await getUserInfo({ user_id: rowData.id }); nextTick(() => { if (userInfoRes.code) { - const { user_info, follow_num } = userInfoRes.data + const { user_info, follow_num } = userInfoRes.data; addDialog({ title: `${title}会员信息`, props: { @@ -236,13 +242,14 @@ export function useData() { profile: user_info?.profile ?? "", init_code: user_info?.init_code ?? "", red_status: user_info?.red_status ?? "", - sex: user_info?.sex ?? '', - is_real: follow_num.is_real === '已实名' ? 1 : 0 + sex: user_info?.sex ?? "", + is_real: follow_num.is_real === "已实名" ? 1 : 0 } }, width: "40%", closeOnClickModal: false, - contentRenderer: () => h(editForm, { ref: formRef, formInline: null }), + contentRenderer: () => + h(editForm, { ref: formRef, formInline: null }), beforeSure: (done, { options }) => { const FormRef = formRef.value.getRef(); const curData = options.props.formInline; @@ -271,14 +278,14 @@ export function useData() { } }); } - }) + }); }; // 查看会员详情 - const viewDetail = async (rowData) => { - const userInfoRes = await getUserInfo({ user_id: rowData.id }) + const viewDetail = async rowData => { + const userInfoRes = await getUserInfo({ user_id: rowData.id }); nextTick(() => { if (userInfoRes.code) { - const userData = userInfoRes.data + const userData = userInfoRes.data; addDialog({ title: `查看会员详情`, props: { @@ -287,13 +294,13 @@ export function useData() { width: "60%", closeOnClickModal: false, contentRenderer: () => h(detailView), - beforeSure: (done) => { - done() + beforeSure: done => { + done(); } }); } - }) - } + }); + }; // 删除会员 const handleDelete = async rowData => { const { code } = await removeUserData({ user_id: rowData.id }); @@ -321,18 +328,24 @@ export function useData() { const FormRef = formRef.value.getRef(); const curData = options.props.formInline; const updateUserDataStatus = async form => { - const paramData = { ...form, user_id: rowData.id } + const paramData = { + ...form, + user_id: rowData.id, + ban_eason: form.ban_reason, // 封禁理由 + ban_day: form.ban_day // 封禁时间 + }; if (form.status === 2) { // 解封 - paramData.time = '' - paramData.status = 2 + paramData.time = ""; + paramData.status = 2; } else { if (!form.timeType) { // 永久解封 - paramData.time = '' + paramData.time = ""; } } - delete paramData.timeType + delete paramData.timeType; + delete paramData.ban_reason; // 删除临时字段,使用ban_eason const { code, msg } = await banUserData(paramData); if (code) { message("设置成功", { type: "success" }); @@ -344,7 +357,7 @@ export function useData() { }; FormRef.validate(valid => { if (valid) { - updateUserDataStatus(curData) + updateUserDataStatus(curData); } }); } @@ -368,43 +381,44 @@ export function useData() { }, width: "50%", closeOnClickModal: false, - contentRenderer: () => h(searchMoreView, { ref: formRef, formInline: null }), + contentRenderer: () => + h(searchMoreView, { ref: formRef, formInline: null }), beforeSure: (done, { options }) => { const FormRef = formRef.value.getRef(); const curData = options.props.formInline; FormRef.validate(valid => { if (valid) { - searchFormMore.value = { ...curData } + searchFormMore.value = { ...curData }; onSearch({ ...searchForm.value, ...curData }); } }); - done() + done(); } }); - } - const changeSearchValue = (form) => { + }; + const changeSearchValue = form => { Object.keys(form).forEach(ele => { - searchForm.value[ele] = form[ele] - }) - console.log(searchForm.value) - } + searchForm.value[ele] = form[ele]; + }); + console.log(searchForm.value); + }; const resetFieldsSearch = () => { searchFormMore.value = { - user_code: '', - login_device: '', - nickname: '', - status: '', - coin1: '', - coin2: '', - createtime: '' - } + user_code: "", + login_device: "", + nickname: "", + status: "", + coin1: "", + coin2: "", + createtime: "" + }; searchForm.value = { search: "", is_sys_tester: "", is_real: "" - } + }; onSearch({ ...searchForm.value, ...searchFormMore.value }); - } + }; // 设置资金 const setUserFund = async (rowData: any) => { addDialog({ @@ -438,33 +452,34 @@ export function useData() { }; FormRef.validate(valid => { if (valid) { - setMoneyData(curData) + setMoneyData(curData); } }); } }); }; - const exportFormRef = ref(null) + const exportFormRef = ref(null); const exportExcel = () => { - let exportTableList = [] + let exportTableList = []; addDialog({ title: `导出数据`, props: { formInline: { - time: '' + time: "" } }, width: "40%", closeOnClickModal: false, - contentRenderer: () => h(ExportForm, { ref: exportFormRef, formInline: null }), + contentRenderer: () => + h(ExportForm, { ref: exportFormRef, formInline: null }), beforeSure: (done, { options }) => { const FormRef = exportFormRef.value.getRef(); const curData = options.props.formInline; - const exportData = async (formData) => { + const exportData = async formData => { const { data, code } = await queryList({ ...searchForm.value, - coin1: searchForm.value.coin1 ? searchForm.value.coin1 : '', - coin2: searchForm.value.coin2 ? searchForm.value.coin2 : '', + coin1: searchForm.value.coin1 ? searchForm.value.coin1 : "", + coin2: searchForm.value.coin2 ? searchForm.value.coin2 : "", page: 1, page_limit: 10000 }); @@ -485,30 +500,35 @@ export function useData() { const workSheet = utils.aoa_to_sheet(res); const workBook = utils.book_new(); utils.book_append_sheet(workBook, workSheet, "数据报表"); - writeFile(workBook, `想会员列表统计${formData.start_time} - ${formData.end_time}.xlsx`); + writeFile( + workBook, + `想会员列表统计${formData.start_time} - ${formData.end_time}.xlsx` + ); message("导出成功", { type: "success" }); - done() + done(); } else { message("获取数据失败,请重试!", { type: "error" }); } - } + }; FormRef.validate(valid => { if (valid) { if (curData.time && curData.time.length) { - exportData({ start_time: curData.time[0] || '', end_time: curData.time[1] || '' }) + exportData({ + start_time: curData.time[0] || "", + end_time: curData.time[1] || "" + }); } } }); } }); - - } + }; // 找回账号 - const FindData = async (rowData) => { + const FindData = async rowData => { // console.log(rowData) const { code } = await findUserData({ mobile: rowData.mobile }); if (code) { @@ -517,7 +537,7 @@ export function useData() { }); onSearch(searchForm.value); } - } + }; // 修改密码 const changePassword = async (rowData: any) => { addDialog({ @@ -529,7 +549,8 @@ export function useData() { }, width: "40%", closeOnClickModal: false, - contentRenderer: () => h(changePassView, { ref: formRef, formInline: null }), + contentRenderer: () => + h(changePassView, { ref: formRef, formInline: null }), beforeSure: (done, { options }) => { const FormRef = formRef.value.getRef(); const curData = options.props.formInline; @@ -581,4 +602,4 @@ export function useData() { FindData, totalPrice }; -} \ No newline at end of file +} diff --git a/vite.config.ts b/vite.config.ts index 0b1bb94..5351dc1 100644 --- a/vite.config.ts +++ b/vite.config.ts @@ -39,14 +39,14 @@ export default ({ mode }: ConfigEnv): UserConfigExport => { // "Access-Control-Allow-Origin", // "http://adminvs.qxhs.xyz" // ); - res.setHeader( - "Access-Control-Allow-Origin", - "http://yushenggliht.qxyushen.top" - ); // res.setHeader( // "Access-Control-Allow-Origin", - // "https://test.vespa.qxyushen.top" + // "http://yushenggliht.qxyushen.top" // ); + res.setHeader( + "Access-Control-Allow-Origin", + "https://test.vespa.qxyushen.top" + ); res.setHeader( "Access-Control-Allow-Methods", "GET, POST, PUT, DELETE, OPTIONS"