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", "path": "xskz/index",
"style": { "style": {
"navigationBarTitleText": "线上看展", "navigationBarTitleText": "线上看展",
"enablePullDownRefresh": false, "enablePullDownRefresh": true,
"onReachBottomDistance": 20,
"usingComponents": { "usingComponents": {
// #ifdef MP-WEIXIN // #ifdef MP-WEIXIN
"player-component": "plugin://player/video" "player-component": "plugin://player/video"

View File

@ -1,7 +1,8 @@
<template> <template>
<view> <view>
<!-- <view class="teamBox-top" > --> <!-- <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> :src="file" style="width: 750rpx;height: 500rpx;" controls>
</video> </video>
<!-- </view> --> <!-- </view> -->
@ -65,9 +66,9 @@
.then((res) => { .then((res) => {
if (res.code == 200) { if (res.code == 200) {
this.type = res.data.type this.type = res.data.type
this.cover = res.data.cover
if (this.type == 'locality') { if (this.type == 'locality') {
this.file = res.data.file this.file = res.data.file
console.log(111)
// this.getvideo(res.data.id) // this.getvideo(res.data.id)
} else if (this.type == 'tencent' && this.isWx) { } else if (this.type == 'tencent' && this.isWx) {
let path = res.data.linkPath.split('/') let path = res.data.linkPath.split('/')

View File

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

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