Merge remote-tracking branch 'origin/main' into main
commit
8e7afa5529
|
@ -9,6 +9,15 @@ export function listPost(query) {
|
|||
})
|
||||
}
|
||||
|
||||
// 查询该用户关注的话题投稿new列表
|
||||
export function listPostFollow(query) {
|
||||
return request({
|
||||
url: '/talk/post/follow',
|
||||
method: 'get',
|
||||
params: query
|
||||
})
|
||||
}
|
||||
|
||||
// 查询话题投稿new详细
|
||||
export function getPost(id) {
|
||||
return request({
|
||||
|
|
14
pages.json
14
pages.json
|
@ -407,6 +407,20 @@
|
|||
"navigationBarTitleText": "消息切换",
|
||||
"navigationStyle": "custom"
|
||||
}
|
||||
},
|
||||
{
|
||||
"path" : "pages/mine/myPost/myPost",
|
||||
"style" :
|
||||
{
|
||||
"navigationBarTitleText" : "我的话题"
|
||||
}
|
||||
},
|
||||
{
|
||||
"path" : "pages/mine/myPost/draft/draft",
|
||||
"style" :
|
||||
{
|
||||
"navigationBarTitleText" : "草稿箱"
|
||||
}
|
||||
}
|
||||
],
|
||||
"tabBar": {
|
||||
|
|
|
@ -2,7 +2,7 @@
|
|||
<!-- 话题 -->
|
||||
<view class="center-content-post" @click="toPostInfoView()">
|
||||
<view class="center-content-post-padding">
|
||||
<view class="center-content-post-head">
|
||||
<view class="center-content-post-head" v-if="postViewIndex != 3">
|
||||
<!-- 左对齐 -->
|
||||
<view class="flex alignCenter">
|
||||
<!-- 头像 -->
|
||||
|
@ -19,16 +19,28 @@
|
|||
</view>
|
||||
</view>
|
||||
<!-- 右对齐 -->
|
||||
<view class="flex alignCenter" v-if="postViewIndex != 0">
|
||||
<!-- 关注操作 -->
|
||||
<view class="flex alignCenter" v-if="postViewIndex != 0 && loginUser.userId != postValue.uid">
|
||||
<text class="focus-text" v-if="postValue.focus" @click.stop="cancelFocus(postValue.uid)">已关注</text>
|
||||
<text class="no-focus-text" v-else @click.stop="addFocus(postValue.uid)">关注</text>
|
||||
</view>
|
||||
<!-- 状态 -->
|
||||
<view class="" v-if="postViewIndex == 2 && loginUser.userId == postValue.uid">
|
||||
<text class="pass-text" v-if="postValue.status == 0" >已发布</text>
|
||||
<text class="audit-text" v-if="postValue.status == 2" >审核中</text>
|
||||
<text class="refuse-text" v-if="postValue.status == 3" >未通过</text>
|
||||
</view>
|
||||
<!-- 删除操作 -->
|
||||
<view class="">
|
||||
<image v-if="postViewIndex == 4 && loginUser.userId == postValue.uid && postValue.status == 0" class="delImg" @click="toDel"
|
||||
src="../../../static/images/icon/sang-1.png" :lazy-load="true"></image>
|
||||
</view>
|
||||
</view>
|
||||
<text class="center-content-post-title" v-if="postValue.title">{{postValue.title}}</text>
|
||||
<text class="center-content-post-content-0"
|
||||
v-if="postValue.content && postViewType == 0">{{postValue.content}}</text>
|
||||
v-if="postValue.content && postViewIndex == 3 || postViewIndex == 0 || postViewIndex == 1 || postViewIndex == 2">{{postValue.content}}</text>
|
||||
<text class="center-content-post-content-1"
|
||||
v-if="postValue.content && postViewType == 1">{{postValue.content}}</text>
|
||||
v-else>{{postValue.content}}</text>
|
||||
<!-- 图片 -->
|
||||
<!--一张图片-->
|
||||
<block v-if="toimage(postValue.media) && toimage(postValue.media).length == 1">
|
||||
|
@ -137,6 +149,8 @@
|
|||
</view>
|
||||
</view>
|
||||
</view>
|
||||
<up-modal :show="modalShow" title="是否删除该话题" showCancelButton="true" closeOnClickOverlay="true" @confirm='modalConfirm' @cancel="modalCancel" @close="modalClose"></up-modal>
|
||||
<up-toast ref="uToastRef"></up-toast>
|
||||
</template>
|
||||
|
||||
<script setup>
|
||||
|
@ -158,6 +172,15 @@
|
|||
import {
|
||||
getDicts
|
||||
} from "@/api/system/dict/data";
|
||||
import {
|
||||
listPost,
|
||||
listPostFollow,
|
||||
getPost,
|
||||
delPost,
|
||||
addPost,
|
||||
updatePost,
|
||||
getLoginUserinfo
|
||||
} from "@/api/talk/post";
|
||||
import {
|
||||
listFollowUser,
|
||||
getFollowUser,
|
||||
|
@ -174,8 +197,12 @@
|
|||
addPostFavorite
|
||||
} from "@/api/postFavorite/postFavorite";
|
||||
|
||||
const emit = defineEmits(["updateFocusFather"])
|
||||
const modalShow = ref(false)
|
||||
const loginUser = reactive(uni.getStorageSync('loginUserPost'));
|
||||
const dictPostTab = ref([])
|
||||
onLoad((options) => {
|
||||
|
||||
getDicts('post_tab').then(e => {
|
||||
dictPostTab.value = e.data
|
||||
})
|
||||
|
@ -191,7 +218,7 @@
|
|||
postViewIndex: Number,
|
||||
postViewType: Number
|
||||
});
|
||||
|
||||
|
||||
const postListStorage = ref(uni.getStorageSync('postList'));
|
||||
|
||||
const upPostListStorage = () => {
|
||||
|
@ -286,6 +313,52 @@
|
|||
urls: urls // 需要预览的图片http链接列表
|
||||
});
|
||||
};
|
||||
|
||||
// 删除操作
|
||||
// 方法
|
||||
const uToastRef = ref(null)
|
||||
const uToastRefParams = reactive({
|
||||
type: 'default',
|
||||
title: '结束后跳转标签页',
|
||||
message: "删除成功",
|
||||
// url: '/pages/componentsB/tag/tag',
|
||||
// iconUrl: 'https://cdn.uviewui.com/uview/demo/toast/jump.png'
|
||||
})
|
||||
function showToast(params) {
|
||||
uToastRef.value.show({
|
||||
...params,
|
||||
complete() {
|
||||
params.url && uni.navigateTo({
|
||||
url: params.url
|
||||
});
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
const modalConfirm = () => {
|
||||
delPost(props.postValue.id).then(res => {
|
||||
showToast(uToastRefParams);
|
||||
setTimeout(function() {
|
||||
uni.$emit('refreshData');
|
||||
uni.navigateBack({
|
||||
delta: 1
|
||||
});
|
||||
}, 1000);
|
||||
});
|
||||
modalShow.value = false;
|
||||
}
|
||||
|
||||
const modalCancel = () => {
|
||||
modalShow.value = false;
|
||||
}
|
||||
|
||||
const modalClose = () => {
|
||||
modalShow.value = false;
|
||||
}
|
||||
|
||||
const toDel = () => {
|
||||
modalShow.value = true;
|
||||
}
|
||||
|
||||
// 点赞操作
|
||||
const cancelCollection = (postId) => {
|
||||
|
@ -336,7 +409,6 @@
|
|||
|
||||
// 关注操作
|
||||
|
||||
const emit = defineEmits(["updateFocusFather"])
|
||||
|
||||
const cancelFocus = (uid) => {
|
||||
const followUser = reactive({
|
||||
|
@ -374,10 +446,13 @@
|
|||
</script>
|
||||
|
||||
<style lang="scss">
|
||||
.center-content-post {}
|
||||
|
||||
.center-content-post {
|
||||
}
|
||||
|
||||
.center-content-post-padding {
|
||||
padding: 46rpx 32rpx 28rpx 32rpx;
|
||||
|
||||
}
|
||||
|
||||
.center-content-post-head {
|
||||
|
@ -412,6 +487,13 @@
|
|||
/* 垂直结束对齐 */
|
||||
height: 30rpx;
|
||||
line-height: 30rpx;
|
||||
display: block;
|
||||
width: 480rpx;
|
||||
// display: flex; /* 设置为弹性盒子 */
|
||||
// max-width: 450rpx; /* 最大宽度为 300rpx */
|
||||
overflow: hidden; /* 超出部分隐藏 */
|
||||
text-overflow: ellipsis; /* 超出部分用省略号表示 */
|
||||
white-space: nowrap; /* 不换行 */
|
||||
}
|
||||
|
||||
.no-focus-text {
|
||||
|
@ -662,4 +744,27 @@
|
|||
color: #fff;
|
||||
}
|
||||
}
|
||||
|
||||
.pass-text {
|
||||
font-weight: 400;
|
||||
font-size: 28rpx;
|
||||
color: #3477FC;
|
||||
}
|
||||
|
||||
.audit-text {
|
||||
font-weight: 400;
|
||||
font-size: 28rpx;
|
||||
color: #43CE8F;
|
||||
}
|
||||
|
||||
.refuse-text {
|
||||
font-weight: 400;
|
||||
font-size: 28rpx;
|
||||
color: #F87863;
|
||||
}
|
||||
|
||||
.delImg {
|
||||
width: 32rpx;
|
||||
height: 42rpx;
|
||||
}
|
||||
</style>
|
239
pages/index.vue
239
pages/index.vue
|
@ -54,8 +54,8 @@
|
|||
<view class="flex alignCenter justifyBetween">
|
||||
<view class="center-content-focus-item" v-for="(item, index) in focusList" :key="index">
|
||||
<u-avatar class="center-content-focus-item-avatat" size="120rpx"
|
||||
:src="item.avatar"></u-avatar>
|
||||
<text class="center-content-focus-item-text">{{item.uname}}</text>
|
||||
:src="getAvatar(item.avatar)"></u-avatar>
|
||||
<text class="center-content-focus-item-text">{{item.nickName}}</text>
|
||||
</view>
|
||||
</view>
|
||||
</u-scroll-list>
|
||||
|
@ -145,12 +145,14 @@
|
|||
import PostView from "@/pages/common/postview/index.vue";
|
||||
import {
|
||||
listPost,
|
||||
listPostFollow,
|
||||
getPost,
|
||||
delPost,
|
||||
addPost,
|
||||
updatePost,
|
||||
getLoginUserinfo
|
||||
} from "@/api/talk/post";
|
||||
import { listFollowUser, getFollowUser, delFollowUser, addFollowUser, updateFollowUser } from "@/api/followUser/followUser";
|
||||
import {
|
||||
useStore
|
||||
} from 'vuex';
|
||||
|
@ -159,6 +161,7 @@
|
|||
proxy
|
||||
} = getCurrentInstance();
|
||||
|
||||
const loginUser = reactive(uni.getStorageSync('loginUserPost'));
|
||||
const QNDomain = store.state.user.QNDomain;
|
||||
const postList = ref([]);
|
||||
|
||||
|
@ -191,10 +194,12 @@
|
|||
longitude: null,
|
||||
latitude: null,
|
||||
auditor: null,
|
||||
status: null,
|
||||
status: 0,
|
||||
auditTime: null,
|
||||
auditAdvice: null,
|
||||
cut: null,
|
||||
sortField: null,
|
||||
sortDirection: null,
|
||||
},
|
||||
rules: {
|
||||
status: [{
|
||||
|
@ -215,18 +220,82 @@
|
|||
form,
|
||||
rules
|
||||
} = toRefs(data);
|
||||
|
||||
const followTotal = ref(0);
|
||||
const queryFollowParams = reactive({
|
||||
pageNum: 1,
|
||||
pageSize: 10,
|
||||
uid: null,
|
||||
topicId: null,
|
||||
discussId: null,
|
||||
voteId: null,
|
||||
title: null,
|
||||
content: null,
|
||||
media: null,
|
||||
tab: null,
|
||||
readCount: null,
|
||||
transmitCount: null,
|
||||
likeCount: null,
|
||||
commentCount: null,
|
||||
favoriteCount: null,
|
||||
postTop: null,
|
||||
type: null,
|
||||
anonymity: null,
|
||||
postPrivate: null,
|
||||
address: null,
|
||||
longitude: null,
|
||||
latitude: null,
|
||||
auditor: null,
|
||||
status: 0,
|
||||
auditTime: null,
|
||||
auditAdvice: null,
|
||||
cut: null,
|
||||
sortField: null,
|
||||
sortDirection: null,
|
||||
})
|
||||
|
||||
/** 查询话题投稿new列表 */
|
||||
function getList() {
|
||||
queryParams.value.params = {};
|
||||
if (searchPrerequisite.value == '热门') {
|
||||
queryParams.value.sortField = 'like_count';
|
||||
} else if (searchPrerequisite.value == '最新') {
|
||||
queryParams.value.sortField = 'create_time';
|
||||
}
|
||||
listPost(queryParams.value).then(response => {
|
||||
uni.setStorageSync('postList', response.rows)
|
||||
console.log('看一下查了啥啊',response.rows)
|
||||
if (queryParams.value.pageNum > 1) {
|
||||
postList.value.push(...response.rows);
|
||||
uni.setStorageSync('postList', postList.value)
|
||||
} else {
|
||||
uni.setStorageSync('postList', response.rows)
|
||||
}
|
||||
postList.value = uni.getStorageSync('postList');
|
||||
// postList.value = response.rows;
|
||||
total.value = response.total;
|
||||
});
|
||||
}
|
||||
|
||||
function getFollowList() {
|
||||
if (searchPrerequisite.value == '热门') {
|
||||
queryFollowParams.sortField = 'like_count';
|
||||
} else if (searchPrerequisite.value == '最新') {
|
||||
queryFollowParams.sortField = 'create_time';
|
||||
}
|
||||
listPostFollow(queryFollowParams).then(response => {
|
||||
console.log('看一下查了啥啊关注',response)
|
||||
if (queryFollowParams.pageNum > 1) {
|
||||
postList.value.push(...response.rows);
|
||||
} else {
|
||||
postList.value = response.rows;
|
||||
}
|
||||
|
||||
followTotal.value = response.total;
|
||||
});
|
||||
}
|
||||
|
||||
function getAvatar(avatar) {
|
||||
return QNDomain + avatar;
|
||||
}
|
||||
const toimage = (url) => {
|
||||
if (typeof url === 'string') {
|
||||
let info = url.split(",");
|
||||
|
@ -239,9 +308,12 @@
|
|||
|
||||
const bgColor = ref('rgba(170, 0, 0, 0)');
|
||||
onLoad(() => {
|
||||
getLoginUserinfo().then(res => {
|
||||
uni.setStorageSync('loginUserPost', res.data)
|
||||
})
|
||||
uni.$on('refreshData',() => {
|
||||
reactiveList();
|
||||
})
|
||||
getLoginUserinfo().then(res => {
|
||||
uni.setStorageSync('loginUserPost', res.data)
|
||||
})
|
||||
onPageScroll((e) => {
|
||||
// console.log("滚动距离为:" + e.scrollTop);
|
||||
if (e.scrollTop >= 70) {
|
||||
|
@ -252,6 +324,18 @@
|
|||
});
|
||||
onReachBottom(() => {
|
||||
console.log('触底了')
|
||||
if (viewIndex.value == 1) {
|
||||
if (total.value > postList.value.length) {
|
||||
queryParams.value.pageNum += 1;
|
||||
getList();
|
||||
}
|
||||
}
|
||||
if (viewIndex.value == 0) {
|
||||
if (followTotal.value > postList.value.length) {
|
||||
queryFollowParams.pageNum += 1;
|
||||
getFollowList();
|
||||
}
|
||||
}
|
||||
})
|
||||
InspectionData()
|
||||
})
|
||||
|
@ -271,7 +355,12 @@
|
|||
}
|
||||
|
||||
onShow(() => {
|
||||
postList.value = uni.getStorageSync('postList');
|
||||
if (viewIndex.value == 1) {
|
||||
postList.value = uni.getStorageSync('postList');
|
||||
}
|
||||
if (viewIndex.value == 0) {
|
||||
selectFollowView();
|
||||
}
|
||||
})
|
||||
|
||||
const viewIndex = ref(1);
|
||||
|
@ -300,92 +389,7 @@
|
|||
}
|
||||
]);
|
||||
|
||||
const focusList = reactive([{
|
||||
avatar: 'https://k.sinaimg.cn/n/sports/transform/400/w600h600/20220130/dd38-eed53ba750d1d8c87eca8b57eda879a5.jpg/w700d1q75cms.jpg?by=cms_fixed_width',
|
||||
uname: '爱吃饭的小张'
|
||||
},
|
||||
{
|
||||
avatar: 'https://oss.1381801.com/forum/202308/11/093616ccxkx99wchwrrw1a.jpg',
|
||||
uname: '喜欢你没道理'
|
||||
},
|
||||
{
|
||||
avatar: 'https://picx.zhimg.com/v2-02f89d05a781ffed9fd2e32654d93135_720w.jpg?source=172ae18b',
|
||||
uname: '恋爱60秒'
|
||||
},
|
||||
{
|
||||
avatar: 'https://www.tboxn.com/wp-content/uploads/2022/11/%E5%A4%B4%E5%83%8F.png',
|
||||
uname: '爱吃饭的小张'
|
||||
}
|
||||
]);
|
||||
|
||||
// const postList = reactive([
|
||||
// {
|
||||
// avatar: 'https://k.sinaimg.cn/n/sports/transform/400/w600h600/20220130/dd38-eed53ba750d1d8c87eca8b57eda879a5.jpg/w700d1q75cms.jpg?by=cms_fixed_width',
|
||||
// uname: '爱吃饭的小张',
|
||||
// createTime: '11分钟前',
|
||||
// address: '南开大学',
|
||||
// isFocus: false,
|
||||
// isOfficial: true,
|
||||
// title: '怎么评论爱德华·艾尔加这位音乐家及其他的作品,欢迎大家发表自己的看法?',
|
||||
// content: '八年前,学弟在工地上杀了一个工友,杀人前,他给警察打了电话,预告杀人的时间和地点,并超出部分测试超出部分测试超出部分测试超出部分测试......超出部分测试超出部分测试超出部分测试超出部分测试',
|
||||
// type: '1',
|
||||
// media: [
|
||||
// 'https://img1.baidu.com/it/u=1179199327,1946315836&fm=253&fmt=auto&app=138&f=JPEG?w=1364&h=800',
|
||||
// 'https://www4.bing.com//th?id=OHR.CopenhagenBicycles_ZH-CN3047958346_1920x1080.jpg&rf=LaDigue_1920x1080.jpg&pid=hp&w=360&h=202',
|
||||
// 'https://www4.bing.com//th?id=OHR.CarnavalTenerife_ZH-CN1559136778_1920x1080.jpg&rf=LaDigue_1920x1080.jpg&pid=hp&w=360&h=202',
|
||||
// 'https://www4.bing.com//th?id=OHR.StJamesPool_ZH-CN5930624359_1920x1080.jpg&rf=LaDigue_1920x1080.jpg&pid=hp&w=360&h=202',
|
||||
// ],
|
||||
// tab: ['学术讨论组', '校园风景'],
|
||||
// transmitCount: 136,
|
||||
// isLike: true,
|
||||
// likeCount: 999,
|
||||
// commentCount: 136,
|
||||
// ifFavorite: true,
|
||||
// favoriteCount: 136
|
||||
// },
|
||||
// {
|
||||
// avatar: 'https://oss.1381801.com/forum/202308/11/093616ccxkx99wchwrrw1a.jpg',
|
||||
// uname: '喜欢你没道理',
|
||||
// createTime: '2024-5-5',
|
||||
// address: '南开大学',
|
||||
// isFocus: false,
|
||||
// isOfficial: false,
|
||||
// content: '是一个中文互联网高质量问答社区和创作者聚集的原创内容平台,于2011年1月正式上线',
|
||||
// type: '1',
|
||||
// media: [
|
||||
// 'https://www4.bing.com//th?id=OHR.BambooPanda_ZH-CN8455481760_1920x1080.jpg&rf=LaDigue_1920x1080.jpg&pid=hp&w=360&h=202',
|
||||
// ],
|
||||
// tab: ['校园风景'],
|
||||
// transmitCount: 13,
|
||||
// isLike: false,
|
||||
// likeCount: 99,
|
||||
// commentCount: 13,
|
||||
// ifFavorite: true,
|
||||
// favoriteCount: 13
|
||||
// },
|
||||
// {
|
||||
// avatar: 'https://picx.zhimg.com/v2-02f89d05a781ffed9fd2e32654d93135_720w.jpg?source=172ae18b',
|
||||
// uname: '恋爱60秒',
|
||||
// createTime: '2024-5-4',
|
||||
// address: '理工大学',
|
||||
// isFocus: false,
|
||||
// isOfficial: false,
|
||||
// title: '怎么评论爱德华·艾尔加这位音乐家及其他的作品,欢迎大家发表自己的看法?',
|
||||
// content: '是一个中文互联网高质量问答社区和创作者聚集的原创内容平台,于2011年1月正式上线',
|
||||
// type: '1',
|
||||
// media: [
|
||||
// 'https://www4.bing.com//th?id=OHR.PlitviceWinter_ZH-CN0407572344_1920x1080.jpg&rf=LaDigue_1920x1080.jpg&pid=hp&w=360&h=202',
|
||||
// 'https://www4.bing.com//th?id=OHR.HawkOwl_ZH-CN3401920167_1920x1080.jpg&rf=LaDigue_1920x1080.jpg&pid=hp&w=360&h=202'
|
||||
// ],
|
||||
// tab: ['校园风景'],
|
||||
// transmitCount: 13,
|
||||
// isLike: false,
|
||||
// likeCount: 99,
|
||||
// commentCount: 13,
|
||||
// ifFavorite: false,
|
||||
// favoriteCount: 13
|
||||
// }
|
||||
// ]);
|
||||
const focusList = ref([]);
|
||||
|
||||
const publishTalk = (item) => {
|
||||
if (item.id === 1) {
|
||||
|
@ -432,12 +436,51 @@
|
|||
};
|
||||
|
||||
const click = (item) => {
|
||||
if (item.index == 1 && viewIndex.value == 0) {
|
||||
queryParams.value.pageNum = 1;
|
||||
getList();
|
||||
}
|
||||
viewIndex.value = item.index;
|
||||
if (item.index == 0) {
|
||||
selectFollowView();
|
||||
}
|
||||
if (item.index == 1) {
|
||||
postList.value = uni.getStorageSync('postList');
|
||||
}
|
||||
};
|
||||
|
||||
const selectFollowView = () => {
|
||||
const FollowUser ={
|
||||
userId: loginUser.userId
|
||||
};
|
||||
listFollowUser(FollowUser).then(res => {
|
||||
console.log(res.rows);
|
||||
queryFollowParams.pageNum = 1;
|
||||
postList.value = [];
|
||||
if (res.rows.length == 0) {
|
||||
const noFollew ={
|
||||
avatar: 'noFollew',
|
||||
nickName: '暂无关注'
|
||||
};
|
||||
res.rows.push(noFollew);
|
||||
focusList.value = res.rows;
|
||||
return;
|
||||
};
|
||||
focusList.value = res.rows;
|
||||
getFollowList();
|
||||
})
|
||||
}
|
||||
|
||||
const handerLi = (res) => {
|
||||
lefther.value = res;
|
||||
searchPrerequisite.value = searchPrerequisiteList[res];
|
||||
if (viewIndex.value == 1) {
|
||||
queryParams.value.pageNum = 1;
|
||||
postList.value = [];
|
||||
getList();
|
||||
} else if (viewIndex.value == 0) {
|
||||
getFollowList();
|
||||
}
|
||||
setTimeout(() => {
|
||||
searchOpen.value = !searchOpen.value;
|
||||
}, 350);
|
||||
|
@ -462,6 +505,12 @@
|
|||
postList.value = uni.getStorageSync('postList');
|
||||
// console.log('关注' + uni.getStorageSync('postList'))
|
||||
}
|
||||
|
||||
const reactiveList = () => {
|
||||
queryParams.value.pageNum = 1;
|
||||
getList();
|
||||
}
|
||||
|
||||
getList();
|
||||
</script>
|
||||
|
||||
|
|
|
@ -233,6 +233,14 @@ function handleLogout() {
|
|||
onPullDownRefresh((options) => {
|
||||
proxy.$router.go(0)
|
||||
})
|
||||
const grid1Click1 = (e) => {
|
||||
console.log(e)
|
||||
if (e == 4) {
|
||||
proxy.$tab.navigateTo('/pages/mine/myPost/draft/draft')
|
||||
} else {
|
||||
proxy.$tab.navigateTo('/pages/mine/myPost/myPost?type=' + e)
|
||||
}
|
||||
}
|
||||
const grid1Click2 = (e) => {
|
||||
if (e == 4) {
|
||||
proxy.$tab.navigateTo('/pages/mine/myActivity/draft')
|
||||
|
|
|
@ -255,9 +255,7 @@ const getDictLabelByValue = (state) => {
|
|||
</script>
|
||||
|
||||
<style lang="scss">
|
||||
page {
|
||||
background-color: #F4F5F6;
|
||||
}
|
||||
|
||||
|
||||
.tabsinfo {
|
||||
background-color: #ffffff;
|
||||
|
|
|
@ -0,0 +1,123 @@
|
|||
<template>
|
||||
<view>
|
||||
<!-- 列表 -->
|
||||
<view class="bc-color" v-for="(postItem, postIndex) in postList" :key="postIndex">
|
||||
<view class="line1"></view>
|
||||
<PostView :postValue="postItem" :postViewIndex="3" :postViewType="1"></PostView>
|
||||
<!-- <u-line></u-line> -->
|
||||
</view>
|
||||
</view>
|
||||
</template>
|
||||
|
||||
<script setup>
|
||||
import { ref, getCurrentInstance, reactive, toRefs } from 'vue';
|
||||
import { onReachBottom, onShow, onLoad, onPullDownRefresh } from '@dcloudio/uni-app'
|
||||
import PostView from "@/pages/common/postview/index.vue";
|
||||
import {
|
||||
listPost,
|
||||
listPostFollow,
|
||||
getPost,
|
||||
delPost,
|
||||
addPost,
|
||||
updatePost,
|
||||
getLoginUserinfo
|
||||
} from "@/api/talk/post";
|
||||
const loginUser = reactive(uni.getStorageSync('loginUserPost'));
|
||||
const postList = ref([]);
|
||||
|
||||
const loading = ref(true);
|
||||
const total = ref(0);
|
||||
|
||||
const data = reactive({
|
||||
form: {},
|
||||
queryParams: {
|
||||
pageNum: 1,
|
||||
pageSize: 10,
|
||||
uid: null,
|
||||
topicId: null,
|
||||
discussId: null,
|
||||
voteId: null,
|
||||
title: null,
|
||||
content: null,
|
||||
media: null,
|
||||
tab: null,
|
||||
readCount: null,
|
||||
transmitCount: null,
|
||||
likeCount: null,
|
||||
commentCount: null,
|
||||
favoriteCount: null,
|
||||
postTop: null,
|
||||
type: null,
|
||||
anonymity: null,
|
||||
postPrivate: null,
|
||||
address: null,
|
||||
longitude: null,
|
||||
latitude: null,
|
||||
auditor: null,
|
||||
status: 5,
|
||||
auditTime: null,
|
||||
auditAdvice: null,
|
||||
cut: null,
|
||||
sortField: null,
|
||||
sortDirection: null,
|
||||
},
|
||||
rules: {
|
||||
status: [{
|
||||
required: true,
|
||||
message: "状态不能为空",
|
||||
trigger: "change"
|
||||
}],
|
||||
cut: [{
|
||||
required: true,
|
||||
message: "分类不能为空",
|
||||
trigger: "change"
|
||||
}],
|
||||
}
|
||||
});
|
||||
|
||||
const {
|
||||
queryParams,
|
||||
form,
|
||||
rules
|
||||
} = toRefs(data);
|
||||
|
||||
onLoad(() => {
|
||||
queryParams.value.uid = loginUser.userId
|
||||
getList();
|
||||
onReachBottom(() => {
|
||||
console.log('触底了')
|
||||
if (total.value > postList.value.length) {
|
||||
queryParams.value.pageNum += 1;
|
||||
getList();
|
||||
}
|
||||
})
|
||||
})
|
||||
|
||||
/** 查询话题投稿new列表 */
|
||||
function getList(type) {
|
||||
|
||||
listPost(queryParams.value).then(response => {
|
||||
console.log('看一下查了啥啊',response.rows)
|
||||
if (queryParams.value.pageNum > 1) {
|
||||
postList.value.push(...response.rows);
|
||||
uni.setStorageSync('myPostDraftList', postList.value)
|
||||
} else {
|
||||
uni.setStorageSync('myPostDraftList', response.rows)
|
||||
}
|
||||
postList.value = uni.getStorageSync('myPostDraftList');
|
||||
// postList.value = response.rows;
|
||||
total.value = response.total;
|
||||
});
|
||||
}
|
||||
</script>
|
||||
|
||||
<style lang="scss">
|
||||
page {
|
||||
background-color: #FFFFFF;
|
||||
}
|
||||
|
||||
.line1 {
|
||||
height: 4rpx;
|
||||
background-color: #f4f5f6;
|
||||
}
|
||||
</style>
|
|
@ -0,0 +1,191 @@
|
|||
<template>
|
||||
<view>
|
||||
<!-- tab -->
|
||||
<up-sticky offset-top="0">
|
||||
<view class="tabsinfo flex alignCenter justifyCenter">
|
||||
<up-tabs :list="list4" lineWidth="20" lineHeight="2" @click="tabsClick" :current="typeIndex" lineColor="#3477FC" :activeStyle="{
|
||||
color: '#000000',
|
||||
fontSize: '28rpx',
|
||||
transform: 'scale(1.05)'
|
||||
}" :inactiveStyle="{
|
||||
color: '#999999',
|
||||
fontSize: '28rpx',
|
||||
transform: 'scale(1.05)'
|
||||
}" itemStyle=" width: 180rpx; padding-bottom:18rpx;">
|
||||
</up-tabs>
|
||||
</view>
|
||||
<up-line></up-line>
|
||||
</up-sticky>
|
||||
|
||||
|
||||
|
||||
<!-- 列表 -->
|
||||
<view class="bc-color" v-for="(postItem, postIndex) in postList" :key="postIndex">
|
||||
<PostView :postValue="postItem" :postViewIndex="2" :postViewType="0"></PostView>
|
||||
<u-line></u-line>
|
||||
</view>
|
||||
</view>
|
||||
</template>
|
||||
|
||||
<script setup>
|
||||
import { ref, getCurrentInstance, reactive, toRefs } from 'vue';
|
||||
import { onReachBottom, onShow, onLoad, onPullDownRefresh } from '@dcloudio/uni-app'
|
||||
import PostView from "@/pages/common/postview/index.vue";
|
||||
import {
|
||||
listPost,
|
||||
listPostFollow,
|
||||
getPost,
|
||||
delPost,
|
||||
addPost,
|
||||
updatePost,
|
||||
getLoginUserinfo
|
||||
} from "@/api/talk/post";
|
||||
const loginUser = reactive(uni.getStorageSync('loginUserPost'));
|
||||
const typeIndex = ref(9)
|
||||
const list4 = reactive([
|
||||
{ name: '全部活动', state: 9 },
|
||||
{ name: '已发布', state: 0 },
|
||||
{ name: '未通过', state: 3 },
|
||||
{ name: '审核中', state: 2 }
|
||||
]);
|
||||
|
||||
const postList = ref([]);
|
||||
|
||||
const loading = ref(true);
|
||||
const total = ref(0);
|
||||
|
||||
const data = reactive({
|
||||
form: {},
|
||||
queryParams: {
|
||||
pageNum: 1,
|
||||
pageSize: 10,
|
||||
uid: null,
|
||||
topicId: null,
|
||||
discussId: null,
|
||||
voteId: null,
|
||||
title: null,
|
||||
content: null,
|
||||
media: null,
|
||||
tab: null,
|
||||
readCount: null,
|
||||
transmitCount: null,
|
||||
likeCount: null,
|
||||
commentCount: null,
|
||||
favoriteCount: null,
|
||||
postTop: null,
|
||||
type: null,
|
||||
anonymity: null,
|
||||
postPrivate: null,
|
||||
address: null,
|
||||
longitude: null,
|
||||
latitude: null,
|
||||
auditor: null,
|
||||
status: null,
|
||||
auditTime: null,
|
||||
auditAdvice: null,
|
||||
cut: null,
|
||||
sortField: null,
|
||||
sortDirection: null,
|
||||
},
|
||||
rules: {
|
||||
status: [{
|
||||
required: true,
|
||||
message: "状态不能为空",
|
||||
trigger: "change"
|
||||
}],
|
||||
cut: [{
|
||||
required: true,
|
||||
message: "分类不能为空",
|
||||
trigger: "change"
|
||||
}],
|
||||
}
|
||||
});
|
||||
|
||||
const {
|
||||
queryParams,
|
||||
form,
|
||||
rules
|
||||
} = toRefs(data);
|
||||
|
||||
onLoad((options) => {
|
||||
const type = Number(options.type)
|
||||
console.log('你好',type)
|
||||
if (options.type == 0) {
|
||||
typeIndex.value = 0
|
||||
queryParams.value.status = null
|
||||
} else if (options.type == 1) {
|
||||
typeIndex.value = 1
|
||||
queryParams.value.status = 0
|
||||
} else if (options.type == 3) {
|
||||
typeIndex.value = 2
|
||||
queryParams.value.status = 2
|
||||
} else if (options.type == 2) {
|
||||
typeIndex.value = 3
|
||||
queryParams.value.status = 3
|
||||
}
|
||||
queryParams.value.uid = loginUser.userId
|
||||
getList(type);
|
||||
onReachBottom(() => {
|
||||
console.log('触底了')
|
||||
if (total.value > postList.value.length) {
|
||||
queryParams.value.pageNum += 1;
|
||||
getList();
|
||||
}
|
||||
})
|
||||
})
|
||||
|
||||
//按照条件查询
|
||||
const tabsClick = (index) => {
|
||||
removePage()
|
||||
if (index.state == 9) {
|
||||
queryParams.value.status = null;
|
||||
} else {
|
||||
queryParams.value.status = index.state
|
||||
}
|
||||
|
||||
getList()
|
||||
|
||||
}
|
||||
|
||||
const removePage = () => {
|
||||
queryParams.value.pageNum = 1;
|
||||
}
|
||||
|
||||
/** 查询话题投稿new列表 */
|
||||
function getList(type) {
|
||||
|
||||
listPost(queryParams.value).then(response => {
|
||||
console.log('看一下查了啥啊',response.rows)
|
||||
if (queryParams.value.pageNum > 1) {
|
||||
postList.value.push(...response.rows);
|
||||
uni.setStorageSync('myPostList', postList.value)
|
||||
} else {
|
||||
uni.setStorageSync('myPostList', response.rows)
|
||||
}
|
||||
console.log('看一下查了啥啊aa',uni.getStorageSync('myPostList'))
|
||||
postList.value = uni.getStorageSync('myPostList');
|
||||
console.log('看一下查了啥啊aa',postList.value)
|
||||
// postList.value = response.rows;
|
||||
total.value = response.total;
|
||||
});
|
||||
}
|
||||
</script>
|
||||
|
||||
<style lang="scss">
|
||||
page {
|
||||
background-color: #F4F5F6;
|
||||
}
|
||||
|
||||
.tabsinfo {
|
||||
width: 100%;
|
||||
height: 2.125rem;
|
||||
background-color: #FFFFFF;
|
||||
display: flex;
|
||||
align-items: flex-end;
|
||||
}
|
||||
|
||||
.bc-color {
|
||||
background-color: #ffffff;
|
||||
}
|
||||
|
||||
</style>
|
|
@ -1,8 +1,8 @@
|
|||
<template>
|
||||
<view>
|
||||
<PostView :postValue="postValue" :postViewIndex="1" :postViewType="1"></PostView>
|
||||
<PostView :postValue="postValue" :postViewIndex="4" :postViewType="1"></PostView>
|
||||
<view class="center-content-focus-line"></view>
|
||||
<view class="comment">
|
||||
<view class="comment" v-if="postValue.status == 0">
|
||||
<view class="flex justifyBetween alignCenter commentTop">
|
||||
<text class="commentLabel">{{"全部评论" + (postValue.commentCount != 0 ? "(" + postValue.commentCount + ")" : "")}}</text>
|
||||
<text class="report">举报</text>
|
||||
|
@ -213,66 +213,6 @@
|
|||
address: null,
|
||||
});
|
||||
|
||||
const postList = reactive([{
|
||||
avatar: 'https://k.sinaimg.cn/n/sports/transform/400/w600h600/20220130/dd38-eed53ba750d1d8c87eca8b57eda879a5.jpg/w700d1q75cms.jpg?by=cms_fixed_width',
|
||||
nickName: '爱吃饭的小张',
|
||||
address: '南开大学',
|
||||
content: '大家来评论',
|
||||
createTime: '7分钟前',
|
||||
isOfficial: true,
|
||||
deployment: false,
|
||||
answerCommentAllCount: 4,
|
||||
answerCommentPage: 0,
|
||||
answerCommentDisplayCount: 0,
|
||||
answerCommentList: [{
|
||||
avatar: 'https://picx.zhimg.com/v2-02f89d05a781ffed9fd2e32654d93135_720w.jpg?source=172ae18b',
|
||||
nickName: '恋爱60秒',
|
||||
createTime: '2024.05.04',
|
||||
isOfficial: false,
|
||||
address: '理工大学',
|
||||
content: '来了',
|
||||
},
|
||||
{
|
||||
avatar: 'https://oss.1381801.com/forum/202308/11/093616ccxkx99wchwrrw1a.jpg',
|
||||
nickName: '喜欢你没道理',
|
||||
createTime: '2024.05.04',
|
||||
isOfficial: false,
|
||||
address: '理工大学',
|
||||
content: '你干嘛~',
|
||||
toUserName: '恋爱60秒',
|
||||
},
|
||||
{
|
||||
avatar: 'https://www.tboxn.com/wp-content/uploads/2022/11/%E5%A4%B4%E5%83%8F.png',
|
||||
nickName: '神奇宝贝',
|
||||
createTime: '2024.05.04',
|
||||
isOfficial: false,
|
||||
address: '理工大学',
|
||||
content: '哎呦~',
|
||||
toUserName: '喜欢你没道理',
|
||||
},
|
||||
{
|
||||
avatar: 'https://files.codelife.cc/wallhaven/full/wq/wallhaven-wqkw2r.jpg?x-oss-process=image/resize,limit_0,m_fill,w_307,h_158/quality,Q_92/format,webp',
|
||||
nickName: '皮卡丘',
|
||||
createTime: '2024.05.04',
|
||||
isOfficial: true,
|
||||
address: '理工大学',
|
||||
content: '要再点一下才能看到我',
|
||||
toUserName: '喜欢你没道理',
|
||||
},
|
||||
]
|
||||
},
|
||||
{
|
||||
avatar: 'https://picx.zhimg.com/v2-02f89d05a781ffed9fd2e32654d93135_720w.jpg?source=172ae18b',
|
||||
nickName: '恋爱60秒',
|
||||
createTime: '2024.05.04',
|
||||
isOfficial: false,
|
||||
deployment: false,
|
||||
address: '理工大学',
|
||||
content: '评论区上线了',
|
||||
answerCommentList: []
|
||||
}
|
||||
]);
|
||||
|
||||
const getPostInfo = () => {
|
||||
queryParams.postId = postValue.id;
|
||||
listComment(queryParams).then(res => {
|
||||
|
@ -281,32 +221,7 @@
|
|||
total.value = res.total
|
||||
});
|
||||
};
|
||||
// const postValue = reactive(
|
||||
// {
|
||||
// avatar: 'https://k.sinaimg.cn/n/sports/transform/400/w600h600/20220130/dd38-eed53ba750d1d8c87eca8b57eda879a5.jpg/w700d1q75cms.jpg?by=cms_fixed_width',
|
||||
// uname: '爱吃饭的小张',
|
||||
// createTime: '11分钟前',
|
||||
// address: '南开大学',
|
||||
// isFocus: false,
|
||||
// isOfficial: true,
|
||||
// title: '怎么评论爱德华·艾尔加这位音乐家及其他的作品,欢迎大家发表自己的看法?',
|
||||
// content: '八年前,学弟在工地上杀了一个工友,上杀了一个工友,杀人前,他给警察打了电话,预告杀人的时间和地点,和地点,并......',
|
||||
// type: '1',
|
||||
// media: [
|
||||
// 'https://img1.baidu.com/it/u=1179199327,1946315836&fm=253&fmt=auto&app=138&f=JPEG?w=1364&h=800',
|
||||
// 'https://www4.bing.com//th?id=OHR.CopenhagenBicycles_ZH-CN3047958346_1920x1080.jpg&rf=LaDigue_1920x1080.jpg&pid=hp&w=360&h=202',
|
||||
// 'https://www4.bing.com//th?id=OHR.CarnavalTenerife_ZH-CN1559136778_1920x1080.jpg&rf=LaDigue_1920x1080.jpg&pid=hp&w=360&h=202',
|
||||
// 'https://www4.bing.com//th?id=OHR.StJamesPool_ZH-CN5930624359_1920x1080.jpg&rf=LaDigue_1920x1080.jpg&pid=hp&w=360&h=202',
|
||||
// ],
|
||||
// tab: ['学术讨论组', '校园风景'],
|
||||
// transmitCount: 136,
|
||||
// like: true,
|
||||
// likeCount: 999,
|
||||
// commentCount: 136,
|
||||
// favorite: true,
|
||||
// favoriteCount: 136
|
||||
// }
|
||||
// );
|
||||
|
||||
const store = useStore();
|
||||
const QNDomain = store.state.user.QNDomain;
|
||||
|
||||
|
@ -537,9 +452,7 @@
|
|||
queryParamsSon.rootId = comment.id;
|
||||
queryParamsSon.pageNum = comment.answerCommentPage;
|
||||
listComment(queryParamsSon).then(res => {
|
||||
console.log('看看子评论', res.rows);
|
||||
comment.answerCommentList.push(...res.rows);
|
||||
console.log(postCommentList.value[index]);
|
||||
});
|
||||
if (comment.answerCommentDisplayCount + increment <= comment.answerCommentAllCount) {
|
||||
comment.answerCommentDisplayCount += increment;
|
||||
|
|
Binary file not shown.
After Width: | Height: | Size: 955 B |
Loading…
Reference in New Issue