import common from '../../utils/util'; import server from '../../utils/main'; const app = getApp(); var categoryID = ""; var categoryName = ""; var categoryNum = ""; var SelectID = 0; Page({ data: { version: app.globalData.version, FileUrl: app.globalData.fileUrl, filter:'all', IsShowMenu:false, CategoryID:1, }, onLoad: function(options) { categoryID = options.id; categoryName = options.name; categoryNum = options.num; //console.log(category); this.getList(); this.setData({ CategoryNum:categoryNum, CategoryID: categoryID, Containnerheight: server.getWindowHeight(), }); }, getList: function() { this.buildList(); wx.setNavigationBarTitle({ title: categoryName + " 题卡仓库", }); }, gotoDetail:function(e){ SelectID = e.currentTarget.dataset.id; var arr = wx.getStorageSync('SelectIDArray'); if (!arr) arr=[]; for(var i=0;i0) list.push(data[i].List[k]); } else{ list.push(data[i].List[k]); } } break; } } } this.setData({ QuestionTypeList: list, }); setTimeout(function(){ var query = wx.createSelectorQuery(); query.select('.line4').boundingClientRect(); query.exec(function (res) { //console.log("top2:" + (res[0].top)); var LineLongHeight = Number(res[0].top) * 2-200; // if (that.data.CategoryNum == 1 ) // LineLongHeight+=430; // else if (that.data.CategoryNum == 2) // LineLongHeight += 320; // else if (that.data.CategoryNum == 3) // LineLongHeight += 280; // else if (that.data.CategoryNum == 4) // LineLongHeight += 30; console.log("LineLongHeight:" + LineLongHeight); that.setData({ LineLongHeight: LineLongHeight, }); }); },200); }, menuClick:function(e){ this.data.filter = e.currentTarget.dataset.id; this.setData({ filter: this.data.filter, IsShowMenu: false, }); this.buildList(); }, closeMenu: function () { this.setData({ IsShowMenu: false, }); }, openMenu: function () { this.setData({ IsShowMenu: true, }); }, onShareAppMessage: function() { return { title: app.globalData.ShareTitle, path: 'pages/index/index?UserID=' + app.globalData.userInfo.UserID, imageUrl: app.globalData.ShareImageUrl, } }, })