11
def setValue2inputs(self): print('测试') # 清空输入框中所有的数据 jsresultstr = '' for r in self.last_100result: type = self.radioSelectName num = "" if len(r) == 3: type = str(r[2]) num = self.model.format2DingType(str(r[0]) + str(r[1]), type) else: type = self.radioSelectName num = str(r[0:4]) money = str(self.last_100result[r]) jsresultstr = jsresultstr + '["' + num + '","' + money + '"],' jsresultstr = "var result = [" + jsresultstr + "];" query = jsresultstr + """ var elelist = []; var ele = window.frames['mem_index'].frames['mainFrame'].frames['IndexFrame'].document.getElementsByTagName('*'); for (var i = 0; i < ele.length; i++) { if (ele[i].className == 'gold_input') { ele[i].value = ''; elelist.push(ele[i]); } } for (r in result){ elelist[r*2].value = result[r][0]; elelist[r*2+1].value = result[r][1]; } var h = window.frames['mem_index'].frames['mainFrame'].frames['IndexFrame'].document.body.scrollHeight; window.frames['mem_index'].frames['mainFrame'].frames['IndexFrame'].document.body.scrollTop = h; function scroll_bottom(){ //alert(1); window.frames['mem_index'].frames['mainFrame'].frames['IndexFrame'].oGame.Submit(); setTimeout(function(){ var h = window.frames['mem_index'].frames['mainFrame'].frames['OrderFrame'].document.body.scrollHeight; window.frames['mem_index'].frames['mainFrame'].frames['OrderFrame'].document.body.scrollTop = h; }, 1000); } var eles = window.frames['mem_index'].frames['mainFrame'].frames['IndexFrame'].document.getElementsByTagName("input"); for (var i = 0; i < eles.length-1; i++) { if (eles[i].getAttribute('onclick') == 'oGame.Submit();') { eles[i].onclick = null; eles[i].removeEventListener("click", scroll_bottom); eles[i].addEventListener("click", scroll_bottom); } } true; """ self.ui.webview.browser.GetMainFrame().ExecuteJavascript(query) self.postState = True time_now = time.strftime(self.ISOTIMEFORMAT, time.localtime()) if self.postState: self.setState("<b style='color:green'>上报成功!</b>" + time_now) self.postType = self.radioSelectName tt = threading.Thread(target=self.postNum(), args=(self,)) tt.setDaemon(True) tt.start() else: self.setState("<b style='color:red'>上报失败!</b>" + time_now) self.postType = False