提交 ee67d0b6 authored 作者: huaxinzhu's avatar huaxinzhu

添加商品 提测

上级 0cf89f67
......@@ -17,6 +17,15 @@ export function GetCategory(query) {
params: query
})
}
// 经营类目
export function NewGetCategory(query) {
return request({
url: '/system/goodsNew/businessList',
method: 'get',
params: query
})
}
// 查询运费模板
// export function GetFreight(query) {
// return request({
......@@ -48,10 +57,19 @@ export function Onsale(data) {
})
}
// 新增goods
// 新增goods - old
// export function addGoods(data) {
// return request({
// url: '/system/goods/add',
// method: 'post',
// data: data
// })
// }
// 新增商品
export function addGoods(data) {
return request({
url: '/system/goods/add',
url: '/system/goodsNew/addGoods',
method: 'post',
data: data
})
......
......@@ -86,7 +86,7 @@
// let query = { page: 1, limit: 50 };
GetFreight().then(res => {
if(res.data) {
this.freightOptions = res.data.list;
this.freightOptions = res.data;
}else {
this.freightOptions = ''
}
......
<template>
<div class="goods-img">
<el-form ref="goodsDeForm" :model="goodsDeForm" label-width="150px" size="small">
<el-form-item label="商品详情:" prop="spxq">
<el-form-item label="商品详情:" prop="description">
<span class="tip-span up-img-tip" style="display: block;line-height: 34px;">上传图片详情,用于商品详情页展示</span>
<el-upload
class="avatar-uploader2"
......@@ -14,7 +14,7 @@
><i class="el-icon-plus" />
</el-upload>
<input class="uploadImg" style="display: none;" type="file" ref="file" accept="image/*" @change="fileChange($event)" name="file" multiple id="file">
<quill-editor class="quill-editor-class" ref="myTextEditor" v-model="description" :options="editorOption" @change="onEditorChange" style="height:500px;margin-bottom:20px;"></quill-editor>
<quill-editor class="quill-editor-class" ref="myTextEditor" v-model="goodsDeForm.description" :options="editorOption" @change="onEditorChange" style="height:500px;margin-bottom:20px;"></quill-editor>
</el-form-item>
</el-form>
</div>
......@@ -43,12 +43,13 @@
return {
loading: false,
goodsDeForm: {
spxq: ''
description: '',
},
// goodsDeRules: {
// spxq:[{required: true, message: '请上传商品详情图片', validator: checkImg}]
// description:[{required: true, message: '请上传商品详情图片', validator: checkImg}]
// },
description: '',
goodsDetailsImgFileList: [],
editorOption: {
placeholder: '',
......@@ -90,10 +91,10 @@
let result = res.split(",");
this.Base64img = result[1];
let data = {"img_data": this.Base64img}
debugger
//debugger
// this.loading = true;
UploadImg(data).then(res => {
debugger
//debugger
if (res && res.code === 1) {
this.index++;
this.goodsDetailsImgFileList.push({'url': res.data.image_url});
......@@ -119,7 +120,7 @@
},
//
onEditorChange({editor, html, text}) {
this.description = html;
this.goodsDeForm.description = html;
},
onEditorBlur(){//失去焦点事件
......
......@@ -143,23 +143,25 @@
categoryList: [], // 商品分类 id集合的数组
goods_des: '', // 关键词
goods_name: '', // 商品标题
// category_id: '',
category_id: '',
producing_area: '', // 产地
deliver_area: '', // 发货地
unit: '', // 单位
goods_brand: '', // 品牌
web_url: '', // 外部链接
out_goods_id: '', // 商品编码
imgs: '' // 商品图片
imgs: [] // 商品图片
},
goodsInfoRules: {
categoryStr: [{required: true, message: '商品分类不能为空', trigger: 'blur'}],
goods_name: [
{required: true, message: '请输入商品名称', trigger: 'blur'},
{min: 3, max: 30, message: '商品标题限制在30字以内', trigger: 'blur'}
{min: 3, max: 30, message: '商品标题限制在3字符以上,30个字符以下', trigger: 'blur'}
],
goods_des: [{required: true, message: '商品关键词不能为空', trigger: 'blur'}],
producing_area:[{required: true, message: '请选择商品产地', trigger: 'change'}],
deliver_area: [{required: true, message: '请选择商品发货地', trigger: 'change'}],
unit: [{required: true, message: '商品单位不能为空', trigger: 'blur'}],
goods_brand: [{required: true, message: '请选择商品品牌', trigger: 'change'}],
imgs: [{required: true, message: '请上传商品图片', validator: categoryIdCheck}]
},
......@@ -184,22 +186,22 @@
},
components: {},
watch: {
'goodsImgFileList': {
handler(val, oldVal) {
if(val.length > 0) {
this.goodsInfoForm.imgs = '';
let imgArr = [];
val.forEach(item => {
imgArr.push(item.url);
})
this.goodsInfoForm.imgs = imgArr.toString();
}else if(val.length === 0){
this.goodsInfoForm.imgs = '';
}
console.log(123,this.goodsInfoForm.imgs);
},
deep: true
}
// 'goodsImgFileList': {
// handler(val, oldVal) {
// if(val.length > 0) {
// this.goodsInfoForm.imgs = '';
// let imgArr = [];
// val.forEach(item => {
// imgArr.push(item.url);
// })
// this.goodsInfoForm.imgs = imgArr.toString();
// }else if(val.length === 0){
// this.goodsInfoForm.imgs = '';
// }
// //console.log(123,this.goodsInfoForm.imgs);
// },
// deep: true
// }
// serviceagsTags: {
// handler(val, oldVal) {
// this.$set(this.goodsInfoForm, 'serviceagsTags', val)
......@@ -211,6 +213,7 @@
//深拷贝一份最开始的数据,为初始化准备
this.goodsInfoDataClone = this.deepClone(this.goodsinfodata);
this.goodsInfoForm.categoryStr = this.goodsinfodata.categoryStr;
this.goodsInfoForm.categoryList = this.goodsinfodata.categoryList;
// console.log("父组件传过来的",this.goodsinfodata)
// console.log("1111",this.goodsInfoForm)
// 获取 省
......@@ -256,6 +259,7 @@
// console.log(222,this.SSQGoodsList);
},
lazyLoad(node, resolve) {
//debugger
this.getSSQArea(node, resolve);
},
getSSQArea(node, resolve) {
......@@ -368,7 +372,7 @@
},
// 上传 商品图片
uploadGoodsImg(param) {
console.log(327,param);
//console.log(327,param);
this.getBase64(param.file).then( res => {
let result = res.split(",");
this.Base64img = result[1];
......@@ -378,6 +382,9 @@
if(res.data) {
urlObj.url = res.data.image_url;
this.goodsImgFileList.push(urlObj);
this.goodsImgFileList.forEach(item=> {
this.goodsInfoForm.imgs.push(item.url)
})
this.$message({type:'success',message:'图片上传成功'});
// 只清除一次,不浪费哦
if(this.goodsImgFileList.length === 1) {
......@@ -409,6 +416,7 @@
for (let i = 0; i < this.goodsImgFileList.length; i++) {
if (file.uid === this.goodsImgFileList[i].uid) {
this.goodsImgFileList.splice(i, 1)
this.goodsImgFileList.imgs.splice(i, 1);
}
}
if(this.goodsImgFileList.length === 0) {
......
......@@ -44,7 +44,7 @@
<el-input size="mini" style="width:90%" v-model="scope.row.weight" placeholder="请输入重量"></el-input>
</template>
</el-table-column>
<el-table-column align="center" prop="imgs" label="图片">
<el-table-column align="center" prop="imgs9" label="图片">
<template slot-scope="scope">
<!-------------->
<el-upload
......@@ -66,11 +66,11 @@
<div v-show="orgGoodsPam.pamTableList.length > 0" v-for="(item,index) in orgGoodsPam.pamTableList" :key="index" class="single-spe-con">
<p style="margin: 10px 0;color: #333;font-size: 14px;font-weight: 400;">
<span v-show="orgGoodsPam.pamNameList.length === 1">
{{ orgGoodsPam.pamNameList[0].specName }} <span></span>{{ orgGoodsPam.pamDataList[index]}}
{{ orgGoodsPam.pamNameList[0].spec_name }} <span></span>{{ orgGoodsPam.pamDataList[index]}}
</span>
<span v-show="orgGoodsPam.pamNameList.length > 1">
<span v-for="(itemv,indexv) in orgGoodsPam.pamNameList" style="margin-right:20px;">
{{ orgGoodsPam.pamNameList[indexv].specName }} <span></span>{{ orgGoodsPam.pamDataList[index][indexv]}}
{{ orgGoodsPam.pamNameList[indexv].spec_name }} <span></span>{{ orgGoodsPam.pamDataList[index][indexv]}}
</span>
</span>
</p>
......@@ -178,7 +178,7 @@ export default {
sc_price: '', // 市场价
stock: '', // 库存
weight: '', // 重量 g
imgs: '', // 图片
imgs9: [], // 图片
}
],
singleSpecImgList: [],
......@@ -188,6 +188,8 @@ export default {
'parameterdata': function(val) {
//debugger
this.orgGoodsPam = val;
// this.orgGoodsPam
//console.log(175,this.orgGoodsPam);
},
},
......@@ -214,9 +216,9 @@ export default {
// this.loading = false;
if (res && res.code == 1) {
this.singleSpecImgList.push({ url: res.data.image_url });
this.singleSpecTable[0].imgs = [];
this.singleSpecTable[0].imgs9 = [];
this.singleSpecImgList.forEach(item=> {
this.singleSpecTable[0].imgs.push(item.url)
this.singleSpecTable[0].imgs9.push(item.url)
})
this.$message({ message:'上传成功',type:'success'});
......@@ -233,7 +235,7 @@ export default {
for(let i = 0; i < this.singleSpecImgList.length; i++) {
if(file.uid === this.singleSpecImgList[i].uid) {
this.singleSpecImgList.splice(i,1);
this.singleSpecTable[0].imgs.splice(i,1);
this.singleSpecTable[0].imgs9.splice(i,1);
}
}
this.$message({ type: 'success', message: '删除成功!' });
......@@ -281,7 +283,7 @@ export default {
});
console.log(3333,file);
//console.log(3333,file);
},
hxz() {
......
......@@ -7,13 +7,13 @@
<div>
<el-select
:ref="'speNameDom' + index "
v-model="speItem.specName"
v-model="speItem.spec_name"
size="small"
style="width: 300px"
filterable
default-first-option
:clearable="true"
@change="speNameChange(speItem.specName,index)"
@change="speNameChange(speItem.spec_name,index)"
@visible-change='bv=> visibleChange(bv,"speNameDom",index)'
>
<el-option
......@@ -31,7 +31,7 @@
<!--<span>数据填写不完整</span>-->
</div>
<div class="spe-params-con">
<div style="display: inline-block" v-for="(itemSV,indexSV) in speItem.specValue" :key="indexSV">
<div style="display: inline-block" v-for="(itemSV,indexSV) in speItem.spec_value" :key="indexSV">
<el-input v-model="itemSV.value" size="small" placeholder="请输入规格参数" class="spe-params-input-item" @blur="paramNameInputBlur(index,indexSV)">
<i v-if="indexSV !== 0" slot="suffix" class="el-input__icon el-icon-delete el-icon-delete-h" @click="deleteSpeParam(index,indexSV)"></i>
</el-input>
......@@ -88,9 +88,8 @@ export default {
return {
speData: [], // 商品规格总数据
specsGroup: {
specName: '', // 规格名称
score: '',
specValue: []
spec_name: '', // 规格名称
spec_value: []
},
speParamName:{
......@@ -111,10 +110,10 @@ export default {
};
},
created() {
this.$set(this.specsGroup.specValue,this.specsGroup.specValue.length,this.speParamName);
this.$set(this.specsGroup.spec_value,this.specsGroup.spec_value.length,this.speParamName);
this.speData = [];
this.$set(this.speData,this.speData.length,this.specsGroup);
//console.log(71,this.specsGroup.specValue);
//console.log(71,this.specsGroup.spec_value);
},
mounted() {
/** 先获取 本地存储的localStorage **/
......@@ -131,9 +130,8 @@ export default {
/** 添加规格*/
addSpe() {
let specsGroup = {
specName: '', // 规格名称
score: '',
specValue: [{value: ''}]
spec_name: '', // 规格名称
spec_value: [{value: ''}]
};
this.$set(this.speData,this.speData.length,specsGroup);
},
......@@ -158,8 +156,8 @@ export default {
coypSpeData = this.speData.concat();
coypSpeData.splice(index,1);
for(let i = 0; i < coypSpeData.length; i++) {
if( val === coypSpeData[i].specName ) {
this.speData[index].specName = '';
if( val === coypSpeData[i].spec_name ) {
this.speData[index].spec_name = '';
this.$message({type: 'error',message: '此规格名称已经使用,请重新选取或新增其他规格名称'});
break;
}
......@@ -173,16 +171,16 @@ export default {
// 添加规格参数
addSpeParam(index) {
let valueObj = { value: ''}
this.$set(this.speData[index].specValue,this.speData[index].specValue.length,valueObj);
this.$set(this.speData[index].spec_value,this.speData[index].spec_value.length,valueObj);
},
/** 删除 规格参数 */
deleteSpeParam(index,indexSV) {
// 先判断,删除前是否有值,如果是空,则没有必要再次计算
if( this.speData[index].specValue[indexSV].value ) {
this.speData[index].specValue.splice(indexSV,1);
if( this.speData[index].spec_value[indexSV].value ) {
this.speData[index].spec_value.splice(indexSV,1);
this.specCalcResult();
}else {
this.speData[index].specValue.splice(indexSV,1);
this.speData[index].spec_value.splice(indexSV,1);
}
},
/**
......@@ -281,7 +279,7 @@ export default {
/** 规格参数 失焦时,进行笛卡尔积算法,并渲染 商品售价 */
paramNameInputBlur(index,indexSV) {
// // 如果失焦的input中有值,才再次计算
// if( this.speData[index].specValue[indexSV].value ) {
// if( this.speData[index].spec_value[indexSV].value ) {
this.specCalcResult();
// }
},
......@@ -295,13 +293,13 @@ export default {
// 需要将 所有规格名称,提出一个数组集合,
this.speNameList = [];
orgSpeData.forEach((item,index)=> {
if( item.specName ) {
let obj = { specName: '' };
// 注意, item.specValue是否一定为一个长度大于 1 的数组
if( item.specValue.length > 0) {
for(let i = 0; i < item.specValue.length; i++) {
if( item.specValue[i].value ) {
obj.specName = item.specName;
if( item.spec_name ) {
let obj = { spec_name: '' };
// 注意, item.spec_value是否一定为一个长度大于 1 的数组
if( item.spec_value.length > 0) {
for(let i = 0; i < item.spec_value.length; i++) {
if( item.spec_value[i].value ) {
obj.spec_name = item.spec_name;
this.speNameList.push(obj);
break;
}
......@@ -331,7 +329,7 @@ export default {
goodsPam.pamDataList = goodsParametersList;
goodsParametersList.forEach((item)=> {
let prePamTable = [
{ js_price:'', sl_price:'', price:'', sc_price:'', stock:'', weight:'', thumb:'' }
{ js_price:'', sl_price:'', price:'', sc_price:'', stock:'', weight:'', thumb:'',spec_values: [] }
];
goodsPam.pamTableList.push(prePamTable)
});
......@@ -346,10 +344,10 @@ export default {
for (let i = 0; i < list.length; i++) {
let childList = [];
if(list[i].specName) {
for(let j = 0; j < list[i].specValue.length; j++) {
if(list[i].specValue[j].value) {
childList.push(list[i].specValue[j].value);
if(list[i].spec_name) {
for(let j = 0; j < list[i].spec_value.length; j++) {
if(list[i].spec_value[j].value) {
childList.push(list[i].spec_value[j].value);
}
}
}
......
......@@ -58,7 +58,7 @@
<p class="card-header-title floor-item-box-title"><span class="blue-block-goods blue-block-goods-title"></span>售后及服务</p>
<Goodsaftersale ref="goodsaftersale" :goodsaftersale="goodsaftersale" />
<div class="submit-type-con">
<el-radio-group v-model="submit" size="small">
<el-radio-group v-model="goodsAllData.submit" size="small">
<el-radio :label="0" border>放入仓库</el-radio>
<el-radio :label="1" border>立即上架</el-radio>
</el-radio-group>
......@@ -77,6 +77,7 @@
<script>
import { getAreaList } from '@/api/module/retreat/address';
import { NewGetCategory,addGoods } from '@/api/module/goods';
import Goodsinfomation from './components/goodsinfomation';
import GoodsSpecifications from './components/goodsspecifications';
import GoodsParameter from './components/goodsparameter';
......@@ -102,7 +103,7 @@
lazy: true,
lazyLoad: this.lazyLoad,
value: "id",
label: 'name',
label: 'label',
leaf: 'leaf'
},
isNextStep: true,
......@@ -132,8 +133,9 @@
goodsaftersale: {
},
submit: 0,
goodsAllData: {
submit: 0,
}, // 商品所有数据
TIMER: null,
} // return end
},
......@@ -148,8 +150,18 @@
methods: {
// 规格子组件,传给父组件的数据
calcSpeTable(data) {
if(data.pamTableList.length > 0) {
// debugger
data.pamTableList.forEach((item, index) => {
if( Array.isArray(data.pamDataList[index]) ) {
item[0].spec_values = data.pamDataList[index];
}else {
item[0].spec_values.push(data.pamDataList[index]);
}
})
}
this.parameterdata = data;
console.log(153,this.parameterdata);
//console.log(153,this.parameterdata);
},
// 只有点击完最后一级,才会有值
SSQChange() {
......@@ -163,6 +175,7 @@
lazyLoad(node, resolve) {
this.SSQList = [];
this.SSQStr = '';
//debugger
this.getArea(node, resolve);
if(this.SSQList && this.SSQList.length > 0) {
this.isNextStep = false
......@@ -174,34 +187,43 @@
const level = node.level;
let limboNode = {};
if(level === 0) {
limboNode = {pid: 0}
limboNode = {id: 0}
}
if(level === 1) {
limboNode = { pid: node.value };
limboNode = { id: node.value };
}
if(level === 2) {
limboNode = { pid: node.value };
limboNode = { id: node.value };
}
this.loading = true;
getAreaList(limboNode).then(res => {
NewGetCategory(limboNode).then(res => {
let result = {};
// debugger
//debugger
if (level === 0) {
result = res.data
result.forEach(item => {
item.value = item.id;
item.label = item.name;
item.children=[];
item.label = item.label;
item.children = [];
item.leaf = 0; // 可以控制 是否有下级 值为true都不行,必须等于0
})
}
if (level === 1) {
result = res.data
//result = res.data
// res.data.forEach((item,index)=> {
// result = (item.id === limboNode.id) ? item.children : [];
// });
for(let i = 0; i < res.data.length; i++) {
if( limboNode.id === res.data[i].id ) {
result = res.data[i].children;
break;
}
}
result.forEach(item => {
item.value = item.id;
item.label = item.name
item.label = item.label
item.children=[];
//这句代码表示当点击最后一级的时候 label后面不会转圈圈 并把相关值赋值到选择器上
item.leaf = 0
......@@ -209,10 +231,21 @@
}
if (level === 2) {
result = res.data
for(let i = 0; i < res.data.length; i++) {
if( res.data[i].children.length > 0) {
for(let j = 0; j < res.data[i].children.length; j++) {
if( limboNode.id === res.data[i].children[j].id ) {
result = res.data[i].children[j].children;
break;
}
}
}
}
result.forEach(item => {
item.value = item.id;
item.label = item.name
item.label = item.label
item.leaf = 1;
})
}
......@@ -224,6 +257,7 @@
},
// 添加商品后,下一步 操作
nextStep() {
// debugger
// 注意数据格式 [1,2,3] 数组,且里面是数字类型
let ssqLabelList = this.$refs['ssqCascader'].getCheckedNodes()[0].pathLabels;
this.goodsinfodata.categoryList = this.SSQList;
......@@ -247,7 +281,7 @@
// 商品售价,通过获取的数据,分别进行判断
let isGoodsPrice = true;
let spsjData = this.$refs.goodsparameter.singleSpecTable;
let spsjData1 = this.$refs.goodsparameter.singleSpecTable;
let spsjData2 = this.$refs.goodsparameter.orgGoodsPam;
//debugger
......@@ -255,34 +289,29 @@
if ( spsjData2.pamTableList && spsjData2.pamTableList.length > 0 ) {
//console.log(25522,spsjData2);
for(let i = 0; i < spsjData2.pamTableList.length; i++) {
console.log("外");
// for(let itemKey in spsjData2.pamTableList[i]) {
// console.log('内', spsjData2.pamTableList[i][itemKey])
// }
let obj = {};
obj = spsjData2.pamTableList[i];
for(let itemKey in obj) {
console.log('内', itemKey)
//console.log("外",spsjData2.pamTableList[i]);
let itemObj = spsjData2.pamTableList[i][0];
for (let itemKey in itemObj) {
// 长度判断,可以校验规格是否上传了图片
// if ( !itemObj[itemKey] || itemObj[itemKey].length === 0) {
if ( !itemObj[itemKey] && itemKey !== 'thumb') {
isGoodsPrice = false;
break
} else {
isGoodsPrice = true;
}
}
if (!isGoodsPrice) {
break
}
// for(let itemKey in spsjData2.pamTableList[i]) {
// if ( !spsjData2.pamTableList[i][itemKey] || spsjData2.pamTableList[i][itemKey].length === 0 ) {
// isGoodsPrice = false;
// break
// }else {
// isGoodsPrice = true;
// }
// }
// if( !isGoodsPrice ) {
// break
// }
}
}else {
// 无规格组合数据
let slingleSpeObj = spsjData[0];
let slingleSpeObj = spsjData1[0];
for (let key in slingleSpeObj) {
if ( !slingleSpeObj[key] || (slingleSpeObj[key].length === 0) ) {
// 长度判断,可以校验规格是否上传了图片
// if ( !slingleSpeObj[key] || (slingleSpeObj[key].length === 0) ) {
if ( !slingleSpeObj[key] && ( key !== 'imgs') ) {
isGoodsPrice = false;
break
} else {
......@@ -292,22 +321,19 @@
}
// 商品详情 是否填写完整
let isGoodsDetailsImgMsg = this.$refs.goodsdetailsimg.description ? true : false;
let isGoodsDetailsImgMsg = this.$refs.goodsdetailsimg.goodsDeForm.description ? true : false;
// 售后服务 是否填写完整
let isGoodsAfterSaleMsg = this.$refs['goodsaftersale'].validateGoodsAfterSaleForm();
// 商品售价,由商品规格决定,
// 如果 没有填写商品规格,那么商品售价应该获取
// console.log(258,spsjData2,spsjData);
// return;
// if(!isGoodsInfoMsg) {
// this.$message({type:'error',message:'商品信息未填写完整'});
// this.setFloorNavMountClick(0);
// return
// }
if(!isGoodsInfoMsg) {
this.$message({type:'error',message:'商品信息未填写完整'});
this.setFloorNavMountClick(0);
return
}
if(!isGoodsPrice) {
this.$message({type:'error',message:'商品售价未填写完整'});
......@@ -315,29 +341,64 @@
return
}
// if(!isGoodsDetailsImgMsg) {
// this.$message({type:'error',message:'请先上传描述商品详情的图片'});
// this.setFloorNavMountClick(3);
// return
// }
// if(!isGoodsAfterSaleMsg) {
// this.$message({type:'error',message:'售后及服务未填写完整'});
// this.setFloorNavMountClick(4);
// return
// }
if(!isGoodsDetailsImgMsg) {
this.$message({type:'error',message:'请先上传描述商品详情的图片'});
this.setFloorNavMountClick(3);
return
}
if(!isGoodsAfterSaleMsg) {
this.$message({type:'error',message:'售后及服务未填写完整'});
this.setFloorNavMountClick(4);
return
}
// 所有校验通过,整理数据
// 获取 商品信息数据
// goodsInfo goodsInfoForm
let spxxData = this.$refs.goodsInfo.goodsInfoForm;
// 商品规格
let spggData = this.$refs.goodsspecifications.speData;
// this.goodsAllData.specs = spggData;
// 商品售价,上面已经获取,
let spsjData = {}; // specs_group
if( spsjData2.pamTableList && spsjData2.pamTableList.length > 0 ) {
this.goodsAllData['specs_group'] = [];
this.goodsAllData['specs'] = spggData;
spsjData2.pamTableList.forEach((item,index)=> {
this.goodsAllData['specs_group'].push(item[0]);
});
}else {
spsjData = spsjData1[0];
}
// 商品详情 数据
let spxqData = this.$refs.goodsdetailsimg.goodsDeForm;
// 售后服务 数据
let ssffData = this.$refs.goodsaftersale.goodsAfterSaleForm;
// 商品详情 数据
let spxqData = this.$refs.goodsdetailsimg.description;
console.log("商品信息:",spxxData);
console.log("商品规格:",spggData);
console.log("商品售价:",spsjData);
console.log("商品详情:",spxqData);
console.log("商品售后:",ssffData);
Object.assign( this.goodsAllData, spxxData, spsjData, spxqData, ssffData);
// spxxData.categoryList = []
// 经营类目,服务标签,需要单独处理数据格式
this.goodsAllData.category_id = spxxData.categoryList.slice(-1)[0] ? spxxData.categoryList.slice(-1)[0] : '';
if(this.goodsAllData.stags) {
this.goodsAllData.stags = this.goodsAllData.stags.toString();
}
console.log('最终数据:',this.goodsAllData);
addGoods( this.goodsAllData ).then( res=> {
console.log("返回结果",res);
});
console.log("商品规格数据:",spxqData);
},
/*-----------------------*/
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论