|
|
@@ -77,25 +77,28 @@
|
|
|
},
|
|
|
onLoad(options) {
|
|
|
try {
|
|
|
- // console.log(options);
|
|
|
- this.stu_number = options.card_number;
|
|
|
- this.roomSelect = options.roomSelect;
|
|
|
- // this.stu_number = this.$store.state.userInfo.card_number
|
|
|
- // this.roomSelect = this.$store.state.building.roomSelect
|
|
|
+ this.stu_number = uni.getStorageSync('stu_number');
|
|
|
+ this.roomSelect = uni.getStorageSync('roomSelect');
|
|
|
+ if (this.stu_number == '' || this.roomSelect == '' || typeof(this.stu_number) == 'undefined' || typeof(this
|
|
|
+ .roomSelect) == 'undefined') {
|
|
|
+ // console.log(options);
|
|
|
+ this.stu_number = options.card_number;
|
|
|
+ this.roomSelect = options.roomSelect;
|
|
|
+ }
|
|
|
|
|
|
- if (this.stu_number == '' || this.roomSelect == '' || typeof(this.stu_number) == 'undefined' || typeof(this.roomSelect) == 'undefined') {
|
|
|
+ if (this.stu_number == '' || this.roomSelect == '' || typeof this.stu_number == 'undefined' || typeof this.roomSelect == 'undefined') {
|
|
|
// 获取学号
|
|
|
this.stu_number = this.$store.state.userInfo.card_number
|
|
|
this.roomSelect = this.$store.state.building.roomSelect
|
|
|
|
|
|
- if (this.stu_number == '' || this.roomSelect == '' || typeof(this.stu_number) == 'undefined' || typeof(this.roomSelect) == 'undefined') {
|
|
|
+ if (this.stu_number == '' || this.roomSelect == '' || typeof this.stu_number == 'undefined' || typeof this.roomSelect == 'undefined') {
|
|
|
const userinfo = uni.getStorageSync('userinfo_storage_key')
|
|
|
if (userinfo) {
|
|
|
this.stu_number = userinfo.card_number
|
|
|
this.roomSelect = userinfo.campus + userinfo.dorm_number
|
|
|
} else {
|
|
|
uni.redirectTo({
|
|
|
- url: '/pages/index/index'
|
|
|
+ url: '../../pages/index/index'
|
|
|
})
|
|
|
|
|
|
uni.showToast({
|
|
|
@@ -259,7 +262,7 @@
|
|
|
totalMoney
|
|
|
});
|
|
|
}
|
|
|
-
|
|
|
+
|
|
|
this.tableData = tableData.filter(function(item, index, self) {
|
|
|
return index === self.findIndex(function(t) {
|
|
|
return t.dataTime === item.dataTime && t.totalPower === item.totalPower && t.totalMoney === item.totalMoney;
|