feat: 新增提现记录功能及相关调整

- 新增提现记录页面并在pages.json中注册路由
- 在存款操作页添加提现记录入口
- 新增两个提现相关的API接口
- 修复发票详情页CSS深度选择器兼容性问题
- 修复操作页面末尾缺失的换行符
This commit is contained in:
pikachu1995@126.com
2026-05-20 11:30:15 +08:00
parent b7cfe13ffd
commit d5663cfb4d
5 changed files with 284 additions and 3 deletions

View File

@@ -23,6 +23,23 @@ export function withdrawalApply(params) {
});
}
export function getWithdrawApplyPage(params) {
return http.request({
url: "/member/withdrawApply",
method: Method.GET,
needToken: true,
params,
});
}
export function getWithdrawApplyWechatTransferInfo(id) {
return http.request({
url: `/member/withdrawApply/wechat/transfer/${id}`,
method: Method.GET,
needToken: true,
});
}
/**
* 支付结果查询
* @param orderType 交易类型,可用值:TRADE,ORDER,RECHARGE

View File

@@ -211,6 +211,12 @@
}
},
{
"path": "deposit/withdrawApply",
"style": {
"navigationStyle": "custom"
}
},
{
"path": "deposit/info",

View File

@@ -15,6 +15,12 @@
<u-icon name="arrow-right"></u-icon>
</div>
</div>
<div class="box list" @click="navigateTo('/pages/mine/deposit/withdrawApply')">
<div class="list-left">提现记录</div>
<div class="list-right">
<u-icon name="arrow-right"></u-icon>
</div>
</div>
</div>
</template>

View File

@@ -0,0 +1,252 @@
<template>
<view class="wap">
<u-navbar title="提现记录"></u-navbar>
<scroll-view class="scroll-v view-wrapper" enableBackToTop="true" scroll-with-animation scroll-y @scrolltolower="loadMore">
<view v-if="records.length != 0" class="view-item" v-for="(item, index) in records" :key="index">
<view class="view-item-detail">
<view class="-title">{{ withdrawStatusText(item.applyStatus) }}</view>
<view class="-number" v-if="item.inspectRemark || item.errorMessage">{{ item.inspectRemark || item.errorMessage }}</view>
</view>
<view class="view-item-change">
<view class="-money">-{{ item.applyMoney | unitPrice }}</view>
<view class="-time">{{ item.createTime || item.inspectTime || "" }}</view>
<view v-if="item.applyStatus === 'WAIT_USER_CONFIRM'" class="confirm-btn" @click.stop="confirmWechatReceive(item)">确认收款</view>
</view>
</view>
<u-empty v-if="loaded && records.length == 0" mode="history" text="暂无记录" />
</scroll-view>
</view>
</template>
<script>
import { getWithdrawApplyPage, getWithdrawApplyWechatTransferInfo } from "@/api/members";
export default {
data() {
return {
loaded: false,
params: {
pageNumber: 1,
pageSize: 10,
order: "desc",
},
records: [],
};
},
onShow() {
this.params.pageNumber = 1;
this.records = [];
this.loaded = false;
this.getData();
},
methods: {
withdrawStatusText(applyStatus) {
switch (applyStatus) {
case "APPLY":
return "申请中";
case "VIA_AUDITING":
return "审核通过";
case "D_VIA_AUDITING":
return "分销提现审核通过";
case "FAIL_AUDITING":
return "审核未通过";
case "D_FAIL_AUDITING":
return "分销提现审核未通过";
case "WAIT_USER_CONFIRM":
return "等待用户确认";
case "SUCCESS":
return "提现成功";
case "ERROR":
return "提现失败";
default:
return applyStatus || "";
}
},
getData() {
getWithdrawApplyPage(this.params).then((res) => {
this.loaded = true;
if (res.data.success) {
if (res.data.result.records.length != 0) {
this.records.push(...res.data.result.records);
}
}
});
},
loadMore() {
this.params.pageNumber++;
this.getData();
},
confirmWechatReceive(item) {
const id = item && item.id;
if (!id) {
uni.showToast({
title: "缺少提现记录ID",
duration: 2000,
icon: "none",
});
return;
}
uni.showLoading({
title: "加载中",
});
getWithdrawApplyWechatTransferInfo(id)
.then((res) => {
if (!res.data || !res.data.success) return;
const info = res.data.result || {};
const mchId = info.mchId;
const wechatPackage = info.wechatPackage;
let appId = info.appId;
if (typeof wx !== "undefined" && wx.getAccountInfoSync) {
try {
const accountInfo = wx.getAccountInfoSync();
const mpAppId = accountInfo && accountInfo.miniProgram && accountInfo.miniProgram.appId;
if (mpAppId) appId = mpAppId;
} catch (e) {}
}
if (!mchId || !appId || !wechatPackage) {
uni.showToast({
title: "微信确认参数缺失",
duration: 2000,
icon: "none",
});
return;
}
const openResultToast = (errMsg) => {
if (errMsg === "requestMerchantTransfer:ok") {
uni.showToast({
title: "已唤起确认页面",
duration: 2000,
icon: "none",
});
return;
}
if (errMsg === "requestMerchantTransfer:cancel") {
uni.showToast({
title: "已取消",
duration: 2000,
icon: "none",
});
return;
}
uni.showToast({
title: errMsg ? `唤起失败:${errMsg}` : "唤起失败",
duration: 2500,
icon: "none",
});
};
if (typeof wx !== "undefined" && wx.getSystemInfoSync) {
try {
const sys = wx.getSystemInfoSync();
if (sys && sys.platform === "devtools") {
uni.showToast({
title: "开发者工具可能不支持,请真机测试",
duration: 2500,
icon: "none",
});
}
} catch (e) {}
}
if (typeof wx !== "undefined" && wx.canIUse && wx.canIUse("requestMerchantTransfer")) {
wx.requestMerchantTransfer({
mchId,
appId,
package: wechatPackage,
success: (r) => {
openResultToast(r && (r.errMsg || r.err_msg));
},
fail: (r) => {
openResultToast(r && (r.errMsg || r.err_msg));
},
});
return;
}
if (typeof WeixinJSBridge !== "undefined" && WeixinJSBridge.invoke) {
WeixinJSBridge.invoke(
"requestMerchantTransfer",
{
mchId,
appId,
package: wechatPackage,
},
(r) => {
openResultToast(r && (r.errMsg || r.err_msg));
}
);
return;
}
uni.showToast({
title: "请在微信内打开确认收款",
duration: 2000,
icon: "none",
});
})
.finally(() => {
uni.hideLoading();
});
},
},
};
</script>
<style lang="scss" scoped>
.view-item {
padding: 32rpx;
display: flex;
justify-content: space-between;
align-items: center;
}
.view-item-change {
text-align: right;
> .-money {
font-size: 36rpx;
color: $main-color;
font-weight: bold;
}
> .-time {
font-size: 22rpx;
color: #999;
}
> .confirm-btn {
display: inline-block;
margin-top: 12rpx;
padding: 12rpx 20rpx;
font-size: 24rpx;
border-radius: 8rpx;
background: $main-color;
color: #fff;
}
}
.view-item-detail {
line-height: 1.75;
flex: 1;
overflow: hidden;
> .-title {
font-size: 28rpx;
}
> .-number {
font-size: 22rpx;
color: #999;
overflow: hidden;
text-overflow: ellipsis;
white-space: nowrap;
}
}
.wap {
width: 100%;
height: calc(100vh - 44px);
}
.scroll-v {
height: calc(100vh - 88rpx);
}
</style>

View File

@@ -368,12 +368,12 @@ export default {
color: #333333;
}
/deep/ .u-cell__value {
::v-deep .u-cell__value {
flex: 1.6;
overflow: visible;
}
/deep/ .u-cell__value-text {
::v-deep .u-cell__value-text {
white-space: normal;
word-break: break-all;
}