Skip to content
Projects
Groups
Snippets
Help
Loading...
Sign in / Register
Toggle navigation
W
wechatapp.shangjiadao.com
Project
Project
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
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
wangxuelai
wechatapp.shangjiadao.com
Commits
bd24cfe6
Commit
bd24cfe6
authored
Oct 11, 2019
by
wangxuelai
Browse files
Options
Browse Files
Download
Plain Diff
Merge remote-tracking branch 'origin/sj-dev-v7' into wxl-develop
parents
f7c420cf
10961352
Hide whitespace changes
Inline
Side-by-side
Showing
8 changed files
with
73 additions
and
44 deletions
+73
-44
index.wxs
filter/index.wxs
+25
-1
index.js
src/pages/themeindex/index.js
+0
-5
index.wxml
src/pages/videoplay/index.wxml
+1
-1
index.wxss
src/pages/videoplay/index.wxss
+2
-2
index.js
src/pages/websiteindex/index.js
+0
-22
infovideo.js
src/pages/websiteindex/infovideo.js
+22
-9
infovideo.wxml
src/pages/websiteindex/infovideo.wxml
+6
-4
infovideo.wxss
src/pages/websiteindex/infovideo.wxss
+17
-0
No files found.
filter/index.wxs
View file @
bd24cfe6
...
...
@@ -147,6 +147,17 @@ function gifvideoPoster (src, params) {
}
return _src
}
function jpgvideoPoster (src, params) {
if (!src) return '';
var _src = src;
if (src.indexOf('media.shangjiadao.cn') == -1) {
_src = 'https://media.shangjiadao.cn/' + src + '.jpg';
}
if (params) {
_src = _src + '?x-oss-process=' + params;
}
return _src
}
function nameSplice (name, length) {
var _length = length || 4;
var _name = name || '';
...
...
@@ -370,6 +381,17 @@ function timeCount(num){
s = s<10? '0' + s: s;
return m+':'+s
}
function isLoadVideo(index, current, length){
if(index == current) {
return true;
}
// if(current == length-1 && index == 0) {
// return true;
// }
// if(current == 0 && index == length-1) {
// return true;
// }
}
module.exports = {
formatDate: formatDate,
timeCompare: timeCompare,
...
...
@@ -402,5 +424,7 @@ module.exports = {
checkSelectObj: checkSelectObj,
dateTimeCompare: dateTimeCompare,
stareCalculate: stareCalculate,
timeCount: timeCount
timeCount: timeCount,
jpgvideoPoster: jpgvideoPoster,
isLoadVideo: isLoadVideo,
}
\ No newline at end of file
src/pages/themeindex/index.js
View file @
bd24cfe6
...
...
@@ -340,10 +340,7 @@ Page({
this
.
innerAudioContext
.
pause
();
this
.
resetAudiosPlayStatus
()
clearInterval
(
this
.
data
.
voiceInterval
);
// this.didAnimation();
// clearInterval(this.timer);
this
.
setData
({
// advertisementshow: false,
activitybarloaded
:
false
})
},
...
...
@@ -355,8 +352,6 @@ Page({
}
})
clearInterval
(
this
.
data
.
voiceInterval
);
// clearInterval(this.timer);
// this.didAnimation();
this
.
setData
({
advertisementshow
:
false
,
activitybarloaded
:
false
...
...
src/pages/videoplay/index.wxml
View file @
bd24cfe6
<wxs src="../../../filter/index.wxs" module="filter" />
<view class="container">
<video src="{{filter.transformOssVideofy(video)}}" poster="{{filter.videoPoster(video)}}"></video>
<video src="{{filter.transformOssVideofy
M3u8
(video)}}" poster="{{filter.videoPoster(video)}}"></video>
</view>
\ No newline at end of file
src/pages/videoplay/index.wxss
View file @
bd24cfe6
.container video {
position:absolute;
/*
position:absolute;
width:100%;
height:100%;
height:100%;
*/
}
\ No newline at end of file
src/pages/websiteindex/index.js
View file @
bd24cfe6
...
...
@@ -131,28 +131,6 @@ Page({
this
.
clockListGet
();
const
myLocation
=
LocalStorage
.
getItem
(
'myLocation'
);
const
that
=
this
;
// if (myLocation) {
// this.setData({
// latitude: Number(myLocation.split('-')[0]),
// longitude: Number(myLocation.split('-')[1]),
// })
// } else {
// wx.getLocation({
// type: 'wgs84',
// success(res) {
// const {
// latitude,
// longitude
// } = res;
// LocalStorage.setItem('myLocation', latitude + '-' + longitude)
// that.setData({
// latitude: latitude,
// longitude: longitude,
// })
// }
// })
// }
wx
.
login
({
success
(
res
)
{
const
sessionCode
=
res
.
code
;
...
...
src/pages/websiteindex/infovideo.js
View file @
bd24cfe6
...
...
@@ -596,6 +596,12 @@ Page({
const
_currentIndex
=
this
.
data
.
currentIndex
;
const
_innerCurrent
=
this
.
data
.
innerCurrent
this
.
data
.
preVideoId
=
this
.
data
.
currentVideoId
;
if
(
_playList
[
current
].
type
==
2
)
{
wx
.
showLoading
({
title
:
'加载中'
,
})
setTimeout
(()
=>
{
wx
.
hideLoading
()},
3000
);
}
if
(
this
.
data
.
preVideoId
){
this
.
videoContext
=
wx
.
createVideoContext
(
this
.
data
.
preVideoId
);
this
.
videoContext
.
stop
();
...
...
@@ -603,11 +609,6 @@ Page({
this
.
data
.
currentVideoId
=
"video"
+
current
;
this
.
videoContext
=
wx
.
createVideoContext
(
this
.
data
.
currentVideoId
);
this
.
videoContext
.
play
();
// }
if
(
_playList
[
current
].
type
==
2
)
{
// var videoContext = wx.createVideoContext("video" + (current))
// videoContext.play();
}
this
.
setData
({
[
`innerCurrent[
${
current
}
]`
]:
_innerCurrent
[
current
]?
_innerCurrent
[
current
]:
0
,
currentIndex
:
current
,
...
...
@@ -656,6 +657,10 @@ Page({
currentPlayItem
:
data
.
list
[
_currentInit
]
},
()
=>
{
if
(
this
.
data
.
currentPlayItem
.
type
==
2
){
wx
.
showLoading
({
title
:
'加载中'
,
})
setTimeout
(()
=>
{
wx
.
hideLoading
()},
3000
);
this
.
data
.
currentVideoId
=
"video"
+
_currentInit
;
this
.
videoContext
=
wx
.
createVideoContext
(
this
.
data
.
currentVideoId
);
this
.
videoContext
.
play
();
...
...
@@ -743,6 +748,13 @@ Page({
clickVideo
(
e
){
const
id
=
e
.
currentTarget
.
dataset
.
id
;
var
videoContext
=
wx
.
createVideoContext
(
this
.
data
.
currentVideoId
);
this
.
data
.
videoStatus
[
id
]
=
{
isplay
:
this
.
data
.
videoStatus
[
id
].
isplay
||
false
,
isClick
:
true
}
this
.
setData
({
videoStatus
:
this
.
data
.
videoStatus
})
if
(
this
.
data
.
videoStatus
[
id
].
isplay
){
videoContext
.
pause
();
}
else
{
...
...
@@ -752,10 +764,10 @@ Page({
bindplay
(
e
){
const
id
=
e
.
currentTarget
.
dataset
.
id
;
const
_id
=
'video'
+
this
.
data
.
currentIndex
;
console
.
log
(
id
,
_id
)
if
(
id
==
_id
){
this
.
data
.
videoStatus
[
id
]
=
{
isplay
:
true
isplay
:
true
,
isClick
:
this
.
data
.
videoStatus
[
id
]
?
(
this
.
data
.
videoStatus
[
id
].
isClick
||
false
)
:
false
}
this
.
setData
({
videoStatus
:
this
.
data
.
videoStatus
...
...
@@ -764,13 +776,14 @@ Page({
var
videoContext
=
wx
.
createVideoContext
(
id
);
videoContext
.
stop
();
this
.
data
.
videoStatus
[
id
]
=
{
isplay
:
false
isplay
:
false
,
isClick
:
this
.
data
.
videoStatus
[
id
]
?
(
this
.
data
.
videoStatus
[
id
].
isClick
||
false
)
:
false
}
this
.
setData
({
videoStatus
:
this
.
data
.
videoStatus
})
}
setTimeout
(()
=>
{
wx
.
hideLoading
()},
500
);
},
bindpause
(
e
){
...
...
src/pages/websiteindex/infovideo.wxml
View file @
bd24cfe6
...
...
@@ -9,11 +9,13 @@
<swiper indicator-dots="{{false}}" show-fullscreen-btn="{{false}}" show-play-btn="false" style="height:100vh" vertical="{{true}}" circular="{{true}}" bindchange="playSwiperChange" current="{{currentInit}}" data-item="{{playitem}}">
<block wx:for="{{playList}}" wx:for-index="playindex" wx:for-item="playitem" wx:key="{{playindex}}" style="position: relative">
<swiper-item>
<video src="{{filter.transformOssVideofyM3u8(filter.jsonParse(playitem.content))}}" bindplay="bindplay" bindpause="bindpause" loop="{{true}}" bindtap="clickVideo" show-play-btn="{{false}}" show-center-play-btn="{{false}}" controls="{{false}}" data-type="{{playitem.type}}" data-id="video{{playindex}}" id="video{{playindex}}" poster="{{filter.videoPoster(playitem.video)}}" autoplay="{{false}}" wx-if="{{playitem.type==2 && ((playindex == currentIndex) || (playindex+1 == currentIndex) || (playindex-1 == currentIndex))}}"></video>
<view class="video-play-icon-box" bindtap="clickVideo" data-type="{{playitem.type}}" data-id="video{{playindex}}" id="video{{playindex}}" poster="{{filter.videoPoster(playitem.video)}}" wx:if="{{playitem.type==2 &&!videoStatus['video'+playindex].isplay}}">
<image class="video-play-icon" src="{{imageRoot}}2c/websiteindex/bigplay.png?{{imageVersion}}" mode="aspectFit|aspectFill|widthFix" lazy-load="false" binderror="" bindload=""></image>
<view class="video-box-wrapper" wx-if="{{playitem.type==2}}">
<video bindprogress="videoProgress" class="{{videoStatus['video'+currentIndex].isClick || videoStatus['video'+currentIndex].isplay ? 'show-video' : ''}}" src="{{filter.transformOssVideofyM3u8(filter.jsonParse(playitem.content))}}" bindplay="bindplay" bindpause="bindpause" loop="{{true}}" bindtap="clickVideo" show-play-btn="{{false}}" show-center-play-btn="{{false}}" controls="{{false}}" data-type="{{playitem.type}}" data-id="video{{playindex}}" id="video{{playindex}}" poster="{{filter.videoPoster(playitem.video)}}" autoplay="{{false}}" wx-if="{{filter.isLoadVideo(playindex, currentIndex, playList.length)}}"></video>
<view class="video-play-icon-box" bindtap="clickVideo" data-type="{{playitem.type}}" data-id="video{{playindex}}" id="video{{playindex}}" poster="{{filter.videoPoster(playitem.video)}}" wx:if="{{playitem.type==2 &&!videoStatus['video'+playindex].isplay}}">
<image class="video-play-icon" src="{{imageRoot}}2c/websiteindex/bigplay.png?{{imageVersion}}" mode="aspectFit|aspectFill|widthFix" lazy-load="false" binderror="" bindload=""></image>
</view>
<image class="video-poster" src="{{filter.jpgvideoPoster(filter.jsonParse(playitem.content)[0], 'image/resize,w_400/format,jpg/quality,q_60')}}" mode="widthFix" lazy-load="false" binderror="" bindload="" />
</view>
<!-- <video src="{{filter.transformOssVideofy(filter.jsonParse(playitem.content))}}" data-id="video{{playindex}}" id="video{{playindex}}" poster="{{filter.videoPoster(playitem.video)}}" wx-if="{{playitem.type==2}}"></video> -->
<swiper indicator-dots="{{false}}" current="{{innerCurrent[playindex]?innerCurrent[playindex]:0}}" bindchange="innerCurrentChange" style="height:100vh;" wx:if="{{playitem.type==1}}" data-index="{{playindex}}">
<block wx:for="{{filter.jsonParse(playitem.content)}}" wx:key="{{index}}">
<swiper-item>
...
...
src/pages/websiteindex/infovideo.wxss
View file @
bd24cfe6
...
...
@@ -96,6 +96,9 @@
.container video {
width: 100%;
height: 100%;
position: absolute;
left: -1000px;
top: 0;
}
.container .swiper-box {
...
...
@@ -875,4 +878,18 @@
width: 102rpx;
height: 116rpx;
display: block;
}
.video-poster{
width: 100%;
}
.video-box-wrapper{
width: 100%;
height: 100%;
display: flex;
align-items: center;
justify-content: center;
background: rgba(0, 0, 0, 1);
}
.container .show-video {
left: 0;
}
\ No newline at end of file
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