Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
M
mayi-mp-shop
Overview
Overview
Details
Activity
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
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
程默
mayi-mp-shop
Commits
7a8b54e8
Commit
7a8b54e8
authored
Jun 09, 2022
by
李嘉林
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
视频封面、底部优化
parent
b6a74154
Show whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
26 additions
and
4 deletions
+26
-4
static/nativeComponents/VideoPlayer/index.js
+4
-3
static/nativeComponents/VideoPlayer/index.wxml
+3
-1
static/nativeComponents/VideoPlayer/index.wxss
+14
-0
static/nativeComponents/custom-tab-bar/index.wxss
+5
-0
No files found.
static/nativeComponents/VideoPlayer/index.js
View file @
7a8b54e8
...
...
@@ -17,7 +17,8 @@ const componentOptions = {
data
:
{
isPageHidden
:
false
,
// 页面是否处于隐藏状态
isPlay
:
false
,
videoContext
:
""
,
videoContext
:
""
,
firstPlay
:
false
,
},
// 数据监听器
observers
:
{},
...
...
@@ -48,7 +49,7 @@ const componentOptions = {
if
(
type
==
0
)
{
// 开始播放
this
.
videoContext
.
play
();
this
.
setData
({
isPlay
:
true
});
this
.
setData
({
isPlay
:
true
,
firstPlay
:
true
});
}
else
if
(
type
==
1
)
{
// 暂停播放
this
.
videoContext
.
pause
();
...
...
@@ -70,7 +71,7 @@ const componentOptions = {
this
.
videoContext
.
play
();
}
isPlay
=
!
isPlay
;
this
.
setData
({
isPlay
});
this
.
setData
({
isPlay
,
firstPlay
:
true
});
}
},
// 组件生命周期
...
...
static/nativeComponents/VideoPlayer/index.wxml
View file @
7a8b54e8
...
...
@@ -15,7 +15,9 @@
controls="{{datas.componentData['nativeControl']}}"
loop="{{datas.componentData['loopPlay']}}"
poster="{{datas.componentData['poster']}}"
/>
>
<image wx:if="{{!firstPlay}}" src="{{datas.componentData['poster']}}" mode="widthFix"></image>
</video>
<view
class="playerBtn"
bindtap="playVideo"
...
...
static/nativeComponents/VideoPlayer/index.wxss
View file @
7a8b54e8
...
...
@@ -11,12 +11,26 @@
}
.main .isVideo{
width: 100%;
height:0;
padding-bottom:56.25%;
position: relative;
}
.main .isVideo video{
width: 100%;
position:absolute;
left:0;
top:0;
width:100%;
height:100%;
display: block;
}
.main .isVideo video .posterImg {
position: absolute;
top: 0;
left: 0;
right: 0;
bottom: 0;
}
.main .isVideo .playerBtn{
position: absolute;
top: 50%;
...
...
static/nativeComponents/custom-tab-bar/index.wxss
View file @
7a8b54e8
...
...
@@ -1226,6 +1226,11 @@
justify-content: center;
align-items: center;
border: 4px solid #fff;
overflow: hidden;
}
.isItem .item .img-view image{
width: 90rpx!important;
height: 90rpx!important;
}
.icons {
width: 90rpx;
...
...
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