import common from '../../utils/util'; import main from '../../utils/main'; const app = getApp(); Page({ data: { Menu:0, TestArr:[], TestItemArr:[{ ID:1, Icon:"sysIcon_d01", Time:"2024年9月19日 20:21", Right:10, Wrong:3, }, { ID:2, Icon:"sysIcon_d02", Time:"未检验", Right:0, Wrong:0, }], }, onLoad: function (options) { var that = this; that.setData({ Containnerheight: main.getWindowHeight(), ImagePath: app.globalData.uploadImageUrl, Category1:options.Category1, Category2:options.Category2, Category3:options.Category3, Name1:options.Name1, WordType:options.WordType, WordNum:options.WordNum, BookID:options.BookID, LibraryID:options.LibraryID, LibraryName:options.LibraryName, BookName:options.BookName, KnowledegImageName:options.KnowledegImageName, }); that.init(options); }, init:function(options){ var that = this; main.getData('GetMiaoguoTestUnit?Category1='+options.Category1+'&Name1='+options.Name1+'&BookID='+options.BookID+'&UserID='+app.globalData.userInfo.UserID, function (data) { if (data) { var readNum=0,writeNum=0,readRate=0,writeRate=0; var list1=data.List1; for(var i=0;i=date1) updateTime=date1; if (today>=date2) updateTime=date2; that.setData({ UpdateTime:updateTime, }); } }, setMenu:function(e){ var that=this; var menu=e.currentTarget.dataset.menu; that.setData({ Menu:menu, }); }, setMenu2:function(e){ var that=this; var menu=e.currentTarget.dataset.menu; var index=e.currentTarget.dataset.index; var item=that.data.List[index]; if (item && (!item.List || item.ListStr=="")){ main.getData('GetMiaoguoTestExamine?UserID='+app.globalData.userInfo.UserID+'&Category1='+that.data.Category1+'&BookID='+that.data.BookID+'&Name='+that.data.Name2+'&UnitID='+item.ID+'&TestType=read', function (data) { if (data) { item.List=[]; for(var i=0;i