// pages/course_detail/course_detail.js Page({ /** * 页面的初始数据 */ data: { course: {}, show_classroom: new Date().getTime() < 1580820786606 }, enter_page({currentTarget:{dataset}}){ let time = new Date().getTime(); let url = dataset.url; if ( time> 1577820786606){ wx.showModal({ title: '提示', content: '该功能稳定性不佳,已于2020年1月1日停用', }) } else if (time > 1574320786656){ wx.showModal({ title: '提示', content: '该功能稳定性不佳,将于2020年1月1日停用,按确认进入页面', success: res=>{ if(res.confirm){ wx.navigateTo({ url: url, }) } } }) }else{ wx.navigateTo({ url: url, }) } }, /** * 生命周期函数--监听页面加载 */ onLoad: function (options) { this.setData({"course.id": options.course_id}) if(options.course_name && options.course_name!="undefined"){ wx.setNavigationBarTitle({ title: options.course_name }) } console.log(this.data); }, /** * 生命周期函数--监听页面初次渲染完成 */ onReady: function () { }, /** * 生命周期函数--监听页面显示 */ onShow: function () { }, /** * 生命周期函数--监听页面隐藏 */ onHide: function () { }, /** * 生命周期函数--监听页面卸载 */ onUnload: function () { }, /** * 页面相关事件处理函数--监听用户下拉动作 */ onPullDownRefresh: function () { }, /** * 页面上拉触底事件的处理函数 */ onReachBottom: function () { }, /** * 用户点击右上角分享 */ onShareAppMessage: function () { } })