提交 646d087a authored 作者: 郑伟娜's avatar 郑伟娜

修改添加商品报错

上级 9e3195b5
......@@ -88,12 +88,12 @@
export default {
name: 'Index',
props: {
option: {
type: Number,
required: true
}
},
// props: {
// option: {
// type: Number,
// required: true
// }
// },
components: {
Goodsinfomation,
GoodsSpecifications,
......@@ -156,12 +156,14 @@
}, // 商品所有数据
TIMER: null,
hehe: 0,
option: 0
} // return end
},
created() {
// option 商品的id
//debugger
this.option = Number(this.$route.query.goods_id)
if( this.option && this.option !== 0 ) {
let data = { goodsId: this.option};
getGoodsNew(data).then(res => {
......@@ -342,8 +344,8 @@
NewGetCategoryData(limboNode).then(res => {
let result = {};
result = res.data
if (level === 0) {
result = res.data
result.forEach(item => {
item.value = item.id;
item.label = item.label;
......@@ -370,13 +372,9 @@
if (level === 2) {
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;
}
}
if( limboNode.id === res.data[i].id ) {
result = res.data[i].children;
break;
}
}
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论