123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112 |
- // pages/experienceList/experienceList.js
- const app = getApp()
- var util = require("../../../utils/util.js")
- Page({
- /**
- * 页面的初始数据
- */
- data: {
- // openid:'',
- },
- gotoProjectDetail(e) {
- console.log(e.currentTarget.dataset)
- wx.navigateTo({
- url: "/pages/classList/projectDetail/projectDetail?collegeId=" + e.currentTarget.dataset.collegeid + '&code=' +
- e.currentTarget.dataset.code + '&testFinish=' + this.data.curriculumList.testFinish
- })
- },
- gototest(e) {
- if (this.data.curriculumDetail.status == 2 && this.data.curriculumDetail.rate == '100%' || this.data.curriculumDetail
- .status == 9) {
- console.log(e.currentTarget.dataset)
- wx.navigateTo({
- url: "/pages/testing/testing?core_id=" + e.currentTarget.dataset.testid + '&testFinish=' + e.currentTarget.dataset
- .testfinish
- })
- } else {
- wx.showToast({
- title: '请先完成学习',
- icon: 'none',
- duration: 2000
- })
- return
- }
- },
- init(id) {
- const that = this
- util.postData('/college/queryUserLearningCoreDetail', {
- openid: app.globalData.openid,
- id: id
- })
- .then(res => {
- // console.log(res)
- this.setData({
- curriculumDetail: res.curriculumDetail,
- curriculumList: res.curriculumList
- })
- })
- .catch(err => {
- console.log(err);
- })
- },
- /**
- * 生命周期函数--监听页面加载
- */
- onLoad: function(options) {
- // console.log('onLoad')
- console.log(options)
- if (options) {
- wx.setStorageSync(
- 'regularID', options.id
- )
- }
- this.setData({
- navH: app.globalData.navHeight,
- })
- },
- /**
- * 生命周期函数--监听页面初次渲染完成
- */
- onReady: function() {
- },
- /**
- * 生命周期函数--监听页面显示
- */
- onShow: function() {
- let regularID = wx.getStorageSync('regularID');
- this.onLoad();
- this.init(regularID);
- },
- /**
- * 生命周期函数--监听页面隐藏
- */
- onHide: function() {
- },
- /**
- * 页面相关事件处理函数--监听用户下拉动作
- */
- onPullDownRefresh: function() {
- },
- /**
- * 页面上拉触底事件的处理函数
- */
- onReachBottom: function() {
- },
- /**
- * 用户点击右上角分享
- */
- onShareAppMessage: function() {
- }
- })
|