|
|
@ -141,9 +141,9 @@ const getUser = async function (jwcode) { |
|
|
|
console.log("用户信息", user.value); |
|
|
|
console.log("用户信息", user.value.firstRechargeDate); |
|
|
|
if (result.data.code === 0) { |
|
|
|
ElMessage.error(result.data.msg); |
|
|
|
ElMessage.error(result.msg); |
|
|
|
} else { |
|
|
|
ElMessage.success(result.data.msg); |
|
|
|
ElMessage.success(result.msg); |
|
|
|
} |
|
|
|
} catch (error) { |
|
|
|
console.log("请求失败", error); |
|
|
@ -197,35 +197,35 @@ getCurrency(); |
|
|
|
// 这是添加上传图片的接口 |
|
|
|
const imageUrl = ref(""); |
|
|
|
|
|
|
|
// // 上传图片成功的回调函数 |
|
|
|
// const handleAvatarSuccess = (response, uploadFile) => { |
|
|
|
// // imageUrl.value = URL.createObjectURL(uploadFile.raw); |
|
|
|
// // 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); |
|
|
|
// }); |
|
|
|
// }; |
|
|
|
// 上传图片成功的回调函数 |
|
|
|
const handleAvatarSuccess = (response, uploadFile) => { |
|
|
|
imageUrl.value = URL.createObjectURL(uploadFile.raw); |
|
|
|
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(); |
|
|
@ -291,65 +291,125 @@ const imageUrl = ref(""); |
|
|
|
// reader.readAsDataURL(file); |
|
|
|
// }); |
|
|
|
// }; |
|
|
|
const handleAvatarSuccess = (response, file, fileList) => { |
|
|
|
// 处理上传成功的逻辑 |
|
|
|
imageUrl.value = URL.createObjectURL(file.raw); |
|
|
|
}; |
|
|
|
// 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, |
|
|
|
// }; |
|
|
|
// 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 = [ |
|
|
|
{ |
|
|
|
value: "现金充值", |
|
|
|
label: "现金充值", |
|
|
|
value: "微信", |
|
|
|
label: "微信", |
|
|
|
}, |
|
|
|
{ |
|
|
|
value: "支付宝", |
|
|
|
label: "支付宝", |
|
|
|
}, |
|
|
|
{ |
|
|
|
value: "银联", |
|
|
|
label: "银联", |
|
|
|
}, |
|
|
|
{ |
|
|
|
value: "龙鳞卡", |
|
|
|
label: "龙鳞卡", |
|
|
|
value: "信用卡", |
|
|
|
label: "信用卡", |
|
|
|
}, |
|
|
|
{ |
|
|
|
value: "弘粉卡", |
|
|
|
label: "弘粉卡", |
|
|
|
value: "借记卡", |
|
|
|
label: "借记卡", |
|
|
|
}, |
|
|
|
{ |
|
|
|
value: "现金充值", |
|
|
|
label: "现金充值", |
|
|
|
}, |
|
|
|
]; |
|
|
|
|
|
|
|
//根据活动id获取汇率 |
|
|
|
const getActivityById = async function (row) { |
|
|
|
try { |
|
|
|
// 发送POST请求 |
|
|
|
const result = await API.post( |
|
|
|
"http://192.168.8.93:10010/recharge/activity/select", |
|
|
|
{ activity: { activityId: row } } |
|
|
|
); |
|
|
|
addRecharge.value.rechargeRatio = result.data[0].rechargeRatio; |
|
|
|
console.log("看看有了吗", result.value); |
|
|
|
} catch (error) { |
|
|
|
console.log("请求失败", error); |
|
|
|
} |
|
|
|
}; |
|
|
|
const handleSelectionChange = (row) => { |
|
|
|
getActivityById(row); |
|
|
|
}; |
|
|
|
const calculatedFreeGold = computed(() => { |
|
|
|
if (!addRecharge.value.activityId == 0) { |
|
|
|
const paidGold = Number(addRecharge.value.paidGold) || 0; |
|
|
|
const activityId = Number(addRecharge.value.activityId) || 1; // 避免除以0 |
|
|
|
const activityId = Number(addRecharge.value.rechargeRatio) || 1; // 避免除以0 |
|
|
|
return Math.ceil(paidGold / activityId); |
|
|
|
} |
|
|
|
}); |
|
|
|
|
|
|
|
const calculatedRechargeGold = computed(() => { |
|
|
|
if (!addRecharge.value.rateId == 0) { |
|
|
|
const paidGold = Number(addRecharge.value.paidGold) || 0; |
|
|
@ -415,7 +475,7 @@ const addLine = function () { |
|
|
|
}); |
|
|
|
} |
|
|
|
// |
|
|
|
const handleSelectionChange = function (val) { |
|
|
|
const handleSelectionChangebatch = function (val) { |
|
|
|
console.log("val===", val); |
|
|
|
batchDelObj.value = val; |
|
|
|
} |
|
|
@ -647,51 +707,60 @@ const batchAdd = function () { |
|
|
|
<p>{{ user.name }}</p> |
|
|
|
</el-form-item> |
|
|
|
</el-col> |
|
|
|
<el-col :span="12"> |
|
|
|
<el-col :span="14"> |
|
|
|
<el-form-item label="历史金币总数"> |
|
|
|
<p>{{ user.totalRechargeGold }}</p> |
|
|
|
</el-form-item> |
|
|
|
</el-col> |
|
|
|
<el-col :span="12"> |
|
|
|
<el-col :span="10"> |
|
|
|
<el-form-item label="精网号"> |
|
|
|
<p>{{ user.jwcode }}</p> |
|
|
|
</el-form-item> |
|
|
|
</el-col> |
|
|
|
<el-col :span="12"> |
|
|
|
<el-col :span="14"> |
|
|
|
<el-form-item label="当前金币总数"> |
|
|
|
<p>{{ user.sumgold }}</p> |
|
|
|
<span style="color: #2fa1ff; margin-right: 5px" v-if="user.buyJb">{{ |
|
|
|
user.buyJb + user.free6 + user.free12 + user.coreJb |
|
|
|
}}</span> |
|
|
|
<span |
|
|
|
style="display: inline; white-space: nowrap; color: #b1b1b1" |
|
|
|
v-if="user.buyJb" |
|
|
|
>(充值金币:{{ user.buyJb }};免费金币:{{ |
|
|
|
user.free6 + user.free12 |
|
|
|
}};任务金币:{{ user.coreJb }})</span |
|
|
|
> |
|
|
|
</el-form-item> |
|
|
|
</el-col> |
|
|
|
<el-col :span="12"> |
|
|
|
<el-col :span="10"> |
|
|
|
<el-form-item label="首次充值日期"> |
|
|
|
<p v-if="user.firstRechargeDate"> |
|
|
|
{{ moment(user.firstRechargeDate).format("YYYY-MM-DD HH:mm:ss") }} |
|
|
|
</p> |
|
|
|
</el-form-item> |
|
|
|
</el-col> |
|
|
|
<el-col :span="12"> |
|
|
|
<el-col :span="14"> |
|
|
|
<el-form-item label="充值次数"> |
|
|
|
<p>{{ user.rechargeTimes }}</p> |
|
|
|
<p style="color: #2fa1ff">{{ user.rechargeTimes }}</p> |
|
|
|
</el-form-item> |
|
|
|
</el-col> |
|
|
|
<el-col :span="12"> |
|
|
|
<el-col :span="10"> |
|
|
|
<el-form-item label="负责客服"> |
|
|
|
<p>{{ adminData.name }}</p> |
|
|
|
</el-form-item> |
|
|
|
</el-col> |
|
|
|
<el-col :span="12"> |
|
|
|
<el-col :span="14"> |
|
|
|
<el-form-item label="消费次数"> |
|
|
|
<p>{{ user.spendTimes }}</p> |
|
|
|
<p style="color: #2fa1ff">{{ user.spendTimes }}</p> |
|
|
|
</el-form-item> |
|
|
|
</el-col> |
|
|
|
<el-col :span="12"> |
|
|
|
<el-col :span="10"> |
|
|
|
<el-form-item label="所属门店"> |
|
|
|
<p>{{ adminData.area }}</p> |
|
|
|
</el-form-item> |
|
|
|
</el-col> |
|
|
|
<el-col :span="12"> |
|
|
|
<el-col :span="14"> |
|
|
|
<el-form-item label="待审核"> |
|
|
|
<p> |
|
|
|
<p style="color: #2fa1ff"> |
|
|
|
{{ user.A }} |
|
|
|
</p> |
|
|
|
</el-form-item> |
|
|
@ -707,7 +776,7 @@ const batchAdd = function () { |
|
|
|
</el-row> |
|
|
|
<el-row> |
|
|
|
<el-table :data="batchData" border max-height="540px" style="height: 540px;" |
|
|
|
@selection-change="handleSelectionChange"> |
|
|
|
@selection-change="handleSelectionChangebatch"> |
|
|
|
<el-table-column type="selection" width="50px" /> |
|
|
|
<el-table-column property="index" label="序号" width="55px"> |
|
|
|
<template #default="scope"> |
|
|
|