部分接口调整,修复提现页面点击弹窗确认按钮卡死问题

This commit is contained in:
2025-08-05 18:02:39 +08:00
parent d3dc2e8a87
commit 1eb645705d
3 changed files with 21 additions and 13 deletions

View File

@@ -8,9 +8,9 @@ export const selectNewApp = (data) => {
return http.request({ return http.request({
url: '/user/selectNewApp', url: '/user/selectNewApp',
data: data, data: data,
method: 'POST',
}) })
} }
/** /**
* 获取用户信息 * 获取用户信息
*/ */

View File

@@ -23,7 +23,7 @@ function getHeader(data) {
} }
// 通用处理逻辑 // 通用处理逻辑
function commonsProcess(showLoading, httpReqCallback, isreturm) { function commonsProcess(showLoading, httpReqCallback, isreturm, url) {
// 判断是否请求完成(用作 是否loading // 判断是否请求完成(用作 是否loading
// 包括: 'ing', 'ingLoading', 'finish' // 包括: 'ing', 'ingLoading', 'finish'
let reqState = "ing"; let reqState = "ing";
@@ -50,7 +50,9 @@ function commonsProcess(showLoading, httpReqCallback, isreturm) {
return httpReqCallback() return httpReqCallback()
.then((httpData) => { .then((httpData) => {
// console.log(url);
// console.log('httpData');
// console.log(httpData);
reqFinishFunc(); // 请求完毕的动作 reqFinishFunc(); // 请求完毕的动作
// 从http响应数据中解构响应数据 [ 响应码、 bodyData ] // 从http响应数据中解构响应数据 [ 响应码、 bodyData ]
let { let {
@@ -76,7 +78,7 @@ function commonsProcess(showLoading, httpReqCallback, isreturm) {
// http响应码不正确 // http响应码不正确
if (statusCode != 200 && statusCode != 204 && statusCode != 201) { if (statusCode != 200 && statusCode != 204 && statusCode != 201) {
isShowErrorToast = true; isShowErrorToast = true;
infoBox.showToast(data.message||data.msg || "服务器异常"); infoBox.showToast(data.message || data.msg || "服务器异常");
return Promise.reject(bodyData); // 跳转到catch函数 return Promise.reject(bodyData); // 跳转到catch函数
} }
if (bodyData.code == 401) { if (bodyData.code == 401) {
@@ -118,7 +120,7 @@ function commonsProcess(showLoading, httpReqCallback, isreturm) {
if (bodyData.code != 0) { if (bodyData.code != 0) {
infoBox.showToast(data.message||data.msg); infoBox.showToast(data.message || data.msg);
return; return;
} }
@@ -135,7 +137,8 @@ function commonsProcess(showLoading, httpReqCallback, isreturm) {
return Promise.resolve(result); return Promise.resolve(result);
}) })
.catch((res) => { .catch((res) => {
console.log('catch res');
console.log(res);
if (res.status == 404) { if (res.status == 404) {
infoBox.showToast("接口404").then(() => {}); infoBox.showToast("接口404").then(() => {});
reject(); reject();
@@ -149,11 +152,11 @@ function commonsProcess(showLoading, httpReqCallback, isreturm) {
reject(); reject();
} }
if (res.code != 0 && res.code != 401) { if (res.code != 0 && res.code != 401) {
infoBox.showToast(res.msg).then(() => {}); infoBox.showToast(res.message || res.msg).then(() => {});
reject(); reject();
} }
if (res.code == 500) { if (res.code == 500) {
infoBox.showToast(res.msg || "服务器异常").then(() => {}); infoBox.showToast(res.message || res.msg || "服务器异常").then(() => {});
reject(); reject();
} }
reqFinishFunc(); // 请求完毕的动作 reqFinishFunc(); // 请求完毕的动作
@@ -208,8 +211,10 @@ function request(args) {
url = url + '?' + (result.slice(0, result.length - 1)) url = url + '?' + (result.slice(0, result.length - 1))
params = null params = null
} }
let headerObject = {} let headerObject = {}
return commonsProcess(showLoading, () => { return commonsProcess(showLoading, () => {
return uni.request( return uni.request(
Object.assign({ Object.assign({
url: slash(baseUrl, url), url: slash(baseUrl, url),
@@ -219,7 +224,7 @@ function request(args) {
}, extParams) }, extParams)
) )
}, isreturm) }, isreturm, url)
} }
// 处理/ // 处理/
function slash(baseUrl, url) { function slash(baseUrl, url) {

View File

@@ -75,9 +75,9 @@
<up-modal :show="data.ruleShow" confirm-text="知道了" title="规则说明" :title="data.rule_title" <up-modal :show="data.ruleShow" confirm-text="知道了" title="规则说明" :title="data.rule_title"
:title-style="{fontWeight:'700'}" @confirm="ruleConfirm" confirm-color="rgb(255, 117, 129)"> :title-style="{fontWeight:'700'}" @confirm="ruleConfirm" confirm-color="rgb(255, 117, 129)">
<view class="u-p-30 u-text-left"> <view class="u-p-30 u-text-left" v-if="data.ruleShow">
<scroll-view scroll-y="true" style="max-height: 50vh;"> <scroll-view scroll-y="true" style="max-height: 50vh;">
<rich-text style="text-align: justify;font-size: 18px;color: #666;" <rich-text style="text-align: justify;font-size: 18px;color: #666;"
:nodes="data.rule_content"></rich-text> :nodes="data.rule_content"></rich-text>
</scroll-view> </scroll-view>
</view> </view>
@@ -409,9 +409,11 @@
/** /**
* 可提现金额 * 可提现金额
*/ */
const totalMoney=ref(0)
function getcashMoney() { function getcashMoney() {
selectUserMoney().then(res => { selectUserMoney().then(res => {
data.mayMoney = getMoneys(res.amount) || 0 data.mayMoney = getMoneys(res.amount) || 0
totalMoney.value=res.amount||0
}) })
} }
@@ -476,8 +478,9 @@
}, 1500) }, 1500)
return; return;
} }
console.log(data.mayMoney);
if (parseFloat(data.mayMoney).toFixed(2) >= parseFloat(data.money)) { console.log(parseFloat(data.mayMoney));
if (totalMoney.value*1 >= parseFloat(data.money)) {
if (parseFloat(data.money).toFixed(2) >= parseFloat(data.cashMoney)) { if (parseFloat(data.money).toFixed(2) >= parseFloat(data.cashMoney)) {
uni.showModal({ uni.showModal({
title: "提现申请提示", title: "提现申请提示",