File tree Expand file tree Collapse file tree 1 file changed +16
-7
lines changed
lib/repository/xidian_ids Expand file tree Collapse file tree 1 file changed +16
-7
lines changed Original file line number Diff line number Diff line change @@ -126,21 +126,30 @@ class SchoolCardSession extends IDSSession {
126
126
127
127
/// Post formula: fetch money.
128
128
String text = "" ;
129
- var getSpans = page.getElementsByTagName ("span" );
130
- for (var i in getSpans) {
129
+ for (var i in page.getElementsByTagName ("span" )) {
131
130
if (i.attributes["name" ] == "showbalanceid" ) {
132
131
text = i.innerHtml;
133
132
break ;
134
133
}
135
134
}
136
- if (text.isEmpty) text = "school_card_status.failed_to_query" ;
137
- if (text.contains (RegExp (r'[0-9]' ))) {
138
- money.value = text.substring (4 );
135
+ log.info ("[SchoolCardSession] remains on the surface: $text " );
136
+
137
+ if (text.contains ("余额未结转" )) {
138
+ var element = page.getElementById ("hidebalanceid" );
139
+ if (element != null ) {
140
+ text = element.innerHtml;
141
+ }
142
+ } else if (text.contains (RegExp (r'[0-9]' ))) {
143
+ text = text.substring (4 );
144
+ }
145
+ log.info ("[SchoolCardSession] remains: $text " );
146
+
147
+ if (text.isEmpty) {
148
+ text = "school_card_status.failed_to_query" ;
139
149
} else if (text.contains ("school_card_status.failed_to_query" )) {
140
150
money.value = "school_card_status.failed_to_query" ;
141
151
} else {
142
- /// Should not exec it.
143
- money.value = "0.00" ;
152
+ money.value = text;
144
153
}
145
154
isInit.value = SessionState .fetched;
146
155
} catch (e) {
You can’t perform that action at this time.
0 commit comments