diff --git a/src/api/admin/order.js b/src/api/admin/order.js index 69fcb62..f656685 100644 --- a/src/api/admin/order.js +++ b/src/api/admin/order.js @@ -7,6 +7,14 @@ export const getOrderList = (params) => { export const getOrderDetail = (params) => { return http2.get('/api/v1/admin/order/detail', {params: params}) } +/**计算新购订单价格 */ +export const getOrderPrice = (data) => { + return http2.post('/api/v1/admin/order/price', data, { + headers:{ + 'Content-Type':'multipart/form-data' + } + }) +} /**删除订单 (未提供删除接口,暂时保留) */ /**删除订单 */ export const deleteOrder = (data) => { diff --git a/src/api/admin/pay007.js b/src/api/admin/pay007.js index 2dd5253..c03e275 100644 --- a/src/api/admin/pay007.js +++ b/src/api/admin/pay007.js @@ -13,3 +13,13 @@ export const updatePay007Config = (data) => { } }) } + +/** 查询 007pay 订单 */ +export const getPay007Orders = (params) => { + return http2.get('/api/v1/admin/pay007/orders', { params }) +} + +/** 查询 007pay 收益统计 */ +export const getPay007Stats = (params) => { + return http2.get('/api/v1/admin/pay007/stats', { params }) +} diff --git a/src/config/menus.js b/src/config/menus.js index fcc3776..394f289 100644 --- a/src/config/menus.js +++ b/src/config/menus.js @@ -69,6 +69,10 @@ export const menus = [ path: '/order/list', title: '订单列表' }, + { + path: '/order/pay007-orders', + title: '007pay订单' + }, { path: '/order/payment-config', title: '支付配置' diff --git a/src/router/index.js b/src/router/index.js index 97b9a04..656d932 100644 --- a/src/router/index.js +++ b/src/router/index.js @@ -314,6 +314,14 @@ const routes = [ title: '订单列表' } }, + { + path: 'pay007-orders', + name: 'Pay007Orders', + component: () => import('../views/order/Pay007Orders.vue'), + meta: { + title: '007pay订单' + } + }, { path: 'payment-config', name: 'PaymentConfig', diff --git a/src/views/dashboard/Dashboard.vue b/src/views/dashboard/Dashboard.vue index f74beb1..f1108fa 100644 --- a/src/views/dashboard/Dashboard.vue +++ b/src/views/dashboard/Dashboard.vue @@ -28,6 +28,77 @@ + + + + +
+
+
007pay Revenue
+

收益计算中心

+

日维度与月维度的到账、退款、手续费、净收益联动对比

+
+ + + +
+ +
+
+
{{ item.label }}
+
{{ item.value }}
+ +
{{ item.detail }}
+
+
+ + +
+
+
+ + +
+
+

日月对比

+

{{ revenueSnapshotText }}

+
+
+
+
+
+ {{ row.label }} + {{ row.value }} +
+
+ {{ row.subLabel }} + {{ row.subValue }} +
+
+
+
+
+
+
+
+
{{ item.value }}
+
{{ item.label }}
+
+
+
+
+
+
@@ -521,9 +540,39 @@ +
+
+
+ 实时价格 + 已手动调整 +
+ + 重新计算 + +
+
+
+ 月基础价 + ¥{{ formatYuan(orderPriceQuote.base_price) }} +
+
+ 优惠前总价 + ¥{{ formatYuan(orderPriceQuote.all_price) }} +
+
+ 实际应付 + ¥{{ formatYuan(orderPriceQuote.price) }} +
+
+ 续费月价 + ¥{{ formatYuan(orderPriceQuote.renew_price) }} +
+
+
等待报价
+
- +
@@ -531,7 +580,7 @@ - +
@@ -540,12 +589,12 @@ - + - + @@ -568,6 +617,16 @@ + + + @@ -721,11 +780,11 @@ diff --git a/src/views/product/UserGoodsDetail.vue b/src/views/product/UserGoodsDetail.vue index e396ce8..d7638d4 100644 --- a/src/views/product/UserGoodsDetail.vue +++ b/src/views/product/UserGoodsDetail.vue @@ -258,6 +258,16 @@ + + + @@ -559,6 +559,7 @@ const formatExpireTime = (t) => { // 判断用户商品是否已删除(后端返回 deleteAt 字段,有值即已删除) const isDeleted = (row) => !!(row?.deleteAt || row?.DeleteAt || row?.deleted_at) +const isPending = (row) => String(row?.status || row?.Status || '').toLowerCase() === 'pending' // 判断用户商品是否已到期(永久商品除外) const isExpired = (row) => { diff --git a/src/views/user/UserBalance.vue b/src/views/user/UserBalance.vue index d72e3d0..964b5b9 100644 --- a/src/views/user/UserBalance.vue +++ b/src/views/user/UserBalance.vue @@ -92,11 +92,6 @@ {{ formatDateTime(row.CreatedAt) }} - - -
@@ -131,6 +126,16 @@ 减少 + + + @@ -180,28 +185,6 @@ - - - - - - - - - - - - 退回余额 - 提现 - -
退回余额:将退款金额添加到对应余额;提现:将退款金额提现
-
-
- -
@@ -210,7 +193,7 @@ import { ref, reactive, onMounted, computed, watch } from 'vue' import { useRoute, useRouter } from 'vue-router' import { ElMessage } from 'element-plus' import { Refresh, ArrowLeft } from '@element-plus/icons-vue' -import { getUserBalanceRecord, editUserBalance, addUserConsumption, getUserBalanceCount, getUserList, refundBalance } from '@/api/admin/user' +import { getUserBalanceRecord, editUserBalance, addUserConsumption, getUserBalanceCount, getUserList } from '@/api/admin/user' const route = useRoute() const router = useRouter() @@ -246,11 +229,8 @@ const userList = ref([]) // 对话框 const balanceDialogVisible = ref(false) const recordDialogVisible = ref(false) -const refundDialogVisible = ref(false) const balanceFormRef = ref(null) const recordFormRef = ref(null) -const refundFormRef = ref(null) -const refundLoading = ref(false) // 余额表单 const balanceForm = reactive({ @@ -258,7 +238,8 @@ const balanceForm = reactive({ balance_type: '', price: 0, state: 'add', - note: '' + note: '', + account_amount: false }) const balanceRules = { @@ -290,18 +271,6 @@ const recordRules = { note: [{ required: true, message: '请输入备注', trigger: 'blur' }] } -// 退款表单 -const refundForm = reactive({ - history_id: 0, - order_id: 0, - bandwidth: false -}) - -const refundRules = { - order_id: [{ required: true, message: '请输入订单ID', trigger: 'blur' }], - bandwidth: [{ required: true, message: '请选择退款方式', trigger: 'change' }] -} - // 当前余额显示 const currentBalanceDisplay = computed(() => { const balance = balanceList.value.find(b => userBalance[b.type]?.type === balanceForm.balance_type) @@ -445,7 +414,8 @@ const handleEditBalance = (balanceType) => { balance_type: apiType, price: 0, state: 'add', - note: '' + note: '', + account_amount: false }) balanceDialogVisible.value = true } @@ -471,7 +441,11 @@ const submitBalanceForm = () => { balanceFormRef.value?.validate(async (valid) => { if (valid) { try { - const res = await editUserBalance(balanceForm) + const submitData = { ...balanceForm } + if (submitData.state !== 'add' || !submitData.account_amount) { + delete submitData.account_amount + } + const res = await editUserBalance(submitData) if (res.data.code === 200) { ElMessage.success('修改成功') balanceDialogVisible.value = false @@ -517,40 +491,6 @@ const handleRecordCurrentChange = () => { fetchBalanceRecord() } -// 退款 -const handleRefund = (row) => { - Object.assign(refundForm, { - history_id: row.Id, - order_id: String(row.OrderId) || 0, - bandwidth: false - }) - refundDialogVisible.value = true -} - -// 提交退款 -const submitRefundForm = () => { - refundFormRef.value?.validate(async (valid) => { - if (valid) { - refundLoading.value = true - try { - const res = await refundBalance(refundForm) - if (res.data.code === 200) { - ElMessage.success('退款成功') - refundDialogVisible.value = false - fetchUserBalance() - } else { - ElMessage.error(res.data.message || '退款失败') - } - } catch (error) { - console.error('退款错误:', error) - ElMessage.error('退款失败') - } finally { - refundLoading.value = false - } - } - }) -} - // 初始化 onMounted(() => { getUserListData() @@ -573,6 +513,15 @@ watch( }, { immediate: true } ) + +watch( + () => balanceForm.state, + (state) => { + if (state !== 'add') { + balanceForm.account_amount = false + } + } +)