修改小数点问题
This commit is contained in:
3
app.wxss
3
app.wxss
@@ -68,8 +68,7 @@ page {
|
||||
/* 占位置 */
|
||||
.empty-view {
|
||||
margin-top: 200rpx;
|
||||
height: 1000rpx;
|
||||
margin-bottom: 1000rpx;
|
||||
margin-bottom: 800rpx;
|
||||
}
|
||||
.placeholder {
|
||||
height: 168rpx;
|
||||
|
||||
@@ -54,7 +54,7 @@
|
||||
box-sizing: border-box;
|
||||
width: inherit;
|
||||
min-width: 0;
|
||||
height: 100%;
|
||||
height: 144rpx;
|
||||
min-height: 20px;
|
||||
margin: 0;
|
||||
padding: 0;
|
||||
|
||||
@@ -24,7 +24,6 @@ Page({
|
||||
cashAccountList.forEach(item => {
|
||||
if (item.balance){
|
||||
cashBalance = cashBalance + item.balance
|
||||
sumBalance = sumBalance + item.balance
|
||||
}
|
||||
})
|
||||
let oweAccountList = setting.data.OWE_SETTING
|
||||
@@ -32,9 +31,11 @@ Page({
|
||||
oweAccountList.forEach(item => {
|
||||
if (item.balance){
|
||||
oweBalance = oweBalance + item.balance
|
||||
sumBalance = sumBalance + item.balance
|
||||
}
|
||||
})
|
||||
cashBalance = Math.floor(cashBalance * 100) / 100
|
||||
oweBalance = Math.floor(cashBalance * 100) / 100
|
||||
sumBalance = Math.floor((cashBalance - oweBalance) * 100) / 100
|
||||
this.setData({cashAccountList,oweAccountList,cashBalance,oweBalance,sumBalance})
|
||||
}
|
||||
})
|
||||
|
||||
11
utils/api.js
11
utils/api.js
@@ -13,6 +13,7 @@ function buildURL(url, needToken) {
|
||||
})
|
||||
wx.showToast({
|
||||
title: '请先登录',
|
||||
icon: 'none',
|
||||
mask: true,
|
||||
duration: 2000
|
||||
})
|
||||
@@ -51,10 +52,8 @@ export function fetchPost(url, params, needToken, multiple) {
|
||||
console.log(res);
|
||||
if (response.statusCode == 200) {
|
||||
if (res.err_code == 0) {
|
||||
wx.hideLoading();
|
||||
resolve(res);
|
||||
} else {
|
||||
wx.hideLoading();
|
||||
wx.showToast({
|
||||
title: res.data.err_msg,
|
||||
icon: 'none',
|
||||
@@ -63,7 +62,6 @@ export function fetchPost(url, params, needToken, multiple) {
|
||||
reject(res);
|
||||
}
|
||||
} else {
|
||||
wx.hideLoading();
|
||||
wx.showToast({
|
||||
title: '服务器异常',
|
||||
icon: 'none',
|
||||
@@ -74,7 +72,6 @@ export function fetchPost(url, params, needToken, multiple) {
|
||||
},
|
||||
fail: function(err) {
|
||||
console.log(err);
|
||||
wx.hideLoading();
|
||||
wx.showToast({
|
||||
title: '网络错误',
|
||||
icon: 'none',
|
||||
@@ -98,10 +95,8 @@ export function fetchPost(url, params, needToken, multiple) {
|
||||
success: function(res) {
|
||||
console.log("POST返回数据", url,res);
|
||||
if (res.data.err_code == 0) {
|
||||
wx.hideLoading();
|
||||
resolve(res.data);
|
||||
} else {
|
||||
wx.hideLoading();
|
||||
wx.showToast({
|
||||
title: res.data.err_msg,
|
||||
icon: 'none',
|
||||
@@ -111,7 +106,6 @@ export function fetchPost(url, params, needToken, multiple) {
|
||||
}
|
||||
},
|
||||
fail: function(res) {
|
||||
wx.hideLoading();
|
||||
wx.showToast({
|
||||
title: '网络错误',
|
||||
icon: 'none',
|
||||
@@ -144,13 +138,11 @@ export function fetchGet(url, params, needToken) {
|
||||
console.log("GET返回数据", url, res);
|
||||
if (res.statusCode == 200) {
|
||||
if (res.data.err_code == 0) {
|
||||
wx.hideLoading();
|
||||
resolve(res.data);
|
||||
} else {
|
||||
reject(res);
|
||||
}
|
||||
} else {
|
||||
wx.hideLoading();
|
||||
reject(res)
|
||||
wx.showToast({
|
||||
title: '服务器异常',
|
||||
@@ -160,7 +152,6 @@ export function fetchGet(url, params, needToken) {
|
||||
}
|
||||
},
|
||||
fail: function(res) {
|
||||
wx.hideLoading();
|
||||
reject(res)
|
||||
wx.showToast({
|
||||
title: '网络错误',
|
||||
|
||||
Reference in New Issue
Block a user