拆分发布商品代码
parent
c403fce786
commit
9b9295ea94
|
@ -90,7 +90,7 @@
|
||||||
<template v-if="detail.goodsParamsDTOList && detail.goodsParamsDTOList.length">
|
<template v-if="detail.goodsParamsDTOList && detail.goodsParamsDTOList.length">
|
||||||
<div class="goods-params" v-for="item in detail.goodsParamsDTOList" :key="item.groupId">
|
<div class="goods-params" v-for="item in detail.goodsParamsDTOList" :key="item.groupId">
|
||||||
<span class="ml_10">{{item.groupName}}</span>
|
<span class="ml_10">{{item.groupName}}</span>
|
||||||
<table class="mb_10" cellpadding='0' border="1" cellspacing="0" >
|
<table class="mb_10" cellpadding='0' cellspacing="0" >
|
||||||
<tr v-for="param in item.goodsParamsItemDTOList" :key="param.paramId">
|
<tr v-for="param in item.goodsParamsItemDTOList" :key="param.paramId">
|
||||||
<td style="text-align:right">{{param.paramName}}</td><td>{{param.paramValue}}</td>
|
<td style="text-align:right">{{param.paramName}}</td><td>{{param.paramValue}}</td>
|
||||||
</tr>
|
</tr>
|
||||||
|
@ -491,12 +491,13 @@ export default {
|
||||||
table{
|
table{
|
||||||
border-color:#efefef;
|
border-color:#efefef;
|
||||||
color: #999;
|
color: #999;
|
||||||
min-width: 30%;
|
width: 40%;
|
||||||
margin-left: 10px;
|
margin-left: 10px;
|
||||||
|
margin-bottom: 10px;
|
||||||
font-size: 12px;
|
font-size: 12px;
|
||||||
tr{
|
tr{
|
||||||
td:nth-child(1){
|
td:nth-child(1){
|
||||||
min-width: 70px;
|
width: 70px;
|
||||||
}
|
}
|
||||||
td:nth-child(2){
|
td:nth-child(2){
|
||||||
padding-left: 10px;
|
padding-left: 10px;
|
||||||
|
|
|
@ -17,15 +17,15 @@ export default {
|
||||||
* @description api请求基础路径
|
* @description api请求基础路径
|
||||||
*/
|
*/
|
||||||
api_dev: {
|
api_dev: {
|
||||||
// common: 'http://192.168.0.100:8890',
|
common: 'http://192.168.0.105:8890',
|
||||||
// buyer: 'http://192.168.0.100:8888',
|
buyer: 'http://192.168.0.105:8888',
|
||||||
// seller: 'http://192.168.0.100:8889',
|
seller: 'http://192.168.0.105:8889',
|
||||||
// manager: 'http://192.168.0.100:8887'
|
manager: 'http://192.168.0.105:8887'
|
||||||
|
|
||||||
common: 'https://common-api.pickmall.cn',
|
// common: 'https://common-api.pickmall.cn',
|
||||||
buyer: 'https://buyer-api.pickmall.cn',
|
// buyer: 'https://buyer-api.pickmall.cn',
|
||||||
seller: 'https://store-api.pickmall.cn',
|
// seller: 'https://store-api.pickmall.cn',
|
||||||
manager: 'https://admin-api.pickmall.cn'
|
// manager: 'https://admin-api.pickmall.cn'
|
||||||
},
|
},
|
||||||
api_prod: {
|
api_prod: {
|
||||||
common: 'https://common-api.pickmall.cn',
|
common: 'https://common-api.pickmall.cn',
|
||||||
|
|
|
@ -5,11 +5,8 @@
|
||||||
<div v-if="list.length">
|
<div v-if="list.length">
|
||||||
<template v-for="(item) in list">
|
<template v-for="(item) in list">
|
||||||
<div class="goodsItem" :key="item.skuId">
|
<div class="goodsItem" :key="item.skuId">
|
||||||
<div class="goodsImg hover-pointer">
|
<div class="goodsImg hover-pointer" v-if="params.type === 'GOODS'">
|
||||||
<img
|
<img :src="item.image" />
|
||||||
:src="params.type === 'GOODS'? item.image : item.logo"
|
|
||||||
alt=""
|
|
||||||
/>
|
|
||||||
</div>
|
</div>
|
||||||
<div class="goodsTitle hover-pointer">
|
<div class="goodsTitle hover-pointer">
|
||||||
{{params.type === 'GOODS'? item.goodsName : item.storeName}}
|
{{params.type === 'GOODS'? item.goodsName : item.storeName}}
|
||||||
|
|
|
@ -0,0 +1,3 @@
|
||||||
|
import Vue from "vue";
|
||||||
|
|
||||||
|
export default new Vue;
|
File diff suppressed because it is too large
Load Diff
|
@ -27,22 +27,22 @@
|
||||||
<!-- 商品分类 -->
|
<!-- 商品分类 -->
|
||||||
<div class="content-goods-publish">
|
<div class="content-goods-publish">
|
||||||
<div class="goods-category">
|
<div class="goods-category">
|
||||||
<ul v-if="categoryListLevel1 && categoryListLevel1.length > 0">
|
<ul v-if="categoryListLevel1.length > 0">
|
||||||
<li v-for="(item, index) in categoryListLevel1" :class="{ activeClass: index == activeCategoryIndex1 }"
|
<li v-for="(item, index) in categoryListLevel1" :class="{ activeClass: category[0].name }"
|
||||||
@click="handleSelectCategory(item, index, 1)" :key="index">
|
@click="handleSelectCategory(item, index, 1)" :key="index">
|
||||||
<span>{{ item.name }}</span>
|
<span>{{ item.name }}</span>
|
||||||
<span>></span>
|
<span>></span>
|
||||||
</li>
|
</li>
|
||||||
</ul>
|
</ul>
|
||||||
<ul v-if="categoryListLevel2 && categoryListLevel2.length > 0">
|
<ul v-if="categoryListLevel2.length > 0">
|
||||||
<li v-for="(item, index) in categoryListLevel2" :class="{ activeClass: index == activeCategoryIndex2 }"
|
<li v-for="(item, index) in categoryListLevel2" :class="{ activeClass: category[1].name }"
|
||||||
@click="handleSelectCategory(item, index, 2)" :key="index">
|
@click="handleSelectCategory(item, index, 2)" :key="index">
|
||||||
<span>{{ item.name }}</span>
|
<span>{{ item.name }}</span>
|
||||||
<span>></span>
|
<span>></span>
|
||||||
</li>
|
</li>
|
||||||
</ul>
|
</ul>
|
||||||
<ul v-if="categoryListLevel3 && categoryListLevel3.length > 0">
|
<ul v-if="categoryListLevel3.length > 0">
|
||||||
<li v-for="(item, index) in categoryListLevel3" :class="{ activeClass: index == activeCategoryIndex3 }"
|
<li v-for="(item, index) in categoryListLevel3" :class="{ activeClass: category[2].name }"
|
||||||
@click="handleSelectCategory(item, index, 3)" :key="index">
|
@click="handleSelectCategory(item, index, 3)" :key="index">
|
||||||
<span>{{ item.name }}</span>
|
<span>{{ item.name }}</span>
|
||||||
</li>
|
</li>
|
||||||
|
@ -50,21 +50,30 @@
|
||||||
</div>
|
</div>
|
||||||
<p class="current-goods-category">
|
<p class="current-goods-category">
|
||||||
您当前选择的商品类别是:
|
您当前选择的商品类别是:
|
||||||
<span>{{ activeCategoryName1 }}</span>
|
<span>{{ category[0].name }}</span>
|
||||||
<span v-show="activeCategoryName2">> {{ activeCategoryName2 }}</span>
|
<span v-show="category[1].name">> {{ category[1].name }}</span>
|
||||||
<span v-show="activeCategoryName3">> {{ activeCategoryName3 }}</span>
|
<span v-show="category[2].name">> {{ category[2].name }}</span>
|
||||||
</p>
|
</p>
|
||||||
<template v-if="!$route.query.id">
|
<template>
|
||||||
<Divider>已选商品模版:{{checkedTemplate()}}</Divider>
|
<Divider>已选商品模版:{{checkedTemplate()}}</Divider>
|
||||||
</template>
|
</template>
|
||||||
</div>
|
</div>
|
||||||
|
<!-- 底部按钮 -->
|
||||||
|
<div class="footer">
|
||||||
|
<ButtonGroup>
|
||||||
|
<Button type="primary" @click="selectGoodsType = true">商品类型</Button>
|
||||||
|
<Button type="primary" @click="next">下一步</Button>
|
||||||
|
</ButtonGroup>
|
||||||
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</template>
|
</template>
|
||||||
<script>
|
<script>
|
||||||
import * as API_GOODS from "@/api/goods";
|
import * as API_GOODS from "@/api/goods";
|
||||||
|
import bus from '@/libs/eventBus'
|
||||||
export default {
|
export default {
|
||||||
data() {
|
data() {
|
||||||
return {
|
return {
|
||||||
|
draftId: '',
|
||||||
selectGoodsType: false, // 展示选择商品分类modal
|
selectGoodsType: false, // 展示选择商品分类modal
|
||||||
goodsTemplates: [], // 商品模板列表
|
goodsTemplates: [], // 商品模板列表
|
||||||
showGoodsTemplates: false, //是否显示选择商品模板
|
showGoodsTemplates: false, //是否显示选择商品模板
|
||||||
|
@ -90,19 +99,12 @@ export default {
|
||||||
check: false,
|
check: false,
|
||||||
},
|
},
|
||||||
],
|
],
|
||||||
/** 当前点击的1级分类索引*/
|
// 商品分类选择数组
|
||||||
activeCategoryIndex1: -1,
|
category: [
|
||||||
|
{name: '', id: ''},
|
||||||
/** 当前点击的2级分类索引*/
|
{name: '', id: ''},
|
||||||
activeCategoryIndex2: -1,
|
{name: '', id: ''}
|
||||||
|
],
|
||||||
/** 当前点击的3级分类索引*/
|
|
||||||
activeCategoryIndex3: -1,
|
|
||||||
/** 当前商品分类名称1*/
|
|
||||||
activeCategoryName1: "",
|
|
||||||
|
|
||||||
/** 当前商品分类名称2*/
|
|
||||||
activeCategoryName2: "",
|
|
||||||
|
|
||||||
/** 当前商品分类名称3*/
|
/** 当前商品分类名称3*/
|
||||||
activeCategoryName3: "",
|
activeCategoryName3: "",
|
||||||
|
@ -120,7 +122,7 @@ export default {
|
||||||
// 获取已选模板
|
// 获取已选模板
|
||||||
checkedTemplate () {
|
checkedTemplate () {
|
||||||
if(this.goodsTemplates.length) {
|
if(this.goodsTemplates.length) {
|
||||||
return this.goodsTemplates.find(item=>{return item.id == this.$parent.draftId}).goodsName
|
return this.goodsTemplates.find(item=>{return item.id == this.draftId}).goodsName
|
||||||
} else {
|
} else {
|
||||||
return ""
|
return ""
|
||||||
}
|
}
|
||||||
|
@ -137,7 +139,6 @@ export default {
|
||||||
this.GET_GoodsTemplate()
|
this.GET_GoodsTemplate()
|
||||||
} else {
|
} else {
|
||||||
// this.baseInfoForm.goodsType = val.type;
|
// this.baseInfoForm.goodsType = val.type;
|
||||||
// this.draftId = "";
|
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
// 获取商品模板
|
// 获取商品模板
|
||||||
|
@ -155,35 +156,30 @@ export default {
|
||||||
},
|
},
|
||||||
// 选择商品模板
|
// 选择商品模板
|
||||||
handleClickGoodsTemplate(val) {
|
handleClickGoodsTemplate(val) {
|
||||||
// this.draftId = val.id;
|
|
||||||
this.selectGoodsType = false;
|
this.selectGoodsType = false;
|
||||||
},
|
},
|
||||||
/** 选择商城商品分类 */
|
/** 选择商城商品分类 */
|
||||||
handleSelectCategory(row, index, level) {
|
handleSelectCategory(row, index, level) {
|
||||||
if (level === 1) {
|
if (level === 1) {
|
||||||
// this.baseInfoForm.categoryPath = row.id;
|
this.category.forEach(cate => {
|
||||||
this.activeCategoryName1 = row.name;
|
cate.name = '',
|
||||||
this.activeCategoryName2 = this.activeCategoryName3 = "";
|
cate.id = ''
|
||||||
this.activeCategoryIndex1 = index;
|
})
|
||||||
this.activeCategoryIndex2 = -1;
|
this.category[0].name = row.name;
|
||||||
this.activeCategoryIndex3 = -1;
|
this.category[0].id = row.id;
|
||||||
this.categoryListLevel2 = this.categoryListLevel1[index].children;
|
this.categoryListLevel2 = this.categoryListLevel1[index].children;
|
||||||
this.categoryListLevel3 = [];
|
this.categoryListLevel3 = [];
|
||||||
} else if (level === 2) {
|
} else if (level === 2) {
|
||||||
// this.baseInfoForm.categoryPath =
|
this.category[1].name = row.name;
|
||||||
// this.baseInfoForm.categoryPath + "," + row.id;
|
this.category[1].id = row.id;
|
||||||
this.activeCategoryName2 = row.name;
|
this.category[2].name = '';
|
||||||
this.activeCategoryName3 = "";
|
this.category[2].id = '';
|
||||||
this.activeCategoryIndex2 = index;
|
|
||||||
this.activeCategoryIndex3 = -1;
|
|
||||||
this.categoryListLevel3 = this.categoryListLevel2[index].children;
|
this.categoryListLevel3 = this.categoryListLevel2[index].children;
|
||||||
} else {
|
} else {
|
||||||
// this.baseInfoForm.categoryPath =
|
this.category[2].name = row.name
|
||||||
// this.baseInfoForm.categoryPath + "," + row.id;
|
this.category[2].id = row.id
|
||||||
this.activeCategoryName3 = row.name;
|
|
||||||
this.activeCategoryIndex3 = index;
|
|
||||||
}
|
}
|
||||||
// 设置当前商城分类ID
|
// 设置当前商品分类ID
|
||||||
// this.baseInfoForm.categoryId = row.id;
|
// this.baseInfoForm.categoryId = row.id;
|
||||||
// this.categoryId = row.id;
|
// this.categoryId = row.id;
|
||||||
// this.baseInfoForm.categoryName = row.name;
|
// this.baseInfoForm.categoryName = row.name;
|
||||||
|
@ -197,9 +193,44 @@ export default {
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
},
|
},
|
||||||
|
// 下一步
|
||||||
|
next() {
|
||||||
|
window.scrollTo(0, 0);
|
||||||
|
if (this.$route.query.draftId) {
|
||||||
|
this.activestep = 1;
|
||||||
|
this.GET_GoodData();
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
/** 1级校验 */
|
||||||
|
this.loading = true;
|
||||||
|
if (!this.baseInfoForm.goodsType) {
|
||||||
|
this.$Message.error('请选择商品类型')
|
||||||
|
this.loading = false;
|
||||||
|
return
|
||||||
|
}
|
||||||
|
if (!this.activeCategoryName1) {
|
||||||
|
this.$Message.error("请选择商品分类");
|
||||||
|
return;
|
||||||
|
} else if (this.activeCategoryIndex3 === -1) {
|
||||||
|
this.$Message.error("必须选择到三级分类");
|
||||||
|
return;
|
||||||
|
} else if (this.activeCategoryName3) {
|
||||||
|
/** 获取该商城分类下 商品参数信息 */
|
||||||
|
this.GET_GoodsParams();
|
||||||
|
/** 查询品牌列表 */
|
||||||
|
this.getGoodsBrandList();
|
||||||
|
/** 查询分类绑定的规格信息 */
|
||||||
|
this.Get_SkuInfoByCategory(this.baseInfoForm.categoryId);
|
||||||
|
// 获取商品单位
|
||||||
|
this.GET_GoodsUnit();
|
||||||
|
// 获取当前店铺分类
|
||||||
|
this.GET_ShopGoodsLabel();
|
||||||
|
}
|
||||||
|
},
|
||||||
},
|
},
|
||||||
mounted () {
|
mounted () {
|
||||||
this.GET_NextLevelCategory()
|
this.GET_NextLevelCategory()
|
||||||
|
this.selectGoodsType = true;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
</script>
|
</script>
|
||||||
|
|
File diff suppressed because it is too large
Load Diff
|
@ -1,17 +1,34 @@
|
||||||
<template>
|
<template>
|
||||||
|
<div class="content-goods-publish">
|
||||||
|
<div class="success" style="text-align: left">
|
||||||
|
<h1>恭喜您,商品发布成功!</h1>
|
||||||
|
<div class="goToGoodsList" @click="gotoGoodsList">
|
||||||
|
<a>去店铺查看商品列表>></a>
|
||||||
|
</div>
|
||||||
|
<div class="operation">
|
||||||
|
<h3>您还可以:</h3>
|
||||||
<div>
|
<div>
|
||||||
|
1、继续
|
||||||
|
<a @click="gotoBack">发布商品</a>
|
||||||
|
</div>
|
||||||
|
<div>
|
||||||
|
2、进入卖家中心,管理
|
||||||
|
<a @click="gotoGoodsList">商品列表</a>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</template>
|
</template>
|
||||||
<script>
|
<script>
|
||||||
export default {
|
export default {
|
||||||
data() {
|
|
||||||
return {
|
|
||||||
|
|
||||||
}
|
|
||||||
},
|
|
||||||
methods: {
|
methods: {
|
||||||
|
// 跳转商品列表
|
||||||
|
gotoGoodsList() {
|
||||||
|
this.$router.push({name: "goods"});
|
||||||
|
},
|
||||||
|
gotoBack() {
|
||||||
|
this.$router.go();
|
||||||
|
},
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
</script>
|
</script>
|
||||||
|
|
Loading…
Reference in New Issue