From a8856fa5b9b337c518d2b50d1c0e62605b6dd8c3 Mon Sep 17 00:00:00 2001
From: donghaolin <17667510818@163.com>
Date: Wed, 25 Dec 2024 15:45:48 +0800
Subject: [PATCH 1/2] =?UTF-8?q?=E9=83=A8=E5=88=86=E9=80=80=E6=AC=BE?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
vue/gold-system/src/views/refund/addRefund.vue | 25 +++++---
vue/gold-system/src/views/usergoldInfo/index.vue | 75 +++++++++++-------------
2 files changed, 51 insertions(+), 49 deletions(-)
diff --git a/vue/gold-system/src/views/refund/addRefund.vue b/vue/gold-system/src/views/refund/addRefund.vue
index e7ea95e..154f5b3 100644
--- a/vue/gold-system/src/views/refund/addRefund.vue
+++ b/vue/gold-system/src/views/refund/addRefund.vue
@@ -26,24 +26,26 @@ const getAdminData = async function () {
};
getAdminData();
-// 这是添加充值信息的表单
+// 这是添加退款信息的表单
const addRefund = ref({
- updateType: "退款",
+ updateType: "3",
allCoin: 0,
contactId: "",
refundGoods: "",
freeCoin: 0,
rechargeCoin: 0,
taskCoin: 0,
+ typeR: "0",
});
// 取消按钮
const cancel = function () {
addRefund.value = {};
- addRefund.value.updateType = "退款";
+ addRefund.value.updateType = "3";
addRefund.value.rechargeCoin = 0;
addRefund.value.freeCoin = 0;
addRefund.value.taskCoin = 0;
addRefund.value.allCoin = 0;
+ addRefund.value.typeR = 0;
addRefund.value.adminId = adminData.value.adminId;
};
// 这是添加退款信息的接口
@@ -63,13 +65,14 @@ const add = async function () {
// 重置表单
addRefund.value = {};
addRefund.value.adminId = adminData.value.adminId;
- addRefund.value.updateType = "退款";
+ addRefund.value.updateType = "3";
addRefund.value.allCoin = 0;
addRefund.value.contactId = "";
addRefund.value.refundGoods = "";
addRefund.value.freeCoin = 0;
addRefund.value.rechargeCoin = 0;
addRefund.value.taskCoin = 0;
+ addRefund.value.typeR = 0;
user.value = {};
} catch (error) {
console.log("请求失败", error);
@@ -325,12 +328,20 @@ const handleSelectionChange = (value) => {
/>
+
+
+
+ 全部退款
+ 部分退款
+
+
+
个
@@ -342,7 +353,7 @@ const handleSelectionChange = (value) => {
个
@@ -350,7 +361,7 @@ const handleSelectionChange = (value) => {
个
diff --git a/vue/gold-system/src/views/usergoldInfo/index.vue b/vue/gold-system/src/views/usergoldInfo/index.vue
index f1efa08..09f9d8d 100644
--- a/vue/gold-system/src/views/usergoldInfo/index.vue
+++ b/vue/gold-system/src/views/usergoldInfo/index.vue
@@ -72,40 +72,25 @@ const get = async function (val) {
}
console.log("搜索参数", getObj.value);
// 发送POST请求
- const result = await API.post("http://192.168.8.93:10010/detailY", {
+ const result = await API.post("http://192.168.8.93:10010/detailY/select", {
...getObj.value,
detailY: { ...detailY.value },
});
- const result2 = await API.post("http://192.168.8.93:10010/detailY", {
- ...getAllObj.value,
- detailY: { ...detailY.value },
- });
+ // const result2 = await API.post("http://192.168.8.93:10010/detailY/select", {
+ // ...getAllObj.value,
+ // detailY: { ...detailY.value },
+ // });
// 将响应结果存储到响应式数据中
console.log("请求成功", result);
- console.log("请求成功2", result2);
+ // console.log("请求成功2", result2);
// 存储表格数据
tableData.value = result.data.list;
console.log("tableData", tableData.value);
- tableAllData.value = result2.data;
- console.log("tableAllData", tableAllData.value);
+ // tableAllData.value = result2.data;
+ // console.log("tableAllData", tableAllData.value);
// 存储分页总数
total.value = result.data.total;
console.log("total", total.value);
- // 计算各金币总数
- rechargeCoin.value = tableAllData.value.sumR;
- freeCoin.value = tableAllData.value.sumF;
- taskCoin.value = tableAllData.value.sumT;
- // for (let i = 0; i < tableAllData.value.length; i++) {
- // rechargeCoin.value += tableAllData.value[i].rechargeCoin;
- // freeCoin.value += tableAllData.value[i].freeCoin;
- // taskCoin.value += tableAllData.value[i].taskCoin;
- // }
- console.log(
- "各金币总数",
- rechargeCoin.value,
- freeCoin.value,
- taskCoin.value
- );
} catch (error) {
console.log("请求失败", error);
// 在这里可以处理错误逻辑,比如显示错误提示等
@@ -117,13 +102,7 @@ const search = function () {
get();
};
// 重置
-const reset = function () {
- detailY.value.jwcode = "";
- detailY.value.updateType = "";
- detailY.value.startDate = "";
- detailY.value.endDate = "";
- getTime.value = {};
-};
+const reset = function () {};
// 验证跳转输入框的数字是否合法
const checkNumber = function () {
@@ -215,28 +194,40 @@ onMounted(async function () {
-
+
-
-
-
-
+
+
+
+ {{
+ scope.row.free12 +
+ scope.row.free6 +
+ scope.row.coreJb +
+ scope.row.buyJb
+ }}
+
+
+
+
+ {{ Math.abs(scope.row.free6 + scope.row.free12) }}
+
+
+
- {{ Math.abs(scope.row.freeCoin) }}
+ {{ Math.abs(scope.row.buyJb) }}
-
+
- {{ Math.abs(scope.row.rechargeCoin) }}
+ {{ Math.abs(scope.row.coreJb) }}
-
+
+
- {{ Math.abs(scope.row.taskCoin) }}
+ {{ Math.abs(scope.row.scoin) }}
-
-
From 5feb286410ffa96a0c76c0853f806e91a2e84d0c Mon Sep 17 00:00:00 2001
From: donghaolin <17667510818@163.com>
Date: Wed, 25 Dec 2024 16:13:33 +0800
Subject: [PATCH 2/2] =?UTF-8?q?=E4=BF=AE=E6=94=B9=E4=B9=8B=E4=B8=80?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
vue/gold-system/src/views/recharge/addRecharge.vue | 168 +--------------------
.../src/views/recharge/adminRecharge.vue | 18 ++-
vue/gold-system/src/views/recharge/allRecharge.vue | 18 ++-
vue/gold-system/src/views/refund/allRefund.vue | 18 ++-
4 files changed, 34 insertions(+), 188 deletions(-)
diff --git a/vue/gold-system/src/views/recharge/addRecharge.vue b/vue/gold-system/src/views/recharge/addRecharge.vue
index 8871cec..69cf864 100644
--- a/vue/gold-system/src/views/recharge/addRecharge.vue
+++ b/vue/gold-system/src/views/recharge/addRecharge.vue
@@ -66,13 +66,6 @@ const add = async function () {
imageUrl.value = "";
Rate.value = null;
user.value = {};
- // addRecharge.value.adminId = adminData.value.adminId;
- // addRecharge.value.area = adminData.value.area;
- // addRecharge.value.rechargeVoucher = "";
- // addRecharge.value.rechargeWay = "客服充值";
- // addRecharge.value.freeGold = 0;
- // addRecharge.value.rechargeGold = 0;
- // addRecharge.value.paidGold = "";
} catch (error) {
console.log("请求失败", error);
// 在这里可以处理错误逻辑,比如显示错误提示等
@@ -205,160 +198,7 @@ const handleAvatarSuccess = (response, uploadFile) => {
console.log("图片上传成功", response, uploadFile);
addRecharge.value.rechargeVoucher = `http://192.168.8.93:10010/upload/${response.data}`;
console.log("图片名称", addRecharge.value.rechargeVoucher);
- // 将图片转换为 Base64 编码
- // const reader = new FileReader();
- // reader.onloadend = () => {
- // const base64data = reader.result;
- // const data = {
- // rechargeVoucher: base64data,
- // };
- // 发送 JSON 对象到服务器
- // axios
- // .post("http://192.168.8.93:10010/upload",data)
- // .then((res) => {
- // console.log("图片上传成功", res);
- // addRecharge.value.rechargeVoucher = `http://192.168.8.93:10010/upload/${response.data}`;
- // console.log("图片名称", addRecharge.value.rechargeVoucher);
- // })
- // .catch((error) => {
- // console.error("图片上传失败", error);
- // });
};
-// reader.readAsDataURL(uploadFile.raw);
-// imageUrl.value = URL.createObjectURL(uploadFile.raw);
-// console.log("图片上传成功", response, uploadFile);
-
-// const handleAvatarSuccess = (response, uploadFile) => {
-// // 将图片转换为 Base64 编码
-// const reader = new FileReader();
-// reader.onloadend = () => {
-// const base64data = reader.result;
-// const data = {
-// rechargeVoucher: base64data,
-// };
-// console.log("图片名称", data);
-// // 发送 JSON 对象到服务器
-// API.post("http://192.168.8.93:10010/upload", {})
-// .then((res) => {
-// console.log("图片上传成功", res);
-// addRecharge.value.rechargeVoucher = `http://192.168.8.93:10010/upload/${response.data}`;
-// console.log("图片名称", addRecharge.value.rechargeVoucher);
-// })
-// .catch((error) => {
-// console.error("图片上传失败", error);
-// });
-// };
-// reader.readAsDataURL(uploadFile.raw);
-// imageUrl.value = URL.createObjectURL(uploadFile.raw);
-// console.log("图片上传成功", response, uploadFile);
-// };
-// 上传图片之前的校验函数
-// const beforeAvatarUpload = (rawFile) => {
-// if (rawFile.type !== "image/jpeg" && rawFile.type !== "image/png") {
-// ElMessage.error("图片格式必须为jpg或png!");
-// return false;
-// } else if (rawFile.size / 1024 / 1024 > 2) {
-// ElMessage.error("Avatar picture size can not exceed 2MB!");
-// return false;
-// }
-// return true;
-// };
-// const beforeAvatarUpload = (file) => {
-// return new Promise((resolve, reject) => {
-// const reader = new FileReader();
-// reader.onload = (e) => {
-// const base64Data = e.target.result;
-// const imgData = {
-// image: base64Data,
-// fileName: file.name,
-// };
-// const formData = new FormData();
-// formData.append("imageData", JSON.stringify(imgData));
-
-// // 使用 fetch 或者 axios 发送 formData
-// fetch("http://192.168.8.93:10010/upload", {
-// method: "POST",
-// body: formData,
-// })
-// .then((response) => response.json())
-// .then((data) => {
-// ElMessage.success("上传成功");
-// resolve();
-// })
-// .catch((error) => {
-// ElMessage.error("上传失败");
-// reject();
-// });
-// };
-// reader.readAsDataURL(file);
-// });
-// };
-// const handleAvatarSuccess = (response, file, fileList) => {
-// // 处理上传成功的逻辑
-// imageUrl.value = URL.createObjectURL(file.raw);
-// };
-
-// const beforeAvatarUpload = (file) => {
-// return new Promise((resolve, reject) => {
-// const reader = new FileReader();
-// reader.onload = (e) => {
-// const base64Data = e.target.result;
-// const imgData = {
-// image: base64Data,
-// fileName: file.name,
-// };
-// const formData = new FormData();
-// formData.append("imageData", JSON.stringify(imgData));
-// // 使用 fetch 或者 axios 发送 formData
-// fetch("http://192.168.8.93:10010/upload", {
-// method: "POST",
-// body: formData,
-// })
-// .then((response) => response.json())
-// .then((data) => {
-// ElMessage.success("上传成功");
-// resolve();
-// })
-// .catch((error) => {
-// ElMessage.error("上传失败");
-// reject();
-// });
-// };
-// reader.readAsDataURL(file);
-// });
-// };
-// const beforeAvatarUpload = (file) => {
-// return new Promise((resolve, reject) => {
-// const reader = new FileReader();
-// reader.onload = (e) => {
-// const base64Data = e.target.result;
-// const imgData = {
-// image: base64Data,
-// fileName: file.name,
-// };
-// // 将 imgData 转换为 JSON 字符串
-// const jsonData = JSON.stringify(imgData);
-// // 使用 fetch 或者 axios 发送 JSON 数据
-// fetch("http://192.168.8.93:10010/upload", {
-// method: "POST",
-// headers: {
-// "Content-Type": "application/json", // 设置请求头为 JSON
-// },
-// body: jsonData, // 发送 JSON 字符串
-// })
-// .then((response) => response.json())
-// .then((data) => {
-// ElMessage.success("上传成功");
-// resolve();
-// })
-// .catch((error) => {
-// ElMessage.error("上传失败");
-// reject();
-// });
-// };
-// reader.readAsDataURL(file);
-// });
-// };
//充值方式条目
const options = [
@@ -428,7 +268,7 @@ const calculatedFreeGold = computed(() => {
const calculatedRechargeGold = computed(() => {
if (!Rate.value == 0) {
const paidGold = Number(addRecharge.value.paidGold) || 0;
- const rate = Number(Rate.value) || 1; // 避免乘以0
+ const rate = Number(Rate.value) || 0; // 避免乘以0
return Number(Math.ceil(paidGold * rate));
}
});
@@ -586,12 +426,6 @@ const changeActivity = function (row) {
row.freeGold = 0;
} else {
row.freeGold = Math.ceil(row.paidGold / ratio);
- // for (let i = 0; i < batchData.value.length; i++) {
- // if (batchData.value[i].line == row.line) {
- // batchData.value[i].freeGold = Math.ceil(row.paidGold / ratio);
- // break;
- // }
- // };
}
}
};
diff --git a/vue/gold-system/src/views/recharge/adminRecharge.vue b/vue/gold-system/src/views/recharge/adminRecharge.vue
index 5149216..5c1caa1 100644
--- a/vue/gold-system/src/views/recharge/adminRecharge.vue
+++ b/vue/gold-system/src/views/recharge/adminRecharge.vue
@@ -252,17 +252,14 @@ const getArea = async function () {
try {
// 发送POST请求
const result = await API.post(
- "http://192.168.8.93:10010/recharge/recharge",
+ "http://192.168.8.93:10010/recharge/user/search",
{}
);
// 将响应结果存储到响应式数据中
console.log("请求成功", result);
// 存储全部数据
- allData.value = result.data;
+ area.value = result.data;
console.log("allData", allData.value);
- // 分离并去重地区列表
- area.value = [...new Set(allData.value.map((item) => item.area))];
- console.log("地区", area.value);
} catch (error) {
console.log("请求失败", error);
// 在这里可以处理错误逻辑,比如显示错误提示等
@@ -436,9 +433,16 @@ onMounted(async function () {
-
+
- {{ scope.$index + 1+(getObj.pageNum-1)*getObj.pageSize }}
+ {{
+ scope.$index + 1 + (getObj.pageNum - 1) * getObj.pageSize
+ }}
diff --git a/vue/gold-system/src/views/recharge/allRecharge.vue b/vue/gold-system/src/views/recharge/allRecharge.vue
index e995dda..16430a9 100644
--- a/vue/gold-system/src/views/recharge/allRecharge.vue
+++ b/vue/gold-system/src/views/recharge/allRecharge.vue
@@ -233,17 +233,14 @@ const getArea = async function () {
try {
// 发送POST请求
const result = await API.post(
- "http://192.168.8.93:10010/recharge/recharge",
+ "http://192.168.8.93:10010/recharge/user/search",
{}
);
// 将响应结果存储到响应式数据中
console.log("请求成功", result);
// 存储全部数据
- allData.value = result.data;
+ area.value = result.data;
console.log("allData", allData.value);
- // 分离并去重地区列表
- area.value = [...new Set(allData.value.map((item) => item.area))];
- console.log("地区", area.value);
} catch (error) {
console.log("请求失败", error);
// 在这里可以处理错误逻辑,比如显示错误提示等
@@ -394,9 +391,16 @@ onMounted(async function () {
-
+
- {{ scope.$index + 1+(getObj.pageNum-1)*getObj.pageSize }}
+ {{
+ scope.$index + 1 + (getObj.pageNum - 1) * getObj.pageSize
+ }}
diff --git a/vue/gold-system/src/views/refund/allRefund.vue b/vue/gold-system/src/views/refund/allRefund.vue
index 2d814f8..cb0ae88 100644
--- a/vue/gold-system/src/views/refund/allRefund.vue
+++ b/vue/gold-system/src/views/refund/allRefund.vue
@@ -196,17 +196,14 @@ const getArea = async function () {
try {
// 发送POST请求
const result = await API.post(
- "http://192.168.8.93:10010/recharge/recharge",
+ "http://192.168.8.93:10010/recharge/user/search",
{}
);
// 将响应结果存储到响应式数据中
console.log("请求成功", result);
// 存储全部数据
- allData.value = result.data;
+ area.value = result.data;
console.log("allData", allData.value);
- // 分离并去重地区列表
- area.value = [...new Set(allData.value.map((item) => item.area))];
- console.log("地区", area.value);
} catch (error) {
console.log("请求失败", error);
// 在这里可以处理错误逻辑,比如显示错误提示等
@@ -404,9 +401,16 @@ const checkNumber = function () {
:height="tableHeight"
style="width: 100%"
>
-
+
- {{ scope.$index + 1+(getObj.pageNum-1)*getObj.pageSize }}
+ {{
+ scope.$index + 1 + (getObj.pageNum - 1) * getObj.pageSize
+ }}