|
@@ -1,6 +1,6 @@
|
|
|
<template>
|
|
|
<view class="my-praise-box">
|
|
|
- <view class="" v-show="tagNum == 0">
|
|
|
+ <view class="" v-show="false">
|
|
|
<view class="publish-box" v-show="publishBoxOff">
|
|
|
<image class="publish-img sys-radius-12" src="/static/img/circle/1.png" mode=""></image>
|
|
|
<view class="publish-text">
|
|
@@ -19,12 +19,12 @@
|
|
|
</view>
|
|
|
</view>
|
|
|
</view>
|
|
|
-
|
|
|
- <scroll-view class="recommended-box" scroll-x="true" v-show="tagNum == 2">
|
|
|
+
|
|
|
+ <scroll-view class="recommended-box" scroll-x="true" v-show="false">
|
|
|
<view class="recommended-list" v-for="(item,i) in listTwo" :key="i" @click="goRecommended">
|
|
|
<image class="recommended-list-img sys-radius-16" :src="item.img" mode=""></image>
|
|
|
<view class="recommended-list-name">
|
|
|
- <image class="list-name-img" src="../../../static/dgex-tantan/like.png" mode=""></image>
|
|
|
+ <image class="list-name-img" src="/static/dgex-tantan/like.png" mode=""></image>
|
|
|
<view class="sys-color-white sys-size-28">
|
|
|
{{item.text}}
|
|
|
</view>
|
|
@@ -43,43 +43,43 @@
|
|
|
</view>
|
|
|
</view>
|
|
|
</scroll-view>
|
|
|
-
|
|
|
+
|
|
|
<view class="praise-item" @click="goToDetails" v-for="(item,itemIndex) in list">
|
|
|
<view class="praise-left">
|
|
|
- <image class="praise-head" src="/static/img/temporary/3.png" mode="aspectFill"></image>
|
|
|
+ <image class="praise-head" :src="item.avatar" mode="aspectFill"></image>
|
|
|
</view>
|
|
|
<view class="praise-right">
|
|
|
<view class="praise-top-data">
|
|
|
<view class="praise-top-left">
|
|
|
<view class="praise-top-left-title">
|
|
|
- <view class="left-title-text sys-height-44 sys-color-black sys-weight-600">WWWWW</view>
|
|
|
+ <view class="left-title-text sys-height-44 sys-color-black sys-weight-600">{{item.nickname}}</view>
|
|
|
<view class="left-title-vip">
|
|
|
<image class="left-title-vip-img" src="/static/img/my/vip.png" mode="heightFix"></image>
|
|
|
</view>
|
|
|
|
|
|
</view>
|
|
|
- <view class="left-title-time sys-color-gray-9">2021-04-18 15:53发布.<100m</view>
|
|
|
+ <view class="left-title-time sys-color-gray-9">{{item.createdAt}}发布</view>
|
|
|
</view>
|
|
|
<view class="praise-top-right">
|
|
|
- <call></call>
|
|
|
+ <call :user-id="item.userId"></call>
|
|
|
</view>
|
|
|
</view>
|
|
|
|
|
|
<view class="right-text sys-color-black sys-weight-400">
|
|
|
- 我是阳光大男孩
|
|
|
+ {{item.content}}
|
|
|
</view>
|
|
|
<view class="right-img">
|
|
|
- <view class="one-img" v-if="item.img.length===1">
|
|
|
- <img-one :file-list="item.img"></img-one>
|
|
|
+ <view class="one-img" v-if="item.galleryUrls.length===1">
|
|
|
+ <img-one :file-list="item.galleryUrls"></img-one>
|
|
|
</view>
|
|
|
- <view class="two-img" v-else-if="item.img.length===2 || item.img.length===4">
|
|
|
- <img-two :file-list="item.img"></img-two>
|
|
|
+ <view class="two-img" v-else-if="item.galleryUrls.length===2 || item.galleryUrls.length===4">
|
|
|
+ <img-two :file-list="item.galleryUrls"></img-two>
|
|
|
</view>
|
|
|
<view class="three-img" v-else>
|
|
|
- <img-three :file-list="item.img"></img-three>
|
|
|
+ <img-three :type="2" :file-list="item.galleryUrls"></img-three>
|
|
|
</view>
|
|
|
</view>
|
|
|
- <view class="right-tag-list" >
|
|
|
+ <view class="right-tag-list" v-if="false" >
|
|
|
<dynamic-tag :list="item.tag" :tag-bg="tagBg" :tag-color="tagColor"></dynamic-tag>
|
|
|
</view>
|
|
|
<view class="right-operation-list">
|
|
@@ -92,14 +92,14 @@
|
|
|
<view class="operation-items">
|
|
|
<view class="operation-item">
|
|
|
<view class="operation-icon" @click="setLike(itemIndex)">
|
|
|
- <text class="iconfont icon-dianzan" v-if="!item.isLike" :style="{'color':operateColor}"> </text>
|
|
|
+ <text class="iconfont icon-dianzan" v-if="!item.liked" :style="{'color':operateColor}"> </text>
|
|
|
<text class="iconfont icon-dianzan1" v-else :style="{'color':'#ED301D'}"> </text>
|
|
|
</view>
|
|
|
- <view class="operation-text sys-weight-400" :style="{'color':operateColor}">{{item.likeNum>0?item.likeNum:'点赞'}}</view>
|
|
|
+ <view class="operation-text sys-weight-400" :style="{'color':operateColor}">{{item.likeCount>0?item.likeCount:'点赞'}}</view>
|
|
|
</view>
|
|
|
<view class="operation-item">
|
|
|
<view class="operation-icon"><text class="iconfont icon-pinglun" :style="{'color':operateColor}"></text></view>
|
|
|
- <view class="operation-text sys-weight-400" :style="{'color':operateColor}">{{item.evaluateNum>0?item.evaluateNum:'评论'}}</view>
|
|
|
+ <view class="operation-text sys-weight-400" :style="{'color':operateColor}">{{item.commentCount>0?item.commentCount:'评论'}}</view>
|
|
|
</view>
|
|
|
</view>
|
|
|
|
|
@@ -117,6 +117,9 @@ import ImgTwo from "@/pages/common/img/img-two";
|
|
|
import ImgThree from "@/pages/common/img/img-three";
|
|
|
import DynamicTag from "@/pages/common/tag/dynamic-tag";
|
|
|
import Call from "@/pages/common/call/call";
|
|
|
+import {setLike, setUnLike} from "@/api/community";
|
|
|
+import {getMyLikeMoments, getMyMoments} from "@/api/my";
|
|
|
+import tools from "@/service/tools";
|
|
|
export default {
|
|
|
name: "my-praise",
|
|
|
components: {Call, DynamicTag, ImgThree, ImgTwo, ImgOne},
|
|
@@ -129,35 +132,59 @@ export default {
|
|
|
tagColor:'#999999',
|
|
|
operateColor:'#999999',
|
|
|
list:[
|
|
|
- {'text':'我是阳光大男孩我','img':['/static/img/temporary/1.png'],'tag':[{'text':'南亭新都会商场','icon':'1'},{'text':'你好认识一哈','icon':'2'}],'likeNum':1,'evaluateNum':0,'isLike':true},
|
|
|
- {'text':'我是阳光大男孩我','img':['/static/img/temporary/1.png','/static/img/temporary/2.png','/static/img/temporary/3.png','/static/img/temporary/2.png'],'tag':[{'text':'南亭新都会商场','icon':'1'},{'text':'你好认识一哈','icon':'2'}],'likeNum':0,'evaluateNum':20,'isLike':false},
|
|
|
- {'text':'我是阳光大男孩我','img':[
|
|
|
- '/static/img/temporary/1.png',
|
|
|
- '/static/img/temporary/3.png',
|
|
|
- '/static/img/temporary/2.png',
|
|
|
- '/static/img/temporary/1.png',
|
|
|
- '/static/img/temporary/3.png',
|
|
|
- '/static/img/temporary/2.png',
|
|
|
- ],'tag':[{'text':'南亭新都会商场','icon':'1'},{'text':'你好认识一哈','icon':'2'}],'likeNum':10,'evaluateNum':20,'isLike':true},
|
|
|
+
|
|
|
],
|
|
|
listTwo:[
|
|
|
- {'text':'24h照片营业馆','img':'/static/img/temporary/1.png','icon':['/static/img/temporary/1.png','/static/img/temporary/1.png'],'num':'815.4w'},
|
|
|
- {'text':'24h照片营业馆','img':'/static/img/temporary/1.png'},{'img':'/static/img/login/2.jpg','text':'24h照片营业馆'},{'img':'/static/img/login/2.jpg','text':'24h照片营业馆'},
|
|
|
+
|
|
|
],
|
|
|
- publishBoxOff:true
|
|
|
+ publishBoxOff:true,
|
|
|
+ isAjax:false,
|
|
|
+ total:undefined,
|
|
|
+ page:1,
|
|
|
}
|
|
|
},
|
|
|
watch: {},
|
|
|
mounted() {
|
|
|
-
|
|
|
+ this.startList()
|
|
|
},
|
|
|
methods: {
|
|
|
+ startList(){
|
|
|
+ if(this.userId<=0){
|
|
|
+ // return false
|
|
|
+ }
|
|
|
+ this.list=[]
|
|
|
+ this.isAjax=false
|
|
|
+ this.total=undefined
|
|
|
+ this.page=1
|
|
|
+ this.getMyLikeMoments()
|
|
|
+
|
|
|
+ },
|
|
|
+ getMyLikeMoments(){
|
|
|
+ if(this.isAjax){
|
|
|
+ return
|
|
|
+ }
|
|
|
+ this.isAjax=true
|
|
|
+ let that=this
|
|
|
+ getMyLikeMoments({'userId':this.userId,'pageNo':this.page,'pageSize':20}).then((res)=>{
|
|
|
+ this.isAjax=false
|
|
|
+ if(res.code===0){
|
|
|
+ res.data.data.forEach((item)=>{
|
|
|
+ item.dateArr=tools.getDateArr(item.createdAt)
|
|
|
+ that.list.push(item )
|
|
|
+ })
|
|
|
+ ++that.page
|
|
|
+ that.total=res.data.total
|
|
|
+ }
|
|
|
+ })
|
|
|
+ },
|
|
|
setLike(index){
|
|
|
- this.list[index].isLike=!this.list[index].isLike
|
|
|
- if(this.list[index].isLike){
|
|
|
- ++this.list[index].likeNum
|
|
|
+ this.list[index].liked=!this.list[index].liked
|
|
|
+ if(this.list[index].liked){
|
|
|
+ ++this.list[index].likeCount
|
|
|
+ setLike( this.list[index].id).then((res)=>{})
|
|
|
}else {
|
|
|
- --this.list[index].likeNum
|
|
|
+ --this.list[index].likeCount
|
|
|
+ setUnLike( this.list[index].id).then((res)=>{})
|
|
|
}
|
|
|
},
|
|
|
goToDetails(){
|
|
@@ -191,30 +218,30 @@ export default {
|
|
|
position: relative;
|
|
|
align-items: center;
|
|
|
box-sizing: border-box;
|
|
|
-
|
|
|
+
|
|
|
.publish-img {
|
|
|
width: 120rpx;
|
|
|
height: 120rpx;
|
|
|
flex-shrink: 0;
|
|
|
}
|
|
|
-
|
|
|
+
|
|
|
.publish-text {
|
|
|
.publish-title {
|
|
|
margin: 0 0 8rpx 0;
|
|
|
}
|
|
|
}
|
|
|
-
|
|
|
+
|
|
|
.publish-button {
|
|
|
flex-shrink: 0;
|
|
|
padding: 6rpx 32rpx;
|
|
|
}
|
|
|
-
|
|
|
+
|
|
|
.off-button {
|
|
|
position: absolute;
|
|
|
right: 0;
|
|
|
top: 0;
|
|
|
padding: 0rpx 2rpx 6rpx 12rpx;
|
|
|
-
|
|
|
+
|
|
|
.off-img {
|
|
|
width: 24rpx;
|
|
|
height: 24rpx;
|