瀏覽代碼

更新科技政策

guhongwei 5 年之前
父節點
當前提交
f84db3c81e
共有 3 個文件被更改,包括 75 次插入8 次删除
  1. 2 1
      src/components/policy/policy.vue
  2. 69 4
      src/layout/policy/policyrightcont.vue
  3. 4 3
      src/views/policy/policy.vue

+ 2 - 1
src/components/policy/policy.vue

@@ -21,7 +21,7 @@
           </el-col>
           <el-col :span="19" class="rightcont">
             <rightcont v-on="$listeners" :columnName="columnName" :contentList="contentList" :total="total" v-if="display === 'list'"></rightcont>
-            <policyrightcont v-else :policyInfo="policyInfo"></policyrightcont>
+            <policyrightcont v-else :columnTitle="columnTitle" :policyInfo="policyInfo"></policyrightcont>
           </el-col>
         </div>
       </el-col>
@@ -51,6 +51,7 @@ export default {
     contentList: null, //内容
     total: null,
     display: { type: String, default: 'list' },
+    columnTitle: null, //信息详情头部栏目标题
     policyInfo: null, //信息详情
   },
   components: {

+ 69 - 4
src/layout/policy/policyrightcont.vue

@@ -1,8 +1,30 @@
 <template>
   <div id="policyrightcont">
-    <el-col class="zhengce">
-      {{ policyInfo.title }}
-    </el-col>
+    <el-row>
+      <el-col :span="24" class="info">
+        <el-col :span="24" class="topInfo">
+          <span>{{ columnTitle }}</span>
+        </el-col>
+        <el-col :span="24" class="infoMess">
+          <el-col :span="24" class="title">
+            {{ policyInfo.title }}
+          </el-col>
+          <el-col :span="24" class="infoDate">
+            <p>
+              <span>发布人:{{ policyInfo.publish }}</span>
+              <span>来源:{{ policyInfo.orgin }}</span>
+              <span>发布时间: {{ policyInfo.meta && policyInfo.meta.createdAt ? new Date(policyInfo.meta.createdAt).toLocaleDateString() : '' || '' }}</span>
+            </p>
+          </el-col>
+          <el-col v-if="policyInfo.picture" class="image">
+            <el-image style="width:50%" :src="policyInfo.picture"></el-image>
+          </el-col>
+          <el-col :span="24" class="content">
+            <p v-html="policyInfo.content"></p>
+          </el-col>
+        </el-col>
+      </el-col>
+    </el-row>
   </div>
 </template>
 
@@ -10,6 +32,7 @@
 export default {
   name: 'policyrightcont',
   props: {
+    columnTitle: null,
     policyInfo: null,
   },
   components: {},
@@ -20,4 +43,46 @@ export default {
 };
 </script>
 
-<style lang="less" scoped></style>
+<style lang="less" scoped>
+p {
+  padding: 0;
+  margin: 0;
+}
+.info {
+  padding: 0 20px;
+}
+.topInfo {
+  height: 60px;
+  line-height: 60px;
+  font-size: 22px;
+}
+.infoMess .title {
+  line-height: 30px;
+  text-align: center;
+  font-size: 16px;
+  font-weight: bold;
+  color: #000000;
+  margin: 0 0 20px 0;
+}
+.infoDate {
+  height: 36px;
+  line-height: 36px;
+}
+.infoDate p {
+  width: 700px;
+  background: #eeeeee;
+  margin: 0 105px;
+}
+.infoDate p span {
+  font-size: 14px;
+  color: #000;
+  padding: 0 0 0 80px;
+}
+.infoMess .image {
+  text-align: center;
+  margin: 20px 0 0 0;
+}
+.content {
+  padding: 0px 0 20px 0;
+}
+</style>

+ 4 - 3
src/views/policy/policy.vue

@@ -7,6 +7,7 @@
       :columnName="columnName"
       :contentList="contentList"
       :total="total"
+      :columnTitle="columnTitle"
       :policyInfo="policyInfo"
       @clickLists="submit"
       @fetch="fetchInfo"
@@ -36,6 +37,7 @@ export default {
     contentList: [],
     total: 1,
     leftId: '',
+    columnTitle: '',
     policyInfo: {},
   }),
   async created() {
@@ -90,10 +92,9 @@ export default {
     async fetchInfo(id) {
       this.display = 'detail';
       const res = await this.newsFetch(id);
-      // for (const val of res.data) {
-      // }
+      const result = await this.policyfetch(res.data.column_id);
+      this.$set(this, `columnTitle`, result.data.name);
       this.$set(this, `policyInfo`, res.data);
-      console.log(res.data);
       // 查询详情,赋值
     },
   },