diff --git a/src/router/index.js b/src/router/index.js
index 0c6e40c..47bc4bc 100644
--- a/src/router/index.js
+++ b/src/router/index.js
@@ -31,7 +31,7 @@ const routes = [
{
path: '/mymatching',
name: 'MyMatching',
- component: () => import('@/views/MyMatching.vue'),
+ component: () => import('@/views/Matching.vue'),
meta: {
title: '资金匹配',
requiresAuth: true
diff --git a/src/utils/api.js b/src/utils/api.js
index aa42253..45851b9 100644
--- a/src/utils/api.js
+++ b/src/utils/api.js
@@ -100,8 +100,13 @@ api.interceptors.response.use(
ElMessage.error('服务器内部错误')
break
+ case 400:
+ // 处理业务逻辑错误(如坏账等)
+ ElMessage.error(data.error?.message || data.message || '请求失败')
+ break
+
default:
- ElMessage.error(data.message || '请求失败')
+ ElMessage.error(data.error?.message || data.message || '请求失败')
}
} else if (error.request) {
// 网络错误
diff --git a/src/views/AgentDashboard.vue b/src/views/AgentDashboard.vue
index 412fd1c..91095f3 100644
--- a/src/views/AgentDashboard.vue
+++ b/src/views/AgentDashboard.vue
@@ -41,7 +41,7 @@
{{ stats.used_codes || 0 }}
-
已使用邀请码
+
已使用二维码
有效:{{ stats.active_codes || 0 }}
@@ -52,9 +52,9 @@
转账信息
-
收款人: {{ transferDialog.toUser.name }}
+
收款人: {{ transferDialog.toUser.to_user_real_name }}
转账金额: ¥{{ transferDialog.amount }}
@@ -378,7 +378,8 @@ export default {
wechatQr: '',
alipayQr: '',
unionpayQr: '',
- bankCard: ''
+ bankCard: '',
+ to_user_real_name:'',
},
amount: 0,
actualAmount: 0,
@@ -534,7 +535,8 @@ export default {
wechatQr: userPaymentInfo.wechat_qr,
alipayQr: userPaymentInfo.alipay_qr,
unionpayQr: userPaymentInfo.unionpay_qr,
- bankCard: userPaymentInfo.bank_card
+ bankCard: userPaymentInfo.bank_card,
+ to_user_real_name: allocation.to_user_real_name,
},
amount: expectedAmount,
actualAmount: expectedAmount
diff --git a/src/views/MyMatching.vue b/src/views/MyMatching.vue
index 4b00ce1..d685ce7 100644
--- a/src/views/MyMatching.vue
+++ b/src/views/MyMatching.vue
@@ -290,6 +290,41 @@ export default {
window.addEventListener('autoStartMatching', handleAutoStartMatching)
},
methods: {
+ /**
+ * 确认分配并创建转账记录
+ * @param {number} allocationId - 分配ID
+ * @param {number} expectedAmount - 预期转账金额
+ */
+ async confirmAllocation(allocationId, expectedAmount) {
+ try {
+ // 获取分配详情和收款用户信息
+ const allocationResponse = await api.get(`/matching/allocation/${allocationId}`)
+ const allocation = allocationResponse.data.data
+
+ // 获取收款用户的收款码信息
+ const userResponse = await api.get(`/users/payment-info/${allocation.to_user_id}`)
+ const userPaymentInfo = userResponse.data.data
+
+ // 设置转账弹窗数据
+ this.transferDialog = {
+ visible: true,
+ allocationId: allocationId,
+ toUser: {
+ id: allocation.to_user_id,
+ name: allocation.to_user_name,
+ wechatQr: userPaymentInfo.wechat_qr,
+ alipayQr: userPaymentInfo.alipay_qr,
+ unionpayQr: userPaymentInfo.unionpay_qr,
+ bankCard: userPaymentInfo.bank_card
+ },
+ amount: expectedAmount,
+ actualAmount: expectedAmount
+ }
+ } catch (error) {
+ console.error('获取转账信息失败:', error)
+ this.$message.error('获取转账信息失败')
+ }
+ },
formatDeadline(deadlineString) {
// 根据需要的格式进行处理,示例:
return new Date(deadlineString).toLocaleString('zh-CN', {
diff --git a/src/views/MyProfile.vue b/src/views/MyProfile.vue
index 95aa712..4f55825 100644
--- a/src/views/MyProfile.vue
+++ b/src/views/MyProfile.vue
@@ -156,12 +156,15 @@ export default {
// 加载账户信息
const loadAccountInfo = async () => {
try {
+ console.log(userStore.user,'userStore.user');
+
if (userStore.user?.id) {
const response = await api.get(`/user/profile`);
+ console.log(response.data);
if (response.data.success) {
- accountInfo.value = response.data.data || { balance: '0.00' };
+ accountInfo.value = response.data.user || { balance: '0.00' };
// 确保加载头像
- if (response.data.data?.avatar) {
+ if (response.data.user?.avatar) {
avatarUrl.value = response.data.data.avatar;
// 更新store中的头像
if(userStore.user) {
diff --git a/src/views/MyShop.vue b/src/views/MyShop.vue
index c05b393..4eac683 100644
--- a/src/views/MyShop.vue
+++ b/src/views/MyShop.vue
@@ -32,10 +32,15 @@