Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
U
uniapp_vedio
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
android
uniapp_vedio
Commits
eb0f2a01
Commit
eb0f2a01
authored
Nov 18, 2024
by
jyx
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
代码优化
parent
cb13036e
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
53 additions
and
49 deletions
+53
-49
player.vue
vedio/components/player/player.vue
+25
-19
index.vue
vedio/pagesC/playlet/index.vue
+28
-30
No files found.
vedio/components/player/player.vue
View file @
eb0f2a01
...
...
@@ -11,16 +11,15 @@
</view>
<view
class=
"shortcut"
v-show=
"showShortcutPop"
>
<image
style=
"width:
70rpx;height: 70rpx;margin-left:
10rpx;"
src=
"../../static/logo-about.png"
>
<image
style=
"width:
70rpx;height:70rpx;margin-left:
10rpx;"
src=
"../../static/logo-about.png"
>
</image>
<view
class=
"flex1"
style=
"margin-left:
20rpx;"
>
<view
style=
"font-size: 26rpx;"
>
添加至桌面
</view>
<view
style=
"font-size: 2
0
rpx;"
>
下次看剧更方便
</view>
<view
class=
"flex1"
style=
"margin-left:20rpx;"
>
<view
style=
"font-size: 26rpx;
font-weight: 700;
"
>
添加至桌面
</view>
<view
style=
"font-size: 2
2
rpx;"
>
下次看剧更方便
</view>
</view>
<button
@
click=
"addShortcut"
open-type=
"addShortcut"
bindaddshortcut=
"eventHandler"
style=
"font-size: 24rpx;background-color: crimson;border-radius: 5rpx;color: white;
padding: 0 12rpx;margin-left: 30rpx;"
>
立即添加
</button>
<image
@
click=
"closeShortcutPop"
style=
"width: 40rpx; height: 40rpx;"
src=
"../../static/video/close.png"
>
<button
@
click=
"addShortcut"
open-type=
"addShortcut"
bindaddshortcut=
"eventHandler"
style=
"font-size:26rpx;background-color:crimson;border-radius:5rpx;color:white;
height:55rpx;line-height:53rpx;margin-left:30rpx;font-weight:700;"
>
立即添加
</button>
<image
@
click=
"closeShortcutPop"
style=
"width:30rpx;height:30rpx;"
src=
"../../static/video/close.png"
>
</image>
</view>
</view>
...
...
@@ -83,7 +82,7 @@
console
.
log
(
"触发播放进度变化onTimeUpdate回调:"
,
e
);
// 播放到第10秒且今天没有弹出 ,弹出加入桌面
if
((
e
.
currentTime
>
3
)
&&
this
.
canShowShortcut
)
{
if
((
e
.
currentTime
>
10
)
&&
this
.
canShowShortcut
)
{
this
.
showShortcutPop
=
true
this
.
canShowShortcut
=
false
this
.
setShowShortcut
()
...
...
@@ -126,7 +125,8 @@
});
// 推荐位使用简单示例
pm
.
onChangeEpisode
((
e
)
=>
{
console
.
log
(
"触发选集切换onChangeEpisode回调:"
,
e
);
console
.
log
(
"触发选集切换onChangeEpisode回调:"
,
e
);
this
.
albumId
=
e
.
albumId
this
.
seq
=
e
.
seq
this
.
episodeId
=
e
.
episodeId
...
...
@@ -411,11 +411,14 @@
message
.
notify
(
data
.
msg
)
if
(
data
.
code
==
200
)
{
this
.
pm
.
setCurrentUnlock
()
this
.
pm
.
setCurrentUnlock
()
// this.commitVideo()
}
else
if
(
data
.
code
==
301
)
{
this
.
pm
.
setCurrentUnlock
()
this
.
pm
.
setCurrentUnlock
()
// this.commitVideo()
}
else
if
(
data
.
code
==
302
)
{
this
.
pm
.
setCurrentUnlock
()
this
.
pm
.
setCurrentUnlock
()
// this.commitVideo()
}
else
if
(
data
.
code
==
303
)
{
this
.
pm
.
toggleCustomDialog
()
}
...
...
@@ -439,11 +442,14 @@
message
.
notify
(
data
.
msg
)
if
(
data
.
code
==
200
)
{
that
.
pm
.
setCurrentUnlock
()
that
.
pm
.
setCurrentUnlock
()
this
.
commitVideo
()
}
else
if
(
data
.
code
==
301
)
{
that
.
pm
.
setCurrentUnlock
()
that
.
pm
.
setCurrentUnlock
()
this
.
commitVideo
()
}
else
if
(
data
.
code
==
302
)
{
that
.
pm
.
setCurrentUnlock
()
that
.
pm
.
setCurrentUnlock
()
this
.
commitVideo
()
}
else
if
(
data
.
code
==
303
)
{
that
.
pm
.
toggleCustomDialog
()
}
...
...
@@ -482,15 +488,15 @@
<
style
lang=
"scss"
>
.shortcut
{
position
:
absolute
;
top
:
8
2
%
;
top
:
8
5
%
;
left
:
40%
;
transform
:
translate
(
-50%
,
-50%
);
display
:
flex
;
flex-direction
:
row
;
align-items
:
center
;
// justify-content: space-between;
width
:
6
0
%
;
height
:
9
0rpx
;
width
:
6
5
%
;
height
:
10
0rpx
;
padding
:
0
20rpx
;
background-color
:
whitesmoke
;
border-radius
:
10rpx
;
...
...
vedio/pagesC/playlet/index.vue
View file @
eb0f2a01
...
...
@@ -17,20 +17,19 @@
//采用uniapp的生命周期函数
onLoad
(
option
)
{
let
data
=
JSON
.
parse
(
decodeURIComponent
(
option
.
data
));
this
.
loadData
(
data
)
setTimeout
(()
=>
{
const
p_m
=
getPlayletManager
(
this
);
p_m
.
setCatalog
({
freeList
:
data
.
douyinFreeList
,
unlockList
:
data
.
douyinUnlockList
,
lockList
:
data
.
douyinLockList
,
});
},
500
)
},
onReady
()
{
const
p_m
=
getPlayletManager
(
this
);
p_m
.
setCatalog
({
freeList
:
[{
start_episode_no
:
1
,
end_episode_no
:
5
,
}],
lockList
:
[{
start_episode_no
:
6
,
end_episode_no
:
200
,
}],
});
p_m
.
onPlay
((
e
)
=>
{
console
.
error
(
"可以播放了,可以播放了,可以播放了,可以播放了"
,
e
);
});
...
...
@@ -57,28 +56,27 @@
console
.
log
(
num
,
"cliPause"
);
},
loadData
(
data
)
{
const
p_m
=
getPlayletManager
(
this
);
// const p_m = getPlayletManager(this);
// common.methods.post({
// url: '/vedio/getIndexList',
// data: {
// vedioId: data.vedioId
// },
// showLoading: false,
// success: ({
// data
// }) => {
common
.
methods
.
post
({
url
:
'/vedio/getIndexList'
,
data
:
{
vedioId
:
data
.
vedioId
},
showLoading
:
false
,
success
:
({
data
})
=>
{
let
_data
=
data
.
vedioMsg
// let _data = data.vedioMsg
p_m
.
setCatalog
({
freeList
:
_data
.
douyinFreeList
,
unlockList
:
_data
.
douyinUnlockList
,
lockList
:
_data
.
douyinLockList
,
});
//
p_m.setCatalog({
//
freeList: _data.douyinFreeList,
//
unlockList: _data.douyinUnlockList,
//
lockList: _data.douyinLockList,
//
});
}
});
//
}
//
});
}
},
};
...
...
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