Переглянути джерело

技术圈专题seo的配置

ccf 3 роки тому
батько
коміт
86b7e0f843
2 змінених файлів з 43 додано та 3 видалено
  1. 23 2
      pages/main/index/js/special_list.js
  2. 20 1
      pages/main/index/special_list.vue

+ 23 - 2
pages/main/index/js/special_list.js

@@ -2,18 +2,39 @@ export default {
   data() {
     return {
       list: [],
+      special_list_seo:{},
+      special_list_seo_dialog:false,
     }
   },
   mounted() {
     this.getList();
+    this.getConfig();
   },
   methods: {
+    async getConfig() {
+      let res = await this.$post("/uapi/pub/getConfig",{key:"special_list_seo"});
+      if (res && res.status === 1) {
+        let data=res.data;
+        this.special_list_seo =JSON.parse(data);
+      }
+    },
     async getList() {
       let res = await this.$post("/uapi/news/special_list");
       if (res && res.status === 1) {
         this.list = res.data || [];
       }
     },
+    async set_config()
+    {
+      let value=this.special_list_seo;
+      let res = await this.$post("/uapi/pub/setConfig",{key:"special_list_seo",value:JSON.stringify(value)});
+      if (res && res.status === 1) {
+        this.$message({
+          type: 'success',
+          message: '操作成功!'
+        });
+      }
+    },
     async del(id) {
       let res = await this.$post("/uapi/news/special_del",{id:id});
       if (res && res.status === 1) {
@@ -34,8 +55,8 @@ export default {
         this.getList();
       }
     },
-    async add() {
-
+    async special_list_seo_dialog_show() {
+      this.special_list_seo_dialog=true;
     },
   }
 

+ 20 - 1
pages/main/index/special_list.vue

@@ -2,7 +2,7 @@
   <div>
 
     <el-button type="primary" @click="$router.push({path:'/main/special_add', query:{id:0}})" style="margin-top: 15px;margin-right: 30px;float: left">添加专题</el-button>
-    <el-button type="primary" @click="$router.push({path:'/main/special_add', query:{id:0}})" style="margin-top: 15px;margin-right: 30px;float: left">专题列表SEO配置</el-button>
+    <el-button type="primary" @click="special_list_seo_dialog_show" style="margin-top: 15px;margin-right: 30px;float: left">专题列表SEO配置</el-button>
     <div style="clear: both;"></div>
     <div style="margin-bottom: 15px"></div>
     <div>
@@ -26,6 +26,25 @@
         </el-table-column>
       </el-table>
     </div>
+
+
+    <el-dialog title="列表SEO配置" :visible.sync="special_list_seo_dialog" width="500px">
+      <el-form :model="special_list_seo"  label-width="70px">
+        <el-form-item label="标题">
+          <el-input v-model="special_list_seo.seo_title" autocomplete="off"></el-input>
+        </el-form-item>
+        <el-form-item label="关键字">
+          <el-input v-model="special_list_seo.seo_keywords" autocomplete="off"></el-input>
+        </el-form-item>
+        <el-form-item label="描述">
+          <el-input v-model="special_list_seo.seo_desc" autocomplete="off"></el-input>
+        </el-form-item>
+      </el-form>
+      <div slot="footer" class="dialog-footer">
+        <el-button size="medium" @click="special_list_seo_dialog = false">取消</el-button>
+        <el-button size="medium" type="primary" @click="set_config">确定</el-button>
+      </div>
+    </el-dialog>
   </div>
 </template>
 <script src="./js/special_list.js"></script>