hongxilin 5 months ago
parent
commit
3f769ff79e
  1. 168
      vue/gold-system/src/views/recharge/addRecharge.vue
  2. 11
      vue/gold-system/src/views/recharge/adminRecharge.vue
  3. 11
      vue/gold-system/src/views/recharge/allRecharge.vue
  4. 25
      vue/gold-system/src/views/refund/addRefund.vue
  5. 11
      vue/gold-system/src/views/refund/allRefund.vue
  6. 75
      vue/gold-system/src/views/usergoldInfo/index.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;
// }
// };
}
}
};

11
vue/gold-system/src/views/recharge/adminRecharge.vue

@ -434,9 +434,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" />

11
vue/gold-system/src/views/recharge/allRecharge.vue

@ -392,9 +392,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" />

25
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) => {
/>
</el-select>
</el-form-item>
<el-form-item prop="typeR" label="退款:">
<el-radio-group v-model="addRefund.typeR">
<el-radio value="0" @change="addRefund.typeR = '0'">全部退款</el-radio>
<el-radio value="1">部分退款</el-radio>
</el-radio-group>
</el-form-item>
<div style="display: flex; align-items: center">
<el-form-item prop="rechargeCoin" label="充值金币" style="float: left">
<el-input
v-model="addRefund.rechargeCoin"
style="width: 100px"
disabled
:disabled="addRefund.typeR === '0' ? true : false"
/>
<p></p>
</el-form-item>
@ -342,7 +353,7 @@ const handleSelectionChange = (value) => {
<el-input
v-model="addRefund.freeCoin"
style="float: left; width: 100px"
disabled
:disabled="addRefund.typeR === '0' ? true : false"
/>
<p></p>
</el-form-item>
@ -350,7 +361,7 @@ const handleSelectionChange = (value) => {
<el-input
v-model="addRefund.taskCoin"
style="float: left; width: 100px"
disabled
:disabled="addRefund.typeR === '0' ? true : false"
/>
<p></p>
</el-form-item>

11
vue/gold-system/src/views/refund/allRefund.vue

@ -402,9 +402,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" />

75
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 () {
<div>
<el-table :data="tableData" :height="tableHeight" style="width: 100%">
<el-table-column prop="" label="序号" width="130" />
<el-table-column prop="uname" label="姓名" width="130" />
<el-table-column prop="name" label="姓名" width="130" />
<el-table-column prop="jwcode" label="精网号" width="170" />
<el-table-column prop="area" label="所属地区" width="170" />
<el-table-column prop="platform" label="平台信息" width="170" />
<el-table-column prop="platform" label="总金币" width="130" />
<el-table-column prop="freeCoin" label="免费金币" width="110">
<el-table-column prop="area" label="所属地区" width="200" />
<el-table-column prop="allJb" label="总金币" width="130">
<template #default="scope">
<span>{{
scope.row.free12 +
scope.row.free6 +
scope.row.coreJb +
scope.row.buyJb
}}</span>
</template>
</el-table-column>
<el-table-column prop="freeJb" label="免费金币" width="110">
<template #default="scope">
<span>{{ Math.abs(scope.row.free6 + scope.row.free12) }}</span>
</template>
</el-table-column>
<el-table-column prop="buyJb" label="充值金币" width="110">
<template #default="scope">
<span>{{ Math.abs(scope.row.freeCoin) }}</span>
<span>{{ Math.abs(scope.row.buyJb) }}</span>
</template>
</el-table-column>
<el-table-column prop="rechargeCoin" label="充值金币" width="110">
<el-table-column prop="coreJb" label="任务金币" width="160">
<template #default="scope">
<span>{{ Math.abs(scope.row.rechargeCoin) }}</span>
<span>{{ Math.abs(scope.row.coreJb) }}</span>
</template>
</el-table-column>
<el-table-column prop="taskCoin" label="任务金币" width="110">
<el-table-column prop="rcoin" label="历史充值" width="150" />
<el-table-column prop="scoin" label="历史消费" width="150">
<template #default="scope">
<span>{{ Math.abs(scope.row.taskCoin) }}</span>
<span>{{ Math.abs(scope.row.scoin) }}</span>
</template>
</el-table-column>
<el-table-column prop="jwcode" label="历史充值" width="150" />
<el-table-column prop="jwcode" label="历史消费" width="150" />
</el-table>
</div>

Loading…
Cancel
Save