增加礼物类型

This commit is contained in:
yziiy
2026-01-13 10:08:54 +08:00
parent 97aff0f0bd
commit 8595bd12f3
6 changed files with 128 additions and 129 deletions

View File

@@ -1,190 +1,156 @@
import { http } from "@/utils/http"; import { http } from "@/utils/http";
type Result = { type Result = {
code: string; code: string;
data: any; data: any;
}; };
export const queryRuleList = params => { export const queryRuleList = params => {
return http.request<Result>( return http.request<Result>("get", "/adminapi/CanRecharge/recharge_lists", {
"get", params
"/adminapi/CanRecharge/recharge_lists", });
{ params }
);
}; };
export const addRuleData = data => { export const addRuleData = data => {
return http.request<Result>("post", "/adminapi/CanRecharge/recharge_add", { return http.request<Result>("post", "/adminapi/CanRecharge/recharge_add", {
data data
}); });
} };
export const editRuleData = data => { export const editRuleData = data => {
return http.request<Result>("post", "/adminapi/CanRecharge/recharge_edit", { return http.request<Result>("post", "/adminapi/CanRecharge/recharge_edit", {
data data
}); });
} };
export const deleteRuleData = data => { export const deleteRuleData = data => {
return http.request<Result>("post", "/adminapi/CanRecharge/recharge_del", { return http.request<Result>("post", "/adminapi/CanRecharge/recharge_del", {
data data
}); });
} };
export const upadteRuleData = data => { export const upadteRuleData = data => {
return http.request<Result>("post", "/adminapi/CanRecharge/recharge_status", { return http.request<Result>("post", "/adminapi/CanRecharge/recharge_status", {
data data
}); });
} };
// 以上充值规则设置 // 以上充值规则设置
export const queryPageist = params => { export const queryPageist = params => {
return http.request<Result>( return http.request<Result>("get", "/adminapi/Page/page_lists", { params });
"get",
"/adminapi/Page/page_lists",
{ params }
);
}; };
export const addPageData = data => { export const addPageData = data => {
return http.request<Result>("post", "/adminapi/Page/page_add", { return http.request<Result>("post", "/adminapi/Page/page_add", {
data data
}); });
} };
export const editPageData = data => { export const editPageData = data => {
return http.request<Result>("post", "/adminapi/Page/page_edit", { return http.request<Result>("post", "/adminapi/Page/page_edit", {
data data
}); });
} };
export const deletePageData = data => { export const deletePageData = data => {
return http.request<Result>("post", "/adminapi/Page/page_del", { return http.request<Result>("post", "/adminapi/Page/page_del", {
data data
}); });
} };
// 主题设置 // 主题设置
export const getThemeList = params => { export const getThemeList = params => {
return http.request<Result>( return http.request<Result>("get", "/adminapi/Theme/theme_list", { params });
"get",
"/adminapi/Theme/theme_list",
{ params }
);
}; };
export const addThemeData = data => { export const addThemeData = data => {
return http.request<Result>("post", "/adminapi/Theme/theme_add", { return http.request<Result>("post", "/adminapi/Theme/theme_add", {
data data
}); });
} };
export const editThemeData = data => { export const editThemeData = data => {
return http.request<Result>("post", "/adminapi/Theme/theme_edit", { return http.request<Result>("post", "/adminapi/Theme/theme_edit", {
data data
}); });
} };
export const deleteThemeData = data => { export const deleteThemeData = data => {
return http.request<Result>("post", "/adminapi/Theme/theme_del", { return http.request<Result>("post", "/adminapi/Theme/theme_del", {
data data
}); });
} };
export const useThemeData = data => { export const useThemeData = data => {
return http.request<Result>("post", "/adminapi/Theme/theme_apply", { return http.request<Result>("post", "/adminapi/Theme/theme_apply", {
data data
}); });
} };
// 私密设置 // 私密设置
export const getConfigTypeList = params => { export const getConfigTypeList = params => {
return http.request<Result>( return http.request<Result>("get", "/adminapi/SysSet/type_list", { params });
"get",
"/adminapi/SysSet/type_list",
{ params }
);
}; };
export const getConfigSetInfo = params => { export const getConfigSetInfo = params => {
return http.request<Result>( return http.request<Result>("get", "/adminapi/SysSet/config_list", {
"get", params
"/adminapi/SysSet/config_list", });
{ params }
);
}; };
export const SetConfigData = data => { export const SetConfigData = data => {
return http.request<Result>( return http.request<Result>("post", "/adminapi/SysSet/config_set", { data });
"post",
"/adminapi/SysSet/config_set",
{ data }
);
}; };
// 帮助中心 // 帮助中心
export const getHelpTypeList = params => { export const getHelpTypeList = params => {
return http.request<Result>( return http.request<Result>("get", "/adminapi/Help/help_type_lists", {
"get", params
"/adminapi/Help/help_type_lists", });
{ params }
);
}; };
export const addHelpTypeData = data => { export const addHelpTypeData = data => {
return http.request<Result>("post", "/adminapi/Help/help_type_add", { return http.request<Result>("post", "/adminapi/Help/help_type_add", {
data data
}); });
} };
export const editHelpTypeData = data => { export const editHelpTypeData = data => {
return http.request<Result>("post", "/adminapi/Help/help_type_edit", { return http.request<Result>("post", "/adminapi/Help/help_type_edit", {
data data
}); });
} };
export const deleteHelpTypeData = data => { export const deleteHelpTypeData = data => {
return http.request<Result>("post", "/adminapi/Help/help_type_del", { return http.request<Result>("post", "/adminapi/Help/help_type_del", {
data data
}); });
} };
export const getProblemList = params => { export const getProblemList = params => {
return http.request<Result>( return http.request<Result>("get", "/adminapi/Help/help_lists", { params });
"get",
"/adminapi/Help/help_lists",
{ params }
);
}; };
export const addProblemData = data => { export const addProblemData = data => {
return http.request<Result>("post", "/adminapi/Help/help_add", { return http.request<Result>("post", "/adminapi/Help/help_add", {
data data
}); });
} };
export const editProblemData = data => { export const editProblemData = data => {
return http.request<Result>("post", "/adminapi/Help/help_edit", { return http.request<Result>("post", "/adminapi/Help/help_edit", {
data data
}); });
} };
export const deleteProblemData = data => { export const deleteProblemData = data => {
return http.request<Result>("post", "/adminapi/Help/help_del", { return http.request<Result>("post", "/adminapi/Help/help_del", {
data data
}); });
} };
export const queryTaskList = params => { export const queryTaskList = params => {
return http.request<Result>( return http.request<Result>("get", "/adminapi/Tasks/task_list", { params });
"get",
"/adminapi/Tasks/task_list",
{ params }
);
}; };
export const editTaskData = data => { export const editTaskData = data => {
return http.request<Result>("post", "/adminapi/Tasks/task_edit", { return http.request<Result>("post", "/adminapi/Tasks/task_edit", {
data data
}); });
} };
export const upadteTaskData = data => { export const upadteTaskData = data => {
return http.request<Result>("post", "/adminapi/Tasks/task_open", { return http.request<Result>("post", "/adminapi/Tasks/task_open", {
data data
}); });
} };
// 二级密码校验 // 二级密码校验
export const checkPassWord = data => { export const checkPassWord = data => {
return http.request<Result>("post", "/adminapi/SysSet/check_second_pwd", { return http.request<Result>("post", "/adminapi/SysSet/check_second_pwd", {
data data
}); });
} };
// 私密设置 // 私密设置
export const getLuckyCoinInfo = () => { export const getLuckyCoinInfo = () => {
return http.request<Result>( return http.request<Result>("get", "/adminapi/Lottery/config_list");
"get",
"/adminapi/Lottery/config_list"
);
}; };
export const saveLuckyCoinInfo = data => { export const saveLuckyCoinInfo = data => {
return http.request<Result>("post", "/adminapi/Lottery/config_set", { return http.request<Result>("post", "/adminapi/Lottery/config_set", {
data data
}); });
} };

View File

@@ -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://vsyusheng.qxhs.xyz";
// 测试 // 测试
// export const URL = "https://test.vespa.qxyushen.top"; // export const URL = "https://test.vespa.qxyushen.top";
// 声网appId 在这里换 // 声网appId 在这里换
export const appIdBySw = '02f7339ec98947deaeab173599891932'; export const appIdBySw = "02f7339ec98947deaeab173599891932";

View File

@@ -1,7 +1,7 @@
import { ref, h } from "vue"; import { ref, h } from "vue";
import editForm from "./form.vue"; import editForm from "./form.vue";
import { message } from "@/utils/message"; import { message } from "@/utils/message";
import { getGiftTypeOrLabel } from '@/api/modules/gift'; import { getGiftTypeOrLabel } from "@/api/modules/gift";
import { import {
queryGiftList, queryGiftList,
addGiftData, addGiftData,
@@ -13,12 +13,14 @@ import { addDialog } from "@/components/ReDialog";
export function useData() { export function useData() {
const getLableList = async () => { const getLableList = async () => {
const { data, code } = await getGiftTypeOrLabel({ type: 2 }) const { data, code } = await getGiftTypeOrLabel({ type: 2 });
searchLabel.value[searchLabel.value.length - 1].optionList = code ? data.map(ele => { searchLabel.value[searchLabel.value.length - 1].optionList = code
return { ...ele, label: ele.name, value: ele.id } ? data.map(ele => {
}) : [] return { ...ele, label: ele.name, value: ele.id };
} })
getLableList() : [];
};
getLableList();
const formRef = ref(); const formRef = ref();
const loading = ref(true); const loading = ref(true);
const tableList = ref([]); const tableList = ref([]);
@@ -33,20 +35,34 @@ export function useData() {
{ label: "礼物ID", prop: "search_gift_id", type: "input" }, { label: "礼物ID", prop: "search_gift_id", type: "input" },
{ label: "礼物名称", prop: "search_gift_name", type: "input" }, { label: "礼物名称", prop: "search_gift_name", type: "input" },
{ {
label: "礼物分类", prop: "search_gift_type", type: "select", optionList: [ label: "礼物分类",
prop: "search_gift_type",
type: "select",
optionList: [
{ {
value: 1, value: 1,
label: '普通礼物' label: "普通礼物"
}, { },
{
value: 2, value: 2,
label: '盲盒礼物' label: "盲盒礼物"
}, { },
{
value: 3, value: 3,
label: '礼包礼物' label: "礼包礼物"
},
{
value: 4,
label: "酒吧房礼物"
} }
] ]
}, },
{ label: "礼物标签", prop: "search_gift_label", type: "select", optionList: [] } {
label: "礼物标签",
prop: "search_gift_label",
type: "select",
optionList: []
}
]); ]);
const pagination = ref({ const pagination = ref({
total: 0, total: 0,
@@ -97,28 +113,36 @@ export function useData() {
label: "公屏", label: "公屏",
prop: "is_public_screen", prop: "is_public_screen",
cellRenderer: ({ row }) => ( cellRenderer: ({ row }) => (
<el-tag type={row.is_public_screen === 1 ? 'success' : 'error'}>{row.is_public_screen === 1 ? '是' : '否'}</el-tag> <el-tag type={row.is_public_screen === 1 ? "success" : "error"}>
{row.is_public_screen === 1 ? "是" : "否"}
</el-tag>
) )
}, },
{ {
label: "全服播报", label: "全服播报",
prop: "is_public_server", prop: "is_public_server",
cellRenderer: ({ row }) => ( cellRenderer: ({ row }) => (
<el-tag type={row.is_public_server === 1 ? 'success' : 'error'}>{row.is_public_server === 1 ? '是' : '否'}</el-tag> <el-tag type={row.is_public_server === 1 ? "success" : "error"}>
{row.is_public_server === 1 ? "是" : "否"}
</el-tag>
) )
}, },
{ {
label: "是否显示", label: "是否显示",
prop: "is_show", prop: "is_show",
cellRenderer: ({ row }) => ( cellRenderer: ({ row }) => (
<el-tag type={row.is_show === 1 ? 'success' : 'error'}>{row.is_show === 1 ? '显示' : '隐藏'}</el-tag> <el-tag type={row.is_show === 1 ? "success" : "error"}>
{row.is_show === 1 ? "显示" : "隐藏"}
</el-tag>
) )
}, },
{ {
label: "是否可购买", label: "是否可购买",
prop: "is_can_buy", prop: "is_can_buy",
cellRenderer: ({ row }) => ( cellRenderer: ({ row }) => (
<el-tag type={row.is_can_buy === 1 ? 'success' : 'error'}>{row.is_can_buy === 1 ? '可购买' : '禁止购买'}</el-tag> <el-tag type={row.is_can_buy === 1 ? "success" : "error"}>
{row.is_can_buy === 1 ? "可购买" : "禁止购买"}
</el-tag>
) )
}, },
{ {
@@ -136,9 +160,9 @@ export function useData() {
slot: "operation" slot: "operation"
} }
]); ]);
const onSearch = async (formData) => { const onSearch = async formData => {
loading.value = true; loading.value = true;
searchForm.value = { ...formData } searchForm.value = { ...formData };
const { data, code } = await queryGiftList({ const { data, code } = await queryGiftList({
...formData, ...formData,
page: pagination.value.currentPage, page: pagination.value.currentPage,
@@ -170,7 +194,7 @@ export function useData() {
}; };
// 新增 // 新增
const openDialog = async (title = "新增", rowData: any) => { const openDialog = async (title = "新增", rowData: any) => {
const { data, code } = await getGiftInfo({ gid: rowData.gid }) const { data, code } = await getGiftInfo({ gid: rowData.gid });
addDialog({ addDialog({
title: `${title}礼物`, title: `${title}礼物`,
props: { props: {

View File

@@ -9,8 +9,8 @@ const newFormInline = ref(
props.formInline props.formInline
? props.formInline ? props.formInline
: { : {
password: "" password: ""
} }
); );
function getRef() { function getRef() {
return ruleFormRef.value; return ruleFormRef.value;
@@ -21,7 +21,7 @@ defineExpose({ getRef });
<template> <template>
<el-form ref="ruleFormRef" :model="newFormInline" :rules="formRules" label-width="120px"> <el-form ref="ruleFormRef" :model="newFormInline" :rules="formRules" label-width="120px">
<el-form-item label="二级密码" prop="password"> <el-form-item label="二级密码" prop="password">
<el-input placeholder="请输入密码" v-model="newFormInline.password" show-password></el-input> <el-input v-model="newFormInline.password" placeholder="请输入密码" show-password />
</el-form-item> </el-form-item>
</el-form> </el-form>
</template> </template>

View File

@@ -11,51 +11,52 @@ import {
import { addDialog } from "@/components/ReDialog"; import { addDialog } from "@/components/ReDialog";
export function useData() { export function useData() {
const formRef = ref(); const formRef = ref();
const formData = ref({}) const formData = ref({});
const loading = ref(true); const loading = ref(true);
const activeId = ref(0) const activeId = ref(0);
const tableList = ref([]); const tableList = ref([]);
const formLabel = ref([]) const formLabel = ref([]);
const isShow = ref(false); const isShow = ref(false);
const onSearch = async () => { const onSearch = async () => {
loading.value = true; loading.value = true;
const { data, code } = await getConfigTypeList({}); const { data, code } = await getConfigTypeList({});
if (code) { if (code) {
// 测试git // 测试git
tableList.value = data.filter(ele => { return ele.id !== 11 }) tableList.value = data.filter(ele => {
activeId.value = data[0].id return ele.id !== 11;
getInfo(activeId.value) });
activeId.value = data[0].id;
getInfo(activeId.value);
} }
loading.value = false; loading.value = false;
}; };
const getInfo = async (id) => { const getInfo = async id => {
const { data, code } = await getConfigSetInfo({ type: id }) const { data, code } = await getConfigSetInfo({ type: id });
if (code) { if (code) {
formLabel.value = code ? data : [] formLabel.value = code ? data : [];
if (data && data.length) { if (data && data.length) {
data.forEach(ele => { data.forEach(ele => {
formData.value[ele.key_title] = ele.key_value formData.value[ele.key_title] = ele.key_value;
}) });
} }
} }
};
} const tabClick = event => {
const tabClick = (event) => { const { name } = event.props;
const { name } = event.props getInfo(name);
getInfo(name) };
}
const saveConfigEvent = async () => { const saveConfigEvent = async () => {
const { code, msg } = await SetConfigData({ const { code, msg } = await SetConfigData({
...formData.value, ...formData.value,
type: activeId.value type: activeId.value
}) });
if (code) { if (code) {
message("操作成功", { type: "success" }); message("操作成功", { type: "success" });
getInfo(activeId.value) getInfo(activeId.value);
} else { } else {
message(msg, { type: "error" }); message(msg, { type: "error" });
} }
} };
const saveConfig = async () => { const saveConfig = async () => {
// 输入二级密码 // 输入二级密码
addDialog({ addDialog({
@@ -72,14 +73,13 @@ export function useData() {
const FormRef = formRef.value.getRef(); const FormRef = formRef.value.getRef();
const curData = options.props.formInline; const curData = options.props.formInline;
const saveData = async form => { const saveData = async form => {
const { data, code, msg } = await checkPassWord(form) const { data, code, msg } = await checkPassWord(form);
if (code) { if (code) {
saveConfigEvent() saveConfigEvent();
done() done();
} else { } else {
message(msg, { type: "error" }); message(msg, { type: "error" });
} }
}; };
FormRef.validate(valid => { FormRef.validate(valid => {
if (valid) { if (valid) {
@@ -108,7 +108,7 @@ export function useData() {
// } // }
// }) // })
// .catch(() => { }); // .catch(() => { });
} };
return { return {
onSearch, onSearch,
isShow, isShow,

View File

@@ -33,13 +33,22 @@ export default ({ mode }: ConfigEnv): UserConfigExport => {
// 如果后端服务器没有对OPTIONS请求进行正确处理代理服务器可能会自动处理 // 如果后端服务器没有对OPTIONS请求进行正确处理代理服务器可能会自动处理
// 你可以尝试添加以下配置来处理预检请求 // 你可以尝试添加以下配置来处理预检请求
onProxyReq: (proxyReq, req, res) => { onProxyReq: (proxyReq, req, res) => {
if (req.method === 'OPTIONS') { if (req.method === "OPTIONS") {
proxyReq.method = 'OPTIONS'; proxyReq.method = "OPTIONS";
// res.setHeader('Access-Control-Allow-Origin', 'http://adminvs.qxhs.xyz'); res.setHeader(
res.setHeader('Access-Control-Allow-Origin', 'http://yushenggliht.qxyushen.top'); "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'); // res.setHeader('Access-Control-Allow-Origin', 'https://test.vespa.qxyushen.top');
res.setHeader('Access-Control-Allow-Methods', 'GET, POST, PUT, DELETE, OPTIONS'); res.setHeader(
res.setHeader('Access-Control-Allow-Headers', 'Content-Type, Authorization'); "Access-Control-Allow-Methods",
"GET, POST, PUT, DELETE, OPTIONS"
);
res.setHeader(
"Access-Control-Allow-Headers",
"Content-Type, Authorization"
);
res.end(); res.end();
} }
} }