Compare commits

...

4 Commits

Author SHA1 Message Date
dragon
6067064351 修复全平台消耗详情弹窗异常问题 2025-02-11 14:48:02 +08:00
dragon
51912a1e24 完成每日金币统计 2025-02-10 15:16:45 +08:00
dragon
e10f249e4e 每日金币暂存 2025-02-08 14:54:06 +08:00
dragon
99d2c67087 修复赠送按钮失效问题 2025-02-08 14:53:14 +08:00
3 changed files with 314 additions and 0 deletions

View File

@@ -0,0 +1,13 @@
import request from '@/utils/request';
import qs from 'qs';
import { genQueryParam } from '@/utils/maintainer';
// ==================================每日数据====================================
// 列表
export const diamondStatList = query => {
return request({
url: '/admin/diamondStat/list',
method: 'get',
params: query
});
};

View File

@@ -0,0 +1,300 @@
<template>
<div class="outer">
<!-- 查询 -->
<div class="inquire">
<div class="block">
<span class="demonstration">开始时间</span>
<el-date-picker
v-model="inquire.time[0]"
type="datetime"
placeholder="开始时间"
>
</el-date-picker>
</div>
</div>
<div class="inquire">
<div class="block">
<span class="demonstration">结束时间</span>
<el-date-picker
v-model="inquire.time[1]"
type="datetime"
placeholder="结束时间"
>
</el-date-picker>
</div>
</div>
<!-- 查询按钮 -->
<el-button style="" type="primary" @click="getData()">查询</el-button>
<!-- <el-button style="" type="primary" @click="exportDate()">导出</el-button> -->
</div>
<!-- 表格 -->
<el-table
v-loading="loading"
:data="tableData"
border
style="width: 100%; margin-top: 25px"
>
<el-table-column prop="date" align="center" label="日期" />
<el-table-column align="center" label="全平台真实消耗" width="">
<template v-slot="scope">
<el-button
@click="
detailsTitle = '全平台金币明细';
edi(scope.row, 0);
"
type="text"
size="small"
>
{{ scope.row.totalDiamond }}
</el-button>
</template>
</el-table-column>
<el-table-column align="center" label="阿拉伯区真实消耗" width="">
<template v-slot="scope">
<el-button
@click="
detailsTitle = '阿拉伯区金币明细';
edi(scope.row, 2);
"
type="text"
size="small"
>
{{ scope.row.arDiamond }}
</el-button>
</template>
</el-table-column>
<el-table-column align="center" label="英语区真实消耗" width="">
<template v-slot="scope">
<el-button
@click="
detailsTitle = '英语区金币明细';
edi(scope.row, 1);
"
type="text"
size="small"
>
{{ scope.row.enDiamond }}
</el-button>
</template>
</el-table-column>
<el-table-column align="center" label="华语区真实消耗" width="">
<template v-slot="scope">
<el-button
@click="
detailsTitle = '华语区金币明细';
edi(scope.row, 4);
"
type="text"
size="small"
>
{{ scope.row.zhDiamond }}
</el-button>
</template>
</el-table-column>
<el-table-column align="center" label="土耳其区真实消耗" width="">
<template v-slot="scope">
<el-button
@click="
detailsTitle = '土耳其区金币明细';
edi(scope.row, 8);
"
type="text"
size="small"
>
{{ scope.row.trDiamond }}
</el-button>
</template>
</el-table-column>
<el-table-column
prop="totalRemainDiamond"
align="center"
label="全平台库存"
/>
<el-table-column
prop="arRemainDiamond"
align="center"
label="阿拉伯区库存"
/>
<el-table-column prop="enRemainDiamond" align="center" label="英语区库存" />
<el-table-column prop="zhRemainDiamond" align="center" label="华语区库存" />
<el-table-column
prop="trRemainDiamond"
align="center"
label="土耳其区库存"
/>
</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="detailsDialog" :title="detailsTitle" width="30%" center>
<!-- 内表格 -->
<el-table
v-loading="loading"
:data="tableDataIn"
border
style="width: 100%; margin-top: 25px"
>
<el-table-column prop="domainDesc" align="center" label="类型" />
<el-table-column prop="addDiamond" align="center" label="增加" />
<el-table-column prop="subDiamond" align="center" label="消耗" />
</el-table>
<!-- 操作 -->
<template #footer>
<span class="dialog-footer">
<el-button type="primary" class="primary" @click="detailsDialog = false"
>关闭</el-button
>
</span>
</template>
</el-dialog>
</template>
<script>
import { diamondStatList } from "@/api/dailyCoinStatistics/dailyCoinStatistics";
import { dateFormat } from "@/utils/system-helper";
import { ElMessage } from "element-plus";
export default {
name: "dailyCoinStatistics",
data() {
return {
loading: false,
// 查询条件
inquire: {
time: [],
},
// 表格
tableData: [{ x: "x" }],
// 分页
total: 10, //总页数
currentPage: 1, //页码
pageSize: 10, //条数
// 内表格
detailsDialog: false,
detailsTitle: "金币明细",
tableDataIn: [],
};
},
created() {
// this.getData();
},
methods: {
// 查询
getData() {
this.loading = true;
let time = this.inquire.time;
let startTime = null;
let endTime = null;
if (time.length > 0) {
startTime = this.inquire.time[0]
? dateFormat(this.inquire.time[0], "yyyy-MM-dd hh:mm:ss")
: null;
endTime = this.inquire.time[1]
? dateFormat(this.inquire.time[1], "yyyy-MM-dd hh:mm:ss")
: null;
}
diamondStatList({
startDate: startTime,
endDate: endTime,
// pageNo: this.currentPage,
// pageSize: this.pageSize,
}).then((res) => {
if (res.code == 200) {
// this.total = res.data.total;
this.tableData = res.data;
this.loading = false;
} else {
ElMessage({
showClose: true,
message: res.message,
type: "error",
});
}
});
},
// 详情
edi(res, type) {
var jsonArr =
type == 0
? res.totalDiamondDetail
: type == 1
? res.enDomainDetail
: type == 2
? res.arDomainDetail
: type == 4
? res.zhDomainDetail
: type == 8
? res.trDomainDetail
: `"[""]"`;
console.log(jsonArr);
this.tableDataIn = JSON.parse(jsonArr);
this.detailsDialog = true;
},
// 分页导航
handleSizeChange() {
this.getData();
},
handleCurrentChange() {
this.getData();
},
},
};
</script>
<style lang="less" scoped>
.outer {
padding-top: 20px;
background: #ecf0f5;
border-top: 3px solid #d2d6de;
.demonstration {
margin-right: 20px;
}
.inquire {
display: flex;
justify-content: space-between;
white-space: nowrap;
float: left;
margin-right: 20px;
}
.search {
width: 100%;
height: 41px;
.searchLeft,
.searchRight {
width: 20%;
float: left;
span {
margin-right: 10px;
}
.input {
width: 75%;
}
}
}
.buttonBox {
margin-top: 10px;
}
.authorityBox {
.authoritySpan {
margin-right: 20px;
}
.authorityInpput {
width: 50%;
}
}
.dialogTableVisibleBut {
margin: -25px 0 20px 0px;
}
}
</style>

View File

@@ -181,6 +181,7 @@ export default {
methods: { methods: {
// 查询接口 // 查询接口
getData() { getData() {
this.butClick = false;
console.log(dateFormat(this.inquire.time, "yyyy-MM-dd")); console.log(dateFormat(this.inquire.time, "yyyy-MM-dd"));
if (!this.inquire.time && this.inquire.userId == '') { if (!this.inquire.time && this.inquire.userId == '') {
ElMessage({ ElMessage({