|
|
@@ -68,6 +68,13 @@
|
|
|
categories: [],
|
|
|
series: []
|
|
|
},
|
|
|
+ chartDataInit: { // 如果 chartData 没有数据,解决一直打转的问题
|
|
|
+ "categories": ["无数据","无数据","无数据","无数据","无数据"],
|
|
|
+ "series": [{
|
|
|
+ "name": "金额",
|
|
|
+ "data": ["0.00","0.00","0.00","0.00","0.00"]
|
|
|
+ }]
|
|
|
+ },
|
|
|
chartOpts: {
|
|
|
color: ["#1890FF", "#91CB74", "#FAC858"],
|
|
|
padding: [15, 10, 0, 15],
|
|
|
@@ -155,8 +162,15 @@
|
|
|
|
|
|
// console.log(res.data);
|
|
|
let data = res.data
|
|
|
+ if (typeof data.rows !== 'undefined' && data.rows === '') {
|
|
|
+ uni.showToast({
|
|
|
+ title: '暂无消费数据',
|
|
|
+ duration: 1500
|
|
|
+ })
|
|
|
+ return
|
|
|
+ }
|
|
|
if (data.code === 200) {
|
|
|
- if (typeof data.rows === 'undefined') {
|
|
|
+ if (typeof data.rows === 'undefined' || data.rows === '') {
|
|
|
uni.showToast({
|
|
|
title: '暂无消费数据',
|
|
|
duration: 1500
|
|
|
@@ -204,21 +218,31 @@
|
|
|
})
|
|
|
|
|
|
// console.log(res.data);
|
|
|
+ let _this = this
|
|
|
+ if (typeof res.data === 'undefined') {
|
|
|
+ uni.showToast({
|
|
|
+ title: '暂无走势图数据',
|
|
|
+ duration: 1500
|
|
|
+ });
|
|
|
+
|
|
|
+ setTimeout(() => {
|
|
|
+ _this.chartData = _this.chartDataInit
|
|
|
+ }, 1000);
|
|
|
+
|
|
|
+ return
|
|
|
+ }
|
|
|
let tmpdata = res.data
|
|
|
if (tmpdata.code === 200) {
|
|
|
- if (typeof res.data === 'undefined') {
|
|
|
- uni.showToast({
|
|
|
- title: '暂无走势图数据',
|
|
|
- duration: 1500
|
|
|
- })
|
|
|
- return
|
|
|
- }
|
|
|
-
|
|
|
if (typeof tmpdata.data === 'undefined' || tmpdata.data.length === 0) {
|
|
|
uni.showToast({
|
|
|
title: '暂无走势图数据',
|
|
|
duration: 1500
|
|
|
- })
|
|
|
+ });
|
|
|
+
|
|
|
+ setTimeout(() => {
|
|
|
+ _this.chartData = _this.chartDataInit
|
|
|
+ }, 1000);
|
|
|
+
|
|
|
return
|
|
|
}
|
|
|
|