Browse Source

修改之一

Hongxilin
donghaolin 5 months ago
parent
commit
5feb286410
  1. 168
      vue/gold-system/src/views/recharge/addRecharge.vue
  2. 18
      vue/gold-system/src/views/recharge/adminRecharge.vue
  3. 18
      vue/gold-system/src/views/recharge/allRecharge.vue
  4. 18
      vue/gold-system/src/views/refund/allRefund.vue

168
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("jpgpng!");
// 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;
// }
// };
}
}
};

18
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 () {
</el-tabs>
<div>
<el-table :data="tableData" :height="tableHeight" style="width: 100%">
<el-table-column type="index" label="序号" width="100px" fixed="left">
<el-table-column
type="index"
label="序号"
width="100px"
fixed="left"
>
<template #default="scope">
<span>{{ scope.$index + 1+(getObj.pageNum-1)*getObj.pageSize }}</span>
<span>{{
scope.$index + 1 + (getObj.pageNum - 1) * getObj.pageSize
}}</span>
</template>
</el-table-column>
<el-table-column prop="username" label="姓名" width="100px" />

18
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 () {
</el-tabs>
<div>
<el-table :data="tableData" :height="tableHeight" style="width: 100%">
<el-table-column type="index" label="序号" width="100px" fixed="left">
<el-table-column
type="index"
label="序号"
width="100px"
fixed="left"
>
<template #default="scope">
<span>{{ scope.$index + 1+(getObj.pageNum-1)*getObj.pageSize }}</span>
<span>{{
scope.$index + 1 + (getObj.pageNum - 1) * getObj.pageSize
}}</span>
</template>
</el-table-column>
<el-table-column prop="username" label="姓名" width="100px" />

18
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%"
>
<el-table-column type="index" label="序号" width="100px" fixed="left">
<el-table-column
type="index"
label="序号"
width="100px"
fixed="left"
>
<template #default="scope">
<span>{{ scope.$index + 1+(getObj.pageNum-1)*getObj.pageSize }}</span>
<span>{{
scope.$index + 1 + (getObj.pageNum - 1) * getObj.pageSize
}}</span>
</template>
</el-table-column>
<el-table-column prop="userName" label="姓名" width="150px" />

Loading…
Cancel
Save