diff --git a/api/user/user.js b/api/user/user.js index ea35eb8..08f3b73 100644 --- a/api/user/user.js +++ b/api/user/user.js @@ -8,9 +8,9 @@ export const selectNewApp = (data) => { return http.request({ url: '/user/selectNewApp', data: data, + method: 'POST', }) } - /** * 获取用户信息 */ diff --git a/http/http.js b/http/http.js index be431e2..baa3ee2 100644 --- a/http/http.js +++ b/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) { diff --git a/pages/me/withdraw/index.vue b/pages/me/withdraw/index.vue index dbb7799..09d65d7 100644 --- a/pages/me/withdraw/index.vue +++ b/pages/me/withdraw/index.vue @@ -75,9 +75,9 @@ - + - @@ -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: "提现申请提示",