zhangqin преди 2 седмици
родител
ревизия
cd25f99e48

+ 0 - 9
src/api/qw/allocationRule.js

@@ -1,9 +0,0 @@
-import request from '@/utils/request'
-
-// 查询企业微信分配规则列表
-export function listAllocationRule() {
-  return request({
-    url: '/qw/allocationRule/list',
-    method: 'get'
-  })
-}

+ 9 - 0
src/api/qw/assignRule.js

@@ -9,6 +9,15 @@ export function listAssignRule(query) {
   })
 }
 
+// 查询分配规则列表(指定参数版本)
+export function pageAssignRule(params) {
+  return request({
+    url: '/qwAssignRule/page',
+    method: 'get',
+    params: params
+  })
+}
+
 // 获取分配规则详细
 export function getAssignRule(id) {
   return request({

+ 2 - 64
src/api/qw/contactWay.js

@@ -1,71 +1,9 @@
 import request from '@/utils/request'
 
-// 查询企微活码列表
-export function listContactWay(query) {
+// 查询企活码列表
+export function listContactWay() {
   return request({
     url: '/qw/contactWay/list',
-    method: 'get',
-    params: query
-  })
-}
-export function sync(id) {
-  return request({
-    url: '/qw/contactWay/sync/' + id,
-    method: 'get'
-  })
-}
-export function informationList() {
-  return request({
-    url: '/qw/contactWay/informationList',
     method: 'get'
   })
 }
-export function statistics(query) {
-  return request({
-    url: '/qw/contactWay/statistics',
-    method: 'get',
-    params: query
-  })
-}
-// 查询企微活码详细
-export function getContactWay(id) {
-  return request({
-    url: '/qw/contactWay/' + id,
-    method: 'get'
-  })
-}
-
-// 新增企微活码
-export function addContactWay(data) {
-  return request({
-    url: '/qw/contactWay',
-    method: 'post',
-    data: data
-  })
-}
-
-// 修改企微活码
-export function updateContactWay(data) {
-  return request({
-    url: '/qw/contactWay',
-    method: 'put',
-    data: data
-  })
-}
-
-// 删除企微活码
-export function delContactWay(id) {
-  return request({
-    url: '/qw/contactWay/' + id,
-    method: 'delete'
-  })
-}
-
-// 导出企微活码
-export function exportContactWay(query) {
-  return request({
-    url: '/qw/contactWay/export',
-    method: 'get',
-    params: query
-  })
-}

+ 9 - 0
src/api/qw/groupLiveCode.js

@@ -9,6 +9,15 @@ export function listGroupLiveCode(query) {
   })
 }
 
+// 查询活码列表(指定参数版本)
+export function pageGroupLiveCode(params) {
+  return request({
+    url: '/qwGroupLiveCode/page',
+    method: 'get',
+    params: params
+  })
+}
+
 // 查询活码详细
 export function getGroupLiveCode(id) {
   return request({

+ 220 - 48
src/components/H5Editor/index.vue

@@ -1,8 +1,33 @@
 <template>
   <div class="h5-editor-container">
+    <!-- 标题编辑栏 -->
+    <div class="title-bar">
+      <el-input v-model="pageTitle" placeholder="输入落地页标题" class="title-input" />
+    </div>
     <el-row :gutter="16" class="editor-wrapper">
-      <!-- 左侧:组件面板 -->
-      <el-col :span="4" class="left-panel">
+      <!-- 左上:页面选择面板 -->
+      <el-col :span="3" class="page-panel">
+        <div class="panel-header">
+          <h3>页面选择</h3>
+        </div>
+        <div class="page-list">
+          <div 
+            v-for="page in pageList" 
+            :key="page.pageStep"
+            class="page-card" 
+            :class="{active: currentPageStep === page.pageStep}"
+            @click="switchPage(page.pageStep)"
+          >
+            <div class="page-icon">
+              <i :class="page.icon"></i>
+            </div>
+            <div class="page-name">{{ page.name }}</div>
+          </div>
+        </div>
+      </el-col>
+
+      <!-- 左下:组件面板 -->
+      <el-col :span="3" class="left-panel">
         <div class="panel-header">
           <h3>组件库</h3>
         </div>
@@ -30,7 +55,7 @@
       </el-col>
       
       <!-- 中间:预览区域 -->
-      <el-col :span="11" class="center-panel">
+      <el-col :span="10" class="center-panel">
         <div class="panel-header">
           <h3>页面预览</h3>
           <span class="device-info">手机预览 (375px)</span>
@@ -70,7 +95,7 @@
       </el-col>
       
       <!-- 右侧:属性面板 -->
-      <el-col :span="9" class="right-panel">
+      <el-col :span="8" class="right-panel">
         <div class="panel-header">
           <h3>属性设置</h3>
         </div>
@@ -128,6 +153,14 @@ export default {
   },
   data() {
     return {
+      pageTitle: '',
+      currentPageStep: 'home',
+      pageList: [
+        { pageStep: 'home', name: '首页', icon: 'el-icon-house' },
+        { pageStep: 'appletLand', name: '小程序授权页', icon: 'el-icon-document' },
+        { pageStep: 'purchaseSuccess', name: '小程序出码页', icon: 'el-icon-success' }
+      ],
+      configList: [],
       componentList: [{
         groupName: '基础控件',
         comps: [
@@ -187,14 +220,79 @@ export default {
   methods: {
     initData(json) {
       try {
-        this.list = JSON.parse(json)
+        const data = JSON.parse(json)
+        // 支持新格式
+        if (data.pageTitle !== undefined) {
+          this.pageTitle = data.pageTitle
+          this.configList = data.configList || []
+          // 初始化configList,确保所有页面都存在
+          this.initializeConfigList()
+          // 加载首页数据
+          this.switchPage('home')
+        } else {
+          // 兼容旧格式(直接是数组)
+          this.configList = [{
+            pageStep: 'home',
+            moduleList: Array.isArray(data) ? data : []
+          }, {
+            pageStep: 'appletLand',
+            moduleList: []
+          }, {
+            pageStep: 'purchaseSuccess',
+            moduleList: []
+          }]
+          this.list = this.configList[0].moduleList
+        }
       } catch (e) {
+        // 初始化为新格式
+        this.pageTitle = ''
+        this.configList = [{
+          pageStep: 'home',
+          moduleList: []
+        }, {
+          pageStep: 'appletLand',
+          moduleList: []
+        }, {
+          pageStep: 'purchaseSuccess',
+          moduleList: []
+        }]
         this.list = []
       }
       // 重置选中状态和属性表单
       this.form = {}
       this.index = -1
     },
+    initializeConfigList() {
+      const pageSteps = ['home', 'appletLand', 'purchaseSuccess']
+      pageSteps.forEach(pageStep => {
+        if (!this.configList.find(config => config.pageStep === pageStep)) {
+          this.configList.push({
+            pageStep: pageStep,
+            moduleList: []
+          })
+        }
+      })
+    },
+    switchPage(pageStep) {
+      // 保存当前页面的数据
+      const currentConfig = this.configList.find(config => config.pageStep === this.currentPageStep)
+      if (currentConfig) {
+        currentConfig.moduleList = this.list
+      }
+      
+      // 切换到新页面
+      this.currentPageStep = pageStep
+      const newConfig = this.configList.find(config => config.pageStep === pageStep)
+      if (newConfig) {
+        this.list = newConfig.moduleList || []
+      } else {
+        this.list = []
+      }
+      
+      // 重置选中和表单
+      this.form = {}
+      this.index = -1
+    },
     end() {
 
     },
@@ -490,50 +588,22 @@ export default {
       }
       return data
     },
-    select(index) {
-      this.index = index
-      // 更新所有元素的active状态
-      this.list.forEach((item, i) => {
-        this.$set(item, 'active', i === index)
-      })
-      // 直接绑定list中的对象
-      this.form = this.list[index]
-    },
-    del() {
-      if (this.index >= 0 && this.index < this.list.length) {
-        this.list.splice(this.index, 1)
-        this.form = {}
-        this.index = -1
-      }
-    },
-    /** 处理删除操作 */
-    handleDelete(index) {
-      this.index = index
-      this.list.splice(index, 1)
-      this.form = {}
-      this.index = -1
-    },
-    updateForm(newForm) {
-      // 更新表单数据
-      if (this.index < 0 || this.index >= this.list.length) {
-        return
+    /** 获取完整的页面数据(新格式JSON) */
+    getPageData() {
+      // 保存当前页面数据
+      const currentConfig = this.configList.find(config => config.pageStep === this.currentPageStep)
+      if (currentConfig) {
+        currentConfig.moduleList = this.list
       }
-
-      Object.assign(this.form, newForm)
-
-      // 更新列表中的数据
-      for (const key in newForm) {
-        if (Object.hasOwnProperty.call(newForm, key)) {
-          // 如果是嵌套对象,递归更新
-          if (typeof newForm[key] === 'object' && newForm[key] !== null) {
-            for (const nestedKey in newForm[key]) {
-              this.$set(this.list[this.index][key], nestedKey, newForm[key][nestedKey])
-            }
-          } else {
-            this.$set(this.list[this.index], key, newForm[key])
-          }
-        }
+      
+      return {
+        pageTitle: this.pageTitle,
+        configList: this.configList
       }
+    },
+    /** 获取JSON字符串 */
+    getJsonString() {
+      return JSON.stringify(this.getPageData())
     }
   }
 }
@@ -547,6 +617,30 @@ export default {
   flex-direction: column;
 }
 
+// 标题编辑栏
+.title-bar {
+  padding: 12px 16px;
+  background: #fff;
+  border-bottom: 1px solid #e8e8e8;
+  flex-shrink: 0;
+  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.08);
+
+  .title-input {
+    height: 36px;
+    
+    ::v-deep .el-input__inner {
+      font-size: 14px;
+      font-weight: 500;
+      color: #303133;
+      padding: 0 12px;
+
+      &::placeholder {
+        color: #909399;
+      }
+    }
+  }
+}
+
 .editor-wrapper {
   height: 100%;
   padding: 0;
@@ -579,7 +673,85 @@ export default {
   }
 }
 
-// 左侧组件面板
+// 页面选择面板
+.page-panel {
+  display: flex;
+  flex-direction: column;
+  height: 100%;
+  background: #fff;
+  border-radius: 0;
+  overflow: hidden;
+  box-shadow: 0 2px 12px 0 rgba(0, 0, 0, 0.1);
+
+  .page-list {
+    flex: 1;
+    overflow-y: auto;
+    padding: 12px;
+    display: flex;
+    flex-direction: column;
+    gap: 8px;
+
+    &::-webkit-scrollbar {
+      width: 6px;
+    }
+
+    &::-webkit-scrollbar-thumb {
+      background: #d0d0d0;
+      border-radius: 3px;
+
+      &:hover {
+        background: #aaa;
+      }
+    }
+  }
+
+  .page-card {
+    display: flex;
+    flex-direction: column;
+    align-items: center;
+    gap: 8px;
+    padding: 12px 8px;
+    border: 2px solid #e8e8e8;
+    border-radius: 6px;
+    background: #f9f9f9;
+    cursor: pointer;
+    transition: all 0.3s ease;
+    user-select: none;
+
+    .page-icon {
+      font-size: 24px;
+      color: #409eff;
+    }
+
+    .page-name {
+      font-size: 11px;
+      color: #606266;
+      text-align: center;
+      word-break: break-word;
+      width: 100%;
+    }
+
+    &:hover {
+      border-color: #409eff;
+      background: #e6f2ff;
+      box-shadow: 0 2px 8px rgba(64, 158, 255, 0.2);
+    }
+
+    &.active {
+      border-color: #409eff;
+      background: #d3e8ff;
+      font-weight: 600;
+      box-shadow: 0 2px 8px rgba(64, 158, 255, 0.3);
+
+      .page-name {
+        color: #409eff;
+        font-weight: 600;
+      }
+    }
+  }
+}
+
+// 左下组件面板
 .left-panel {
   display: flex;
   flex-direction: column;

+ 9 - 8
src/views/adv/landingPageTemplate/index.vue

@@ -275,7 +275,7 @@ export default {
       this.reset();
       // 清空H5编辑器的缓存数据
       if (this.$refs.h5Editor) {
-        this.$refs.h5Editor.initData("[]");
+        this.$refs.h5Editor.initData('{"pageTitle":"","configList":[]}')
       }
       this.open = true;
       this.title = "添加模板";
@@ -353,17 +353,18 @@ export default {
     },
     /** 打开H5编辑器 */
     openH5(templateData) {
-      this.h5Open = true;
+      this.h5Open = true
       this.$nextTick(() => {
-        this.$refs.h5Editor.initData(templateData || "[]");
-      });
+        // 支持新旧数据格式
+        this.$refs.h5Editor.initData(templateData || '{"pageTitle":"","configList":[]}')
+      })
     },
     /** H5编辑器确定 */
     h5Ok() {
-      // 通过ref获取子组件的list数据
-      const listData = this.$refs.h5Editor.list;
-      this.form.templateData = JSON.stringify(listData);
-      this.h5Open = false; // 关闭对话框
+      // 通过ref获取子组件的完整数据(新格式JSON)
+      const pageData = this.$refs.h5Editor.getPageData()
+      this.form.templateData = JSON.stringify(pageData)
+      this.h5Open = false // 关闭对话框
     },
     /** H5编辑器取消 */
     h5Cancel() {

+ 52 - 15
src/views/adv/site/index.vue

@@ -181,7 +181,7 @@
           
           <!-- 企微分配规则 -->
           <el-form-item label="企微分配规则" prop="allocationRule">
-            <el-radio-group v-model="form.allocationRule" @change="handleAllocationRuleChange" :disabled="isDetail">
+            <el-radio-group v-model="form.allocationRule" @change="handleAllocationRuleChange" :disabled="!form.launchType || isDetail">
               <el-radio 
                 label="1"
                 :border="true"
@@ -210,7 +210,7 @@
               <el-option
                 v-for="item in allocationRuleList"
                 :key="item.id"
-                :label="item.allocationRuleName"
+                :label="item.ruleName"
                 :value="item.id"
               />
             </el-select>
@@ -218,21 +218,21 @@
           
           <el-form-item 
             v-if="form.allocationRule === '0'" 
-            label="群活码" 
+            :label="form.launchType === 1 ? '群活码' : '企业微信活码'" 
             prop="allocationRuleId"
             class="slide-fade"
           >
             <el-select 
               v-model="form.allocationRuleId" 
-              placeholder="请选择群活码" 
+              :placeholder="form.launchType === 1 ? '请选择群活码' : '请选择企业微信活码'" 
               style="width: 100%"
               filterable
               :disabled="isDetail"
             >
               <el-option
-                v-for="item in groupActiveList"
+                v-for="item in form.launchType === 1 ? groupActiveList : contactWayList"
                 :key="item.id"
-                :label="item.groupActiveName"
+                :label="form.launchType === 1 ? item.groupName : item.name"
                 :value="item.id"
               />
             </el-select>
@@ -543,8 +543,9 @@ import { pageCallbackAccount, getCallbackAccount, queryEventType, saveEventType
 import { pageDomain } from "@/api/adv/domain";
 import { pageProject as pageChannel } from "@/api/adv/channel";
 import { pageProject } from "@/api/adv/project";
-import { listAllocationRule } from "@/api/qw/allocationRule";
-import { listGroupActive } from "@/api/qw/groupActual";
+import { pageAssignRule } from "@/api/qw/assignRule";
+import { pageGroupLiveCode } from "@/api/qw/groupLiveCode";
+import { listContactWay } from "@/api/qw/contactWay";
 
 export default {
   name: "Site",
@@ -594,6 +595,8 @@ export default {
       allocationRuleList: [],
       // 群活码列表
       groupActiveList: [],
+      // 企业微信活码列表
+      contactWayList: [],
       // 回传账号列表
       callbackAccountList: [],
       // 投放域名列表
@@ -703,6 +706,7 @@ export default {
       this.launchDomainList = [];
       this.allocationRuleList = [];
       this.groupActiveList = [];
+      this.contactWayList = [];
       this.conversionEvents = [];
       this.advertiserEventOptions = [];
       this.systemEventOptions = [];
@@ -982,16 +986,26 @@ export default {
       this.advertiserEventOptions = [];
       this.systemEventOptions = [];
       
-      // 重置企微分配规则相关数据
+      // 重置企分配规则相关数据
       this.form.allocationRule = undefined;
       this.form.allocationRuleId = undefined;
       this.allocationRuleList = [];
       this.groupActiveList = [];
+      this.contactWayList = [];
       
       // 根据投放类型加载广告商列表
       if (launchType) {
         this.loadAdvertiserList(launchType);
       }
+      
+      // 根据投放类型重新加载活码数据(如果已选择活码分配)
+      if (this.form.allocationRule === '0') {
+        if (launchType === 1) {
+          this.loadGroupActiveList();
+        } else if (launchType === 2) {
+          this.loadContactWayList();
+        }
+      }
     },
     /** 加载广告商列表 */
     loadAdvertiserList(launchType) {
@@ -1209,20 +1223,29 @@ export default {
       this.form.allocationRuleId = undefined;
       this.allocationRuleList = [];
       this.groupActiveList = [];
+      this.contactWayList = [];
       
       // 根据不同的分配规则加载对应数据
       if (allocationRule === '1') {
         // 加载企业微信分配规则列表
         this.loadAllocationRuleList();
       } else if (allocationRule === '0') {
-        // 加载群活码列表
-        this.loadGroupActiveList();
+        // 根据投放类型加载群活码或企业微信活码
+        if (this.form.launchType === 1) {
+          this.loadGroupActiveList();
+        } else if (this.form.launchType === 2) {
+          this.loadContactWayList();
+        }
       }
     },
     /** 加载企业微信分配规则列表 */
     loadAllocationRuleList() {
-      listAllocationRule().then(response => {
-        this.allocationRuleList = response.data || [];
+      pageAssignRule({
+        pageNum: 1,
+        pageSize: 1000,
+        status: 1
+      }).then(response => {
+        this.allocationRuleList = response.data.records || [];
       }).catch(error => {
         console.error('加载企业微信分配规则列表失败:', error);
         this.allocationRuleList = [];
@@ -1230,13 +1253,27 @@ export default {
     },
     /** 加载群活码列表 */
     loadGroupActiveList() {
-      listGroupActive().then(response => {
-        this.groupActiveList = response.data || [];
+      pageGroupLiveCode({
+        pageNum: 1,
+        pageSize: 1000,
+        status: 1
+      }).then(response => {
+        this.groupActiveList = response.data.records || [];
       }).catch(error => {
         console.error('加载群活码列表失败:', error);
         this.groupActiveList = [];
       });
     },
+    /** 加载企业微信活码列表 */
+    loadContactWayList() {
+      // 调用/qw/contactWay/list接口获取企业微信活码数据
+      listContactWay().then(response => {
+        this.contactWayList = response.data || [];
+      }).catch(error => {
+        console.error('加载企业微信活码列表失败:', error);
+        this.contactWayList = [];
+      });
+    },
     /** 保存转换事件 */
     saveConversionEvents() {
       // 调用保存接口

+ 1 - 1
src/views/qw/groupActual/index.vue

@@ -253,7 +253,7 @@ export default {
           const data = { ...this.form };
           // 有效期处理:剆除时間秘,添加默认时間秘 00:00:00
           if (data.efficientTime && typeof data.efficientTime === 'string') {
-            data.efficientTime = data.efficientTime + ' 00:00:00';
+            data.efficientTime = data.efficientTime + 'T00:00:00';
           }
           addOrUpdateGroupActual(data).then(response => {
             this.msgSuccess(this.form.id ? "修改成功" : "新增成功");