Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Submit feedback
Sign in
Toggle navigation
X
xzf_uniapp-wechat-web
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
李智书
xzf_uniapp-wechat-web
Commits
ef75ba86
Commit
ef75ba86
authored
Nov 25, 2024
by
袁玲利
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
返回刷新界面
parent
a74ddfd4
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
32 additions
and
17 deletions
+32
-17
src/pages/gameOrder/gameOrder.vue
src/pages/gameOrder/gameOrder.vue
+32
-17
No files found.
src/pages/gameOrder/gameOrder.vue
View file @
ef75ba86
...
@@ -115,29 +115,36 @@ export default {
...
@@ -115,29 +115,36 @@ export default {
second
:
0
,
second
:
0
,
};
};
},
},
onShow
()
{
uni
.
$on
(
"
refreshPage
"
,
(
data
)
=>
{
console
.
log
(
data
,
"
ttttttttttttt
"
);
if
(
data
.
reload
)
{
this
.
init
();
}
});
},
mounted
()
{
mounted
()
{
this
.
games
.
sort
(()
=>
0.5
-
Math
.
random
());
this
.
params
.
userid
=
this
.
getQueryParams
(
"
userId
"
)
||
uni
.
getStorageSync
(
"
userid
"
);
this
.
params
.
sessionid
=
this
.
getQueryParams
(
"
sessionid
"
)
||
uni
.
getStorageSync
(
"
sessionid
"
);
this
.
params
.
behavior
=
"
viewPage
"
;
this
.
params
.
data
=
"
gameOrder
"
;
this
.
GameStatistics
();
if
(
this
.
params
.
userid
)
{
uni
.
setStorageSync
(
"
userid
"
,
this
.
params
.
userid
);
}
if
(
this
.
params
.
sessionid
)
{
uni
.
setStorageSync
(
"
sessionid
"
,
this
.
params
.
sessionid
);
}
this
.
init
();
this
.
init
();
},
},
methods
:
{
methods
:
{
init
()
{
init
()
{
const
self
=
this
;
const
self
=
this
;
this
.
games
.
sort
(()
=>
0.5
-
Math
.
random
());
this
.
params
.
userid
=
this
.
getQueryParams
(
"
userId
"
)
||
uni
.
getStorageSync
(
"
userid
"
);
this
.
params
.
sessionid
=
this
.
getQueryParams
(
"
sessionid
"
)
||
uni
.
getStorageSync
(
"
sessionid
"
);
this
.
params
.
behavior
=
"
viewPage
"
;
this
.
params
.
data
=
"
gameOrder
"
;
this
.
GameStatistics
();
if
(
this
.
params
.
userid
)
{
uni
.
setStorageSync
(
"
userid
"
,
this
.
params
.
userid
);
}
if
(
this
.
params
.
sessionid
)
{
uni
.
setStorageSync
(
"
sessionid
"
,
this
.
params
.
sessionid
);
}
this
.
timer
=
setInterval
(()
=>
{
this
.
timer
=
setInterval
(()
=>
{
this
.
second
+=
1
;
this
.
second
+=
1
;
if
(
this
.
second
==
5
)
{
if
(
this
.
second
==
5
)
{
...
@@ -232,6 +239,12 @@ export default {
...
@@ -232,6 +239,12 @@ export default {
// uni.navigateToMiniProgram({
// uni.navigateToMiniProgram({
// appId: game.appId,
// appId: game.appId,
// });
// });
this
.
params
.
userid
=
this
.
getQueryParams
(
"
userId
"
)
||
uni
.
getStorageSync
(
"
userid
"
);
this
.
params
.
sessionid
=
this
.
getQueryParams
(
"
sessionid
"
)
||
uni
.
getStorageSync
(
"
sessionid
"
);
console
.
log
(
this
.
params
.
userid
,
"
zzzzzzzuserid
"
);
console
.
log
(
this
.
params
.
sessionid
,
"
zzzzzzzsessionid
"
);
this
.
params
.
behavior
=
"
click
"
;
this
.
params
.
behavior
=
"
click
"
;
this
.
params
.
data
=
game
.
appId
;
this
.
params
.
data
=
game
.
appId
;
this
.
GameStatistics
();
this
.
GameStatistics
();
...
@@ -249,6 +262,8 @@ export default {
...
@@ -249,6 +262,8 @@ export default {
clearInterval
(
this
.
timer
);
clearInterval
(
this
.
timer
);
this
.
timer
=
null
;
this
.
timer
=
null
;
}
}
// 移除监听,避免内存泄露
uni
.
$off
(
"
refreshPage
"
);
},
},
};
};
</
script
>
</
script
>
...
...
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