This repository was archived by the owner on Nov 29, 2023. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathapp.js
More file actions
64 lines (54 loc) · 1.45 KB
/
app.js
File metadata and controls
64 lines (54 loc) · 1.45 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
var ga = require('./utils/ga.js');
var GoogleAnalytics = ga.GoogleAnalytics;
App({
tracker: null,
getTracker: function () {
var app_info = wx.getAccountInfoSync().miniProgram;
if (!this.tracker) {
// 初始化GoogleAnalytics Tracker
this.tracker = GoogleAnalytics.getInstance(this)
.setAppName('UMEH_Wechat')
.setAppVersion(app_info.version + " " + app_info.envVersion)
.newTracker('UA-176924130-1'); //用你的 Tracking ID 代替
//使用自己的合法域名做跟踪数据转发
this.tracker.setTrackerServer("https://ga.umeh.top");
}
return this.tracker;
},
globalData: {
// url:"http://60.205.223.2:888",
// url:"http://127.0.0.1:8000",
url: "https://mpserver.umeh.top",
course_info: {},
prof_list: [],
new_code: "",
prof_num: 0,
comments: [],
prof_info: {},
course_list: [],
courseDescription:"",
Intended_Learning_Outcomes:"",
},
data: {
},
/**
* 当小程序初始化完成时,会触发 onLaunch(全局只触发一次)
*/
onLaunch: function () {
},
/**
* 当小程序启动,或从后台进入前台显示,会触发 onShow
*/
onShow: function (options) {
},
/**
* 当小程序从前台进入后台,会触发 onHide
*/
onHide: function () {
},
/**
* 当小程序发生脚本错误,或者 api 调用失败时,会触发 onError 并带上错误信息
*/
onError: function (msg) {
}
})