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
84bac9f7
Commit
84bac9f7
authored
Sep 29, 2020
by
AU-Pro-mac
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
complete video task and video rewards --02
parent
471e4555
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
36 additions
and
22 deletions
+36
-22
homePage.axml
taobao_mini/client/pages/homePage/homePage.axml
+3
-2
homePage.js
taobao_mini/client/pages/homePage/homePage.js
+33
-20
No files found.
taobao_mini/client/pages/homePage/homePage.axml
View file @
84bac9f7
...
@@ -46,9 +46,10 @@
...
@@ -46,9 +46,10 @@
<view class="video_hide" onTap="videoHideFunc"> 缩小视频 </view>
<view class="video_hide" onTap="videoHideFunc"> 缩小视频 </view>
<!-- 视频部分 -->
<!-- 视频部分 -->
<view hidden="{{videoBottom_timeout}}"
onTap="videoShowFunc"
class="video_block {{ videoBottom ? 'block_opciaty0' : ''}}">
<view hidden="{{videoBottom_timeout}}" class="video_block {{ videoBottom ? 'block_opciaty0' : ''}}">
<view class="video_block_wrapper">
<view class="video_block_wrapper"
onTap="videoShowFunc"
>
<view class="video_block_text">
<view class="video_block_text">
<image src="{{videoImgSrcSmall}}" mode="aspectFill" />
<view>观看XXXXX视频</view>
<view>观看XXXXX视频</view>
<view>赢惊喜抽奖次数</view>
<view>赢惊喜抽奖次数</view>
</view>
</view>
...
...
taobao_mini/client/pages/homePage/homePage.js
View file @
84bac9f7
...
@@ -15,9 +15,9 @@ Page({
...
@@ -15,9 +15,9 @@ Page({
// 视频地址列表 - 存储播放时常
// 视频地址列表 - 存储播放时常
videoSrcArr
:
[
videoSrcArr
:
[
//
{ url: 'https://cloud.video.taobao.com/play/u/20446068/p/1/e/6/t/1/239271757987.mp4', timeStamp: 0, totalTime: 0, completed: false },
{
url
:
'https://cloud.video.taobao.com/play/u/20446068/p/1/e/6/t/1/239271757987.mp4'
,
timeStamp
:
0
,
totalTime
:
0
,
completed
:
false
},
//
{ url: 'https://cloud.video.taobao.com/play/u/20446068/p/1/e/6/t/1/239271757987.mp4', timeStamp: 0, totalTime: 0, completed: false },
{
url
:
'https://cloud.video.taobao.com/play/u/20446068/p/1/e/6/t/1/239271757987.mp4'
,
timeStamp
:
0
,
totalTime
:
0
,
completed
:
false
},
//
{ url: 'https://cloud.video.taobao.com/play/u/20446068/p/1/e/6/t/1/239271757987.mp4', timeStamp: 0, totalTime: 0, completed: false }
{
url
:
'https://cloud.video.taobao.com/play/u/20446068/p/1/e/6/t/1/239271757987.mp4'
,
timeStamp
:
0
,
totalTime
:
0
,
completed
:
false
}
],
],
// 视频记录 flag
// 视频记录 flag
timeStampCountFlag
:
false
,
timeStampCountFlag
:
false
,
...
@@ -27,10 +27,12 @@ Page({
...
@@ -27,10 +27,12 @@ Page({
timeStampRecord
:
0
,
timeStampRecord
:
0
,
// 视频预览图列表
// 视频预览图列表
posterSrcArr
:
[
posterSrcArr
:
[
//
'https://yun.duiba.com.cn/spark/assets/bg1.d818f787351875b0982937d8bb68b0655febec3c.png',
'https://yun.duiba.com.cn/spark/assets/bg1.d818f787351875b0982937d8bb68b0655febec3c.png'
,
//
'https://yun.duiba.com.cn/spark/assets/弹窗背景_奖品.dce4e3dd9a3fcae166dfbd934b714ce1bc7fa5c9.png',
'https://yun.duiba.com.cn/spark/assets/弹窗背景_奖品.dce4e3dd9a3fcae166dfbd934b714ce1bc7fa5c9.png'
,
//
'https://yun.duiba.com.cn/spark/assets/7191ae57140b4937ae42500e76aa533693326ef9.png',
'https://yun.duiba.com.cn/spark/assets/7191ae57140b4937ae42500e76aa533693326ef9.png'
,
],
],
// 小封面图
videoImgSrcSmallArr
:
[],
// 是否是会员
// 是否是会员
isVip
:
false
,
isVip
:
false
,
// 是否关注店铺
// 是否关注店铺
...
@@ -68,6 +70,7 @@ Page({
...
@@ -68,6 +70,7 @@ Page({
initTime
:
0
,
initTime
:
0
,
mobilenetHintType
:
1
,
mobilenetHintType
:
1
,
videoActiveIndex
:
0
,
videoActiveIndex
:
0
,
videoImgSrcSmall
:
''
,
// 视频小封面图
// ------ 视频 配置 ------ //
// ------ 视频 配置 ------ //
// 出现 选择游戏弹窗
// 出现 选择游戏弹窗
...
@@ -161,14 +164,16 @@ Page({
...
@@ -161,14 +164,16 @@ Page({
else
{
else
{
console
.
log
(
'%c-----活动基本信息
\
n'
+
'-----yd.getActivityBaseInfoById
\
n'
,
ConsoleStyle
,
data
)
console
.
log
(
'%c-----活动基本信息
\
n'
+
'-----yd.getActivityBaseInfoById
\
n'
,
ConsoleStyle
,
data
)
data
.
videoUrlArr
.
forEach
((
item
,
index
)
=>
{
data
.
videoUrlArr
.
forEach
((
item
,
index
)
=>
{
this
.
videoSrcArr
[
index
]
=
{
//
this.videoSrcArr[index] = {
url
:
item
,
timeStamp
:
0
,
totalTime
:
0
,
completed
:
false
//
url: item, timeStamp: 0, totalTime: 0, completed: false
}
//
}
// this.posterSrcArr
// this.posterSrcArr
// this.videoImgSrcSmallArr = data.videoImgSrcSmallArr
})
})
this
.
setData
({
this
.
setData
({
rule
:
data
.
rule
,
rule
:
data
.
rule
,
videoSrc
:
this
.
videoSrcArr
[
0
]
videoSrc
:
this
.
videoSrcArr
[
0
].
url
,
// videoImgSrcSmall: this.videoImgSrcSmallArr[0],
})
})
}
}
...
@@ -328,12 +333,15 @@ Page({
...
@@ -328,12 +333,15 @@ Page({
let
i
=
this
.
data
.
videoActiveIndex
let
i
=
this
.
data
.
videoActiveIndex
if
(
i
>
0
)
{
if
(
i
>
0
)
{
this
.
videoCtx
.
stop
()
this
.
videoCtx
.
stop
()
this
.
videoRecord
(
i
)
// 因为 现在只有 视频缩小时 会暂停,所以切换时不需要记录 仅在缩小时记录
// this.videoRecord(i)
setTimeout
(()
=>
{
setTimeout
(()
=>
{
i
-=
1
i
-=
1
let
vsrc
=
this
.
videoSrcArr
[
i
].
url
,
let
vsrc
=
this
.
videoSrcArr
[
i
].
url
,
psrc
=
this
.
posterSrcArr
[
i
]
psrc
=
this
.
posterSrcArr
[
i
],
spsrc
=
this
.
videoImgSrcSmallArr
[
i
]
this
.
setData
({
this
.
setData
({
videoImgSrcSmall
:
spsrc
,
videoSrc
:
vsrc
,
videoSrc
:
vsrc
,
posterSrc
:
psrc
,
posterSrc
:
psrc
,
videoActiveIndex
:
i
videoActiveIndex
:
i
...
@@ -348,12 +356,15 @@ Page({
...
@@ -348,12 +356,15 @@ Page({
let
i
=
this
.
data
.
videoActiveIndex
let
i
=
this
.
data
.
videoActiveIndex
if
(
i
<
this
.
videoSrcArr
.
length
-
1
)
{
if
(
i
<
this
.
videoSrcArr
.
length
-
1
)
{
this
.
videoCtx
.
stop
()
this
.
videoCtx
.
stop
()
this
.
videoRecord
(
i
)
// 因为 现在只有 视频缩小时 会暂停,所以切换时不需要记录 仅在缩小时记录
// this.videoRecord(i)
setTimeout
(()
=>
{
setTimeout
(()
=>
{
i
+=
1
i
+=
1
let
vsrc
=
this
.
videoSrcArr
[
i
].
url
,
let
vsrc
=
this
.
videoSrcArr
[
i
].
url
,
psrc
=
this
.
posterSrcArr
[
i
]
psrc
=
this
.
posterSrcArr
[
i
],
spsrc
=
this
.
videoImgSrcSmallArr
[
i
]
this
.
setData
({
this
.
setData
({
videoImgSrcSmall
:
spsrc
,
videoSrc
:
vsrc
,
videoSrc
:
vsrc
,
posterSrc
:
psrc
,
posterSrc
:
psrc
,
videoActiveIndex
:
i
videoActiveIndex
:
i
...
@@ -379,7 +390,8 @@ Page({
...
@@ -379,7 +390,8 @@ Page({
// video - onPause
// video - onPause
onPause
()
{
onPause
()
{
console
.
log
(
'---- 视频播放暂停'
,
this
.
timeStamp
)
console
.
log
(
'---- 视频播放暂停'
,
this
.
timeStamp
)
this
.
videoRecord
(
this
.
data
.
videoActiveIndex
)
// 因为 现在只有 视频缩小时 会暂停,所以切换时不需要记录 仅在缩小时记录
// this.videoRecord(this.data.videoActiveIndex)
},
},
// video - onEnded
// video - onEnded
...
@@ -400,9 +412,11 @@ Page({
...
@@ -400,9 +412,11 @@ Page({
// video - hide
// video - hide
videoHideFunc
()
{
videoHideFunc
()
{
console
.
log
(
'videoHideFunc'
)
this
.
videoRecord
(
this
.
data
.
videoActiveIndex
)
console
.
log
(
'videoHideFunc'
,
this
.
videoSrcArr
)
this
.
setData
({
videoShow
:
false
})
this
.
setData
({
videoShow
:
false
})
if
(
this
.
videoSrcArr
[
this
.
data
.
videoActiveIndex
].
timeStamp
>=
15
&&
!
this
.
videoSrcArr
[
this
.
data
.
videoActiveIndex
].
completed
)
{
// 观看超过 15000ms 15s
if
(
this
.
videoSrcArr
[
this
.
data
.
videoActiveIndex
].
timeStamp
>=
15000
&&
!
this
.
videoSrcArr
[
this
.
data
.
videoActiveIndex
].
completed
)
{
this
.
videoSrcArr
[
this
.
data
.
videoActiveIndex
].
completed
=
true
this
.
videoSrcArr
[
this
.
data
.
videoActiveIndex
].
completed
=
true
this
.
getWatchRewards
()
this
.
getWatchRewards
()
}
}
...
@@ -410,7 +424,7 @@ Page({
...
@@ -410,7 +424,7 @@ Page({
// 观看视频领奖
// 观看视频领奖
getWatchRewards
()
{
getWatchRewards
()
{
API
.
sendCoinsByWatch
({
activityId
:
app
.
activityId
,
videoIndex
:
this
.
videoActiveIndex
})
API
.
sendCoinsByWatch
({
activityId
:
app
.
activityId
,
videoIndex
:
this
.
data
.
videoActiveIndex
})
.
then
(
res
=>
{
.
then
(
res
=>
{
const
{
success
,
data
}
=
res
const
{
success
,
data
}
=
res
if
(
success
)
{
if
(
success
)
{
...
@@ -474,6 +488,7 @@ Page({
...
@@ -474,6 +488,7 @@ Page({
}
}
})
})
},
},
// 显示通用弹层
// 显示通用弹层
showCommonMoadalT2
(
obj
)
{
showCommonMoadalT2
(
obj
)
{
let
{
title
,
content
,
confirmCallback1
,
confirmCallback2
,
btnImg1
,
btnImg2
,
rewardsImg
}
=
obj
let
{
title
,
content
,
confirmCallback1
,
confirmCallback2
,
btnImg1
,
btnImg2
,
rewardsImg
}
=
obj
...
@@ -485,8 +500,6 @@ Page({
...
@@ -485,8 +500,6 @@ Page({
})
})
},
},
onModalT2One
()
{
this
.
data
.
onModalT2One
()
},
onModalT2One
()
{
this
.
data
.
onModalT2One
()
},
onModalT2Two
()
{
this
.
data
.
onModalT2Two
()
},
onModalT2Two
()
{
this
.
data
.
onModalT2Two
()
},
confirmCommonModalT1
()
{
this
.
data
.
confirmCommonModalT1
()
},
confirmCommonModalT1
()
{
this
.
data
.
confirmCommonModalT1
()
},
...
...
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