This commit is contained in:
lnn19986213 2023-09-06 08:57:10 +08:00
parent 29253c593f
commit 1e34b8a9bc
5 changed files with 139 additions and 70 deletions

View File

@ -96,7 +96,7 @@
// vueproxyTable,
"/pre" : {
//
"target" : "http://192.168.1.31:8080/h5/api", //
"target" : "http://192.168.1.20:8080/h5/api", //
// "target" : "https://yxx.ydool.net/h5/api", //
"changeOrigin" : true, //

View File

@ -18,11 +18,9 @@
}
}
],
"subPackages": [
{
"subPackages": [{
"root": "pagesA/",
"pages": [
{
"pages": [{
"path": "msg/msg",
"style": {
"enablePullDownRefresh": true,
@ -197,8 +195,7 @@
},
{
"root": "pagesB/",
"pages": [
{
"pages": [{
"path": "ArtRace/ArtRace",
"style": {
"navigationBarTitleText": "文艺比赛",
@ -674,20 +671,25 @@
"navigationBarTitleText": "线上看展",
"enablePullDownRefresh": false,
"usingComponents": {
// #ifdef MP-WEIXIN
"player-component": "plugin://player/video"
// #endif
}
}
},
{
"path": "xskz/details",
"style": {
"navigationBarTitleText": "线上看展-详情",
"enablePullDownRefresh": false,
"usingComponents": {
// #ifdef MP-WEIXIN
"player-component": "plugin://player/video"
// #endif
}
}
}
// {
// "path": "xskz/details",
// "style": {
// "navigationBarTitleText": "线上看展-详情",
// "enablePullDownRefresh": false,
// "usingComponents": {
// "player-component": "plugin://player/video"
// }
// }
// }
]
}
],

View File

@ -1,31 +1,115 @@
<template>
<view>
<!-- <player-component
playerid="tvp"
id="tvp-id"
vid="p0743x9grjv"
></player-component> -->
<!-- <view class="teamBox-top" > -->
<video v-if="type == 'locality'" id="myVideo" :custom-cache="false" @error="videoErrorCallback" show-loading
:src="file" style="width: 750rpx;height: 500rpx;" controls>
</video>
<!-- </view> -->
<view class="teamBox-top" v-else-if="type == 'tencent' && isWx">
<!-- #ifdef MP-WEIXIN -->
<player-component id="tvp-id" playerid="tvp" :autoplay="false" :enablePlayGesture="true" :vid="linkPath"
:bindplay="onBindplay" :bindstatechange="onStateChange">
</player-component>
<!-- #endif -->
</view>
<view v-else class="teamBox-top" @click="toDetail()">
<image :src="cover" mode="" style="width: 750rpx;height: 500rpx;"></image>
</view>
</view>
</template>
<script>
export default {
export default {
data() {
return {
store: null,
player: null,
id: '',
type: '',
file: '',
linkPath: '',
isWx: false,
cover: ''
};
},
onShow() {
// this.store = requirePlugin("player");
// this.player = this.selectComponent('#tvp-id');
// this.player = this.store.get("tvp");
// console.log(this.store);
// console.log(this.player);
onReady() {
// #ifdef MP-WEIXIN
this.isWx = true
// #endif
},
mounted() {},
methods: {},
};
onLoad(op) {
this.id = op.id
this.getData()
},
methods: {
onBindplay() {
// this.player.play()
console.log('执行');
},
onStateChange() {
},
videoErrorCallback: function(e) {
console.log(e.target.errMsg)
uni.showModal({
content: e.target.errMsg,
showCancel: false
})
},
getData() {
this.http
.request("/exhibition/details", {
id: this.id
}, "GET")
.then((res) => {
if (res.code == 200) {
this.type = res.data.type
if (this.type == 'locality') {
this.file = res.data.file
console.log(111)
// this.getvideo(res.data.id)
} else if (this.type == 'tencent' && this.isWx) {
let path = res.data.linkPath.split('/')
let video = path[path.length - 1].split('.html')
this.linkPath = video[0]
// this.store = requirePlugin('player')
// this.player = this.store.get('tvp');
} else {
this.cover = res.data.cover
this.linkPath = res.data.linkPath
window.open(res.data.linkPath)
}
}
})
.catch((e) => {
uni.showToast({
title: e.data.message,
icon: "none",
});
});
},
getvideo(val) {
console.log(222)
this.http
.request("/exhibition/getVideo/" + val, "GET")
.then((res) => {
if (res.code == 200) {
this.file = res.data
}
})
.catch((e) => {
uni.showToast({
title: e.data.message,
icon: "none",
});
});
},
toDetail() {
window.open(this.linkPath)
}
},
};
</script>
<style>

View File

@ -2,19 +2,8 @@
<view class="wyxx">
<view class="forms">
<view class="teamBox" v-for="item in list" :key="item.id">
<view class="teamBox-top" v-if="item.type == 'locality'">
<video :src="item.file" @error="videoErrorCallback" style="width: 750rpx;height: 500rpx;"
controls></video>
<!-- <player-component vid="p0743x9grjv"></player-component> -->
</view>
<view class="teamBox-top" v-else-if="item.type == 'tencent'">
<!-- #ifdef MP-WEIXIN -->
<player-component :autoplay="false" :enablePlayGesture="true" :vid="item.linkPath"
:bindplay="onBindplay">
</player-component>
<!-- #endif -->
<view class="teamBox-top" @click="toDetail(item.id)">
<image :src="item.cover" mode="" style="width: 100%; height: 100%;"></image>
</view>
<view class="teamBox-bottom">
<view class="interactive">
@ -56,7 +45,7 @@ export default {
list: [],
query: {
page: 1,
size: 20,
size: 999,
},
};
},
@ -69,9 +58,6 @@ export default {
console.log(store);
},
methods: {
onBindplay() {
console.log('执行');
},
toTab(val) {
this.tabC = val;
// this.getData()
@ -150,26 +136,21 @@ export default {
this.query.size = res.data.size;
}
})
.catch((err) => {
.catch((e) => {
uni.showToast({
title: e.data.message,
icon: "none",
});
});
},
skip(query = {}) {
toDetail(val){
uni.navigateTo({
//
url: "/pagesD/xskz/details",
url: "/pagesD/xskz/details?id=" + val,
});
},
videoErrorCallback: function (e) {
console.log(e.target.errMsg)
uni.showModal({
content: e.target.errMsg,
showCancel: false
})
},
playMask(obj) {
// this.videoList[index].play = false;
// var video = document.getElementById("video");
@ -237,6 +218,8 @@ export default {
.teamBox {
.teamBox-top {
position: relative;
width: 100%;
height: 400rpx;
.content {
position: relative;

View File

@ -5,9 +5,9 @@
export default {
config: {
// baseUrl: "http://192.168.1.20:8080/h5/api", //俞燕红-小程序不能配跨域
baseUrl: "http://192.168.1.20:8080/h5/api", //俞燕红-小程序不能配跨域
// baseUrl: "/pre", //俞燕红-跨域
baseUrl: "https://yxx.ydool.net/h5/api", //线上
// baseUrl: "https://yxx.ydool.net/h5/api", //线上
// baseUrl: "/h5/api", //h5
header: {
'Content-Type': 'application/json;charset=UTF-8',