diff --git a/vue/gold-system/src/views/audit/rechargeAudit.vue b/vue/gold-system/src/views/audit/rechargeAudit.vue
index 42a0ced..e01a40d 100644
--- a/vue/gold-system/src/views/audit/rechargeAudit.vue
+++ b/vue/gold-system/src/views/audit/rechargeAudit.vue
@@ -205,8 +205,8 @@ const adminReject = function () {
rechargeVo.value.status = 2;
getObj.value.pageNum = 1;
get();
- console.log('adminReject');
-}
+ console.log("adminReject");
+};
//点击标签页
const handleClick = function (tab, event) {
if (tab.props.name === "all") {
@@ -215,7 +215,7 @@ const handleClick = function (tab, event) {
adminWait();
} else if (tab.props.name === "pass") {
adminPass();
- } else if (tab.props.name === 'reject') {
+ } else if (tab.props.name === "reject") {
adminReject();
}
};
@@ -270,6 +270,7 @@ const checkNumber = function () {
getObj.value.pageNum <= Math.ceil(total.value / getObj.value.pageSize)
) {
console.log("输入的数字合法");
+
get();
} else {
//提示
@@ -399,26 +400,57 @@ onMounted(async function () {
活动名称:
-
-
+
+
充值方式:
-
-
+
+
所属地区:
-
-
+
+
@@ -427,9 +459,16 @@ onMounted(async function () {
充值时间:
-
- 今
+
+ 今
昨
近7天
@@ -447,7 +486,12 @@ onMounted(async function () {
-
+
@@ -458,16 +502,41 @@ onMounted(async function () {
-
-
-
+
+
+
-
+
-
+
-
+
@@ -493,7 +562,12 @@ onMounted(async function () {
-
+
{{
@@ -502,15 +576,29 @@ onMounted(async function () {
-
+
-
+
-
+
通过
@@ -521,10 +609,16 @@ onMounted(async function () {
-
+
驳回
@@ -535,17 +629,42 @@ onMounted(async function () {
@@ -554,12 +673,29 @@ onMounted(async function () {
-
+
-
+
-
+
diff --git a/vue/gold-system/src/views/consume/addConsume.vue b/vue/gold-system/src/views/consume/addConsume.vue
index 712d16e..5e62437 100644
--- a/vue/gold-system/src/views/consume/addConsume.vue
+++ b/vue/gold-system/src/views/consume/addConsume.vue
@@ -38,7 +38,7 @@ const add = async function () {
try {
// 发送POST请求
const result = await API.post(
- "http://192.168.8.93:10010/consume/add",
+ "http://192.168.8.147:10010/consume/add",
addConsume.value
);
if (result.code === 0) {
@@ -182,53 +182,71 @@ getGoods();
const userGold = ref({});
const getUserGold = async function (jwcode) {
try {
- const result = await API.post(
- "http://192.168.8.93:10010/statistics/getMess/" + jwcode,
- {}
- );
- if (result.code === 0) {
- addConsume.value.jwcode = "";
- ElMessage.error(result.msg);
- return;
- console.log("查询失败,请检查精网号是否正确");
- }
+ // 发送POST请求
+ const result = await API.post("http://192.168.8.93:10010/recharge/user", {
+ jwcode: jwcode,
+ });
+ // 将响应结果存储到响应式数据中
console.log("请求成功", result);
- // 存储全部数据
- userGold.value = result.data;
- console.log("userGold", userGold.value);
+ // 存储表格数据
+ userGold.value = result.data[0];
+ if (result.data.code === 0) {
+ ElMessage.error("查询失败,请检查精网号是否正确");
+ } else {
+ ElMessage.success("查询成功");
+ }
} catch (error) {
console.log("请求失败", error);
+ ElMessage.error("查询失败,请检查精网号是否正确");
+ // 在这里可以处理错误逻辑,比如显示错误提示等
}
};
function calculateCoins() {
- // 保存原始的allGold值
- const originalAllGold = addConsume.value.allGold;
+ if (
+ userGold.value.coreJb +
+ userGold.value.free6 +
+ userGold.value.free12 +
+ userGold.value.buyJb <
+ addConsume.value.allGold
+ ) {
+ addConsume.value.allGold = 0;
+ addConsume.value.taskCoin = 0;
+ addConsume.value.freeCoin = 0;
+ addConsume.value.rechargeCoin = 0;
+ ElMessage.error("金币不足,请充值");
+ return;
+ } else {
+ // 保存原始的allGold值
+ const originalAllGold = addConsume.value.allGold;
- // 确保todayTask和todayFree是有效的数字
- const todayTask =
- typeof userGold.value.todayTask === "number" ? userGold.value.todayTask : 0;
- const todayFree =
- typeof userGold.value.todayFree === "number" ? userGold.value.todayFree : 0;
+ // 确保todayTask和todayFree是有效的数字
+ const todayTask =
+ typeof userGold.value.coreJb === "number" ? userGold.value.coreJb : 0;
+ const todayFree =
+ typeof (userGold.value.free6 + userGold.value.free12) === "number"
+ ? userGold.value.free6 + userGold.value.free12
+ : 0;
- // 根据用户输入的消费金币总数和已有的金币数量进行计算
- addConsume.value.taskCoin = Math.min(originalAllGold, todayTask);
- let remainingGold = originalAllGold - addConsume.value.taskCoin;
+ // 根据用户输入的消费金币总数和已有的金币数量进行计算
+ addConsume.value.taskCoin = Math.min(originalAllGold, todayTask);
+ let remainingGold = originalAllGold - addConsume.value.taskCoin;
- addConsume.value.freeCoin = Math.min(remainingGold, todayFree);
- remainingGold -= addConsume.value.freeCoin;
+ addConsume.value.freeCoin = Math.min(remainingGold, todayFree);
+ remainingGold -= addConsume.value.freeCoin;
- addConsume.value.rechargeCoin = remainingGold; // 剩余的都算作充值金币
+ addConsume.value.rechargeCoin = remainingGold; // 剩余的都算作充值金币
- // 恢复allGold的原始值
- addConsume.value.allGold = originalAllGold;
+ // 恢复allGold的原始值
+ addConsume.value.allGold = originalAllGold;
- // 确保taskCoin, freeCoin, rechargeCoin不是NaN,如果是,则设置为0
- if (isNaN(addConsume.value.taskCoin)) addConsume.value.taskCoin = 0;
- if (isNaN(addConsume.value.freeCoin)) addConsume.value.freeCoin = 0;
- if (isNaN(addConsume.value.rechargeCoin)) addConsume.value.rechargeCoin = 0;
+ // 确保taskCoin, freeCoin, rechargeCoin不是NaN,如果是,则设置为0
+ if (isNaN(addConsume.value.taskCoin)) addConsume.value.taskCoin = 0;
+ if (isNaN(addConsume.value.freeCoin)) addConsume.value.freeCoin = 0;
+ if (isNaN(addConsume.value.rechargeCoin)) addConsume.value.rechargeCoin = 0;
- console.log("计算结果", addConsume.value);
+ console.log("计算结果", addConsume.value);
+ }
}
diff --git a/vue/gold-system/src/views/workspace/index.vue b/vue/gold-system/src/views/workspace/index.vue
index 744d851..cfb0fe3 100644
--- a/vue/gold-system/src/views/workspace/index.vue
+++ b/vue/gold-system/src/views/workspace/index.vue
@@ -37,7 +37,7 @@ const consumeMonthTask = ref([]);
// 地区排名
const getAreaRankObj = ref({
- updateType: "充值"
+ updateType: "充值",
});
const getMediumArea = ref([]);
const areaRank = ref([]);
@@ -85,7 +85,6 @@ const list = ref([]);
// 搜索方法
const get = async function () {
try {
-
getAreaRank();
// 发送POST请求
const result1 = await API.post(
@@ -205,7 +204,6 @@ const get = async function () {
console.log("consumeTotalFree", consumeTotalFree.value);
console.log("consumeTotalTask", consumeTotalTask.value);
-
option3Data.value = [
{
value: Math.abs(statistics.value.rechargeSumCoin),
@@ -279,13 +277,13 @@ const get = async function () {
ERPData.value.forEach((item, index) =>
item == ""
? (ERPData.value[index] = {
- value: 0,
- name: "第" + (index + 1) + "学科",
- })
+ value: 0,
+ name: "第" + (index + 1) + "学科" + 0,
+ })
: (ERPData.value[index] = {
- value: item[0],
- name: "第" + (index + 1) + "学科",
- })
+ value: item[0],
+ name: "第" + (index + 1) + "学科" + item[0],
+ })
);
console.log("ERPData", ERPData.value);
HCData.value = [
@@ -305,13 +303,13 @@ const get = async function () {
HCData.value.forEach((item, index) =>
item == ""
? (HCData.value[index] = {
- value: 0,
- name: "第" + (index + 1) + "学科",
- })
+ value: 0,
+ name: "第" + (index + 1) + "学科" + 0,
+ })
: (HCData.value[index] = {
- value: item[0],
- name: "第" + (index + 1) + "学科",
- })
+ value: item[0],
+ name: "第" + (index + 1) + "学科" + item[0],
+ })
);
console.log("HCData", HCData.value);
LinkData.value = [
@@ -331,13 +329,13 @@ const get = async function () {
LinkData.value.forEach((item, index) =>
item == ""
? (LinkData.value[index] = {
- value: 0,
- name: "第" + (index + 1) + "学科",
- })
+ value: 0,
+ name: "第" + (index + 1) + "学科" + 0,
+ })
: (LinkData.value[index] = {
- value: item[0],
- name: "第" + (index + 1) + "学科",
- })
+ value: item[0],
+ name: "第" + (index + 1) + "学科" + item[0],
+ })
);
console.log("LinkData", LinkData.value);
goldData.value = [
@@ -357,13 +355,13 @@ const get = async function () {
goldData.value.forEach((item, index) =>
item == ""
? (goldData.value[index] = {
- value: 0,
- name: "第" + (index + 1) + "学科",
- })
+ value: 0,
+ name: "第" + (index + 1) + "学科" + 0,
+ })
: (goldData.value[index] = {
- value: item[0],
- name: "第" + (index + 1) + "学科",
- })
+ value: item[0],
+ name: "第" + (index + 1) + "学科" + item[0],
+ })
);
console.log("goldData", goldData.value);
allData.value = [
@@ -441,30 +439,30 @@ const getAreaRank = async function () {
console.log("getMediumArea", getMediumArea.value);
- if (getAreaRankObj.value.type == '充值金币') {
+ if (getAreaRankObj.value.type == "充值金币") {
areaRank.value = getMediumArea.value.map((item) => ({
value: Math.abs(item.rechargeSumCoin),
- name: item.area + '-' + item.store,
+ name: item.area + "-" + item.store,
}));
- } else if (getAreaRankObj.value.type == '免费金币') {
+ } else if (getAreaRankObj.value.type == "免费金币") {
areaRank.value = getMediumArea.value.map((item) => ({
value: Math.abs(item.freeSumCoin),
- name: item.area + '-' + item.store,
+ name: item.area + "-" + item.store,
}));
- } else if (getAreaRankObj.value.type == '任务金币') {
+ } else if (getAreaRankObj.value.type == "任务金币") {
areaRank.value = getMediumArea.value.map((item) => ({
value: Math.abs(item.taskSumCoin),
- name: item.area + '-' + item.store,
+ name: item.area + "-" + item.store,
}));
} else {
areaRank.value = getMediumArea.value.map((item) => ({
value: Math.abs(item.totalRechargeSum),
- name: item.area + '-' + item.store,
+ name: item.area + "-" + item.store,
}));
}
console.log("areaRank", areaRank.value);
-}
+};
// 金币类型
@@ -476,7 +474,7 @@ const findBsComponent = function (index) {
iconName = `bs.Bs${index + 1}Circle`; // 根据index拼接图标名称
}
return eval(iconName); // 动态执行图标名称,返回图标组件
-}
+};
// 门店排名下拉框
const changeGoldType = function () {
console.log("changeGoldType", goldType.value);
@@ -493,16 +491,15 @@ const changeGoldType = function () {
};
// 点击标签页初始化
const handleChange = function () {
- if (activeName.value == 'recharge') {
- getAreaRankObj.value.updateType = '充值';
-
+ if (activeName.value == "recharge") {
+ getAreaRankObj.value.updateType = "充值";
} else {
- getAreaRankObj.value.updateType = '消费';
+ getAreaRankObj.value.updateType = "消费";
}
getAreaRankObj.value.type = "";
goldType.value = "全部类型";
getAreaRank();
-}
+};
// 切换平台
const changePlatform = function () {
console.log("changePlatform", platform.value);
@@ -764,7 +761,7 @@ onMounted(async function () {
const option3 = {
tooltip: {
trigger: "item",
- position: ['15%', '-3%']
+ position: ["15%", "-3%"],
},
legend: {
bottom: "-2%",
@@ -800,7 +797,7 @@ onMounted(async function () {
const option4 = {
tooltip: {
trigger: "item",
- position: ['15%', '-3%']
+ position: ["15%", "-3%"],
},
legend: {
bottom: "-2%",
@@ -841,7 +838,7 @@ onMounted(async function () {
const option5 = {
tooltip: {
trigger: "item",
- position: ['15%', '-3%']
+ position: ["15%", "-3%"],
},
legend: {
bottom: "-2%",
@@ -909,26 +906,37 @@ onMounted(async function () {
较前一天 {{ formatNum(getSumCoin.coinDifference) }}
-
+
较前一天 {{ formatNum(getSumCoin.coinDifference) }}
-
+
较前一天 {{ formatNum(getSumCoin.coinDifference) }}
-
+
- 充值{{ formatNum(getSumCoin.todayRecharge) }} 免费{{
- formatNum(getSumCoin.todayFree)
- }}
- 任务{{ formatNum(getSumCoin.todayTask) }}
+ 充值{{ formatNum(getSumCoin.todayRecharge) }} 免费{{
+ formatNum(getSumCoin.todayFree)
+ }}
+ 任务{{ formatNum(getSumCoin.todayTask) }}
@@ -940,7 +948,8 @@ onMounted(async function () {
折合新币累计金额 {{ formatNum(Math.abs(statistics.totalSumCoin)) }}
- 昨日新增
+ 昨日新增
{{ formatNum(Math.abs(statistics.totalYesterdaySumCoin)) }}
,其中充值
{{ formatNum(Math.abs(statistics.rechargeYesterdaySumCoin)) }}
@@ -957,10 +966,12 @@ onMounted(async function () {
消费 {{ formatNum(Math.abs(getYearConsumeCoin.yearConsumeCoin)) }};
退款 {{ formatNum(Math.abs(getYearConsumeCoin.yearRefundCoin)) }}
- 昨日新增消耗
+ 昨日新增消耗
{{ formatNum(Math.abs(getDayConsumeCoin.daysumCoin)) }} ; 消费
{{ formatNum(Math.abs(getDayConsumeCoin.dayConsumeCoin)) }} ; 退款
- {{ formatNum(Math.abs(getDayConsumeCoin.dayRefundCoin)) }}
+ {{ formatNum(Math.abs(getDayConsumeCoin.dayRefundCoin)) }}
@@ -973,53 +984,78 @@ onMounted(async function () {
周同比 {{ statistics.weekOverWeekRate }}%
-
+
周同比 {{ statistics.weekOverWeekRate }}%
-
+
周同比 {{ statistics.weekOverWeekRate }}%
-
+
日环比{{ statistics.dayOverDayRate }}%
-
+
日环比{{ statistics.dayOverDayRate }}%
-
+
日环比{{ statistics.dayOverDayRate }}%
-
+
- 昨日充值人数
+ 昨日充值人数
{{ formatNum(Math.abs(statistics.rechargeCountYesterday)) }}
,其中首充
{{ formatNum(Math.abs(statistics.firstRechargeCountYesterday)) }}
- 人
+ 人
-
+
合计:充值金币:
@@ -1033,7 +1069,7 @@ onMounted(async function () {
-
+
充值金币
@@ -1047,22 +1083,38 @@ onMounted(async function () {
任务金币
-
+
-
+
- {{ index + 1 }}
- {{
- item.name
+ {{
+ index + 1
}}
+ {{ item.name }}
{{
formatNum(item.value)
}}
@@ -1089,7 +1141,7 @@ onMounted(async function () {
-
+
充值金币
@@ -1103,22 +1155,38 @@ onMounted(async function () {
任务金币
-
+
-
+
- {{ index + 1 }}
- {{
- item.name
+ {{
+ index + 1
}}
+ {{ item.name }}
{{
formatNum(item.value)
}}
@@ -1152,8 +1220,14 @@ onMounted(async function () {