Commit 6b4c4ac8 authored by Mac's avatar Mac

1

parent 5dd19d1f
...@@ -474,6 +474,10 @@ ...@@ -474,6 +474,10 @@
"path":"my-news"//我的动态 "path":"my-news"//我的动态
},{ },{
"path":"enlargevideo"//视频放大 "path":"enlargevideo"//视频放大
},{
"path":"mydetails"//动态详情
},{
"path":"friendcircle"//朋友圈
}] }]
}, },
//抖音商品短视频 //抖音商品短视频
......
...@@ -90,8 +90,98 @@ ...@@ -90,8 +90,98 @@
top:0; top:0;
font-size: 30px; font-size: 30px;
color: #FFFFFF; color: #FFFFFF;
}
.friendcircle .audios{
width: 500rpx;
height: 27px;
border-radius: 5px;
padding: 0 15px;
display: flex;
flex-direction: row;
align-items: center;
justify-content: space-between;
background: #EBEBEB;
}
.friendcircle .friendarea{
position: relative;
width: 100%;
background: #F5F5F5;
border-radius: 5px;
margin-top: 10px;
}
.friendcircle .sjx{
width: 0;
height: 0;
border-left: 6px solid transparent;
border-right: 6px solid transparent;
border-bottom: 8px solid #F5F5F5;
position: absolute;
left: 10px;
top:-6px;
}
.friendcircle .areagood{
width: 100%;
padding: 10px;
display: flex;flex-direction: row;
align-items: flex-start;
}
.areagood-r{
width: 1;
flex:1;
margin-left: 10px;
}
.friendcircle .comment{
width: 100%;
height: 55px;
padding: 0 15px;
display: flex;
flex-direction: row;
align-items: center;
justify-content: space-between;
position: fixed;
left: 0;
bottom: 0;
background: #FFF;
z-index: 9;
}
.friendcircle .comment-pl{
width: 56px;
height: 26px;
font-size: 13px;
color: #FFF;
display: flex;
align-items: center;
justify-content: center;
border-radius: 3px;
} }
.friendcircle .commentinput{
width: calc(100vw - 120px);
height: 30px;
background: #F3FAF8;
border-radius: 15px;
font-size: 13px;
padding: 0 10px;
}
.friendcircle .comment-list{
width: 100%;
}
.popup-box{
width: 100%;
border-top-right-radius: 8px;
border-top-left-radius: 8px;
background: #FFF;
}
.popup-box-item{
width: 100%;
height: 40px;
border-bottom: 1px solid #E7E7E7;
display: flex;
align-items: center;
justify-content: center;
}
</style> </style>
<template> <template>
<div class='friendcircle'> <div class='friendcircle'>
...@@ -100,8 +190,9 @@ ...@@ -100,8 +190,9 @@
height: calc(100vh);width: calc(100vw) height: calc(100vh);width: calc(100vw)
overflow: hidden; overflow: hidden;
"> ">
<scroll-view :scroll-y="true" :enable-back-to-top="true" :enable-flex="true" @scrolltolower="lower" :style="{ height: '100%' }"> <scroll-view :scroll-y="true" :enable-back-to-top="true" :enable-flex="true" @scroll='inputscroll' @scrolltolower="lower"
<view class="ftBox" v-for="(x, i) in g" :key="i" > :style="{ height: '100%' }">
<view class="ftBox" v-for="(x, i) in g" :key="i">
<view class="ftBox-left"> <view class="ftBox-left">
<u-avatar :src="x.crearteEmPhoto" size='80' mode="square"></u-avatar> <u-avatar :src="x.crearteEmPhoto" size='80' mode="square"></u-avatar>
</view> </view>
...@@ -109,36 +200,35 @@ ...@@ -109,36 +200,35 @@
<view class="text" style="font-size: 14px;font-weight: bold;margin-bottom: 5px;">{{x.createEmName}}</view> <view class="text" style="font-size: 14px;font-weight: bold;margin-bottom: 5px;">{{x.createEmName}}</view>
<view class="text2" style="font-size: 14px;margin-bottom: 5px;">{{x.content}}</view> <view class="text2" style="font-size: 14px;margin-bottom: 5px;">{{x.content}}</view>
<!-- 图片模式 --> <!-- 图片模式 -->
<view class="imgmode" v-if="x.fileType==1" > <view class="imgmode" v-if="x.fileType==1">
<view v-if="x.files.length==1" style="width: 150px;height:200px;margin-bottom: 6px;" @click="previewImage(0,x.files)"> <view v-if="x.files.length==1" style="width: 150px;height:200px;margin-bottom: 6px;" @click="previewImage(0,x.files)">
<image :src="x.files[0]" mode="aspectFill" class="fileimg"></image> <image :src="x.files[0]" mode="aspectFill" class="fileimg"></image>
</view> </view>
<view v-if="x.files.length==2 || x.files.length==4" v-for="(item, iq) in x.files" :key="iq" <view v-if="x.files.length==2 || x.files.length==4" v-for="(item, iq) in x.files" :key="iq" @click="previewImage(iq,x.files)"
@click="previewImage(iq,x.files)"
style="width: 240rpx;height:240rpx;margin-bottom: 6px;margin-right: 6px;"> style="width: 240rpx;height:240rpx;margin-bottom: 6px;margin-right: 6px;">
<image :src="item" mode="aspectFill" class="fileimg"></image> <image :src="item" mode="aspectFill" class="fileimg"></image>
</view> </view>
<view v-if="(x.files.length==3 || x.files.length>4) && iq<9" v-for="(item, iq) in x.files" :key="iq" <view v-if="(x.files.length==3 || x.files.length>4) && iq<9" v-for="(item, iq) in x.files" :key="iq" @click="previewImage(iq,x.files)"
@click="previewImage(iq,x.files)"
style="width: 160rpx;height:160rpx;margin-bottom: 6px;margin-right: 6px;position: relative;"> style="width: 160rpx;height:160rpx;margin-bottom: 6px;margin-right: 6px;position: relative;">
<image :src="item" mode="aspectFill" class="fileimg" ></image> <image :src="item" mode="aspectFill" class="fileimg"></image>
<view class="imgc" v-if="iq==8 && x.files.length>9"> <view class="imgc" v-if="iq==8 && x.files.length>9">
9+ 9+
</view> </view>
</view> </view>
</view> </view>
<view class="imgmode" v-if="x.fileType==2"> <view class="imgmode" v-if="x.fileType==2">
<view style="width: 100px;height:120px;margin-bottom: 6px;position: relative;" > <view style="width: 100px;height:120px;margin-bottom: 6px;position: relative;">
<video id="myVideo" :src="x.files[0]" style="width: 100%;height: 100%;" :controls='false' <video id="myVideo" :src="x.files[0]" style="width: 100%;height: 100%;" :controls='false' :show-center-play-btn='false'></video>
:show-center-play-btn='false'></video>
<view style="width: 100%;height: 100%;position: absolute;left: 0;top: 0;display: flex;align-items: center;justify-content: center;" <view style="width: 100%;height: 100%;position: absolute;left: 0;top: 0;display: flex;align-items: center;justify-content: center;"
@click="enlarge(x.files[0])"> @click="enlarge(x.files[0])">
<u-icon name="play-circle-o" :size="50" color="#FFF"></u-icon> <u-icon name="play-circle-o" :size="50" color="#FFF"></u-icon>
</view> </view>
</view> </view>
</view> </view>
<view> <view v-if="x.fileType==3" class="audios">
<view class="andiostyle" @click.stop="playVoice(x)">
<image src="https://viitto-1301420277.cos.ap-chengdu.myqcloud.com/Static/Sound.png" mode="widthFix" style="width: 19px;height: auto;"></image>
</view>
</view> </view>
<view class="r-sj"> <view class="r-sj">
<text>{{x.createTime}}</text> <text>{{x.createTime}}</text>
...@@ -159,20 +249,63 @@ ...@@ -159,20 +249,63 @@
<text> <text>
评论 评论
</text> </text>
</view>
</view>
</view>
<view class="friendarea" v-if="(x.likeList && x.likeList.length>0) || x.commentList && x.commentList.length>0">
<!-- //三角形 -->
<view class="sjx"></view>
<view class="areagood" v-if=" x.likeList.length>0" :style="{'border-bottom':x.commentList.length>0?'1px solid rgb(226, 226, 226)':0}">
<u-icon name="like-o" :size="30" color="#737373"></u-icon>
<view class="areagood-r text">
<text v-for="(item, iq) in x.likeList" :key="iq">{{item.empName}}{{x.likeList.length!=iq+1?'、':''}}</text>
</view>
</view> </view>
<view class="areagood" v-if=" x.commentList.length>0">
<u-icon name="comment-o" :size="30" color="#737373" style='margin-top: 2px;'></u-icon>
<view class="areagood-r">
<view v-for="(item, iq) in x.commentList" :key="iq" style="width: 100%;margin-bottom: 10px;" @click="huifu(x,i,item,iq)">
<view class="text comment-list">
{{item.empName}}
<text style="color: #333333;margin: 0 3px;" v-if="item.byReplayEmpId>0">回复</text>
{{item.byReplayEmpId>0?item.byReplayEmpName:''}}
</view> </view>
<view class="text2">{{item.content}}</view>
</view> </view>
</view> </view>
</view> </view>
</view>
</view>
</view>
<!-- 输入框 -->
<view class="comment" v-if="focu==true">
<input type="text" v-model="commentMsg.Content" :placeholder='placeholder' class="commentinput" :focus='focu'>
<view class="comment-pl" :style="{background:mainColor}" @click="addComment">评论</view>
</view>
<u-loadmore :status="status" :load-text="loadText" :font-size="24" :margin-top="20" :margin-bottom="20" bg-color="#FFF" /> <u-loadmore :status="status" :load-text="loadText" :font-size="24" :margin-top="20" :margin-bottom="20" bg-color="#FFF" />
</scroll-view> </scroll-view>
</view> </view>
<auth v-if="showAuth" @changeuserinfo="reloadUserinfo" @gbAuth='gbAuth'></auth> <auth v-if="showAuth" @changeuserinfo="reloadUserinfo" @gbAuth='gbAuth'></auth>
<u-popup v-model="show" mode="bottom" border-radius='14'>
<view class="popup-box">
<view class="popup-box-item" @click="paste()">
复制
</view>
<view class="popup-box-item" @click="mydelete()">
删除
</view>
<view style="width: 100%;height: 10px;background: #E7E7E7;"></view>
<view class="popup-box-item" @click="show=false" style="height: 45px;">
取消
</view>
</view> </view>
</u-popup>
</view>
</div> </div>
</template> </template>
...@@ -190,9 +323,9 @@ ...@@ -190,9 +323,9 @@
msg: { msg: {
pageIndex: 1, pageIndex: 1,
pageSize: 15, pageSize: 15,
UserTeacher:0, UserTeacher: 0,
CreateBy:'', CreateBy: '',
UserId:0, UserId: 0,
}, },
mainColor: "", mainColor: "",
secondary: '', secondary: '',
...@@ -210,6 +343,17 @@ ...@@ -210,6 +343,17 @@
windowWidth: 0, windowWidth: 0,
nowbofo: false, nowbofo: false,
placeholder: '评论',
focu: false, //是否获取焦点
commentMsg: {
ArticleId: 0,
CommentId: 0,
Content: '',
},
choiceId: 0,//保存评论和点赞时候的id
show:false,
user:'',//点击用户保存的数据
} }
}, },
created() { created() {
...@@ -218,7 +362,7 @@ ...@@ -218,7 +362,7 @@
this.secondary = this.$uiConfig.secondary; this.secondary = this.$uiConfig.secondary;
this.pricecolor = this.$uiConfig.pricecolor; this.pricecolor = this.$uiConfig.pricecolor;
this.windowWidth = this.$utils.SystemInfo().windowWidth; this.windowWidth = this.$utils.SystemInfo().windowWidth;
this.msg.UserId=uni.getStorageSync("mall_UserInfo").UserId ? uni.getStorageSync("mall_UserInfo").UserId :0; this.msg.UserId = uni.getStorageSync("mall_UserInfo").UserId ? uni.getStorageSync("mall_UserInfo").UserId : 0;
}, },
mounted() { mounted() {
let currentPages = getCurrentPages(); let currentPages = getCurrentPages();
...@@ -317,15 +461,135 @@ ...@@ -317,15 +461,135 @@
gbAuth() { gbAuth() {
uni.navigateBack() uni.navigateBack()
}, },
getdian(x,i){//点击点点 getdian(x, i) { //点击点点
this.g[i].dianshow = !this.g[i].dianshow; this.g[i].dianshow = !this.g[i].dianshow;
this.$forceUpdate() this.$forceUpdate()
}, },
dianzan(x,i){//点赞 dianzan(x, i) { //点赞
this.choiceId = x.id;
let url = '';
if (x.hasLike == false) {
url = '/api/AppletEducation/DynamicLike'
} else {
url = '/api/AppletEducation/DynamicCancelLike'
}
this.request2({
url: url,
data: {
articleId: x.id
}
}, },
pinglun(x,i){//评论 res => {
if (res.resultCode == 1) {
this.g[i].hasLike = !this.g[i].hasLike;
this.g[i].dianshow = false; //隐藏按钮
this.init2(1)
}
}
);
},
pinglun(x, i) { //评论
this.focu = true;
this.choiceId = x.id;
this.$forceUpdate()
this.g[i].dianshow = false; //隐藏按钮
this.commentMsg = {
ArticleId: x.id,
CommentId: 0,
Content: '',
}
},
inputscroll() { //滚动时触发
//初始化内容
this.focu = false;
this.commentMsg.Content = '';
this.placeholder = '评论';
},
huifu(x,i,item,iq){
this.user={
x:x,
i:i,
item:item,
iq:iq,
}
if(this.msg.UserId == this.user.item.empId){//自己点自己的时候处理
this.show=true
}
},
mydelete(){//删除自己的回复
this.request2({
url: '/api/AppletEducation/DynamicDeleteComment',
data: {commentId:this.user.item.commentId}
},
res => {
if (res.resultCode == 1) {
this.g[this.user.i].commentList.splice(this.user.iq,1)
uni.showToast({
title: res.message,
icon: 'none',
duration: 2000
});
this.show = false;
}
}
);
},
addComment() {
if (this.commentMsg.Content == '') {
uni.showToast({
title: '请输入评论',
icon: 'none',
duration: 2000
});
return
}
this.request2({
url: '/api/AppletEducation/DynamicComment',
data: this.commentMsg
},
res => {
if (res.resultCode == 1) {
this.focu = false;
this.commentMsg.Content = '';
this.placeholder = '评论';
this.init2(2)
}
}
);
},
init2(type) { //根据id去查询当前的数据 只更新当前数据
this.request2({
url: '/api/AppletSchool/DynamicList',
data: {
pageIndex: 1,
pageSize: 1,
UserTeacher: 0,
CreateBy: '',
UserId: 0,
Id: this.choiceId
}
},
res => {
if (res.resultCode == 1) {
this.g.forEach((x, j) => {
if (res.data.pageData[0].id == x.id) {
if (type == 2) { //评论
this.g[j].commentList = res.data.pageData[0].commentList
} else if (type == 1) { //点赞
this.g[j].likeList = res.data.pageData[0].likeList;
}
}
})
}
}
);
}, },
//图片预览 //图片预览
previewImage(index, images) { previewImage(index, images) {
...@@ -334,11 +598,16 @@ ...@@ -334,11 +598,16 @@
current: index, current: index,
}); });
}, },
enlarge(file){ enlarge(file) {
uni.navigateTo({ uni.navigateTo({
url: '/pages/friendcircle/enlargevideo?file=' + file url: '/pages/friendcircle/enlargevideo?file=' + file
}) })
} },
paste(){//复制
uni.setClipboardData({
data: this.user.item.content,
});
},
} }
} }
......
...@@ -442,7 +442,7 @@ ...@@ -442,7 +442,7 @@
url: '/pages/friendcircle/mydetails?ID=' + x.id url: '/pages/friendcircle/mydetails?ID=' + x.id
}) })
innerAudioContext.stop(); innerAudioContext.stop();
} },
} }
} }
</script> </script>
...@@ -44,14 +44,14 @@ ...@@ -44,14 +44,14 @@
<u-empty text="没有找到商品信息" font-size="36" mode="list" ></u-empty> <u-empty text="没有找到商品信息" font-size="36" mode="list" ></u-empty>
</view> </view>
<!-- <view class="quick" v-if="!loading"> <view class="quick" v-if="!loading">
<view class="item"> <!-- <view class="item">
<u-icon name="cart-o" size="48" color="#333" /> <u-icon name="cart-o" size="48" color="#333" />
</view> </view> -->
<view class="item" @click="goTop"> <view class="item" @click="goTop">
<u-icon name="arrow-up" size="48" color="#333" /> <u-icon name="arrow-up" size="48" color="#333" />
</view> </view>
</view> --> </view>
</view> </view>
</template> </template>
......
...@@ -185,7 +185,9 @@ ...@@ -185,7 +185,9 @@
educationteacher educationteacher
}, },
onLoad(options) { onLoad(options) {
uni.navigateTo({
url: '/pages/friendcircle/friendcircle'
})
let that = this; let that = this;
uni.getSystemInfo({ uni.getSystemInfo({
success(res) { success(res) {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment