This commit is contained in:
lnn19986213 2023-09-09 17:20:04 +08:00
parent 1e34b8a9bc
commit db413baf43
4 changed files with 238 additions and 223 deletions

View File

@ -669,7 +669,8 @@
"path": "xskz/index",
"style": {
"navigationBarTitleText": "线上看展",
"enablePullDownRefresh": false,
"enablePullDownRefresh": true,
"onReachBottomDistance": 20,
"usingComponents": {
// #ifdef MP-WEIXIN
"player-component": "plugin://player/video"

View File

@ -1,7 +1,8 @@
<template>
<view>
<!-- <view class="teamBox-top" > -->
<video v-if="type == 'locality'" id="myVideo" :custom-cache="false" @error="videoErrorCallback" show-loading
<video v-if="type == 'locality'" id="myVideo" show-loading
muted autoplay preload loop
:src="file" style="width: 750rpx;height: 500rpx;" controls>
</video>
<!-- </view> -->
@ -65,9 +66,9 @@
.then((res) => {
if (res.code == 200) {
this.type = res.data.type
this.cover = res.data.cover
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('/')

View File

@ -38,253 +38,266 @@
</template>
<script>
export default {
data() {
return {
// tabC: "0",
list: [],
query: {
page: 1,
size: 999,
export default {
data() {
return {
// tabC: "0",
list: [],
pages: 1,
size: 10,
};
},
onShow() {
// this.getData();
this.get();
},
onPullDownRefresh() {
this.pages = 1
this.list = []
this.get()
setTimeout(function() {
uni.stopPullDownRefresh();
}, 1000);
},
//
onReachBottom() {
this.pages++
this.get();
},
mounted() {
const store = requirePlugin('player')
console.log(store);
},
methods: {
toTab(val) {
this.tabC = val;
// this.getData()
},
};
},
onShow() {
// this.getData();
this.get();
},
mounted() {
const store = requirePlugin('player')
console.log(store);
},
methods: {
toTab(val) {
this.tabC = val;
// this.getData()
},
//
clickHeart(val0, val1) {
console.log(val1)
if (val0) {
this.http.request('/worksGreat/delGreat?type=3&workId=' + val1, "POST").then(res => {
if (res.code == 200) {
this.get()
}
}).catch(e => {
uni.showToast({
title: e.data.message,
icon: "none",
});
})
} else {
this.http.request('/worksGreat/addGreat?type=3&workId=' + val1, "POST").then(res => {
if (res.code == 200) {
this.get()
}
}).catch(e => {
uni.showToast({
title: e.data.message,
icon: "none",
});
})
}
},
//
clickStar(val0, val1) {
if (val0) {
this.http.request('/worksCollection/delCollection?workId=' + val1 + '&type=3', "POST").then(res => {
if (res.code == 200) {
this.get()
}
}).catch(e => {
uni.showToast({
title: e.data.message,
icon: "none",
});
})
} else {
this.http.request('/worksCollection/addCollection?workId=' + val1 + '&type=3', "POST").then(res => {
if (res.code == 200) {
this.get()
}
}).catch(e => {
uni.showToast({
title: e.data.message,
icon: "none",
});
})
}
},
get() {
this.http
.request("/exhibition/list", this.query, "GET")
.then((res) => {
if (res.code == 200) {
let list = []
list = res.data.records;
/* #ifdef MP-WEIXIN*/
list.forEach(item => {
if (item.linkPath) {
let path = item.linkPath.split('/')
let video = path[path.length - 1].split('.html')
item.linkPath = video[0]
}
//
clickHeart(val0, val1) {
console.log(val1)
if (val0) {
this.http.request('/worksGreat/delGreat?type=3&workId=' + val1, "POST").then(res => {
if (res.code == 200) {
this.get()
}
}).catch(e => {
uni.showToast({
title: e.data.message,
icon: "none",
});
})
} else {
this.http.request('/worksGreat/addGreat?type=3&workId=' + val1, "POST").then(res => {
if (res.code == 200) {
this.get()
}
}).catch(e => {
uni.showToast({
title: e.data.message,
icon: "none",
});
})
}
},
//
clickStar(val0, val1) {
if (val0) {
this.http.request('/worksCollection/delCollection?workId=' + val1 + '&type=3', "POST").then(res => {
if (res.code == 200) {
this.get()
}
}).catch(e => {
uni.showToast({
title: e.data.message,
icon: "none",
});
})
} else {
this.http.request('/worksCollection/addCollection?workId=' + val1 + '&type=3', "POST").then(res => {
if (res.code == 200) {
this.get()
}
}).catch(e => {
uni.showToast({
title: e.data.message,
icon: "none",
});
})
}
},
get() {
let _this = this
this.http
.request("/exhibition/list", {
page: this.pages,
size: this.size,
}, "GET")
.then((res) => {
if (res.code == 200) {
if (res.data.records.length > 0) {
res.data.records.forEach(item => {
if (item.linkPath) {
let path = item.linkPath.split('/')
let video = path[path.length - 1].split('.html')
item.linkPath = video[0]
}
_this.list.push(item)
});
} else {
this.pages--
}
}
})
.catch((e) => {
uni.showToast({
title: e.data.message,
icon: "none",
});
/* #endif */
this.list = list;
this.query.page = res.data.current;
this.query.size = res.data.size;
}
})
.catch((e) => {
uni.showToast({
title: e.data.message,
icon: "none",
});
},
toDetail(val) {
uni.navigateTo({
//
url: "/pagesD/xskz/details?id=" + val,
});
},
playMask(obj) {
// this.videoList[index].play = false;
// var video = document.getElementById("video");
// //
// video.addEventListener("pause", function (e) {
// console.log("");
// console.log(e);
// });
// // 15ended
// video.addEventListener("ended", function (e) {
// console.log("");
// console.log(e);
// });
},
},
toDetail(val){
uni.navigateTo({
//
url: "/pagesD/xskz/details?id=" + val,
});
},
playMask(obj) {
// this.videoList[index].play = false;
// var video = document.getElementById("video");
// //
// video.addEventListener("pause", function (e) {
// console.log("");
// console.log(e);
// });
// // 15ended
// video.addEventListener("ended", function (e) {
// console.log("");
// console.log(e);
// });
},
},
};
};
</script>
<style lang="scss">
.wyxx {
background-color: #fefefe;
}
.wyxx {
background-color: #fefefe;
}
.tabTitle {
display: flex;
width: 100%;
background: #ffffff;
.tabTitle {
display: flex;
width: 100%;
background: #ffffff;
.tabs {
width: 33.3%;
text-align: center;
padding: 32rpx 0 0rpx;
font-size: 28rpx;
font-weight: 400;
color: #333333;
.tabs {
width: 33.3%;
text-align: center;
padding: 32rpx 0 0rpx;
font-size: 28rpx;
font-weight: 400;
color: #333333;
.line {
width: 36rpx;
height: 4rpx;
margin: 10rpx auto 8rpx;
.line {
width: 36rpx;
height: 4rpx;
margin: 10rpx auto 8rpx;
}
}
.tabsC {
width: 33.3%;
text-align: center;
padding: 32rpx 0 0;
font-size: 28rpx;
font-weight: 600;
color: #000;
.line {
width: 44rpx;
height: 4rpx;
margin: 10rpx auto 8rpx;
background-color: #a02521;
}
}
}
.tabsC {
width: 33.3%;
text-align: center;
padding: 32rpx 0 0;
font-size: 28rpx;
font-weight: 600;
color: #000;
.forms {
margin: 0 auto 40rpx;
padding-top: 40rpx;
.line {
width: 44rpx;
height: 4rpx;
margin: 10rpx auto 8rpx;
background-color: #a02521;
}
}
}
.forms {
margin: 0 auto 0rpx;
padding-top: 40rpx;
.teamBox {
.teamBox-top {
position: relative;
width: 100%;
height: 400rpx;
.content {
.teamBox {
.teamBox-top {
position: relative;
z-index: 4;
width: 100%;
height: 400rpx;
.content-title {
.content {
position: relative;
z-index: 4;
.content-title {
position: absolute;
z-index: 10;
padding: 18rpx;
text {
color: #fff;
max-width: 500rpx;
overflow: hidden;
/* 超出一行文字自动隐藏 */
text-overflow: ellipsis;
/*文字隐藏后添加省略号*/
white-space: nowrap;
}
}
.team-image {
width: 100%;
height: 400rpx;
}
}
.mask {
position: absolute;
z-index: 10;
padding: 18rpx;
top: 0;
left: 0;
right: 0;
bottom: 0;
z-index: 12;
display: flex;
align-items: center;
justify-content: center;
text {
color: #fff;
max-width: 500rpx;
overflow: hidden;
/* 超出一行文字自动隐藏 */
text-overflow: ellipsis;
/*文字隐藏后添加省略号*/
white-space: nowrap;
.mask-play {
image {
width: 60rpx;
height: 60rpx;
}
}
}
.team-image {
width: 100%;
height: 400rpx;
}
}
.mask {
position: absolute;
top: 0;
left: 0;
right: 0;
bottom: 0;
z-index: 12;
.teamBox-bottom {
display: flex;
align-items: center;
justify-content: center;
justify-content: space-between;
padding: 15rpx 32rpx;
background-color: #fff;
box-sizing: border-box;
.interactive {
display: flex;
align-items: center;
.mask-play {
image {
width: 60rpx;
height: 60rpx;
width: 30rpx;
height: 30rpx;
margin-right: 12rpx;
}
}
}
}
.teamBox-bottom {
display: flex;
justify-content: space-between;
padding: 15rpx 32rpx;
background-color: #fff;
box-sizing: border-box;
.interactive {
display: flex;
align-items: center;
image {
width: 30rpx;
height: 30rpx;
margin-right: 12rpx;
}
}
}
}
}
</style>

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',