diff --git a/client/src/api/index.js b/client/src/api/index.js
index b03ab3e..bb7883a 100644
--- a/client/src/api/index.js
+++ b/client/src/api/index.js
@@ -24,7 +24,7 @@ export const mealApi = {
}
export const accountApi = {
- index: () => clientRequest.get('/account/'),
+ index: () => clientRequest.get('/account'),
transactions: (params) => clientRequest.get('/account/transactions', { params }),
}
diff --git a/client/src/views/my/Account.vue b/client/src/views/my/Account.vue
index b8f5a40..a2ed298 100644
--- a/client/src/views/my/Account.vue
+++ b/client/src/views/my/Account.vue
@@ -26,12 +26,12 @@ onMounted(async () => {
现金余额
-
¥ {{ (account.cash_balance || 0).toFixed(2) }}
+
¥ {{ Number(account.cash_balance ?? 0).toFixed(2) }}
储值卡余额
-
¥ {{ (account.card_balance || 0).toFixed(2) }}
+
¥ {{ Number(account.card_balance ?? 0).toFixed(2) }}
diff --git a/client/src/views/my/Complaints.vue b/client/src/views/my/Complaints.vue
index b2c9a29..8fa862a 100644
--- a/client/src/views/my/Complaints.vue
+++ b/client/src/views/my/Complaints.vue
@@ -17,8 +17,10 @@ const typeOptions = [
{ text: '其他', value: '其他' },
]
-const statusLabel = { 1: '待处理', 2: '处理中', 3: '已解决' }
-const statusColor = { 1: 'warning', 2: 'primary', 3: 'success' }
+const statusLabel = { 0: '待处理', 1: '处理中', 2: '已解决', 3: '已关闭' }
+const statusColor = { 0: 'warning', 1: 'primary', 2: 'success', 3: 'default' }
+
+const typeLabel = { 1: '服务质量', 2: '餐饮问题', 3: '环境卫生', 4: '其他' }
onMounted(fetchList)
@@ -37,7 +39,14 @@ async function submit() {
}
submitting.value = true
try {
- await complaintApi.create(form.value)
+ // 后端 complaints.type 是 tinyInteger,这里把中文选项映射为数字
+ const typeMap = { '服务质量': 1, '餐饮问题': 2, '环境卫生': 3, '其他': 4 }
+ const payload = {
+ ...form.value,
+ type: typeMap[form.value.type] ?? form.value.type,
+ }
+
+ await complaintApi.create(payload)
showToast({ type: 'success', message: '提交成功' })
showForm.value = false
form.value = { type: '', content: '' }
@@ -60,7 +69,7 @@ async function submit() {