Browse Source

success Merge branch 'zhangrenyuan/feature-20250623164058-金币前端' into milestone-20250623-金币前端

zhangrenyuan/feature-20250623164058-金币前端
zry 1 day ago
parent
commit
f06bdf2673
  1. 2
      .env.production
  2. 93
      package-lock.json
  3. 5
      package.json
  4. 70
      src/views/recharge/addCoinRecharge.vue
  5. 3
      src/views/refund/addCoinRefund.vue
  6. 18
      src/views/refund/coinRefundDetail.vue

2
.env.production

@ -1,5 +1,5 @@
# VITE_API_BASE='http://54.251.137.151:10702/' # VITE_API_BASE='http://54.251.137.151:10702/'
VITE_API_BASE='https://hwjb.homilychart.com/admin/'
VITE_API_BASE='https://hwjb.homilychart.com/admin'
# VITE_API_BASE='https://hwjb.homilychart.com/gold_htms_dev' # VITE_API_BASE='https://hwjb.homilychart.com/gold_htms_dev'
# VITE_API_BASE='http://192.168.8.232:8080/' # VITE_API_BASE='http://192.168.8.232:8080/'
VITE_UPLOAD_URL=https://api.homilychart.com/hljw/api/aws/upload VITE_UPLOAD_URL=https://api.homilychart.com/hljw/api/aws/upload

93
package-lock.json

@ -8,7 +8,12 @@
"name": "gold-system", "name": "gold-system",
"version": "0.0.0", "version": "0.0.0",
"dependencies": { "dependencies": {
"@ant-design/icons-vue": "^7.0.1",
"@element-plus/icons-vue": "^2.3.1", "@element-plus/icons-vue": "^2.3.1",
"@fortawesome/fontawesome-svg-core": "^6.7.2",
"@fortawesome/free-solid-svg-icons": "^6.7.2",
"@fortawesome/vue-fontawesome": "^3.0.8",
"@tabler/icons-vue": "^3.34.0",
"axios": "^1.7.8", "axios": "^1.7.8",
"dayjs": "^1.11.13", "dayjs": "^1.11.13",
"dayjs-plugin-utc": "^0.1.2", "dayjs-plugin-utc": "^0.1.2",
@ -55,6 +60,31 @@
"node": ">=6.0.0" "node": ">=6.0.0"
} }
}, },
"node_modules/@ant-design/colors": {
"version": "6.0.0",
"resolved": "https://registry.npmmirror.com/@ant-design/colors/-/colors-6.0.0.tgz",
"integrity": "sha512-qAZRvPzfdWHtfameEGP2Qvuf838NhergR35o+EuVyB5XvSA98xod5r4utvi4TJ3ywmevm290g9nsCG5MryrdWQ==",
"dependencies": {
"@ctrl/tinycolor": "^3.4.0"
}
},
"node_modules/@ant-design/icons-svg": {
"version": "4.4.2",
"resolved": "https://registry.npmmirror.com/@ant-design/icons-svg/-/icons-svg-4.4.2.tgz",
"integrity": "sha512-vHbT+zJEVzllwP+CM+ul7reTEfBR0vgxFe7+lREAsAA7YGsYpboiq2sQNeQeRvh09GfQgs/GyFEvZpJ9cLXpXA=="
},
"node_modules/@ant-design/icons-vue": {
"version": "7.0.1",
"resolved": "https://registry.npmmirror.com/@ant-design/icons-vue/-/icons-vue-7.0.1.tgz",
"integrity": "sha512-eCqY2unfZK6Fe02AwFlDHLfoyEFreP6rBwAZMIJ1LugmfMiVgwWDYlp1YsRugaPtICYOabV1iWxXdP12u9U43Q==",
"dependencies": {
"@ant-design/colors": "^6.0.0",
"@ant-design/icons-svg": "^4.2.1"
},
"peerDependencies": {
"vue": ">=3.0.3"
}
},
"node_modules/@babel/code-frame": { "node_modules/@babel/code-frame": {
"version": "7.26.2", "version": "7.26.2",
"resolved": "https://registry.npmjs.org/@babel/code-frame/-/code-frame-7.26.2.tgz", "resolved": "https://registry.npmjs.org/@babel/code-frame/-/code-frame-7.26.2.tgz",
@ -1974,6 +2004,45 @@
"integrity": "sha512-kym7SodPp8/wloecOpcmSnWJsK7M0E5Wg8UcFA+uO4B9s5d0ywXOEro/8HM9x0rW+TljRzul/14UYz3TleT3ig==", "integrity": "sha512-kym7SodPp8/wloecOpcmSnWJsK7M0E5Wg8UcFA+uO4B9s5d0ywXOEro/8HM9x0rW+TljRzul/14UYz3TleT3ig==",
"license": "MIT" "license": "MIT"
}, },
"node_modules/@fortawesome/fontawesome-common-types": {
"version": "6.7.2",
"resolved": "https://registry.npmmirror.com/@fortawesome/fontawesome-common-types/-/fontawesome-common-types-6.7.2.tgz",
"integrity": "sha512-Zs+YeHUC5fkt7Mg1l6XTniei3k4bwG/yo3iFUtZWd/pMx9g3fdvkSK9E0FOC+++phXOka78uJcYb8JaFkW52Xg==",
"engines": {
"node": ">=6"
}
},
"node_modules/@fortawesome/fontawesome-svg-core": {
"version": "6.7.2",
"resolved": "https://registry.npmmirror.com/@fortawesome/fontawesome-svg-core/-/fontawesome-svg-core-6.7.2.tgz",
"integrity": "sha512-yxtOBWDrdi5DD5o1pmVdq3WMCvnobT0LU6R8RyyVXPvFRd2o79/0NCuQoCjNTeZz9EzA9xS3JxNWfv54RIHFEA==",
"dependencies": {
"@fortawesome/fontawesome-common-types": "6.7.2"
},
"engines": {
"node": ">=6"
}
},
"node_modules/@fortawesome/free-solid-svg-icons": {
"version": "6.7.2",
"resolved": "https://registry.npmmirror.com/@fortawesome/free-solid-svg-icons/-/free-solid-svg-icons-6.7.2.tgz",
"integrity": "sha512-GsBrnOzU8uj0LECDfD5zomZJIjrPhIlWU82AHwa2s40FKH+kcxQaBvBo3Z4TxyZHIyX8XTDxsyA33/Vx9eFuQA==",
"dependencies": {
"@fortawesome/fontawesome-common-types": "6.7.2"
},
"engines": {
"node": ">=6"
}
},
"node_modules/@fortawesome/vue-fontawesome": {
"version": "3.0.8",
"resolved": "https://registry.npmmirror.com/@fortawesome/vue-fontawesome/-/vue-fontawesome-3.0.8.tgz",
"integrity": "sha512-yyHHAj4G8pQIDfaIsMvQpwKMboIZtcHTUvPqXjOHyldh1O1vZfH4W03VDPv5RvI9P6DLTzJQlmVgj9wCf7c2Fw==",
"peerDependencies": {
"@fortawesome/fontawesome-svg-core": "~1 || ~6",
"vue": ">= 3.0.0 < 4"
}
},
"node_modules/@jridgewell/gen-mapping": { "node_modules/@jridgewell/gen-mapping": {
"version": "0.3.8", "version": "0.3.8",
"resolved": "https://mirrors.huaweicloud.com/repository/npm/@jridgewell/gen-mapping/-/gen-mapping-0.3.8.tgz", "resolved": "https://mirrors.huaweicloud.com/repository/npm/@jridgewell/gen-mapping/-/gen-mapping-0.3.8.tgz",
@ -2633,6 +2702,30 @@
"win32" "win32"
] ]
}, },
"node_modules/@tabler/icons": {
"version": "3.34.0",
"resolved": "https://registry.npmmirror.com/@tabler/icons/-/icons-3.34.0.tgz",
"integrity": "sha512-jtVqv0JC1WU2TTEBN32D9+R6mc1iEBuPwLnBsWaR02SIEciu9aq5806AWkCHuObhQ4ERhhXErLEK7Fs+tEZxiA==",
"funding": {
"type": "github",
"url": "https://github.com/sponsors/codecalm"
}
},
"node_modules/@tabler/icons-vue": {
"version": "3.34.0",
"resolved": "https://registry.npmmirror.com/@tabler/icons-vue/-/icons-vue-3.34.0.tgz",
"integrity": "sha512-5JAR3ij6APih9NNO94EA/IN7sl13Z2f60x7+F82Dt74Bt5iou0clf9mLcCDCvv3Ea91sbkNWOCF6JEx5z1bz/g==",
"dependencies": {
"@tabler/icons": "3.34.0"
},
"funding": {
"type": "github",
"url": "https://github.com/sponsors/codecalm"
},
"peerDependencies": {
"vue": ">=3.0.1"
}
},
"node_modules/@types/estree": { "node_modules/@types/estree": {
"version": "1.0.6", "version": "1.0.6",
"resolved": "https://mirrors.huaweicloud.com/repository/npm/@types/estree/-/estree-1.0.6.tgz", "resolved": "https://mirrors.huaweicloud.com/repository/npm/@types/estree/-/estree-1.0.6.tgz",

5
package.json

@ -12,7 +12,12 @@
"serve": "vite - service serve --host 0.0.0.0 --port 8080" "serve": "vite - service serve --host 0.0.0.0 --port 8080"
}, },
"dependencies": { "dependencies": {
"@ant-design/icons-vue": "^7.0.1",
"@element-plus/icons-vue": "^2.3.1", "@element-plus/icons-vue": "^2.3.1",
"@fortawesome/fontawesome-svg-core": "^6.7.2",
"@fortawesome/free-solid-svg-icons": "^6.7.2",
"@fortawesome/vue-fontawesome": "^3.0.8",
"@tabler/icons-vue": "^3.34.0",
"axios": "^1.7.8", "axios": "^1.7.8",
"dayjs": "^1.11.13", "dayjs": "^1.11.13",
"dayjs-plugin-utc": "^0.1.2", "dayjs-plugin-utc": "^0.1.2",

70
src/views/recharge/addCoinRecharge.vue

@ -21,18 +21,20 @@ const trimJwCode = () => {
} }
// //
const beforeAvatarUpload = (file) => { const beforeAvatarUpload = (file) => {
const isJPG = file.type === 'image/jpeg'
const isPNG = file.type === 'image/png'
const isLt2M = file.size / 1024 / 1024 < 1
const validTypes = ['image/jpeg', 'image/png'];
const isImage = validTypes.includes(file.type);
const isLt1M = file.size / 1024 / 1024 < 1;
if (!isJPG && !isPNG) {
ElMessage.error('上传头像图片只能是 JPG 或 PNG 格式!')
if (!isImage) {
ElMessage.error('只能上传 JPG/PNG 图片!');
return false;
} }
if (!isLt2M) {
ElMessage.error('上传头像图片大小不能超过 1MB!')
if (!isLt1M) {
ElMessage.error('图片大小不能超过 1MB!');
return false;
} }
return (isJPG || isPNG) && isLt2M
}
return true;
};
// //
const imageUrl = ref('') const imageUrl = ref('')
const voucher = ref('') const voucher = ref('')
@ -351,20 +353,48 @@ const rateName = [
// //
const customUpload = async (options) => { const customUpload = async (options) => {
try { try {
const response = await uploadFile(options.file);
handleAvatarSuccess(response.data, { raw: options.file });
const formData = new FormData();
formData.append('file', options.file);
const response = await axios.post(import.meta.env.VITE_UPLOAD_URL, formData, {
headers: {
'Content-Type': 'multipart/form-data',
'Authorization': `Bearer ${localStorage.getItem('token')}`
}
});
if (response.data.code === 200 && response.data.data) {
//
handleAvatarSuccess(response.data, options.file);
ElMessage.success('上传成功');
} else {
ElMessage.error(response.data.msg || '上传失败');
}
} catch (error) { } catch (error) {
ElMessage.error('上传失败');
console.error('上传错误:', error);
ElMessage.error(`上传失败: ${error.response?.data?.message || error.message}`);
} }
}; };
// //
// const uploadUrl = import.meta.env.VITE_UPLOAD_URL; // const uploadUrl = import.meta.env.VITE_UPLOAD_URL;
// //
const handleAvatarSuccess = (response, uploadFile) => {
imageUrl.value = URL.createObjectURL(uploadFile.raw) ;
console.log('图片上传成功', response, uploadFile)
recharge.value.voucher = import.meta.env.VITE_UPLOAD_URL;
console.log('图片名称', recharge.value.voucher)
const handleAvatarSuccess = (response, file) => {
// 使 file Object URL
imageUrl.value = URL.createObjectURL(file);
// 使
if (response && response.filePath) {
recharge.value.voucher = response.filePath;
} else if (response && response.url) {
recharge.value.voucher = response.url;
} else if (response && response.data) {
// { code: 200, data: { filePath: ... } }
recharge.value.voucher = response.data.filePath || response.data.url;
} else {
// 使URL
recharge.value.voucher = import.meta.env.VITE_UPLOAD_URL;
}
} }
// //
@ -420,6 +450,9 @@ onMounted(async function () {
await getActivity()// await getActivity()//
}) })
onMounted(() => {
console.log('上传URL:', import.meta.env.VITE_UPLOAD_URL);
});
</script> </script>
<template> <template>
@ -593,7 +626,6 @@ onMounted(async function () {
</el-form> </el-form>
<!-- 客户信息栏 --> <!-- 客户信息栏 -->
<!-- 客户信息栏 -->
<el-card v-if="user.jwcode" style="width: 800px; float: right" class="customer-info"> <el-card v-if="user.jwcode" style="width: 800px; float: right" class="customer-info">
<el-form <el-form
:model="user" :model="user"
@ -620,7 +652,7 @@ onMounted(async function () {
<!-- 如果不是有效的数字显示默认值 --> <!-- 如果不是有效的数字显示默认值 -->
<p v-else></p> <p v-else></p>
</el-form-item> </el-form-item>
<el-form-item style="margin-top: -23px"> <!-- 负边距减少间距 -->
<el-form-item style="margin-top: -23px">
<span <span
style="display: inline; white-space: nowrap; color: #b1b1b1" style="display: inline; white-space: nowrap; color: #b1b1b1"
v-if="user.historyPermanentGold !== undefined" v-if="user.historyPermanentGold !== undefined"

3
src/views/refund/addCoinRefund.vue

@ -420,6 +420,7 @@ onMounted(async function () {
style="width: 100px" style="width: 100px"
:disabled="addRe.typeR === '0' ? true : false" :disabled="addRe.typeR === '0' ? true : false"
@input="handlePermanentGoldInput($event)" @input="handlePermanentGoldInput($event)"
type="number"
> >
</el-input> </el-input>
<p></p> <p></p>
@ -434,6 +435,7 @@ onMounted(async function () {
style="float: left; width: 100px" style="float: left; width: 100px"
:disabled="addRe.typeR === '0' ? true : false" :disabled="addRe.typeR === '0' ? true : false"
@input="handleFreeGoldInput($event)" @input="handleFreeGoldInput($event)"
type="number"
/> />
<p></p> <p></p>
</el-form-item> </el-form-item>
@ -443,6 +445,7 @@ onMounted(async function () {
style="float: left; width: 100px" style="float: left; width: 100px"
:disabled="addRe.typeR === '0' ? true : false" :disabled="addRe.typeR === '0' ? true : false"
@input="handleTaskGoldInput($event)" @input="handleTaskGoldInput($event)"
type="number"
/> />
<p></p> <p></p>
</el-form-item> </el-form-item>

18
src/views/refund/coinRefundDetail.vue

@ -379,12 +379,12 @@ const handleCurrentChange = function (val) {
<el-row style="margin-bottom: 10px"> <el-row style="margin-bottom: 10px">
<el-col :span="5"> <el-col :span="5">
<div class="head-card-element"> <div class="head-card-element">
<el-text class="mx-1" size="large">精网号</el-text>
<el-text class="mx-1" >精网号</el-text>
<el-input <el-input
v-model="refundUser.jwcode" v-model="refundUser.jwcode"
placeholder="请输入精网号" placeholder="请输入精网号"
size="large"
style="width: 150px" style="width: 150px"
clearable clearable
/> />
@ -392,11 +392,11 @@ const handleCurrentChange = function (val) {
</el-col> </el-col>
<el-col :span="6"> <el-col :span="6">
<div class="head-card-element"> <div class="head-card-element">
<el-text class="mx-1" size="large">退款类型</el-text>
<el-text class="mx-1" >退款类型</el-text>
<el-select <el-select
v-model="refundUser.refundType" v-model="refundUser.refundType"
placeholder="请选择退款类型" placeholder="请选择退款类型"
size="large"
style="width: 180px" style="width: 180px"
clearable clearable
> >
@ -412,11 +412,11 @@ const handleCurrentChange = function (val) {
</el-col> </el-col>
<el-col :span="6"> <el-col :span="6">
<div class="head-card-element"> <div class="head-card-element">
<el-text class="mx-1" size="large">退款商品</el-text>
<el-text class="mx-1" >退款商品</el-text>
<el-select <el-select
v-model="refundUser.goodsName" v-model="refundUser.goodsName"
placeholder="请选择退款商品" placeholder="请选择退款商品"
size="large"
style="width: 180px" style="width: 180px"
clearable clearable
@ -432,11 +432,11 @@ const handleCurrentChange = function (val) {
</el-col> </el-col>
<el-col :span="6"> <el-col :span="6">
<div class="head-card-element"> <div class="head-card-element">
<el-text class="mx-1" size="large">所属地区</el-text>
<el-text class="mx-1" >所属地区</el-text>
<el-select <el-select
v-model="refundUser.market" v-model="refundUser.market"
placeholder="请选择所属地区" placeholder="请选择所属地区"
size="large"
style="width: 180px" style="width: 180px"
clearable clearable
> >
@ -453,7 +453,7 @@ const handleCurrentChange = function (val) {
<el-row> <el-row>
<el-col :span="21"> <el-col :span="21">
<div class="head-card-element"> <div class="head-card-element">
<el-text class="mx-1" size="large">退款时间</el-text>
<el-text class="mx-1" >退款时间</el-text>
<el-date-picker <el-date-picker
v-model="getTime" v-model="getTime"
type="datetimerange" type="datetimerange"

Loading…
Cancel
Save