Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
M
mini-program-wepy
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Boards
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
ui
mini-program-wepy
Commits
3c3f216e
Commit
3c3f216e
authored
Jun 17, 2020
by
付清曌
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch 'feature/video' into 'master'
Feature/video See merge request
!57
parents
b86b4ff9
dc243dbf
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
34 additions
and
12 deletions
+34
-12
common.wxs
src/common/common.wxs
+11
-2
wxRequest.js
src/common/wxRequest.js
+1
-1
prizeList.wpy
src/components/custom/prizeList.wpy
+17
-4
sign.wpy
src/components/custom/sign.wpy
+5
-5
No files found.
src/common/common.wxs
View file @
3c3f216e
...
...
@@ -16,8 +16,17 @@ function getClass (status) {
console.log(status)
return cls[index]
};
function showVideo(item,current,index) {
if(item.showType && item.showType.value ==2) {
if(current === index) {
return true
} else {
return false;
}
}
}
module.exports = {
computClass:computClass,
getClass:getClass
getClass:getClass,
showVideo:showVideo
}
src/common/wxRequest.js
View file @
3c3f216e
import
wepy
from
'
@wepy/core
'
;
import
Notify
from
'
../components/vant/notify/notify
'
;
const
env
=
'
test
'
;
// 每次上线手动切换成 prod/test
const
env
=
'
prod
'
;
// 每次上线手动切换成 prod/test
let
baseUrl
=
'
https://api-luckii.q-gp.com
'
;
if
(
env
===
'
test
'
)
{
baseUrl
=
'
https://luckii-qa.liangkebang.net
'
;
...
...
src/components/custom/prizeList.wpy
View file @
3c3f216e
...
...
@@ -8,6 +8,7 @@
height:100%;
width:100%;
position: absolute;
background-color: #000;
z-index: 1;
}
...
...
@@ -65,6 +66,7 @@
width: 100%;
}
</style>
<wxs module="video" src="../../common/common.wxs"></wxs>
<template>
<view class="container">
<swiper
...
...
@@ -74,6 +76,7 @@
vertical
current="0"
bindanimationfinish="bindanimationfinish"
bindchange="moveSwiper"
>
<swiper-item :class="{'image-item': item.showType && item.showType.value === 1}" v-for="(item, idx) in curQueue" :key="item.id">
<view class="video-wrapper">
...
...
@@ -84,19 +87,20 @@
show-center-play-btn="{{false}}"
enable-progress-gesture="{{false}}"
controls="{{false}}"
src="{{
item.videoUr
l}}"
src="{{
video.showVideo(item,currentIndex,idx)?item.videoUrl:nul
l}}"
data-id="{{item.id}}"
object-fit="{{item.objectFit || 'contain'}}"
data-index="{{idx}}"
binderror="onError"
bindtimeupdate="onTimeUpdate"
@tap="videoTap"
v-if="item.showType && item.showType.value === 2"
custom-cache="{{false}}"
object-fit="contain"
wx:if="{{item.showType && item.showType.value ==2}}"
>
<video-loading v-if="item.time === 0" :snapshot="item.videoSnapUrl"/>
<video-pause :pause="pause"></video-pause>
</video>
<image
v-if="item.showType && item.showType.value === 1
" lazy-load class="images" :src="item.photoUrl" mode="widthFix" bindload="imageLoad(item.id)">
<image
wx:if="{{item.showType && item.showType.value ==1}}
" lazy-load class="images" :src="item.photoUrl" mode="widthFix" bindload="imageLoad(item.id)">
<image-loading v-if="item.time === 0"/>
</image>
<view class="rightcont" v-show="item.id > 0">
...
...
@@ -131,6 +135,7 @@
data: {
pause: false,
curQueue: [],
currentIndex:0,
},
watch: {
videoList () {
...
...
@@ -154,6 +159,12 @@
this.curQueue = [...this.curQueue];
this.updateAwardsInfo(videoCurrent);
},
moveSwiper(e) {
if (e.$wx.detail.source === 'touch') {
let current = e.$wx.detail.current;
this.currentIndex = current;
}
},
async getProgress(id) {
if (id <= 0) return;
let detail = await getAwardsDetail({ prizeId: id });
...
...
@@ -222,6 +233,8 @@
if (index !== current) {
ctx && ctx.pause();
} else {
//将视频重置到最开始的位置并播放
// ctx && ctx.seek(0);
ctx && ctx.play();
}
});
...
...
src/components/custom/sign.wpy
View file @
3c3f216e
...
...
@@ -57,7 +57,6 @@
share: '/static/images/share@2x.png',
lottery: '/static/images/lottery@2x.png'
};
let isFirst = true;
let addGoldTimer = null;
wepy.component({
store,
...
...
@@ -74,6 +73,7 @@
lotteryUrl: '/static/images/lottery@2x.png',
containerStyle: '',
flyAnimation: false,
isFirst:true,
},
props: {
title: '',
...
...
@@ -144,8 +144,8 @@
if (v) {
this.addCount = 0;
}
if (isFirst) {
isFirst = false;
if (
this.
isFirst) {
this.
isFirst = false;
return;
}
setTimeout(() => {
...
...
@@ -153,11 +153,11 @@
}, 1500);
},
sign(v) {
if (isFirst) {
if (
this.
isFirst) {
this.signComplete = false;
this.flyAnimation = false;
this.addsunshine = false;
isFirst = false;
this.
isFirst = false;
return;
}
if (v) {
...
...
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