// pages/course_detail/course_detail.js import { getVRCourseDetail } from '../../utils/request'; import { IsNotStart, IsInTime } from '../../utils/courseTime'; Page({ /** * 页面的初始数据 */ data: { time: 96 * 60 * 1000, detail: { compereId: null, createTime: "", creatorId: null, creatorName: "", display: null, duration: null, fee: null, id: null, isDap: null, isFee: null, isTop: null, organization: "", rtf: "", sceneCode: "", sort: null, thumb: "", thumbShare: "", title: "", titleSub: "", updateTime: "", } }, /** * 生命周期函数--监听页面加载 */ onLoad(options) { if (options.id) { // debugger this.getVRCourseDetailData(options.id); } }, async getVRCourseDetailData(id) { const data = await getVRCourseDetail(id) console.log('data', data.data) this.setData({ detail: data.data }, () => { const res = IsNotStart(this.data.detail.createTime) console.log('IsNotStart', res, this.data.detail.createTime) }) }, /** * 生命周期函数--监听页面初次渲染完成 */ onReady() { }, /** * 生命周期函数--监听页面显示 */ onShow() { }, /** * 生命周期函数--监听页面隐藏 */ onHide() { }, /** * 生命周期函数--监听页面卸载 */ onUnload() { }, /** * 页面相关事件处理函数--监听用户下拉动作 */ onPullDownRefresh() { }, /** * 页面上拉触底事件的处理函数 */ onReachBottom() { }, /** * 用户点击右上角分享 */ onShareAppMessage() { }, openHost() { wx.navigateToMiniProgram({ appId: 'wxd55ee54235e90359', path: 'pages/paid-room/paid-room', extraData: { roomId: 'test-01586', role: "leader", userId: '066893f525e56f09ce8b4420dff7e0681', nickname: "四维展主持人", avatar: "https://4dkk.4dage.com/take-look/images/other/6d5298a02bd849119b7e5357cbd6edff.jpeg" }, envVersion: 'develop', success(res) { // 打开成功 } }) }, })