问题现象:供应商后台点击“复制商品”后进入了总后台商品编辑页,返回时会跳到总后台登录页;同时供应商发布/编辑商品时下一步会看到总后台才应出现的营销设置项。
原因定位:商品列表复制入口需要按当前路由区分供应商端和总后台端;供应商商品编辑页需要隐藏佣金、会员价、营销设置等平台后台配置项,并在上一步/下一步切换时跳过这些标签。
修复思路:复制商品时供应商端跳转到 /supplier/product/add_product,总后台端仍跳转到 /admin/product/add_product;供应商商品编辑页加载商品信息后移除不应显示的标签,并修正标签页前进后退逻辑。
行数以当前本地源码为准,不同版本可能有少量偏移。
1. 供应商端复制商品跳转供应商商品添加页
文件: src/pages/product/productList/index.vue
方法: changeMenu(row, name, index)
行数: 1526-1530
case "6": this.$router.push({ path: this.isSupplier ? "/supplier/product/add_product" : "/admin/product/add_product", query: { copy: row.id }, }); break;2. 供应商编辑/复制商品时隐藏平台后台配置项
文件: src/pages/product/productAdd/index.vue
方法: infoData(data)
行数: 1697-1701
// 供应商商品不显示佣金会员价和营销设置if (this.isSupplier) { // 删除佣金/会员价 (索引4) 和营销设置 (索引4,因为前面已经删除了一个) this.headTab.splice(4, 2);}3. 供应商商品上一步跳过隐藏标签页
文件: src/pages/product/productAdd/index.vue
方法: upTab()
行数: 1803-1812
upTab() { if (this.currentTab == 5 && this.formData.product_type != 0) { this.currentTab = (Number(this.currentTab) - 2).toString(); } else { if(this.isSupplier && this.currentTab == 7){ this.currentTab = (Number(this.currentTab) - 3).toString(); }else{ this.currentTab = (Number(this.currentTab) - 1).toString(); } }4. 供应商商品下一步跳过隐藏标签页
文件: src/pages/product/productAdd/index.vue
方法: downTab(name)
行数: 1908-1916
if (this.currentTab == 3 && this.formData.product_type != 0) { this.currentTab = (Number(this.currentTab) + 2).toString();} else { if(this.isSupplier && this.currentTab == 4){ this.currentTab = (Number(this.currentTab) + 3).toString(); }else{ this.currentTab = (Number(this.currentTab) + 1).toString(); }}验证方式:
1. 供应商后台进入商品列表,点击某个商品的“复制商品”。
2. 地址应保持在 /supplier/product/add_product?copy=商品ID,不能跳到 /admin/product/add_product。
3. 复制商品编辑流程中不展示佣金、会员价、营销设置等总后台配置项。
4. 点击上一步/下一步时能正常跳过隐藏标签,返回后仍留在供应商后台。

