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
d42cedae
Commit
d42cedae
authored
Jan 23, 2021
by
李增强
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
m
parent
17525f2c
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
20 additions
and
7 deletions
+20
-7
lib/qm_tj.dart
lib/qm_tj.dart
+20
-7
No files found.
lib/qm_tj.dart
View file @
d42cedae
...
...
@@ -10,16 +10,21 @@ class QMTJ {
static
DB
_db
;
static
String
_appStartUpId
;
static
Future
<
bool
>
ready
;
static
bool
isDebug
=
false
;
static
void
debug
()
{
isDebug
=
true
;
}
static
Future
<
void
>
init
()
async
{
static
init
()
{
_appStartUpId
=
_md5
(
_getDateNow
().
toString
());
_db
=
new
DB
();
await
_db
.
init
();
ready
=
new
Future
<
bool
>(()
async
{
_db
=
new
DB
();
await
await
_db
.
init
();
return
true
;
});
}
/// APP 启动
...
...
@@ -36,6 +41,7 @@ class QMTJ {
"appear_time"
:
appearTime
,
"extras"
:
json
.
encode
(
extras
),
};
await
ready
;
log
(
"appStart"
,
map
);
await
_db
.
db
.
insert
(
"app_tj"
,
map
);
}
...
...
@@ -57,20 +63,22 @@ class QMTJ {
"appear_time"
:
appearTime
,
"extras"
:
json
.
encode
(
extras
),
};
await
ready
;
log
(
"appAppear"
,
map
);
await
_db
.
db
.
insert
(
"app_tj"
,
map
);
}
/// APP 不可见
static
void
appDisappear
()
{
static
void
appDisappear
()
async
{
int
disappearTime
=
_getDateNow
();
_db
.
db
.
update
(
"app_tj"
,
{
"disappear_time"
:
disappearTime
},
where:
"id = ? and disappear_time = 0"
,
whereArgs:
[
_appStartUpId
]);
Map
<
String
,
dynamic
>
map
=
{
"id"
:
_appStartUpId
,
"disappear_time"
:
disappearTime
,
};
await
ready
;
log
(
"appDisappear"
,
map
);
_db
.
db
.
update
(
"app_tj"
,
{
"disappear_time"
:
disappearTime
},
where:
"id = ? and disappear_time = 0"
,
whereArgs:
[
_appStartUpId
]);
}
/// PAGE 可见
...
...
@@ -92,6 +100,7 @@ class QMTJ {
"disappear_time"
:
disappearTime
,
"extras"
:
extrasStr
,
};
await
ready
;
log
(
"pageAppear"
,
map
);
await
_db
.
db
.
insert
(
"page_tj"
,
map
);
}
...
...
@@ -102,6 +111,9 @@ class QMTJ {
String
extrasStr
=
json
.
encode
(
extras
);
String
id
=
_md5
(
"
${pageId}
_
${lastPageId}
_
$extrasStr
"
);
int
disappearTime
=
_getDateNow
();
await
ready
;
log
(
"pageDisappear"
,
map
);
await
_db
.
db
.
update
(
"page_tj"
,
{
...
...
@@ -116,7 +128,6 @@ class QMTJ {
"disappear_time"
:
disappearTime
,
"extras"
:
extrasStr
,
};
log
(
"pageDisappear"
,
map
);
}
/// 点击
...
...
@@ -139,6 +150,7 @@ class QMTJ {
"click_time"
:
clickTime
,
"extras"
:
extrasStr
,
};
await
ready
;
log
(
"tap"
,
map
);
await
_db
.
db
.
insert
(
"tap_tj"
,
map
);
}
...
...
@@ -163,6 +175,7 @@ class QMTJ {
"exposure_time"
:
exposureTime
,
"extras"
:
extrasStr
,
};
await
ready
;
log
(
"exposure"
,
map
);
await
_db
.
db
.
insert
(
"exposure_tj"
,
map
);
}
...
...
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