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
+83 -54
View File
@@ -6,9 +6,9 @@ import request from '@/utils/request.js'; // 引入封装的方法
*/
export function getBalanceAcctFlow(params) {
return request({
url: "/finance/getBalanceAcctFlow",
method: "get",
data:params,
url: "/finance/getBalanceAcctFlow",
method: "get",
data: params,
});
}
@@ -18,9 +18,9 @@ export function getBalanceAcctFlow(params) {
*/
export function getAcctBalance(params) {
return request({
url: "/finance/getAcctBalance",
method: "get",
data:params,
url: "/finance/getAcctBalance",
method: "get",
data: params,
});
}
@@ -30,9 +30,9 @@ export function getAcctBalance(params) {
*/
export function getWithdrawalRule(params) {
return request({
url: "/finance/getWithdrawalRule",
method: "get",
data:params,
url: "/finance/getWithdrawalRule",
method: "get",
data: params,
});
}
@@ -41,10 +41,10 @@ export function getWithdrawalRule(params) {
export function withdrawal(data) {
// return request.post('/common/getSmsCode',qs.stringify(params));
return request({
url: "/finance/withdrawal",
method: "post",
data,
});
url: "/finance/withdrawal",
method: "post",
data,
});
}
/**
@@ -53,9 +53,9 @@ export function withdrawal(data) {
*/
export function getAcctFlow(params) {
return request({
url: "/finance/getAcctFlow",
method: "get",
data:params,
url: "/finance/getAcctFlow",
method: "get",
data: params,
});
}
@@ -65,9 +65,9 @@ export function getAcctFlow(params) {
*/
export function getWithdrawalList(params) {
return request({
url: "/finance/getWithdrawalList",
method: "get",
data:params,
url: "/finance/getWithdrawalList",
method: "get",
data: params,
});
}
@@ -77,26 +77,26 @@ export function getWithdrawalList(params) {
*/
export function getExchangeRule(params) {
return request({
url: "/finance/getExchangeRule",
method: "get",
data:params,
url: "/finance/getExchangeRule",
method: "get",
data: params,
});
}
// 兑换
export function exchange(data) {
return request({
url: "/finance/exchange",
method: "post",
data,
});
url: "/finance/exchange",
method: "post",
data,
});
}
// 充值
export function recharge(data) {
return request({
url: "/finance/recharge",
method: "post",
data,
url: "/finance/recharge",
method: "post",
data,
});
}
/**
@@ -105,9 +105,9 @@ export function recharge(data) {
*/
export function getRechargeSupportPay(params) {
return request({
url: "/finance/getRechargeSupportPay",
method: "get",
data:params,
url: "/finance/getRechargeSupportPay",
method: "get",
data: params,
});
}
@@ -117,9 +117,9 @@ export function getRechargeSupportPay(params) {
*/
export function getExchUsers(params) {
return request({
url: "/finance/getExchUsers",
method: "get",
data:params,
url: "/finance/getExchUsers",
method: "get",
data: params,
});
}
@@ -129,9 +129,9 @@ export function getExchUsers(params) {
*/
export function getExchTransferRecord(params) {
return request({
url: "/finance/getExchTransferRecord",
method: "get",
data:params,
url: "/finance/getExchTransferRecord",
method: "get",
data: params,
});
}
@@ -141,41 +141,70 @@ export function getExchTransferRecord(params) {
*/
export function getExchRule(params) {
return request({
url: "/finance/getExchRule",
method: "get",
data:params,
url: "/finance/getExchRule",
method: "get",
data: params,
});
}
// 交易所兑换【OK】
export function exchTransfer(data) {
return request({
url: "/finance/exchTransfer",
method: "post",
data,
url: "/finance/exchTransfer",
method: "post",
data,
});
}
// 绑定交易所账户【OK】
export function bindExchUsers(data) {
return request({
url: "/finance/bindExchUsers",
method: "post",
data,
url: "/finance/bindExchUsers",
method: "post",
data,
});
}
// 注册交易所账户【OK】
export function registerExchUser(data) {
return request({
url: "/finance/registerExchUser",
method: "post",
data,
url: "/finance/registerExchUser",
method: "post",
data,
});
}
// 获取注册交易所账户验证码【OK】
export function sentEmailCode(data) {
return request({
url: "/finance/sentEmailCode",
method: "post",
data,
url: "/finance/sentEmailCode",
method: "post",
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) {
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") {// 提现
uni.navigateTo({
url: "/pages/mine_package/mine_purse_bonus_withdraw/mine_purse_bonus_withdraw?amount=" + row.curAmount + "&category=" + row.categoty,
})
} else if (type === "recharge") {// 充值
uni.navigateTo({
@@ -20,7 +20,8 @@
<view v-if="form.category === 'vcoin' || form.category === 'bonus' || form.category === 'expend'">
<view class="info_center_warp">
<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>
</view>
@@ -60,7 +61,7 @@
<script>
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 { formatDate, handleAmount } from '@/utils/index.js';
@@ -71,6 +72,7 @@ export default {
}
},
components: { Header },
data() {
return {
infoList: [
@@ -82,8 +84,14 @@ export default {
name: "锁定账户",
key: "lock"
},
{
name: "预存款账户",
key: "pre"
},
],
source: [],
headerData: {},
selInfo: "cur",
form: {
id: 0,
@@ -94,6 +102,7 @@ export default {
orderList: [],
lockId: 0,
curId: 0,
preId: 0,
}
},
onLoad(option) {
@@ -103,6 +112,8 @@ export default {
}
const lockId = option.lockId;
const curId = option.curId;
const preId = option.preId;
// 分红金额
if (category === 'bonus') {
@@ -128,56 +139,105 @@ export default {
// TBC
if (category === 'vcoin') {
this.onGetAcctMiningStat();
this.source = [
{
name: "商城总挖矿数量",
key: "cur"
key: "mallTotalMiningSum"
},
{
name: "已兑换数量",
key: "lock"
key: "exchangeNumber"
},
];
}
// 贡献值 expend
if (category === 'expend') {
this.onGetAcctContribution();
this.source = [
{
name: "今日贡献值",
key: "cur"
key: "todayValue"
},
{
name: "总贡献值",
key: "lock"
key: "totalValue"
},
{
name: "今日商城贡献值",
key: "lock"
key: "todayMallValue"
},
{
name: "我的占比",
key: "lock"
key: "ratio"
},
];
}
if (lockId && lockId !== 'null') {
this.lockId = lockId;
// this.selectInfo(this.infoList[1]);
}
if (curId && curId !== 'null') {
this.curId = curId;
this.selectInfo(this.infoList[0]);
}
if (preId && preId !== 'null') {
this.preId = preId;
}
this.onGetAcctFlowList();
},
methods: {
getValue,
formatDate,
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) {
this.orderList = [];
this.form.page = 1;
@@ -189,6 +249,10 @@ export default {
if (item.key === "lock") {
id = this.lockId;
}
if (item.key === "pre") {
id = this.preId;
}
this.form.id = id;
this.loadData();
},
@@ -208,7 +272,8 @@ export default {
this.loading = false; // 设置加载状态为false
}
},
// 模拟获取数据的方法,实际应用中应该替换为你的数据获取逻辑,例如从服务器获取数据
// 列表数据
async fetchData(page, pageSize) {
if (!this.form.id || this.form.id === 0) {
return [];
@@ -220,8 +285,8 @@ export default {
pageSize,
}
console.log("params", params);
const resp = await getAcctFlow(params);
console.log("resp", resp);
const resp = await getAcctFlowList(params);
console.log("列表数据---1", resp);
if (resp && resp.bizcode === 100) {
const data = resp.data && resp.data.entitys || [];
return data
@@ -253,7 +318,7 @@ export default {
.info_title_warp {
display: flex;
justify-content: space-around;
padding: 0 100rpx;
padding: 0 50rpx;
.info_title_item_warp {