| 1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192 |
- import common from '../../utils/util';
- import main from '../../utils/main';
- const app = getApp();
- Page({
- data: {
- },
- onReady() {
- this.videoContext = wx.createVideoContext('myVideo')
- },
- onLoad: function (options) {
- var that = this;
- var height = app.globalData.systemInfo.windowHeight;
- that.setData({
- Containnerheight:height,
- });
- wx.setNavigationBarColor({
- frontColor: "#ffffff",
- backgroundColor: "#000000"
- });
- var LessonID = 2;
- var LessonPage = 1;
- if (options && options.LessonID) {
- LessonID = options.LessonID;
- }
- if (options && options.LessonPage) {
- LessonPage = options.LessonPage;
- }
- else
- LessonPage=1;
- if (options.url){
- that.setData({
- LessonID: LessonID,
- LessonPage: LessonPage,
- VideoUrl:app.globalData.uploadImageUrl+"web/_lesson/"+options.url,
- ImageUrl:options.imageurl,
- });
- wx.setNavigationBarTitle({
- title: options.title
- });
- }
- else{
- var userid = app.globalData.userInfo.UserID;
- main.getData("GetMiaoguoLesson2?UserID=" + userid, function (data) {
- if (data) {
- that.setData({
- LessonID: LessonID,
- LessonPage: LessonPage,
- VideoUrl:app.globalData.uploadImageUrl+"web/_lesson/"+data[LessonID-1].List[LessonPage-1].VideoUrl,
- ImageUrl:data[LessonID-1].List[LessonPage-1].ImageUrl,
- });
- wx.setNavigationBarTitle({
- title: data[LessonID-1].List[LessonPage-1].Title
- });
- }
- });
- }
-
-
- },
- onUnload: function () {
- this.InsertMiaoguoUserLesson();
- },
- onHide: function () {
- this.InsertMiaoguoUserLesson();
- },
- InsertMiaoguoUserLesson: function () {
-
- var url = "InsertMiaoguoUserLesson?UserID=" + app.globalData.userInfo.UserID;
- url += "&LessonID=" + this.data.LessonID;
- url += "&Content=" + this.data.LessonPage;
- main.getData(url, function (data) {});
- },
- onShareAppMessage: function () {
- var title ="课程";
- var imageUrl = app.globalData.uploadImageUrl+"web/"+this.data.ImageUrl;
- var path=app.globalData.SharePath + '?type=video&LessonID=' + this.data.LessonID + '&LessonPage=' + this.data.LessonPage+'&UserID=' + app.globalData.userInfo.UserID;
- console.log("path:"+path);
- return {
- title: title,
- path: path,
- imageUrl: imageUrl
- }
- },
- })
|