10
This commit is contained in:
@@ -1,7 +1,14 @@
|
||||
<template>
|
||||
<view class="content" id="content">
|
||||
<u-navbar bgColor="transparent" title="朋友圈" title-size="36" leftIconColor="#fff"
|
||||
:titleStyle ="{color:'#fff'}" :title-bold="true" :border-bottom="false">
|
||||
<u-navbar
|
||||
@leftClick="goto('/pages/workbench/index/index')"
|
||||
bgColor="transparent"
|
||||
title="朋友圈"
|
||||
title-size="36"
|
||||
leftIconColor="#fff"
|
||||
:titleStyle ="{color:'#fff'}"
|
||||
:title-bold="true"
|
||||
:border-bottom="false">
|
||||
<view slot="right" class="u-margin-right-20" @click="showTypeSheet"
|
||||
@longpress="linkToRelease({releaseType:0})">
|
||||
<u-icon name="camera" color="#fff" size="32"></u-icon>
|
||||
@@ -18,22 +25,21 @@
|
||||
|
||||
<MyAvatar class="headimg" :src="selfInfo.faceURL" :desc="selfInfo.nickname || selfInfo.remark"
|
||||
:isGroup="Boolean(selfInfo.groupID)" size="66" @tap="linkToBusinessCard(selfInfo.userID)" />
|
||||
<text class="nickname">{{ selfInfo.nickname || self.remark }}</text>
|
||||
<text class="nickname">{{ selfInfo.nickname || selfInfo.remark }}</text>
|
||||
</view>
|
||||
<!-- 个性签名 -->
|
||||
<view class="signature">
|
||||
<view class="">{{ selfInfo.bio }}</view>
|
||||
</view>
|
||||
|
||||
<view class="u-m-t-20 u-m-b-30 u-flex u-row-center u-col-center" v-if="vuex_friendCircleUnreadCount>0">
|
||||
<view class="u-flex u-row-left u-col-center" @click="clearUnReadCount()"
|
||||
style="width: 300rpx;height:70rpx;background-color: #333333;color: #ffffff;border-radius:10rpx;">
|
||||
<view v-if="vuex_friendCircleUnreadCount>0" style="display: flex;justify-content: center;">
|
||||
<view @click="clearUnReadCount()"
|
||||
style="width: 300rpx;height:70rpx;line-height:70rpx;background-color: #333333;color: #ffffff;border-radius:10rpx;display: flex;align-items: center;">
|
||||
<view style="width:80rpx;padding:0 10rpx;">
|
||||
<MyAvatar class="headimg" :src="selfInfo.faceURL" :desc="selfInfo.nickname || selfInfo.remark"
|
||||
:isGroup="Boolean(selfInfo.groupID)" size="66"/>
|
||||
<MyAvatar :src="selfInfo.faceURL" class="headimg" desc=" " size="24"/>
|
||||
</view>
|
||||
<view style="width:220rpx;text-align: center;">
|
||||
<text>{{vuex_friendCircleUnreadCount}}条新信息</text>
|
||||
<view style="flex:1;">
|
||||
{{vuex_friendCircleUnreadCount}}条新信息
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
@@ -42,107 +48,9 @@
|
||||
<view class="content-circle">
|
||||
<!-- circleData是vuex变量,不在本页面定义 -->
|
||||
<template v-if="circleData!=null&&circleData.length>0">
|
||||
<view class="content-circle-box" v-for="(item, index) in circleData" :key="index" :index="index">
|
||||
<view @tap="linkToBusinessCard(item.user_id)">
|
||||
<MyAvatar :src="item.user.avatar" :desc="item.user.nickname || item.user.id" :isGroup="false" size="66"></MyAvatar>
|
||||
</view>
|
||||
<view class="content">
|
||||
<view class="content-name" @tap="linkToBusinessCard(item.user_id)">{{ item.user.nickname || item.user.remark }}</view>
|
||||
<view class="content-desc">{{ item.body }}</view>
|
||||
<!-- 图片,视频 -->
|
||||
<view class="content-img" v-if="item.files!=null&&item.files.length>0">
|
||||
<!-- //只有一张图时候 -->
|
||||
<view v-if="item.files.length==1&&item.releaseType==1" class="u-flex u-row-left u-col-center"
|
||||
style="width:100%;min-height: 200rpx;">
|
||||
<u-image width="280rpx" :src="cdn(item.files[0])" mode="widthFix"
|
||||
@tap="previewImg(0, item)">
|
||||
<u-loading slot="loading"></u-loading>
|
||||
<view slot="error" class="u-flex u-row-left u-col-center"
|
||||
style="font-size: 24rpx;width: 200rpx;height: 100rpx;margin-top: -50rpx;">
|
||||
<u-icon name="photo" size="100" label="加载失败" label-pos="bottom"></u-icon>
|
||||
</view>
|
||||
</u-image>
|
||||
</view>
|
||||
<!-- 有多张图的时候 -->
|
||||
<view v-if="item.files.length > 1&&item.releaseType==1">
|
||||
<view class="content-img-more u-m-b-20">
|
||||
<u-grid :col="3" :border="false" hover-class="none">
|
||||
<u-grid-item v-for="(src, index) in item.files" :index="index" :custom-style="girdItemCustomStyle">
|
||||
<view @tap="previewImg(index, item)" class="slot-btn">
|
||||
<u-image :src="cdn(src)" width="180rpx" height="180rpx" mode="aspectFill" border-radius="10"></u-image>
|
||||
</view>
|
||||
</u-grid-item>
|
||||
</u-grid>
|
||||
</view>
|
||||
</view>
|
||||
|
||||
|
||||
<!-- 视频 -->
|
||||
<view class="u-m-b-30 u-m-t-30 u-flex u-row-left u-col-center"
|
||||
v-if="item.fileList.length > 0&&item.releaseType==2" @tap="previewImg(0, item)">
|
||||
<view v-if="vuex_OSPlat=='ios'">
|
||||
<u-image width="280rpx" :src="getVideoPoster(item.fileList[0])" mode="widthFix">
|
||||
<u-loading slot="loading"></u-loading>
|
||||
</u-image>
|
||||
</view>
|
||||
<view v-else class="u-flex u-row-center u-col-center"
|
||||
style="border: 1rpx solid #36648b;width:280rpx;height:120rpx;border-radius: 16rpx;">
|
||||
<u-icon name="play-circle" size="48" color="#36648b"
|
||||
label="点击查看视频" label-pos="bottom"></u-icon>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
|
||||
<!-- 地点 -->
|
||||
<view v-if="(item.address&&item.address.chooseFlag)==true" class="u-line-2 u-m-t-10 u-m-b-10" style="font-size: 30rpx;color: #36648b;">
|
||||
<u-icon name="map" color="#36648b" size="30" :custom-style="{marginLeft:'-4rpx'}"></u-icon>
|
||||
<text> {{ item.address.name}}</text>
|
||||
</view>
|
||||
|
||||
<!-- 相对时间 点赞按钮等 -->
|
||||
<view class="relavivetime" :id="`comment-${'null'}-${index}`">
|
||||
<view class="time u-flex u-col-center">
|
||||
<view>{{ item.created_at }}</view>
|
||||
<view @click="deleteCircle(item,index)" style="color:#36648b;margin-left: 20rpx;" v-if="item.user_id==selfInfo.userID">删除</view>
|
||||
</view>
|
||||
|
||||
<view class="icon-box u-flex u-row-between u-col-center">
|
||||
<view @tap="clickThumb(item,index)" class="u-m-r-6 u-p-t-4">
|
||||
<u-icon v-if="item.isPraise==false" size="38" name="heart" color="#36648b"></u-icon>
|
||||
<u-icon v-if="item.isPraise==true" size="38" name="heart-fill" color="#36648b"></u-icon>
|
||||
</view>
|
||||
<view @tap="handleComment(item.id, null, index)" class="u-m-l-6 u-p-t-2">
|
||||
<u-icon size="40" name="chat" color="#36648b"></u-icon>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
|
||||
<!-- 点赞人 评论 -->
|
||||
<view class="msg-box">
|
||||
<view class="thumbinfo u-border-bottom" v-if="item.praise!=null&&item.praise.length">
|
||||
<uni-icons size="30" type="heart" color="#36648b" class="u-m-r-10"></uni-icons>
|
||||
<text class="thumbinfo-name" v-for="(userInfo, pindex) in item.praise" :index="pindex"
|
||||
:key="pindex" @tap="linkToBusinessCard(userInfo.userId)">
|
||||
{{ userInfo.nickame }}{{ pindex != item.praise.length - 1 ? ',' : '' }}
|
||||
</text>
|
||||
</view>
|
||||
<view class="comment" v-if="item.comments!=null&&item.comments.length">
|
||||
<view class="comment-box" v-for="(comment, commentIndex) in item.comments" :index="commentIndex"
|
||||
:key="commentIndex" hover-class="comment-hover-class"
|
||||
:id="`comment-${item.id}-${index}`"
|
||||
@tap="handleComment(item.id, comment, index)">
|
||||
<text class="comment-box-name" v-if="!comment.reply_user_id">{{ comment.replyUser.nickname }}:</text>
|
||||
<text class="comment-box-name" v-if="comment.reply_user_id">
|
||||
{{ comment.replyUser.nickname }}
|
||||
<text class="callback u-m-l-4 u-m-r-4">回复</text>
|
||||
</text>
|
||||
<text v-if="comment.reply_user_id" class="comment-box-name">{{ comment.replyUser.nickname }}:</text>
|
||||
<text class="comment-box-content">{{ comment.content }}</text>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
<template v-for="(item, index) in circleData" >
|
||||
<CircleItem :key="index" :index="index" :item="item"></CircleItem>
|
||||
</template>
|
||||
</template>
|
||||
<template v-else>
|
||||
<view style="margin-top: 30%;">
|
||||
@@ -259,11 +167,12 @@
|
||||
import {getFriendCircle} from "@/api/login.js"
|
||||
import UserBase from "@/components/User.vue"
|
||||
import MyAvatar from "@/components/MyAvatar/index.vue";
|
||||
import util from "@/util/index.js"
|
||||
import util from "@/util/index.js";
|
||||
import CircleItem from "./components/circleItem.vue"
|
||||
export default {
|
||||
name: 'firendCircle',
|
||||
mixins:[UserBase],
|
||||
components:{videoPlayer ,MyAvatar},
|
||||
components:{videoPlayer ,MyAvatar,CircleItem},
|
||||
computed: {
|
||||
selfInfo() {
|
||||
return this.$store.getters.storeSelfInfo;
|
||||
@@ -382,6 +291,7 @@
|
||||
},
|
||||
|
||||
methods: {
|
||||
goto:util.goto,
|
||||
clearUnReadCount(){
|
||||
this.$store.dispatch('circle/updateUnreadCount',0-this.vuex_friendCircleUnreadCount);
|
||||
},
|
||||
@@ -389,60 +299,6 @@
|
||||
getCircleDataList:function(param){
|
||||
let that=this;
|
||||
this.$store.dispatch('circle/getFriendCircleList',param);
|
||||
return ;
|
||||
getFriendCircle(param).then(res => {
|
||||
//console.log("朋友圈列表",res);
|
||||
let circleDataList=res.data;
|
||||
//console.log("朋友圈列表",circleDataList);
|
||||
if(circleDataList.length>0){
|
||||
that.loadMoreFlag=true;
|
||||
for (var i = 0; i < circleDataList.length; i++) {
|
||||
let item= circleDataList[i];
|
||||
if(item.userId==this.selfInfo.userID){
|
||||
item.userName="我";
|
||||
}
|
||||
if(item.address!=null&&item.address.length>0){
|
||||
item.address=JSON.parse(item.address);
|
||||
}
|
||||
if(item.fileList!=null&&item.fileList.length>0){
|
||||
item.fileList=JSON.parse(item.fileList);
|
||||
if(item.releaseType==2){
|
||||
|
||||
}
|
||||
}
|
||||
if(item.praise!=null){
|
||||
item.praise=JSON.parse(item.praise);
|
||||
}else{
|
||||
item.praise=[];
|
||||
}
|
||||
if(item.comment!=null&&item.comment.length>0){
|
||||
item.comment=JSON.parse(item.comment);
|
||||
}
|
||||
else{
|
||||
item.comment=[];
|
||||
}
|
||||
}
|
||||
}else{
|
||||
if(param.moreFlag==true){
|
||||
that.loadMoreFlag=false;
|
||||
}
|
||||
return;
|
||||
}
|
||||
//初始化列表
|
||||
if(param.moreFlag==false){
|
||||
console.log("初始化朋友圈列表",circleDataList.length);
|
||||
that.circleData = circleDataList;
|
||||
//that.$u.vuex('circleData', circleDataList);
|
||||
}
|
||||
//加载更多
|
||||
else{
|
||||
let oldList=that.circleData;
|
||||
let newList=oldList.concat(circleDataList);
|
||||
that.circleData = circleDataList;
|
||||
//that.$u.vuex('circleData', newList);
|
||||
console.log("加载更多朋友圈列表",newList);
|
||||
}
|
||||
})
|
||||
},
|
||||
|
||||
//滚动事件
|
||||
@@ -680,7 +536,7 @@
|
||||
tempFilePaths = res.tempFilePaths;
|
||||
let param = {
|
||||
releaseType: 1,
|
||||
tempFilePaths: JSON.stringify(tempFilePaths)
|
||||
tempFilePaths: tempFilePaths
|
||||
}
|
||||
that.linkToRelease(param);
|
||||
return;
|
||||
@@ -698,7 +554,7 @@
|
||||
tempFilePaths.push(filePath);
|
||||
let param = {
|
||||
releaseType: 2,
|
||||
tempFilePaths: JSON.stringify(tempFilePaths)
|
||||
tempFilePaths: tempFilePaths
|
||||
}
|
||||
that.linkToRelease(param);
|
||||
return;
|
||||
@@ -709,10 +565,19 @@
|
||||
},
|
||||
//点击自定义组件相机按钮
|
||||
linkToRelease(params) {
|
||||
uni.$u.route({
|
||||
url: '/pages/workbench/friend-circle/releaseFriendCircle',
|
||||
params: params
|
||||
});
|
||||
console.log(params);
|
||||
let url = "/pages/workbench/friend-circle/releaseFriendCircle?";
|
||||
for(let key in params){
|
||||
if(key!="tempFilePaths"){
|
||||
url+=key+"="+params[key]+"&";
|
||||
}
|
||||
}
|
||||
uni.navigateTo({
|
||||
url:url,
|
||||
success(res) {
|
||||
res.eventChannel.emit('successEvent',params);
|
||||
}
|
||||
})
|
||||
},
|
||||
getVideoPoster(videoSrc){
|
||||
console.log("video",videoSrc);
|
||||
|
||||
Reference in New Issue
Block a user