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