You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
This file contains ambiguous Unicode characters that may be confused with others in your current locale. If your use case is intentional and legitimate, you can safely ignore this warning. Use the Escape button to highlight these characters.
const app = getApp ( ) ;
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 . course _id = options . course _id ;
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 ) ;
} ,
onShow : function ( ) {
app . client . get _course _info ( { course _id : this . course _id } )
. then ( res => {
console . log ( res ) ;
this . setData ( { course : res . data } ) ;
} ) ;
} ,
onShareAppMessage : function ( options ) {
let course = this . data . course ;
let next _week _time = new Date ( ) . getTime ( ) + 7 * 24 * 3600 * 1000 ;
let current _user = app . client . current _user ;
if ( options . from == "button" ) {
return {
path : ` /pages/course_invite/course_invite?course_id= ${ this . course _id } &invite_code= ${ course . invite _code } &deadline= ${ next _week _time } &course_name= ${ course . name } &inviter= ${ current _user . real _name } &avatar_url=https://www.educoder.net/images/ ${ current _user . image _url } ` ,
imageUrl : "/images/invite.png" ,
title : "课堂邀请--" + course . name
}
}
}
} )