提现优化更新

This commit is contained in:
GaoHao 2025-01-22 10:38:43 +08:00
parent fa809e7b0b
commit f8bd53596b
4 changed files with 39 additions and 11 deletions

View File

@ -1,6 +1,6 @@
//打包时修改env的值即可
const env='production' //test , production,local
const env='test' //test , production,local
export const encryptKey='1234567890123456' // http数据加解密的key

View File

@ -122,14 +122,12 @@ function commonsProcess(showLoading, httpReqCallback, isreturm) {
}
if (res.code == 401) {
infoBox.showToast(res.message || "请登录").then(() => {
uni.redirectTo({
url: "/pages/login/login",
});
reject();
uni.redirectTo({
url: "/pages/login/login",
});
reject();
}
if (res.code != 0) {
if (res.code != 0&&res.code != 401) {
infoBox.showToast(res.msg).then(() => {});
reject();
}

View File

@ -2,8 +2,8 @@
"name" : "斯耀短剧",
"appid" : "__UNI__E0B05B1",
"description" : "",
"versionName" : "1.2.4",
"versionCode" : 124,
"versionName" : "1.2.5",
"versionCode" : 125,
"transformPx" : false,
/* 5+App */
"app-plus" : {

View File

@ -301,9 +301,39 @@
* 全部提现赋值
*/
function setAllMoney() {
data.money = data.mayMoney.toFixed(2)
data.money = getMoneys(data.mayMoney)
}
/**
*
* 金额格式化
* money:金额
* 保留两位小数&不四舍五入
*/
function getMoneys (money) {
if (!money || isNaN(money)) return "0.00";
let num = parseFloat(money + '') + '';
num = parseInt(money * 100 + '') / 100 + ''
let reg = /(-?\d+)(\d{4})/;
while (reg.test(num)) {
num = num.replace(reg, "$1,$2");
}
let idx = num.indexOf('.')
if (idx === -1) {
num = num + '.00'
}
if (idx > 0) {
let num_per = num.substring(0, idx) + '.'
let num_next = num.substring(idx + 1).padEnd(2, '0')
num = num_per + num_next
}
return num;
}
/**
* 获取提现记录
*/
@ -338,7 +368,7 @@
*/
function getcashMoney() {
selectUserMoney().then(res => {
data.mayMoney = res.amount || 0
data.mayMoney = getMoneys(res.amount) || 0
})
}