Skip to content

Commit cd1c3e4

Browse files
init project
1 parent 52f92c9 commit cd1c3e4

File tree

90 files changed

+6147
-2
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

90 files changed

+6147
-2
lines changed

.babelrc

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
{
2+
"presets": [
3+
[
4+
"es2015",
5+
{
6+
"modules": false
7+
}
8+
]
9+
],
10+
"plugins": [
11+
"external-helpers"
12+
]
13+
}

Demo/app.js

Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
import AnalysysAgent from './util/sdk/AnalysysAgent_ByteDance_SDK.min.js'
2+
AnalysysAgent.debugMode = 2
3+
AnalysysAgent.appkey = 'sdktest201907'
4+
AnalysysAgent.uploadURL = 'https://sdk.analysys.cn'
5+
// AnalysysAgent.encryptType = 1; //使用加密文件的时候 放开赋值。(直接放开不会报错)
6+
AnalysysAgent.autoShare = true;
7+
// AnalysysAgent.autoProfile = false;
8+
AnalysysAgent.auto = true;
9+
/**
10+
* @file app.js
11+
* @author tt
12+
*/
13+
14+
/* globals tt */
15+
16+
App({
17+
onLaunch (options) {
18+
// do something when launch
19+
},
20+
onShow (options) {
21+
AnalysysAgent.appStart(options)
22+
// do something when show
23+
},
24+
onHide () {
25+
// do something when hide
26+
}
27+
});

Demo/app.json

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
{
2+
"pages": [
3+
"pages/index/index",
4+
"pages/logs/logs"
5+
],
6+
"window": {
7+
"backgroundTextStyle": "light",
8+
"navigationBarBackgroundColor": "#fff",
9+
"navigationBarTitleText": "Mini Program",
10+
"navigationBarTextStyle": "black"
11+
}
12+
}

Demo/app.ttss

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
/**
2+
* @file app.css
3+
* @author swan
4+
*/
5+
.container {
6+
display: flex;
7+
flex-direction: column;
8+
align-items: center;
9+
justify-content: space-between;
10+
padding: 200rpx 0;
11+
box-sizing: border-box;
12+
}

Demo/pages/index/index.js

Lines changed: 228 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,228 @@
1+
/**
2+
* @file index.js
3+
* @author tt
4+
*/
5+
let AnalysysAgent = tt.AnalysysAgent
6+
const app = getApp()
7+
8+
Page({
9+
onLaunch: function () {
10+
},
11+
onShareAppMessage: function () {
12+
let shareProperties = {
13+
title: "6点分享",
14+
path: 'pages/index/index?id=123'
15+
}
16+
let shareObj = AnalysysAgent.share(shareProperties)
17+
return shareObj
18+
},
19+
data: {},
20+
onShow: function () {
21+
// AnalysysAgent.registerSuperProperty('b', 7777)
22+
// AnalysysAgent.track("a1111111a", {
23+
// a: 1
24+
// })
25+
},
26+
onLoad: function (option) {
27+
28+
},
29+
nextPage: function () {
30+
swan.navigateTo({
31+
url: '../logs/logs'
32+
})
33+
},
34+
// API 开始 其中方法名字后缀为R的为不合法测试。
35+
registerSuperProperty: function () {
36+
AnalysysAgent.registerSuperProperty("age", 20)
37+
},
38+
registerSuperProperties: function () {
39+
var str = "";
40+
for (var i = 0; i < 300; i++) {
41+
str += "你你"
42+
}
43+
let superProperty = {
44+
"age": 20,
45+
"member": "25"
46+
}
47+
AnalysysAgent.registerSuperProperties(superProperty)
48+
},
49+
unRegisterSuperProperty: function () {
50+
AnalysysAgent.unRegisterSuperProperty("age")
51+
},
52+
clearSuperProperties: function () {
53+
AnalysysAgent.clearSuperProperties()
54+
},
55+
getSuperProperty: function () {
56+
AnalysysAgent.getSuperProperty("member11")
57+
},
58+
getSuperProperties: function () {
59+
AnalysysAgent.getSuperProperties()
60+
},
61+
// 超级属性 不合法测试
62+
registerSuperPropertyR: function () {
63+
AnalysysAgent.registerSuperProperty("age", "")
64+
},
65+
registerSuperPropertiesR: function () {
66+
let superProperty = {
67+
"": 20,
68+
"member": ""
69+
}
70+
AnalysysAgent.registerSuperProperties(superProperty)
71+
},
72+
// profile 系列合法API
73+
profileSet: function () {
74+
let profiles = {
75+
"Email": "yonghu@163.com",
76+
"BaiduID": "tt123"
77+
}
78+
AnalysysAgent.profileSet(profiles)
79+
},
80+
profileSetOnce: function () {
81+
let setOnceProfiles = {
82+
"activationTime": "1521594686781",
83+
"loginTime": "1521594726781"
84+
}
85+
AnalysysAgent.profileSetOnce(setOnceProfiles)
86+
},
87+
profileIncrement: function () {
88+
let profies = {
89+
"age": 20,
90+
"integral": 200
91+
}
92+
AnalysysAgent.profileIncrement(profies)
93+
},
94+
profileAppend: function () {
95+
AnalysysAgent.profileAppend("Movies", "霸王别姬")
96+
},
97+
profileAppendObject: function () {
98+
let propertyObject = {
99+
'Movies': '霸王别姬',
100+
'Music': ['花房姑娘']
101+
}
102+
AnalysysAgent.profileAppend(propertyObject)
103+
},
104+
profileAppendArray: function () {
105+
let properties = ["花房姑娘", "花房姑娘22"];
106+
// let properties = ""
107+
AnalysysAgent.profileAppend("Movies", properties)
108+
},
109+
profileUnset: function () {
110+
AnalysysAgent.profileUnset("Movies", "霸王")
111+
},
112+
profileDelete: function () {
113+
AnalysysAgent.profileDelete()
114+
},
115+
// profile 不合法逻辑,方法名字后缀为 R,为错误方法校验
116+
profileSetR: function () {
117+
let profiles = {
118+
"": "yonghu@163.com",
119+
"WeChatID": ""
120+
}
121+
AnalysysAgent.profileSet(profiles)
122+
},
123+
profileSetOnceR: function () {
124+
let setOnceProfiles = {
125+
"activationTime": "",
126+
"": "1521594726781"
127+
}
128+
AnalysysAgent.profileSetOnce(setOnceProfiles)
129+
},
130+
profileIncrementR: function () {
131+
let profies = {
132+
"age": 20,
133+
"integral": "200"
134+
}
135+
AnalysysAgent.profileIncrement(profies)
136+
},
137+
profileAppendR: function () {
138+
AnalysysAgent.profileAppend("Movies", "")
139+
},
140+
profileAppendObjectR: function () {
141+
let propertyObject = {
142+
'Movies': '霸王别姬',
143+
'Music': []
144+
}
145+
AnalysysAgent.profileAppend(propertyObject)
146+
},
147+
profileAppendArrayR: function () {
148+
let properties = [""]
149+
AnalysysAgent.profileAppend("Movies", properties)
150+
},
151+
profileUnsetR: function () {
152+
AnalysysAgent.profileUnset("Movies", "")
153+
},
154+
pageView: function () {
155+
var pageInfo = {
156+
"commodityName": "iPhone",
157+
}
158+
// AnalysysAgent.pageView("商品页", pageInfo);
159+
// for (var i = 0; i < 10; i++) {
160+
// console.log(i)
161+
let i = 0
162+
AnalysysAgent.pageView("商品页" + "--" + i, pageInfo, i);
163+
// }
164+
},
165+
// 其他合法逻辑,
166+
alias: function () {
167+
AnalysysAgent.alias("1")
168+
},
169+
identify: function () {
170+
AnalysysAgent.identify("identy", false)
171+
},
172+
reset: function () {
173+
AnalysysAgent.reset()
174+
},
175+
track: function () {
176+
let eventInfo = {
177+
"money": 20
178+
}
179+
AnalysysAgent.track('payment', eventInfo)
180+
},
181+
getPresetProperties: function () {
182+
AnalysysAgent.getPresetProperties();
183+
},
184+
appProperty: function () {
185+
let obj = {
186+
openId: 200000
187+
};
188+
AnalysysAgent.appProperty(obj);
189+
},
190+
getDistinctId: function () {
191+
let DistinctId = AnalysysAgent.getDistinctId();
192+
// console.log(AnalysysAgent.getDistinctId())
193+
},
194+
//其他 不合法逻辑
195+
pageViewR: function () {
196+
var pageInfo = {
197+
"": "",
198+
}
199+
AnalysysAgent.pageView("商品页", pageInfo);
200+
},
201+
aliasR: function () {
202+
var str1 = "";
203+
for (var i = 0; i < 300; i++) {
204+
str1 += "你"
205+
}
206+
AnalysysAgent.alias("", "")
207+
// AnalysysAgent.alias("", "11")
208+
209+
},
210+
identifyR: function () {
211+
AnalysysAgent.identify("userName", true)
212+
},
213+
resetR: function () {
214+
AnalysysAgent.reset()
215+
},
216+
trackR: function () {
217+
let eventInfo = {
218+
"money": ""
219+
}
220+
AnalysysAgent.track("payment", eventInfo)
221+
},
222+
getUserInfo: function (e) { },
223+
nextPage: function () {
224+
tt.navigateTo({
225+
url: '../logs/logs?campagin_id=11&utm_source==22&utm_medium=33'
226+
})
227+
}
228+
})

0 commit comments

Comments
 (0)