接口变量对接
This commit is contained in:
@@ -250,10 +250,9 @@ import {getImageUrl} from "@/utils/config";
|
||||
|
||||
// 响应式数据
|
||||
const loading = ref(false)
|
||||
const directSaler = ref({})
|
||||
const directSaleList = ref([])
|
||||
const directSaleStats = ref({
|
||||
total_users: 0,
|
||||
total: 0,
|
||||
total_beans: 0,
|
||||
today_withdrawals: 0,
|
||||
total_withdrawals: 0
|
||||
@@ -273,15 +272,6 @@ const pagination = reactive({
|
||||
|
||||
// 创建直营
|
||||
const createDirectSaler = async () => {
|
||||
// try {
|
||||
// console.log("创建直营数据:",directSaler)
|
||||
// await api.directSale.createDirectSale(directSaler.value)
|
||||
// ElMessage.success('创建直营成功')
|
||||
// getDirectSaleList()
|
||||
// } catch (error) {
|
||||
// console.log(error)
|
||||
// ElMessage.error('创建直营失败')
|
||||
// }
|
||||
isEdit.value = false
|
||||
resetUserForm()
|
||||
dialogVisible.value = true
|
||||
@@ -300,23 +290,14 @@ const getDirectSaleList = async () => {
|
||||
const response = await api.directSale.listUsers(params)
|
||||
directSaleList.value = response.data.data.users
|
||||
pagination.total = response.data.data.pagination.total
|
||||
directSaleStats.value = response.data.data.pagination // TODO 统计
|
||||
|
||||
// TODO 统计
|
||||
directSaleStats.value.total = response.data.data.pagination.total
|
||||
directSaleStats.value.total_beans = response.data.data.all_total.balance_total
|
||||
directSaleStats.value.today_withdrawals = response.data.data.all_total.withdraw_num_total
|
||||
directSaleStats.value.total_withdrawals = response.data.data.all_total.withdraw_total
|
||||
//directSaleStats.value = response.data.data.pagination
|
||||
} catch (error) {
|
||||
directSaleList.value = [{
|
||||
id: 1,
|
||||
real_name: '张三',
|
||||
phone: '13800000000',
|
||||
balance: 1000,
|
||||
level: 'normal',
|
||||
created_at: '2023-01-01 00:00:00'
|
||||
}, {
|
||||
id: 2,
|
||||
real_name: '李四',
|
||||
phone: '13900000000',
|
||||
balance: 2000,
|
||||
level: 'vip',
|
||||
created_at: '2023-01-02 00:00:00'
|
||||
}]
|
||||
console.log(error)
|
||||
ElMessage.error('获取直营列表失败')
|
||||
} finally {
|
||||
|
||||
@@ -76,7 +76,7 @@
|
||||
</el-icon>
|
||||
</div>
|
||||
<div class="stats-info">
|
||||
<div class="stat-value">¥{{ formatBalance(stats.total_balance) }}</div>
|
||||
<div class="stat-value">¥{{ Math.abs(formatBalance(stats.total_balance)) }}</div>
|
||||
<div class="stat-label">用户总余额</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
Reference in New Issue
Block a user