视频圈优化
This commit is contained in:
parent
e0b87e4983
commit
e3aad9bbad
|
@ -6,7 +6,7 @@
|
||||||
<view class="text_view">
|
<view class="text_view">
|
||||||
<view class="item_view">
|
<view class="item_view">
|
||||||
<view class="item_title" @tap="Cityshow = true">服务城市</view>
|
<view class="item_title" @tap="Cityshow = true">服务城市</view>
|
||||||
<u-input type="text" :disabled="true" v-model="city" placeholder="选择城市" />
|
<u-input type="text" v-model="city" placeholder="选择城市" @focus="Cityshow = true"/>
|
||||||
<view class="xian"></view>
|
<view class="xian"></view>
|
||||||
</view>
|
</view>
|
||||||
<view class="item_view">
|
<view class="item_view">
|
||||||
|
|
|
@ -231,7 +231,7 @@
|
||||||
</view>
|
</view>
|
||||||
</uni-popup>
|
</uni-popup>
|
||||||
</view>
|
</view>
|
||||||
<uni-popup style="width: 100%;height: 100vh;" type="center" ref="pinglun" @touchmove.stop.prevent="moveHandle">
|
<uni-popup style="width: 100%;height: 100vh;" type="center" ref="bofang" @touchmove.stop.prevent="moveHandle">
|
||||||
<view style="width: 100%;height: 100%;position: relative;">
|
<view style="width: 100%;height: 100%;position: relative;">
|
||||||
<video
|
<video
|
||||||
id="myVideo"
|
id="myVideo"
|
||||||
|
@ -253,13 +253,35 @@
|
||||||
<view class="guanbi" @click="guanbi">
|
<view class="guanbi" @click="guanbi">
|
||||||
<image src="@/static/closeimg.png"></image>
|
<image src="@/static/closeimg.png"></image>
|
||||||
</view>
|
</view>
|
||||||
|
<view class="userInfo">
|
||||||
|
<!-- 1.头像 -->
|
||||||
|
<image @click="tozuozhe(artificerItem)" class="userAvatar" :src="artificerItem.artificerImg" mode="aspectFill"></image>
|
||||||
|
<!-- 2.点赞 -->
|
||||||
|
<view class="list-view" @click="cLike(artificerItem);" style="opacity: 0.9; margin-top: 17px;">
|
||||||
|
<image v-if="artificerItem.sfdz==1" src="@/static/img/index/xin.png" style="width: 40px; height: 40px; position: absolute; right: 6px;"></image>
|
||||||
|
<image v-if="artificerItem.sfdz==0" src="@/static/img/index/xin-2.png" style="width: 40px; height: 40px; position: absolute; right: 6px;"></image>
|
||||||
|
<text style="color: #FFFFFF; margin-top: 5px; font-size: 14px; text-align: center; margin-top: 40px; font-weight: bold;" :class="{'likeNumActive':artificerItem.sfdz}">{{artificerItem.dzs}}</text>
|
||||||
|
</view>
|
||||||
|
<!-- 3.评论 -->
|
||||||
|
<view class="comment list-view" @click="toComment(artificerItem)" style="opacity: 0.9; margin-top: 17px;">
|
||||||
|
<image src="@/static/img/index/liaotian-2.png" style="width:38px; height:36px; position: absolute; right: 7px;"></image>
|
||||||
|
<text style="color: #FFFFFF; margin-top: 5px; font-size: 14px; font-weight: bold; text-align: center; margin-top: 40px;">{{artificerItem.pls}}</text>
|
||||||
|
</view>
|
||||||
|
</view>
|
||||||
|
</view>
|
||||||
|
</uni-popup>
|
||||||
|
<uni-popup class="uni-popup" type="bottom" ref="pinglun" @touchmove.stop.prevent="moveHandle">
|
||||||
|
<view class="popup-content-pl" :style="'width: '+ windowWidth +'px; height: '+ (boxStyle.height/heightNum) +'px;'">
|
||||||
|
<CComment ref="ccRef" :showPopup="showPopup" :userInfo="userInfo" :tableData="tableData" :tableTotal="tableTotal" likeFun="likeFun" @replyFun="replyFun" @deleteFun="deleteFun" :deleteMode="deleteMode"></CComment>
|
||||||
</view>
|
</view>
|
||||||
</uni-popup>
|
</uni-popup>
|
||||||
</view>
|
</view>
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
<script>
|
<script>
|
||||||
|
import CComment from "@/components/XJ-comment/index";
|
||||||
export default {
|
export default {
|
||||||
|
components:{CComment},
|
||||||
data() {
|
data() {
|
||||||
return {
|
return {
|
||||||
playShow:false,
|
playShow:false,
|
||||||
|
@ -334,7 +356,26 @@
|
||||||
filePath:'',
|
filePath:'',
|
||||||
contentVideo:'',
|
contentVideo:'',
|
||||||
videoId:'',
|
videoId:'',
|
||||||
artificerClassifyList:[]
|
artificerClassifyList:[],
|
||||||
|
artificerItem:{},
|
||||||
|
showPopup:false,
|
||||||
|
ccRef: null,
|
||||||
|
userInfo: {
|
||||||
|
id: 120,
|
||||||
|
user_name: "🍁",
|
||||||
|
user_avatar: "https://pic1.zhimg.com/80/v2-a79071a705f55c5d88f6c74e6111fe84_720w.webp",
|
||||||
|
},
|
||||||
|
tableTotal: 4,
|
||||||
|
tableData: [],
|
||||||
|
deleteMode: "all",
|
||||||
|
windowWidth: 0,
|
||||||
|
windowHeight: 0,
|
||||||
|
heightNum: 1.18,
|
||||||
|
deleteHeight: 0,
|
||||||
|
boxStyle:{//视频,图片封面样式🌟💗
|
||||||
|
'height': 0,
|
||||||
|
'width': 0,
|
||||||
|
},
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
onLoad(option) {
|
onLoad(option) {
|
||||||
|
@ -344,6 +385,13 @@
|
||||||
title: '加载中...',
|
title: '加载中...',
|
||||||
|
|
||||||
});
|
});
|
||||||
|
if(this.platform == 'ios' && (model !== 'iPhone6' || model !== 'iPhone6s' || model !== 'iPhone7' || model !== 'iPhone8')){
|
||||||
|
this.deleteHeight = 0//有 tabbar的 修改这里可以改变视频高度
|
||||||
|
}
|
||||||
|
this.windowWidth = uni.getSystemInfoSync().windowWidth;
|
||||||
|
this.windowHeight = uni.getSystemInfoSync().windowHeight;
|
||||||
|
this.boxStyle.width = this.windowWidth + 'px';//给宽度加px
|
||||||
|
this.boxStyle.height = this.windowHeight - this.deleteHeight;//有 tabbar的 修改这里可以改变视频高度
|
||||||
this.XCXIsSelect = this.$queue.getData("XCXIsSelect");
|
this.XCXIsSelect = this.$queue.getData("XCXIsSelect");
|
||||||
this.artificerId = option.artificerId
|
this.artificerId = option.artificerId
|
||||||
this.myId = uni.getStorageSync('userId')
|
this.myId = uni.getStorageSync('userId')
|
||||||
|
@ -369,7 +417,7 @@
|
||||||
this.playShow=false;
|
this.playShow=false;
|
||||||
const videoContext = uni.createVideoContext('myVideo', this);
|
const videoContext = uni.createVideoContext('myVideo', this);
|
||||||
videoContext.pause(); // 播放视频
|
videoContext.pause(); // 播放视频
|
||||||
this.$refs.pinglun.close("center");
|
this.$refs.bofang.close("center");
|
||||||
},
|
},
|
||||||
jieshu(){
|
jieshu(){
|
||||||
this.playShow=true;
|
this.playShow=true;
|
||||||
|
@ -386,8 +434,9 @@
|
||||||
this.playShow=true;
|
this.playShow=true;
|
||||||
this.filePath=item.filePath;
|
this.filePath=item.filePath;
|
||||||
this.contentVideo=item.content;
|
this.contentVideo=item.content;
|
||||||
|
this.artificerItem=item;
|
||||||
this.videoId=item.id
|
this.videoId=item.id
|
||||||
this.$refs.pinglun.open("center")
|
this.$refs.bofang.open("center")
|
||||||
},
|
},
|
||||||
getVideo(){
|
getVideo(){
|
||||||
var that=this;
|
var that=this;
|
||||||
|
@ -718,6 +767,171 @@
|
||||||
current: imgArr[index]
|
current: imgArr[index]
|
||||||
});
|
});
|
||||||
},
|
},
|
||||||
|
tozuozhe(item){
|
||||||
|
// console.log("itemitemitemitemitem",item)
|
||||||
|
uni.reLaunch({
|
||||||
|
url:'/pages/therapist/orderDetail?artificerId='+item.createBy+'&classifyId='+'undefined'
|
||||||
|
})
|
||||||
|
this.currents = 1//点击头像以后就会切换
|
||||||
|
},
|
||||||
|
cLike(item){
|
||||||
|
var data={
|
||||||
|
createBy:uni.getStorageSync('userId'),
|
||||||
|
shipinquanId:item.id,
|
||||||
|
}
|
||||||
|
if(item.sfdz=='0'){
|
||||||
|
this.$Request.post("/app/shipinquan/addDianzan", data).then(res => {
|
||||||
|
if (res.code == 0) {
|
||||||
|
this.artificerItem.dzs += 1;
|
||||||
|
this.artificerItem.sfdz = '1';
|
||||||
|
} else {
|
||||||
|
uni.showToast({
|
||||||
|
title: res.msg,
|
||||||
|
icon: 'none'
|
||||||
|
})
|
||||||
|
}
|
||||||
|
});
|
||||||
|
|
||||||
|
}else{//取消点赞
|
||||||
|
this.$Request.post("/app/shipinquan/delDianzan", data).then(res => {
|
||||||
|
if (res.code == 0) {
|
||||||
|
this.artificerItem.dzs -= 1;
|
||||||
|
this.artificerItem.sfdz = '0';
|
||||||
|
} else {
|
||||||
|
uni.showToast({
|
||||||
|
title: res.msg,
|
||||||
|
icon: 'none'
|
||||||
|
})
|
||||||
|
}
|
||||||
|
});
|
||||||
|
}
|
||||||
|
},
|
||||||
|
likeFun(params, callback) {//评论点赞返回
|
||||||
|
console.log("likeFun", params);
|
||||||
|
// Implement your logic for likeFun
|
||||||
|
},
|
||||||
|
toComment(item){
|
||||||
|
// 注意点击评论之后会执行这里
|
||||||
|
/*
|
||||||
|
(1)先加载缓冲
|
||||||
|
(2)获取当前视频 ID 信息
|
||||||
|
(3)🌟🌟🌟🌟重要🌟🌟🌟🌟
|
||||||
|
- 一定要记得看 index.vue 里面
|
||||||
|
uni.setStorageSync("user",this.peopleList[i]);
|
||||||
|
这个东西,用于存储当前用户信息。在 插件里面会使用到这个东西,
|
||||||
|
记得写一下。
|
||||||
|
|
||||||
|
(4)打开评论
|
||||||
|
*/
|
||||||
|
uni.showToast({
|
||||||
|
title: '加载中...',
|
||||||
|
icon: 'none',
|
||||||
|
position: 'bottom',
|
||||||
|
duration: 300
|
||||||
|
})
|
||||||
|
uni.setStorageSync("videoID",item.id);
|
||||||
|
this.videoID = item.id;
|
||||||
|
this.$refs.pinglun.open('bottom');
|
||||||
|
this.getPingL(this.videoID);
|
||||||
|
},
|
||||||
|
getPingL(shipinquanId){//获取评论列表
|
||||||
|
var data={
|
||||||
|
page: this.page,
|
||||||
|
limit:310,
|
||||||
|
shipinquanId:shipinquanId
|
||||||
|
}
|
||||||
|
this.$Request.get("/app/shipinquan/contentlist", data).then(res => {
|
||||||
|
if (res.code == 0) {
|
||||||
|
var msg = res.data.records||{}
|
||||||
|
this.tableTotal=res.data.total;
|
||||||
|
var list=[];
|
||||||
|
// for (let i = 0; i < msg.length; i++) {
|
||||||
|
// list.push(msg[i])
|
||||||
|
// }
|
||||||
|
|
||||||
|
this.tableData = msg.map(item => {
|
||||||
|
return {
|
||||||
|
...item,
|
||||||
|
parent_id: null,
|
||||||
|
reply_id: null,
|
||||||
|
reply_name: null,
|
||||||
|
user_name: item.userName,
|
||||||
|
user_avatar: item.userPhoto?item.userPhoto:'../../static/logo.png',
|
||||||
|
user_content: item.content,
|
||||||
|
is_like: true,
|
||||||
|
like_count: 8,
|
||||||
|
create_time: item.createTime
|
||||||
|
};
|
||||||
|
});
|
||||||
|
} else {
|
||||||
|
uni.showToast({
|
||||||
|
title: res.msg,
|
||||||
|
icon: 'none'
|
||||||
|
})
|
||||||
|
}
|
||||||
|
});
|
||||||
|
},
|
||||||
|
replyFun(params, callback) {
|
||||||
|
// console.log("replyFun", params);
|
||||||
|
if(params.params.user_content==''){
|
||||||
|
uni.hideLoading();
|
||||||
|
uni.showToast({
|
||||||
|
icon:'error',
|
||||||
|
title:'请填写发布评论'
|
||||||
|
})
|
||||||
|
}else{
|
||||||
|
var data={
|
||||||
|
createBy:uni.getStorageSync('userId'),
|
||||||
|
content:params.params.user_content,
|
||||||
|
shipinquanId:this.videoID,
|
||||||
|
}
|
||||||
|
this.$Request.post("/app/shipinquan/addContent",data).then(res => {
|
||||||
|
if (res.code == 0) {
|
||||||
|
setTimeout(() => this.getPingL(this.videoID), 500);
|
||||||
|
this.showPopup==true;
|
||||||
|
uni.hideLoading();
|
||||||
|
this.artificerItem.pls++
|
||||||
|
// callback(this.videoID);
|
||||||
|
} else {
|
||||||
|
uni.hideLoading();
|
||||||
|
uni.showToast({
|
||||||
|
title: res.msg,
|
||||||
|
icon: 'none'
|
||||||
|
})
|
||||||
|
}
|
||||||
|
});
|
||||||
|
}
|
||||||
|
},
|
||||||
|
deleteFun({ params, mode }, callback) {
|
||||||
|
|
||||||
|
console.log("deleteFun", { params, mode });
|
||||||
|
// 当请求成功, 调用callback执行评论删除;
|
||||||
|
switch (this.deleteMode) {
|
||||||
|
case "bind":
|
||||||
|
// 逻辑: 调用接口进行评论内容修改 update
|
||||||
|
setTimeout(() => callback(), 500); // 目前为了展示效果, 直接执行callback
|
||||||
|
break;
|
||||||
|
case "only":
|
||||||
|
// 逻辑: 调用接口删除一个评论 delete
|
||||||
|
setTimeout(() => callback(), 500); // 目前为了展示效果, 直接执行callback
|
||||||
|
break;
|
||||||
|
default:
|
||||||
|
// all
|
||||||
|
// 逻辑: 调用接口删除多个评论 [delete]
|
||||||
|
// Demo如下:
|
||||||
|
// axios.post("http://xxx/delete", { ids: params }).then((res) => {
|
||||||
|
// if (res.code === 0) {
|
||||||
|
// callback(res);
|
||||||
|
// }
|
||||||
|
// });
|
||||||
|
setTimeout(() => callback(), 500); // 目前为了展示效果, 直接执行callback
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
},
|
||||||
|
closeScrollview(){
|
||||||
|
// 点击评论里面的叉叉,就会关闭评论
|
||||||
|
this.$refs.pinglun.close('bottom');
|
||||||
|
},
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
@ -773,9 +987,6 @@
|
||||||
/deep/.uni-popup__wrapper-box{
|
/deep/.uni-popup__wrapper-box{
|
||||||
width: 100%;
|
width: 100%;
|
||||||
height: 100%;
|
height: 100%;
|
||||||
display: flex;
|
|
||||||
justify-content: center;
|
|
||||||
align-items: center;
|
|
||||||
}
|
}
|
||||||
.videoHovers image{
|
.videoHovers image{
|
||||||
width: 100%;
|
width: 100%;
|
||||||
|
@ -1012,7 +1223,16 @@
|
||||||
display: flex;
|
display: flex;
|
||||||
flex-direction: column;
|
flex-direction: column;
|
||||||
}
|
}
|
||||||
|
.popup-content-pl{
|
||||||
|
width: 100%;
|
||||||
|
height: 100%;
|
||||||
|
background-color: #242424;
|
||||||
|
border-top-left-radius: 10px;
|
||||||
|
border-top-right-radius: 10px;
|
||||||
|
position: relative;
|
||||||
|
display: flex;
|
||||||
|
flex-direction: column;
|
||||||
|
}
|
||||||
.content{
|
.content{
|
||||||
width: 100%;
|
width: 100%;
|
||||||
background-color: #f7f7f7;
|
background-color: #f7f7f7;
|
||||||
|
@ -1539,4 +1759,31 @@
|
||||||
margin-right: 10rpx;
|
margin-right: 10rpx;
|
||||||
margin-top: 5px;
|
margin-top: 5px;
|
||||||
}
|
}
|
||||||
|
.userInfo{
|
||||||
|
position: absolute;
|
||||||
|
bottom:110px;
|
||||||
|
right: 10px;
|
||||||
|
display: flex;
|
||||||
|
flex-direction: column;
|
||||||
|
z-index: 18;
|
||||||
|
}
|
||||||
|
.userAvatar{
|
||||||
|
border-radius: 500%;
|
||||||
|
border-style: solid;
|
||||||
|
border-width: 2px;
|
||||||
|
border-color: #ffffff;
|
||||||
|
width : 100rpx;
|
||||||
|
height: 100rpx;
|
||||||
|
}
|
||||||
|
.list-view{
|
||||||
|
display: flex;
|
||||||
|
flex-direction: column;
|
||||||
|
align-items: center;
|
||||||
|
}
|
||||||
|
.uni-popup{
|
||||||
|
width: 100%;
|
||||||
|
height: 500px;
|
||||||
|
overflow: auto;
|
||||||
|
}
|
||||||
|
|
||||||
</style>
|
</style>
|
||||||
|
|
|
@ -76,7 +76,7 @@
|
||||||
{{item.content}}
|
{{item.content}}
|
||||||
</view>
|
</view>
|
||||||
<view class="data-list">
|
<view class="data-list">
|
||||||
<view class="videoHovers" @click="towxh5Video(item)">
|
<view class="videoHovers" @click="towxh5Video(item,index)">
|
||||||
<image src="@/static/bofang.png"></image>
|
<image src="@/static/bofang.png"></image>
|
||||||
</view>
|
</view>
|
||||||
<view class="playState">
|
<view class="playState">
|
||||||
|
@ -84,12 +84,13 @@
|
||||||
</view>
|
</view>
|
||||||
</view>
|
</view>
|
||||||
<view class="scroll-bottom">
|
<view class="scroll-bottom">
|
||||||
<view class="pinglun">
|
<view class="pinglun" @click="toComment(index)">
|
||||||
<image src="../../static/pinglun.png" mode=""></image>
|
<image src="../../static/pinglun.png" mode=""></image>
|
||||||
<span>{{item.pls}}</span>
|
<span>{{item.pls}}</span>
|
||||||
</view>
|
</view>
|
||||||
<view class="pinglun" style="margin-left: 20px;">
|
<view class="pinglun" style="margin-left: 20px;" @click="cLike(item,index);">
|
||||||
<image src="../../static/guanzhu.png" mode=""></image>
|
<image v-if="item.sfdz==0" src="../../static/guanzhu.png" mode=""></image>
|
||||||
|
<image v-if="item.sfdz==1" src="@/static/img/index/xin.png" mode=""></image>
|
||||||
<span>{{item.dzs}}</span>
|
<span>{{item.dzs}}</span>
|
||||||
</view>
|
</view>
|
||||||
</view>
|
</view>
|
||||||
|
@ -106,7 +107,7 @@
|
||||||
</template>
|
</template>
|
||||||
</scroll-view>
|
</scroll-view>
|
||||||
<empty v-if="getVideoData.length==0"></empty>
|
<empty v-if="getVideoData.length==0"></empty>
|
||||||
<uni-popup style="width: 100%;height: 100vh;" type="center" ref="pinglun" @touchmove.stop.prevent="moveHandle">
|
<uni-popup style="width: 100%;height: 100vh;" type="center" ref="bofang" @touchmove.stop.prevent="moveHandle">
|
||||||
<view style="width: 100%;height: 100%;position: relative;">
|
<view style="width: 100%;height: 100%;position: relative;">
|
||||||
<video
|
<video
|
||||||
id="myVideo"
|
id="myVideo"
|
||||||
|
@ -128,15 +129,36 @@
|
||||||
<view class="guanbi" @click="guanbi">
|
<view class="guanbi" @click="guanbi">
|
||||||
<image src="@/static/closeimg.png"></image>
|
<image src="@/static/closeimg.png"></image>
|
||||||
</view>
|
</view>
|
||||||
|
<view class="userInfo">
|
||||||
|
<!-- 1.头像 -->
|
||||||
|
<image @click="tozuozhe(artificerItem)" class="userAvatar" :src="artificerItem.artificerImg" mode="aspectFill"></image>
|
||||||
|
<!-- 2.点赞 -->
|
||||||
|
<view class="list-view" @click="cLike(artificerItem,k);" style="opacity: 0.9; margin-top: 17px;">
|
||||||
|
<image v-if="artificerItem.sfdz==1" src="@/static/img/index/xin.png" style="width: 40px; height: 40px; position: absolute; right: 6px;"></image>
|
||||||
|
<image v-if="artificerItem.sfdz==0" src="@/static/img/index/xin-2.png" style="width: 40px; height: 40px; position: absolute; right: 6px;"></image>
|
||||||
|
<text style="color: #FFFFFF; margin-top: 5px; font-size: 14px; text-align: center; margin-top: 40px; font-weight: bold;" :class="{'likeNumActive':artificerItem.sfdz}">{{artificerItem.dzs}}</text>
|
||||||
|
</view>
|
||||||
|
<!-- 3.评论 -->
|
||||||
|
<view class="comment list-view" @click="toComment(k)" style="opacity: 0.9; margin-top: 17px;">
|
||||||
|
<image src="@/static/img/index/liaotian-2.png" style="width:38px; height:36px; position: absolute; right: 7px;"></image>
|
||||||
|
<text style="color: #FFFFFF; margin-top: 5px; font-size: 14px; font-weight: bold; text-align: center; margin-top: 40px;">{{artificerItem.pls}}</text>
|
||||||
|
</view>
|
||||||
|
</view>
|
||||||
|
</view>
|
||||||
|
</uni-popup>
|
||||||
|
<uni-popup class="uni-popup" type="bottom" ref="pinglun" @touchmove.stop.prevent="moveHandle">
|
||||||
|
<view class="popup-content" :style="'width: '+ windowWidth +'px; height: '+ (boxStyle.height/heightNum) +'px;'">
|
||||||
|
<CComment ref="ccRef" :showPopup="showPopup" :userInfo="userInfo" :tableData="tableData" :tableTotal="tableTotal" likeFun="likeFun" @replyFun="replyFun" @deleteFun="deleteFun" :deleteMode="deleteMode"></CComment>
|
||||||
</view>
|
</view>
|
||||||
</uni-popup>
|
</uni-popup>
|
||||||
</view>
|
</view>
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
<script>
|
<script>
|
||||||
import empty from '@/components/empty.vue'
|
import empty from '@/components/empty.vue';
|
||||||
|
import CComment from "@/components/XJ-comment/index";
|
||||||
export default {
|
export default {
|
||||||
components:{empty},
|
components:{CComment,empty},
|
||||||
data() {
|
data() {
|
||||||
return {
|
return {
|
||||||
isFollow: false,
|
isFollow: false,
|
||||||
|
@ -154,15 +176,43 @@
|
||||||
playShow:false,
|
playShow:false,
|
||||||
filePath:'',
|
filePath:'',
|
||||||
contentVideo:'',
|
contentVideo:'',
|
||||||
|
artificerImg:'',
|
||||||
|
artificerItem:{},
|
||||||
videoId:'',
|
videoId:'',
|
||||||
getVideoData:[],
|
getVideoData:[],
|
||||||
//上拉状态文字
|
//上拉状态文字
|
||||||
loadingText : ["上拉或点击加载更多","已加载全部数据",'加载中',''],
|
loadingText : ["上拉或点击加载更多","已加载全部数据",'加载中',''],
|
||||||
ordersScore:''
|
ordersScore:'',
|
||||||
|
showPopup:false,
|
||||||
|
ccRef: null,
|
||||||
|
userInfo: {
|
||||||
|
id: 120,
|
||||||
|
user_name: "🍁",
|
||||||
|
user_avatar: "https://pic1.zhimg.com/80/v2-a79071a705f55c5d88f6c74e6111fe84_720w.webp",
|
||||||
|
},
|
||||||
|
tableTotal: 4,
|
||||||
|
tableData: [],
|
||||||
|
deleteMode: "all",
|
||||||
|
windowWidth: 0,
|
||||||
|
windowHeight: 0,
|
||||||
|
heightNum: 1.18,
|
||||||
|
deleteHeight: 0,
|
||||||
|
boxStyle:{//视频,图片封面样式🌟💗
|
||||||
|
'height': 0,
|
||||||
|
'width': 0,
|
||||||
|
},
|
||||||
|
k: 0,
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
|
||||||
onLoad(e) {
|
onLoad(e) {
|
||||||
|
if(this.platform == 'ios' && (model !== 'iPhone6' || model !== 'iPhone6s' || model !== 'iPhone7' || model !== 'iPhone8')){
|
||||||
|
this.deleteHeight = 0//有 tabbar的 修改这里可以改变视频高度
|
||||||
|
}
|
||||||
|
this.windowWidth = uni.getSystemInfoSync().windowWidth;
|
||||||
|
this.windowHeight = uni.getSystemInfoSync().windowHeight;
|
||||||
|
this.boxStyle.width = this.windowWidth + 'px';//给宽度加px
|
||||||
|
this.boxStyle.height = this.windowHeight - this.deleteHeight;//有 tabbar的 修改这里可以改变视频高度
|
||||||
this.artificerId = e.artificerId;
|
this.artificerId = e.artificerId;
|
||||||
this.latitude = uni.getStorageSync('latitude');
|
this.latitude = uni.getStorageSync('latitude');
|
||||||
this.longitude = uni.getStorageSync('longitude');
|
this.longitude = uni.getStorageSync('longitude');
|
||||||
|
@ -291,7 +341,7 @@
|
||||||
this.playShow=false;
|
this.playShow=false;
|
||||||
const videoContext = uni.createVideoContext('myVideo', this);
|
const videoContext = uni.createVideoContext('myVideo', this);
|
||||||
videoContext.pause(); // 播放视频
|
videoContext.pause(); // 播放视频
|
||||||
this.$refs.pinglun.close("center");
|
this.$refs.bofang.close("center");
|
||||||
},
|
},
|
||||||
jieshu(){
|
jieshu(){
|
||||||
this.playShow=true;
|
this.playShow=true;
|
||||||
|
@ -304,12 +354,180 @@
|
||||||
videoContext.src = this.filePath; // 设置视频源
|
videoContext.src = this.filePath; // 设置视频源
|
||||||
videoContext.play(); // 播放视频
|
videoContext.play(); // 播放视频
|
||||||
},
|
},
|
||||||
towxh5Video(item){
|
towxh5Video(item,index){
|
||||||
this.playShow=true;
|
this.playShow=true;
|
||||||
this.filePath=item.filePath;
|
this.filePath=item.filePath;
|
||||||
this.contentVideo=item.content;
|
this.contentVideo=item.content;
|
||||||
this.videoId=item.id
|
this.artificerItem=item;
|
||||||
this.$refs.pinglun.open("center")
|
this.videoId=item.id;
|
||||||
|
this.k=index;
|
||||||
|
this.$refs.bofang.open("center");
|
||||||
|
},
|
||||||
|
tozuozhe(item){
|
||||||
|
// console.log("itemitemitemitemitem",item)
|
||||||
|
uni.reLaunch({
|
||||||
|
url:'/pages/therapist/orderDetail?artificerId='+item.createBy+'&classifyId='+'undefined'
|
||||||
|
})
|
||||||
|
this.currents = 1//点击头像以后就会切换
|
||||||
|
},
|
||||||
|
cLike(item,index){
|
||||||
|
var data={
|
||||||
|
createBy:uni.getStorageSync('userId'),
|
||||||
|
shipinquanId:item.id,
|
||||||
|
}
|
||||||
|
if(item.sfdz=='0'){
|
||||||
|
this.$Request.post("/app/shipinquan/addDianzan", data).then(res => {
|
||||||
|
if (res.code == 0) {
|
||||||
|
this.getVideoData[index].dzs += 1;
|
||||||
|
this.getVideoData[index].sfdz = '1';
|
||||||
|
} else {
|
||||||
|
uni.showToast({
|
||||||
|
title: res.msg,
|
||||||
|
icon: 'none'
|
||||||
|
})
|
||||||
|
}
|
||||||
|
});
|
||||||
|
|
||||||
|
}else{//取消点赞
|
||||||
|
this.$Request.post("/app/shipinquan/delDianzan", data).then(res => {
|
||||||
|
if (res.code == 0) {
|
||||||
|
this.getVideoData[index].dzs -= 1;
|
||||||
|
this.getVideoData[index].sfdz = '0';
|
||||||
|
} else {
|
||||||
|
uni.showToast({
|
||||||
|
title: res.msg,
|
||||||
|
icon: 'none'
|
||||||
|
})
|
||||||
|
}
|
||||||
|
});
|
||||||
|
}
|
||||||
|
},
|
||||||
|
likeFun(params, callback) {//评论点赞返回
|
||||||
|
// console.log("likeFun", params);
|
||||||
|
// Implement your logic for likeFun
|
||||||
|
},
|
||||||
|
toComment(index){
|
||||||
|
// 注意点击评论之后会执行这里
|
||||||
|
/*
|
||||||
|
(1)先加载缓冲
|
||||||
|
(2)获取当前视频 ID 信息
|
||||||
|
(3)🌟🌟🌟🌟重要🌟🌟🌟🌟
|
||||||
|
- 一定要记得看 index.vue 里面
|
||||||
|
uni.setStorageSync("user",this.peopleList[i]);
|
||||||
|
这个东西,用于存储当前用户信息。在 插件里面会使用到这个东西,
|
||||||
|
记得写一下。
|
||||||
|
|
||||||
|
(4)打开评论
|
||||||
|
*/
|
||||||
|
uni.showToast({
|
||||||
|
title: '加载中...',
|
||||||
|
icon: 'none',
|
||||||
|
position: 'bottom',
|
||||||
|
duration: 300
|
||||||
|
})
|
||||||
|
this.k = index;
|
||||||
|
uni.setStorageSync("videoID",this.getVideoData[index].id);
|
||||||
|
this.videoID = this.getVideoData[index].id;
|
||||||
|
this.$refs.pinglun.open('bottom');
|
||||||
|
this.getPingL(this.videoID);
|
||||||
|
},
|
||||||
|
getPingL(shipinquanId){//获取评论列表
|
||||||
|
var data={
|
||||||
|
page: this.page,
|
||||||
|
limit:310,
|
||||||
|
shipinquanId:shipinquanId
|
||||||
|
}
|
||||||
|
this.$Request.get("/app/shipinquan/contentlist", data).then(res => {
|
||||||
|
if (res.code == 0) {
|
||||||
|
var msg = res.data.records||{}
|
||||||
|
this.tableTotal=res.data.total;
|
||||||
|
var list=[];
|
||||||
|
// for (let i = 0; i < msg.length; i++) {
|
||||||
|
// list.push(msg[i])
|
||||||
|
// }
|
||||||
|
|
||||||
|
this.tableData = msg.map(item => {
|
||||||
|
return {
|
||||||
|
...item,
|
||||||
|
parent_id: null,
|
||||||
|
reply_id: null,
|
||||||
|
reply_name: null,
|
||||||
|
user_name: item.userName,
|
||||||
|
user_avatar: item.userPhoto?item.userPhoto:'../../static/logo.png',
|
||||||
|
user_content: item.content,
|
||||||
|
is_like: true,
|
||||||
|
like_count: 8,
|
||||||
|
create_time: item.createTime
|
||||||
|
};
|
||||||
|
});
|
||||||
|
} else {
|
||||||
|
uni.showToast({
|
||||||
|
title: res.msg,
|
||||||
|
icon: 'none'
|
||||||
|
})
|
||||||
|
}
|
||||||
|
});
|
||||||
|
},
|
||||||
|
replyFun(params, callback) {
|
||||||
|
// console.log("replyFun", params);
|
||||||
|
if(params.params.user_content==''){
|
||||||
|
uni.hideLoading();
|
||||||
|
uni.showToast({
|
||||||
|
icon:'error',
|
||||||
|
title:'请填写发布评论'
|
||||||
|
})
|
||||||
|
}else{
|
||||||
|
var data={
|
||||||
|
createBy:uni.getStorageSync('userId'),
|
||||||
|
content:params.params.user_content,
|
||||||
|
shipinquanId:this.videoID,
|
||||||
|
}
|
||||||
|
this.$Request.post("/app/shipinquan/addContent",data).then(res => {
|
||||||
|
if (res.code == 0) {
|
||||||
|
setTimeout(() => this.getPingL(this.videoID), 500);
|
||||||
|
this.showPopup==true;
|
||||||
|
uni.hideLoading();
|
||||||
|
this.getVideoData[this.k].pls++
|
||||||
|
// callback(this.videoID);
|
||||||
|
} else {
|
||||||
|
uni.hideLoading();
|
||||||
|
uni.showToast({
|
||||||
|
title: res.msg,
|
||||||
|
icon: 'none'
|
||||||
|
})
|
||||||
|
}
|
||||||
|
});
|
||||||
|
}
|
||||||
|
},
|
||||||
|
deleteFun({ params, mode }, callback) {
|
||||||
|
|
||||||
|
console.log("deleteFun", { params, mode });
|
||||||
|
// 当请求成功, 调用callback执行评论删除;
|
||||||
|
switch (this.deleteMode) {
|
||||||
|
case "bind":
|
||||||
|
// 逻辑: 调用接口进行评论内容修改 update
|
||||||
|
setTimeout(() => callback(), 500); // 目前为了展示效果, 直接执行callback
|
||||||
|
break;
|
||||||
|
case "only":
|
||||||
|
// 逻辑: 调用接口删除一个评论 delete
|
||||||
|
setTimeout(() => callback(), 500); // 目前为了展示效果, 直接执行callback
|
||||||
|
break;
|
||||||
|
default:
|
||||||
|
// all
|
||||||
|
// 逻辑: 调用接口删除多个评论 [delete]
|
||||||
|
// Demo如下:
|
||||||
|
// axios.post("http://xxx/delete", { ids: params }).then((res) => {
|
||||||
|
// if (res.code === 0) {
|
||||||
|
// callback(res);
|
||||||
|
// }
|
||||||
|
// });
|
||||||
|
setTimeout(() => callback(), 500); // 目前为了展示效果, 直接执行callback
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
},
|
||||||
|
closeScrollview(){
|
||||||
|
// 点击评论里面的叉叉,就会关闭评论
|
||||||
|
this.$refs.pinglun.close('bottom');
|
||||||
},
|
},
|
||||||
//编辑信息
|
//编辑信息
|
||||||
UserEdit() {
|
UserEdit() {
|
||||||
|
@ -322,6 +540,21 @@
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
<style scoped>
|
<style scoped>
|
||||||
|
.uni-popup{
|
||||||
|
width: 100%;
|
||||||
|
height: 500px;
|
||||||
|
overflow: auto;
|
||||||
|
}
|
||||||
|
.popup-content{
|
||||||
|
width: 100%;
|
||||||
|
height: 100%;
|
||||||
|
background-color: #242424;
|
||||||
|
border-top-left-radius: 10px;
|
||||||
|
border-top-right-radius: 10px;
|
||||||
|
position: relative;
|
||||||
|
display: flex;
|
||||||
|
flex-direction: column;
|
||||||
|
}
|
||||||
.dvideo-concent{
|
.dvideo-concent{
|
||||||
font-size: 26rpx;
|
font-size: 26rpx;
|
||||||
color: #666;
|
color: #666;
|
||||||
|
@ -484,11 +717,6 @@
|
||||||
/* height: 100vh; */
|
/* height: 100vh; */
|
||||||
/* overflow: scroll; */
|
/* overflow: scroll; */
|
||||||
}
|
}
|
||||||
.scroll-Y {
|
|
||||||
width: 100%;
|
|
||||||
/* height: 700px;*/
|
|
||||||
background-color: #fff;
|
|
||||||
}
|
|
||||||
.top-view {
|
.top-view {
|
||||||
width:100%;
|
width:100%;
|
||||||
background-color: #fff;
|
background-color: #fff;
|
||||||
|
@ -524,8 +752,8 @@
|
||||||
word-break: break-all;
|
word-break: break-all;
|
||||||
}
|
}
|
||||||
.data-list{
|
.data-list{
|
||||||
width: 200px;
|
width: 100%;
|
||||||
height: 200px;
|
/* height: 200px; */
|
||||||
position: relative;
|
position: relative;
|
||||||
margin: 10px 0px;
|
margin: 10px 0px;
|
||||||
}
|
}
|
||||||
|
@ -553,7 +781,7 @@
|
||||||
margin-top: 10px;
|
margin-top: 10px;
|
||||||
}
|
}
|
||||||
.scroll-list{
|
.scroll-list{
|
||||||
width: 95%;
|
width: 98%;
|
||||||
padding: 0px 10px;
|
padding: 0px 10px;
|
||||||
background-color: #fff;
|
background-color: #fff;
|
||||||
display: flex;
|
display: flex;
|
||||||
|
@ -586,13 +814,13 @@
|
||||||
margin-left: 15px;
|
margin-left: 15px;
|
||||||
color: #fff;
|
color: #fff;
|
||||||
}
|
}
|
||||||
/deep/.uni-scroll-view-content{
|
/* /deep/.uni-scroll-view-content{
|
||||||
width: 100%;
|
width: 100%;
|
||||||
height: 100%;
|
height: 100%;
|
||||||
display: flex;
|
display: flex;
|
||||||
flex-direction: column;
|
flex-direction: column;
|
||||||
align-items: center;
|
align-items: center;
|
||||||
}
|
} */
|
||||||
.guanbi{
|
.guanbi{
|
||||||
width: 30px;
|
width: 30px;
|
||||||
height: 30px;
|
height: 30px;
|
||||||
|
@ -610,17 +838,15 @@
|
||||||
width: 100%;
|
width: 100%;
|
||||||
height: 100%;
|
height: 100%;
|
||||||
}
|
}
|
||||||
.data-list{
|
|
||||||
width:100%;
|
|
||||||
height: 162px;
|
|
||||||
}
|
|
||||||
.videoHovers{
|
.videoHovers{
|
||||||
width: 60px;
|
width: 60px;
|
||||||
height: 60px;
|
height: 60px;
|
||||||
position: absolute;
|
position: absolute;
|
||||||
top: 0px;
|
/* top: 0px;
|
||||||
margin-top: 20%;
|
margin-top: 20%;
|
||||||
margin-left: 40%;
|
margin-left: 40%; */
|
||||||
|
top: 45%;
|
||||||
|
margin-left: 45%;
|
||||||
z-index: 99;
|
z-index: 99;
|
||||||
}
|
}
|
||||||
.videoHover{
|
.videoHover{
|
||||||
|
@ -737,4 +963,25 @@
|
||||||
display: flex;
|
display: flex;
|
||||||
flex-direction: row;
|
flex-direction: row;
|
||||||
}
|
}
|
||||||
|
.userInfo{
|
||||||
|
position: absolute;
|
||||||
|
bottom:110px;
|
||||||
|
right: 10px;
|
||||||
|
display: flex;
|
||||||
|
flex-direction: column;
|
||||||
|
z-index: 18;
|
||||||
|
}
|
||||||
|
.userAvatar{
|
||||||
|
border-radius: 500%;
|
||||||
|
border-style: solid;
|
||||||
|
border-width: 2px;
|
||||||
|
border-color: #ffffff;
|
||||||
|
width : 100rpx;
|
||||||
|
height: 100rpx;
|
||||||
|
}
|
||||||
|
.list-view{
|
||||||
|
display: flex;
|
||||||
|
flex-direction: column;
|
||||||
|
align-items: center;
|
||||||
|
}
|
||||||
</style>
|
</style>
|
Loading…
Reference in New Issue