feat: 流水完成

This commit is contained in:
2025-08-14 20:44:04 +08:00
parent 2ff5cc2146
commit 94a7dc3149
3 changed files with 165 additions and 69 deletions
+39 -10
View File
@@ -8,7 +8,7 @@ export function getBalanceAcctFlow(params) {
return request({ return request({
url: "/finance/getBalanceAcctFlow", url: "/finance/getBalanceAcctFlow",
method: "get", method: "get",
data:params, data: params,
}); });
} }
@@ -20,7 +20,7 @@ export function getAcctBalance(params) {
return request({ return request({
url: "/finance/getAcctBalance", url: "/finance/getAcctBalance",
method: "get", method: "get",
data:params, data: params,
}); });
} }
@@ -32,7 +32,7 @@ export function getWithdrawalRule(params) {
return request({ return request({
url: "/finance/getWithdrawalRule", url: "/finance/getWithdrawalRule",
method: "get", method: "get",
data:params, data: params,
}); });
} }
@@ -55,7 +55,7 @@ export function getAcctFlow(params) {
return request({ return request({
url: "/finance/getAcctFlow", url: "/finance/getAcctFlow",
method: "get", method: "get",
data:params, data: params,
}); });
} }
@@ -67,7 +67,7 @@ export function getWithdrawalList(params) {
return request({ return request({
url: "/finance/getWithdrawalList", url: "/finance/getWithdrawalList",
method: "get", method: "get",
data:params, data: params,
}); });
} }
@@ -79,7 +79,7 @@ export function getExchangeRule(params) {
return request({ return request({
url: "/finance/getExchangeRule", url: "/finance/getExchangeRule",
method: "get", method: "get",
data:params, data: params,
}); });
} }
// 兑换 // 兑换
@@ -107,7 +107,7 @@ export function getRechargeSupportPay(params) {
return request({ return request({
url: "/finance/getRechargeSupportPay", url: "/finance/getRechargeSupportPay",
method: "get", method: "get",
data:params, data: params,
}); });
} }
@@ -119,7 +119,7 @@ export function getExchUsers(params) {
return request({ return request({
url: "/finance/getExchUsers", url: "/finance/getExchUsers",
method: "get", method: "get",
data:params, data: params,
}); });
} }
@@ -131,7 +131,7 @@ export function getExchTransferRecord(params) {
return request({ return request({
url: "/finance/getExchTransferRecord", url: "/finance/getExchTransferRecord",
method: "get", method: "get",
data:params, data: params,
}); });
} }
@@ -143,7 +143,7 @@ export function getExchRule(params) {
return request({ return request({
url: "/finance/getExchRule", url: "/finance/getExchRule",
method: "get", method: "get",
data:params, data: params,
}); });
} }
@@ -179,3 +179,32 @@ export function sentEmailCode(data) {
data, data,
}); });
} }
// 流水挖矿统计
export function getAcctMiningStat() {
return request({
url: "/finance/getVcoinStatistics",
method: "get",
});
}
// 流水贡献值
export function getAcctContribution() {
return request({
url: "/finance/getExpend",
method: "get",
});
}
// 查询账户流水
export function getAcctFlowList(data) {
return request({
url: "/finance/getAcctFlow",
method: "get",
data,
});
}
+3 -1
View File
@@ -72,7 +72,8 @@ export default {
// 跳转到详情 // 跳转到详情
jumpBonus(item) { jumpBonus(item) {
uni.navigateTo({ uni.navigateTo({
url: "/pages/mine_package/mine_purse_log/mine_purse_log?category=" + item.categoty + "&lockId=" + item.lockId + "&curId=" + item.curId, url: "/pages/mine_package/mine_purse_log/mine_purse_log?category=" + item.categoty + "&lockId=" + item.lockId + "&curId=" + item.curId + "&preId=" + item.preId,
}) })
}, },
// 查询余额 // 查询余额
@@ -92,6 +93,7 @@ export default {
if (type === "withdraw") {// 提现 if (type === "withdraw") {// 提现
uni.navigateTo({ uni.navigateTo({
url: "/pages/mine_package/mine_purse_bonus_withdraw/mine_purse_bonus_withdraw?amount=" + row.curAmount + "&category=" + row.categoty, url: "/pages/mine_package/mine_purse_bonus_withdraw/mine_purse_bonus_withdraw?amount=" + row.curAmount + "&category=" + row.categoty,
}) })
} else if (type === "recharge") {// 充值 } else if (type === "recharge") {// 充值
uni.navigateTo({ uni.navigateTo({
@@ -20,7 +20,8 @@
<view v-if="form.category === 'vcoin' || form.category === 'bonus' || form.category === 'expend'"> <view v-if="form.category === 'vcoin' || form.category === 'bonus' || form.category === 'expend'">
<view class="info_center_warp"> <view class="info_center_warp">
<view class="info_center_warp-item" v-for="item in source"> <view class="info_center_warp-item" v-for="item in source">
<view class="info_center_warp-item-top">21</view> <view class="info_center_warp-item-top">{{ headerData[item.key] }}</view>
<view class="info_center_warp-item-bottom">{{ item.name }}</view> <view class="info_center_warp-item-bottom">{{ item.name }}</view>
</view> </view>
</view> </view>
@@ -60,7 +61,7 @@
<script> <script>
import Header from '@/components/header.vue'; import Header from '@/components/header.vue';
import { getAcctFlow } from '@/api/finance.js'; import { getAcctFlow, getAcctMiningStat, getAcctContribution, getAcctFlowList } from '@/api/finance.js';
import { getValue, BALANCE_TYPE } from '@/utils/enumUtils.js'; import { getValue, BALANCE_TYPE } from '@/utils/enumUtils.js';
import { formatDate, handleAmount } from '@/utils/index.js'; import { formatDate, handleAmount } from '@/utils/index.js';
@@ -71,6 +72,7 @@ export default {
} }
}, },
components: { Header }, components: { Header },
data() { data() {
return { return {
infoList: [ infoList: [
@@ -82,8 +84,14 @@ export default {
name: "锁定账户", name: "锁定账户",
key: "lock" key: "lock"
}, },
{
name: "预存款账户",
key: "pre"
},
], ],
source: [], source: [],
headerData: {},
selInfo: "cur", selInfo: "cur",
form: { form: {
id: 0, id: 0,
@@ -94,6 +102,7 @@ export default {
orderList: [], orderList: [],
lockId: 0, lockId: 0,
curId: 0, curId: 0,
preId: 0,
} }
}, },
onLoad(option) { onLoad(option) {
@@ -103,6 +112,8 @@ export default {
} }
const lockId = option.lockId; const lockId = option.lockId;
const curId = option.curId; const curId = option.curId;
const preId = option.preId;
// 分红金额 // 分红金额
if (category === 'bonus') { if (category === 'bonus') {
@@ -128,56 +139,105 @@ export default {
// TBC // TBC
if (category === 'vcoin') { if (category === 'vcoin') {
this.onGetAcctMiningStat();
this.source = [ this.source = [
{ {
name: "商城总挖矿数量", name: "商城总挖矿数量",
key: "cur" key: "mallTotalMiningSum"
}, },
{ {
name: "已兑换数量", name: "已兑换数量",
key: "lock" key: "exchangeNumber"
}, },
]; ];
} }
// 贡献值 expend // 贡献值 expend
if (category === 'expend') { if (category === 'expend') {
this.onGetAcctContribution();
this.source = [ this.source = [
{ {
name: "今日贡献值", name: "今日贡献值",
key: "cur" key: "todayValue"
}, },
{ {
name: "总贡献值", name: "总贡献值",
key: "lock" key: "totalValue"
}, },
{ {
name: "今日商城贡献值", name: "今日商城贡献值",
key: "lock" key: "todayMallValue"
}, },
{ {
name: "我的占比", name: "我的占比",
key: "lock" key: "ratio"
}, },
]; ];
} }
if (lockId && lockId !== 'null') { if (lockId && lockId !== 'null') {
this.lockId = lockId; this.lockId = lockId;
// this.selectInfo(this.infoList[1]); // this.selectInfo(this.infoList[1]);
} }
if (curId && curId !== 'null') { if (curId && curId !== 'null') {
this.curId = curId; this.curId = curId;
this.selectInfo(this.infoList[0]); this.selectInfo(this.infoList[0]);
} }
if (preId && preId !== 'null') {
this.preId = preId;
}
this.onGetAcctFlowList();
}, },
methods: { methods: {
getValue, getValue,
formatDate, formatDate,
handleAmount, handleAmount,
// 流水挖矿统计
async onGetAcctMiningStat() {
const resp = await getAcctMiningStat();
console.log("流水挖矿统计", resp);
if (resp && resp.bizcode === 100) {
this.headerData = resp.data || {};
} else {
return [];
}
},
// 流水贡献值
async onGetAcctContribution() {
const resp = await getAcctContribution();
console.log("流水贡献值", resp);
if (resp && resp.bizcode === 100) {
if (resp.data.ratio) {
resp.data.ratio = resp.data.ratio * 100 + '%';
}
this.headerData = resp.data || {};
} else {
return [];
}
},
// 查询账户流水
// async onGetAcctFlowList() {
// const resp = await getAcctFlowList(this.form);
// console.log("查询账户流水", resp);
// if (resp && resp.bizcode === 100) {
// this.orderList = resp.data || [];
// } else {
// return [];
// }
// },
selectInfo(item) { selectInfo(item) {
this.orderList = []; this.orderList = [];
this.form.page = 1; this.form.page = 1;
@@ -189,6 +249,10 @@ export default {
if (item.key === "lock") { if (item.key === "lock") {
id = this.lockId; id = this.lockId;
} }
if (item.key === "pre") {
id = this.preId;
}
this.form.id = id; this.form.id = id;
this.loadData(); this.loadData();
}, },
@@ -208,7 +272,8 @@ export default {
this.loading = false; // 设置加载状态为false this.loading = false; // 设置加载状态为false
} }
}, },
// 模拟获取数据的方法,实际应用中应该替换为你的数据获取逻辑,例如从服务器获取数据
// 列表数据
async fetchData(page, pageSize) { async fetchData(page, pageSize) {
if (!this.form.id || this.form.id === 0) { if (!this.form.id || this.form.id === 0) {
return []; return [];
@@ -220,8 +285,8 @@ export default {
pageSize, pageSize,
} }
console.log("params", params); console.log("params", params);
const resp = await getAcctFlow(params); const resp = await getAcctFlowList(params);
console.log("resp", resp); console.log("列表数据---1", resp);
if (resp && resp.bizcode === 100) { if (resp && resp.bizcode === 100) {
const data = resp.data && resp.data.entitys || []; const data = resp.data && resp.data.entitys || [];
return data return data
@@ -253,7 +318,7 @@ export default {
.info_title_warp { .info_title_warp {
display: flex; display: flex;
justify-content: space-around; justify-content: space-around;
padding: 0 100rpx; padding: 0 50rpx;
.info_title_item_warp { .info_title_item_warp {