Commit 74bcf119 authored by Facius's avatar Facius

fix: 数字处理bug

parent 4919fa79
...@@ -330,6 +330,13 @@ export default { ...@@ -330,6 +330,13 @@ export default {
if (this.checkToken()) { if (this.checkToken()) {
this.monthRecord(); this.monthRecord();
this.bookRecord(); this.bookRecord();
} else {
setTimeout(()=> {
if (this.freshing) {
this.triggered = false;
this.freshing = false;
}
}, 1500)
} }
}, },
async getWeather() { async getWeather() {
...@@ -396,7 +403,7 @@ export default { ...@@ -396,7 +403,7 @@ export default {
}) })
.catch(res => {}); .catch(res => {});
}, },
bookRecord() { bookRecord() {
bookRecord({}) bookRecord({})
.then(res => { .then(res => {
if (res.data) { if (res.data) {
......
...@@ -639,11 +639,11 @@ export function formatCount(count) { ...@@ -639,11 +639,11 @@ export function formatCount(count) {
string += '00' string += '00'
var num = 0 var num = 0
if (Number(string.substring(index + 3, index + 4) || 0) >= 5) { if (Number(string.substring(index + 3, index + 4) || 0) >= 5) {
num = 0.01 num = 1
} }
string = string.substring(0, index + 3) string = string.substring(0, index + 3)
if (num > 0) { if (num > 0) {
return formatCount(Number(string) + num) return formatCount(Math.round(Number(string) * 100 + num) / 100)
} }
} else { } else {
string += '.00' string += '.00'
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment