|
|
@@ -68,10 +68,10 @@
|
|
|
onLoad() {
|
|
|
// 获取学号
|
|
|
this.stu_number = this.$store.state.stu_number
|
|
|
-
|
|
|
- this.get_xiaofeijilu()
|
|
|
-
|
|
|
+ // 充值记录
|
|
|
this.get_chongzhijilu()
|
|
|
+ // 消费记录
|
|
|
+ this.get_xiaofeijilu()
|
|
|
},
|
|
|
methods: {
|
|
|
/**
|
|
|
@@ -80,14 +80,14 @@
|
|
|
*/
|
|
|
bindDateChange: function(e) {
|
|
|
this.date = e.detail.value
|
|
|
-
|
|
|
+ // 充值记录
|
|
|
this.get_chongzhijilu()
|
|
|
},
|
|
|
/**
|
|
|
* 获取充值记录
|
|
|
*/
|
|
|
async get_chongzhijilu() {
|
|
|
- console.log(this.$store.state.stu_number);
|
|
|
+ // console.log(this.$store.state.stu_number);
|
|
|
const res = await this.$myRequest({
|
|
|
host: this.ceshi,
|
|
|
url: '/HotWaters/elqueyRecordEle.action',
|
|
|
@@ -97,19 +97,20 @@
|
|
|
},
|
|
|
data: {
|
|
|
'stu_number': this.$store.state.stu_number,
|
|
|
- 're_time': this.date
|
|
|
+ 're_time': this.date
|
|
|
}
|
|
|
})
|
|
|
-
|
|
|
- console.log(res);
|
|
|
+
|
|
|
+ console.log(res);
|
|
|
if (res.data.mess == '未查到记录') {
|
|
|
uni.showToast({
|
|
|
- title: '该月无充值记录',
|
|
|
+ title: '该月无缴费记录',
|
|
|
icon: 'success'
|
|
|
});
|
|
|
+ } else {
|
|
|
+ // 充值绑定显示到界面
|
|
|
+ this.list = res.data.data[0].xiaofei
|
|
|
}
|
|
|
-
|
|
|
- // this.list = this.all_data.data[0].xiaofei
|
|
|
},
|
|
|
async get_xiaofeijilu() {
|
|
|
const res = await this.$myRequest({
|
|
|
@@ -124,28 +125,22 @@
|
|
|
}
|
|
|
})
|
|
|
|
|
|
- console.log(res);
|
|
|
- let tmparr_date_time = []
|
|
|
- let tmparr_use_elec = []
|
|
|
- for (var i = 0; i < res.data.date_time.length; i++) {
|
|
|
- tmparr_date_time.push(res.data.date_time[i])
|
|
|
- }
|
|
|
- for (var i = 0; i < res.data.use_elc.length; i++) {
|
|
|
- tmparr_use_elec.push(res.data.use_elc[i])
|
|
|
- }
|
|
|
-
|
|
|
+ // console.log(res);
|
|
|
let chrt_data = {
|
|
|
categories: [],
|
|
|
series: [{
|
|
|
data: [],
|
|
|
}],
|
|
|
}
|
|
|
- chrt_data.categories = tmparr_date_time
|
|
|
- chrt_data.series[0].data = tmparr_use_elec
|
|
|
- console.log(chrt_data);
|
|
|
+ for (var i = 0; i < res.data.date_time.length; i++) {
|
|
|
+ chrt_data.categories.push(res.data.date_time[i])
|
|
|
+ chrt_data.series[0].data.push(res.data.use_elc[i])
|
|
|
+ }
|
|
|
+
|
|
|
+ // console.log(chrt_data);
|
|
|
setTimeout(() => {
|
|
|
this.chartData = chrt_data;
|
|
|
- }, 30)
|
|
|
+ }, 1000)
|
|
|
}
|
|
|
}
|
|
|
}
|