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
39b4d6f9
Commit
39b4d6f9
authored
Oct 04, 2020
by
AU-Pro-mac
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
add new code --15
parent
7f9bcb7a
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
61 additions
and
53 deletions
+61
-53
homePage.js
taobao_mini/client/pages/homePage/homePage.js
+61
-53
No files found.
taobao_mini/client/pages/homePage/homePage.js
View file @
39b4d6f9
...
...
@@ -96,8 +96,44 @@ Page({
// 页面加载
// 开场动画
this
.
setData
({
gameShow
:
true
,
gameType
:
3
,
gameShow_timeout
:
true
})
// 开场动画 => 业务页面 监听
// cover: getAuth login init checkDohelp
this
.
onAnimationLoadOver
()
this
.
getAuth
()
},
openAnimationTimeout
:
null
,
// 收到 canvas lottie 加载结束的 信息 -- 且等待 开场动画 5s
onAnimationLoadOver
(
msg
=
''
)
{
if
(
msg
===
'lottieReady'
)
{
console
.
log
(
'%creceive canvas lottie ready, onAnimationLoadOver'
,
'color:red;font-weight:bold;font-size:16px;padding: 4px 20px;'
)
console
.
log
(
`%c
${
msg
}
`
,
'color:red;font-weight:bold;font-size:16px;padding: 4px 20px;'
)
clearTimeout
(
this
.
openAnimationTimeout
)
this
.
openAnimationTimeout
=
setTimeout
(()
=>
{
this
.
setData
({
gameShow_timeout
:
false
,
gameType
:
0
})
setTimeout
(()
=>
{
this
.
setData
({
gameShow
:
false
})
// 主要的 授权 => 登陆 => 获取基本信息 开始
this
.
getAuth
()
},
350
)
},
5000
)
}
else
if
(
!
this
.
openAnimationTimeout
)
{
console
.
log
(
'%conAnimationLoadOver timeout run'
,
'color:red;font-weight:bold;font-size:16px;padding: 4px 20px;'
)
this
.
openAnimationTimeout
=
setTimeout
(()
=>
{
this
.
setData
({
gameShow_timeout
:
false
,
gameType
:
0
})
setTimeout
(()
=>
{
this
.
setData
({
gameShow
:
false
})
// 主要的 授权 => 登陆 => 获取基本信息 开始
this
.
getAuth
()
},
350
)
},
5500
)
}
},
// 获取用户授权信息
...
...
@@ -161,7 +197,7 @@ Page({
app
.
xxlWinRate
=
data
.
timeChallengeWinRate
// 游戏胜率 - 传送带
app
.
csdWinRate
=
data
.
conveyBeltWinRate
data
.
videoUrlArr
.
forEach
((
item
,
index
)
=>
{
// 获取视频 视频封面 视频小封面
this
.
videoSrcArr
[
index
]
=
{
...
...
@@ -183,7 +219,7 @@ Page({
}
})
.
catch
(
res
=>
{
console
.
warn
(
res
);
commonToast
(
res
&&
res
.
message
);
})
||
{};
// 检查是否是vip
this
.
checkVip
()
...
...
@@ -218,34 +254,6 @@ Page({
},
openAnimationTimeout
:
null
,
// 收到 canvas lottie 加载结束的 信息 -- 且等待 开场动画 30s
onAnimationLoadOver
(
msg
=
''
)
{
if
(
msg
===
'lottieReady'
)
{
console
.
log
(
'%creceive canvas lottie ready, onAnimationLoadOver'
,
'color:red;font-weight:bold;font-size:16px;padding: 4px 20px;'
)
console
.
log
(
`%c
${
msg
}
`
,
'color:red;font-weight:bold;font-size:16px;padding: 4px 20px;'
)
clearTimeout
(
this
.
openAnimationTimeout
)
this
.
openAnimationTimeout
=
setTimeout
(()
=>
{
this
.
setData
({
gameShow_timeout
:
false
,
gameType
:
0
})
setTimeout
(()
=>
{
this
.
setData
({
gameShow
:
false
})
},
350
)
},
5000
)
}
else
if
(
!
this
.
openAnimationTimeout
)
{
console
.
log
(
'%conAnimationLoadOver timeout run'
,
'color:red;font-weight:bold;font-size:16px;padding: 4px 20px;'
)
this
.
openAnimationTimeout
=
setTimeout
(()
=>
{
this
.
setData
({
gameShow_timeout
:
false
,
gameType
:
0
})
setTimeout
(()
=>
{
this
.
setData
({
gameShow
:
false
})
},
350
)
},
30000
)
}
},
// 开场动画
openAnimation
()
{
return
new
Promise
((
resolve
,
reject
)
=>
{
this
.
setData
({
gameShow
:
true
,
gameType
:
3
,
gameShow_timeout
:
true
})
})
},
// 检查助力标记
checkDohelpReturnMark
()
{
console
.
warn
(
'检查助力返回标记!!'
,
this
.
query
)
...
...
@@ -256,34 +264,34 @@ Page({
// 助力
checkDohelp
(){
if
(
this
.
query
.
inviteId
)
{
API
.
doHelp
({
activityId
:
app
.
activityId
,
inviteId
:
this
.
query
.
inviteId
}).
then
(
res
=>
{
const
{
code
,
data
,
success
,
message
}
=
res
console
.
log
(
'%c-----助力接口
\
n'
+
'-----yd.doHelp
\
n'
,
ConsoleStyle
,
res
)
if
(
success
)
{
this
.
showCommonMoadalT1
({
title
:
'恭喜您'
,
content
:
'助力成功~'
,
confirmCallback
:
()
=>
{
this
.
closeCommonModalT1
()
},
btnImg
:
'//yun.duiba.com.cn/spark/assets/我也要赢大奖.a22bebbd5be4a6e557ee4ef611216ba73b729d10.png'
})
}
else
{
if
(
code
==
'430004'
)
commonToast
(
message
)
if
(
!
data
.
isVip
)
{
app
.
vipUrl
=
data
.
url
API
.
doHelp
({
activityId
:
app
.
activityId
,
inviteId
:
this
.
query
.
inviteId
})
.
then
(
res
=>
{
const
{
code
,
data
,
success
,
message
}
=
res
console
.
log
(
'%c-----助力接口
\
n'
+
'-----yd.doHelp
\
n'
,
ConsoleStyle
,
res
)
if
(
success
)
{
this
.
showCommonMoadalT1
({
title
:
'
温馨提示
'
,
content
:
'
成为会员 才能为他助力哦
~'
,
title
:
'
恭喜您
'
,
content
:
'
助力成功
~'
,
confirmCallback
:
()
=>
{
navigateToOutside
(
data
.
url
)
this
.
closeCommonModalT1
(
)
},
btnImg
:
'//yun.duiba.com.cn/spark/assets/一秒成为会员.10be8a8ede8f6c62eadb005744dc54ae182911d9.png'
})
btnImg
:
'//yun.duiba.com.cn/spark/assets/我也要赢大奖.a22bebbd5be4a6e557ee4ef611216ba73b729d10.png'
})
}
else
{
if
(
!
data
.
isVip
)
{
app
.
vipUrl
=
data
.
url
this
.
showCommonMoadalT1
({
title
:
'温馨提示'
,
content
:
'成为会员 才能为他助力哦~'
,
confirmCallback
:
()
=>
{
navigateToOutside
(
data
.
url
)
},
btnImg
:
'//yun.duiba.com.cn/spark/assets/一秒成为会员.10be8a8ede8f6c62eadb005744dc54ae182911d9.png'
})
}
commonToast
(
message
);
}
commonToast
(
JSON
.
stringify
(
err
));
}
}).
catch
(
err
=>
{
console
.
log
(
err
)
commonToast
(
err
.
message
);
commonToast
(
err
.
message
+
'~~'
);
});
}
else
{
console
.
log
(
'不是分享落地页,不需要走助力~'
)
...
...
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