-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathbasePage.html
More file actions
144 lines (125 loc) · 4.26 KB
/
Copy pathbasePage.html
File metadata and controls
144 lines (125 loc) · 4.26 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
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8">
<meta charset="UTF-8">
<meta name="applicable-device" content="mobile"/>
<meta name="viewport" content="width=device-width,initial-scale=1.0,minimum-scale=1.0,maximum-scale=1.0,user-scalable=no"/>
<meta content="telephone=no" name="format-detection"/>
<meta content="black" name="apple-mobile-web-app-status-bar-style">
<meta content="yes" name="apple-mobile-web-app-capable"/>
<meta http-equiv="Cache-Control" content="no-transform"/>
<meta http-equiv="Cache-Control" content="no-siteapp"/>
<title>TalkingData Base</title>
<link rel="stylesheet" href="css/public_head.css" />
<link rel="stylesheet" href="css/index.css" />
<script type="text/javascript" src="js/jquery-1.8.2.min.js"></script>
<script type="text/javascript" src="js/TalkingData.js"></script>
<script type="text/javascript" src="js/phone.js" ></script>
</head>
<body>
<!--head_line-->
<div class="head_line">
<p class="head_line_p">
TalkingData
</p>
</div>
<div class="new_index">
<div class="wd_title">
<img src="images/wd_ico.png">基础统计
</div>
<div class="wd_index">
<div class="wd_line">
<img src="images/sh_info_ico.png">
<input id="id" type="text" class="line_input" placeholder="id">
</div>
<div class="wd_line">
<img src="images/shdz_ico.png">
<input id="label" type="text" class="line_input" placeholder="label">
</div>
<div class="wd_line">
<img src="images/bz_ico.png">
<input id="value" type="text" class="line_input" placeholder="value">
</div>
<div class="wd_line">
<img src="images/lxr_ico.png">
<input id="data_key" type="text" class="line_input" placeholder="data-key">
</div>
<div class="wd_line">
<img src="images/lxdh_ico.png">
<input id="data_value" type="text" class="line_input" placeholder="data-value">
</div>
<div class="btn_line">
<input id="btn_onevent" type="button" class="bottom_btn" value="添加自定义事件">
</div>
</div>
<div class="wd_index">
<div class="wd_line">
<img src="images/sh_info_ico.png">
<input id="tx_deviceid" type="text" class="line_input" placeholder="deviceid">
</div>
<div class="btn_line">
<input id="btn_deviceid" type="button" class="bottom_btn" value="获取 device id">
</div>
</div>
<div class="wd_index">
<div class="wd_line">
<img src="images/sh_info_ico.png">
<input id="tx_oaid" type="text" class="line_input" placeholder="oaid">
</div>
<div class="btn_line">
<input id="btn_oaid" type="button" class="bottom_btn" value="获取 oaid">
</div>
</div>
<div class="btn_line">
<input id="btn_back" type="button" class="bottom_btn" value="返回">
</div>
</div>
<script>
$('#btn_onevent').on('click', function(){
var eventId = $('#id').val();
var eventLabel = $('#label').val();
var eventValue = $('#value').val();
var dataKey = $('#data_key').val();
var dataValue = $('#data_value').val();
if(!eventId || eventId == "") {
console.log("自定义事件 id 不允许为空");
return;
}
if (dataKey && dataKey.length > 0 && dataValue && dataValue.length) {
var data={};
data[dataKey]=dataValue;
}
if (eventValue && eventValue.length > 0) {
TalkingData.onEventWithValue(eventId, eventLabel, data, eventValue*1);
return;
}
if (data) {
TalkingData.onEventWithParameters(eventId, eventLabel, data);
return;
}
if(eventLabel && eventLabel.length > 0) {
TalkingData.onEventWithLabel(eventId, eventLabel);
return;
}
TalkingData.onEvent(eventId);
});
var getdeviceid = function(deviceid){
$('#tx_deviceid').val(deviceid);
}
$('#btn_deviceid').on('click', function(){
TalkingData.getDeviceId(getdeviceid);
});
var getoaid = function(oaid){
$('#tx_oaid').val(oaid);
}
$('#btn_oaid').on('click', function(){
TalkingData.getOAID(getoaid);
});
$('#btn_back').on("click", function() {
TalkingData.onPageEnd(window.location.href);
window.history.back();
});
</script>
</body>
</html>