From 81b9647dce13fcb3cd04253447bdf0537ff27c6c Mon Sep 17 00:00:00 2001 From: caoqianming Date: Tue, 17 Nov 2020 21:45:55 +0800 Subject: [PATCH] =?UTF-8?q?=E5=B0=8F=E7=A8=8B=E5=BA=8F=E7=BB=83=E4=B9=A0?= =?UTF-8?q?=E8=87=AA=E5=BB=BA=E5=88=86=E7=B1=BB=E5=85=B1=E4=BA=AB=E5=88=86?= =?UTF-8?q?=E7=B1=BB?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- pages/exercise/index.js | 7 ++++++- pages/exercise/index.wxml | 9 ++++++++- pages/questioncat/index.js | 8 ++++++-- 3 files changed, 20 insertions(+), 4 deletions(-) diff --git a/pages/exercise/index.js b/pages/exercise/index.js index caf453b..ed4e72b 100644 --- a/pages/exercise/index.js +++ b/pages/exercise/index.js @@ -119,7 +119,12 @@ wx.getStorage({ }, choosequestioncat:function(){ wx.navigateTo({ - url: '/pages/questioncat/index', + url: '/pages/questioncat/index?type=2', + }) + }, + choosequestioncat2:function(){ + wx.navigateTo({ + url: '/pages/questioncat/index?type=3', }) }, start1:function(){ diff --git a/pages/exercise/index.wxml b/pages/exercise/index.wxml index 3325528..5b74ea2 100644 --- a/pages/exercise/index.wxml +++ b/pages/exercise/index.wxml @@ -4,7 +4,14 @@ 选择题库分类进行练习。 - + + + + + + + + 已选分类 {{catsname}} diff --git a/pages/questioncat/index.js b/pages/questioncat/index.js index 4089c87..4c7a2fb 100644 --- a/pages/questioncat/index.js +++ b/pages/questioncat/index.js @@ -11,13 +11,17 @@ Page({ selectList: [], //已选择的元素列表 originalList: [], //最原始的数据列表 indexList: [], //存储目录层级的数组,用于准确的返回上一层 - selectList: [], //已选中的人员列表 + selectList: [], //已选中的人员列表, + type:2 }, onLoad: function (options) { wx.setNavigationBarTitle({ title: '选择分类' }) + if(options.type){ + this.data.type = options.type + } this.init(); }, @@ -25,7 +29,7 @@ Page({ //上次选中的列表,用于判断是不是取消选中了 this.lastTimeSelect = [] wx.request({ - url: getApp().globalData.serverUrl + 'api/questioncat?a=tree3', + url: getApp().globalData.serverUrl + 'api/questioncat?a=tree' + this.data.type.toString(), header: { 'content-type': 'application/json', // 默认值 'Cookie': getApp().globalData.sessionId,