diff --git a/commons/config.js b/commons/config.js index 69fdd05..c55e9fe 100644 --- a/commons/config.js +++ b/commons/config.js @@ -1,6 +1,6 @@ //打包时修改env的值即可 -const env='production' //test , production,local +const env='test' //test , production,local export const encryptKey='1234567890123456' // http数据加解密的key diff --git a/http/http.js b/http/http.js index dcef9d8..d7ee8e9 100644 --- a/http/http.js +++ b/http/http.js @@ -120,14 +120,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(); } diff --git a/manifest.json b/manifest.json index 8cd2e1c..67dfbbb 100644 --- a/manifest.json +++ b/manifest.json @@ -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" : { diff --git a/pages/me/withdraw/index.vue b/pages/me/withdraw/index.vue index a0f7b19..dc29fc5 100644 --- a/pages/me/withdraw/index.vue +++ b/pages/me/withdraw/index.vue @@ -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 }) }