index.js 932 B

1234567891011121314151617181920212223242526272829303132333435363738394041
  1. let app = getApp()
  2. Page({
  3. data: {
  4. groupId: 0,
  5. tableData: [],
  6. types:{
  7. 1:'判断题',
  8. 2:'单选题',
  9. 3:'多选题',
  10. 4:'案例题'
  11. },
  12. openErr: false,
  13. openExam: false
  14. },
  15. onLoad: function(options) {
  16. let groupId = +options.groupId||1;
  17. this.setData({ groupId });
  18. },
  19. onShow: function () {
  20. app.checkLogin( userInfo =>{
  21. this.setData({userInfo, from:0})
  22. this.loadData()
  23. })
  24. },
  25. gotoAnswer(e){
  26. let item = e.currentTarget.dataset.item;
  27. let groupId = this.data.groupId
  28. console.log( item )
  29. wx.navigateTo({
  30. url: `/pages/newExam/orderTest/index?groupId=${groupId}&type=${item.type}&count=${item.count}`
  31. })
  32. },
  33. loadData: function(){
  34. let param= {groupId: this.data.groupId}
  35. app.formPost('Exam.InitGroupAnswer', param ).then(res => {
  36. if( res.code == 200){
  37. this.setData({tableData: res.data})
  38. }
  39. })
  40. }
  41. })