Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
N
new_taobao
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
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
wildfirecode13
new_taobao
Commits
ac75957c
Commit
ac75957c
authored
Oct 18, 2020
by
zhangjinzhou
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
代码暂存
parent
59eec3b1
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
37 additions
and
35 deletions
+37
-35
pagegamemain.js
taobao_jn/client/pages/pagegamemain/pagegamemain.js
+34
-32
pagepageindex.js
taobao_jn/client/pages/pagepageindex/pagepageindex.js
+3
-3
No files found.
taobao_jn/client/pages/pagegamemain/pagegamemain.js
View file @
ac75957c
...
...
@@ -146,6 +146,7 @@ Page({
let
isnewdata
=
my
.
getStorageSync
({
key
:
'jn_'
+
app
.
openId
+
'_new'
});
console
.
log
(
"新手数据"
,
isnewdata
);
let
isnew
=
isnewdata
.
data
?
0
:
1
;
// isnew = 1;
this
.
setData
({
...
...
@@ -612,6 +613,39 @@ Page({
this
.
updateActInfo
();
},
onHide
()
{
this
.
hideSetData
();
this
.
setData
({
hidetime
:
ntime
});
},
//更新活动信息
//30s刷新一次邀请人列表,新增温暖,结束前5s再请求一次,onshow请求一次
async
updateActInfo
(
gamestat
=
"now"
)
{
// console.log("updateActInfo=======>");
clearTimeout
(
updateact
);
await
this
.
updateAttionList
(
gamestat
);
await
this
.
getInviteListByCurGame
();
let
lesstime
=
this
.
data
.
gametime
*
1000
;
let
chatime
=
30000
;
if
(
lesstime
>
chatime
)
{
}
else
{
if
(
lesstime
>
5000
)
{
chatime
=
lesstime
-
5000
;
}
else
{
chatime
=
0
;
}
}
if
(
chatime
>
0
)
{
// console.log("下次请求间隔", chatime);
updateact
=
setTimeout
(()
=>
{
this
.
updateActInfo
();
},
chatime
);
}
this
.
hideSetData
();
},
//hideset Data
hideSetData
()
{
//房间数据
let
roomdata
=
this
.
data
.
roomdata
;
let
roomnums
=
this
.
data
.
roomnums
;
...
...
@@ -646,38 +680,6 @@ Page({
hidetime
:
ntime
,
}
})
this
.
setData
({
hidetime
:
ntime
});
},
//更新活动信息
//30s刷新一次邀请人列表,新增温暖,结束前5s再请求一次,onshow请求一次
async
updateActInfo
(
gamestat
=
"now"
)
{
// console.log("updateActInfo=======>");
clearTimeout
(
updateact
);
await
this
.
updateAttionList
(
gamestat
);
await
this
.
getInviteListByCurGame
();
let
lesstime
=
this
.
data
.
gametime
*
1000
;
let
chatime
=
30000
;
if
(
lesstime
>
chatime
)
{
}
else
{
if
(
lesstime
>
5000
)
{
chatime
=
lesstime
-
5000
;
}
else
{
chatime
=
0
;
}
}
if
(
chatime
>
0
)
{
// console.log("下次请求间隔", chatime);
updateact
=
setTimeout
(()
=>
{
this
.
updateActInfo
();
},
chatime
);
}
},
//全局的update
updateAct
()
{
...
...
taobao_jn/client/pages/pagepageindex/pagepageindex.js
View file @
ac75957c
...
...
@@ -549,7 +549,7 @@ Page({
// }
// }
console
.
log
(
"上局状态"
,
data
);
//服务器的
let
{
joinGameStartTime
,
joinGameEndTime
,
toolStartTime
,
toolEndTime
,
winRate
,
propsCD
,
step
}
=
data
;
if
(
joinGameStartTime
&&
joinGameEndTime
)
{
...
...
@@ -558,7 +558,7 @@ Page({
nowTime
=
Date
.
now
();
}
let
toolcd
=
Math
.
ceil
(
(
toolEndTime
-
toolStartTime
)
/
1000
);
let
toolcd
=
Math
.
ceil
(
propsCD
);
let
tooless
=
Math
.
ceil
((
toolEndTime
-
nowTime
)
/
1000
);
if
(
tooless
<
0
){
tooless
=
0
;
...
...
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