Compare commits

...

6 Commits

Author SHA1 Message Date
dragon
d31726d6e7 更新请求接口方式 2024-07-18 16:39:18 +08:00
dragon
7bdbb9f071 修复bug暂存-周卡 2024-07-18 14:48:58 +08:00
dragon
cb54148f6e 对接完成接口-周卡 2024-07-18 14:48:58 +08:00
dragon
fcefd9e09d 暂存 2024-07-18 14:48:57 +08:00
dragon
210a6a8f71 暂存 2024-07-18 14:48:57 +08:00
dragon
7ea73622cd 完成勋章赠送 2024-07-18 14:32:57 +08:00
9 changed files with 2552 additions and 0 deletions

58
src/api/medal/medal.js Normal file
View File

@@ -0,0 +1,58 @@
import request from '@/utils/request';
import { genQueryParam } from '@/utils/maintainer';
// 地区接口
export const listPartitionInfo = query => {
return request({
url: '/partition/listPartitionInfo',
method: 'get',
params: query
});
};
// 勋章信息-列表
export const medalPage = query => {
return request({
url: '/admin/medal/page',
method: 'get',
params: query
});
};
// 勋章信息-新增&保存
export const medalSave = query => {
return request({
url: '/admin/medal/save',
method: 'post',
params: query
});
};
// 勋章信息-发放
export const medalSend = query => {
return request({
url: '/admin/medal/send',
method: 'post',
params: query
});
};
// 勋章记录-撤销
export const rollback = query => {
return request({
url: '/admin/medalRecord/rollback',
method: 'post',
params: query
});
};
// 勋章记录-列表
export const medalRecordPage = query => {
return request({
url: '/admin/medalRecord/page',
method: 'get',
params: query
});
};
// 勋章记录-勋章列表
export const listAll = query => {
return request({
url: '/admin/medal/listAll',
method: 'get',
params: query
});
};

View File

@@ -0,0 +1,135 @@
import request from '@/utils/request';
import { genQueryParam } from '@/utils/maintainer';
// 地区接口
export const listPartitionInfo = query => {
return request({
url: '/partition/listPartitionInfo',
method: 'get',
params: query
});
};
// 福袋列表请求
export const listLuckyBagLinearGift = query => {
return request({
url: '/admin/gift/getGiftByTypes',
method: 'get',
params: query
});
};
// 福袋礼物列表请求
export const getPrizeGroupsInfo = query => {
return request({
url: '/admin/luckyBag/getGroupInfo',
method: 'get',
params: query
});
};
// 所有礼物列表请求
export const getAll = query => {
return request({
url: '/admin/gift/getAll',
method: 'get',
params: query
});
};
// 所有座驾列表请求
export const carAll = query => {
return request({
url: '/admin/car/goods/total/list',
method: 'get',
params: query
});
};
// 所有头饰列表请求
export const headwearAll = query => {
return request({
url: '/admin/headwear/total/list',
method: 'get',
params: query
});
};
// 所有铭牌列表请求
export const nameplateAll = query => {
return request({
url: '/admin/nameplate/total/list',
method: 'get',
params: query
});
};
// 所有气泡列表请求
export const chatbubbleAll = query => {
return request({
url: '/admin/chatbubble/total/list',
method: 'get',
params: query
});
};
// 所有资料卡列表请求
export const infocard = query => {
return request({
url: '/admin/infocard/total/list',
method: 'get',
params: query
});
};
// 周卡TAB-列表
export const weekCardTabList = query => {
return request({
url: '/admin/weekCardTab/list',
method: 'get',
params: query
});
};
// 周卡TAB-保存
export const weekCardTabSave = query => {
return request({
url: '/admin/weekCardTab/save',
method: 'post',
params: query
});
};
// 周卡激励统计-列表
export const weekCardRecordPage = query => {
return request({
url: '/admin/weekCardRecord/page',
method: 'get',
params: query
});
};
// 周卡激励统计-详情
export const weekCardRecordGetDetailPage = query => {
return request({
url: '/admin/weekCardRecord/getDetailPage',
method: 'get',
params: query
});
};
// 周卡激励统计-导出
export const weekCardRecordExport = query => {
window.location.href = `/admin/weekCardRecord/export?${genQueryParam(query)}`;
return;
};
// 周卡激励配置-列表
export const weekCardPage = query => {
return request({
url: '/admin/weekCard/page',
method: 'get',
params: query
});
};
// 周卡激励配置-上下线
export const updateEnabled = query => {
return request({
url: '/admin/weekCard/updateEnabled',
method: 'get',
params: query
});
};
// 周卡激励配置-保存
export const weekCardSave = query => {
return request({
url: '/admin/weekCard/save',
method: 'post',
params: query
});
};

View File

@@ -51,6 +51,7 @@ export default {
},
getViewComponent(context, path) {
let component = path;
console.log(component)
if (path && path.endsWith('.html')) {
const pathArray = path.split('/');
const routeName = toCamelCase(pathArray[pathArray.length - 1].replace('.html', ''));

View File

@@ -0,0 +1,626 @@
<template>
<div class="box">
<!-- 查询 -->
<div class="inquire">
<span>勋章ID</span>
<el-input v-model="inquire.id" placeholder="" class="input"></el-input>
</div>
<div class="inquire">
<span>勋章昵称</span>
<el-input v-model="inquire.nick" placeholder="" class="input"></el-input>
</div>
<div class="inquire">
<span class="demonstration">地区</span>
<el-select filterable v-model="inquire.partitionId" placeholder="请选择">
<el-option
v-for="item in inquire.options"
:key="item.id"
:label="item.desc"
:value="item.id"
></el-option>
</el-select>
</div>
<!-- 查询按钮 -->
<el-button class="primary" type="primary" @click="getData()">
查询
</el-button>
<el-button class="primary" type="primary" @click="add()"> 新增 </el-button>
<!-- 表格 -->
<el-table
v-loading="loading"
:data="tableData"
border
style="width: 100%; margin-top: 25px"
>
<el-table-column prop="id" align="center" label="勋章ID" />
<el-table-column prop="partitionFlag" align="center" label="地区">
<template v-slot="scope">{{
partitionFlagFun(scope.row.partitionFlag, 1)
}}</template>
</el-table-column>
<el-table-column prop="name" align="center" label="勋章名称-华语区">
<template v-slot="scope">{{ JSON.parse(scope.row.name).zh }}</template>
</el-table-column>
<el-table-column prop="name" align="center" label="勋章名称-英语区">
<template v-slot="scope">{{ JSON.parse(scope.row.name).en }}</template>
</el-table-column>
<el-table-column prop="name" align="center" label="勋章名称-阿语区">
<template v-slot="scope">{{ JSON.parse(scope.row.name).ar }}</template>
</el-table-column>
<el-table-column
align="center"
prop="picUrl"
label="勋章图片"
width="120"
>
<template v-slot="scope">
<el-image
style="width: 100px; height: 100px"
:src="scope.row.picUrl"
:zoom-rate="1.1"
:preview-src-list="scope.row.picUrl"
fit="cover"
preview-teleported="true"
hide-on-click-modal="true"
/>
</template>
</el-table-column>
<el-table-column prop="enable" align="center" label="状态">
<template v-slot="scope">{{
scope.row.enable ? "生效" : "不生效"
}}</template>
</el-table-column>
<el-table-column prop="createTime" align="center" label="添加时间" />
<el-table-column align="center" label="操作" width="220">
<template v-slot="scope">
<el-button
@click="eidFun(scope.row)"
class="primary"
type="primary"
size="default"
>
编辑
</el-button>
<el-button
@click="grantFun(scope.row)"
class="primary"
type="primary"
size="default"
:disabled="!scope.row.enable"
>
发放
</el-button>
</template>
</el-table-column>
</el-table>
<!-- 分页 -->
<el-pagination
style="margin-top: 10px"
class="paginationClass"
v-model:current-page="currentPage"
v-model:page-size="pageSize"
:page-sizes="[10, 20, 30, 40, 50, 100, 200, 300, 400, 500, 999999999]"
layout="sizes, prev, pager, next"
:total="total"
@size-change="handleSizeChange"
@current-change="handleCurrentChange"
/>
<!-- 新增&编辑弹窗 -->
<el-dialog
destroy-on-close
class="pub"
v-model="controlsDialog"
:title="controlsTitle"
width="32%"
center
>
<!-- 地区 -->
<div style="margin-bottom: 25px; margin-top: 10px; display: flex">
<span
style="display: inline-block; margin-right: 20px"
class="col-sm-2 control-label"
>地区</span
>
<el-select
multiple
filterable
v-model="controlsObj.value"
placeholder="请选择"
style="width: 100%"
>
<el-option
v-for="item in controlsObj.options"
:key="item.id"
:label="item.desc"
:value="item.id"
>
</el-option>
</el-select>
</div>
<!-- 勋章名称-华语 -->
<div style="margin-bottom: 25px; margin-top: 10px; display: flex">
<span
style="display: inline-block; margin-right: 20px"
class="col-sm-2 control-label"
>勋章名称-华语</span
>
<el-input
v-model="controlsObj.nickZh"
placeholder=""
class="input"
></el-input>
</div>
<!-- 勋章名称-英语 -->
<div style="margin-bottom: 25px; margin-top: 10px; display: flex">
<span
style="display: inline-block; margin-right: 20px"
class="col-sm-2 control-label"
>勋章名称-英语</span
>
<el-input
v-model="controlsObj.nickEn"
placeholder=""
class="input"
></el-input>
</div>
<!-- 勋章名称-阿语 -->
<div style="margin-bottom: 25px; margin-top: 10px; display: flex">
<span
style="display: inline-block; margin-right: 20px"
class="col-sm-2 control-label"
>勋章名称-阿语</span
>
<el-input
v-model="controlsObj.nickAr"
placeholder=""
class="input"
></el-input>
</div>
<!-- 勋章图片 -->
<div style="margin-bottom: 25px; margin-top: 10px; display: flex">
<span
style="display: inline-block; margin-right: 20px"
class="col-sm-2 control-label"
>勋章图片</span
>
<el-upload
class="avatar-uploader"
action="/admin/tencent/cos/upload/file"
:show-file-list="false"
:on-success="handleAvatarSuccess"
:before-upload="beforeAvatarUpload"
:on-error="handleAvatarError"
>
<img
v-if="controlsObj.imageUrl1"
:src="controlsObj.imageUrl1"
class="avatar"
/>
<el-icon v-else class="avatar-uploader-icon"><Plus /></el-icon>
</el-upload>
</div>
<!-- 状态 -->
<div style="margin-bottom: 25px; margin-top: 10px; display: flex">
<span
style="display: inline-block; margin-right: 20px"
class="col-sm-2 control-label"
>状态</span
>
<el-select filterable v-model="controlsObj.value2" placeholder="请选择">
<el-option
v-for="item in controlsObj.options2"
:key="item.id"
:label="item.desc"
:value="item.id"
></el-option>
</el-select>
</div>
<!-- 弹窗按钮 -->
<template #footer>
<span class="dialog-footer">
<el-button @click="controlsDialog = false">取消</el-button>
<el-button type="primary" @click="controlsDialogOut()">
确认
</el-button>
</span>
</template>
</el-dialog>
<!-- 发放勋章弹窗 -->
<el-dialog
destroy-on-close
class="pub"
v-model="grantDialog"
title="发放勋章"
width="32%"
center
>
<!-- 勋章名称 -->
<div style="margin-bottom: 25px; margin-top: 10px; display: flex">
<span
style="display: inline-block; margin-right: 20px"
class="col-sm-2 control-label"
>勋章名称</span
>
<el-input
v-model="grantObj.nick"
placeholder="默认展示的是中文勋章名称"
class="input"
disabled
></el-input>
</div>
<!-- 发放对象平台号 -->
<div style="margin-bottom: 25px; margin-top: 10px; display: flex">
<span
style="display: inline-block; margin-right: 20px"
class="col-sm-2 control-label"
>发放对象平台号</span
>
<el-input
type="textarea"
:rows="2"
v-model="grantObj.userId"
placeholder="多个平台号用英文“,”号分开分隔"
class="input"
></el-input>
</div>
<!-- 发放天数 -->
<div style="margin-bottom: 25px; margin-top: 10px; display: flex">
<span
style="display: inline-block; margin-right: 20px"
class="col-sm-2 control-label"
>发放天数</span
>
<el-input
v-model="grantObj.days"
placeholder="输入天数,不输入则视为无限制"
class="input"
></el-input>
</div>
<!-- 备注 -->
<div style="margin-bottom: 25px; margin-top: 10px; display: flex">
<span
style="display: inline-block; margin-right: 20px"
class="col-sm-2 control-label"
>备注</span
>
<el-input
v-model="grantObj.desc"
placeholder=""
class="input"
></el-input>
</div>
<!-- 弹窗按钮 -->
<template #footer>
<span class="dialog-footer">
<el-button @click="grantDialog = false">取消</el-button>
<el-button type="primary" @click="grantOut()"> 确认 </el-button>
</span>
</template>
</el-dialog>
</div>
</template>
<script>
import {
listPartitionInfo,
medalPage,
medalSave,
medalSend,
} from "@/api/medal/medal";
// @ts-ignore
import { dateFormat } from "@/utils/system-helper";
// @ts-ignore
import { ElMessage } from "element-plus";
export default {
name: "MedalInfo",
data() {
return {
loading: false,
//查询所需条件对象
inquire: {
id: "",
nick: "",
partitionId: "",
},
// 表格
tableData: [],
// 分页
total: 10,
currentPage: 1,
pageSize: 10,
// 操作弹窗
controlsDialog: false,
controlsTitle: "新增&编辑",
controlsType: 1,
controlsObj: {
value: [],
options: [],
nickZh: "",
nickEn: "",
nickAr: "",
imageUrl1: "",
value2: "",
options2: [
{
desc: "生效",
id: true,
},
{
desc: "不生效",
id: false,
},
],
id: "",
},
// 发放弹窗
grantDialog: false,
grantObj: {
nick: "",
userId: "",
days: "",
desc: "",
},
grantObjNew: {},
};
},
created() {
listPartitionInfo().then((res) => {
this.inquire.options = res.data;
this.inquire.options.push({
desc: "全部",
id: "",
});
listPartitionInfo().then((res) => {
this.controlsObj.options = res.data;
this.getData();
});
});
},
methods: {
// 查询接口
getData() {
this.loading = true;
medalPage({
id: this.inquire.id,
name: this.inquire.nick,
partitionId: this.inquire.partitionId,
page: this.currentPage,
pageSize: this.pageSize,
}).then((res) => {
if (res.code == 200) {
this.total = res.data.total;
this.tableData = res.data.records;
this.loading = false;
} else {
ElMessage({
showClose: true,
message: res.message,
type: "error",
});
}
});
},
// 添加
add() {
this.controlsTitle = "新增";
this.controlsType = 1;
this.controlsObj.value = [];
this.controlsObj.nickZh = "";
this.controlsObj.nickEn = "";
this.controlsObj.nickAr = "";
this.controlsObj.imageUrl1 = "";
this.controlsObj.value2 = "";
this.controlsDialog = true;
},
// 编辑
eidFun(val) {
this.controlsTitle = "编辑";
this.controlsType = 2;
this.controlsObj.value = this.partitionFlagFun(val.partitionFlag, 2);
this.controlsObj.nickZh = JSON.parse(val.name).zh;
this.controlsObj.nickEn = JSON.parse(val.name).en;
this.controlsObj.nickAr = JSON.parse(val.name).ar;
this.controlsObj.imageUrl1 = val.picUrl;
this.controlsObj.value2 = val.enable;
this.controlsObj.id = val.id;
this.controlsDialog = true;
},
// 确认保存按钮
controlsDialogOut() {
if (this.controlsType == 1) {
// 新增
var obj = {};
var partitionFlagVal = 0;
console.log(this.controlsObj.value);
console.log(this.controlsObj.options);
this.controlsObj.value.forEach((res, i) => {
partitionFlagVal |= this.controlsObj.options[i].id;
});
obj.partitionFlag = partitionFlagVal;
obj.name = JSON.stringify({
zh: this.controlsObj.nickZh,
en: this.controlsObj.nickEn,
ar: this.controlsObj.nickAr,
});
obj.picUrl = this.controlsObj.imageUrl1;
obj.enable = this.controlsObj.value2;
console.log(obj);
medalSave(obj).then((res) => {
if (res.code == 200) {
this.getData();
this.controlsDialog = false;
} else {
ElMessage({
showClose: true,
message: res.message,
type: "error",
});
}
});
} else {
// 编辑
var obj1 = {};
var partitionFlagVal1 = 0;
this.controlsObj.value.forEach((res, i) => {
partitionFlagVal1 += res;
});
obj1.partitionFlag = partitionFlagVal1;
obj1.name = JSON.stringify({
zh: this.controlsObj.nickZh,
en: this.controlsObj.nickEn,
ar: this.controlsObj.nickAr,
});
obj1.picUrl = this.controlsObj.imageUrl1;
obj1.enable = this.controlsObj.value2;
obj1.id = this.controlsObj.id;
console.log(1111111111, this.controlsObj.value);
console.log(this.controlsObj.options);
console.log(obj1);
medalSave(obj1).then((res) => {
if (res.code == 200) {
this.getData();
this.controlsDialog = false;
} else {
ElMessage({
showClose: true,
message: res.message,
type: "error",
});
}
});
}
},
//发放按钮
grantFun(val) {
this.grantObjNew = val;
this.grantObj.nick = JSON.parse(val.name).zh;
this.grantDialog = true;
},
// 确认发放
grantOut() {
medalSend({
days: this.grantObj.days,
erbanNoStr: this.grantObj.userId,
medalId: this.grantObjNew.id,
remark: this.grantObj.desc,
}).then((res) => {
if (res.code == 200) {
ElMessage({
showClose: true,
message: res.message || "发放成功",
type: "success",
});
this.grantDialog = false;
} else {
ElMessage({
showClose: true,
message: res.message,
type: "error",
});
}
});
},
partitionFlagFun(num, type) {
//1 2 4
var val = 0;
if (type == 2) {
if (num == 0 || num == 7) {
val = [4, 1, 2];
} else if (num == 1) {
val = [1];
} else if (num == 3) {
val = [1, 2];
} else if (num == 2) {
val = [2];
} else if (num == 6) {
val = [2, 4];
} else if (num == 4) {
val = [4];
}
} else {
if (num == 0 || num == 7) {
val = "华语区、英语区、阿语区";
} else if (num == 1) {
val = "英语区";
} else if (num == 3) {
val = "英语区、阿语区";
} else if (num == 2) {
val = "阿语区";
} else if (num == 6) {
val = "阿语区、华语区";
} else if (num == 4) {
val = "华语区";
}
}
return val;
},
beforeAvatarUpload() {
ElMessage({
showClose: true,
message: "上传中~",
type: "warning",
});
},
handleAvatarError() {
ElMessage({
showClose: true,
message: "上传失败!",
type: "error",
});
},
handleAvatarSuccess(res, file) {
console.log(file);
this.controlsObj.imageUrl1 = file.response.data;
ElMessage({
showClose: true,
message: "上传成功!",
type: "success",
});
},
// 分页导航
handleSizeChange() {
this.getData();
},
handleCurrentChange() {
this.getData();
},
},
};
</script>
<style lang="less" scoped>
.box {
padding-top: 20px;
background: #ecf0f5;
.inquire {
display: inline-block;
margin-right: 20px;
span {
margin-right: 10px;
}
.input {
width: 180px;
margin-right: 10px;
}
}
.dialogTableVisibleBut {
display: block;
margin: 30px 0 0 830px;
}
.paginationClass {
margin: 15px 0 5px 0px;
}
}
</style>

View File

@@ -0,0 +1,363 @@
<template>
<div class="box">
<!-- 查询 -->
<div class="inquire">
<span>勋章ID</span>
<el-input v-model="inquire.id" placeholder="" class="input"></el-input>
</div>
<div class="inquire">
<span>用户平台ID</span>
<el-input
v-model="inquire.userId"
placeholder=""
class="input"
></el-input>
</div>
<!-- 查询按钮 -->
<el-button class="primary" type="primary" @click="getData()">
查询
</el-button>
<el-button class="primary" type="primary" @click="grantDialog = true">
发放勋章
</el-button>
<!-- 表格 -->
<el-table
v-loading="loading"
:data="tableData"
border
style="width: 100%; margin-top: 25px"
>
<el-table-column prop="createTime" align="center" label="发放时间" />
<el-table-column prop="source" align="center" label="发放渠道">
<template v-slot="scope">{{
scope.row.source == 1 ? "管理后台" : scope.row.source
}}</template>
</el-table-column>
<el-table-column prop="id" align="center" label="发放勋章ID" />
<el-table-column prop="medalName" align="center" label="勋章名称" />
<el-table-column align="center" prop="x" label="勋章图片" width="120">
<template v-slot="scope">
<el-image
style="width: 100px; height: 100px"
:src="scope.row.picUrl"
:zoom-rate="1.1"
:preview-src-list="scope.row.picUrl"
fit="cover"
preview-teleported="true"
hide-on-click-modal="true"
/>
</template>
</el-table-column>
<el-table-column prop="x" align="center" label="生效天数">
<template v-slot="scope">{{ scope.row.days }}</template>
</el-table-column>
<el-table-column prop="x" align="center" label="备注">
<template v-slot="scope">{{
scope.row.remark == "" ? "-" : scope.row.remark
}}</template>
</el-table-column>
<el-table-column prop="x" align="center" label="状态">
<template v-slot="scope">{{
scope.row.status == 1
? "生效中"
: scope.row.status == 0
? "已失效"
: "撤销"
}}</template>
</el-table-column>
<el-table-column prop="erbanNo" align="center" label="发放对象平台号" />
<el-table-column prop="nick" align="center" label="发放对象昵称" />
<el-table-column
prop="partitionName"
align="center"
label="发放对象分区"
/>
<el-table-column align="center" label="操作" width="220">
<template v-slot="scope">
<el-button
@click="eidFun(scope.row)"
class="primary"
type="primary"
size="default"
:disabled="scope.row.status <= 0 ? true : false"
>
撤销
</el-button>
</template>
</el-table-column>
</el-table>
<!-- 分页 -->
<el-pagination
style="margin-top: 10px"
class="paginationClass"
v-model:current-page="currentPage"
v-model:page-size="pageSize"
:page-sizes="[10, 20, 30, 40, 50, 100, 200, 300, 400, 500, 999999999]"
layout="sizes, prev, pager, next"
:total="total"
@size-change="handleSizeChange"
@current-change="handleCurrentChange"
/>
<!-- 发放勋章弹窗 -->
<el-dialog
destroy-on-close
class="pub"
v-model="grantDialog"
title="发放勋章"
width="32%"
center
>
<!-- 勋章昵称 -->
<div style="margin-bottom: 25px; margin-top: 10px; display: flex">
<span
style="display: inline-block; margin-right: 20px"
class="col-sm-2 control-label"
>勋章昵称</span
>
<el-select filterable v-model="grantObj.value" placeholder="请选择">
<el-option
v-for="item in grantObj.options"
:key="item.id"
:label="item.name"
:value="item.id"
></el-option>
</el-select>
</div>
<!-- 发放对象平台号 -->
<div style="margin-bottom: 25px; margin-top: 10px; display: flex">
<span
style="display: inline-block; margin-right: 20px"
class="col-sm-2 control-label"
>发放对象平台号</span
>
<el-input
type="textarea"
:rows="2"
v-model="grantObj.userId"
placeholder="多个平台号用英文“,”号分开分隔"
class="input"
></el-input>
</div>
<!-- 发放天数 -->
<div style="margin-bottom: 25px; margin-top: 10px; display: flex">
<span
style="display: inline-block; margin-right: 20px"
class="col-sm-2 control-label"
>发放天数</span
>
<el-input
v-model="grantObj.days"
placeholder="输入天数,不输入则视为无限制"
class="input"
></el-input>
</div>
<!-- 备注 -->
<div style="margin-bottom: 25px; margin-top: 10px; display: flex">
<span
style="display: inline-block; margin-right: 20px"
class="col-sm-2 control-label"
>备注</span
>
<el-input
v-model="grantObj.desc"
placeholder=""
class="input"
></el-input>
</div>
<!-- 弹窗按钮 -->
<template #footer>
<span class="dialog-footer">
<el-button @click="grantDialog = false">取消</el-button>
<el-button type="primary" @click="grantOut()"> 确认 </el-button>
</span>
</template>
</el-dialog>
<!-- 二次确认弹窗 -->
<el-dialog
destroy-on-close
v-model="delDialog"
title="提示"
width="30%"
center
>
<span> 确定要撤销吗?</span>
<template #footer>
<span class="dialog-footer">
<el-button @click="delDialog = false">取消</el-button>
<el-button type="primary" @click="delClick()"> 确认 </el-button>
</span>
</template>
</el-dialog>
</div>
</template>
<script>
import {
medalRecordPage,
listAll,
medalSend,
rollback,
} from "@/api/medal/medal";
// @ts-ignore
import { dateFormat } from "@/utils/system-helper";
// @ts-ignore
import { ElMessage } from "element-plus";
export default {
name: "MedalRecord",
data() {
return {
loading: false,
//查询所需条件对象
inquire: {
id: "",
userId: "",
},
// 表格
tableData: [],
// 分页
total: 10,
currentPage: 1,
pageSize: 10,
// 发放弹窗
grantDialog: false,
grantObj: {
value: "",
options: [],
userId: "",
days: "",
desc: "",
},
// 撤销
delDialog: false,
delObj: {},
};
},
created() {
listAll().then((res) => {
if (res.code == 200) {
this.grantObj.options = res.data;
this.getData();
} else {
ElMessage({
showClose: true,
message: res.message,
type: "error",
});
}
});
},
methods: {
// 查询接口
getData() {
this.loading = true;
medalRecordPage({
medalId: this.inquire.id,
erbanNo: this.inquire.userId,
page: this.currentPage,
pageSize: this.pageSize,
}).then((res) => {
if (res.code == 200) {
this.total = res.data.total;
this.tableData = res.data.records;
this.loading = false;
} else {
ElMessage({
showClose: true,
message: res.message,
type: "error",
});
}
});
},
// 确认发放
grantOut() {
medalSend({
days: this.grantObj.days,
erbanNoStr: this.grantObj.userId,
medalId: this.grantObj.value,
remark: this.grantObj.desc,
}).then((res) => {
if (res.code == 200) {
ElMessage({
showClose: true,
message: res.message || "发放成功",
type: "success",
});
this.grantDialog = false;
this.getData();
} else {
ElMessage({
showClose: true,
message: res.message,
type: "error",
});
}
});
},
// 撤销按钮
eidFun(val) {
this.delObj = val;
this.delDialog = true;
},
// 确认撤销按钮
delClick() {
console.log(this.delObj);
rollback({ recordId: this.delObj.id }).then((res) => {
if (res.code == 200) {
ElMessage({
showClose: true,
message: res.message || "撤销成功",
type: "success",
});
this.getData();
this.delDialog = false;
} else {
ElMessage({
showClose: true,
message: res.message,
type: "error",
});
}
});
},
// 分页导航
handleSizeChange() {
this.getData();
},
handleCurrentChange() {
this.getData();
},
},
};
</script>
<style lang="less" scoped>
.box {
padding-top: 20px;
background: #ecf0f5;
.inquire {
display: inline-block;
margin-right: 20px;
span {
margin-right: 10px;
}
.input {
width: 180px;
margin-right: 10px;
}
}
.dialogTableVisibleBut {
display: block;
margin: 30px 0 0 830px;
}
.paginationClass {
margin: 15px 0 5px 0px;
}
}
</style>

View File

@@ -35,6 +35,7 @@
<el-table-column prop="vipLevel" align="center" label="赠送贵族等级">
<template v-slot="scope">VIP{{ scope.row.vipLevel }}</template>
</el-table-column>
<el-table-column prop="adminName" align="center" label="操作人" />
</el-table>
<!-- 分页 -->
<el-pagination

View File

@@ -0,0 +1,234 @@
<template>
<!-- 表格 -->
<el-table
v-loading="loading"
:data="tableData"
border
style="width: 100%; margin-top: 25px"
>
<el-table-column
prop="appleChargeProdId"
align="center"
label="apple充值档位"
/>
<el-table-column prop="createTime" align="center" label="创建时间" />
<el-table-column
prop="googleChargeProdId"
align="center"
label="google充值档位"
/>
<el-table-column prop="id" align="center" label="主键" />
<el-table-column prop="seqNo" align="center" label="排序" />
<el-table-column prop="showAmount" align="center" label="展示金额" />
<el-table-column prop="tabName" align="center" label="TAB名称">
<template v-slot="scope">
{{ JsonFunc(scope.row.tabName).zh }}
</template>
</el-table-column>
<el-table-column prop="updateTime" align="center" label="更新时间" />
<el-table-column align="center" label="操作">
<template v-slot="scope">
<el-button
@click="
controlsDialog = true;
controlsObjNew = scope.row;
controlsObj.value = controlsObjNew.partitionId;
controlsObj.num = controlsObjNew.showAmount;
"
class="primary"
type="primary"
size="default"
>编辑</el-button
>
</template>
</el-table-column>
</el-table>
<!-- 分页 -->
<el-pagination
style="margin-top: 10px"
class="paginationClass"
v-model:current-page="currentPage"
v-model:page-size="pageSize"
:page-sizes="[10, 20, 30, 40, 50, 100, 200, 300, 400, 500, 999999999]"
layout="sizes, prev, pager, next"
:total="total"
@size-change="handleSizeChange"
@current-change="handleCurrentChange"
/>
<!-- 新增&编辑弹窗 -->
<el-dialog
destroy-on-close
class="pub"
v-model="controlsDialog"
:title="controlsTitle"
width="32%"
center
>
<!-- 地区选择 -->
<div style="margin-bottom: 25px; margin-top: 10px; width: 134%">
<span
style="display: inline-block; margin-right: 20px"
class="col-sm-2 control-label"
>地区选择</span
>
<el-select filterable v-model="controlsObj.value" placeholder="请选择">
<el-option
v-for="item in controlsObj.options"
:key="item.id"
:label="item.desc"
:value="item.id"
>
</el-option>
</el-select>
</div>
<!-- 展示折扣金额 -->
<div style="margin-bottom: 25px; margin-top: 10px; width: 134%">
<span
style="display: inline-block; margin-right: 20px"
class="col-sm-2 control-label"
>展示折扣金额</span
>
<el-input
v-model="controlsObj.num"
placeholder=""
class="input"
style="display: inline-block; width: 36%"
></el-input>
</div>
<!-- 弹窗按钮 -->
<template #footer>
<span class="dialog-footer">
<el-button @click="controlsDialog = false">取消</el-button>
<el-button type="primary" @click="controlsDialogOut()">
确认
</el-button>
</span>
</template>
</el-dialog>
</template>
<script>
import {
weekCardTabList,
listPartitionInfo,
weekCardTabSave,
} from "@/api/weeklyCard/weeklyCard";
import { dateFormat } from "@/utils/system-helper";
import { ElMessage } from "element-plus";
export default {
name: "weekCardGear",
data() {
return {
inquire: {
giftId: "",
userId: "",
time: "",
},
loading: false,
// 表格数据
tableData: [],
// 分页
total: 10, //总页数
currentPage: 1, //页码
pageSize: 10, //条数
// 编辑
controlsDialog: false,
controlsObjNew: false,
controlsObj: {
value: "",
options: [],
num: "",
},
};
},
created() {
this.getData();
listPartitionInfo().then((res) => {
this.controlsObj.options = res.data;
});
},
methods: {
getData() {
this.loading = true;
weekCardTabList({})
.then((res) => {
if (res.code === 200) {
this.tableData = res.data;
} else {
ElMessage({
showClose: true,
message: res.message || "获取数据失败",
type: "error",
});
}
this.loading = false;
})
.catch((error) => {
console.error("请求出错:", error);
ElMessage({
showClose: true,
message: "请求出错,请稍后重试",
type: "error",
});
this.loading = false;
});
},
// 确认编辑按钮
controlsDialogOut() {
weekCardTabSave({
showAmount: this.controlsObj.num,
partitionId: this.controlsObj.value,
id: this.controlsObjNew.id,
}).then((res) => {
if (res.code === 200) {
this.getData();
this.controlsDialog = false;
} else {
ElMessage({
showClose: true,
message: res.message,
type: "error",
});
}
});
},
JsonFunc(val) {
var res = JSON.parse(val);
return res;
},
// 分页导航
handleSizeChange(size) {
this.pageSize = size;
this.getData();
},
handleCurrentChange(page) {
this.currentPage = page;
this.getData();
},
},
};
</script>
<style lang="less" scoped>
.box {
padding-top: 20px;
background: #ecf0f5;
.inquire {
display: inline-block;
margin-right: 20px;
span {
margin-right: 10px;
}
.input {
width: 180px;
margin-right: 10px;
}
}
.paginationClass {
margin: 15px 0 5px 0px;
}
}
</style>

View File

@@ -0,0 +1,841 @@
<template>
<div class="box">
<!-- 查询 -->
<div class="inquire">
<div class="block">
<!-- 地区 -->
<span class="demonstration">地区</span>
<el-select filterable v-model="inquire.value" placeholder="请选择">
<el-option
v-for="item in inquire.options"
:key="item.id"
:label="item.desc"
:value="item.id"
></el-option>
</el-select>
</div>
</div>
<div class="inquire">
<div class="block">
<!-- 地区 -->
<span class="demonstration">周卡栏</span>
<el-select filterable v-model="inquire.value2" placeholder="请选择">
<el-option
v-for="item in inquire.options2"
:key="item.id"
:label="item.desc"
:value="item.id"
></el-option>
</el-select>
</div>
</div>
<!-- 查询按钮 -->
<el-button class="primary" type="primary" @click="getData()"
>查询</el-button
>
<!-- 新增按钮 -->
<el-button class="primary" type="primary" @click="add()">新增</el-button>
</div>
<!-- 表格 -->
<el-table
v-loading="loading"
:data="tableData"
border
style="width: 100%; margin-top: 25px"
>
<el-table-column prop="id" align="center" label="ID" />
<el-table-column prop="groupName" align="center" label="日期" />
<el-table-column prop="rewardType" align="center" label="金币">
<template v-slot="scope">
{{ scope.row.rewardType == 1 ? scope.row.rewardNum : "/" }}
</template>
</el-table-column>
<el-table-column prop="rewardType" align="center" label="礼物类型">
<template v-slot="scope">
{{ rewardTypeNumFun(scope.row.rewardType).name }}
</template>
</el-table-column>
<el-table-column prop="rewardName" align="center" label="礼物名称" />
<el-table-column prop="rewardPrice" align="center" label="礼物价值" />
<el-table-column prop="rewardNum" align="center" label="数量" />
<el-table-column prop="rewardValue" align="center" label="可用天数" />
<el-table-column prop="seqNo" align="center" label="排序" />
<el-table-column
align="center"
prop="cardIcon"
label="卡片ICON"
width="120"
>
<template v-slot="scope">
<el-image
style="width: 100px; height: 100px"
:src="scope.row.cardIcon"
:zoom-rate="1.1"
:preview-src-list="scope.row.cardIcon"
fit="cover"
preview-teleported="true"
hide-on-click-modal="true"
/>
</template>
</el-table-column>
<el-table-column
align="center"
prop="rewardIcon"
label="奖励ICON"
width="120"
>
<template v-slot="scope">
<el-image
style="width: 100px; height: 100px"
:src="scope.row.rewardIcon"
:zoom-rate="1.1"
:preview-src-list="scope.row.rewardIcon"
fit="cover"
preview-teleported="true"
hide-on-click-modal="true"
/>
</template>
</el-table-column>
<el-table-column align="center" label="操作">
<template v-slot="scope">
<el-button
@click="eid(scope)"
class="primary"
type="primary"
size="default"
>编辑</el-button
>
<el-button
@click="
delDialog = true;
delObj = scope.row;
"
:class="scope.row.isEnabled == 1 ? 'danger' : 'primary'"
:type="scope.row.isEnabled == 1 ? 'danger' : 'primary'"
size="default"
>{{ scope.row.isEnabled == 1 ? "下线" : "上线" }}</el-button
>
</template>
</el-table-column>
</el-table>
<!-- 分页 -->
<el-pagination
style="margin-top: 10px"
class="paginationClass"
v-model:current-page="currentPage"
v-model:page-size="pageSize"
:page-sizes="[10, 20, 30, 40, 50, 100, 200, 300, 400, 500, 999999999]"
layout="sizes, prev, pager, next"
:total="total"
@size-change="handleSizeChange"
@current-change="handleCurrentChange"
/>
<!-- 添加和编辑弹窗 -->
<el-dialog
v-model="operationDialog"
:title="operationTitle"
width="30%"
center
>
<!-- 输入日期 -->
<div class="selectBox">
<span class="left" style="margin-right: 20px">输入日期</span>
<el-select filterable v-model="operation.days" placeholder="请选择">
<el-option
v-for="item in operation.optionsDays"
:key="item.id"
:label="item.desc"
:value="item.id"
>
</el-option>
</el-select>
</div>
<!-- 金币数量 -->
<div class="selectBox">
<span class="left" style="margin-right: 20px">金币数量</span>
<el-input
v-model="operation.gameName"
size="default"
placeholder=""
class="right"
style="width: 70%"
></el-input>
</div>
<!-- 游戏icon -->
<div class="selectBox selectBoxImg">
<span class="left" style="margin-right: 20px">金币icon</span>
<el-upload
class="avatar-uploader"
action="/admin/tencent/cos/upload/file"
:show-file-list="false"
:on-success="handleAvatarSuccess"
:before-upload="beforeAvatarUpload"
:on-error="handleAvatarError"
>
<img
v-if="operation.imageUrl1"
:src="operation.imageUrl1"
class="avatar"
/>
<el-icon v-else class="avatar-uploader-icon"><Plus /></el-icon>
</el-upload>
</div>
<!-- 选择礼物类型 -->
<div style="margin-bottom: 25px; margin-top: 10px; width: 134%">
<span
style="display: inline-block; margin-right: 20px"
class="col-sm-2 control-label"
>选择礼物类型</span
>
<el-select
filterable
v-model="operation.value"
@change="optionsChange()"
placeholder="请选择"
>
<el-option
v-for="item in operation.options"
:key="item.id"
:label="item.desc"
:value="item.id"
>
</el-option>
</el-select>
</div>
<!-- 奖励 -->
<div
v-show="operationIsShow"
style="margin-bottom: 25px; margin-top: 10px; width: 134%"
>
<span
style="display: inline-block; margin-right: 20px"
class="col-sm-2 control-label"
>奖励</span
>
<el-select
filterable
v-model="operation.value2"
@change="operationChange(e)"
placeholder="请选择"
>
<el-option
v-for="item in operation.options2"
:key="item.id"
:label="
operation.value == 2
? JsonFunc(item.giftName).zh
: operation.value == 16 || operation.value == 17
? JsonFunc(item.name).zh
: item.name
"
:value="operation.value == 2 ? item.giftId : item.id"
>
<!-- item.name -->
</el-option>
</el-select>
</div>
<!-- 奖励天数 -->
<div v-show="operationIsShow" class="selectBox">
<span class="left" style="margin-right: 20px">奖励天数</span>
<el-input
v-model="operation.rewardDays"
size="default"
placeholder="特权类奖励请输入天数,其他不需要填写"
class="right"
style="width: 70%"
></el-input>
</div>
<!-- 奖励个数v-show="!operationIsShow" -->
<div class="selectBox">
<span class="left" style="margin-right: 20px">奖励个数</span>
<el-input
v-model="operation.rewardGoldNum"
size="default"
placeholder="金币/金币礼物请输入数量"
class="right"
style="width: 70%"
></el-input>
</div>
<!-- 排序 -->
<div class="selectBox">
<span class="left" style="margin-right: 20px">排序</span>
<el-input
v-model="operation.seqNo"
size="default"
placeholder="请输入排序,越小排序越前 "
class="right"
style="width: 70%"
></el-input>
</div>
<!-- 操作 -->
<template #footer>
<span class="dialog-footer">
<el-button @click="operationDialog = false">取消</el-button>
<el-button type="primary" @click="operationClick()"> 确认 </el-button>
</span>
</template>
</el-dialog>
<!-- 二次确认弹窗 -->
<el-dialog
destroy-on-close
v-model="delDialog"
title="提示"
width="30%"
center
>
<span> 确定要进行该操作吗?</span>
<template #footer>
<span class="dialog-footer">
<el-button @click="delDialog = false">取消</el-button>
<el-button type="primary" @click="delClick()"> 确认 </el-button>
</span>
</template>
</el-dialog>
</template>
<script>
import {
listPartitionInfo,
weekCardPage,
getAll,
carAll,
headwearAll,
nameplateAll,
chatbubbleAll,
infocard,
weekCardSave,
updateEnabled,
} from "@/api/weeklyCard/weeklyCard";
import { dateFormat } from "@/utils/system-helper";
import { ElMessage } from "element-plus";
export default {
name: "weekCardSet",
data() {
return {
inquire: {
value: "",
options: [],
value2: "",
value22: "",
options2: [
{ desc: "初级周卡", id: 1 },
{ desc: "中级周卡", id: 2 },
{ desc: "高级周卡", id: 3 },
],
},
giftArr: [],
carArr: [],
headArr: [],
nameplateArr: [],
bubbleArr: [],
cardArr: [],
loading: false,
// 表格数据
tableData: [],
// 分页
total: 10, //总页数
currentPage: 1, //页码
pageSize: 10, //条数
// 编辑
operationDialog: false,
operationType: 1, //1添加2编辑
operationTitle: "编辑&添加",
operatioObj: {},
operation: {
days: "",
optionsDays: [
{ desc: "第一天", id: 1 },
{ desc: "第二天", id: 2 },
{ desc: "第三天", id: 3 },
{ desc: "第四天", id: 4 },
{ desc: "第五天", id: 5 },
{ desc: "第六天", id: 6 },
{ desc: "第七天", id: 7 },
],
gameName: "",
imageUrl1: "",
value: "",
options: [
{ desc: "金币", id: 1 },
{ desc: "礼物", id: 2 },
{ desc: "铭牌", id: 14 },
{ desc: "头饰", id: 4 },
{ desc: "气泡", id: 16 },
{ desc: "资料卡", id: 17 },
{ desc: "座驾", id: 3 },
],
value2: "",
value22: "",
options2: [],
rewardDays: "",
rewardGoldNum: "",
seqNo: "",
},
operationIsShow: true,
// 上下线
delDialog: false,
delObj: {},
};
},
created() {
// this.getData();
listPartitionInfo().then((res) => {
this.inquire.options = res.data;
});
this.loading = true;
getAll().then((res) => {
this.giftArr = res.data;
carAll().then((res) => {
this.carArr = res.data;
headwearAll().then((res) => {
this.headArr = res.data;
nameplateAll().then((res) => {
this.nameplateArr = res.data;
chatbubbleAll().then((res) => {
this.bubbleArr = res.data;
infocard().then((res) => {
this.cardArr = res.data;
this.loading = false;
});
});
});
});
});
});
},
methods: {
// 上线下线
delClick() {
updateEnabled({
weekCardId: this.delObj.id,
isEnabled: !this.delObj.isEnabled == true ? 1 : 2,
}).then((res) => {
if (res.code === 200) {
this.getData();
this.loading = false;
this.delDialog = false;
} else {
ElMessage({
showClose: true,
message: res.message,
type: "error",
});
}
});
},
// 查询
getData() {
this.loading = true;
weekCardPage({
page: this.currentPage,
pageSize: this.pageSize,
partitionId: this.inquire.value,
tabId: this.inquire.value2,
})
.then((res) => {
if (res.code === 200) {
this.tableData = res.data.records;
this.total = res.data.total;
} else {
ElMessage({
showClose: true,
message: res.message || "获取数据失败",
type: "error",
});
}
this.loading = false;
})
.catch((error) => {
console.error("请求出错:", error);
ElMessage({
showClose: true,
message: "请求出错,请稍后重试",
type: "error",
});
});
},
// 监听礼物类型
optionsChange() {
let than = this;
var type = than.operation.value;
than.operation.value2 = "";
if (type) {
than.operationIsShow = true;
if (type == 2) {
//礼物
than.operation.options2 = than.giftArr;
} else if (type == 3) {
//座驾
than.operation.options2 = than.carArr;
} else if (type == 4) {
//头饰
than.operation.options2 = than.headArr;
} else if (type == 14) {
//铭牌
than.operation.options2 = than.nameplateArr;
} else if (type == 16) {
//气泡
than.operation.options2 = than.bubbleArr;
} else if (type == 17) {
//资料卡
than.operation.options2 = than.cardArr;
} else if (type == 1) {
//金币
than.operationIsShow = false;
}
}
},
operationChange() {
this.operation.options2.forEach((res, i) => {
if (this.operation.value == 2) {
if (res.giftId == this.operation.value2) {
this.operation.value22 =
this.operation.value == 2
? this.JsonFunc(res.giftName).zh
: this.operation.value == 16 || this.operation.value == 17
? this.JsonFunc(res.name).zh
: res.name;
}
} else {
if (res.id == this.operation.value2) {
this.operation.value22 =
this.operation.value == 2
? this.JsonFunc(res.giftName).zh
: this.operation.value == 16 || this.operation.value == 17
? this.JsonFunc(res.name).zh
: res.name;
}
}
});
},
// 新增
add() {
this.operation = {
days: "",
optionsDays: [
{ desc: "第一天", id: 1 },
{ desc: "第二天", id: 2 },
{ desc: "第三天", id: 3 },
{ desc: "第四天", id: 4 },
{ desc: "第五天", id: 5 },
{ desc: "第六天", id: 6 },
{ desc: "第七天", id: 7 },
],
gameName: "",
imageUrl1: "",
value: "",
options: [
{ desc: "金币", id: 1 },
{ desc: "礼物", id: 2 },
{ desc: "铭牌", id: 14 },
{ desc: "头饰", id: 4 },
{ desc: "气泡", id: 16 },
{ desc: "资料卡", id: 17 },
{ desc: "座驾", id: 3 },
],
value2: "",
options2: [],
rewardDays: "",
rewardGoldNum: "",
seqNo: "",
};
this.operationType = 1;
this.operationTitle = "添加";
this.operationDialog = true;
},
// 编辑
eid(scope) {
this.operationDialog = true;
this.operatioObj = scope.row;
this.operation = {
days: this.operatioObj.groupId,
optionsDays: [
{ desc: "第一天", id: 1 },
{ desc: "第二天", id: 2 },
{ desc: "第三天", id: 3 },
{ desc: "第四天", id: 4 },
{ desc: "第五天", id: 5 },
{ desc: "第六天", id: 6 },
{ desc: "第七天", id: 7 },
],
gameName: this.operatioObj.rewardValue,
imageUrl1: this.operatioObj.cardIcon,
value: this.operatioObj.rewardType,
options: [
{ desc: "金币", id: 1 },
{ desc: "礼物", id: 2 },
{ desc: "铭牌", id: 14 },
{ desc: "头饰", id: 4 },
{ desc: "气泡", id: 16 },
{ desc: "资料卡", id: 17 },
{ desc: "座驾", id: 3 },
],
value2: this.operatioObj.rewardId,
options2:
this.operatioObj.rewardType == 2
? this.giftArr
: this.operatioObj.rewardType == 3
? this.carArr
: this.operatioObj.rewardType == 4
? this.headArr
: this.operatioObj.rewardType == 14
? this.nameplateArr
: this.operatioObj.rewardType == 16
? this.bubbleArr
: this.operatioObj.rewardType == 17
? this.cardArr
: "",
rewardDays: this.operatioObj.rewardValue,
rewardGoldNum: this.operatioObj.rewardNum,
seqNo: this.operatioObj.seqNo,
};
this.operationType = 2;
this.operationTitle = "编辑";
this.operationDialog = true;
},
// 确认按钮
operationClick() {
if (this.operationType == 1) {
// 新增
weekCardSave({
groupId: this.operation.days,
groupName:
this.operation.days == 1
? "第一天"
: this.operation.days == 2
? "第二天"
: this.operation.days == 3
? "第三天"
: this.operation.days == 4
? "第四天"
: this.operation.days == 5
? "第五天"
: this.operation.days == 6
? "第六天"
: "第七天",
rewardPrice: this.operation.gameName,
cardIcon: this.operation.imageUrl1,
rewardType: this.operation.value,
rewardId: this.operation.value2,
rewardName: this.operation.value22,
rewardNum: this.operation.rewardGoldNum,
seqNo: this.operation.seqNo,
partitionId: this.inquire.value1,
tabId: this.inquire.value2,
})
.then((res) => {
if (res.code === 200) {
this.operationDialog = false;
this.getData();
this.loading = false;
} else {
ElMessage({
showClose: true,
message: res.message || "获取数据失败",
type: "error",
});
}
})
.catch((error) => {
console.error("请求出错:", error);
ElMessage({
showClose: true,
message: "请求出错,请稍后重试",
type: "error",
});
});
} else {
// 编辑
weekCardSave({
groupId: this.operation.days,
groupName:
this.operation.days == 1
? "第一天"
: this.operation.days == 2
? "第二天"
: this.operation.days == 3
? "第三天"
: this.operation.days == 4
? "第四天"
: this.operation.days == 5
? "第五天"
: this.operation.days == 6
? "第六天"
: "第七天",
rewardPrice: this.operation.gameName,
cardIcon: this.operation.imageUrl1,
rewardType: this.operation.value,
rewardId: this.operation.value2,
rewardName: this.operation.value22,
rewardNum: this.operation.rewardGoldNum,
seqNo: this.operation.seqNo,
id: this.operatioObj.id,
partitionId: this.inquire.value1,
tabId: this.inquire.value2,
})
.then((res) => {
if (res.code === 200) {
this.getData();
this.operationDialog = false;
this.loading = false;
} else {
ElMessage({
showClose: true,
message: res.message || "获取数据失败",
type: "error",
});
}
})
.catch((error) => {
console.error("请求出错:", error);
ElMessage({
showClose: true,
message: "请求出错,请稍后重试",
type: "error",
});
});
}
},
// 单位判断
rewardTypeNumFun(num) {
if (num == 1) {
return { name: "金币", unit: "个" };
} else if (num == 2) {
return { name: "礼物", unit: "个" };
} else if (num == 3) {
return { name: "座驾", unit: "天" };
} else if (num == 4) {
return { name: "头饰", unit: "天" };
} else if (num == 5) {
return { name: "背景", unit: "天" };
} else if (num == 6) {
return { name: "实物", unit: "个" };
} else if (num == 7) {
return { name: "靓号", unit: "天" };
} else if (num == 8) {
return { name: "全麦礼物", unit: "个" };
} else if (num == 9) {
return { name: "随机靓号", unit: "天" };
} else if (num == 10) {
return { name: "锤子", unit: "个" };
} else if (num == 13) {
return { name: "祝福语", unit: "天" };
} else if (num == 14) {
return { name: "铭牌", unit: "天" };
} else if (num == 15) {
return { name: "虚拟货币", unit: "个" };
} else if (num == 16) {
return { name: "聊天气泡", unit: "天" };
} else if (num == 17) {
return { name: "资料卡", unit: "天" };
} else {
return { name: "null", unit: "null" };
}
},
beforeAvatarUpload() {
ElMessage({
showClose: true,
message: "上传中~",
type: "warning",
});
},
handleAvatarError() {
ElMessage({
showClose: true,
message: "上传失败!",
type: "error",
});
},
handleAvatarSuccess(res, file) {
console.log(file);
// this.operation.imageUrl1 = URL.createObjectURL();
this.operation.imageUrl1 = file.response.data;
ElMessage({
showClose: true,
message: "上传成功!",
type: "success",
});
},
// 分页导航
handleSizeChange(size) {
this.pageSize = size;
this.getData();
this.loading = false;
},
handleCurrentChange(page) {
this.currentPage = page;
this.getData();
this.loading = false;
},
JsonFunc(val) {
var res = JSON.parse(val);
return res;
},
},
};
</script>
<style lang="less" scoped>
.box {
padding-top: 20px;
background: #ecf0f5;
.inquire {
display: inline-block;
margin-right: 20px;
span {
margin-right: 10px;
}
.input {
width: 180px;
margin-right: 10px;
}
}
.paginationClass {
margin: 15px 0 5px 0px;
}
}
</style>
<style scoped>
.avatar-uploader .avatar {
width: 178px;
height: 178px;
display: block;
}
.selectBox {
display: flex;
height: 35px;
line-height: 35px;
margin-bottom: 20px;
}
.selectBox span {
min-width: 80px;
}
.selectBoxImg {
height: 150px;
}
</style>
<style>
.avatar-uploader .el-upload {
border: 1px dashed var(--el-border-color);
border-radius: 6px;
cursor: pointer;
position: relative;
overflow: hidden;
transition: var(--el-transition-duration-fast);
width: 150px;
height: 150px;
}
.avatar-uploader .el-upload .el-upload__input {
display: none;
}
.avatar-uploader .el-upload:hover {
border-color: var(--el-color-primary);
}
</style>

View File

@@ -0,0 +1,293 @@
<template>
<div class="box">
<!-- 查询 -->
<div class="inquire">
<div class="block">
<!-- 地区 -->
<span class="demonstration">地区</span>
<el-select filterable v-model="inquire.value" placeholder="请选择">
<el-option
v-for="item in inquire.options"
:key="item.id"
:label="item.desc"
:value="item.id"
></el-option>
</el-select>
</div>
</div>
<!-- 时间选择器 -->
<div class="inquire">
<div class="block">
<span class="demonstration">日期</span>
<el-date-picker
v-model="inquire.time"
type="datetimerange"
range-separator=""
start-placeholder="开始日期"
end-placeholder="结束日期"
></el-date-picker>
</div>
</div>
<!-- 查询按钮 -->
<el-button class="primary" type="primary" @click="getData()"
>查询</el-button
>
<!-- 导出按钮 -->
<el-button class="primary" type="primary" @click="derive()">导出</el-button>
</div>
<!-- 表格 -->
<el-table
v-loading="loading"
:data="tableData"
border
style="width: 100%; margin-top: 25px"
>
<el-table-column prop="dateTime" align="center" label="日期" />
<el-table-column prop="userNum1" align="center" label="初级周卡获得人数" />
<el-table-column prop="userNum2" align="center" label="中级周卡获得人数" />
<el-table-column prop="userNum3" align="center" label="高级周卡获得人数" />
<el-table-column prop="chargeAmount" align="center" label="充值金额" />
<el-table-column align="center" label="操作">
<template v-slot="scope">
<el-button
@click="detial(scope.row)"
class="primary"
type="primary"
size="default"
>详情</el-button
>
</template>
</el-table-column>
</el-table>
<!-- 分页 -->
<el-pagination
style="margin-top: 10px"
class="paginationClass"
v-model:current-page="currentPage"
v-model:page-size="pageSize"
:page-sizes="[10, 20, 30, 40, 50, 100, 200, 300, 400, 500, 999999999]"
layout="sizes, prev, pager, next"
:total="total"
@size-change="handleSizeChange"
@current-change="handleCurrentChange"
/>
<!-- 详情弹窗 -->
<el-dialog
destroy-on-close
class="pub"
v-model="controlsDialog"
title="详情"
width="32%"
center
>
<!-- 内表格 -->
<el-table
v-loading="loading2"
:data="tableData2"
border
style="width: 100%; margin-top: 25px"
>
<el-table-column prop="erBanNo" align="center" label="用户ID" />
<el-table-column prop="nick" align="center" label="用户昵称" />
<el-table-column prop="tabName" align="center" label="购买档位" />
<el-table-column prop="chargeAmount" align="center" label="购买金额" />
<el-table-column prop="createTimeStr" align="center" label="购买时间" />
</el-table>
<!-- 分页 -->
<el-pagination
style="margin-top: 10px"
class="paginationClass"
v-model:current-page="currentPage2"
v-model:page-size="pageSize2"
:page-sizes="[10, 20, 30, 40, 50, 100, 200, 300, 400, 500, 999999999]"
layout="sizes, prev, pager, next"
:total="total"
@size-change="handleSizeChange2"
@current-change="handleCurrentChange2"
/>
<!-- 弹窗按钮 -->
<template #footer>
<span class="dialog-footer">
<el-button @click="controlsDialog = false">关闭</el-button>
</span>
</template>
</el-dialog>
</template>
<script>
import {
weekCardRecordPage,
listPartitionInfo,
weekCardRecordExport,
weekCardRecordGetDetailPage,
} from "@/api/weeklyCard/weeklyCard";
import { dateFormat } from "@/utils/system-helper";
import { ElMessage } from "element-plus";
export default {
name: "weekCardStatistics",
data() {
return {
inquire: {
time: "",
value: "",
options: [],
},
loading: false,
loading2: false,
// 表格数据
tableData: [],
tableData2: [],
// 分页
total: 10, //总页数
currentPage: 1, //页码
pageSize: 10, //条数
// 分页2
total2: 10, //总页数
currentPage2: 1, //页码
pageSize2: 10, //条数
// 编辑
controlsDialog: false,
controlsObjNew: false,
controlsObj: {
value: "",
options: [],
num: "",
},
};
},
created() {
this.getData();
listPartitionInfo().then((res) => {
this.inquire.options = res.data;
});
},
methods: {
getData() {
this.loading = true;
let startTime = "";
let endTime = "";
if (this.inquire.time && this.inquire.time.length > 0) {
startTime = dateFormat(this.inquire.time[0], "yyyy-MM-dd hh:mm:ss");
endTime = dateFormat(this.inquire.time[1], "yyyy-MM-dd hh:mm:ss");
}
this.loading = true;
weekCardRecordPage({
startTime,
endTime,
partitionId: this.inquire.value,
pageSize: this.pageSize,
page: this.currentPage,
})
.then((res) => {
if (res.code === 200) {
this.tableData = res.data.records;
this.total = res.data.total;
} else {
ElMessage({
showClose: true,
message: res.message || "获取数据失败",
type: "error",
});
}
this.loading = false;
})
.catch((error) => {
console.error("请求出错:", error);
ElMessage({
showClose: true,
message: "请求出错,请稍后重试",
type: "error",
});
this.loading = false;
});
},
derive() {
let startTime = "";
let endTime = "";
if (this.inquire.time && this.inquire.time.length > 0) {
startTime = dateFormat(this.inquire.time[0], "yyyy-MM-dd hh:mm:ss");
endTime = dateFormat(this.inquire.time[1], "yyyy-MM-dd hh:mm:ss");
}
weekCardRecordExport({
startTime,
endTime,
partitionId: this.inquire.value,
}).then((res) => {});
},
detial(val) {
weekCardRecordGetDetailPage({
page: this.currentPage2,
pageSize: this.pageSize2,
dateTime: val.createTimeStr,
partitionId: this.inquire.value,
})
.then((res) => {
if (res.code === 200) {
this.tableData2 = res.data.records;
this.total2 = res.data.total;
} else {
ElMessage({
showClose: true,
message: res.message || "获取数据失败",
type: "error",
});
}
this.controlsDialog = true;
this.loading2 = false;
})
.catch((error) => {
console.error("请求出错:", error);
ElMessage({
showClose: true,
message: "请求出错,请稍后重试",
type: "error",
});
this.loading2 = false;
});
},
// 分页导航
handleSizeChange2(size) {
this.pageSize2 = size;
this.getData();
},
handleCurrentChange2(page) {
this.currentPage2 = page;
this.getData();
},
// 分页导航
handleSizeChange(size) {
this.pageSize = size;
this.getData();
},
handleCurrentChange(page) {
this.currentPage = page;
this.getData();
},
},
};
</script>
<style lang="less" scoped>
.box {
padding-top: 20px;
background: #ecf0f5;
.inquire {
display: inline-block;
margin-right: 20px;
span {
margin-right: 10px;
}
.input {
width: 180px;
margin-right: 10px;
}
}
.paginationClass {
margin: 15px 0 5px 0px;
}
}
</style>