|
|
@@ -4,54 +4,56 @@ import main from '../../utils/main';
|
|
4
|
4
|
const app = getApp();
|
|
5
|
5
|
|
|
6
|
6
|
Page({
|
|
7
|
|
- data: {
|
|
8
|
|
- },
|
|
|
7
|
+ data: {},
|
|
9
|
8
|
onLoad: function (options) {
|
|
10
|
9
|
var that = this;
|
|
11
|
10
|
that.setData({
|
|
12
|
11
|
CheckListUserID: app.globalData.userInfo.UserID,
|
|
13
|
12
|
Containnerheight: main.getWindowHeight(),
|
|
14
|
13
|
UserID: app.globalData.userInfo.UserID,
|
|
15
|
|
- ListType:options.listtype,
|
|
|
14
|
+ ListType: options.listtype,
|
|
16
|
15
|
});
|
|
17
|
16
|
|
|
18
|
17
|
var userid = app.globalData.userInfo.UserID;
|
|
19
|
18
|
main.getData("GetMiaoguoLesson2?UserID=" + userid, function (data) {
|
|
20
|
19
|
if (data) {
|
|
21
|
|
-
|
|
22
|
|
- var arr=[];
|
|
23
|
|
- if (that.data.ListType=="simple"){
|
|
|
20
|
+
|
|
|
21
|
+ var arr = [];
|
|
|
22
|
+ if (that.data.ListType == "simple") {
|
|
24
|
23
|
arr.push(data[0]);
|
|
25
|
24
|
arr.push(data[1]);
|
|
26
|
|
-
|
|
27
|
|
- arr[0].Text="前言";
|
|
28
|
|
- arr[1].Text="基本操作";
|
|
29
|
|
- arr[1].Time="时长约10分钟";
|
|
30
|
|
-
|
|
31
|
|
- arr[1].List[4]=data[1].List[2];
|
|
32
|
|
- arr[1].List[3]=data[1].List[1];
|
|
33
|
|
- arr[1].List[2]=data[1].List[0];
|
|
34
|
|
- arr[1].List[0]=data[2].List[0];
|
|
35
|
|
- arr[1].List[1]=data[2].List[1];
|
|
36
|
|
- arr[1].List[4].Title="通过【检验】生成字词、古诗词、英语题卡";
|
|
37
|
|
- arr[1].List[3].Title="通过【加资料】制作字词、古诗词、英语题卡";
|
|
38
|
|
- arr[1].List[2].Title="制作任何知识点的普通题卡";
|
|
39
|
|
-
|
|
40
|
|
- arr[1].List.splice(6,1);
|
|
41
|
|
- arr[1].List.splice(5,1);
|
|
42
|
|
-
|
|
|
25
|
+
|
|
|
26
|
+ arr[0].Text = "前言";
|
|
|
27
|
+ arr[1].Text = "基本操作";
|
|
|
28
|
+ arr[1].Time = "时长约10分钟";
|
|
|
29
|
+
|
|
|
30
|
+
|
|
|
31
|
+ arr[1].List[5] = data[2].List[4];
|
|
|
32
|
+ arr[1].List[4] = data[1].List[2];
|
|
|
33
|
+ arr[1].List[3] = data[1].List[1];
|
|
|
34
|
+ arr[1].List[2] = data[1].List[0];
|
|
|
35
|
+ arr[1].List[0] = data[2].List[0];
|
|
|
36
|
+ arr[1].List[1] = data[2].List[1];
|
|
|
37
|
+
|
|
|
38
|
+ arr[1].List.splice(6, 1);
|
|
|
39
|
+
|
|
|
40
|
+
|
|
|
41
|
+ arr[1].List[4].Title = "通过【检验】生成字词、古诗词、英语题卡";
|
|
|
42
|
+ arr[1].List[3].Title = "通过【加资料】制作字词、古诗词、英语题卡";
|
|
|
43
|
+ arr[1].List[2].Title = "制作任何知识点的普通题卡";
|
|
|
44
|
+
|
|
|
45
|
+
|
|
43
|
46
|
wx.setNavigationBarTitle({
|
|
44
|
47
|
title: '简要版',
|
|
45
|
48
|
});
|
|
46
|
|
- }
|
|
47
|
|
- else{
|
|
|
49
|
+ } else {
|
|
48
|
50
|
wx.setNavigationBarTitle({
|
|
49
|
51
|
title: '完整版',
|
|
50
|
52
|
});
|
|
51
|
|
- for(var i=0;i<4;i++)
|
|
|
53
|
+ for (var i = 0; i < 4; i++)
|
|
52
|
54
|
arr.push(data[i]);
|
|
53
|
55
|
}
|
|
54
|
|
-
|
|
|
56
|
+
|
|
55
|
57
|
that.setData({
|
|
56
|
58
|
List: arr,
|
|
57
|
59
|
});
|
|
|
@@ -62,34 +64,62 @@ Page({
|
|
62
|
64
|
},
|
|
63
|
65
|
gotoLesson: function (e) {
|
|
64
|
66
|
var id = e.currentTarget.dataset.id;
|
|
65
|
|
- var idchild="";
|
|
66
|
|
- if (e.currentTarget.dataset.idchild && id>1)
|
|
67
|
|
- idchild = '&LessonPage=' +e.currentTarget.dataset.idchild;
|
|
68
|
|
-
|
|
69
|
|
- if (e.currentTarget.dataset.url){
|
|
|
67
|
+ var idchild = "";
|
|
|
68
|
+ if (e.currentTarget.dataset.idchild && id > 1)
|
|
|
69
|
+ idchild = '&LessonPage=' + e.currentTarget.dataset.idchild;
|
|
|
70
|
+
|
|
|
71
|
+ if (e.currentTarget.dataset.url) {
|
|
|
72
|
+ if (this.data.ListType == "simple") {
|
|
|
73
|
+ switch (e.currentTarget.dataset.idchild) {
|
|
|
74
|
+ case 1:
|
|
|
75
|
+ id = 3;
|
|
|
76
|
+ idchild = "&LessonPage=1";
|
|
|
77
|
+ break;
|
|
|
78
|
+ case 2:
|
|
|
79
|
+ id = 3;
|
|
|
80
|
+ idchild = "&LessonPage=2";
|
|
|
81
|
+ break;
|
|
|
82
|
+ case 3:
|
|
|
83
|
+ id = 2;
|
|
|
84
|
+ idchild = "&LessonPage=1";
|
|
|
85
|
+ break;
|
|
|
86
|
+ case 4:
|
|
|
87
|
+ id = 2;
|
|
|
88
|
+ idchild = "&LessonPage=2";
|
|
|
89
|
+ break;
|
|
|
90
|
+ case 5:
|
|
|
91
|
+ id = 2;
|
|
|
92
|
+ idchild = "&LessonPage=3";
|
|
|
93
|
+ break;
|
|
|
94
|
+ case 6:
|
|
|
95
|
+ id = 3;
|
|
|
96
|
+ idchild = "&LessonPage=5";
|
|
|
97
|
+ break;
|
|
|
98
|
+
|
|
|
99
|
+ }
|
|
|
100
|
+ }
|
|
70
|
101
|
wx.navigateTo({
|
|
71
|
|
- url: '../other/video?LessonID=' + id +idchild+"&imageurl="+e.currentTarget.dataset.imageurl+"&url="+e.currentTarget.dataset.url+"&title="+e.currentTarget.dataset.title,
|
|
|
102
|
+ url: '../other/video?LessonID=' + id + idchild +"&title=" + e.currentTarget.dataset.title+ "&imageurl=" + e.currentTarget.dataset.imageurl + "&url=" + e.currentTarget.dataset.url,
|
|
72
|
103
|
});
|
|
73
|
|
- }
|
|
74
|
|
- else{
|
|
75
|
|
- if (id!=2 && id!=3){
|
|
|
104
|
+ } else {
|
|
|
105
|
+ if (id != 2 && id != 3) {
|
|
76
|
106
|
wx.navigateTo({
|
|
77
|
|
- url: '../other/lesson?LessonID=' + id +idchild,
|
|
|
107
|
+ url: '../other/lesson?LessonID=' + id + idchild,
|
|
78
|
108
|
});
|
|
79
|
109
|
}
|
|
80
|
110
|
}
|
|
81
|
111
|
},
|
|
82
|
112
|
onShareAppMessage: function () {
|
|
83
|
|
- var title="完整版教学课程";
|
|
84
|
|
- if (this.data.ListType=="simple"){
|
|
85
|
|
- title="简要版教学课程";
|
|
|
113
|
+ var title = "完整版教学课程";
|
|
|
114
|
+ if (this.data.ListType == "simple") {
|
|
|
115
|
+ title = "简要版教学课程";
|
|
86
|
116
|
}
|
|
87
|
|
- var url=app.globalData.SharePath + '?type=lesson&LessonID=all&ListType='+this.data.ListType+'&UserID=' + app.globalData.userInfo.UserID;
|
|
|
117
|
+ var url = app.globalData.SharePath + '?type=lesson&LessonID=all&ListType=' + this.data.ListType + '&UserID=' + app.globalData.userInfo.UserID;
|
|
88
|
118
|
console.log(url);
|
|
89
|
119
|
return {
|
|
90
|
120
|
title: title,
|
|
91
|
121
|
path: url,
|
|
92
|
|
- imageUrl: app.globalData.uploadImageUrl+"web/program_screenshot_lesson_a00.png",
|
|
|
122
|
+ imageUrl: app.globalData.uploadImageUrl + "web/program_screenshot_lesson_a00.png",
|
|
93
|
123
|
}
|
|
94
|
124
|
},
|
|
95
|
|
-})
|
|
|
125
|
+})
|