|
|
@@ -44,7 +44,6 @@
|
|
|
</template>
|
|
|
|
|
|
<script>
|
|
|
- // import data from '../../static/test_xiaofei.js'
|
|
|
export default {
|
|
|
data() {
|
|
|
return {
|
|
|
@@ -61,40 +60,71 @@
|
|
|
endDate: this.$getDate('end_date'),
|
|
|
all_data: '', //所有数据
|
|
|
list: [], //消费列表
|
|
|
- card_number: 0, //用户卡号
|
|
|
+ code: '',
|
|
|
+ ceshi: 'code',
|
|
|
+ stu_number: 0, //用户卡号
|
|
|
}
|
|
|
},
|
|
|
- onLoad(options) {
|
|
|
- // console.log(this.chartData.series[0].data)
|
|
|
+ onLoad() {
|
|
|
+ // 获取学号
|
|
|
+ this.stu_number = this.$store.state.stu_number
|
|
|
|
|
|
- // this.list = this.all_data.data[0].xiaofei;
|
|
|
- // this.name = this.all_data.data[0].xiaofei.name;
|
|
|
- // console.log(this.date)
|
|
|
- this.card_number = options.card_number
|
|
|
- // console.log(this.card_number)
|
|
|
-
|
|
|
- this.get_data()
|
|
|
+ this.get_xiaofeijilu()
|
|
|
+
|
|
|
+ this.get_chongzhijilu()
|
|
|
},
|
|
|
methods: {
|
|
|
+ /**
|
|
|
+ * 获取选择日期
|
|
|
+ * @param {Object} e
|
|
|
+ */
|
|
|
bindDateChange: function(e) {
|
|
|
this.date = e.detail.value
|
|
|
+
|
|
|
+ this.get_chongzhijilu()
|
|
|
},
|
|
|
- async get_data() {
|
|
|
- //http://ecu9ys.natappfree.cc/HotWaters/buildgetMonthBill.action
|
|
|
+ /**
|
|
|
+ * 获取充值记录
|
|
|
+ */
|
|
|
+ async get_chongzhijilu() {
|
|
|
+ console.log(this.$store.state.stu_number);
|
|
|
const res = await this.$myRequest({
|
|
|
- host: 'ceshi',
|
|
|
- url: 'http://ecu9ys.natappfree.cc/HotWaters/buildgetMonthBill.action',
|
|
|
+ host: this.ceshi,
|
|
|
+ url: '/HotWaters/elqueyRecordEle.action',
|
|
|
+ method: 'POST',
|
|
|
+ header: {
|
|
|
+ 'content-type': 'application/x-www-form-urlencoded'
|
|
|
+ },
|
|
|
+ data: {
|
|
|
+ 'stu_number': this.$store.state.stu_number,
|
|
|
+ 're_time': this.date
|
|
|
+ }
|
|
|
+ })
|
|
|
+
|
|
|
+ console.log(res);
|
|
|
+ if (res.data.mess == '未查到记录') {
|
|
|
+ uni.showToast({
|
|
|
+ title: '该月无充值记录',
|
|
|
+ icon: 'success'
|
|
|
+ });
|
|
|
+ }
|
|
|
+
|
|
|
+ // this.list = this.all_data.data[0].xiaofei
|
|
|
+ },
|
|
|
+ async get_xiaofeijilu() {
|
|
|
+ const res = await this.$myRequest({
|
|
|
+ host: this.ceshi,
|
|
|
+ url: '/HotWaters/buildgetMonthBill.action',
|
|
|
method: 'POST',
|
|
|
header: {
|
|
|
'content-type': 'application/x-www-form-urlencoded'
|
|
|
},
|
|
|
data: {
|
|
|
'roomSelect': this.$store.state.building.roomSelect
|
|
|
- // 'roomSelect': '墨轩湖校区1101'
|
|
|
}
|
|
|
})
|
|
|
|
|
|
- // console.log(res.data);
|
|
|
+ console.log(res);
|
|
|
let tmparr_date_time = []
|
|
|
let tmparr_use_elec = []
|
|
|
for (var i = 0; i < res.data.date_time.length; i++) {
|
|
|
@@ -103,11 +133,19 @@
|
|
|
for (var i = 0; i < res.data.use_elc.length; i++) {
|
|
|
tmparr_use_elec.push(res.data.use_elc[i])
|
|
|
}
|
|
|
-
|
|
|
+
|
|
|
+ let chrt_data = {
|
|
|
+ categories: [],
|
|
|
+ series: [{
|
|
|
+ data: [],
|
|
|
+ }],
|
|
|
+ }
|
|
|
+ chrt_data.categories = tmparr_date_time
|
|
|
+ chrt_data.series[0].data = tmparr_use_elec
|
|
|
+ console.log(chrt_data);
|
|
|
setTimeout(() => {
|
|
|
- this.chartData.categories = tmparr_date_time;
|
|
|
- this.chartData.series[0].data = tmparr_use_elec;
|
|
|
- }, 300)
|
|
|
+ this.chartData = chrt_data;
|
|
|
+ }, 30)
|
|
|
}
|
|
|
}
|
|
|
}
|