视频圈点赞优化

This commit is contained in:
曹磊 2024-08-28 17:16:58 +08:00
parent 9b3d6b9729
commit c37845d422
2 changed files with 56 additions and 52 deletions

View File

@ -356,7 +356,7 @@
id:4, id:4,
name: '女性专区', name: '女性专区',
}, },
], ],
scrollLeft:0, scrollLeft:0,
tabs: [{ tabs: [{
@ -641,19 +641,21 @@
}, },
getVideo(){ getVideo(){
var that=this; var that=this;
console.log(that.parType);
// 1. // 1.
var data={ var data={
parType:that.parType, userId: uni.getStorageSync('userId'),
userId:uni.getStorageSync('userId'),
page: this.page, page: this.page,
limit:4, limit:4,
} }
if(that.parType=='3'){ if(that.parType=='1'){
data.longitude=that.longitude;
data.latitude=that.latitude;
}else{
data.longitude=''; data.longitude='';
data.latitude=''; data.latitude='';
}else if(that.parType=='2'){
data.longitude=that.longitude;
data.latitude=that.latitude;
}else if(that.parType=='3'){
data.gzrId = uni.getStorageSync('userId');
} }
this.$Request.get("/app/shipinquan/list", data).then(res => { this.$Request.get("/app/shipinquan/list", data).then(res => {
if (res.code == 0) { if (res.code == 0) {
@ -680,7 +682,7 @@
url: '/pages/public/login' url: '/pages/public/login'
}) })
} }
}, },
searchBtn(){// searchBtn(){//
@ -694,7 +696,7 @@
url: '/pages/public/login' url: '/pages/public/login'
}) })
} }
}, },
input(res) {// input(res) {//
this.searchValue=res; this.searchValue=res;
@ -713,7 +715,7 @@
url: '/pages/public/login' url: '/pages/public/login'
}) })
} }
}, },
yuedao(text){ yuedao(text){
let userId = uni.getStorageSync('userId') let userId = uni.getStorageSync('userId')
@ -726,7 +728,7 @@
url: '/pages/public/login' url: '/pages/public/login'
}) })
} }
}, },
closePopup(type){// closePopup(type){//
this.type = type this.type = type
@ -770,7 +772,7 @@
url: '/pages/public/login' url: '/pages/public/login'
}) })
} }
} else{ } else{
// #ifdef MP-WEIXIN // #ifdef MP-WEIXIN
let that = this let that = this
@ -900,7 +902,7 @@
}, },
chaoji(){// chaoji(){//
let userId = uni.getStorageSync('userId') let userId = uni.getStorageSync('userId')
if (userId) { if (userId) {
uni.navigateTo({ uni.navigateTo({
@ -936,7 +938,7 @@
url: '/pages/public/login' url: '/pages/public/login'
}) })
} }
}, },
goNav(e){ goNav(e){
let userId = uni.getStorageSync('userId') let userId = uni.getStorageSync('userId')
@ -955,7 +957,7 @@
url: '/pages/public/login' url: '/pages/public/login'
}) })
} }
}, },
// chooseItem(item){ // chooseItem(item){
@ -1031,7 +1033,7 @@
url: '/pages/public/login' url: '/pages/public/login'
}) })
} }
}, },
getCity(e) { getCity(e) {
@ -1219,8 +1221,8 @@
url: '/pages/public/login' url: '/pages/public/login'
}) })
} }
}, },
chengFel(item){// chengFel(item){//
this.currentTabFl=item.id; this.currentTabFl=item.id;
@ -1237,7 +1239,7 @@
url: '/pages/public/login' url: '/pages/public/login'
}) })
} }
}else if(this.currentTabFl=='3'){// }else if(this.currentTabFl=='3'){//
let userId = uni.getStorageSync('userId') let userId = uni.getStorageSync('userId')
if (userId) { if (userId) {
@ -1249,7 +1251,7 @@
url: '/pages/public/login' url: '/pages/public/login'
}) })
} }
}else{// }else{//
let userId = uni.getStorageSync('userId') let userId = uni.getStorageSync('userId')
if (userId) { if (userId) {
@ -1261,8 +1263,8 @@
url: '/pages/public/login' url: '/pages/public/login'
}) })
} }
} }
}, },
remen(){// remen(){//
@ -1291,12 +1293,12 @@
font-size: 14px; font-size: 14px;
color: #1296db; color: #1296db;
} }
.kefu image { .kefu image {
width: 50px; width: 50px;
height: 50px; height: 50px;
} }
.kefu { .kefu {
width: 75px; width: 75px;
height: 75px; height: 75px;

View File

@ -6,7 +6,7 @@
<swiper-item v-for="(list,index) in dataList" :key="index"> <swiper-item v-for="(list,index) in dataList" :key="index">
<view v-if="Math.abs(k-index)<=1"> <view v-if="Math.abs(k-index)<=1">
<view> <view>
<!-- <!--
1.v-if用于控制视频在节点的渲染数 1.v-if用于控制视频在节点的渲染数
2.muted的默认值是 false代表默认是禁音视频的 2.muted的默认值是 false代表默认是禁音视频的
3.http-cache默认开启视频缓存 3.http-cache默认开启视频缓存
@ -34,7 +34,7 @@
:style="'width: '+ windowWidth +'px; height: '+ windowHeight +'px; background-color: #000000; z-index: 8;'" :style="'width: '+ windowWidth +'px; height: '+ windowHeight +'px; background-color: #000000; z-index: 8;'"
:poster="list.filePath" :poster="list.filePath"
></video> ></video>
<!-- <!--
1.这里是封面方案二这里的封面可以自定义 1.这里是封面方案二这里的封面可以自定义
2.也在代码中做了批注两种方案可以共存不会相互影响 2.也在代码中做了批注两种方案可以共存不会相互影响
--> -->
@ -155,23 +155,23 @@
'height': 0, 'height': 0,
'width': 0, 'width': 0,
}, },
videoID: "", videoID: "",
isShow: false, isShow: false,
showPlay: false,// showPlay: false,//
rotates: 0,// rotates: 0,//
rotateTime: "",// rotateTime: "",//
xrotats: "", xrotats: "",
mpcleartime: "", mpcleartime: "",
isClick: false, isClick: false,
changeTimeout: "", changeTimeout: "",
mptime: 0, mptime: 0,
mpstartTime: 0, mpstartTime: 0,
duration: 500, duration: 500,
// -- -- start // -- -- start
videoStartPositon: 0, videoStartPositon: 0,
@ -183,14 +183,14 @@
// -- -- end // -- -- end
// - // -
heightNum: 1.18, heightNum: 1.18,
// //
touchNum: 0, touchNum: 0,
aixinLeft: 0, aixinLeft: 0,
aixinTop: 0, aixinTop: 0,
isShowAixin: false, isShowAixin: false,
Rotate: 0, Rotate: 0,
isShow1: false,//1 isShow1: false,//1
isShow2: false,//2 uni-popup isShow2: false,//2 uni-popup
currents: 0,//01🌟💗 currents: 0,//01🌟💗
@ -198,12 +198,12 @@
limit:10 limit:10
} }
}, },
watch:{ watch:{
async k(k,old_k){ async k(k,old_k){
// console.log(k, old_k) // console.log(k, old_k)
this.progressBarPercent = 0; this.progressBarPercent = 0;
this.isShow = false this.isShow = false
this.dataList[old_k].playIng = false// this.dataList[old_k].playIng = false//
this.dataList[old_k].isplay = true this.dataList[old_k].isplay = true
@ -291,7 +291,7 @@
audo.pause() audo.pause()
} }
}, },
methods: { methods: {
openComment() {// openComment() {//
this.$refs.ccRef.newCommentFun(); this.$refs.ccRef.newCommentFun();
@ -310,9 +310,9 @@
uni.setStorageSync("user",this.peopleList[i]); uni.setStorageSync("user",this.peopleList[i]);
这个东西用于存储当前用户信息 插件里面会使用到这个东西 这个东西用于存储当前用户信息 插件里面会使用到这个东西
记得写一下 记得写一下
4打开评论 4打开评论
*/ */
uni.showToast({ uni.showToast({
title: '加载中...', title: '加载中...',
icon: 'none', icon: 'none',
@ -338,7 +338,7 @@
// for (let i = 0; i < msg.length; i++) { // for (let i = 0; i < msg.length; i++) {
// list.push(msg[i]) // list.push(msg[i])
// } // }
this.tableData = msg.map(item => { this.tableData = msg.map(item => {
return { return {
...item, ...item,
@ -528,7 +528,7 @@
this.videoStartPositon = (this.windowWidth - (this.windowWidth*0.10)); this.videoStartPositon = (this.windowWidth - (this.windowWidth*0.10));
} }
// #endif // #endif
}, },
touchend(e){ touchend(e){
// #ifdef H5 // #ifdef H5
@ -543,7 +543,7 @@
this.isTouch = false; this.isTouch = false;
},500) },500)
// #endif // #endif
}, },
timeupdate(event,index){ timeupdate(event,index){
// //
@ -556,7 +556,7 @@
// ---- --- ending // ---- --- ending
doubleLike(){ doubleLike(){
if(this.dataList[this.k].sfdz == '0'){ if(this.dataList[this.k].sfdz == '0'){
var data={ var data={
createBy:uni.getStorageSync('userId'), createBy:uni.getStorageSync('userId'),
shipinquanId:this.dataList[this.k].id, shipinquanId:this.dataList[this.k].id,
@ -625,7 +625,7 @@
if(this.k == this.dataList.length - 1){ if(this.k == this.dataList.length - 1){
this.page++ this.page++
this.GET() this.GET()
} }
}, },
// //
@ -633,6 +633,7 @@
var data={ var data={
page: this.page, page: this.page,
limit:this.limit, limit:this.limit,
userId:uni.getStorageSync('userId')
} }
this.$Request.get("/app/shipinquan/list", data).then(res => { this.$Request.get("/app/shipinquan/list", data).then(res => {
if (res.code == 0) { if (res.code == 0) {
@ -654,6 +655,7 @@
var data={ var data={
page: this.page, page: this.page,
limit:this.limit, limit:this.limit,
userId:uni.getStorageSync('userId')
} }
this.$Request.get("/app/shipinquan/list", data).then(res => { this.$Request.get("/app/shipinquan/list", data).then(res => {
if (res.code == 0) { if (res.code == 0) {
@ -680,7 +682,7 @@
uni.createVideoContext(this.dataList[this.k].id+''+this.k,this).seek(0) uni.createVideoContext(this.dataList[this.k].id+''+this.k,this).seek(0)
uni.createVideoContext(this.dataList[this.k].id+''+this.k,this).pause() uni.createVideoContext(this.dataList[this.k].id+''+this.k,this).pause()
audo.src = this.dataList[this.k].src; audo.src = this.dataList[this.k].src;
},500) },500)
},200) },200)
this.videoID = this.dataList[this.k].id this.videoID = this.dataList[this.k].id
@ -698,7 +700,7 @@
icon: 'none' icon: 'none'
}) })
}, },
cLike(sss){ cLike(sss){
var data={ var data={
createBy:uni.getStorageSync('userId'), createBy:uni.getStorageSync('userId'),
@ -717,7 +719,7 @@
}) })
} }
}); });
}else{// }else{//
this.$Request.post("/app/shipinquan/delDianzan", data).then(res => { this.$Request.post("/app/shipinquan/delDianzan", data).then(res => {
if (res.code == 0) { if (res.code == 0) {
@ -730,9 +732,9 @@
}) })
} }
}); });
} }
} }
} }
} }
@ -748,7 +750,7 @@
width: 100%; width: 100%;
height: 100%; height: 100%;
background-color: #242424; background-color: #242424;
border-top-left-radius: 10px; border-top-left-radius: 10px;
border-top-right-radius: 10px; border-top-right-radius: 10px;
position: relative; position: relative;
display: flex; display: flex;
@ -757,7 +759,7 @@
/deep/uni-tabbar /deep/.uni-tabbar-bottom /deep/.uni-tabbar{ /deep/uni-tabbar /deep/.uni-tabbar-bottom /deep/.uni-tabbar{
z-index: 998; z-index: 998;
} }
.btn { .btn {
text-align: center; text-align: center;
color: #fff; color: #fff;
@ -848,7 +850,7 @@
display: -webkit-box; display: -webkit-box;
-webkit-box-orient: vertical; -webkit-box-orient: vertical;
-webkit-line-clamp: 3; -webkit-line-clamp: 3;
/* background-color: aqua; */ /* background-color: aqua; */
} }
.userName { .userName {