7.10 增加登录页面,事件详情接口对接,我的点赞,关注收藏页面搭建,接口对接

This commit is contained in:
尚政杰
2025-07-10 18:08:16 +08:00
parent c4267a0e27
commit 58b3414bdd
356 changed files with 7710 additions and 978 deletions

View File

@@ -1,5 +1,7 @@
"use strict";
const common_vendor = require("../../../common/vendor.js");
const request_api = require("../../../request/api.js");
const utils_util = require("../../../utils/util.js");
const common_assets = require("../../../common/assets.js");
const _sfc_main = {
data() {
@@ -7,11 +9,26 @@ const _sfc_main = {
navH: common_vendor.inject("navHeight"),
listTop: "",
tabList: ["评论我的", "我评论的"],
selectTab: 0
selectTab: 0,
commentList: [],
page: 1,
loadAll: false,
getLocaleDate: utils_util.getLocaleDate
};
},
onLoad() {
this.listTop = this.navH + (75 + 10) / 750 * common_vendor.inject("windowWidth");
this.getCommentListData();
},
onPullDownRefresh() {
this.page = 1;
this.getCommentListData();
},
onReachBottom() {
if (!this.loadAll) {
this.page++;
this.getCommentListData();
}
},
methods: {
/**
@@ -21,7 +38,30 @@ const _sfc_main = {
clickTabItem(index) {
if (this.selectTab != index) {
this.selectTab = index;
this.getCommentListData();
}
},
/**
* 获取评论列表数据
*/
getCommentListData() {
let param = { page: this.page, type: this.selectTab == 0 ? "commented" : "comments" };
request_api.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
common_vendor.index.showToast({
title: res.message,
icon: "none"
});
}).catch((error) => {
});
}
}
};
@@ -34,7 +74,7 @@ if (!Math) {
_easycom_navBar();
}
function _sfc_render(_ctx, _cache, $props, $setup, $data, $options) {
return {
return common_vendor.e({
a: common_vendor.p({
leftText: "评论回复"
}),
@@ -50,8 +90,25 @@ function _sfc_render(_ctx, _cache, $props, $setup, $data, $options) {
});
}),
d: common_vendor.s("top:" + $data.navH + "px;"),
e: common_vendor.s("top:" + $data.listTop + "px;")
};
e: $data.selectTab == 0
}, $data.selectTab == 0 ? {
f: common_vendor.f($data.commentList, (item, index, i0) => {
return {
a: index
};
})
} : {
g: common_vendor.f($data.commentList, (item, index, i0) => {
return {
a: common_vendor.t($data.getLocaleDate(item.created_at)),
b: common_vendor.t(item.content),
c: common_vendor.t(item.event_title),
d: index
};
})
}, {
h: common_vendor.s("top:" + $data.listTop + "px;")
});
}
const MiniProgramPage = /* @__PURE__ */ common_vendor._export_sfc(_sfc_main, [["render", _sfc_render]]);
wx.createPage(MiniProgramPage);

View File

@@ -1 +1 @@
<view><nav-bar wx:if="{{a}}" u-i="dc49bf38-0" bind:__l="__l" u-p="{{a}}"></nav-bar><image class="topBg absolute" src="{{b}}" mode="widthFix"></image><view class="tabC fixed flex" style="{{d}}"><view wx:for="{{c}}" wx:for-item="item" wx:key="d" class="{{item.c}}" bindtap="{{item.e}}">{{item.a}} <view wx:if="{{item.b}}" class="line absolute"></view></view></view><view class="list fixed" style="{{e}}"><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></view></view><view class="reply">回复</view></view><view class="content"> 回复<text class="originNickname">永不落的梦想</text><text>:四部门联合启动的人力资源服务业与制造业融合发展点。</text></view></view><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></view>
<view><nav-bar wx:if="{{a}}" u-i="dc49bf38-0" bind:__l="__l" u-p="{{a}}"></nav-bar><image class="topBg absolute" src="{{b}}" mode="widthFix"></image><view class="tabC fixed flex" style="{{d}}"><view wx:for="{{c}}" wx:for-item="item" wx:key="d" class="{{item.c}}" bindtap="{{item.e}}">{{item.a}} <view wx:if="{{item.b}}" class="line absolute"></view></view></view><view class="list fixed" style="{{h}}"><block wx:if="{{e}}"><view wx:for="{{f}}" wx:for-item="item" wx:key="a" class="commentMeItem"><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><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></block><block wx:else><view wx:for="{{g}}" wx:for-item="item" wx:key="d" class="myCommentItem"><view class="replyContentC"><view class="flex"><image class="avatar" src="{{''}}" mode="aspectFill"></image><view class="flex1"><view class="nickname">逸尘破晓</view><view class="time">{{item.a}}</view></view></view><view class="content">{{item.b}}</view></view><view class="originEventC"><view class="levelTitleC flex"><view class="level">C</view><view class="title">{{item.c}}</view></view><view class="eventContent">人社部、工信部等四部门印发通知明确在30个城市开展3年期试点培育人力资源服务与制造业协同机构...</view></view></view></block></view></view>

View File

@@ -37,24 +37,26 @@
bottom: 0;
overflow-y: scroll;
}
.list .item .replyContentC {
.list .commentMeItem .replyContentC {
padding: 40rpx 25rpx 0;
}
.list .item .replyContentC .avatar {
background-color: red;
.list .commentMeItem .replyContentC .avatar {
margin-right: 22rpx;
width: 80rpx;
height: 80rpx;
border-radius: 50%;
}
.list .item .replyContentC .replyNickname {
.list .commentMeItem .replyContentC .replyNickname {
font-size: 28rpx;
font-weight: bold;
color: #111;
}
.list .item .replyContentC .time {
.list .commentMeItem .replyContentC .time {
font-size: 26rpx;
font-weight: 500;
color: #aaa;
}
.list .item .replyContentC .reply {
.list .commentMeItem .replyContentC .reply {
width: 90rpx;
height: 52rpx;
line-height: 50rpx;
@@ -63,38 +65,38 @@
font-size: 24rpx;
text-align: center;
}
.list .item .replyContentC .content {
.list .commentMeItem .replyContentC .content {
margin-top: 20rpx;
font-size: 24rpx;
font-weight: 500;
color: #444;
}
.list .item .replyContentC .content .originNickname {
.list .commentMeItem .replyContentC .content .originNickname {
color: #F97316;
}
.list .item .originalTextC {
.list .commentMeItem .originalTextC {
background-color: #F7F7F7;
margin-top: 20rpx;
padding: 20rpx 25rpx 25rpx;
}
.list .item .originalTextC .originReply {
.list .commentMeItem .originalTextC .originReply {
font-size: 24rpx;
font-weight: 500;
color: #444;
}
.list .item .originalTextC .originReply .originNickname {
.list .commentMeItem .originalTextC .originReply .originNickname {
color: #F97316;
}
.list .item .originalTextC .originEventC {
.list .commentMeItem .originalTextC .originEventC {
background-color: white;
margin-top: 20rpx;
padding: 34rpx 16rpx;
}
.list .item .originalTextC .originEventC .levelTitleC {
.list .commentMeItem .originalTextC .originEventC .levelTitleC {
font-size: 30rpx;
font-weight: bold;
}
.list .item .originalTextC .originEventC .levelTitleC .level {
.list .commentMeItem .originalTextC .originEventC .levelTitleC .level {
background-color: #FEC44F;
margin-right: 17rpx;
width: 50rpx;
@@ -105,10 +107,64 @@
color: white;
text-align: center;
}
.list .item .originalTextC .originEventC .levelTitleC .title {
.list .commentMeItem .originalTextC .originEventC .levelTitleC .title {
color: #222;
}
.list .item .originalTextC .originEventC .eventContent {
.list .commentMeItem .originalTextC .originEventC .eventContent {
margin-top: 20rpx;
font-size: 24rpx;
font-weight: 500;
color: #666;
}
.list .myCommentItem .replyContentC {
padding: 40rpx 25rpx 0;
}
.list .myCommentItem .replyContentC .avatar {
margin-right: 22rpx;
width: 80rpx;
height: 80rpx;
border-radius: 50%;
}
.list .myCommentItem .replyContentC .nickname {
font-size: 28rpx;
font-weight: bold;
color: #111;
}
.list .myCommentItem .replyContentC .time {
font-size: 26rpx;
font-weight: 500;
color: #aaa;
}
.list .myCommentItem .replyContentC .content {
margin-top: 20rpx;
font-size: 24rpx;
font-weight: 500;
color: #444;
}
.list .myCommentItem .originEventC {
background-color: #F7F7F7;
margin-top: 20rpx;
padding: 20rpx 40rpx;
}
.list .myCommentItem .originEventC .levelTitleC {
font-size: 30rpx;
font-weight: bold;
}
.list .myCommentItem .originEventC .levelTitleC .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;
}
.list .myCommentItem .originEventC .levelTitleC .title {
color: #222;
}
.list .myCommentItem .originEventC .eventContent {
margin-top: 20rpx;
font-size: 24rpx;
font-weight: 500;