Sfoglia il codice sorgente

留言静态页面

shaogen1995 4 anni fa
parent
commit
43e7d95dfb
3 ha cambiato i file con 338 aggiunte e 89 eliminazioni
  1. 6 1
      houtai/src/router/index.js
  2. 240 0
      houtai/src/views/message/index.vue
  3. 92 88
      web/src/views/tab4/tab4-4.vue

+ 6 - 1
houtai/src/router/index.js

@@ -5,6 +5,11 @@ Vue.use(VueRouter)
 
 const routes = [
   {
+    path: '/message',
+    name: 'message',
+    component: () => import('../views/message')
+  },
+  {
     path: '/',
     name: 'login',
     component: () => import('../views/login.vue')
@@ -164,7 +169,7 @@ const router = new VueRouter({
 
 router.beforeEach((to, from, next) => {
   // 如果是去登录页,不需要验证,直接下一步
-  if (to.name === 'login') next()
+  if (to.name === 'login' || to.name === 'message') next()
   // 否则要有token值才能下一步,不然就返回登录页
   else {
     const token = localStorage.getItem('CQLJXU_token')

+ 240 - 0
houtai/src/views/message/index.vue

@@ -0,0 +1,240 @@
+<template>
+  <div class="message">
+    <div class="conten">
+      <h2 class="title">留言板</h2>
+      <ul class="liuyan">
+        <li v-for="i in 20" :key="i">
+          <div class="name">王大锤锤锤</div>
+          <div class="con">
+            快乐快乐快乐快乐快乐快乐快乐快乐快乐快乐快乐快乐快乐快乐快乐快乐快乐快乐快乐快乐快乐快乐快乐快乐快乐!~
+          </div>
+          <div class="time">2022.1.4 17:34</div>
+        </li>
+      </ul>
+      <!-- 分页器 -->
+      <div class="pagination">
+        <el-pagination
+          layout="prev, pager, next"
+          :total="50"
+          @current-change="currentChange"
+        >
+        </el-pagination>
+      </div>
+      <!-- 文本域和按钮 -->
+      <div class="bottmInp">
+        <div class="texe">
+          <el-input
+            maxlength="100"
+            show-word-limit
+            resize="none"
+            type="textarea"
+            :rows="4"
+            placeholder="请输入留言内容,字数在100字以内。"
+            v-model="textarea"
+          >
+          </el-input>
+        </div>
+        <div class="button">
+          <el-input
+            type="text"
+            placeholder="请输入您的姓名"
+            v-model="name"
+            maxlength="5"
+            show-word-limit
+          >
+          </el-input>
+          <el-button type="primary">提 交</el-button>
+        </div>
+      </div>
+    </div>
+    <ul>
+      <li>
+        <span></span>
+      </li>
+    </ul>
+  </div>
+</template>
+
+<script>
+// 这里可以导入其他文件(比如:组件,工具js,第三方插件js,json文件,图片文件等等)
+// 例如:import 《组件名称》 from '《组件路径》';
+
+export default {
+  // import引入的组件需要注入到对象中才能使用
+  components: {},
+  data () {
+    // 这里存放数据
+    return {
+      textarea: '',
+      name: ''
+    }
+  },
+  // 监听属性 类似于data概念
+  computed: {},
+  // 监控data中的数据变化
+  watch: {},
+  // 方法集合
+  methods: {
+    // 分页器方法
+    currentChange (val) {
+      console.log('当前页改变了', val)
+      // this.getList({ pageNum: val, pageSize: 10 });
+    }
+  },
+  // 生命周期 - 创建完成(可以访问当前this实例)
+  created () {},
+  // 生命周期 - 挂载完成(可以访问DOM元素)
+  mounted () {},
+  beforeCreate () {}, // 生命周期 - 创建之前
+  beforeMount () {}, // 生命周期 - 挂载之前
+  beforeUpdate () {}, // 生命周期 - 更新之前
+  updated () {}, // 生命周期 - 更新之后
+  beforeDestroy () {}, // 生命周期 - 销毁之前
+  destroyed () {}, // 生命周期 - 销毁完成
+  activated () {} // 如果页面有keep-alive缓存功能,这个函数会触发
+}
+</script>
+<style lang='less' scoped>
+/deep/.el-input__inner::-webkit-input-placeholder {
+  color: #878787 !important;
+}
+/deep/.el-input__inner:-moz-placeholder {
+  color: #878787 !important;
+}
+/deep/.el-input__inner::-moz-placeholder {
+  color: #878787 !important;
+}
+/deep/.el-input__inner:-ms-input-placeholder {
+  /* Internet Explorer 10+ */
+  color: #878787 !important;
+}
+/deep/.el-textarea__inner::-webkit-input-placeholder {
+  color: #878787 !important;
+}
+/deep/.el-textarea__inner:-moz-placeholder {
+  color: #878787 !important;
+}
+/deep/.el-textarea__inner::-moz-placeholder {
+  color: #878787 !important;
+}
+/deep/.el-textarea__inner:-ms-input-placeholder {
+  /* Internet Explorer 10+ */
+  color: #878787 !important;
+}
+.message {
+  width: 1000px;
+  height: 700px;
+  .conten {
+    /deep/.el-button--primary{
+      width: 100%;
+      height: 40px;
+    }
+    /deep/.el-pager li {
+      background-color: #d5d5d5;
+      color: #fff;
+    }
+    /deep/.el-pager li.active {
+      background-color: #b9412e;
+    }
+    /deep/.el-pagination button {
+      border-radius: 5px;
+      background-color: #d5d5d5;
+      color: #fff;
+    }
+    /deep/.el-pagination button:disabled {
+      background-color: #fff;
+    }
+
+    width: 100%;
+    height: 100%;
+    background-color: #fff;
+    padding: 20px;
+    .title {
+      text-align: center;
+      color: #154916;
+    }
+    .liuyan::-webkit-scrollbar {
+      /*滚动条整体样式*/
+      width: 3px; /*高宽分别对应横竖滚动条的尺寸*/
+      height: 1px;
+    }
+    .liuyan::-webkit-scrollbar-thumb {
+      /*滚动条里面小方块*/
+      border-radius: 10px;
+      box-shadow: inset 0 0 5px rgba(0, 0, 0, 0.2);
+      background: #b9412e;
+    }
+    .liuyan::-webkit-scrollbar-track {
+      /*滚动条里面轨道*/
+      // box-shadow: inset 0 0 5px rgba(0, 0, 0, 0.2);
+      border-radius: 10px;
+      background: transparent;
+    }
+    .liuyan {
+      padding-right: 20px;
+      margin: 20px auto 0;
+      width: 94%;
+      height: 420px;
+      overflow-y: auto;
+      li {
+        color: #878787;
+        font-size: 16px;
+        display: flex;
+        & > div {
+          padding: 12px 0;
+        }
+        .name {
+          width: 130px;
+        }
+        .con {
+          flex: 1;
+          margin-right: 20px;
+        }
+        .time {
+          width: 140px;
+        }
+      }
+    }
+    .pagination {
+      display: flex;
+      justify-content: center;
+      width: 380px;
+      margin: 20px auto;
+    }
+    .bottmInp {
+      /deep/.el-textarea__inner:focus {
+        border-color: #b9412e;
+      }
+      /deep/.el-textarea__inner {
+        background-color: #ededed;
+      }
+      /deep/.el-input__inner {
+        background-color: #ededed;
+      }
+      /deep/.el-textarea .el-input__count {
+        background-color: transparent;
+        color: #878787;
+      }
+      /deep/.el-input__count-inner {
+        background-color: transparent;
+        color: #878787;
+      }
+      width: 100%;
+      display: flex;
+      justify-content: space-between;
+      height: 95px;
+      .texe {
+        width: 660px;
+        margin-left: 30px;
+      }
+    }
+    .button {
+      margin-right: 40px;
+      width: 160px;
+      display: flex;
+      flex-direction: column;
+      justify-content: space-between;
+    }
+  }
+}
+</style>

+ 92 - 88
web/src/views/tab4/tab4-4.vue

@@ -37,18 +37,18 @@
     <!-- 点击领导详情 -->
     <div class="details" v-show="details">
       <div class="left">
-        <div class="el-icon-arrow-left" @click="details=false"></div>
-        <img :src="baseURL+txtObj.thumb" alt="" v-if='txtObj.thumb'/>
-        <p>{{txtObj.name}}</p>
+        <div class="el-icon-arrow-left" @click="details = false"></div>
+        <img :src="baseURL + txtObj.thumb" alt="" v-if="txtObj.thumb" />
+        <p>{{ txtObj.name }}</p>
       </div>
       <div class="right">
         <div>
           <span>基本信息</span>
         </div>
-        <p>性别:{{txtObj.sex==='M'?'男':'女'}}</p>
-        <p>政治面貌:{{txtObj.politics}}</p>
-        <p>任职职位:{{txtObj.job}}</p>
-        <p>任期:{{time}}</p>
+        <p>性别:{{ txtObj.sex === "M" ? "男" : "女" }}</p>
+        <p>政治面貌:{{ txtObj.politics }}</p>
+        <p>任职职位:{{ txtObj.job }}</p>
+        <p>任期:{{ time }}</p>
         <div>
           <span>领导简介</span>
         </div>
@@ -59,7 +59,7 @@
   <div class="tab4-4 conNull" v-else>暂 无 数 据</div>
 </template>
 <script>
-import moment from 'moment'
+import moment from "moment";
 import axios from "@/utils/request";
 import { leaderList } from "@/utils/api";
 export default {
@@ -68,9 +68,9 @@ export default {
   data() {
     // 这里存放数据
     return {
-      time:'',
+      time: "",
       details: false,
-      txtObj:{},
+      txtObj: {},
       myArr: [],
       total: 0,
       formData: {
@@ -89,10 +89,13 @@ export default {
   methods: {
     //点击图片,查看详情
     lookBigImg(val) {
-      this.details=true
-      this.txtObj=val
+      this.details = true;
+      this.txtObj = val;
       // 处理日期
-      this.time = moment((this.txtObj.tenure.split(','))[0]).format('YYYY年MM月') + '-' + moment((this.txtObj.tenure.split(','))[1]).format('YYYY年MM月')
+      this.time =
+        moment(this.txtObj.tenure.split(",")[0]).format("YYYY年MM月") +
+        "-" +
+        moment(this.txtObj.tenure.split(",")[1]).format("YYYY年MM月");
     },
     // 分页器方法
     currentChange(val) {
@@ -136,11 +139,11 @@ export default {
 };
 </script>
 <style lang='less' scoped>
-   /deep/::-webkit-scrollbar-thumb{
-    background-color: #b9412e !important;
-    outline: 1px solid #b9412e !important;
-    outline-offset: 0;
-   }
+/deep/::-webkit-scrollbar-thumb {
+  background-color: #b9412e !important;
+  outline: 1px solid #b9412e !important;
+  outline-offset: 0;
+}
 
 .conNull {
   display: flex;
@@ -153,19 +156,19 @@ export default {
   /*修改提示文字的颜色*/
   /deep/input::-webkit-input-placeholder {
     /* WebKit browsers */
-    color: #B9412E;
+    color: #b9412e;
   }
   /deep/input:-moz-placeholder {
     /* Mozilla Firefox 4 to 18 */
-    color: #B9412E;
+    color: #b9412e;
   }
   /deep/input::-moz-placeholder {
     /* Mozilla Firefox 19+ */
-    color: #B9412E;
+    color: #b9412e;
   }
   /deep/input:-ms-input-placeholder {
     /* Internet Explorer 10+ */
-    color: #B9412E;
+    color: #b9412e;
   }
   // position: relative;
   width: 100%;
@@ -181,10 +184,10 @@ export default {
     font-size: 26px;
     font-weight: 700;
     .search {
-  /deep/.el-input__inner {
-    border-radius: 40px;
-    border: 1px solid #b9412e;
-  }
+      /deep/.el-input__inner {
+        border-radius: 40px;
+        border: 1px solid #b9412e;
+      }
       width: 350px;
       left: 0;
       bottom: -10px;
@@ -244,72 +247,73 @@ export default {
     bottom: 20px;
     transform: translateX(-50%);
   }
-.details{
-  background-color: #fff;
-  z-index: 9999;
-  position: absolute;
-  right: 0;
-  top: 0;
-  display: flex;
-  // width: calc(100% - 160px);
-  width: 100%;
-  height: 100%;
-  padding: 0px 0 0 80px;
-  color: #707070;
-  .left{
-    margin-right: 100px;
-    padding-top: 50px;
-    width: 200px;
-    height: auto;
-    &>div {
-      margin-left: -12px;
-      cursor: pointer;
-      font-size: 50px;
-      margin-bottom: 30px;
-    }
-    &>img{
+  .details {
+    background-color: #fff;
+    z-index: 9999;
+    position: absolute;
+    right: 0;
+    top: 0;
+    display: flex;
+    // width: calc(100% - 160px);
+    width: 100%;
+    height: 100%;
+    padding: 0px 0 0 80px;
+    color: #707070;
+    .left {
+      margin-right: 100px;
+      padding-top: 50px;
       width: 200px;
-      height: 230px;
-      object-fit: cover;
-    }
-    &>P {
-      margin-top: 8px;
-      text-align: center;
-    }
-  }
-  .right{
-    flex: 1;
-    padding-top: 100px;
-    &>div {
-      margin-top: 30px;
-      width: 1000px;
-      border-bottom: 1px solid #AFAFAF;
-      &>span{
-        transform: translateY(2px);
-        width: 105px;
-        border-bottom: 4px solid #b9412e;
-        display: block;
-        height: 50px;
-        font-size: 26px;
-        font-weight: 700;
-        color: #b9412e;
+      height: auto;
+      & > div {
+        margin-left: -12px;
+        cursor: pointer;
+        font-size: 50px;
+        margin-bottom: 30px;
+      }
+      & > img {
+        width: 200px;
+        height: 230px;
+        object-fit: cover;
+      }
+      & > P {
+        margin-top: 8px;
+        text-align: center;
       }
     }
-    &>p{
-      margin: 15px 0;
-      font-size: 16px;
-    }
-    .intro{
-      padding-top: 15px;
-      margin-top: 0px;
-      height: 450px;
-      overflow-y: auto;
-      border-bottom:none;
-      font-size: 16px;
-      /deep/p{
-        margin: 10px 0;
+    .right {
+      flex: 1;
+      padding-top: 100px;
+      & > div {
+        margin-top: 30px;
+        width: 1000px;
+        border-bottom: 1px solid #afafaf;
+        & > span {
+          transform: translateY(2px);
+          width: 105px;
+          border-bottom: 4px solid #b9412e;
+          display: block;
+          height: 50px;
+          font-size: 26px;
+          font-weight: 700;
+          color: #b9412e;
+        }
+      }
+      & > p {
+        margin: 15px 0;
+        font-size: 16px;
+      }
+      .intro {
+        padding-top: 15px;
+        margin-top: 0px;
+        height: 450px;
+        overflow-y: auto;
+        border-bottom: none;
+        font-size: 16px;
+        /deep/p {
+          margin: 10px 0;
+        }
       }
     }
   }
-}}
+}
 </style>