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, // vueproxyTable,
"/pre" : { "/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", // // "target" : "https://yxx.ydool.net/h5/api", //
"changeOrigin" : true, // "changeOrigin" : true, //

View File

@ -18,11 +18,9 @@
} }
} }
], ],
"subPackages": [ "subPackages": [{
{
"root": "pagesA/", "root": "pagesA/",
"pages": [ "pages": [{
{
"path": "msg/msg", "path": "msg/msg",
"style": { "style": {
"enablePullDownRefresh": true, "enablePullDownRefresh": true,
@ -197,8 +195,7 @@
}, },
{ {
"root": "pagesB/", "root": "pagesB/",
"pages": [ "pages": [{
{
"path": "ArtRace/ArtRace", "path": "ArtRace/ArtRace",
"style": { "style": {
"navigationBarTitleText": "文艺比赛", "navigationBarTitleText": "文艺比赛",
@ -674,20 +671,25 @@
"navigationBarTitleText": "线上看展", "navigationBarTitleText": "线上看展",
"enablePullDownRefresh": false, "enablePullDownRefresh": false,
"usingComponents": { "usingComponents": {
// #ifdef MP-WEIXIN
"player-component": "plugin://player/video" "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,10 +1,21 @@
<template> <template>
<view> <view>
<!-- <player-component <!-- <view class="teamBox-top" > -->
playerid="tvp" <video v-if="type == 'locality'" id="myVideo" :custom-cache="false" @error="videoErrorCallback" show-loading
id="tvp-id" :src="file" style="width: 750rpx;height: 500rpx;" controls>
vid="p0743x9grjv" </video>
></player-component> --> <!-- </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> </view>
</template> </template>
@ -14,17 +25,90 @@ export default {
return { return {
store: null, store: null,
player: null, player: null,
id: '',
type: '',
file: '',
linkPath: '',
isWx: false,
cover: ''
}; };
}, },
onShow() { onReady() {
// this.store = requirePlugin("player"); // #ifdef MP-WEIXIN
// this.player = this.selectComponent('#tvp-id'); this.isWx = true
// this.player = this.store.get("tvp"); // #endif
// console.log(this.store); },
// console.log(this.player); 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)
}
}, },
mounted() {},
methods: {},
}; };
</script> </script>

View File

@ -2,19 +2,8 @@
<view class="wyxx"> <view class="wyxx">
<view class="forms"> <view class="forms">
<view class="teamBox" v-for="item in list" :key="item.id"> <view class="teamBox" v-for="item in list" :key="item.id">
<view class="teamBox-top" v-if="item.type == 'locality'"> <view class="teamBox-top" @click="toDetail(item.id)">
<video :src="item.file" @error="videoErrorCallback" style="width: 750rpx;height: 500rpx;" <image :src="item.cover" mode="" style="width: 100%; height: 100%;"></image>
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> </view>
<view class="teamBox-bottom"> <view class="teamBox-bottom">
<view class="interactive"> <view class="interactive">
@ -56,7 +45,7 @@ export default {
list: [], list: [],
query: { query: {
page: 1, page: 1,
size: 20, size: 999,
}, },
}; };
}, },
@ -69,9 +58,6 @@ export default {
console.log(store); console.log(store);
}, },
methods: { methods: {
onBindplay() {
console.log('执行');
},
toTab(val) { toTab(val) {
this.tabC = val; this.tabC = val;
// this.getData() // this.getData()
@ -150,26 +136,21 @@ export default {
this.query.size = res.data.size; this.query.size = res.data.size;
} }
}) })
.catch((err) => { .catch((e) => {
uni.showToast({ uni.showToast({
title: e.data.message, title: e.data.message,
icon: "none", icon: "none",
}); });
}); });
}, },
skip(query = {}) {
toDetail(val){
uni.navigateTo({ 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) { playMask(obj) {
// this.videoList[index].play = false; // this.videoList[index].play = false;
// var video = document.getElementById("video"); // var video = document.getElementById("video");
@ -237,6 +218,8 @@ export default {
.teamBox { .teamBox {
.teamBox-top { .teamBox-top {
position: relative; position: relative;
width: 100%;
height: 400rpx;
.content { .content {
position: relative; position: relative;

View File

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