feat(goodsOperation): 完善商品发布流程与分类选择界面

- 引入商品类型选择对话框,增强用户体验
- 重新组织商品发布步骤,优化步骤指示器
- 更新商品分类选择逻辑,确保用户选择到三级分类
- 调整数据传递与状态管理,支持商品编辑与复制功能
- 优化样式与布局,提高界面可用性
This commit is contained in:
田香琪
2026-08-27 17:48:16 +08:00
parent ffdae4a332
commit 2d80a795a7
3 changed files with 317 additions and 182 deletions

View File

@@ -1,31 +1,58 @@
<template>
<div class="goods-operation">
<!-- 填写商品详细信息含商品类型商品分类 -->
<second-step ref="second" :firstData="firstData" v-if="activestep === 1"></second-step>
<!-- 发布完成 -->
<third-step ref="third" v-if="activestep === 2"></third-step>
<div class="step-list">
<el-steps :active="activestep" align-center style="height: 60px; margin-top: 10px">
<el-step title="选择商品品类" />
<el-step title="填写商品详情" />
<el-step title="商品发布成功" />
</el-steps>
</div>
<!-- 第一步 选择分类 -->
<first-step ref='first' v-show="activestep === 0" @change="getFirstData"></first-step>
<!-- 第二步 商品详细信息 -->
<second-step ref='second' :firstData="firstData" v-if="activestep === 1"></second-step>
<!-- 第三步 发布完成 -->
<third-step ref='third' v-if="activestep === 2"></third-step>
</div>
</template>
<script>
import secondStep from "./goodsOperationSec";
import thirdStep from "./goodsOperationThird";
import firstStep from './goodsOperationFirst'
import secondStep from './goodsOperationSec'
import thirdStep from './goodsOperationThird'
export default {
name: "addGoods",
components: {
firstStep,
secondStep,
thirdStep,
thirdStep
},
data() {
return {
/** 当前激活步骤1 填写详情2 发布成功 */
activestep: 1,
firstData: {},
/** 当前激活步骤*/
activestep: 0,
firstData: {}, // 第一步传递的数据
};
},
mounted() {
window.scrollTo(0, 0);
methods: {
// 选择商品分类回调
getFirstData (item) {
this.firstData = item;
this.activestep = 1;
}
},
mounted() {
// 编辑商品、模板、复制商品
if (this.$route.query.id || this.$route.query.draftId || this.$route.query.copyId) {
this.activestep = 1;
} else {
this.activestep = 0
this.$refs.first.selectGoodsType = true;
}
}
};
</script>
<style lang="scss" scoped>