Browse Source

add gonganxian

lhl 1 year ago
parent
commit
b4c3912189

+ 6 - 0
src/components/leftNav/LeftNav.vue

@@ -185,6 +185,12 @@
 					case '/newContent/hhs/detail':
 						title = '洪湖市红会'
 						break
+					case '/newContent/gnx/list':
+						title = '公安县红会'
+						break
+					case '/newContent/gnx/detail':
+						title = '公安县红会'
+						break
 					case '/directories/list':
 						title = '造血干细胞捐献名录'
 						break

+ 28 - 1
src/router.js

@@ -277,8 +277,35 @@ export default new Router({
 		meta: {
 			title: '县市区红会动态'
 		},
-		redirect: '/newContent/jlx',
+		redirect: '/newContent/jzq',
 		children: [
+			{
+				path: 'gnx',
+				name: 'gnx',
+				component: () => import('./views/newContent/Gnx.vue'),
+				meta: {
+					title: '公安县红会动态'
+				},
+				redirect: '/newContent/gnx/list',
+				children: [
+					{
+						path: 'list',
+						name: 'gnxList',
+						component: () => import('./views/newContent/gnx/List.vue'),
+						meta: {
+							title: '公安县红会动态'
+						}
+					},
+					{
+						path: 'detail',
+						name: 'gnxdetail',
+						component: () => import('./views/newContent/gnx/Detail.vue'),
+						meta: {
+							title: '公安县红会动态'
+						}
+					}
+				]
+			},
 			{
 				path: 'jlx',
 				name: 'jlx',

+ 64 - 0
src/views/newContent/Gnx.vue

@@ -0,0 +1,64 @@
+<template>
+	<div class="news">
+		<left-nav :navList="navList" :topTitle="'县市区红会动态'">
+			<router-view></router-view>
+		</left-nav>
+	</div>
+</template>
+
+<script>
+	import LeftNav from '../../components/leftNav/LeftNav.vue';
+
+	export default {
+		components: {
+			LeftNav
+		},
+		data() {
+			return {
+				navList: [{
+						index: 3,
+						name: '荆州区红会',
+						path: '/newContent/jzq'
+					},
+					{
+						index: 4,
+						name: '沙市区红会',
+						path: '/newContent/ssq'
+					}, {
+						index: 0,
+						name: '江陵县红会',
+						path: '/newContent/jlx'
+					},
+					{
+						index: 5,
+						name: '松滋市红会',
+						path: '/newContent/szs'
+					},
+					{
+						index: 0,
+						name: '公安县红会',
+						path: '/newContent/gnx'
+					},
+					{
+						index: 1,
+						name: '石首市红会',
+						path: '/newContent/sss'
+					},
+					{
+						index: 6,
+						name: '监利县红会',
+						path: '/newContent/jls'
+					},
+					{
+						index: 2,
+						name: '洪湖市红会',
+						path: '/newContent/hhs'
+					}
+				],
+			};
+		}
+	};
+</script>
+
+<style>
+</style>

+ 39 - 33
src/views/newContent/Hhs.vue

@@ -16,39 +16,45 @@
 		data() {
 			return {
 				navList: [{
-					index: 0,
-					name: '江陵县红会',
-					path: '/newContent/jlx'
-				}, {
-					index: 1,
-					name: '石首市红会',
-					path: '/newContent/sss'
-				}, {
-					index: 2,
-					name: '洪湖市红会',
-					path: '/newContent/hhs'
-				},
-				{
-					index: 3,
-					name: '荆州区红会',
-					path: '/newContent/jzq'
-				},
-				{
-					index: 4,
-					name: '沙市区红会',
-					path: '/newContent/ssq'
-				},
-				{
-					index: 5,
-					name: '松滋市红会',
-					path: '/newContent/szs'
-				},
-				{
-					index: 6,
-					name: '监利县红会',
-					path: '/newContent/jls'
-				},
-			],
+						index: 3,
+						name: '荆州区红会',
+						path: '/newContent/jzq'
+					},
+					{
+						index: 4,
+						name: '沙市区红会',
+						path: '/newContent/ssq'
+					}, {
+						index: 0,
+						name: '江陵县红会',
+						path: '/newContent/jlx'
+					},
+					{
+						index: 5,
+						name: '松滋市红会',
+						path: '/newContent/szs'
+					},
+					{
+						index: 0,
+						name: '公安县红会',
+						path: '/newContent/gnx'
+					},
+					{
+						index: 1,
+						name: '石首市红会',
+						path: '/newContent/sss'
+					},
+					{
+						index: 6,
+						name: '监利县红会',
+						path: '/newContent/jls'
+					},
+					{
+						index: 2,
+						name: '洪湖市红会',
+						path: '/newContent/hhs'
+					}
+				],
 			};
 		}
 	};

+ 39 - 33
src/views/newContent/Jls.vue

@@ -16,39 +16,45 @@
 		data() {
 			return {
 				navList: [{
-					index: 0,
-					name: '江陵县红会',
-					path: '/newContent/jlx'
-				}, {
-					index: 1,
-					name: '石首市红会',
-					path: '/newContent/sss'
-				}, {
-					index: 2,
-					name: '洪湖市红会',
-					path: '/newContent/hhs'
-				},
-				{
-					index: 3,
-					name: '荆州区红会',
-					path: '/newContent/jzq'
-				},
-				{
-					index: 4,
-					name: '沙市区红会',
-					path: '/newContent/ssq'
-				},
-				{
-					index: 5,
-					name: '松滋市红会',
-					path: '/newContent/szs'
-				},
-				{
-					index: 6,
-					name: '监利县红会',
-					path: '/newContent/jls'
-				},
-			],
+						index: 3,
+						name: '荆州区红会',
+						path: '/newContent/jzq'
+					},
+					{
+						index: 4,
+						name: '沙市区红会',
+						path: '/newContent/ssq'
+					}, {
+						index: 0,
+						name: '江陵县红会',
+						path: '/newContent/jlx'
+					},
+					{
+						index: 5,
+						name: '松滋市红会',
+						path: '/newContent/szs'
+					},
+					{
+						index: 0,
+						name: '公安县红会',
+						path: '/newContent/gnx'
+					},
+					{
+						index: 1,
+						name: '石首市红会',
+						path: '/newContent/sss'
+					},
+					{
+						index: 6,
+						name: '监利县红会',
+						path: '/newContent/jls'
+					},
+					{
+						index: 2,
+						name: '洪湖市红会',
+						path: '/newContent/hhs'
+					}
+				],
 			};
 		}
 	};

+ 39 - 33
src/views/newContent/Jlx.vue

@@ -16,39 +16,45 @@
 		data() {
 			return {
 				navList: [{
-					index: 0,
-					name: '江陵县红会',
-					path: '/newContent/jlx'
-				}, {
-					index: 1,
-					name: '石首市红会',
-					path: '/newContent/sss'
-				}, {
-					index: 2,
-					name: '洪湖市红会',
-					path: '/newContent/hhs'
-				},
-				{
-					index: 3,
-					name: '荆州区红会',
-					path: '/newContent/jzq'
-				},
-				{
-					index: 4,
-					name: '沙市区红会',
-					path: '/newContent/ssq'
-				},
-				{
-					index: 5,
-					name: '松滋市红会',
-					path: '/newContent/szs'
-				},
-				{
-					index: 6,
-					name: '监利县红会',
-					path: '/newContent/jls'
-				},
-			],
+						index: 3,
+						name: '荆州区红会',
+						path: '/newContent/jzq'
+					},
+					{
+						index: 4,
+						name: '沙市区红会',
+						path: '/newContent/ssq'
+					}, {
+						index: 0,
+						name: '江陵县红会',
+						path: '/newContent/jlx'
+					},
+					{
+						index: 5,
+						name: '松滋市红会',
+						path: '/newContent/szs'
+					},
+					{
+						index: 0,
+						name: '公安县红会',
+						path: '/newContent/gnx'
+					},
+					{
+						index: 1,
+						name: '石首市红会',
+						path: '/newContent/sss'
+					},
+					{
+						index: 6,
+						name: '监利县红会',
+						path: '/newContent/jls'
+					},
+					{
+						index: 2,
+						name: '洪湖市红会',
+						path: '/newContent/hhs'
+					}
+				],
 			};
 		}
 	};

+ 39 - 33
src/views/newContent/Jzq.vue

@@ -16,39 +16,45 @@
 		data() {
 			return {
 				navList: [{
-					index: 0,
-					name: '江陵县红会',
-					path: '/newContent/jlx'
-				}, {
-					index: 1,
-					name: '石首市红会',
-					path: '/newContent/sss'
-				}, {
-					index: 2,
-					name: '洪湖市红会',
-					path: '/newContent/hhs'
-				},
-				{
-					index: 3,
-					name: '荆州区红会',
-					path: '/newContent/jzq'
-				},
-				{
-					index: 4,
-					name: '沙市区红会',
-					path: '/newContent/ssq'
-				},
-				{
-					index: 5,
-					name: '松滋市红会',
-					path: '/newContent/szs'
-				},
-				{
-					index: 6,
-					name: '监利县红会',
-					path: '/newContent/jls'
-				},
-			],
+						index: 3,
+						name: '荆州区红会',
+						path: '/newContent/jzq'
+					},
+					{
+						index: 4,
+						name: '沙市区红会',
+						path: '/newContent/ssq'
+					}, {
+						index: 0,
+						name: '江陵县红会',
+						path: '/newContent/jlx'
+					},
+					{
+						index: 5,
+						name: '松滋市红会',
+						path: '/newContent/szs'
+					},
+					{
+						index: 0,
+						name: '公安县红会',
+						path: '/newContent/gnx'
+					},
+					{
+						index: 1,
+						name: '石首市红会',
+						path: '/newContent/sss'
+					},
+					{
+						index: 6,
+						name: '监利县红会',
+						path: '/newContent/jls'
+					},
+					{
+						index: 2,
+						name: '洪湖市红会',
+						path: '/newContent/hhs'
+					}
+				],
 			};
 		}
 	};

+ 39 - 33
src/views/newContent/Ssq.vue

@@ -16,39 +16,45 @@
 		data() {
 			return {
 				navList: [{
-					index: 0,
-					name: '江陵县红会',
-					path: '/newContent/jlx'
-				}, {
-					index: 1,
-					name: '石首市红会',
-					path: '/newContent/sss'
-				}, {
-					index: 2,
-					name: '洪湖市红会',
-					path: '/newContent/hhs'
-				},
-				{
-					index: 3,
-					name: '荆州区红会',
-					path: '/newContent/jzq'
-				},
-				{
-					index: 4,
-					name: '沙市区红会',
-					path: '/newContent/ssq'
-				},
-				{
-					index: 5,
-					name: '松滋市红会',
-					path: '/newContent/szs'
-				},
-				{
-					index: 6,
-					name: '监利县红会',
-					path: '/newContent/jls'
-				},
-			],
+						index: 3,
+						name: '荆州区红会',
+						path: '/newContent/jzq'
+					},
+					{
+						index: 4,
+						name: '沙市区红会',
+						path: '/newContent/ssq'
+					}, {
+						index: 0,
+						name: '江陵县红会',
+						path: '/newContent/jlx'
+					},
+					{
+						index: 5,
+						name: '松滋市红会',
+						path: '/newContent/szs'
+					},
+					{
+						index: 0,
+						name: '公安县红会',
+						path: '/newContent/gnx'
+					},
+					{
+						index: 1,
+						name: '石首市红会',
+						path: '/newContent/sss'
+					},
+					{
+						index: 6,
+						name: '监利县红会',
+						path: '/newContent/jls'
+					},
+					{
+						index: 2,
+						name: '洪湖市红会',
+						path: '/newContent/hhs'
+					}
+				],
 			};
 		}
 	};

+ 39 - 33
src/views/newContent/Sss.vue

@@ -16,39 +16,45 @@
 		data() {
 			return {
 				navList: [{
-					index: 0,
-					name: '江陵县红会',
-					path: '/newContent/jlx'
-				}, {
-					index: 1,
-					name: '石首市红会',
-					path: '/newContent/sss'
-				}, {
-					index: 2,
-					name: '洪湖市红会',
-					path: '/newContent/hhs'
-				},
-				{
-					index: 3,
-					name: '荆州区红会',
-					path: '/newContent/jzq'
-				},
-				{
-					index: 4,
-					name: '沙市区红会',
-					path: '/newContent/ssq'
-				},
-				{
-					index: 5,
-					name: '松滋市红会',
-					path: '/newContent/szs'
-				},
-				{
-					index: 6,
-					name: '监利县红会',
-					path: '/newContent/jls'
-				},
-			],
+						index: 3,
+						name: '荆州区红会',
+						path: '/newContent/jzq'
+					},
+					{
+						index: 4,
+						name: '沙市区红会',
+						path: '/newContent/ssq'
+					}, {
+						index: 0,
+						name: '江陵县红会',
+						path: '/newContent/jlx'
+					},
+					{
+						index: 5,
+						name: '松滋市红会',
+						path: '/newContent/szs'
+					},
+					{
+						index: 0,
+						name: '公安县红会',
+						path: '/newContent/gnx'
+					},
+					{
+						index: 1,
+						name: '石首市红会',
+						path: '/newContent/sss'
+					},
+					{
+						index: 6,
+						name: '监利县红会',
+						path: '/newContent/jls'
+					},
+					{
+						index: 2,
+						name: '洪湖市红会',
+						path: '/newContent/hhs'
+					}
+				],
 			};
 		}
 	};

+ 39 - 33
src/views/newContent/Szs.vue

@@ -16,39 +16,45 @@
 		data() {
 			return {
 				navList: [{
-					index: 0,
-					name: '江陵县红会',
-					path: '/newContent/jlx'
-				}, {
-					index: 1,
-					name: '石首市红会',
-					path: '/newContent/sss'
-				}, {
-					index: 2,
-					name: '洪湖市红会',
-					path: '/newContent/hhs'
-				},
-				{
-					index: 3,
-					name: '荆州区红会',
-					path: '/newContent/jzq'
-				},
-				{
-					index: 4,
-					name: '沙市区红会',
-					path: '/newContent/ssq'
-				},
-				{
-					index: 5,
-					name: '松滋市红会',
-					path: '/newContent/szs'
-				},
-				{
-					index: 6,
-					name: '监利县红会',
-					path: '/newContent/jls'
-				},
-			],
+						index: 3,
+						name: '荆州区红会',
+						path: '/newContent/jzq'
+					},
+					{
+						index: 4,
+						name: '沙市区红会',
+						path: '/newContent/ssq'
+					}, {
+						index: 0,
+						name: '江陵县红会',
+						path: '/newContent/jlx'
+					},
+					{
+						index: 5,
+						name: '松滋市红会',
+						path: '/newContent/szs'
+					},
+					{
+						index: 0,
+						name: '公安县红会',
+						path: '/newContent/gnx'
+					},
+					{
+						index: 1,
+						name: '石首市红会',
+						path: '/newContent/sss'
+					},
+					{
+						index: 6,
+						name: '监利县红会',
+						path: '/newContent/jls'
+					},
+					{
+						index: 2,
+						name: '洪湖市红会',
+						path: '/newContent/hhs'
+					}
+				],
 			};
 		}
 	};

+ 37 - 0
src/views/newContent/gnx/Detail.vue

@@ -0,0 +1,37 @@
+<template>
+	<div class="new-detail">
+		<dcontent :content="content"></dcontent>
+	</div>
+</template>
+
+<script>
+	import { details } from '../../../request/api.js'
+	export default {
+		data() {
+			return {
+				content: '',
+				detail: {},
+				idd:0
+			}
+		},
+		created() {
+			this.getContent()
+		},
+		methods:{
+			getContent() {
+				let obj = this
+				this.idd = this.$route.query.id
+				obj.getDetail()
+			},
+			getDetail() {
+				let obj = this
+				details({},this.idd).then(res => {
+					obj.content = res.data.content
+				})
+			}
+		}
+	}
+</script>
+
+<style>
+</style>

+ 200 - 0
src/views/newContent/gnx/List.vue

@@ -0,0 +1,200 @@
+<template>
+  <div class="new-list">
+    <div class="serch-wrapper">
+      <div class="search">
+        <input
+          type="text"
+          v-model="keyword"
+          placeholder="请输入内容进行搜索"
+          class=""
+          @keyup.enter="getList(keyword)"
+        />
+        <img
+          src="../../../assets/img/search.png"
+          class="hand"
+          @click="getList(keyword)"
+        />
+      </div>
+    </div>
+    <div class="empty" v-if="newList.length == 0">暂无数据</div>
+    <div
+      class="new-item hand"
+      v-for="item in newList"
+      :key="item.id"
+      @click="navTo(item.url?item.url:('/newContent/gnx/detail?id=' + item.id))"
+    >
+      <div class="title clamp">
+        <span class="title-icon"></span>
+        {{ item.title }}
+      </div>
+      <div class="time">{{ item.releasetime | time }}</div>
+    </div>
+    <el-pagination
+      layout="prev, pager, next"
+      :total="total"
+      background
+      prev-text="上一页"
+      next-text="下一页"
+      @current-change="currentChange"
+      :page-size="15"
+      hide-on-single-page
+    ></el-pagination>
+  </div>
+</template>
+
+<script>
+import { getList,getArtList } from "../../../request/api.js";
+export default {
+  data() {
+    return {
+      newList: [],
+      total: 0,
+      page: 1,
+      limit: 15,
+      keyword: "",
+    };
+  },
+  filters: {
+    time(val) {
+      let arr = val.split(" ");
+      let str = arr[0];
+      str = str.replace(/-/g, ".");
+      return str;
+    },
+  },
+  created() {
+    this.getList();
+  },
+  methods: {
+    navTo(url) {
+     if(url.indexOf('http') != -1) {
+     	window.open(url)
+     }else {
+     	this.$router.push(url);
+     }
+    },
+    currentChange(e) {
+      this.page = e;
+      this.getList();
+    },
+    getList(keyword) {
+      let obj = this;
+      if (keyword) {
+        obj.page = 1;
+      }
+      getArtList({
+        ifyid: 62,
+        page: obj.page,
+        limit: obj.limit,
+        key: keyword,
+      }).then((res) => {
+        obj.newList = res.data.list;
+        obj.total = res.data.count;
+      });
+    },
+    compare(attribute) {
+      return function (obj1, obj2) {
+        var val1 = obj1[attribute];
+        var val2 = obj2[attribute];
+        if (val1 < val2) {
+          return 1;
+        } else if (val1 > val2) {
+          return -1;
+        } else {
+          return 0;
+        }
+      };
+    },
+  },
+};
+</script>
+
+<style lang="scss" scoped>
+.new-list {
+  position: relative;
+
+  .empty {
+    text-align: center;
+    color: #999;
+    height: 400px;
+    line-height: 400px;
+  }
+  .new-item {
+    display: flex;
+    justify-content: space-between;
+    font-size: 18px;
+    font-family: PingFang SC;
+    font-weight: 500;
+    color: #666666;
+    height: 40px;
+    border-bottom: 1px solid #e5e5e5;
+    line-height: 40px;
+
+    &:hover {
+      color: red;
+
+      .title {
+        .title-icon {
+          border-left-color: red;
+        }
+      }
+    }
+
+    .title {
+      width: 500px;
+
+      .title-icon {
+        display: inline-block;
+        width: 0;
+        height: 0;
+        width: 0;
+        height: 0;
+        border-top: 6px solid transparent;
+        border-left: 8px solid #d2d2d2;
+        border-bottom: 6px solid transparent;
+      }
+    }
+  }
+}
+
+/deep/ .el-pagination {
+  margin-top: 50px;
+  text-align: center;
+}
+.serch-wrapper {
+  display: flex;
+  height: 33px;
+  position: absolute;
+  top: -80px;
+  right: -50px;
+
+  .search {
+    padding-left: 13px;
+    padding-right: 13px;
+    width: 295px;
+    height: 33px;
+    line-height: 33px;
+    background: #ffffff;
+    border: 1px solid #cccccc;
+    border-radius: 10px;
+    // margin-bottom: 10px;
+    display: flex;
+    justify-content: space-between;
+    align-items: center;
+
+    input {
+      width: 235px;
+      font-size: 16px;
+      font-family: PingFang SC;
+      font-weight: bold;
+      outline: none;
+      border: none;
+    }
+
+    img {
+      width: 20px;
+      height: 20px;
+    }
+  }
+}
+</style>