This commit is contained in:
Mr.jiang 2024-08-01 13:50:54 +08:00
parent a764d8d74a
commit a4e032b526
3 changed files with 14 additions and 18 deletions

View File

@ -219,7 +219,7 @@
<view class="swiper-topic-list" v-for="(item,index) in swiperDateLists" :key="index"> <view class="swiper-topic-list" v-for="(item,index) in swiperDateLists" :key="index">
<view class="swiper-item-card" style="position: relative;"> <view class="swiper-item-card" style="position: relative;">
<view class="data-list"> <view class="data-list">
<view class="videoHovers" @click="towxh5Video(item)"> <view class="videoHovers" @click="towxh5Video(item,index)">
<image class="playState" src="@/static/bofang.png"></image> <image class="playState" src="@/static/bofang.png"></image>
</view> </view>
<image :src="item.picPath" mode="aspectFill" style="width: 100%; height: 100%;"></image> <image :src="item.picPath" mode="aspectFill" style="width: 100%; height: 100%;"></image>
@ -309,6 +309,8 @@
// #ifdef APP-PLUS // #ifdef APP-PLUS
// import permision from "@/components/permission.js"; // import permision from "@/components/permission.js";
// #endif // #endif
let audo = uni.createInnerAudioContext()
audo.loop = true
export default { export default {
data() { data() {
return { return {
@ -584,11 +586,16 @@
videoContext.src = this.filePath; // videoContext.src = this.filePath; //
videoContext.play(); // videoContext.play(); //
}, },
towxh5Video(item){ towxh5Video(item,index){
this.playShow=true; this.playShow=true;
this.filePath=item.filePath; this.filePath=item.filePath;
this.contentVideo=item.content; this.contentVideo=item.content;
this.videoId=item.id this.videoId=item.id;
const videoContext = uni.createVideoContext('myVideo', this);
videoContext.src = this.filePath; //
setTimeout(()=>{
videoContext.play(); //
},100)
this.$refs.pinglun.open("center") this.$refs.pinglun.open("center")
}, },
swichMenu(index,id) {// swichMenu(index,id) {//
@ -600,13 +607,6 @@
}).exec(); }).exec();
this.parType=index+1; this.parType=index+1;
this.getVideo() this.getVideo()
// this.currentTab = index
// console.log(11,index)
// this.scrollLeft = 0;
// for (let i = 0; i < index; i++) {
// this.scrollLeft += 60
// };
}, },
swiperChange(e) {// swiperChange(e) {//
let index = e.detail.current let index = e.detail.current

View File

@ -144,9 +144,9 @@
}, },
onLoad(d) { onLoad(d) {
this.userId = this.$queue.getData('userId'); this.userId = this.$queue.getData('userId');
let scoket = uni.getStorageSync('wbescokt') // let scoket = uni.getStorageSync('wbescokt')
this.byUserId = scoket.byUserId this.byUserId = d.byUserId
this.chatConversationId = scoket.chatConversationId; this.chatConversationId = d.chatConversationId;
this.connect(); this.connect();
}, },
computed: { computed: {

View File

@ -265,7 +265,6 @@
this.boxStyle.width = this.windowWidth + 'px'//px this.boxStyle.width = this.windowWidth + 'px'//px
this.boxStyle.height = this.windowHeight - this.deleteHeight;// tabbar this.boxStyle.height = this.windowHeight - this.deleteHeight;// tabbar
this.get() // this.get() //
}, },
onShow(){ onShow(){
console.log('回到前台'); console.log('回到前台');
@ -273,18 +272,15 @@
this.dataList[this.k].state = 'pause'; this.dataList[this.k].state = 'pause';
uni.createVideoContext(this.dataList[this.k].id+''+this.k,this).pause() uni.createVideoContext(this.dataList[this.k].id+''+this.k,this).pause()
audo.pause() audo.pause()
// this.dataList[this.k].state = 'play';
// uni.createVideoContext(this.dataList[this.k].id+''+this.k,this).play()
// audo.play()
} }
}, },
onHide(){ onHide(){
console.log('到后台');
if(this.isClick){ if(this.isClick){
this.dataList[this.k].state = 'pause'; this.dataList[this.k].state = 'pause';
uni.createVideoContext(this.dataList[this.k].id+''+this.k,this).pause() uni.createVideoContext(this.dataList[this.k].id+''+this.k,this).pause()
audo.pause() audo.pause()
} }
console.log('到后台');
}, },
methods: { methods: {