feat:v1.4前端更新
This commit is contained in:
@@ -1,34 +1,52 @@
|
||||
<template>
|
||||
<view class='product-bg'>
|
||||
<swiper :indicator-dots="indicatorDots" indicator-active-color="#e93323" :autoplay="autoplay"
|
||||
:circular="circular" :interval="interval" :duration="duration" @change="change">
|
||||
|
||||
<swiper :indicator-dots="indicatorDots" :indicator-active-color="indicatorBg" :autoplay="autoplay" :circular="circular"
|
||||
:interval="interval" :duration="duration" @change="change" v-if="isPlay">
|
||||
<!-- #ifndef APP-PLUS -->
|
||||
<swiper-item v-if="videoline">
|
||||
<view class="item">
|
||||
<view v-show="!controls" style="width:100%;height:100% ">
|
||||
<video id="myVideo" :src='videoline' objectFit="cover" controls style="width:100%;height:100% "
|
||||
show-center-play-btn show-mute-btn="true" auto-pause-if-navigate :custom-cache="false"
|
||||
:enable-progress-gesture="false" :poster="imgUrls[0]" @pause="videoPause"></video>
|
||||
show-center-play-btn show-mute-btn="true" auto-pause-if-navigate :custom-cache="false" :enable-progress-gesture="false" :poster="imgUrls[0]" @pause="videoPause"></video>
|
||||
</view>
|
||||
<view class="poster" v-show="controls">
|
||||
<image class="image" :src="imgUrls[0]"></image>
|
||||
</view>
|
||||
<view class="stop" v-show="controls" @tap="bindPause">
|
||||
<image class="image" src="../../static/images/stop.png"></image>
|
||||
<image class="image" :src="urlDomain+'crmebimage/perset/staticImg/stop.png'"></image>
|
||||
</view>
|
||||
</view>
|
||||
</swiper-item>
|
||||
|
||||
<!-- #endif -->
|
||||
<!-- #ifdef APP-PLUS -->
|
||||
<swiper-item v-if="videoline">
|
||||
<view class="item">
|
||||
<view class="poster" v-show="controls">
|
||||
<image class="image" :src="imgUrls[0]"></image>
|
||||
</view>
|
||||
<view class="stop" v-show="controls" @tap="bindPause">
|
||||
<image class="image" :src="urlDomain+'crmebimage/perset/staticImg/stop.png'"></image>
|
||||
</view>
|
||||
</view>
|
||||
</swiper-item>
|
||||
<!-- #endif -->
|
||||
<block v-for="(item,index) in imgUrls" :key='index'>
|
||||
<swiper-item>
|
||||
<swiper-item v-if="videoline?index>=1:index>=0">
|
||||
<image :src="item" class="slide-image" />
|
||||
</swiper-item>
|
||||
</block>
|
||||
</swiper>
|
||||
<!-- #ifdef APP-PLUS -->
|
||||
<view v-if="!isPlay" style="width: 100%; height: 750rpx;">
|
||||
<video id="myVideo" :src='videoline' objectFit="cover" controls style="width:100%;height:100% "
|
||||
show-center-play-btn show-mute-btn="true" autoplay="true" auto-pause-if-navigate :custom-cache="false" :enable-progress-gesture="false" :poster="imgUrls[0]" @pause="videoPause"></video>
|
||||
</view>
|
||||
<!-- #endif -->
|
||||
</view>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import {setThemeColor} from '@/utils/setTheme.js'
|
||||
export default {
|
||||
props: {
|
||||
imgUrls: {
|
||||
@@ -44,6 +62,7 @@
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
urlDomain: this.$Cache.get("imgHost"),
|
||||
indicatorDots: true,
|
||||
circular: true,
|
||||
autoplay: true,
|
||||
@@ -52,21 +71,41 @@
|
||||
currents: "1",
|
||||
controls: true,
|
||||
isPlay:true,
|
||||
videoContext:''
|
||||
videoContext:'',
|
||||
indicatorBg:'#e93323',
|
||||
};
|
||||
},
|
||||
created(){
|
||||
let that = this;
|
||||
that.indicatorBg = setThemeColor();
|
||||
},
|
||||
mounted() {
|
||||
if(this.videoline){
|
||||
this.imgUrls.shift()
|
||||
}
|
||||
// #ifndef APP-PLUS
|
||||
this.videoContext = uni.createVideoContext('myVideo', this);
|
||||
// #endif
|
||||
},
|
||||
methods: {
|
||||
videoPause(e){
|
||||
// #ifdef APP-PLUS
|
||||
this.isPlay= true
|
||||
this.autoplay = true
|
||||
// #endif
|
||||
},
|
||||
bindPause: function() {
|
||||
|
||||
// #ifndef APP-PLUS
|
||||
this.videoContext.play();
|
||||
this.$set(this, 'controls', false)
|
||||
this.autoplay = false
|
||||
// #endif
|
||||
// #ifdef APP-PLUS
|
||||
this.isPlay= false
|
||||
this.videoContext = uni.createVideoContext('myVideo', this);
|
||||
this.videoContext.play();
|
||||
// #endif
|
||||
},
|
||||
change: function(e) {
|
||||
this.$set(this, 'currents', e.detail.current + 1);
|
||||
@@ -146,4 +185,4 @@
|
||||
width: 100%;
|
||||
height: 100%;
|
||||
}
|
||||
</style>
|
||||
</style>
|
||||
Reference in New Issue
Block a user