7.10 增加登录页面,事件详情接口对接,我的点赞,关注收藏页面搭建,接口对接
This commit is contained in:
@@ -9,42 +9,67 @@
|
||||
</view>
|
||||
</view>
|
||||
<view class="list fixed" :style="'top:'+listTop+'px;'">
|
||||
<view class="item">
|
||||
<view class="replyContentC">
|
||||
<view class="flex">
|
||||
<view class="flex1 flex">
|
||||
<image class="avatar" src="" mode="aspectFill"></image>
|
||||
<view class="flex1">
|
||||
<view class="replyNickname">逸尘破晓</view>
|
||||
<view class="time">2-15 15:37</view>
|
||||
<block v-if="selectTab==0">
|
||||
<view class="commentMeItem" v-for="(item,index) in commentList" :key="index">
|
||||
<view class="replyContentC">
|
||||
<view class="flex">
|
||||
<view class="flex1 flex">
|
||||
<image class="avatar" src="" mode="aspectFill"></image>
|
||||
<view class="flex1">
|
||||
<view class="replyNickname">逸尘破晓</view>
|
||||
<view class="time">2-15 15:37</view>
|
||||
</view>
|
||||
</view>
|
||||
<view class="reply">回复</view>
|
||||
</view>
|
||||
<view class="content">
|
||||
回复<text class="originNickname">永不落的梦想</text><text>:四部门联合启动的人力资源服务业与制造业融合发展点。</text>
|
||||
</view>
|
||||
<view class="reply">回复</view>
|
||||
</view>
|
||||
<view class="content">
|
||||
回复<text class="originNickname">永不落的梦想</text><text>:四部门联合启动的人力资源服务业与制造业融合发展点。</text>
|
||||
<view class="originalTextC">
|
||||
<view class="originReply">
|
||||
<text class="originNickname">永不落的梦想</text><text>:四部门联合启动的人力资源服务业与制造业融合发展点。</text>
|
||||
</view>
|
||||
<view class="originEventC">
|
||||
<view class="levelTitleC flex">
|
||||
<view class="level">C</view>
|
||||
<view class="title">四部门联合启动人力资源服务业与制造业...</view>
|
||||
</view>
|
||||
<view class="eventContent">人社部、工信部等四部门印发通知,明确在30个城市开展3年期试点,培育人力资源服务与制造业协同机构...</view>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
<view class="originalTextC">
|
||||
<view class="originReply">
|
||||
<text class="originNickname">永不落的梦想</text><text>:四部门联合启动的人力资源服务业与制造业融合发展点。</text>
|
||||
</block>
|
||||
<block v-else>
|
||||
<view class="myCommentItem" v-for="(item,index) in commentList" :key="index">
|
||||
<view class="replyContentC">
|
||||
<view class="flex">
|
||||
<image class="avatar" src="" mode="aspectFill"></image>
|
||||
<view class="flex1">
|
||||
<view class="nickname">逸尘破晓</view>
|
||||
<view class="time">{{getLocaleDate(item.created_at)}}</view>
|
||||
</view>
|
||||
</view>
|
||||
<view class="content">{{item.content}}</view>
|
||||
</view>
|
||||
<view class="originEventC">
|
||||
<view class="levelTitleC flex">
|
||||
<view class="level">C</view>
|
||||
<view class="title">四部门联合启动人力资源服务业与制造业...</view>
|
||||
<view class="title">{{item.event_title}}</view>
|
||||
</view>
|
||||
<view class="eventContent">人社部、工信部等四部门印发通知,明确在30个城市开展3年期试点,培育人力资源服务与制造业协同机构...</view>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
</block>
|
||||
</view>
|
||||
</view>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import { inject } from 'vue';
|
||||
|
||||
import { userActivityList } from '@/request/api';
|
||||
import { getLocaleDate } from '@/utils/util';
|
||||
|
||||
export default {
|
||||
data() {
|
||||
return {
|
||||
@@ -52,10 +77,26 @@
|
||||
listTop:'',
|
||||
tabList:['评论我的','我评论的'],
|
||||
selectTab:0,
|
||||
commentList:[],
|
||||
page:1,
|
||||
loadAll:false,
|
||||
getLocaleDate:getLocaleDate
|
||||
}
|
||||
},
|
||||
onLoad() {
|
||||
this.listTop = this.navH+(75+10)/750*inject('windowWidth')
|
||||
this.getCommentListData()
|
||||
},
|
||||
onPullDownRefresh() {
|
||||
this.page = 1
|
||||
this.getCommentListData()
|
||||
},
|
||||
onReachBottom() {
|
||||
if(!this.loadAll)
|
||||
{
|
||||
this.page ++
|
||||
this.getCommentListData()
|
||||
}
|
||||
},
|
||||
methods: {
|
||||
/**
|
||||
@@ -67,7 +108,34 @@
|
||||
if(this.selectTab!=index)
|
||||
{
|
||||
this.selectTab = index
|
||||
this.getCommentListData()
|
||||
}
|
||||
},
|
||||
/**
|
||||
* 获取评论列表数据
|
||||
*/
|
||||
getCommentListData()
|
||||
{
|
||||
let param = {page:this.page,type:this.selectTab==0?'commented':'comments'}
|
||||
userActivityList(param).then(res=>{
|
||||
if (res.code==200) {
|
||||
if(res.data.current_page==1)
|
||||
{
|
||||
this.commentList = res.data.activities
|
||||
}else
|
||||
this.commentList = this.followList.concat(res.data.activities)
|
||||
if(res.data.current_page==res.data.pages)
|
||||
{
|
||||
this.loadAll = true
|
||||
}
|
||||
} else
|
||||
uni.showToast({
|
||||
title:res.message,
|
||||
icon:'none'
|
||||
})
|
||||
}).catch(error=>{
|
||||
|
||||
})
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -118,14 +186,13 @@
|
||||
right: 0;
|
||||
bottom: 0;
|
||||
overflow-y: scroll;
|
||||
.item
|
||||
.commentMeItem
|
||||
{
|
||||
.replyContentC
|
||||
{
|
||||
padding: 40rpx 25rpx 0;
|
||||
.avatar
|
||||
{
|
||||
background-color: red;
|
||||
margin-right: 22rpx;
|
||||
width: 80rpx;
|
||||
height: 80rpx;
|
||||
@@ -134,10 +201,13 @@
|
||||
.replyNickname
|
||||
{
|
||||
font-size: 28rpx;
|
||||
font-weight: bold;
|
||||
color: #111;
|
||||
}
|
||||
.time
|
||||
{
|
||||
font-size: 26rpx;
|
||||
font-weight: 500;
|
||||
color: #aaa;
|
||||
}
|
||||
.reply
|
||||
@@ -213,5 +283,73 @@
|
||||
}
|
||||
}
|
||||
}
|
||||
.myCommentItem
|
||||
{
|
||||
.replyContentC
|
||||
{
|
||||
padding: 40rpx 25rpx 0;
|
||||
.avatar
|
||||
{
|
||||
margin-right: 22rpx;
|
||||
width: 80rpx;
|
||||
height: 80rpx;
|
||||
border-radius: 50%;
|
||||
}
|
||||
.nickname
|
||||
{
|
||||
font-size: 28rpx;
|
||||
font-weight: bold;
|
||||
color: #111;
|
||||
}
|
||||
.time
|
||||
{
|
||||
font-size: 26rpx;
|
||||
font-weight: 500;
|
||||
color: #aaa;
|
||||
}
|
||||
.content
|
||||
{
|
||||
margin-top: 20rpx;
|
||||
font-size: 24rpx;
|
||||
font-weight: 500;
|
||||
color: #444;
|
||||
}
|
||||
}
|
||||
|
||||
.originEventC
|
||||
{
|
||||
background-color: #F7F7F7;
|
||||
margin-top: 20rpx;
|
||||
padding: 20rpx 40rpx;
|
||||
.levelTitleC
|
||||
{
|
||||
font-size: 30rpx;
|
||||
font-weight: bold;
|
||||
.level
|
||||
{
|
||||
background-color: #FEC44F;
|
||||
margin-right: 17rpx;
|
||||
width: 50rpx;
|
||||
height: 40rpx;
|
||||
border-radius: 10rpx;
|
||||
font-size: 30rpx;
|
||||
font-weight: bold;
|
||||
color: white;
|
||||
text-align: center;
|
||||
}
|
||||
.title
|
||||
{
|
||||
color: #222;
|
||||
}
|
||||
}
|
||||
.eventContent
|
||||
{
|
||||
margin-top: 20rpx;
|
||||
font-size: 24rpx;
|
||||
font-weight: 500;
|
||||
color: #666;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
</style>
|
||||
|
||||
Reference in New Issue
Block a user