Fix:2881 【千县名品】千县,县城资讯需要增加上传视频功能
This commit is contained in:
@@ -33,6 +33,7 @@
|
||||
object-fit="contain"
|
||||
play-btn-position="center"
|
||||
class="video"
|
||||
id="coverVideo"
|
||||
/>
|
||||
</view>
|
||||
</view>
|
||||
@@ -171,12 +172,24 @@
|
||||
</view>
|
||||
<view class="info-item-body">
|
||||
<img-box
|
||||
v-if="item.type === 1"
|
||||
:imgList="item.images"
|
||||
:num="item.images.length"
|
||||
:img-radius="10"
|
||||
style="width: 100%;"
|
||||
@click="infoItemViewClick(item)"
|
||||
/>
|
||||
<video
|
||||
v-else
|
||||
@play="infoItemViewClick(item, index)"
|
||||
play-btn-position="center"
|
||||
:show-fullscreen-btn="false"
|
||||
class="video-item v12-mt-0"
|
||||
:src="item.video"
|
||||
objectFit
|
||||
controls
|
||||
:id="'video-item' + index"
|
||||
:poster="item.video + '?vframe/jpg/offset/1'"></video>
|
||||
</view>
|
||||
<view class="info-item-bottom">
|
||||
<view class="time">
|
||||
@@ -704,6 +717,7 @@ export default {
|
||||
// 产品
|
||||
leftList: [],
|
||||
rightList: [],
|
||||
videoPlayers:[]
|
||||
}
|
||||
},
|
||||
// 必须在页面加 onPageScroll(e){} ,才能滑动显示背景
|
||||
@@ -1050,7 +1064,27 @@ export default {
|
||||
infoClick(info) {
|
||||
// this.$yrouter.push('/pagesInn/inn/innInfoDetail?id=' + info.id)
|
||||
},
|
||||
infoItemViewClick(item) {
|
||||
infoItemViewClick(item, index) {
|
||||
if(item.type === 2) {
|
||||
const coverCtx = uni.createVideoContext('coverVideo', this)
|
||||
coverCtx.pause()
|
||||
const playerId = 'video-item' + index
|
||||
if(this.videoPlayers.includes(playerId)) {
|
||||
this.videoPlayers.forEach(player => {
|
||||
if(player === playerId) return
|
||||
const playerCtx = uni.createVideoContext(player, this)
|
||||
playerCtx.pause()
|
||||
})
|
||||
} {
|
||||
this.videoPlayers.push(playerId)
|
||||
this.videoPlayers.forEach(player => {
|
||||
if(player === playerId) return
|
||||
const playerCtx = uni.createVideoContext(player, this)
|
||||
playerCtx.pause()
|
||||
})
|
||||
}
|
||||
this.$emit('video')
|
||||
}
|
||||
uni.$u.debounce(() => {
|
||||
postCountyFamousNewsView({ countyFamousNewsId: item.id }).finally(() => {
|
||||
this.infoArray.map(info => {
|
||||
@@ -1156,6 +1190,11 @@ export default {
|
||||
<style scoped lang="less">
|
||||
|
||||
@import "@/assets/css/store.less";
|
||||
.video-item {
|
||||
width: 100%;
|
||||
height: 400rpx;
|
||||
border-radius: 10rpx;
|
||||
}
|
||||
.focus-img {
|
||||
position: relative;
|
||||
.img {
|
||||
|
||||
Reference in New Issue
Block a user