|
@@ -1,228 +1,239 @@
|
|
|
<template>
|
|
|
<div class="message-body">
|
|
|
+ <div class="title">
|
|
|
+ <span>留言板</span>
|
|
|
+ </div>
|
|
|
<div class="message">
|
|
|
- <div class="con">
|
|
|
- <ul class="form">
|
|
|
- <li>
|
|
|
- <div class="input">
|
|
|
- <textarea placeholder="请留下你的留言" maxlength='250' v-model="msg" rows="4" cols="80">
|
|
|
- </textarea>
|
|
|
- <span>{{msg.length}}/250</span>
|
|
|
- </div>
|
|
|
- </li>
|
|
|
- </ul>
|
|
|
- <div>
|
|
|
- <input placeholder="请输入昵称" type="text">
|
|
|
- <div class="button primarybtn" @click="leaveMsg('','')">
|
|
|
- 提交
|
|
|
+ <div class="con brightnessW">
|
|
|
+
|
|
|
+ <ul>
|
|
|
+ <li v-for="(item, i) in 10" :key="i">
|
|
|
+ <img
|
|
|
+ :src="require(`@/assets/images/icon/usericon.png`)"
|
|
|
+ alt=""
|
|
|
+ />
|
|
|
+ <div>
|
|
|
+ <p>匿名</p>
|
|
|
+ <p>很不错。很丰富很全面</p>
|
|
|
</div>
|
|
|
- </div>
|
|
|
- </div>
|
|
|
- <img class="v-line" :src="require(`@/assets/images/icon/line-msg.png`)" alt="">
|
|
|
- <div class="leaving">
|
|
|
- <ul class="content">
|
|
|
- <li v-for="(item,i) in message" :key="i">
|
|
|
- <div class="info">
|
|
|
- <p><span>网友留言:</span><span>{{item.msg}}</span></p>
|
|
|
- <p><span>留言回复:</span><span>{{item.res}}</span></p>
|
|
|
- </div>
|
|
|
- <div class="date">
|
|
|
- 2021-12-13
|
|
|
- </div>
|
|
|
- </li>
|
|
|
- </ul>
|
|
|
+ <p>2021.12.12</p>
|
|
|
+
|
|
|
+ </li>
|
|
|
+ </ul>
|
|
|
+
|
|
|
+ <Paging class="paging" v-if="paging.total>0" :paging="paging" />
|
|
|
+
|
|
|
+ <span class="totalmsg">共45条留言</span>
|
|
|
+ </div>
|
|
|
+
|
|
|
+ <div class="vtextarea brightnessW">
|
|
|
+ <textarea v-model="msg" rows="5" maxlength="100" cols="20" placeholder="请输入留言......"></textarea>
|
|
|
+ <emoji class="emoji" @select="selectEmoji" :type="0" id="biaoqing1"/>
|
|
|
+ <span class="maxlength">{{ msg.length }}/100</span>
|
|
|
+ </div>
|
|
|
+
|
|
|
+ <div class="submitcon">
|
|
|
+ <ul>
|
|
|
+ <li :class="{active:item.id == activetype}" @click="activetype=item.id" v-for="(item,i) in types" :key="i">
|
|
|
+ <span></span>
|
|
|
+ <span class="name">{{item.name}}</span>
|
|
|
+ </li>
|
|
|
+ </ul>
|
|
|
+
|
|
|
+ <div class="ipp brightnessW">
|
|
|
+ <input type="text" >
|
|
|
</div>
|
|
|
- <div v-if="!loadAll" class="loadmore" @click="loadmore"><span class="borderThemeStyle primaryColor">加载更多</span></div>
|
|
|
+ <div class="btnww">提交</div>
|
|
|
</div>
|
|
|
+
|
|
|
+ </div>
|
|
|
+ <img @click="$emit('close')" class="close" :src="require('@/assets/images/close.png')" alt="">
|
|
|
</div>
|
|
|
</template>
|
|
|
|
|
|
<script>
|
|
|
-import { getMsg,saveMsg } from "@/config/api";
|
|
|
+import { saveMsg } from "@/config/api";
|
|
|
+import emoji from "@/components/emoji";
|
|
|
+import Paging from '@/components/Paging'
|
|
|
|
|
|
export default {
|
|
|
+ components:{emoji,Paging},
|
|
|
data() {
|
|
|
return {
|
|
|
- msg:'',
|
|
|
- message:[{
|
|
|
- msg:'藏品一栏,那个“法书”是不是应该为“书法”',
|
|
|
- res:'法书不同于书法。法书是对古代名家墨迹的尊称,包含着书法作品之楷模的意思。'
|
|
|
- },{
|
|
|
- msg:'网友留言:你好,现在还能寄存行李吗?',
|
|
|
- res:'残疾人预约观展不便 最近故宫举办有关敦煌的展览,残疾人凭本人残疾证可以免费进故宫参观,可是在商务系统预约敦煌展时提示必须购买门票才可以预约,残疾人怎么办呢,为了参观必须去买门票。。'
|
|
|
+ types:[{
|
|
|
+ name:'匿名发表',
|
|
|
+ id:'none'
|
|
|
},{
|
|
|
- msg:'藏品一栏,那个“法书”是不是应该为“书法”',
|
|
|
- res:'法书不同于书法。法书是对古代名家墨迹的尊称,包含着书法作品之楷模的意思。'
|
|
|
- },{
|
|
|
- msg:'网友留言:你好,现在还能寄存行李吗?',
|
|
|
- res:'残疾人预约观展不便 最近故宫举办有关敦煌的展览,残疾人凭本人残疾证可以免费进故宫参观,可是在商务系统预约敦煌展时提示必须购买门票才可以预约,残疾人怎么办呢,为了参观必须去买门票。。'
|
|
|
+ name:'您的昵称',
|
|
|
+ id:'nickname'
|
|
|
}],
|
|
|
- select: "nickName",
|
|
|
- mtotal: 0,
|
|
|
- mpageSize: 6,
|
|
|
- mcurrentPage: 1,
|
|
|
- loadAll:false
|
|
|
+ activetype:'none',
|
|
|
+ msg: "",
|
|
|
+ message: [],
|
|
|
+ loadAll: false,
|
|
|
+ paging: {
|
|
|
+ pageSize: 12,
|
|
|
+ pageNum: 1,
|
|
|
+ total: 118,
|
|
|
+ showSize: 2,
|
|
|
+ current: 1,
|
|
|
+ },
|
|
|
};
|
|
|
},
|
|
|
- watch:{
|
|
|
- mpageSize(){
|
|
|
- this.getMessage()
|
|
|
- }
|
|
|
+ watch: {
|
|
|
+ mpageSize() {
|
|
|
+ },
|
|
|
},
|
|
|
- mounted(){
|
|
|
- // this.getMessage()
|
|
|
+ mounted() {
|
|
|
},
|
|
|
- methods:{
|
|
|
- tologin(){
|
|
|
- window.scrollTo(0,0)
|
|
|
- this.$bus.$emit('showLogin',true)
|
|
|
+ methods: {
|
|
|
+ selectEmoji(data){
|
|
|
+ this.msg += data
|
|
|
},
|
|
|
- loadmore(){
|
|
|
- // this.mpageSize += this.mpageSize
|
|
|
- this.message = this.message.concat(this.message)
|
|
|
+ tologin() {
|
|
|
+ window.scrollTo(0, 0);
|
|
|
+ this.$bus.$emit("showLogin", true);
|
|
|
},
|
|
|
- async leaveMsg(item='',i=''){
|
|
|
- let tmp = (item ? item.comment : this.msg).trim()
|
|
|
+ loadmore() {
|
|
|
+ this.mpageSize += this.mpageSize;
|
|
|
+ },
|
|
|
+ async leaveMsg(item = "", i = "") {
|
|
|
+ let tmp = (item ? item.comment : this.msg).trim();
|
|
|
if (!tmp) {
|
|
|
- return alert('留言不能为空')
|
|
|
+ return alert("留言不能为空");
|
|
|
}
|
|
|
- this.msg = ''
|
|
|
- alert('留言成功')
|
|
|
+ saveMsg(
|
|
|
+ "comment",
|
|
|
+ {
|
|
|
+ content: tmp,
|
|
|
+ parentId: item.id || "",
|
|
|
+ isRealName: Number(this.select == "realName"),
|
|
|
+ },
|
|
|
+ (res) => {
|
|
|
+ if (res.code == 0) {
|
|
|
+ this.msg = "";
|
|
|
+ alert("留言成功");
|
|
|
+ item && this.showComment(item, i);
|
|
|
+ this.getMessage();
|
|
|
+ }
|
|
|
+ }
|
|
|
+ );
|
|
|
},
|
|
|
- showComment(item,i){
|
|
|
- item.showComment = !item.showComment
|
|
|
- item.comment = ''
|
|
|
- this.$set(this.message,i,item)
|
|
|
+ showComment(item, i) {
|
|
|
+ item.showComment = !item.showComment;
|
|
|
+ item.comment = "";
|
|
|
+ this.$set(this.message, i, item);
|
|
|
},
|
|
|
- async getMessage(){
|
|
|
- if (this.loadAll) return
|
|
|
- getMsg({
|
|
|
- pageNum: this.mcurrentPage,
|
|
|
- pageSize: this.mpageSize,
|
|
|
- },result=>{
|
|
|
- result.data.list.forEach(item=>{
|
|
|
- item.showComment = false
|
|
|
- item.comment = ''
|
|
|
- })
|
|
|
- if (result.data.list.length==this.message.length) {
|
|
|
- this.loadAll = true
|
|
|
- }
|
|
|
- this.message = result.data.list
|
|
|
- this.mtotal= result.data.total
|
|
|
- })
|
|
|
-
|
|
|
- }
|
|
|
- }
|
|
|
+
|
|
|
+ },
|
|
|
};
|
|
|
</script>
|
|
|
|
|
|
<style lang="less" scoped>
|
|
|
.message-body {
|
|
|
- max-width: 1300px;
|
|
|
+ width: 1120px;
|
|
|
margin: 0 auto;
|
|
|
- position: relative;
|
|
|
+ position: fixed;
|
|
|
+ top: 50%;
|
|
|
+ left: 50%;
|
|
|
+ transform: translate(-50%,-50%);
|
|
|
z-index: 99;
|
|
|
- .message{
|
|
|
- .con{
|
|
|
+ background: rgba(21, 33, 49, 0.5);
|
|
|
+ color: #fff;
|
|
|
+ padding: 30px 70px;
|
|
|
+ border-top: 8px solid #338F7B;
|
|
|
+ border-bottom: 8px solid #338F7B;
|
|
|
+ .title {
|
|
|
+ margin: 0 auto 37px;
|
|
|
+ position: relative;
|
|
|
+ > span {
|
|
|
+ display: inline-block;
|
|
|
+ height: 30px;
|
|
|
+ font-size: 30px;
|
|
|
+ font-weight: bold;
|
|
|
+ line-height: 38px;
|
|
|
+ }
|
|
|
+ }
|
|
|
+ .message {
|
|
|
+ height: 100%;
|
|
|
+
|
|
|
+ .con {
|
|
|
width: 100%;
|
|
|
- padding: 30px 100px;
|
|
|
- .form{
|
|
|
- text-align: left;
|
|
|
- width: 100%;
|
|
|
- >li{
|
|
|
- margin-bottom: 30px;
|
|
|
+ height: 397px;
|
|
|
+ position: relative;
|
|
|
+ box-sizing: content-box;
|
|
|
+
|
|
|
+ > ul {
|
|
|
+ height: calc(100% - 60px);
|
|
|
+ overflow-y: auto;
|
|
|
+ margin-top: 20px;
|
|
|
+ padding: 0 20px 20px;
|
|
|
+ > li {
|
|
|
display: flex;
|
|
|
- width: 100%;
|
|
|
- align-items: flex-start;
|
|
|
- > span{
|
|
|
- display: inline-block;
|
|
|
- width: 100px;
|
|
|
- flex-shrink: 0;
|
|
|
- font-size: 20px;
|
|
|
- margin-right: 10px;
|
|
|
- text-align: right;
|
|
|
+ justify-content: space-between;
|
|
|
+ border-bottom: 1px dashed #CFC5C5;
|
|
|
+ padding: 14px 0;
|
|
|
+ @wh: 50px;
|
|
|
+ &:last-of-type {
|
|
|
+ border-bottom: none;
|
|
|
}
|
|
|
- .name{
|
|
|
- .radio{
|
|
|
- &::before{
|
|
|
- border: 1px solid #707070;
|
|
|
- content: '';
|
|
|
- }
|
|
|
- margin-right: 50px;
|
|
|
- }
|
|
|
+ > img {
|
|
|
+ width: @wh;
|
|
|
+ height: @wh;
|
|
|
+ flex-shrink: 0;
|
|
|
+ border-radius: 50%;
|
|
|
}
|
|
|
- .input{
|
|
|
- flex: auto;
|
|
|
- width: 100%;
|
|
|
- position: relative;
|
|
|
- font-size: 0;
|
|
|
- color : #999999;
|
|
|
- >textarea{
|
|
|
- width: 100%;
|
|
|
- line-height: 2;
|
|
|
- font-size: 16px;
|
|
|
- &::placeholder{
|
|
|
- color : #999999;
|
|
|
+ > div {
|
|
|
+ text-align: left;
|
|
|
+ flex: 10;
|
|
|
+ margin-left: 20px;
|
|
|
+ > p {
|
|
|
+ &:first-of-type {
|
|
|
+ font-size: 24px;
|
|
|
+ color: #CFCFCF;
|
|
|
+ margin-bottom: 10px;
|
|
|
}
|
|
|
- }
|
|
|
- >span{
|
|
|
- display: inline-block;
|
|
|
- color: rgba(153, 153, 153, 1);
|
|
|
- position: absolute;
|
|
|
- font-size: 12px;
|
|
|
- bottom: 5px;
|
|
|
- right: 14px;
|
|
|
- }
|
|
|
- .loginwarn{
|
|
|
- left: 50%;
|
|
|
- right: auto;
|
|
|
- transform: translateX(-50%);
|
|
|
- background-color: rgba(51, 51, 51, 0.5);
|
|
|
- color: #fff;
|
|
|
- display: flex;
|
|
|
- align-items: center;
|
|
|
- bottom: 10px;
|
|
|
- padding: 4px;
|
|
|
- border-radius: 2px;
|
|
|
- >img{
|
|
|
- width: 20px;
|
|
|
- margin-right: 4px;
|
|
|
+ &:last-of-type {
|
|
|
+ font-size: 14px;
|
|
|
}
|
|
|
}
|
|
|
}
|
|
|
+ > p {
|
|
|
+ font-size: 14px;
|
|
|
+ margin-top: 10px;
|
|
|
+ color: #D6D6D6;
|
|
|
+ flex-shrink: 0;
|
|
|
+ }
|
|
|
}
|
|
|
}
|
|
|
- >div{
|
|
|
+
|
|
|
+ .paging{
|
|
|
+ margin-top: 10px;
|
|
|
+ }
|
|
|
+ .totalmsg{
|
|
|
+ position: absolute;
|
|
|
+ bottom: 20px;
|
|
|
+ right: 20px;
|
|
|
+ }
|
|
|
+ > div {
|
|
|
display: flex;
|
|
|
- justify-content: space-between;
|
|
|
+ justify-content: center;
|
|
|
align-items: center;
|
|
|
- >input{
|
|
|
- flex: 7;
|
|
|
- line-height: 42px;
|
|
|
- height: 42px;
|
|
|
- background: none;
|
|
|
- border: 1px solid #999;
|
|
|
- padding-left: 10px;
|
|
|
- &::placeholder{
|
|
|
- color : #999999;
|
|
|
- }
|
|
|
- }
|
|
|
-
|
|
|
- .button{
|
|
|
+
|
|
|
+ .button {
|
|
|
position: relative;
|
|
|
- flex: 1;
|
|
|
width: 150px;
|
|
|
- margin-left: 50px;
|
|
|
- border-radius: 0px;
|
|
|
- >span{
|
|
|
+ &:first-of-type {
|
|
|
+ margin-right: 50px;
|
|
|
+ }
|
|
|
+ > span {
|
|
|
position: absolute;
|
|
|
left: -220px;
|
|
|
top: 50%;
|
|
|
transform: translateY(-50%);
|
|
|
- color: rgba(153, 153, 153, 1);
|
|
|
display: flex;
|
|
|
align-items: center;
|
|
|
- >img{
|
|
|
+ > img {
|
|
|
width: 24px;
|
|
|
height: 24px;
|
|
|
margin-right: 8px;
|
|
@@ -231,54 +242,121 @@ export default {
|
|
|
}
|
|
|
}
|
|
|
}
|
|
|
-
|
|
|
- .v-line{
|
|
|
- margin: 60px 0;
|
|
|
- }
|
|
|
- .leaving{
|
|
|
- margin-top: 40px;
|
|
|
- .content{
|
|
|
- text-align: left;
|
|
|
+ .vtextarea{
|
|
|
+ width: 100%;
|
|
|
+ margin: 20px auto 0;
|
|
|
+ position: relative;
|
|
|
+ >textarea{
|
|
|
+ background: none;
|
|
|
+ outline:none;
|
|
|
+ width: 100%;
|
|
|
+ color: #fff;
|
|
|
+ border: none;
|
|
|
+ padding:10px 20px;
|
|
|
+ &::placeholder{
|
|
|
+ color: #FFF6F6;
|
|
|
+ }
|
|
|
+ }
|
|
|
+ .emoji{
|
|
|
+ position: absolute;
|
|
|
+ bottom: 0;
|
|
|
+ left: 18px;
|
|
|
+ }
|
|
|
+ .maxlength{
|
|
|
+ position: absolute;
|
|
|
+ bottom: 10px;
|
|
|
+ right: 18px;
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
+ .submitcon{
|
|
|
+ margin-top: 30px;
|
|
|
+ display: flex;
|
|
|
+ align-items: center;
|
|
|
+ position: relative;
|
|
|
+ >ul{
|
|
|
+ display: flex;
|
|
|
+ align-items: center;
|
|
|
>li{
|
|
|
- margin-bottom: 10px;
|
|
|
display: flex;
|
|
|
- justify-content: space-between;
|
|
|
- margin-bottom: 20px;
|
|
|
- .info{
|
|
|
- flex: 6;
|
|
|
- >p{
|
|
|
- display: flex;
|
|
|
- text-align: left;
|
|
|
- justify-content: flex-start;
|
|
|
- margin-bottom: 10px;
|
|
|
- >span{
|
|
|
- line-height: 1.5;
|
|
|
- font-size: 18px;
|
|
|
- color: #999;
|
|
|
- &:first-of-type{
|
|
|
- width: 100px;
|
|
|
+ margin-right: 20px;
|
|
|
+ align-items: center;
|
|
|
+ cursor: pointer;
|
|
|
+ >span{
|
|
|
+ display: inline-block;
|
|
|
+ &:first-of-type{
|
|
|
+ position: relative;
|
|
|
+ border-radius: 50%;
|
|
|
+ width: 30px;
|
|
|
+ height: 30px;
|
|
|
+ border: 1px solid #EBEBEB;
|
|
|
+ border-radius: 50%;
|
|
|
+ }
|
|
|
+ &:last-of-type{
|
|
|
+ margin-left: 10px;
|
|
|
+ }
|
|
|
+ }
|
|
|
+ &.active{
|
|
|
+ >span{
|
|
|
+ &:first-of-type{
|
|
|
+ &::before{
|
|
|
+ width: 20px;
|
|
|
+ height: 20px;
|
|
|
display: inline-block;
|
|
|
- flex-shrink: 0;
|
|
|
- color: #333;
|
|
|
- font-weight: bold;
|
|
|
+ content: '';
|
|
|
+ border-radius: 50%;
|
|
|
+ background: #939BD2;
|
|
|
+ position: absolute;
|
|
|
+ top: 50%;
|
|
|
+ left: 50%;
|
|
|
+ transform: translate(-50%,-50%);
|
|
|
}
|
|
|
- }
|
|
|
}
|
|
|
- }
|
|
|
- .date{
|
|
|
- flex: 1;
|
|
|
- text-align: right;
|
|
|
+ }
|
|
|
}
|
|
|
}
|
|
|
}
|
|
|
- }
|
|
|
- .loadmore{
|
|
|
- margin-top: 40px;
|
|
|
- .borderThemeStyle{
|
|
|
+ .ipp{
|
|
|
+ width: 280px;
|
|
|
display: inline-block;
|
|
|
- padding: 10px 50px;
|
|
|
+ position: relative;
|
|
|
+ border-radius: 5px;
|
|
|
+ height: 30px;
|
|
|
+ line-height: 30px;
|
|
|
+ text-align: left;
|
|
|
+ padding: 0 6px;
|
|
|
+ >input{
|
|
|
+ background: none;
|
|
|
+ border: none;
|
|
|
+ user-select: none;
|
|
|
+ height: 30px;
|
|
|
+ width: 100%;
|
|
|
+ color: #fff;
|
|
|
+ position: relative;
|
|
|
+ }
|
|
|
+ }
|
|
|
+ .btnww{
|
|
|
+ width: 106px;
|
|
|
+ height: 35px;
|
|
|
+ line-height: 35px;
|
|
|
+ background: #338F7B;
|
|
|
+ text-align: center;
|
|
|
+ border-radius: 0px;
|
|
|
+ position: absolute;
|
|
|
+ right: 0;
|
|
|
+ color: #fff;
|
|
|
+ cursor: pointer;
|
|
|
}
|
|
|
}
|
|
|
}
|
|
|
+ .close{
|
|
|
+ position: absolute;
|
|
|
+ top: 40px;
|
|
|
+ right: 50px;
|
|
|
+ width: 24px;
|
|
|
+ height: 24px;
|
|
|
+ cursor: pointer;
|
|
|
+ z-index: 9999999;
|
|
|
+ }
|
|
|
}
|
|
|
</style>
|