123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129 |
- // 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) {
- // 打开成功
- }
- })
- },
- })
|