提交 924de7fc 编写于 作者: R Renic1

Merge branch 'frontend' of https://gitcode.net/qq_50679803/great-teamwork into frontend

......@@ -67,7 +67,7 @@
uniCloud.callFunction({
name: 'fe-college-makePost',
data: { //向云函数中传入的数据
userId: "6450da43e1a35c371b3699cc",
userId: getApp().globalData.userId,
picture: this.img,
content: this.value1,
},
......
......@@ -27,15 +27,15 @@
<!-- 点赞和评论 -->
<view class="like-and-comment">
<!-- 删除键,只有我的帖子可见该组件 -->
<text class="del" @click="delPost" v-if="'6450da43e1a35c371b3699cc'==postDetail.ownerId">删除</text>
<text class="del" @click="delPost" v-if="userId==postDetail.ownerId">删除</text>
<view class="icon-and-num">
<image class="like-icon"
:src="postDetail.islike==1?'../../static/post/喜欢2.png':'../../static/post/喜欢.png'"
style="width: 16px;height:16px;" @click="changeLike" />
<text style="font-size: 12px;">{{postDetail.likes}}</text>
style="width: 20px;height:20px;float: left;" @click="changeLike" />
<text style="font-size: 15px;float: left;">{{postDetail.likes}}</text>
<image class="comment-icon" :src="'../../static/post/评论.png'"
style="width: 16px;height: 16px;margin-left: 10px;" @click="addComment()" />
<text style="font-size: 12px;">{{postDetail.comments}}</text>
style="width: 20px;height: 20px;margin-left: 10px;float: left;" @click="addComment()" />
<text style="font-size: 15px;float: left;">{{postDetail.comments}}</text>
</view>
</view>
......@@ -51,7 +51,7 @@
<!-- 点击进入评论 -->
<view class="comment">
<image
:src="'https://mp-6f6feaec-a026-4402-8e8d-18f7572890da.cdn.bspapp.com/cloudstorage/becea65c-89d7-4fe0-9c3f-2e08cdf911e8.jpg'"
:src="icon"
class="icon-small" />
<span @click="addComment" class="comment-buttun"><text
style="margin-left:8px;margin-top: 5px;float: left">写评论</text></span>
......@@ -123,7 +123,8 @@
],
postDetail: [],
userId:'',
icon:'',
};
},
......@@ -132,13 +133,15 @@
onLoad(e) {
//this.from=e.from;
this.postId = e.postId;
this.userId=getApp().globalData.userId;
this.icon=getApp().globalData.icon;
this.getData();
},
getData() {
uniCloud.callFunction({
name: 'fe-college-postDetail',
data: { //向云函数中传入的数据
userId: "6450da43e1a35c371b3699cc",
userId: getApp().globalData.userId,
postId: this.postId
},
})
......@@ -188,7 +191,7 @@
uniCloud.callFunction({
name: 'fe-college-commentPost',
data: { //向云函数中传入的数据
userId: "6450da43e1a35c371b3699cc",
userId: getApp().globalData.userId,
postId: this.postId,
content: value
},
......@@ -242,7 +245,7 @@
uniCloud.callFunction({
name: 'fe-college-likePost',
data: { //向云函数中传入的数据
userId: "6450da43e1a35c371b3699cc",
userId: getApp().globalData.userId,
postId: this.postId,
},
})
......@@ -261,7 +264,7 @@
uniCloud.callFunction({
name: 'fe-college-likePost',
data: { //向云函数中传入的数据
userId: "6450da43e1a35c371b3699cc",
userId: getApp().globalData.userId,
postId: this.postId,
},
})
......@@ -288,7 +291,7 @@
uniCloud.callFunction({
name: 'fe-college-likeComment',
data: { //向云函数中传入的数据
userId: "6450da43e1a35c371b3699cc",
userId: getApp().globalData.userId,
commentId: this.postDetail.commentList[index].commentId
},
})
......@@ -308,7 +311,7 @@
uniCloud.callFunction({
name: 'fe-college-likeComment',
data: { //向云函数中传入的数据
userId: "6450da43e1a35c371b3699cc",
userId: getApp().globalData.userId,
commentId: this.postDetail.commentList[index].commentId
},
})
......@@ -341,7 +344,7 @@
.del {
float: left;
font-size: 12px;
font-size: 15px;
color: lightskyblue;
}
......
......@@ -45,11 +45,11 @@
<view class="icon-and-num">
<image class="like-icon"
:src="item.islike=='1'?'../../static/post/喜欢2.png':'../../static/post/喜欢.png'"
style="width: 16px;height:16px;" @click.stop="changeAllPostLike(index)" />
<text style="font-size: 15px;">{{item.likes}}</text>
style="width: 20px;height:20px;float: left;" @click.stop="changeAllPostLike(index)" />
<text style="font-size: 15px;float: left;">{{item.likes}}</text>
<image class="comment-icon" :src="'../../static/post/评论.png'"
style="width: 16px;height: 16px;margin-left: 10px;" />
<text style="font-size: 15px;">{{item.comments}}</text>
style="width: 20px;height: 20px;margin-left: 10px;float: left;" />
<text style="font-size: 15px;float: left; ">{{item.comments}}</text>
</view>
</view>
......@@ -90,11 +90,11 @@
<view class="icon-and-num">
<image class="like-icon"
:src="item.islike=='1'?'../../static/post/喜欢2.png':'../../static/post/喜欢.png'"
style="width: 16px;height:16px;" @click.stop="changeMyPostLike(index)" />
<text style="font-size: 15px;">{{item.likes}}</text>
style="width: 20px;height:20px;float: left;" @click.stop="changeAllPostLike(index)" />
<text style="font-size: 15px;float: left;">{{item.likes}}</text>
<image class="comment-icon" :src="'../../static/post/评论.png'"
style="width: 16px;height: 16px;margin-left: 10px;" />
<text style="font-size: 15px;">{{item.comments}}</text>
style="width: 20px;height: 20px;margin-left: 10px;float: left;" />
<text style="font-size: 15px;float: left; ">{{item.comments}}</text>
</view>
</view>
......@@ -113,6 +113,7 @@
onPullDownRefresh() {
this.getAllPost();
this.getMyPost();
uni.stopPullDownRefresh();
},
onLoad() {
......@@ -181,7 +182,7 @@
uniCloud.callFunction({
name: 'fe-college-postList',
data: { //向云函数中传入的数据
uid: "6450da43e1a35c371b3699cc"
uid: getApp().globalData.userId
},
})
.then(res => {
......@@ -196,7 +197,7 @@
uniCloud.callFunction({
name: 'fe-college-myPostList',
data: { //向云函数中传入的数据
userId: "6450da43e1a35c371b3699cc"
userId: getApp().globalData.userId
},
})
.then(res => {
......@@ -226,7 +227,7 @@
uniCloud.callFunction({
name: 'fe-college-likePost',
data: { //向云函数中传入的数据
userId: "6450da43e1a35c371b3699cc",
userId: getApp().globalData.userId,
postId: this.allPost[index].postId,
},
})
......@@ -244,7 +245,7 @@
uniCloud.callFunction({
name: 'fe-college-likePost',
data: { //向云函数中传入的数据
userId: "6450da43e1a35c371b3699cc",
userId: getApp().globalData.userId,
postId: this.allPost[index].postId,
},
})
......@@ -271,7 +272,7 @@
uniCloud.callFunction({
name: 'fe-college-likePost',
data: { //向云函数中传入的数据
userId: "6450da43e1a35c371b3699cc",
userId: getApp().globalData.userId,
postId: this.myPost[index].postId,
},
})
......@@ -289,7 +290,7 @@
uniCloud.callFunction({
name: 'fe-college-likePost',
data: { //向云函数中传入的数据
userId: "6450da43e1a35c371b3699cc",
userId: getApp().globalData.userId,
postId: this.myPost[index].postId,
},
})
......@@ -374,7 +375,7 @@
.one-img {
float: left;
width: 32%;
height: 70px;
height: 80px;
margin-left: 2px;
margin-top: 2px;
}
......@@ -382,7 +383,7 @@
.single-pic {
width: 100%;
border-radius: 5px;
height: 200px;
height: 250px;
}
.post-pic {
......
......@@ -30,7 +30,6 @@
export default {
data() {
return {
userId: '644a643a0c801ca878983559',
info: {
type: '跑步',
distance: 0,
......@@ -52,7 +51,7 @@
uniCloud.callFunction({
name: 'fe-sport-index',
data: {
userId: this.userId,
userId: getApp().globalData.userId,
type: this.info.type
}
})
......@@ -82,18 +81,17 @@
}
},
onLoad() {
this.userId=getApp().globalData.userId
uniCloud.callFunction({
name: 'fe-sport-index',
data: {
userId: this.userId,
userId: getApp().globalData.userId,
type: '跑步'
}
})
.then(res => {
console.log(res)
this.distance = res.result.data.totalRunningDistance
this.rank = res.result.data.totalRunningRank
this.info.distance = res.result.data.totalRunningDistance
this.info.rank = res.result.data.totalRunningRank
})
}
}
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册