zhaoyun 2 månader sedan
förälder
incheckning
e81319cbe1

+ 178 - 0
mer_mer_admin/src/api/article.js

@@ -0,0 +1,178 @@
+// +----------------------------------------------------------------------
+// | CRMEB [ CRMEB赋能开发者,助力企业发展 ]
+// +----------------------------------------------------------------------
+// | Copyright (c) 2016~2025 https://www.crmeb.com All rights reserved.
+// +----------------------------------------------------------------------
+// | Licensed CRMEB并不是自由软件,未经许可不能去掉CRMEB相关版权
+// +----------------------------------------------------------------------
+// | Author: CRMEB Team <admin@crmeb.com>
+// +----------------------------------------------------------------------
+
+import request from '@/utils/request';
+
+/**
+ * 删除文章
+ * @param id
+ * @constructor
+ */
+export function DelArticle(id) {
+  return request({
+    url: `/admin/merchant/article/delete/${id}`,
+    method: 'POST',
+  });
+}
+
+/**
+ * 文章详情
+ * @param id
+ * @constructor
+ */
+export function InfoArticle(id) {
+  return request({
+    url: `/admin/merchant/article/info/${id}`,
+    method: 'get',
+  });
+}
+
+/**
+ * 文章列表
+ * @param pram
+ * @constructor
+ */
+export function ListArticle(pram) {
+  const data = {
+    author: pram.author,
+    cid: pram.cid,
+    page: pram.page,
+    limit: pram.limit,
+    title: pram.title,
+    searchType: pram.searchType,
+    content: pram.content,
+  };
+  return request({
+    url: '/admin/merchant/article/list',
+    method: 'GET',
+    params: data,
+  });
+}
+
+/**
+ * 新增文章
+ * @param pram
+ * @constructor
+ */
+export function AddArticle(pram) {
+  const data = {
+    author: pram.author,
+    cid: pram.cid,
+    content: pram.content,
+    cover: pram.cover,
+    isBanner: pram.isBanner,
+    isHot: pram.isHot,
+    sort: pram.sort,
+    synopsis: pram.synopsis,
+    title: pram.title,
+    url: pram.url,
+  };
+  return request({
+    url: '/admin/merchant/article/save',
+    method: 'post',
+    data: data,
+  });
+}
+
+/**
+ * 更新文章
+ * @param pram
+ * @constructor
+ */
+export function UpdateArticle(pram) {
+  const data = {
+    author: pram.author,
+    cid: pram.cid,
+    content: pram.content,
+    cover: pram.cover,
+    isBanner: pram.isBanner,
+    isHot: pram.isHot,
+    sort: pram.sort,
+    synopsis: pram.synopsis,
+    title: pram.title,
+    id: pram.id,
+  };
+  return request({
+    url: '/admin/merchant/article/update',
+    method: 'post',
+    data,
+  });
+}
+
+/**
+ * 新增文章分类
+ * @param data
+ * @constructor
+ */
+export function articleCategoryAddApi(data) {
+  return request({
+    url: '/admin/merchant/article/category/add',
+    method: 'POST',
+    data,
+  });
+}
+
+/**
+ * 删除文章分类
+ * @param data
+ * @constructor
+ */
+export function articleCategoryDelApi(row) {
+  return request({
+    url: `admin/merchant/article/category/delete/${row.id}`,
+    method: 'POST',
+  });
+}
+
+/**
+ * 文章分类分页列表
+ * @constructor
+ */
+export function articleCategoryListApi() {
+  return request({
+    url: `admin/merchant/article/category/list`,
+    method: 'GET',
+  });
+}
+
+/**
+ * 修改文章分类
+ * @param data
+ * @constructor
+ */
+export function articleCategoryUpdateApi(data) {
+  return request({
+    url: `admin/merchant/article/category/update`,
+    method: 'POST',
+    data,
+  });
+}
+
+/**
+ * 文章开关
+ * @param data
+ */
+export function articleSwitchApi(id) {
+  return request({
+    url: `/admin/merchant/article/switch/${id}`,
+    method: 'POST',
+  });
+}
+
+/**
+ * 文章分类开关
+ * @param data
+ */
+export function articleCategorySwitchApi(id) {
+  return request({
+    url: `/admin/merchant/article/category/switch/${id}`,
+    method: 'POST',
+  });
+}

+ 2 - 2
mer_mer_admin/src/api/categoryApi.js

@@ -68,7 +68,7 @@ export function listCategroy(pram) {
     type: pram.type,
   };
   return request({
-    url: '/admin/category/list',
+    url: '/admin/merchant/category/list',
     method: 'GET',
     params: data,
   });
@@ -147,7 +147,7 @@ export function categroyUpdateStatus(id) {
  */
 export function articleInfoApi(params) {
   return request({
-    url: `/admin/article/info`,
+    url: `/admin/merchant/article/info`,
     method: 'GET',
     params,
   });

+ 102 - 31
mer_mer_admin/src/components/Category/edit.vue

@@ -48,7 +48,12 @@
         type="primary"
         :loading="loadingBtn"
         @click="handlerSubmit('editPram')"
-        v-hasPermi="['merchant:product:category:update']"
+		v-hasPermi="[
+		  'merchant:product:category:add',
+		  'merchant:product:category:update',
+		  'merchant:article:category:update',
+		  'merchant:article:category:add',
+		]"
         >确定</el-button
       >
     </div>
@@ -67,6 +72,7 @@
 // +----------------------------------------------------------------------
 
 import * as categoryApi from '@/api/categoryApi.js';
+import * as articleApi from '@/api/article.js';
 import * as selfUtil from '@/utils/ZBKJIutil.js';
 import * as storeApi from '@/api/product.js';
 export default {
@@ -101,6 +107,7 @@ export default {
         pid: 0,
         sort: 0,
         id: 0,
+		type: this.biztype.value,
       },
       categoryProps: {
         value: 'id',
@@ -152,14 +159,16 @@ export default {
       this.$emit('hideEditDialog');
     },
     initEditData() {
-      const { icon, name, pid, sort, id } = this.editData;
+      const { icon, name, pid, sort, id ,type} = this.editData;
       if (this.isCreate === 1) {
         this.editPram.icon = icon;
         this.editPram.name = name;
         this.editPram.pid = pid;
         this.editPram.sort = sort;
         this.editPram.id = id;
+		this.editPram.type = type;
       } else {
+		this.editPram.type = this.biztype.value;
         this.editPram.pid = this.prent.id;
       }
     },
@@ -169,35 +178,97 @@ export default {
         this.handlerSaveOrUpdate(this.isCreate === 0);
       });
     },
-    handlerSaveOrUpdate(isSave) {
-      if (isSave) {
-        this.loadingBtn = true;
-        storeApi
-          .productCategoryAddApi(this.editPram)
-          .then((data) => {
-            this.$emit('hideEditDialog');
-            this.$message.success('创建目录成功');
-            this.$store.commit('product/SET_MerProductClassify', []);
-            this.loadingBtn = false;
-          })
-          .catch(() => {
-            this.loadingBtn = false;
-          });
-      } else {
-        this.loadingBtn = true;
-        storeApi
-          .productCategoryUpdateApi(this.editPram)
-          .then((data) => {
-            this.$emit('hideEditDialog');
-            this.$message.success('更新目录成功');
-            this.$store.commit('product/SET_MerProductClassify', []);
-            this.loadingBtn = false;
-          })
-          .catch(() => {
-            this.loadingBtn = false;
-          });
-      }
-    },
+	handlerSaveOrUpdate(isSave) {
+	  if (isSave) {
+	    // this.editPram.pid = this.prent.id
+	    this.loadingBtn = true;
+	    if (this.biztype.value !== 3) {
+	      if (this.editPram.pid === 0) this.editPram.level = 1;
+	      if (!this.editPram.level) this.editPram.level = parseInt(this.prent.level) + 1;
+	      storeApi
+	        .productCategoryAddApi(this.editPram)
+	        .then((data) => {
+	          this.$emit('hideEditDialog');
+	          this.$message.success('创建目录成功');
+	          this.$store.commit('product/SET_AdminProductClassify', []);
+	          this.loadingBtn = false;
+	        })
+	        .catch(() => {
+	          this.loadingBtn = false;
+	        });
+	    } else {
+	      articleApi
+	        .articleCategoryAddApi(this.editPram)
+	        .then((data) => {
+	          this.$emit('hideEditDialog');
+	          this.$message.success('创建目录成功');
+	          localStorage.removeItem('articleClass');
+	          this.loadingBtn = false;
+	        })
+	        .catch(() => {
+	          this.loadingBtn = false;
+	        });
+	    }
+	  } else {
+	    this.loadingBtn = true;
+	    if (this.biztype.value !== 3) {
+	      if (this.editPram.pid === this.editData.id) return this.$message.warning('父级不能选当前分类');
+	      storeApi
+	        .productCategoryUpdateApi(this.editPram)
+	        .then((data) => {
+	          this.$emit('hideEditDialog');
+	          this.$message.success('更新目录成功');
+	          this.$store.commit('product/SET_MerProductClassify', []);
+	          this.loadingBtn = false;
+	        })
+	        .catch(() => {
+	          this.loadingBtn = false;
+	        });
+	    } else {
+	      this.editPram.pid = Array.isArray(this.editPram.pid) ? this.editPram.pid[0] : this.editPram.pid;
+	      articleApi
+	        .articleCategoryUpdateApi(this.editPram)
+	        .then((data) => {
+	          this.$emit('hideEditDialog');
+	          this.$message.success('更新目录成功');
+	          localStorage.removeItem('articleClass');
+	          this.loadingBtn = false;
+	        })
+	        .catch(() => {
+	          this.loadingBtn = false;
+	        });
+	    }
+	  }
+	},
+    // handlerSaveOrUpdate(isSave) {
+    //   if (isSave) {
+    //     this.loadingBtn = true;
+    //     storeApi
+    //       .productCategoryAddApi(this.editPram)
+    //       .then((data) => {
+    //         this.$emit('hideEditDialog');
+    //         this.$message.success('创建目录成功');
+    //         this.$store.commit('product/SET_MerProductClassify', []);
+    //         this.loadingBtn = false;
+    //       })
+    //       .catch(() => {
+    //         this.loadingBtn = false;
+    //       });
+    //   } else {
+    //     this.loadingBtn = true;
+    //     storeApi
+    //       .productCategoryUpdateApi(this.editPram)
+    //       .then((data) => {
+    //         this.$emit('hideEditDialog');
+    //         this.$message.success('更新目录成功');
+    //         this.$store.commit('product/SET_MerProductClassify', []);
+    //         this.loadingBtn = false;
+    //       })
+    //       .catch(() => {
+    //         this.loadingBtn = false;
+    //       });
+    //   }
+    // },
   },
 };
 </script>

+ 62 - 12
mer_mer_admin/src/components/Category/list.vue

@@ -65,9 +65,9 @@
                     <a @click="handleAddMenu(scope.row)">添加子目录</a>
                     <el-divider direction="vertical"></el-divider>
                   </template>
-                  <a @click="handleEditMenu(scope.row)" v-hasPermi="['merchant:product:category:update']">编辑</a>
+                  <a @click="handleEditMenu(scope.row)" v-hasPermi="['merchant:product:category:update', 'merchant:article:category:update']">编辑</a>
                   <el-divider direction="vertical"></el-divider>
-                  <a @click="handleDelMenu(scope.row)" v-hasPermi="['merchant:product:category:delete']">删除</a>
+                  <a @click="handleDelMenu(scope.row)" v-hasPermi="['merchant:product:category:delete', 'merchant:article:category:delete']">删除</a>
                 </template>
               </el-table-column>
             </template>
@@ -112,6 +112,7 @@ import info from './info';
 import edit from './edit';
 import * as selfUtil from '@/utils/ZBKJIutil.js';
 import { checkPermi } from '@/utils/permission';
+import * as articleApi from '@/api/article.js';
 export default {
   // name: "list"
   components: { info, edit },
@@ -177,7 +178,13 @@ export default {
     };
   },
   mounted() {
-    if (checkPermi(['merchant:product:category:list'])) this.handlerGetTreeList();
+		if (this.biztype.value === 3) {
+		  if (checkPermi(['merchant:article:category:list'])) this.handlerGetList();
+		} else {
+		  if (checkPermi(['merchant:product:category:list'])) this.handlerGetTreeList();
+		}
+		
+    //if (checkPermi(['merchant:product:category:list'])) this.handlerGetTreeList();
   },
   methods: {
     checkPermi, //权限控制
@@ -225,18 +232,57 @@ export default {
         }
       }
     },
+	
+	// handleDelete(rowData) {
+	//   this.$modalSure(this.biztype.value === 2 ? '删除当前数据?' : '删除品类吗?该品类优惠券将同步删除。').then(() => {
+	//     if (this.biztype.value === 2) {
+	//       articleApi.articleCategoryDelApi(rowData).then((data) => {
+	//         this.handlerGetList();
+	//         localStorage.removeItem('articleClass');
+	//         this.$message.success('删除成功');
+	//       });
+	//     } else {
+	//       storeApi.productCategoryDeleteApi(rowData.id).then((data) => {
+	//         this.handlerGetTreeList();
+	//         this.$message.success('删除成功');
+	//       });
+	//     }
+	//   });
+	// },
+	
     handleDelMenu(rowData) {
       this.$modalSure('删除当前数据?').then(() => {
-        storeApi.productCategoryDeleteApi(rowData.id).then((res) => {
-          this.handlerGetTreeList();
-          this.$store.commit('product/SET_MerProductClassify', []);
-          this.$message.success('删除成功');
-        });
+		if (this.biztype.value === 3) {
+			articleApi.articleCategoryDelApi(rowData).then((data) => {
+			  this.handlerGetList();
+			  localStorage.removeItem('articleClass');
+			  this.$message.success('删除成功');
+			  this.handlerGetList();
+			});
+		  
+		} else {
+			storeApi.productCategoryDeleteApi(rowData.id).then((res) => {
+			  this.$store.commit('product/SET_MerProductClassify', []);
+			  this.$message.success('删除成功');
+			   this.handlerGetTreeList();
+			});
+		  
+		}
+       
       });
     },
-    handlerGetList() {
-      this.handlerGetTreeList();
-    },
+    // handlerGetList() {
+    //   this.handlerGetTreeList();
+    // },
+	handlerGetList() {
+	  articleApi.articleCategoryListApi().then((data) => {
+	    this.dataList = data;
+	    let list = data.filter((item) => {
+	      return item.status;
+	    });
+	    localStorage.setItem('articleClass', JSON.stringify(list));
+	  });
+	},
     changeNodes(data) {
       if (data.length > 0) {
         for (var i = 0; i < data.length; i++) {
@@ -285,7 +331,11 @@ export default {
         this.editDialogConfig.prent = {};
         this.editDialogConfig.type = 0;
         this.editDialogConfig.visible = false;
-        this.handlerGetTreeList();
+		if (this.biztype.value === 3) {
+		  this.handlerGetList();
+		} else {
+		   this.handlerGetTreeList();
+		}
       }, 200);
     },
     handleSelectionChange(d1, { checkedNodes, checkedKeys, halfCheckedNodes, halfCheckedKeys }) {

+ 44 - 5
mer_mer_admin/src/router/modules/marketing.js

@@ -26,34 +26,73 @@ const marketingRouter = {
       path: 'seckill',
       component: () => import('@/views/marketing/seckill/index'),
       name: 'Seckill',
-      meta: { title: '秒杀', icon: '' },
+      meta: { title: '精选', icon: '' },
       children: [
         {
           path: 'list',
           component: () => import('@/views/marketing/seckill/seckillList/index'),
           name: 'SeckillList',
-          meta: { title: '秒杀商品', icon: '' },
+          meta: { title: '精选商品', icon: '' },
         },
         {
           path: 'seckillActivity',
           component: () => import('@/views/marketing/seckill/seckillActivity/index'),
           name: 'SeckillActivity',
-          meta: { title: '秒杀活动', icon: '' },
+          meta: { title: '精选活动', icon: '' },
         },
         {
           path: 'creatActivity/:activityId?',
           component: () => import('@/views/marketing/seckill/seckillActivity/creatSeckill'),
           name: 'creatActivity',
-          meta: { title: '参加秒杀活动', icon: '', noCache: true, activeMenu: `/marketing/seckill/seckillActivity` },
+          meta: { title: '参加精选活动', icon: '', noCache: true, activeMenu: `/marketing/seckill/seckillActivity` },
         },
         {
           path: 'creatSeckill/:activityId?',
           component: () => import('@/views/marketing/seckill/seckillActivity/creatSeckill'),
           name: 'CreatSeckill',
-          meta: { title: '添加秒杀商品', icon: '', noCache: true, activeMenu: `/marketing/seckill/list` },
+          meta: { title: '添加精选商品', icon: '', noCache: true, activeMenu: `/marketing/seckill/list` },
         },
       ],
     },
+	{
+	  path: 'content',
+	  name: 'Content',
+	  meta: {
+	    title: '公告内容',
+	    noCache: true,
+	  },
+	  component: () => import('@/views/content'),
+	  children: [
+	    {
+	      path: 'articleManager',
+	      name: 'articleManager',
+	      component: () => import('@/views/content/article/list'),
+	      meta: {
+	        title: '文章管理',
+	        icon: 'clipboard',
+	      },
+	    },
+	    {
+	      path: 'articleCreat/:id?',
+	      name: 'articleCreat',
+	      component: () => import('@/views/content/article/edit'),
+	      meta: {
+	        title: '添加文章',
+	        noCache: true,
+	        activeMenu: `/marketing/content/articleManager`,
+	      },
+	    },
+	    {
+	      path: 'classifManager',
+	      name: 'classifManager',
+	      component: () => import('@/views/content/articleclass/list'),
+	      meta: {
+	        title: '文章分类',
+	        icon: 'clipboard',
+	      },
+	    },
+	  ],
+	},
     {
       path: 'group',
       component: () => import('@/views/marketing/group/index'),

+ 249 - 0
mer_mer_admin/src/views/content/article/edit.vue

@@ -0,0 +1,249 @@
+<template>
+  <div class="divBox">
+    <pages-header
+      ref="pageHeader"
+      :title="$route.params.id ? '编辑文章' : '添加文章'"
+      backUrl="/marketing/content/articleManager"
+    ></pages-header>
+    <el-card class="box-card mt14" shadow="never" :bordered="false" :body-style="{ padding: '40px 50px' }">
+      <div class="components-container">
+        <el-form ref="pram" label-width="81px" :model="pram" size="small">
+          <el-form-item
+            label="标题:"
+            prop="title"
+            :rules="[{ required: true, message: '请填写标题', trigger: ['blur', 'change'] }]"
+          >
+            <el-input v-model.trim="pram.title" class="from-ipt-width" placeholder="标题" maxlength="100" />
+          </el-form-item>
+          <el-form-item
+            label="作者:"
+            prop="author"
+            :rules="[{ required: true, message: '请填作者', trigger: ['blur', 'change'] }]"
+          >
+            <el-input v-model.trim="pram.author" class="from-ipt-width" placeholder="作者" maxlength="20" />
+          </el-form-item>
+          <el-form-item
+            label="文章分类:"
+            :rules="[{ required: true, message: '请选择分类', trigger: ['blur', 'change'] }]"
+          >
+            <el-select v-model.trim="pram.cid" placeholder="请选择" class="from-ipt-width">
+              <el-option v-for="item in categoryTreeData" :key="item.id" :label="item.name" :value="item.id">
+              </el-option>
+            </el-select>
+          </el-form-item>
+          <el-form-item
+            label="图文封面:"
+            prop="cover"
+            :rules="[{ required: true, message: '请上传图文封面', trigger: 'change' }]"
+          >
+            <div class="upLoadPicBox" @click="modalPicTap(false)">
+              <div v-if="pram.cover" class="pictrue"><img :src="pram.cover" /></div>
+              <div v-else class="upLoad">
+                <i class="el-icon-camera cameraIconfont" />
+              </div>
+            </div>
+          </el-form-item>
+          <el-form-item
+            label="文章简介:"
+            prop="synopsis"
+            :rules="[{ required: true, message: '请填写文章简介', trigger: ['blur', 'change'] }]"
+          >
+            <el-input
+              v-model.trim="pram.synopsis"
+              maxlength="100"
+              type="textarea"
+              :rows="2"
+              resize="none"
+              class="from-ipt-width"
+              placeholder="文章简介"
+            />
+          </el-form-item>
+          <el-form-item
+            label="文章内容:"
+            prop="content"
+            :rules="[{ required: true, message: '请填写文章内容', trigger: ['blur', 'change'] }]"
+          >
+            <Tinymce v-model.trim="pram.content"></Tinymce>
+          </el-form-item>
+          <el-form-item label="排序:">
+            <el-input-number v-model.trim="pram.sort" :min="0" :max="10" label="排序"></el-input-number>
+          </el-form-item>
+          <el-form-item label="是否Banner:">
+            <el-switch v-model.trim="pram.isBanner" active-text="是" inactive-text="否" />
+          </el-form-item>
+          <el-form-item label="是否热门:">
+            <el-switch v-model.trim="pram.isHot" active-text="是" inactive-text="否" />
+          </el-form-item>
+          <el-form-item>
+            <el-button
+              type="primary"
+              :loading="loading"
+              @click="handerSubmit('pram')"
+              v-hasPermi="['merchant:article:update', 'merchant:article:save']"
+              >保存</el-button
+            >
+          </el-form-item>
+        </el-form>
+      </div>
+    </el-card>
+  </div>
+</template>
+
+<script>
+// +---------------------------------------------------------------------
+// | CRMEB [ CRMEB赋能开发者,助力企业发展 ]
+// +---------------------------------------------------------------------
+// | Copyright (c) 2016~2025 https://www.crmeb.com All rights reserved.
+// +---------------------------------------------------------------------
+// | Licensed CRMEB并不是自由软件,未经许可不能去掉CRMEB相关版权
+// +---------------------------------------------------------------------
+// | Author: CRMEB Team <admin@crmeb.com>
+// +---------------------------------------------------------------------
+import Tinymce from '@/components/Tinymce/index';
+import * as articleApi from '@/api/article.js';
+import { getToken } from '@/utils/auth';
+import { Debounce } from '@/utils/validate';
+export default {
+  components: { Tinymce },
+  data() {
+    return {
+      loading: false,
+      constants: this.$constants,
+      categoryTreeData: [],
+      categoryProps: {
+        value: 'id',
+        label: 'name',
+        children: 'child',
+        expandTrigger: 'hover',
+        checkStrictly: true,
+        emitPath: false,
+      },
+      pram: {
+        author: null,
+        cid: null,
+        content: '', //<span>My Document\'s Title</span>
+        cover: '',
+        isBanner: false,
+        isHot: null,
+        shareSynopsis: null,
+        shareTitle: null,
+        sort: 0,
+        synopsis: null,
+        title: null,
+        id: null,
+        // mediaId: null
+      },
+      editData: {},
+      myHeaders: { 'X-Token': getToken() },
+      editorContentLaebl: '',
+    };
+  },
+  created() {
+    this.tempRoute = Object.assign({}, this.$route);
+  },
+  mounted() {
+    if (localStorage.getItem('articleClass')) {
+      this.categoryTreeData = JSON.parse(localStorage.getItem('articleClass'));
+    } else {
+      this.handlerGetCategoryTreeData();
+    }
+    if (this.$route.params.id) {
+      this.getInfo();
+      this.setTagsViewTitle();
+    }
+  },
+  methods: {
+    getInfo() {
+      articleApi.InfoArticle(this.$route.params.id).then((data) => {
+        this.editData = data;
+        this.hadlerInitEditData();
+      });
+    },
+    modalPicTap(multiple) {
+      const _this = this;
+      this.$modalUpload(
+        function (img) {
+          if (!img) return;
+          _this.pram.cover = img[0].sattDir;
+        },
+        multiple,
+        'content',
+      );
+    },
+    hadlerInitEditData() {
+      if (!this.$route.params.id) return;
+      const { author, cid, content, cover, isBanner, isHot, shareSynopsis, shareTitle, sort, synopsis, title, id } =
+        this.editData;
+      this.pram.author = author;
+      this.pram.cid = Number.parseInt(cid);
+      this.pram.content = content;
+      this.pram.cover = cover;
+      this.pram.isBanner = isBanner;
+      this.pram.isHot = isHot;
+      this.pram.shareSynopsis = shareSynopsis;
+      this.pram.shareTitle = shareTitle;
+      this.pram.sort = sort;
+      this.pram.synopsis = synopsis;
+      this.pram.title = title;
+      this.pram.id = id;
+    },
+    handlerGetCategoryTreeData() {
+      articleApi.articleCategoryListApi().then((data) => {
+        this.categoryTreeData = data;
+        let list = data.filter((item) => {
+          return item.status;
+        });
+        localStorage.setItem('articleClass', JSON.stringify(list));
+      });
+    },
+    handerSubmit: Debounce(function (form) {
+      this.$refs[form].validate((valid) => {
+        if (!valid) return;
+        if (!this.$route.params.id) {
+          this.handlerSave();
+        } else {
+          this.handlerUpdate();
+        }
+      });
+    }),
+    handlerUpdate() {
+      this.loading = true;
+      this.pram.shareTitle = this.pram.title;
+      this.pram.shareSynopsis = this.pram.synopsis;
+      articleApi
+        .UpdateArticle(this.pram)
+        .then((data) => {
+          this.$message.success('编辑文章成功');
+          this.loading = false;
+          this.$router.push({ path: '/marketing/content/articleManager' });
+        })
+        .catch(() => {
+          this.loading = false;
+        });
+    },
+    handlerSave() {
+      this.loading = true;
+      //this.pram.cid = Array.isArray(this.pram.cid) ? this.pram.cid[0] : this.pram.cid
+      this.pram.shareTitle = this.pram.title;
+      this.pram.shareSynopsis = this.pram.synopsis;
+      articleApi
+        .AddArticle(this.pram)
+        .then((data) => {
+          this.$message.success('新增文章成功');
+          this.loading = false;
+          this.$router.push({ path: '/marketing/content/articleManager' });
+        })
+        .catch(() => {
+          this.loading = false;
+        });
+    },
+    setTagsViewTitle() {
+      const title = '编辑文章';
+      const route = Object.assign({}, this.tempRoute, { title: `${title}-${this.$route.params.id}` });
+      this.$store.dispatch('tagsView/updateVisitedView', route);
+    },
+  },
+};
+</script>
+
+<style scoped></style>

+ 267 - 0
mer_mer_admin/src/views/content/article/list.vue

@@ -0,0 +1,267 @@
+<template>
+  <div class="divBox">
+    <el-card
+      :bordered="false"
+      shadow="never"
+      class="ivu-mt"
+      :body-style="{ padding: 0 }"
+      v-hasPermi="['merchant:article:list']"
+    >
+      <div class="padding-add">
+        <el-form inline size="small" label-position="right" @submit.native.prevent>
+          <el-form-item label="文章分类:">
+            <el-select
+              v-model="listPram.cid"
+              clearable
+              class="selWidth"
+              placeholder="请选择文章分类"
+              @change="handerSearch"
+            >
+              <el-option v-for="item in categoryTreeData" :key="item.id" :label="item.name" :value="item.id">
+              </el-option>
+            </el-select>
+          </el-form-item>
+          <el-form-item label="文章标题:">
+            <el-input
+              v-model.trim="title"
+              @keyup.enter.native="handerSearch"
+              placeholder="请输入文章标题"
+              class="selWidth"
+              size="small"
+              clearable
+            ></el-input>
+          </el-form-item>
+          <el-form-item label="文章作者:">
+            <el-input
+              v-model.trim="author"
+              @keyup.enter.native="handerSearch"
+              placeholder="请输入文章作者"
+              class="selWidth"
+              size="small"
+              clearable
+            ></el-input>
+          </el-form-item>
+          <el-form-item>
+            <el-button type="primary" size="small" @click="handerSearch()">查询</el-button>
+            <el-button size="small" @click="reset()">重置</el-button>
+          </el-form-item>
+        </el-form>
+      </div>
+    </el-card>
+    <el-card class="box-card mt14" :body-style="{ padding: '20px' }" shadow="never" :bordered="false">
+      <router-link :to="{ path: '/marketing/content/articleCreat' }">
+        <el-button size="small" type="primary" class="mr10" v-hasPermi="['merchant:article:save']">添加文章</el-button>
+      </router-link>
+      <el-table v-loading="listLoading" :data="listData.list" size="small" highlight-current-row class="mt20">
+        <el-table-column prop="id" label="ID" min-width="50" />
+        <el-table-column label="图片" min-width="80">
+          <template slot-scope="scope">
+            <div class="demo-image__preview line-heightOne">
+              <el-image :src="scope.row.cover" :preview-src-list="[scope.row.cover]" />
+            </div>
+          </template>
+        </el-table-column>
+        <el-table-column prop="title" label="文章标题" min-width="220" :show-overflow-tooltip="true" />
+        <el-table-column prop="visit" label="文章分类" min-width="150">
+          <template slot-scope="scope">
+            <span>{{ scope.row.cid | articleTypeFilter }}</span>
+          </template>
+        </el-table-column>
+        <el-table-column prop="visit" label="浏览量" min-width="150">
+          <template slot-scope="scope">
+            <span>{{ scope.row.visit }}</span>
+          </template>
+        </el-table-column>
+        <el-table-column prop="author" label="文章作者" min-width="180" />
+        <el-table-column prop="sort" label="排序" show-overflow-tooltip min-width="80" />
+        <el-table-column prop="createTime" label="创建时间" min-width="150" />
+        <el-table-column label="状态" fixed="right">
+          <template slot-scope="scope">
+            <el-switch
+              v-if="checkPermi(['merchant:article:switch'])"
+              v-model="scope.row.status"
+              :active-value="true"
+              :inactive-value="false"
+              active-text="启用"
+              inactive-text="禁用"
+              @change="handleStatusChange(scope.row)"
+            >
+            </el-switch>
+            <div v-else>{{ scope.row.status ? '启用' : '禁用' }}</div>
+          </template>
+        </el-table-column>
+        <el-table-column label="操作" width="100" fixed="right">
+          <template slot-scope="scope">
+            <router-link :to="{ path: '/marketing/content/articleCreat/' + scope.row.id }">
+              <a v-hasPermi="['merchant:article:update']">编辑</a>
+            </router-link>
+            <el-divider direction="vertical"></el-divider>
+            <a @click="handlerDelete(scope.row)" v-hasPermi="['merchant:article:delete']">删除</a>
+          </template>
+        </el-table-column>
+      </el-table>
+      <el-pagination
+        background
+        :current-page="listPram.page"
+        :page-sizes="constants.page.limit"
+        :layout="constants.page.layout"
+        :total="listData.total"
+        @size-change="handleSizeChange"
+        @current-change="handleCurrentChange"
+      />
+    </el-card>
+    <el-dialog
+      :visible.sync="editDialogConfig.visible"
+      :title="editDialogConfig.isEdit === 0 ? '创建文章' : '编辑文章'"
+      top="1vh"
+      width="900px"
+      destroy-on-close
+      :modal="false"
+      :close-on-click-modal="false"
+      class="articleModal"
+    >
+      <edit
+        v-if="editDialogConfig.visible"
+        :is-edit="editDialogConfig.isEdit"
+        :edit-data="editDialogConfig.editData"
+        @hideDialog="handlerHideDialog"
+      />
+    </el-dialog>
+  </div>
+</template>
+
+<script>
+// +---------------------------------------------------------------------
+// | CRMEB [ CRMEB赋能开发者,助力企业发展 ]
+// +---------------------------------------------------------------------
+// | Copyright (c) 2016~2025 https://www.crmeb.com All rights reserved.
+// +---------------------------------------------------------------------
+// | Licensed CRMEB并不是自由软件,未经许可不能去掉CRMEB相关版权
+// +---------------------------------------------------------------------
+// | Author: CRMEB Team <admin@crmeb.com>
+// +---------------------------------------------------------------------
+import * as articleApi from '@/api/article.js';
+import edit from './edit';
+import { checkPermi } from '@/utils/permission'; // 权限判断函数
+export default {
+  components: { edit },
+  data() {
+    return {
+      constants: this.$constants,
+      listPram: {
+        author: null,
+        cid: null,
+        page: 1,
+        title: '',
+        limit: this.$constants.page.limit[0],
+      },
+      author: '',
+      title: '',
+      listData: { list: [], total: 0 },
+      editDialogConfig: {
+        visible: false,
+        data: {},
+        isEdit: 0, // 0=add 1=edit
+      },
+      listLoading: true,
+      categoryTreeData: [],
+      categoryProps: {
+        value: 'id',
+        label: 'name',
+        children: 'child',
+        expandTrigger: 'hover',
+        checkStrictly: true,
+        emitPath: false,
+      },
+    };
+  },
+  created() {
+    if (localStorage.getItem('articleClass')) {
+      this.categoryTreeData = JSON.parse(localStorage.getItem('articleClass'));
+    } else {
+      if (checkPermi(['merchant:article:category:list'])) this.handlerGetTreeList();
+    }
+    if (checkPermi(['merchant:article:list'])) this.handlerGetListData(this.listPram);
+  },
+  methods: {
+    checkPermi,
+    //修改状态
+    handleStatusChange(row) {
+      articleApi.articleSwitchApi(row.id).then((res) => {
+        this.$message.success('更新状态成功');
+        this.handlerGetTreeList();
+      });
+    },
+    handlerGetTreeList() {
+      articleApi.articleCategoryListApi().then((data) => {
+        this.categoryTreeData = data;
+        let list = data.filter((item) => {
+          return item.status;
+        });
+        localStorage.setItem('articleClass', JSON.stringify(list));
+      });
+    },
+    handerSearch() {
+      this.listPram.page = 1;
+      this.handlerGetListData(this.listPram);
+    },
+    handlerGetListData(pram) {
+      this.listLoading = true;
+      this.listPram.title = encodeURIComponent(this.title);
+      this.listPram.author = encodeURIComponent(this.author);
+      articleApi.ListArticle(pram).then((data) => {
+        this.listData = data;
+        this.listLoading = false;
+      });
+    },
+    handlerOpenEdit(isEdit, editData) {
+      // 0=add 1=edit
+      if (isEdit === 1) {
+        this.editDialogConfig.isEdit = 1;
+        this.editDialogConfig.editData = editData;
+      } else {
+        this.editDialogConfig.isEdit = 0;
+      }
+      this.editDialogConfig.visible = true;
+    },
+    handlerHideDialog() {
+      this.handlerGetListData(this.listPram);
+      this.editDialogConfig.visible = false;
+    },
+    handlerDelete(rowData) {
+      this.$modalSure('删除当前文章', '提示').then((result) => {
+        articleApi.DelArticle(rowData.id).then((data) => {
+          this.$message.success('删除数据成功');
+          this.handlerGetListData(this.listPram);
+        });
+      });
+    },
+    handleSizeChange(val) {
+      this.listPram.limit = val;
+      this.handlerGetListData(this.listPram);
+    },
+    handleCurrentChange(val) {
+      this.listPram.page = val;
+      this.handlerGetListData(this.listPram);
+    },
+    reset() {
+      this.author = '';
+      this.title = '';
+      this.listPram = {
+        author: null,
+        cid: null,
+        page: 1,
+        title: '',
+        limit: this.$constants.page.limit[0],
+      };
+      this.handlerGetListData(this.listPram);
+    },
+  },
+};
+</script>
+
+<style scoped lang="scss">
+.articleModal {
+  z-index: 333 !important;
+}
+</style>

+ 28 - 0
mer_mer_admin/src/views/content/articleclass/list.vue

@@ -0,0 +1,28 @@
+<template>
+  <div class="components-container">
+    <category-list :biztype="constants.categoryType[2]" :pid="0" />
+  </div>
+</template>
+
+<script>
+// +---------------------------------------------------------------------
+// | CRMEB [ CRMEB赋能开发者,助力企业发展 ]
+// +---------------------------------------------------------------------
+// | Copyright (c) 2016~2025 https://www.crmeb.com All rights reserved.
+// +---------------------------------------------------------------------
+// | Licensed CRMEB并不是自由软件,未经许可不能去掉CRMEB相关版权
+// +---------------------------------------------------------------------
+// | Author: CRMEB Team <admin@crmeb.com>
+// +---------------------------------------------------------------------
+import categoryList from '@/components/Category/list';
+export default {
+  components: { categoryList },
+  data() {
+    return {
+      constants: this.$constants,
+    };
+  },
+};
+</script>
+
+<style scoped></style>

+ 20 - 0
mer_mer_admin/src/views/content/index.vue

@@ -0,0 +1,20 @@
+<template>
+  <div>
+    <router-view />
+  </div>
+</template>
+
+<script>
+// +---------------------------------------------------------------------
+// | CRMEB [ CRMEB赋能开发者,助力企业发展 ]
+// +---------------------------------------------------------------------
+// | Copyright (c) 2016~2025 https://www.crmeb.com All rights reserved.
+// +---------------------------------------------------------------------
+// | Licensed CRMEB并不是自由软件,未经许可不能去掉CRMEB相关版权
+// +---------------------------------------------------------------------
+// | Author: CRMEB Team <admin@crmeb.com>
+// +---------------------------------------------------------------------
+export default {};
+</script>
+
+<style lang="sass" scoped></style>

+ 6 - 6
mer_mer_admin/src/views/marketing/seckill/seckillActivity/creatSeckill.vue

@@ -3,7 +3,7 @@
     <div class="container_box">
       <pages-header
         ref="pageHeader"
-        title="添加秒杀商品"
+        title="添加精选商品"
         :backUrl="this.isEdit ? `/marketing/seckill/seckillActivity` : '/marketing/seckill/list'"
       ></pages-header>
       <el-card class="box-card box-body mt14 list-tabs" shadow="never" :bordered="false">
@@ -212,8 +212,8 @@ export default {
         share: [{ required: true, message: '请选择优惠比例', trigger: 'change' }],
         timeVal: [{ required: true, message: '请选择活动日期' }],
         discount: [{ required: true, message: '请选择优惠方式' }],
-        timeVal2: [{ type: 'array', required: true, message: '请输入选择秒杀场次', trigger: 'change' }],
-        id: [{ required: true, message: '请选择秒杀活动', trigger: 'change' }],
+        timeVal2: [{ type: 'array', required: true, message: '请输入选择精选场次', trigger: 'change' }],
+        id: [{ required: true, message: '请选择精选活动', trigger: 'change' }],
       },
       timeVal2: [],
       pickerOptions: timeOptions,
@@ -350,7 +350,7 @@ export default {
     },
     //行删除
     handleDelete(index, row) {
-      this.$modalSure('删除该秒杀商品吗?').then(() => {
+      this.$modalSure('删除该精选商品吗?').then(() => {
         let i = this.proData.findIndex((item) => item == row);
         this.proData.splice(i, 1);
       });
@@ -386,7 +386,7 @@ export default {
     },
     //添加商品
     addGoods() {
-      if (!this.form.id) return this.$message.warning('请先选择秒杀活动');
+      if (!this.form.id) return this.$message.warning('请先选择精选活动');
       const _this = this;
       this.$modalActivityProduct(
         function (row) {
@@ -450,7 +450,7 @@ export default {
             });
           });
           if (!total && total !== 0) return this.$message.warning('商品限量不能为空');
-          if (!price) return this.$message.warning('商品秒杀价格不能为空');
+          if (!price) return this.$message.warning('商品精选价格不能为空');
           if (total < this.proData.length) return this.$message.warning('商品限量总和不能小于0');
           let list = this.proData;
           //this.auditStatus === 3 获取商品规格id。因为重新提交 相当于添加商品,取普通商品规格id

+ 1 - 1
mer_mer_admin/src/views/marketing/seckill/seckillActivity/index.vue

@@ -143,7 +143,7 @@ export default {
     },
     // 删除
     handleDelete(id) {
-      this.$modalSure(`删除该秒杀活动吗?`).then(() => {
+      this.$modalSure(`删除该精选活动吗?`).then(() => {
         seckillAtivityDelApi(id).then(() => {
           this.$message.success('删除成功');
           handleDeleteTable(this.tableData.data.length, this.tableForm);

+ 7 - 5
mer_mer_admin/src/views/systemSetting/modifyStoreInfo/index.vue

@@ -155,11 +155,11 @@
                 placeholder="请查找位置"
                 readonly
               >
-                <!--<el-button-->
-                <!--slot="append"-->
-                <!--style="background: #46a6ff; color: #fff; border-radius: 0 4px 4px 0;"-->
-                <!--@click="onSearchs"-->
-                <!--&gt;查找位置</el-button>-->
+               <!--el-button
+                slot="append"
+                style="background: #46a6ff; color: #fff; border-radius: 0 4px 4px 0;"
+                @click="onSearchs">
+                查找位置</el-button-->
               </el-input>
               <iframe id="mapPage" width="100%" height="500px" frameborder="0" :src="keyUrl" />
             </el-form-item>
@@ -389,6 +389,7 @@ export default {
     // 选择经纬度
     selectAdderss(data) {
       this.merInfoForm.addressDetail = data.poiaddress + data.poiname;
+	  this.merInfoForm.city=data.cityname;
       this.merInfoForm.latitude = data.latlng.lat;
       this.merInfoForm.longitude = data.latlng.lng;
     },
@@ -463,6 +464,7 @@ export default {
     getConfigInfo() {
       merchantConfigInfoApi().then((res) => {
         this.merInfoForm = res;
+		//alert(this.merInfoForm.txMapKey)
         this.keyUrl = `https://apis.map.qq.com/tools/locpicker?type=1&key=${this.merInfoForm.txMapKey}&referer=myapp`;
         localStorage.setItem('JavaMerchantConfigInfo', JSON.stringify(res));
         this.labelarr = res.keywords.split(',') || [];