Kaynağa Gözat

Merge branch 'master' of http://git.cc-lotus.info/count/webnew-count

reloaded 5 yıl önce
ebeveyn
işleme
327c6bde94

+ 8 - 0
src/router/index.js

@@ -81,8 +81,16 @@ const routes = [
   {
     path: '/partisan/index',
     name: '党建学苑',
+    meta: { title: '党建学苑', subSite: true },
     component: () => import('../views/partisan/index.vue'),
   },
+  // 党建学苑-列表详情
+  {
+    path: '/partisan/listDetail',
+    name: '党建学苑',
+    meta: { title: '党建学苑', subSite: true },
+    component: () => import('../views/partisan/listDetail.vue'),
+  },
   // 个人中心
   {
     path: '/pcenter/index',

+ 39 - 7
src/views/partisan/index.vue

@@ -15,29 +15,61 @@
         <div class="w_1200">
           <el-col :span="24" class="images">
             <el-carousel indicator-position="outside" height="380px" width="590px">
-              <el-carousel-item v-for="(item, index) in ruleList" :key="index" class="ruleList">
+              <el-carousel-item
+                v-for="(item, index) in ruleList"
+                :key="index"
+                @click.native="$router.push({ path: '/partisan/listDetail', query: { col_name: '图片新闻', id: 'id', display: '1' } })"
+                class="ruleList"
+              >
                 <el-image :src="item.img_url"></el-image>
                 <p class="textOver">{{ item.title }}</p>
               </el-carousel-item>
             </el-carousel>
           </el-col>
           <el-col :span="12" class="right">
-            <el-col :span="24" class="infoTop"> <span>|</span><span>党建工作</span><span>MORE</span> </el-col>
-            <el-col :span="24" class="info" v-for="(item, index) in workList" :key="index">
+            <el-col :span="24" class="infoTop">
+              <span>|</span><span>党建工作</span
+              ><span @click="$router.push({ path: '/partisan/listDetail', query: { col_name: '党建工作', display: '0' } })">MORE</span>
+            </el-col>
+            <el-col
+              :span="24"
+              class="info"
+              v-for="(item, index) in workList"
+              :key="index"
+              @click.native="$router.push({ path: '/partisan/listDetail', query: { col_name: '党建工作', id: 'id', display: '1' } })"
+            >
               <span></span><span class="textOver">{{ item.title }}</span
               ><span>{{ item.publish_time }}</span>
             </el-col>
           </el-col>
           <el-col :span="12" class="left">
-            <el-col :span="24" class="infoTop"> <span>|</span><span>学习园地</span><span>MORE</span> </el-col>
-            <el-col :span="24" class="info" v-for="(item, index) in stuList" :key="index">
+            <el-col :span="24" class="infoTop">
+              <span>|</span><span>学习园地</span
+              ><span @click="$router.push({ path: '/partisan/listDetail', query: { col_name: '学习园地', display: '0' } })">MORE</span>
+            </el-col>
+            <el-col
+              :span="24"
+              class="info"
+              v-for="(item, index) in stuList"
+              :key="index"
+              @click.native="$router.push({ path: '/partisan/listDetail', query: { col_name: '学习园地', id: 'id', display: '1' } })"
+            >
               <span></span><span class="textOver">{{ item.title }}</span
               ><span>{{ item.publish_time }}</span>
             </el-col>
           </el-col>
           <el-col :span="12" class="right">
-            <el-col :span="24" class="infoTop"> <span>|</span><span>党风廉政</span><span>MORE</span> </el-col>
-            <el-col :span="24" class="info" v-for="(item, index) in politicsList" :key="index">
+            <el-col :span="24" class="infoTop">
+              <span>|</span><span>党风廉政</span
+              ><span @click="$router.push({ path: '/partisan/listDetail', query: { col_name: '党风廉政', display: '0' } })">MORE</span>
+            </el-col>
+            <el-col
+              :span="24"
+              class="info"
+              v-for="(item, index) in politicsList"
+              :key="index"
+              @click.native="$router.push({ path: '/partisan/listDetail', query: { col_name: '党风廉政', id: 'id', display: '1' } })"
+            >
               <span></span><span class="textOver">{{ item.title }}</span
               ><span>{{ item.publish_time }}</span>
             </el-col>

+ 224 - 0
src/views/partisan/listDetail.vue

@@ -0,0 +1,224 @@
+<template>
+  <div id="listDetail">
+    <el-row>
+      <el-col :span="24" class="style">
+        <el-col :span="24" class="top">
+          <top></top>
+        </el-col>
+        <el-col :span="24" class="menu">
+          <div class="w_1200">
+            <menus></menus>
+          </div>
+        </el-col>
+        <el-col :span="24" class="main">
+          <div class="w_1200">
+            <el-col :span="5" class="left">
+              <el-col :span="24" class="top">
+                <i class="el-icon-s-unfold"></i>
+                <span>党建学苑</span>
+              </el-col>
+              <el-col :span="24" class="menu">
+                <el-col class="menuList" :span="24" v-for="(item, index) in menuList" :key="index">
+                  <p @click="changeMenu(item.name, index)" :style="`color:${menuIndex == index ? menuColor : ''}`">
+                    {{ item.name }}
+                  </p>
+                </el-col>
+              </el-col>
+            </el-col>
+            <el-col :span="18" class="right">
+              <span v-if="displays == '0'">
+                <el-col :span="24" class="one">
+                  <span></span>
+                  <span>{{ columnName }}</span>
+                </el-col>
+                <el-col :span="24" class="list">
+                  <newsList :list="list" :total="total" @detailBtn="detailBtn"></newsList>
+                </el-col>
+              </span>
+              <span v-else>
+                <newsDetail :details="details"></newsDetail>
+              </span>
+            </el-col>
+          </div>
+        </el-col>
+        <el-col :span="24" class="foot">
+          <div class="w_1200">
+            <foot></foot>
+          </div>
+        </el-col>
+      </el-col>
+    </el-row>
+  </div>
+</template>
+
+<script>
+import top from '@/layout/common/top.vue';
+import menus from '@/layout/common/menus.vue';
+import foot from '@/layout/common/foot.vue';
+import newsList from './parts/newsList.vue';
+import newsDetail from './parts/newsDetail.vue';
+import { mapState, createNamespacedHelpers } from 'vuex';
+export default {
+  name: 'listDetail',
+  props: {},
+  components: {
+    top,
+    menus,
+    foot,
+    newsList,
+    newsDetail,
+  },
+  data: function() {
+    return {
+      menuList: [{ name: '图片新闻' }, { name: '党建工作' }, { name: '学习园地' }, { name: '党风廉政' }],
+      menuColor: 'rgb(5,73,130)',
+      menuIndex: '0',
+      columnName: '',
+      displays: '0',
+      // 列表
+      list: [
+        {
+          title: '标题',
+          date: '2020-02-02',
+        },
+        {
+          title: '十四数据',
+          date: '2020-02-02',
+        },
+      ],
+      // 总数
+      total: 10,
+      // 详情
+      details: {
+        title: '信息标题',
+        source: '信息部',
+        date: '2020-02-02',
+        content: '信息内容',
+      },
+    };
+  },
+  created() {
+    this.changeColumn();
+  },
+  methods: {
+    // 选择栏目
+    changeColumn() {
+      if (this.col_name == '图片新闻') {
+        this.menuIndex = 0;
+        this.columnName = this.col_name;
+        this.menuColor = 'rgb(5,73,130)';
+        this.$set(this, `displays`, this.display);
+      } else if (this.col_name == '党建工作') {
+        this.menuIndex = 1;
+        this.columnName = this.col_name;
+        this.menuColor = 'rgb(5,73,130)';
+        this.$set(this, `displays`, this.display);
+      } else if (this.col_name == '学习园地') {
+        this.menuIndex = 2;
+        this.columnName = this.col_name;
+        this.menuColor = 'rgb(5,73,130)';
+        this.$set(this, `displays`, this.display);
+      } else if (this.col_name == '党风廉政') {
+        this.menuIndex = 3;
+        this.columnName = this.col_name;
+        this.menuColor = 'rgb(5,73,130)';
+        this.$set(this, `displays`, this.display);
+      }
+    },
+    // 点击选择菜单
+    changeMenu(name, index) {
+      this.menuIndex = index;
+      this.columnName = name;
+      this.menuColor = 'rgb(5,73,130)';
+      this.$set(this, `displays`, 0);
+    },
+    // 点击详情
+    detailBtn(id) {
+      this.$set(this, `displays`, 1);
+    },
+  },
+  computed: {
+    ...mapState(['user']),
+    display() {
+      return this.$route.query.display;
+    },
+    col_name() {
+      return this.$route.query.col_name;
+    },
+    id() {
+      return this.$route.query.id;
+    },
+  },
+  metaInfo() {
+    return { title: this.$route.meta.title };
+  },
+};
+</script>
+
+<style lang="less" scoped>
+.w_1200 {
+  width: 1200px;
+  margin: 0 auto;
+}
+.style {
+  .menu {
+    height: 70px;
+    margin: 0 0 10px 0;
+  }
+  .main {
+    min-height: 600px;
+    margin: 0 0 10px 0;
+    .left {
+      min-height: 600px;
+      background: #fff;
+      margin: 0 10px 0 0;
+      .top {
+        height: 60px;
+        line-height: 60px;
+        background-color: #054982;
+        color: #fff;
+        font-size: 25px;
+        font-weight: 600;
+        letter-spacing: 2px;
+        text-align: center;
+      }
+      .menuList {
+        height: 50px;
+        line-height: 50px;
+        text-align: center;
+        border-bottom: 1px solid #ccc;
+        p {
+          font-size: 20px;
+          font-weight: bold;
+        }
+      }
+    }
+    .right {
+      width: 78%;
+      min-height: 600px;
+      background: #fff;
+      padding: 0 20px;
+      .one {
+        height: 35px;
+        margin: 20px 0;
+        border-bottom: 1px dashed #ccc;
+        span:first-child {
+          display: inline-block;
+          width: 4px;
+          height: 20px;
+          background: #005293;
+          margin: 0 10px -3px 0;
+        }
+        span:nth-child(2) {
+          font-size: 20px;
+          color: #005293;
+          font-weight: bold;
+        }
+      }
+    }
+  }
+  .foot {
+    height: 135px;
+  }
+}
+</style>

+ 60 - 0
src/views/partisan/parts/newsDetail.vue

@@ -0,0 +1,60 @@
+<template>
+  <div id="newsDetail">
+    <el-row>
+      <el-col :span="24" class="info">
+        <h3>{{ details.title }}</h3>
+        <div>
+          <span>文章来源:{{ details.source }}</span>
+          <span>时间:{{ details.date }}</span>
+        </div>
+        <p>{{ details.content }}</p>
+      </el-col>
+    </el-row>
+  </div>
+</template>
+
+<script>
+import { mapState, createNamespacedHelpers } from 'vuex';
+export default {
+  name: 'newsDetail',
+  props: {
+    details: null,
+  },
+  components: {},
+  data: function() {
+    return {};
+  },
+  created() {},
+  methods: {},
+  computed: {
+    ...mapState(['user']),
+    pageTitle() {
+      return `${this.$route.meta.title}`;
+    },
+  },
+  metaInfo() {
+    return { title: this.$route.meta.title };
+  },
+};
+</script>
+
+<style lang="less" scoped>
+.info {
+  padding: 20px 0;
+  h3 {
+    font-size: 24px;
+    color: #005293;
+    text-align: center;
+  }
+  div {
+    text-align: center;
+    border-bottom: 1px solid #ccc;
+    padding: 0 0 40px 0;
+    margin: 0 0 20px 0;
+    span {
+      color: #666666;
+      padding: 0 10px;
+    }
+  }
+}
+</style>

+ 83 - 0
src/views/partisan/parts/newsList.vue

@@ -0,0 +1,83 @@
+<template>
+  <div id="newsList">
+    <el-row>
+      <el-col :span="24" class="info">
+        <el-col :span="24" class="list" @click.native="detailBtn(item.id)" v-for="(item, index) in list" :key="index">
+          <span></span>
+          <span class="textOver">{{ item.title }}</span>
+          <span>{{ item.date }}</span>
+        </el-col>
+        <el-col :span="24" class="page">
+          <pagination :total="total"></pagination>
+        </el-col>
+      </el-col>
+    </el-row>
+  </div>
+</template>
+
+<script>
+import pagination from '@/components/pagination.vue';
+import { mapState, createNamespacedHelpers } from 'vuex';
+export default {
+  name: 'newsList',
+  props: {
+    list: null,
+    total: null,
+  },
+  components: {
+    pagination,
+  },
+  data: function() {
+    return {};
+  },
+  created() {},
+  methods: {
+    detailBtn(id) {
+      this.$emit('detailBtn', id);
+    },
+  },
+  computed: {
+    ...mapState(['user']),
+    pageTitle() {
+      return `${this.$route.meta.title}`;
+    },
+  },
+  metaInfo() {
+    return { title: this.$route.meta.title };
+  },
+};
+</script>
+
+<style lang="less" scoped>
+.info {
+  .list {
+    padding: 0 0 7px 0;
+    span:first-child {
+      display: inline-block;
+      width: 4px;
+      height: 4px;
+      background: #ccc;
+      margin: 0px 10px 7px 0px;
+    }
+    span:nth-child(2) {
+      display: inline-block;
+      font-size: 16px;
+      color: #555555;
+      font-family: '微软雅黑';
+      width: 85%;
+      margin: 0 30px 0 0;
+    }
+    span:last-child {
+      display: inline-block;
+      width: 90px;
+      font-size: 16px;
+      color: #a8abb7;
+      font-family: '微软雅黑';
+      text-align: right;
+    }
+  }
+  .page {
+    height: 50px;
+  }
+}
+</style>