部分接口调整,修复提现页面点击弹窗确认按钮卡死问题
This commit is contained in:
parent
d3dc2e8a87
commit
1eb645705d
|
|
@ -8,9 +8,9 @@ export const selectNewApp = (data) => {
|
|||
return http.request({
|
||||
url: '/user/selectNewApp',
|
||||
data: data,
|
||||
method: 'POST',
|
||||
})
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取用户信息
|
||||
*/
|
||||
|
|
|
|||
21
http/http.js
21
http/http.js
|
|
@ -23,7 +23,7 @@ function getHeader(data) {
|
|||
}
|
||||
|
||||
// 通用处理逻辑
|
||||
function commonsProcess(showLoading, httpReqCallback, isreturm) {
|
||||
function commonsProcess(showLoading, httpReqCallback, isreturm, url) {
|
||||
// 判断是否请求完成(用作 是否loading )
|
||||
// 包括: 'ing', 'ingLoading', 'finish'
|
||||
let reqState = "ing";
|
||||
|
|
@ -50,7 +50,9 @@ function commonsProcess(showLoading, httpReqCallback, isreturm) {
|
|||
|
||||
return httpReqCallback()
|
||||
.then((httpData) => {
|
||||
|
||||
// console.log(url);
|
||||
// console.log('httpData');
|
||||
// console.log(httpData);
|
||||
reqFinishFunc(); // 请求完毕的动作
|
||||
// 从http响应数据中解构响应数据 [ 响应码、 bodyData ]
|
||||
let {
|
||||
|
|
@ -76,7 +78,7 @@ function commonsProcess(showLoading, httpReqCallback, isreturm) {
|
|||
// http响应码不正确
|
||||
if (statusCode != 200 && statusCode != 204 && statusCode != 201) {
|
||||
isShowErrorToast = true;
|
||||
infoBox.showToast(data.message||data.msg || "服务器异常");
|
||||
infoBox.showToast(data.message || data.msg || "服务器异常");
|
||||
return Promise.reject(bodyData); // 跳转到catch函数
|
||||
}
|
||||
if (bodyData.code == 401) {
|
||||
|
|
@ -118,7 +120,7 @@ function commonsProcess(showLoading, httpReqCallback, isreturm) {
|
|||
|
||||
|
||||
if (bodyData.code != 0) {
|
||||
infoBox.showToast(data.message||data.msg);
|
||||
infoBox.showToast(data.message || data.msg);
|
||||
return;
|
||||
}
|
||||
|
||||
|
|
@ -135,7 +137,8 @@ function commonsProcess(showLoading, httpReqCallback, isreturm) {
|
|||
return Promise.resolve(result);
|
||||
})
|
||||
.catch((res) => {
|
||||
|
||||
console.log('catch res');
|
||||
console.log(res);
|
||||
if (res.status == 404) {
|
||||
infoBox.showToast("接口404").then(() => {});
|
||||
reject();
|
||||
|
|
@ -149,11 +152,11 @@ function commonsProcess(showLoading, httpReqCallback, isreturm) {
|
|||
reject();
|
||||
}
|
||||
if (res.code != 0 && res.code != 401) {
|
||||
infoBox.showToast(res.msg).then(() => {});
|
||||
infoBox.showToast(res.message || res.msg).then(() => {});
|
||||
reject();
|
||||
}
|
||||
if (res.code == 500) {
|
||||
infoBox.showToast(res.msg || "服务器异常").then(() => {});
|
||||
infoBox.showToast(res.message || res.msg || "服务器异常").then(() => {});
|
||||
reject();
|
||||
}
|
||||
reqFinishFunc(); // 请求完毕的动作
|
||||
|
|
@ -208,8 +211,10 @@ function request(args) {
|
|||
url = url + '?' + (result.slice(0, result.length - 1))
|
||||
params = null
|
||||
}
|
||||
|
||||
let headerObject = {}
|
||||
return commonsProcess(showLoading, () => {
|
||||
|
||||
return uni.request(
|
||||
Object.assign({
|
||||
url: slash(baseUrl, url),
|
||||
|
|
@ -219,7 +224,7 @@ function request(args) {
|
|||
}, extParams)
|
||||
|
||||
)
|
||||
}, isreturm)
|
||||
}, isreturm, url)
|
||||
}
|
||||
// 处理/
|
||||
function slash(baseUrl, url) {
|
||||
|
|
|
|||
|
|
@ -75,9 +75,9 @@
|
|||
|
||||
<up-modal :show="data.ruleShow" confirm-text="知道了" title="规则说明" :title="data.rule_title"
|
||||
: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;">
|
||||
<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>
|
||||
</scroll-view>
|
||||
</view>
|
||||
|
|
@ -409,9 +409,11 @@
|
|||
/**
|
||||
* 可提现金额
|
||||
*/
|
||||
const totalMoney=ref(0)
|
||||
function getcashMoney() {
|
||||
selectUserMoney().then(res => {
|
||||
data.mayMoney = getMoneys(res.amount) || 0
|
||||
totalMoney.value=res.amount||0
|
||||
})
|
||||
}
|
||||
|
||||
|
|
@ -476,8 +478,9 @@
|
|||
}, 1500)
|
||||
return;
|
||||
}
|
||||
|
||||
if (parseFloat(data.mayMoney).toFixed(2) >= parseFloat(data.money)) {
|
||||
console.log(data.mayMoney);
|
||||
console.log(parseFloat(data.mayMoney));
|
||||
if (totalMoney.value*1 >= parseFloat(data.money)) {
|
||||
if (parseFloat(data.money).toFixed(2) >= parseFloat(data.cashMoney)) {
|
||||
uni.showModal({
|
||||
title: "提现申请提示",
|
||||
|
|
|
|||
Loading…
Reference in New Issue