projectBox.js 2.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112
  1. // pages/experienceList/experienceList.js
  2. const app = getApp()
  3. var util = require("../../../utils/util.js")
  4. Page({
  5. /**
  6. * 页面的初始数据
  7. */
  8. data: {
  9. // openid:'',
  10. },
  11. gotoProjectDetail(e) {
  12. console.log(e.currentTarget.dataset)
  13. wx.navigateTo({
  14. url: "/pages/classList/projectDetail/projectDetail?collegeId=" + e.currentTarget.dataset.collegeid + '&code=' +
  15. e.currentTarget.dataset.code + '&testFinish=' + this.data.curriculumList.testFinish
  16. })
  17. },
  18. gototest(e) {
  19. if (this.data.curriculumDetail.status == 2 && this.data.curriculumDetail.rate == '100%' || this.data.curriculumDetail
  20. .status == 9) {
  21. console.log(e.currentTarget.dataset)
  22. wx.navigateTo({
  23. url: "/pages/testing/testing?core_id=" + e.currentTarget.dataset.testid + '&testFinish=' + e.currentTarget.dataset
  24. .testfinish
  25. })
  26. } else {
  27. wx.showToast({
  28. title: '请先完成学习',
  29. icon: 'none',
  30. duration: 2000
  31. })
  32. return
  33. }
  34. },
  35. init(id) {
  36. const that = this
  37. util.postData('/college/queryUserLearningCoreDetail', {
  38. openid: app.globalData.openid,
  39. id: id
  40. })
  41. .then(res => {
  42. // console.log(res)
  43. this.setData({
  44. curriculumDetail: res.curriculumDetail,
  45. curriculumList: res.curriculumList
  46. })
  47. })
  48. .catch(err => {
  49. console.log(err);
  50. })
  51. },
  52. /**
  53. * 生命周期函数--监听页面加载
  54. */
  55. onLoad: function(options) {
  56. // console.log('onLoad')
  57. console.log(options)
  58. if (options) {
  59. wx.setStorageSync(
  60. 'regularID', options.id
  61. )
  62. }
  63. this.setData({
  64. navH: app.globalData.navHeight,
  65. })
  66. },
  67. /**
  68. * 生命周期函数--监听页面初次渲染完成
  69. */
  70. onReady: function() {
  71. },
  72. /**
  73. * 生命周期函数--监听页面显示
  74. */
  75. onShow: function() {
  76. let regularID = wx.getStorageSync('regularID');
  77. this.onLoad();
  78. this.init(regularID);
  79. },
  80. /**
  81. * 生命周期函数--监听页面隐藏
  82. */
  83. onHide: function() {
  84. },
  85. /**
  86. * 页面相关事件处理函数--监听用户下拉动作
  87. */
  88. onPullDownRefresh: function() {
  89. },
  90. /**
  91. * 页面上拉触底事件的处理函数
  92. */
  93. onReachBottom: function() {
  94. },
  95. /**
  96. * 用户点击右上角分享
  97. */
  98. onShareAppMessage: function() {
  99. }
  100. })