Commit 40bad449 authored by yuwenwen's avatar yuwenwen

移动端调整

parent 28d41209
.DS_Store
node_modules/
unpackage/
dist/
npm-debug.log*
yarn-debug.log*
yarn-error.log*
**/*.log
tests/**/coverage/
tests/e2e/reports
selenium-debug.log
# Editor directories and files
.idea
.vscode
*.suo
*.ntvs*
*.njsproj
*.sln
*.local
package-lock.json
yarn.lock
...@@ -9,53 +9,155 @@ ...@@ -9,53 +9,155 @@
<image src="/static/images/empty.png" class="icon"></image> <image src="/static/images/empty.png" class="icon"></image>
<view class="text">期待您的经常评论~</view> <view class="text">期待您的经常评论~</view>
</view> </view>
<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-new" v-for="(item,index) in commentList">
<view class="user-info"> <block v-if="activeIndex==0">
<view style="display: flex;align-items: center;"> <!-- PK评论展示红蓝方 -->
<view class="username">{{item.nickName}}</view> <block v-if="form.isEnableVote == 1">
<!-- 红方 -->
<view class="user-info" v-if="item.voteOptionCode=='1'">
<view class="flex-layout">
<!-- 是否精选 -->
<view class="tag rmark-icon mr-10" v-if="item.isFeatured">
<image src="/static/images/is-featured.png" class="icon"></image>
</view>
<!-- 是否置顶 -->
<view class="tag rmark-icon mr-10" v-if="item.isTop">
<image src="/static/images/is-top.png" class="icon"></image>
</view>
<view class="tag red-tag"></view>
<view class="username ml-10">{{item.nickName}}</view>
</view>
<view class="flex-layout">
<view class="datetime">{{item.createTime}}</view> <view class="datetime">{{item.createTime}}</view>
<image src="/static/images/more-icon.png" class="more ml-10"
@click.stop="(e)=>handleOperationDynamics(e,item)"></image>
</view>
</view>
<view class="user-info" v-else>
<view class="flex-layout">
<image src="/static/images/more-icon.png" class="more mr-10"
@click.stop="(e)=>handleOperationDynamics(e,item)"></image>
<view class="datetime">{{item.createTime}}</view>
</view>
<view class="flex-layout">
<view class="username mr-10">{{item.nickName}}</view>
<view class="tag blue-tag"></view>
<!-- 是否精选 -->
<view class="tag rmark-icon ml-10" v-if="item.isFeatured">
<image src="/static/images/is-featured.png" class="icon"></image>
</view>
<!-- 是否置顶 -->
<view class="tag rmark-icon ml-10" v-if="item.isTop">
<image src="/static/images/is-top.png" class="icon"></image>
</view>
</view>
</view>
<view class="content" v-if="item.voteOptionCode=='1'">
<view class="text " @click.stop="handleReplayComment(item)">
{{item.content}}
</view>
<view class="replay-content" v-if="item.replyNickName"
@click.stop="handleReplayComment(item)">
<span>{{item.replyNickName}}</span>{{item.replyContent}}
</view>
</view>
<view class="content" v-if="item.voteOptionCode=='2'">
<view class="text text-blue" @click.stop="handleReplayComment(item)">
{{item.content}}
</view>
<view class="blue-content">
<view class="replay-content" v-if="item.replyNickName"
@click.stop="handleReplayComment(item)">
<span>{{item.replyNickName}}</span>{{item.replyContent}}
</view> </view>
<view class="operation-text">
<view class="add-text mr10"
v-if="form.isSelf==1&&activeIndex==1 &&item.isFeatured==0 &&form.isEnableFeaturedComment==1"
@click="handleFeatured(item)">加入精选</view>
<view class="mr10"
v-if="form.isSelf==1&&activeIndex==1 &&item.isFeatured==1&&form.isEnableFeaturedComment==1"
@click="handleFeatured(item)">
取消精选</view>
<view v-if="activeIndex==0&&item.isFeatured==1" style="color: #F2AC39;margin-right: 10rpx;">精选
</view> </view>
<view v-if="activeIndex==0&&form.isSelf==1 && item.isTop==0" class="add-text mr10" </view>
@click="handleIsTop(item,1)">置顶</view> </block>
<view class="add-text mr10" v-if="form.isSelf==1&&activeIndex==0 && item.isTop==1" <!-- 非PK评论正常展示 -->
@click="handleIsTop(item,0)"> <block v-else>
取消置顶</view> <view class="user-info">
<view class="flex-layout">
<!-- 是否精选 -->
<view style="color: #bbb;margin-left: 10rpx;" v-if="item.isSelf==1 || userInfo.bbsAdmin" <view class="tag rmark-icon mr-10" v-if="item.isFeatured">
@click.stop="handleDelete(item)">删除</view> <image src="/static/images/is-featured.png" class="icon"></image>
</view>
<!-- 是否置顶 -->
<view class="tag rmark-icon mr-10" v-if="item.isTop">
<image src="/static/images/is-top.png" class="icon"></image>
</view>
<view class="username ml-10">{{item.nickName}}</view>
</view>
<view class="flex-layout">
<view class="datetime">{{item.createTime}}</view>
<image src="/static/images/more-icon.png" class="more ml-10"
@click.stop="(e)=>handleOperationDynamics(e,item)"> </image>
</view> </view>
</view> </view>
<view class="content"> <view class="content">
<view class="text" v-if="!item.replyNickName" @click.stop="handleReplayComment(item)"> <view class="text" @click.stop="handleReplayComment(item)">
{{item.content}} {{item.content}}
</view> </view>
<view class="replay-content" v-if="item.replyNickName"
<view class="text" v-else @click.stop="handleReplayComment(item)"> @click.stop="handleReplayComment(item)">
回复<span style="color: #0058B6;">{{item.replyNickName}}</span>{{item.content}} <span>{{item.replyNickName}}</span>{{item.replyContent}}
</view> </view>
</view> </view>
</block>
</block>
<block v-if="activeIndex==1">
<view class="user-info">
<view class="flex-layout">
<!-- 是否精选 -->
<view class="tag rmark-icon mr-10" v-if="item.isFeatured">
<image src="/static/images/is-featured.png" class="icon"></image>
</view>
<!-- 是否置顶 -->
<view class="tag rmark-icon mr-10" v-if="item.isTop">
<image src="/static/images/is-top.png" class="icon"></image>
</view>
<view class="tag red-tag" v-if="item.voteOptionCode=='1'"></view>
<view class="tag blue-tag" v-if="item.voteOptionCode=='2'"></view>
<view class="username ml-10">{{item.nickName}}</view>
</view> </view>
<view class="flex-layout">
<view class="datetime">{{item.createTime}}</view>
<image src="/static/images/more-icon.png" class="more ml-10"
@click.stop="(e)=>handleOperationDynamics(e,item)"></image>
</view>
</view>
<view class="content">
<view class="text" @click.stop="handleReplayComment(item)">
{{item.content}}
</view>
<view class="replay-content" v-if="item.replyNickName" @click.stop="handleReplayComment(item)">
<span>{{item.replyNickName}}</span>{{item.replyContent}}
</view>
</view>
</block>
<view class="show-more-box" v-if="commentList.length < total" @click="loadMore"> <view class="show-more-box" v-if="commentList.length < total" @click="loadMore">
加载更多 加载更多
<image src="/static/images/down.png" class="icon"></image> <image src="/static/images/down.png" class="icon"></image>
</view> </view>
</view>
</view>
<!-- 操作按钮 -->
<view class="operation-box" v-if="showOperationBtn"
:style="'left:' + clientX + 'rpx;' +'top:' + clientY + 'rpx'">
<view class="item del-item" v-if="operationItem.isSelf==1 || userInfo.bbsAdmin"
@click.stop="handleDelete(operationItem)">删除</view>
<view class="item" v-if="activeIndex==1 && operationItem.isTop==0"
@click="handleIsTop(operationItem,1)">置顶</view>
<view class="item" v-if="activeIndex==1 && operationItem.isTop==1"
@click="handleIsTop(operationItem,0)">取消置顶</view>
<view class="item" v-if="activeIndex==1 &&operationItem.isFeatured==0 &&form.isEnableFeaturedComment==1"
@click="handleFeatured(operationItem)">加入精选</view>
<view class="item" v-if="activeIndex==1 &&operationItem.isFeatured==1&&form.isEnableFeaturedComment==1"
@click="handleFeatured(operationItem)">取消精选</view>
</view>
</view>
<!-- 打开评论 --> <!-- 打开评论 -->
<publish-comment :form="form" ref="publishCommentRef" @refresh="handleRefresh"></publish-comment> <publish-comment :form="form" ref="publishCommentRef" @refresh="handleRefresh"></publish-comment>
</view> </view>
...@@ -84,7 +186,11 @@ ...@@ -84,7 +186,11 @@
momentId: '' momentId: ''
}, },
total: 0, total: 0,
userInfo: {} userInfo: {},
showOperationBtn: false,
clientX: 0,
clientY: 0,
operationItem: {}
}; };
}, },
components: { components: {
...@@ -115,6 +221,7 @@ ...@@ -115,6 +221,7 @@
methods: { methods: {
handleChange(index) { handleChange(index) {
this.activeIndex = index this.activeIndex = index
this.showOperationBtn = false
}, },
handleRefresh() { handleRefresh() {
this.queryParams.pageNum = 1; this.queryParams.pageNum = 1;
...@@ -154,10 +261,12 @@ ...@@ -154,10 +261,12 @@
uni.showToast({ uni.showToast({
title: `${text}成功` title: `${text}成功`
}) })
_this.showOperationBtn = false
_this.handleRefresh() _this.handleRefresh()
} }
}) })
} else if (res.cancel) { } else if (res.cancel) {
_this.showOperationBtn = false
console.log('用户点击取消'); console.log('用户点击取消');
} }
} }
...@@ -175,10 +284,12 @@ ...@@ -175,10 +284,12 @@
uni.showToast({ uni.showToast({
title: `删除成功` title: `删除成功`
}) })
_this.showOperationBtn = false
_this.handleRefresh() _this.handleRefresh()
} }
}) })
} else if (res.cancel) { } else if (res.cancel) {
_this.showOperationBtn = false
console.log('用户点击取消'); console.log('用户点击取消');
} }
} }
...@@ -190,7 +301,7 @@ ...@@ -190,7 +301,7 @@
let data = { let data = {
isTop, isTop,
commentId: item.id, commentId: item.id,
momentId:this.form.id, momentId: this.form.id,
} }
let msg = `确认要${text}评论内容为:${item.content}的数据吗?` let msg = `确认要${text}评论内容为:${item.content}的数据吗?`
uni.showModal({ uni.showModal({
...@@ -203,15 +314,32 @@ ...@@ -203,15 +314,32 @@
uni.showToast({ uni.showToast({
title: `${text}成功` title: `${text}成功`
}) })
_this.showOperationBtn = false
_this.handleRefresh() _this.handleRefresh()
} }
}) })
} else if (res.cancel) { } else if (res.cancel) {
_this.showOperationBtn = false
console.log('用户点击取消'); console.log('用户点击取消');
} }
} }
}); });
},
// 展示删除动态按钮
handleOperationDynamics(e, item) {
this.showOperationBtn = !this.showOperationBtn
this.operationItem = {
...item
}
if (e.target.offsetLeft < 100) {
this.clientX = (e.target.offsetLeft * 2);
this.clientY = ((e.target.offsetTop * 2) + 14);
} else {
this.clientX = (e.target.offsetLeft * 2 - 148);
this.clientY = ((e.target.offsetTop * 2) + 34);
} }
},
} }
} }
</script> </script>
...@@ -267,6 +395,126 @@ ...@@ -267,6 +395,126 @@
margin-top: 32rpx; margin-top: 32rpx;
padding: 24rpx 20rpx; padding: 24rpx 20rpx;
box-sizing: border-box; box-sizing: border-box;
position: relative;
.comment-item-new {
font-size: 28rpx;
.user-info {
display: flex;
justify-content: space-between;
align-items: center;
.flex-layout {
display: flex;
align-items: center;
height: 100%;
}
.flex-end {
display: flex;
align-items: center;
justify-content: flex-end;
}
.tag {
width: 40rpx;
height: 40rpx;
border-radius: 6rpx;
font-size: 24rpx;
display: flex;
align-items: center;
justify-content: center;
font-weight: bold;
}
.red-tag {
background-color: rgba(255, 100, 95, 0.1);
color: rgba(255, 100, 95, 1);
}
.blue-tag {
background-color: rgba(52, 132, 253, 0.1);
color: rgba(52, 132, 253, 1);
}
.rmark-icon {
background-color: rgba(242, 172, 57, 0.1);
color: rgba(255, 100, 95, 1);
.icon {
width: 24rpx;
height: 24rpx;
}
}
.username {
color: black;
color: #0058B6;
}
.ml-10 {
margin-left: 10rpx;
}
.mr-10 {
margin-right: 10rpx;
}
.datetime {
margin-left: 16rpx;
color: #999999;
font-size: 24rpx;
}
.more {
width: 32rpx;
height: 32rpx;
}
}
.blue-content {
display: flex;
align-items: center;
justify-content: flex-end;
}
.content {
color: black;
margin: 10rpx 0;
.text {
width: 100%;
word-wrap: break-word;
word-break: break-all;
padding: 0 10rpx;
box-sizing: border-box;
}
.text-blue {
text-align: right;
}
.mr10 {
margin-right: 12rpx;
}
.add-text {
color: #0058B6;
}
}
.replay-content {
padding: 6rpx 12rpx;
box-sizing: border-box;
background-color: rgba(238, 238, 238, 1);
width: fit-content;
margin-top: 8rpx;
}
}
.comment-item { .comment-item {
.user-info { .user-info {
...@@ -299,7 +547,7 @@ ...@@ -299,7 +547,7 @@
display: flex; display: flex;
.text { .text {
width: calc(100% - 180rpx); width: 100%;
word-wrap: break-word; word-wrap: break-word;
word-break: break-all; word-break: break-all;
} }
...@@ -330,4 +578,28 @@ ...@@ -330,4 +578,28 @@
height: 32rpx; height: 32rpx;
} }
} }
.operation-box {
position: absolute;
width: 152rpx;
border-radius: 6rpx;
background-color: rgba(255, 255, 255, 1);
color: rgba(102, 102, 102, 1);
font-size: 26rpx;
text-align: center;
box-shadow: 0px 2px 12rpx 0px rgba(0, 0, 0, 0.2);
padding: 10rpx 0;
color: rgba(16, 16, 16, 1);
.item {
height: 56rpx;
line-height: 56rpx;
}
.del-item {
color: #ff645f;
}
}
</style> </style>
\ No newline at end of file
...@@ -2,8 +2,8 @@ ...@@ -2,8 +2,8 @@
<view> <view>
<view class="dynamic-item" @click="toDynamicDetailPage"> <view class="dynamic-item" @click="toDynamicDetailPage">
<view class="user-info-box" style="position: relative;"> <view class="user-info-box" style="position: relative;">
<image class="avatar" v-if="form.avatar" :src="form.avatar"></image> <image class="avatar" v-if="form.faceImg" :src="form.faceImg" @error="imgLoadFail"></image>
<image class="avatar" v-else src="/static/images/default-avatar.png"></image> <!-- <image class="avatar" v-else src="/static/images/default-avatar.png"></image> -->
<view class="user-name">{{form.nickName}}</view> <view class="user-name">{{form.nickName}}</view>
<image v-if="deleteable || userInfo.bbsAdmin || form.isSelf==1" class="more-icon" <image v-if="deleteable || userInfo.bbsAdmin || form.isSelf==1" class="more-icon"
@click.stop="handleDelDynamics" src="/static/images/more-icon.png"></image> @click.stop="handleDelDynamics" src="/static/images/more-icon.png"></image>
...@@ -35,6 +35,7 @@ ...@@ -35,6 +35,7 @@
</view> </view>
<view class="datetime-box">{{form.createTime}}</view> <view class="datetime-box">{{form.createTime}}</view>
<view class="operation-box"> <view class="operation-box">
<view class="flex-layout">
<view class="favorite-box"> <view class="favorite-box">
<image src="/static/images/favorite.png" v-if="form.isLike==0" class="icon" <image src="/static/images/favorite.png" v-if="form.isLike==0" class="icon"
@click.stop="handleUpdateLikeStatus(1)"></image> @click.stop="handleUpdateLikeStatus(1)"></image>
...@@ -42,7 +43,12 @@ ...@@ -42,7 +43,12 @@
@click.stop="handleUpdateLikeStatus(0)" class="icon"></image> @click.stop="handleUpdateLikeStatus(0)" class="icon"></image>
<view class="num">{{form.likeCount}}</view> <view class="num">{{form.likeCount}}</view>
</view> </view>
<view class="comment-box" @click.stop="handleOpenComment"> <view class="favorite-box ml-10">
<image src="/static/images/comment.png" class="icon"></image>
<view class="num">{{form.commentCount}}</view>
</view>
</view>
<view class="comment-box" v-if="displayComment" @click.stop="handleOpenComment">
<image class="icon" src="/static/images/comment-icon.png"></image> <image class="icon" src="/static/images/comment-icon.png"></image>
<view class="text">评论</view> <view class="text">评论</view>
</view> </view>
...@@ -53,14 +59,14 @@ ...@@ -53,14 +59,14 @@
<image src="/static/images/pk-icon.png" class="pk-icon"></image> <image src="/static/images/pk-icon.png" class="pk-icon"></image>
<view class="pk-title-text">{{form.voteTitle}}</view> <view class="pk-title-text">{{form.voteTitle}}</view>
</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&&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(form.voteOptions,index)" class="img"></image> <image :src="item.imageUrl" @click.stop="preview(form.voteOptions,index)" class="img"></image>
</template> </template>
</view> </view>
<!-- 未投票 --> <!-- 未投票 -->
<view v-if="form.isVote==0"> <view v-if="form.isVote==0">
<view class="pk-btns" v-if="form.voteOptions.length>0 "> <view class="pk-btns" v-if="form.voteOptions&&form.voteOptions&&form.voteOptions.length>0 ">
<view class="btns red-btn" @click.stop="handleVote(form.voteOptions[0])"> <view class="btns red-btn" @click.stop="handleVote(form.voteOptions[0])">
{{form.voteOptions[0].name}} {{form.voteOptions[0].name}}
</view> </view>
...@@ -77,17 +83,18 @@ ...@@ -77,17 +83,18 @@
<view class="left" @click.stop="toPKDetailPage(0)"> <view class="left" @click.stop="toPKDetailPage(0)">
<view class="left-num">{{form.voteOptions[0].name}} {{form.voteOptions[0].voteCount}}</view> <view class="left-num">{{form.voteOptions[0].name}} {{form.voteOptions[0].voteCount}}</view>
</view> </view>
<view class="right" @click.stop="toPKDetailPage(1)"> <view class="left" :style="'width:' + ((form.voteOptions[0].voteCount/(form.voteOptions[0].voteCount+form.voteOptions[1].voteCount))*100)+'%'"
<view class="right-num">{{form.voteOptions[1].name}} {{form.voteOptions[1].voteCount}} @click.stop="toPKDetailPage(0)">
</view> <view class="results-item left-item"></view>
</view> </view>
</view> </view>
<view class="pk-results"> <view class="pk-results">
<view class="left" :style="'flex:' + form.voteOptions[0].voteCount" <view class="right" @click.stop="toPKDetailPage(1)">
@click.stop="toPKDetailPage(0)"> <view class="right-num">{{form.voteOptions[1].name}} {{form.voteOptions[1].voteCount}}
<view class="results-item left-item"></view> </view>
</view> </view>
<view class="right" :style="'flex:' + form.voteOptions[1].voteCount" <view class="right" :style="'width:' + ((form.voteOptions[1].voteCount/(form.voteOptions[0].voteCount+form.voteOptions[1].voteCount))*100)+'%'"
@click.stop="toPKDetailPage(1)"> @click.stop="toPKDetailPage(1)">
<view class="results-item right-item"></view> <view class="results-item right-item"></view>
</view> </view>
...@@ -99,7 +106,7 @@ ...@@ -99,7 +106,7 @@
</view> </view>
</view> </view>
<!-- 评论区 --> <!-- 评论区 -->
<view class="comment-box" v-if="form.isEnableComment==1"> <!-- <view class="comment-box" v-if="form.isEnableComment==1">
<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">
...@@ -124,7 +131,7 @@ ...@@ -124,7 +131,7 @@
</view> </view>
</view> </view>
</view> </view>
</view> </view> -->
</view> </view>
<!-- 发布评论区 --> <!-- 发布评论区 -->
<publish-comment :form="form" ref="publishCommentRef" @refresh="$emit('refresh')"></publish-comment> <publish-comment :form="form" ref="publishCommentRef" @refresh="$emit('refresh')"></publish-comment>
...@@ -143,9 +150,11 @@ ...@@ -143,9 +150,11 @@
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 defalutAvatar from '/static/images/default-avatar.png'
import { import {
getUserInfo getUserInfo
} from '@/utils/auth'; } from '@/utils/auth';
import {generateSignature} from '@/utils/common.js';
export default { export default {
name: "Dynamic-Item", name: "Dynamic-Item",
data() { data() {
...@@ -173,6 +182,10 @@ ...@@ -173,6 +182,10 @@
deleteable: { deleteable: {
type: Boolean, type: Boolean,
default: false default: false
},
displayComment:{
type: Boolean,
default: true
} }
}, },
watch: { watch: {
...@@ -184,6 +197,7 @@ ...@@ -184,6 +197,7 @@
return; return;
} }
this.userInfo = JSON.parse(JSON.parse(getUserInfo())) this.userInfo = JSON.parse(JSON.parse(getUserInfo()))
this.form.faceImg = generateSignature(this.userInfo.userName)
this.preNodes = this.formatContent(val) this.preNodes = this.formatContent(val)
} }
} }
...@@ -282,7 +296,24 @@ ...@@ -282,7 +296,24 @@
// 打开评论区 // 打开评论区
handleOpenComment() { handleOpenComment() {
// this.showComment = true // this.showComment = true
const {isEnableVote,isVote} = this.form;
// 如果开启pk,则必须先已经投票才可以评论
if(isEnableVote == 1){
if(isVote == 1){
this.$refs.publishCommentRef.openModal() this.$refs.publishCommentRef.openModal()
}else{
uni.showToast({
title: '请先点击上方PK按钮,选择你的观点后才可进行评论',
icon:'none',
duration:3000
})
return;
}
}else{
this.$refs.publishCommentRef.openModal()
}
}, },
// 回复评论 // 回复评论
handleReplayComment(item) { handleReplayComment(item) {
...@@ -330,6 +361,7 @@ ...@@ -330,6 +361,7 @@
uni.showToast({ uni.showToast({
title: '投票成功' title: '投票成功'
}) })
uni.$emit('hanldeDynamicRefresh')
this.$emit('refreshCurrent', this.form.id) this.$emit('refreshCurrent', this.form.id)
} }
}) })
...@@ -369,6 +401,9 @@ ...@@ -369,6 +401,9 @@
}); });
} }
}, },
imgLoadFail() {
this.userInfo.faceImg = defalutAvatar
},
//预览视频 //预览视频
videoPreview(url) { videoPreview(url) {
this.$refs.videoPreviewRef.openModal(url) this.$refs.videoPreviewRef.openModal(url)
......
...@@ -4,14 +4,20 @@ const CONFIG = { ...@@ -4,14 +4,20 @@ const CONFIG = {
debug: true, debug: true,
platformName: '社区', platformName: '社区',
requestUrl: 'http://192.168.5.177:8089', requestUrl: 'http://192.168.5.177:8089',
videoLimitSize:10 videoLimitSize: 10,
secret: '775d4e98-49d8-86d7-48c9-c93b5f7c0c16',
appId: 'jfsq',
faceBaseUrl: 'https://photo.jift.edu.cn/preview/main/'
}, },
//生产环境配置 //生产环境配置
production: { production: {
debug: false, debug: false,
platformName: '社区', platformName: '社区',
requestUrl: '/bbs/prod-api', requestUrl: '/bbs/prod-api',
videoLimitSize:10 videoLimitSize: 10,
secret: '775d4e98-49d8-86d7-48c9-c93b5f7c0c16',
appId: 'jfsq',
faceBaseUrl: 'https://photo.jift.edu.cn/preview/main/'
} }
} }
......
<template> <template>
<view class="detail-page-container"> <view class="detail-page-container">
<dynamic-item :form="form" @refresh="handleRefresh" @deleteSuccess="deleteSuccess"></dynamic-item> <dynamic-item :form="form" @refresh="handleRefresh" @refreshCurrent="handleRefresh" @deleteSuccess="deleteSuccess"></dynamic-item>
<!-- 评论管理区 --> <!-- 评论管理区 -->
<comment-item :form="form" ></comment-item> <comment-item :form="form" ></comment-item>
</view> </view>
......
...@@ -11,20 +11,13 @@ ...@@ -11,20 +11,13 @@
<scroll-view class="scroll-view-index" scroll-y :show-scrollbar="false" v-if="list.length>0" <scroll-view class="scroll-view-index" scroll-y :show-scrollbar="false" v-if="list.length>0"
@scrolltolower="loadMore"> @scrolltolower="loadMore">
<template v-for="(item,index) in list"> <template v-for="(item,index) in list">
<dynamic-item :form="item" @refresh="refreshContentList" <dynamic-item :form="item" :displayComment="false" @refresh="refreshContentList"
@refreshCurrent="refreshCurrent"></dynamic-item> @refreshCurrent="refreshCurrent"></dynamic-item>
</template> </template>
</scroll-view> </scroll-view>
<scroll-view class="scroll-view-index" scroll-y :show-scrollbar="false" v-else> <scroll-view class="scroll-view-index" scroll-y :show-scrollbar="false" v-else>
<list-empty></list-empty> <list-empty></list-empty>
</scroll-view> </scroll-view>
<!-- 发布按钮 -->
<!-- <movable-area class="movable-area">
<movable-view class="add-dynamic-box move-button" :x="area.x+'rpx'" :y="area.y + 'rpx'" direction="all"
@change="onChange" damping="30" @click="toPublishPage">
<image class="icon" src="/static/images/publish-icon.png"></image>
</movable-view>
</movable-area> -->
<!-- 发布按钮 --> <!-- 发布按钮 -->
<view class="add-dynamic-box" @click="toPublishPage" :style="{ left: iconLeft + 'px', top: iconTop + 'px' }" <view class="add-dynamic-box" @click="toPublishPage" :style="{ left: iconLeft + 'px', top: iconTop + 'px' }"
......
...@@ -6,8 +6,8 @@ ...@@ -6,8 +6,8 @@
</view> </view>
</view> </view>
<view class="publish-box"> <view class="publish-box">
<textarea class="textarea" v-model="form.content" placeholder="分享有趣事~" <textarea class="textarea" v-model="form.content" placeholder="分享有趣事~" placeholder-class="placeholder-class"
placeholder-class="placeholder-class" @focus="handleFocus" /> @focus="handleFocus" />
<image-upload v-model="form.attachments" ref="uploadRef" :limit="9" :showEmjo="showEmjo" :showIcons="true" <image-upload v-model="form.attachments" ref="uploadRef" :limit="9" :showEmjo="showEmjo" :showIcons="true"
@componentsType="handleSetComponentsType" @handleTopic="handleOpenTopicSelection" @componentsType="handleSetComponentsType" @handleTopic="handleOpenTopicSelection"
@handleEmjo="handleAddEmjo"></image-upload> @handleEmjo="handleAddEmjo"></image-upload>
...@@ -33,7 +33,7 @@ ...@@ -33,7 +33,7 @@
<!-- pk数据编辑 --> <!-- pk数据编辑 -->
<view class="pk-edit-box" v-if="form.isEnableVote==1"> <view class="pk-edit-box" v-if="form.isEnableVote==1">
<view class="textarea-box"> <view class="textarea-box">
<textarea class="textarea" v-model="form.voteTitle" maxlength="12" placeholder="请输入PK标题~(0/12)" <textarea class="textarea" v-model="form.voteTitle" maxlength="50" placeholder="请输入PK标题~(0/50)"
placeholder-class="placeholder-class" /> placeholder-class="placeholder-class" />
</view> </view>
<view class="pk-type-box"> <view class="pk-type-box">
...@@ -41,7 +41,7 @@ ...@@ -41,7 +41,7 @@
<label class="radio" style="margin-right: 40rpx;"> <label class="radio" style="margin-right: 40rpx;">
<radio value="TEXT" :checked="form.voteOptionType=='TEXT'" />文字PK <radio value="TEXT" :checked="form.voteOptionType=='TEXT'" />文字PK
</label> </label>
<label class="radio" > <label class="radio">
<radio value="IMAGE" :checked="form.voteOptionType=='IMAGE'" />图片PK <radio value="IMAGE" :checked="form.voteOptionType=='IMAGE'" />图片PK
</label> </label>
</radio-group> </radio-group>
...@@ -50,24 +50,26 @@ ...@@ -50,24 +50,26 @@
<view class="choice-item"> <view class="choice-item">
<image-upload v-model="voteOptionsAffirmative" :limit="1" :width="120" :height="120" <image-upload v-model="voteOptionsAffirmative" :limit="1" :width="120" :height="120"
:showIcons="false"></image-upload> :showIcons="false"></image-upload>
<input class="text" v-model="form.voteOptions[0].name" placeholder="请输入选项1(4字以内)" /> <input class="text" maxlength="16" v-model="form.voteOptions[0].name"
placeholder="请输入选项1(16字以内)" />
</view> </view>
<view class="choice-item"> <view class="choice-item">
<image-upload v-model="voteOptionsOpposing" :limit="1" :width="120" :height="120" <image-upload v-model="voteOptionsOpposing" :limit="1" :width="120" :height="120"
:showIcons="false"></image-upload> :showIcons="false"></image-upload>
<input class="text" v-model="form.voteOptions[1].name" placeholder="请输入选项2(4字以内)" /> <input class="text" maxlength="16" v-model="form.voteOptions[1].name"
placeholder="请输入选项2(16字以内)" />
</view> </view>
</view> </view>
<view class="choice-box" v-if="form.voteOptionType=='TEXT'"> <view class="choice-box" v-if="form.voteOptionType=='TEXT'">
<view class="choice-item text-item"> <view class="choice-item text-item">
<view class="label">选项1</view> <view class="label">选项1</view>
<input class="text" maxlength="4" v-model="form.voteOptions[0].name" <input class="text" maxlength="16" v-model="form.voteOptions[0].name"
placeholder="请输入选项1(4字以内)" /> placeholder="请输入选项1(16字以内)" />
</view> </view>
<view class="choice-item text-item"> <view class="choice-item text-item">
<view class="label">选项2</view> <view class="label">选项2</view>
<input class="text" maxlength="4" v-model="form.voteOptions[1].name" <input class="text" maxlength="16" v-model="form.voteOptions[1].name"
placeholder="请输入选项2(4字以内)" /> placeholder="请输入选项2(16字以内)" />
</view> </view>
</view> </view>
</view> </view>
...@@ -155,7 +157,7 @@ ...@@ -155,7 +157,7 @@
voteOptionsAffirmative: [], voteOptionsAffirmative: [],
voteOptionsOpposing: [], voteOptionsOpposing: [],
emotions, emotions,
showEmjo:false showEmjo: false
} }
}, },
components: { components: {
...@@ -274,6 +276,7 @@ ...@@ -274,6 +276,7 @@
handleCloseTopicSelection() { handleCloseTopicSelection() {
this.showTopicSelection = false, this.showTopicSelection = false,
this.topicResultList = undefined this.topicResultList = undefined
this.topicParams.name = ''
}, },
// 搜索话题 // 搜索话题
handleSearchTopic() { handleSearchTopic() {
...@@ -306,12 +309,13 @@ ...@@ -306,12 +309,13 @@
}, },
// 删除话题 // 删除话题
handleDeleteTopic(index) { handleDeleteTopic(index) {
let _this = this;
uni.showModal({ uni.showModal({
title: '提示', title: '提示',
content: '是否取消选择话题', content: '是否取消选择话题',
success: function(res) { success: function(res) {
if (res.confirm) { if (res.confirm) {
this.topicList.splice(index, 1) _this.topicList.splice(index, 1)
} else if (res.cancel) { } else if (res.cancel) {
console.log('用户点击取消'); console.log('用户点击取消');
} }
...@@ -320,7 +324,7 @@ ...@@ -320,7 +324,7 @@
}, },
// textarea聚焦时关闭表情窗口 // textarea聚焦时关闭表情窗口
handleFocus(){ handleFocus() {
this.$refs.uploadRef.closeEmjo() this.$refs.uploadRef.closeEmjo()
}, },
// 添加表情 // 添加表情
......
...@@ -31,16 +31,17 @@ $common-width:94vw; ...@@ -31,16 +31,17 @@ $common-width:94vw;
// 话题容器样式 // 话题容器样式
.topic-box-common { .topic-box-common {
height: 52rpx; // height: 52rpx;
padding: 0 20rpx;
background-color: rgba(0, 123, 255, 0.1); background-color: rgba(0, 123, 255, 0.1);
color: $color-main-blue; color: $color-main-blue;
border-radius: 26rpx; font-size: 26rpx; /* 基准字体大小 */
line-height: 52rpx; padding: 10rpx 16px; /* 只左右内边距,高度由line-height决定 */
margin-right: 20rpx; border-radius: 2em; /* 1em = 16px = 高度32px的50% */
height: fit-content;
margin-bottom: 10rpx; margin-bottom: 10rpx;
} }
.search-box-common{ .search-box-common{
height: 76rpx; height: 76rpx;
width: $common-width; width: $common-width;
......
...@@ -70,6 +70,10 @@ ...@@ -70,6 +70,10 @@
display: flex; display: flex;
align-items: center; align-items: center;
justify-content: space-between; justify-content: space-between;
.flex-layout{
display: flex;
align-items: center;
}
.favorite-box{ .favorite-box{
width: 112rpx; width: 112rpx;
height: 60rpx; height: 60rpx;
...@@ -90,6 +94,9 @@ ...@@ -90,6 +94,9 @@
color: rgba(245, 166, 35, 1); color: rgba(245, 166, 35, 1);
} }
} }
.ml-10{
margin-left: 20rpx;
}
.comment-box{ .comment-box{
display: flex; display: flex;
...@@ -122,6 +129,7 @@ ...@@ -122,6 +129,7 @@
.pk-title-text{ .pk-title-text{
color: rgba(16, 16, 16, 1); color: rgba(16, 16, 16, 1);
font-size: 24rpx; font-size: 24rpx;
width: calc(100% - 50rpx);
} }
} }
...@@ -139,10 +147,11 @@ ...@@ -139,10 +147,11 @@
.pk-btns{ .pk-btns{
margin: 20rpx 0; margin: 20rpx 0;
display: flex; display: flex;
flex-direction: column;
align-items: center; align-items: center;
justify-content: center; justify-content: center;
.btns{ .btns{
width: 208rpx; width: 520rpx;
height: 76rpx; height: 76rpx;
line-height: 76rpx; line-height: 76rpx;
color: rgba(255, 255, 255, 1); color: rgba(255, 255, 255, 1);
...@@ -150,11 +159,11 @@ ...@@ -150,11 +159,11 @@
text-align: center; text-align: center;
} }
.red-btn{ .red-btn{
border-radius: 38rpx 6rpx 6rpx 38rpx; border-radius: 38rpx;
background-color: rgba(255, 100, 95, 1); background-color: rgba(255, 100, 95, 1);
} }
.blue-btn{ .blue-btn{
border-radius: 6rpx 38rpx 38rpx 6rpx; border-radius: 38rpx;
background-color: rgba(52, 132, 253, 1); background-color: rgba(52, 132, 253, 1);
} }
...@@ -175,43 +184,39 @@ ...@@ -175,43 +184,39 @@
.pk-results{ .pk-results{
margin-top: 20rpx; margin-top: 20rpx;
margin-bottom: 10rpx; margin-bottom: 10rpx;
display: flex; // display: flex;
align-items: center; // align-items: center;
justify-content: space-between; // justify-content: space-between;
font-size: 24rpx; font-size: 24rpx;
.left{ .left{
width: 100%;
flex: 1;
.left-num{ .left-num{
color: rgba(255, 100, 95, 1); color: rgba(255, 100, 95, 1);
margin-bottom: 10rpx; margin-bottom: 10rpx;
} }
} }
.right{ .right{
width: 100%;
flex: 1;
text-align: right;
.right-num{ .right-num{
color: rgba(52, 132, 253, 1); color: rgba(52, 132, 253, 1);
margin-bottom: 10rpx; margin-bottom: 10rpx;
} }
} }
.results-item{ .results-item{
width: 100%; width: 100%;
height: 12rpx; height: 12rpx;
color: rgba(255, 255, 255, 1); color: rgba(255, 255, 255, 1);
font-size: 28rpx; font-size: 28rpx;
} }
.left-item{ .left-item{
border-radius: 6rpx 0 0 6rpx; border-radius: 6rpx;
margin-right: 10rpx; min-width: 10rpx;
background-color: rgba(255, 100, 95, 1); background-color: rgba(255, 100, 95, 1);
} }
.right-item{ .right-item{
border-radius: 0 6rpx 6rpx 0; border-radius: 6rpx;
margin-left: 10rpx; min-width: 10rpx;
background-color: rgba(52, 132, 253, 1); background-color: rgba(52, 132, 253, 1);
} }
......
...@@ -95,6 +95,7 @@ ...@@ -95,6 +95,7 @@
color: rgba(187, 187, 187, 1); color: rgba(187, 187, 187, 1);
font-size: 32rpx; font-size: 32rpx;
margin-left: 32rpx; margin-left: 32rpx;
width: calc(100% - 140rpx);
} }
.label{ .label{
color: rgba(16, 16, 16, 1); color: rgba(16, 16, 16, 1);
...@@ -176,6 +177,7 @@ ...@@ -176,6 +177,7 @@
} }
.input{ .input{
margin-left: 20rpx; margin-left: 20rpx;
width: calc(100% - 50rpx);
} }
.input-class{ .input-class{
font-size: 14px; font-size: 14px;
...@@ -185,11 +187,13 @@ ...@@ -185,11 +187,13 @@
.topic-result-list{ .topic-result-list{
margin-top: 32rpx; margin-top: 32rpx;
.list-item{ .list-item{
height: 64rpx; padding: 10rpx 16rpx;
border-radius: 32rpx; border-radius: 32rpx;
background-color: rgba(245, 248, 250, 1); background-color: rgba(245, 248, 250, 1);
font-size: 26rpx; font-size: 26rpx; /* 基准字体大小 */
padding: 0 20rpx;
border-radius: 2em; /* 1em = 16px = 高度32px的50% */
box-sizing: border-box; box-sizing: border-box;
display: flex; display: flex;
align-items: center; align-items: center;
......
...@@ -171,3 +171,22 @@ export function getQuery(name) { ...@@ -171,3 +171,22 @@ export function getQuery(name) {
} }
return null; return null;
} }
import md5 from 'js-md5';
import config from '@/config/index.config.js'
export function generateSignature(userName) {
if (!userName || typeof userName !== 'string') {
throw new Error('用户名/学工号不能为空,且必须是字符串类型');
}
const timestamp = Date.now();
const appSecret = config.secret;
const appId = config.appId;
const baseUrl = config.faceBaseUrl;
const rawStr = userName + timestamp.toString() + appSecret;
const signature = md5(rawStr);
return baseUrl + userName + "?appid=" + appId + "&timestamp=" + timestamp.toString() + "&signature=" + signature;
}
\ No newline at end of file
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