Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Q
QM_TJ
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
李增强
QM_TJ
Commits
f71033ff
Commit
f71033ff
authored
Apr 06, 2021
by
xgz
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
setdevie改成setidfa
parent
cfba5bad
Changes
6
Hide whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
30 additions
and
24 deletions
+30
-24
lib/qm_tj.dart
lib/qm_tj.dart
+2
-2
lib/src/tj/app.dart
lib/src/tj/app.dart
+8
-4
lib/src/tj/exposure.dart
lib/src/tj/exposure.dart
+4
-6
lib/src/tj/page.dart
lib/src/tj/page.dart
+8
-4
lib/src/tj/tap.dart
lib/src/tj/tap.dart
+3
-3
lib/src/utils.dart
lib/src/utils.dart
+5
-5
No files found.
lib/qm_tj.dart
View file @
f71033ff
...
...
@@ -24,8 +24,8 @@ class QMTJ {
}
// 设置设备ID
static
void
set
DeviceId
(
String
d
)
{
Utils
.
set
Device
Id
(
d
);
static
void
set
IDFA
(
String
d
)
{
Utils
.
set
Idfa
Id
(
d
);
}
// 设置渠道
...
...
lib/src/tj/app.dart
View file @
f71033ff
...
...
@@ -52,13 +52,17 @@ class App {
// 上传数据至接口
Future
<
void
>
upload
()
async
{
await
_db
.
ready
;
List
<
Map
>
list
=
await
_db
.
db
.
query
(
"app_tj"
,
where:
"disappear_time < ?"
,
whereArgs:
[
startUpTime
],
limit:
100
,
offset:
0
);
List
<
Map
>
list
=
await
_db
.
db
.
query
(
"app_tj"
,
where:
"disappear_time < ?"
,
whereArgs:
[
startUpTime
],
limit:
100
,
offset:
0
);
if
(
list
.
length
==
0
)
{
return
;
}
String
deviceId
=
await
Utils
.
getDevice
Id
();
String
idfaId
=
await
Utils
.
getIDFA
Id
();
bool
result
=
await
Utils
.
uploadData
({
"
device_id"
:
device
Id
,
"
idfa_id"
:
idfa
Id
,
"projects"
:
[
{
"event_name"
:
"app_stage"
,
"event_data"
:
list
}
]
...
...
@@ -72,7 +76,7 @@ class App {
Utils
.
log
(
"app upload_result"
,
{
"ok"
:
result
,
"length"
:
list
.
length
});
}
if
(
list
.
length
==
100
)
{
await
upload
();
await
upload
();
}
}
}
lib/src/tj/exposure.dart
View file @
f71033ff
...
...
@@ -35,9 +35,9 @@ class Exposure {
if
(
list
.
length
==
0
)
{
return
;
}
String
deviceId
=
await
Utils
.
getDevice
Id
();
String
idfaId
=
await
Utils
.
getIDFA
Id
();
bool
result
=
await
Utils
.
uploadData
({
"
device_id"
:
device
Id
,
"
idfa_id"
:
idfa
Id
,
"projects"
:
[
{
"event_name"
:
"elem_exposure"
,
"event_data"
:
list
}
]
...
...
@@ -48,13 +48,11 @@ class Exposure {
"delete from exposure_tj where id in('
${ids.join("','")}
')"
);
}
if
(
Utils
.
isDebug
)
{
Utils
.
log
(
"exposure upload_result"
,
{
"ok"
:
result
,
"length"
:
list
.
length
});
Utils
.
log
(
"exposure upload_result"
,
{
"ok"
:
result
,
"length"
:
list
.
length
});
}
if
(
list
.
length
==
100
)
{
await
upload
();
}
}
}
lib/src/tj/page.dart
View file @
f71033ff
...
...
@@ -60,13 +60,17 @@ class Page {
// 上传数据至接口
Future
<
void
>
upload
()
async
{
await
_db
.
ready
;
List
<
Map
>
list
=
await
_db
.
db
.
query
(
"page_tj"
,
where:
'disappear_time < ?'
,
whereArgs:
[
startUpTime
],
limit:
100
,
offset:
0
);
List
<
Map
>
list
=
await
_db
.
db
.
query
(
"page_tj"
,
where:
'disappear_time < ?'
,
whereArgs:
[
startUpTime
],
limit:
100
,
offset:
0
);
if
(
list
.
length
==
0
)
{
return
;
}
String
deviceId
=
await
Utils
.
getDevice
Id
();
String
idfaId
=
await
Utils
.
getIDFA
Id
();
bool
result
=
await
Utils
.
uploadData
({
"
device_id"
:
device
Id
,
"
idfa_id"
:
idfa
Id
,
"projects"
:
[
{
"event_name"
:
"page_scan"
,
"event_data"
:
list
}
]
...
...
@@ -80,7 +84,7 @@ class Page {
Utils
.
log
(
"page upload_result"
,
{
"ok"
:
result
,
"length"
:
list
.
length
});
}
if
(
list
.
length
==
100
)
{
await
upload
();
await
upload
();
}
}
}
lib/src/tj/tap.dart
View file @
f71033ff
...
...
@@ -38,9 +38,9 @@ class Tap {
if
(
list
.
length
==
0
)
{
return
;
}
String
deviceId
=
await
Utils
.
getDevice
Id
();
String
idfaId
=
await
Utils
.
getIDFA
Id
();
bool
result
=
await
Utils
.
uploadData
({
"
device_id"
:
device
Id
,
"
idfa_id"
:
idfa
Id
,
"projects"
:
[
{
"event_name"
:
"elem_click"
,
"event_data"
:
list
}
]
...
...
@@ -54,7 +54,7 @@ class Tap {
Utils
.
log
(
"tap upload_result"
,
{
"ok"
:
result
,
"length"
:
list
.
length
});
}
if
(
list
.
length
==
100
)
{
await
upload
();
await
upload
();
}
}
}
lib/src/utils.dart
View file @
f71033ff
...
...
@@ -6,7 +6,7 @@ import 'package:connectivity/connectivity.dart';
class
Utils
{
static
String
channel
=
''
;
static
String
device
Id
=
''
;
static
String
idfa
Id
=
''
;
static
bool
isDebug
=
false
;
static
Http
_http
=
Http
(
scheme:
"http"
,
host:
"8.135.58.206"
,
port:
8802
);
...
...
@@ -53,13 +53,13 @@ class Utils {
}
// 设置设备ID
static
void
set
Device
Id
(
String
d
)
{
device
Id
=
d
;
static
void
set
Idfa
Id
(
String
d
)
{
idfa
Id
=
d
;
}
// 获取设备ID
static
Future
<
String
>
get
Device
Id
()
async
{
return
device
Id
;
static
Future
<
String
>
get
IDFA
Id
()
async
{
return
idfa
Id
;
}
// 获取公共参数
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment