Commit 17b612dc authored by 万成波's avatar 万成波

Merge remote-tracking branch 'origin/master'

parents 5062b336 11bf8faf
...@@ -12,14 +12,9 @@ ...@@ -12,14 +12,9 @@
<view class="comment-display-box" v-else> <view class="comment-display-box" v-else>
<view class="comment-item" v-for="(item,index) in commentList"> <view class="comment-item" v-for="(item,index) in commentList">
<view class="user-info"> <view class="user-info">
<view class="username">{{item.nickName}}</view> <view style="display: flex;align-items: center;">
<view class="datetime">{{item.createTime}}</view> <view class="username">{{item.nickName}}</view>
</view> <view class="datetime">{{item.createTime}}</view>
<view class="content">
<view class="text" v-if="!item.replyNickName" @click.stop="handleReplayComment(item)">{{item.content}}</view>
<view class="text" v-else @click.stop="handleReplayComment(item)">
回复<span style="color: #0058B6;">{{item.replyNickName}}</span>{{item.content}}
</view> </view>
<view class="operation-text"> <view class="operation-text">
<view class="add-text mr10" v-if="form.isSelf==1&&activeIndex==1 &&item.isFeatured==0 &&form.isEnableFeaturedComment==1" <view class="add-text mr10" v-if="form.isSelf==1&&activeIndex==1 &&item.isFeatured==0 &&form.isEnableFeaturedComment==1"
...@@ -27,10 +22,18 @@ ...@@ -27,10 +22,18 @@
<view class="mr10" v-if="form.isSelf==1&&activeIndex==1 &&item.isFeatured==1&&form.isEnableFeaturedComment==1" @click="handleFeatured(item)"> <view class="mr10" v-if="form.isSelf==1&&activeIndex==1 &&item.isFeatured==1&&form.isEnableFeaturedComment==1" @click="handleFeatured(item)">
取消精选</view> 取消精选</view>
<view v-if="activeIndex==0&&item.isFeatured==1" style="color: #F2AC39;margin-right: 10rpx;">精选</view> <view v-if="activeIndex==0&&item.isFeatured==1" style="color: #F2AC39;margin-right: 10rpx;">精选</view>
<view v-if="item.isSelf==1" @click.stop="handleDelete(item)">删除</view> <view style="color: #bbb;" v-if="item.isSelf==1 || userInfo.bbsAdmin" @click.stop="handleDelete(item)">删除</view>
</view> </view>
</view> </view>
<view class="content">
<view class="text" v-if="!item.replyNickName" @click.stop="handleReplayComment(item)">{{item.content}}</view>
<view class="text" v-else @click.stop="handleReplayComment(item)">
回复<span style="color: #0058B6;">{{item.replyNickName}}</span>{{item.content}}
</view>
</view>
</view> </view>
<view class="show-more-box" v-if="commentList.length < total" @click="loadMore"> <view class="show-more-box" v-if="commentList.length < total" @click="loadMore">
加载更多 加载更多
...@@ -50,6 +53,7 @@ ...@@ -50,6 +53,7 @@
delComment, delComment,
dynamicDetailComments dynamicDetailComments
} from '@/api/api.js' } from '@/api/api.js'
import { getUserInfo } from '@/utils/auth';
export default { export default {
name: "Comment-Item", name: "Comment-Item",
data() { data() {
...@@ -61,7 +65,8 @@ ...@@ -61,7 +65,8 @@
pageSize: 10, pageSize: 10,
momentId: '' momentId: ''
}, },
total:0 total:0,
userInfo:{}
}; };
}, },
components: { components: {
...@@ -81,6 +86,7 @@ ...@@ -81,6 +86,7 @@
if(newVal.id){ if(newVal.id){
this.queryParams.momentId = newVal.id; this.queryParams.momentId = newVal.id;
this.commentList = []; this.commentList = [];
this.userInfo = JSON.parse(getUserInfo())
this.getCommentList() this.getCommentList()
} }
} }
...@@ -220,19 +226,22 @@ ...@@ -220,19 +226,22 @@
.user-info { .user-info {
display: flex; display: flex;
justify-content: space-between; justify-content: space-between;
font-size: 24rpx;
.username { .username {
width: calc(100% - 300rpx);
color: black; color: black;
color: #0058B6; color: #0058B6;
} }
.datetime { .datetime {
width: 290rpx; margin-left: 16rpx;
text-align: right;
color: #999999; color: #999999;
} }
.operation-text {
width: 180rpx;
text-align: right;
display: flex;
align-items: center;
justify-content: flex-end;
}
} }
.content { .content {
...@@ -244,14 +253,7 @@ ...@@ -244,14 +253,7 @@
width: calc(100% - 180rpx); width: calc(100% - 180rpx);
} }
.operation-text {
width: 180rpx;
text-align: right;
font-size: 24rpx;
display: flex;
align-items: center;
justify-content: flex-end;
}
.mr10{ .mr10{
margin-right: 12rpx; margin-right: 12rpx;
} }
......
...@@ -22,7 +22,7 @@ ...@@ -22,7 +22,7 @@
<rich-text v-if="preNodes.length > 0" :nodes="preNodes"></rich-text> <rich-text v-if="preNodes.length > 0" :nodes="preNodes"></rich-text>
<view class="imgs" v-if="form.type=='IMAGE'&&form.attachments && form.attachments.length > 0"> <view class="imgs" v-if="form.type=='IMAGE'&&form.attachments && form.attachments.length > 0">
<template v-for="(item,index) in form.attachments"> <template v-for="(item,index) in form.attachments">
<image class="item" :src="item.url" @click.stop="preview(item.url)"></image> <image class="item" :src="item.url" @click.stop="preview(form.attachments,index)"></image>
</template> </template>
</view> </view>
<view class="imgs" v-if="form.type=='VIDEO'&&form.attachments && form.attachments.length > 0"> <view class="imgs" v-if="form.type=='VIDEO'&&form.attachments && form.attachments.length > 0">
...@@ -54,7 +54,7 @@ ...@@ -54,7 +54,7 @@
</view> </view>
<view class="pk-imgs" v-if="form.voteOptionType=='IMAGE' && form.voteOptions.length>0 "> <view class="pk-imgs" v-if="form.voteOptionType=='IMAGE' && form.voteOptions.length>0 ">
<template v-for="(item,index) in form.voteOptions"> <template v-for="(item,index) in form.voteOptions">
<image :src="item.imageUrl" @click.stop="preview(item.imageUrl)" class="img"></image> <image :src="item.imageUrl" @click.stop="preview(form.voteOptions,index)" class="img"></image>
</template> </template>
</view> </view>
<!-- 未投票 --> <!-- 未投票 -->
...@@ -102,8 +102,14 @@ ...@@ -102,8 +102,14 @@
<view class="comment-display-box" v-if="form.comments&& form.comments.length>0"> <view class="comment-display-box" v-if="form.comments&& form.comments.length>0">
<view class="comment-item" v-for="(item,index) in form.comments"> <view class="comment-item" v-for="(item,index) in form.comments">
<view class="user-info"> <view class="user-info">
<view class="username">{{item.nickName}}:</view> <view style="display: flex;align-items: center;">
<view class="datetime">{{item.createTime}}</view> <view class="username">{{item.nickName}}</view>
<view class="datetime">{{item.createTime}}</view>
</view>
<view class="operation-text">
<view v-if="item.isFeatured==1" style="color: #F2AC39;margin-right: 10rpx;">精选</view>
<view style="color: #bbb;" v-if="item.isSelf==1 || userInfo.bbsAdmin" @click.stop="handleDelete(item)">删除</view>
</view>
</view> </view>
<view class="content"> <view class="content">
<view class="text" v-if="!item.replyNickName" @click.stop="handleReplayComment(item)"> <view class="text" v-if="!item.replyNickName" @click.stop="handleReplayComment(item)">
...@@ -111,11 +117,7 @@ ...@@ -111,11 +117,7 @@
</view> </view>
<view class="text" v-else @click.stop="handleReplayComment(item)"> <view class="text" v-else @click.stop="handleReplayComment(item)">
回复<span style="color: #0058B6;">{{item.replyNickName}}:</span>{{item.content}} 回复<span style="color: #0058B6;">{{item.replyNickName}}</span>{{item.content}}
</view>
<view class="operation-text">
<view v-if="item.isFeatured==1" style="color: #F2AC39;margin-right: 10rpx;">精选</view>
<view v-if="item.isSelf==1" @click.stop="handleDelete(item)">删除</view>
</view> </view>
</view> </view>
</view> </view>
...@@ -139,6 +141,7 @@ ...@@ -139,6 +141,7 @@
import PublishComment from './PublishComment.vue'; import PublishComment from './PublishComment.vue';
import VideoPreview from './VideoPreview.vue'; import VideoPreview from './VideoPreview.vue';
import emotions from '@/utils/emjo'; import emotions from '@/utils/emjo';
import { getUserInfo } from '@/utils/auth';
export default { export default {
name: "Dynamic-Item", name: "Dynamic-Item",
data() { data() {
...@@ -150,7 +153,8 @@ ...@@ -150,7 +153,8 @@
clientY: 0, clientY: 0,
showDelBtn: false, showDelBtn: false,
preNodes: [], preNodes: [],
emotions emotions,
userInfo:{}
}; };
}, },
components: { components: {
...@@ -175,6 +179,7 @@ ...@@ -175,6 +179,7 @@
if (val === oldVal) { if (val === oldVal) {
return; return;
} }
this.userInfo = JSON.parse(getUserInfo())
this.preNodes = this.formatContent(val) this.preNodes = this.formatContent(val)
} }
} }
...@@ -335,10 +340,16 @@ ...@@ -335,10 +340,16 @@
}); });
}, },
// 预览图片 // 预览图片
preview(url) { preview(list,index) {
uni.previewImage({ let urls = list.map((item)=>{
urls: [url] return item.url;
}); })
if(urls.length > 0){
uni.previewImage({
urls: urls,
current:index
});
}
}, },
//预览视频 //预览视频
videoPreview(url) { videoPreview(url) {
......
{ {
"pages": [ //pages数组中第一项表示应用启动页,参考:https://uniapp.dcloud.io/collocation/pages "pages": [ //pages数组中第一项表示应用启动页,参考:https://uniapp.dcloud.io/collocation/pages
{
"path" : "pages/login/login",
"style" :
{
"navigationBarTitleText" : ""
}
},
{ {
"path": "pages/index/index", "path": "pages/index/index",
"style": { "style": {
...@@ -15,47 +8,48 @@ ...@@ -15,47 +8,48 @@
} }
}, },
{ {
"path" : "pages/topics/topics", "path": "pages/login/login",
"style" : "style": {
{ "navigationBarTitleText": ""
"navigationBarTitleText" : "话题", }
},
{
"path": "pages/topics/topics",
"style": {
"navigationBarTitleText": "话题",
"enablePullDownRefresh": true "enablePullDownRefresh": true
} }
}, },
{ {
"path" : "pages/mine/mine", "path": "pages/mine/mine",
"style" : "style": {
{ "navigationBarTitleText": "我的"
"navigationBarTitleText" : "我的"
} }
}, },
{ {
"path" : "pages/publish/publish", "path": "pages/publish/publish",
"style" : "style": {
{ "navigationBarTitleText": "发布"
"navigationBarTitleText" : "发布"
} }
}, },
{ {
"path" : "pages/dynamic-detail/dynamic-detail", "path": "pages/dynamic-detail/dynamic-detail",
"style" : "style": {
{ "navigationBarTitleText": "动态详情"
"navigationBarTitleText" : "动态详情"
} }
}, },
{ {
"path" : "pages/topic-detail/topic-detail", "path": "pages/topic-detail/topic-detail",
"style" : "style": {
{ "navigationBarTitleText": "话题详情",
"navigationBarTitleText" : "话题详情",
"enablePullDownRefresh": true "enablePullDownRefresh": true
} }
}, },
{ {
"path" : "pages/pk-detail/pk-detail", "path": "pages/pk-detail/pk-detail",
"style" : "style": {
{ "navigationBarTitleText": "PK详情"
"navigationBarTitleText" : "PK详情"
} }
} }
], ],
...@@ -94,4 +88,4 @@ ...@@ -94,4 +88,4 @@
"text": "我的" "text": "我的"
}] }]
} }
} }
\ No newline at end of file
...@@ -52,6 +52,7 @@ ...@@ -52,6 +52,7 @@
ListEmpty ListEmpty
}, },
onLoad() { onLoad() {
this.$store.dispatch('GetInfo')
this.getList() this.getList()
let _this = this; let _this = this;
uni.$on('hanldeDynamicRefresh', function() { uni.$on('hanldeDynamicRefresh', function() {
......
...@@ -40,7 +40,6 @@ ...@@ -40,7 +40,6 @@
login(params).then(res => { login(params).then(res => {
if (res.code == 200 && res.data) { if (res.code == 200 && res.data) {
setToken(res.data) setToken(res.data)
this.$store.dispatch('GetInfo')
uni.switchTab({ uni.switchTab({
url: '/pages/index/index' url: '/pages/index/index'
}) })
...@@ -51,7 +50,6 @@ ...@@ -51,7 +50,6 @@
}) })
} }
if(res.code == 401){ if(res.code == 401){
// removeToken()
window.location = res.data window.location = res.data
} }
}) })
......
...@@ -50,6 +50,7 @@ ...@@ -50,6 +50,7 @@
grid-template-rows: auto; grid-template-rows: auto;
row-gap: 6rpx; row-gap: 6rpx;
column-gap: 6rpx; column-gap: 6rpx;
margin-top: 12rpx;
.item{ .item{
width: 100%; width: 100%;
height: 224rpx; height: 224rpx;
...@@ -237,34 +238,34 @@ ...@@ -237,34 +238,34 @@
.user-info{ .user-info{
display: flex; display: flex;
justify-content: space-between; justify-content: space-between;
font-size: 24rpx;
.username{ .username{
width: calc(100% - 300rpx);
color: black; color: black;
color:#0058B6; color:#0058B6;
} }
.datetime{ .datetime{
width: 290rpx;
text-align: right;
color: #999999; color: #999999;
} margin-left: 16rpx;
}
.content{
color: black;
margin: 10rpx 0;
display: flex;
.text {
width: calc(100% - 180rpx);
} }
.operation-text { .operation-text {
width: 180rpx; width: 180rpx;
text-align: right; text-align: right;
font-size: 24rpx;
display: flex; display: flex;
align-items: center; align-items: center;
justify-content: flex-end; justify-content: flex-end;
} }
}
.content{
color: black;
margin: 10rpx 0;
display: flex;
.text {
width: 100%;
}
.mr10{ .mr10{
margin-right: 12rpx; margin-right: 12rpx;
} }
......
...@@ -55,9 +55,14 @@ const user = { ...@@ -55,9 +55,14 @@ const user = {
}) { }) {
return new Promise((resolve, reject) => { return new Promise((resolve, reject) => {
getInfo().then(res => { getInfo().then(res => {
const user = res.data if(res.code == 200){
commit('SET_USER_INFO', JSON.stringify(user)) const user = res.data
resolve(res) commit('SET_USER_INFO', JSON.stringify(user))
resolve(res)
}
if(res.code == 401){
window.location = res.data
}
}).catch(error => { }).catch(error => {
reject(error) reject(error)
}) })
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment