类目全部修改为从第二级开始展示(第一级默认为服务商城)

This commit is contained in:
donqi 2022-08-04 22:08:49 +08:00
parent e33e775380
commit bfe0490330
5 changed files with 114 additions and 49 deletions

View File

@ -362,21 +362,31 @@
this[this.taskConditions[index].action]();
},
async loadCategoryList(idArr) {
let typeList = await this.$request.listByStep();
let typeList = await this.$request.listByStep({
type: 1
});
typeList = typeList.data;
let col1Id = idArr ? idArr[0] : typeList[0].goodsCategoryId;
let subTypeList = await this.$request.listByStep({
type: 1,
goodsCategoryId: col1Id
});
subTypeList = subTypeList.data;
let col2Id = idArr ? idArr[1] : subTypeList[0].goodsCategoryId;
let subSubTypeList = await this.$request.listByStep({
type: 1,
goodsCategoryId: col2Id
});
subSubTypeList = subSubTypeList.data;
this.categoryList.push(typeList);
let col3Id = idArr ? idArr[2] : subSubTypeList[0].goodsCategoryId;
let thirdTypeList = await this.$request.listByStep({
type: 1,
goodsCategoryId: col3Id
});
thirdTypeList = thirdTypeList.data;
this.categoryList.push(subTypeList);
this.categoryList.push(subSubTypeList);
this.categoryList.push(thirdTypeList);
},
async loadRegionList() {
let regionList = await this.$request.areaListByStep();
@ -462,13 +472,18 @@
if (colObj.column == 0) {
//
let subTypeList = await this.$request.listByStep({
type: 1,
goodsCategoryId: this.categoryList[0][colObj.value].goodsCategoryId
});
subTypeList = subTypeList.data;
let subSubTypeList = await this.$request.listByStep({
goodsCategoryId: subTypeList[0].goodsCategoryId
});
subSubTypeList = subSubTypeList.data;
let subSubTypeList = [];
if (subTypeList && subTypeList.length) {
subSubTypeList = await this.$request.listByStep({
type: 1,
goodsCategoryId: subTypeList[0].goodsCategoryId
});
subSubTypeList = subSubTypeList.data;
}
this.categoryList.pop();
this.categoryList.pop();
this.categoryList.push(subTypeList);
@ -477,6 +492,7 @@
} else if (colObj.column == 1) {
//
let subSubTypeList = await this.$request.listByStep({
type: 1,
goodsCategoryId: this.categoryList[1][colObj.value].goodsCategoryId
});
subSubTypeList = subSubTypeList.data;

View File

@ -509,8 +509,15 @@
// this.servSpecialSkills = res.data;
// },
async loadSpecialSkillType() {
let res = await this.$request.listByStep();
this.specialTypeList = res.data;
let res = await this.$request.listByStep({
type: 1
});
res = res.data;
let typeList = await this.$request.listByStep({
type: 1,
goodsCategoryId: res[0].goodsCategoryId
});
this.specialTypeList = typeList.data;
},
async chooseSpecialSkill(e, type, index) {
let funName = "listByStep";
@ -518,7 +525,8 @@
funName = "qrySpecialSkillList";
}
let res = await this.$request[funName]({
goodsCategoryId: e.goodsCategoryId
goodsCategoryId: e.goodsCategoryId,
type: 1
});
if (res.code == 0) {
switch (type) {

View File

@ -318,12 +318,20 @@
/* 服务区域 end */
/* 服务技能 start */
async loadTypeList() {
let res = await this.$request.listByStep();
this.typeList = res.data;
let res = await this.$request.listByStep({
type: 1
});
res = res.data;
let typeList = await this.$request.listByStep({
type: 1,
goodsCategoryId: res[0].goodsCategoryId
});
this.typeList = typeList.data;
},
async chooseType(e, type, index) {
let res = await this.$request.listByStep({
goodsCategoryId: e.goodsCategoryId
goodsCategoryId: e.goodsCategoryId,
type: 1
});
if (res.code == 0) {
switch (type) {
@ -364,8 +372,15 @@
/* 服务技能 end */
/* 特殊技能 start */
async loadSpecialSkill() {
let res = await this.$request.listByStep();
this.specialTypeList = res.data;
let res = await this.$request.listByStep({
type: 1
});
res = res.data;
let typeList = await this.$request.listByStep({
type: 1,
goodsCategoryId: res[0].goodsCategoryId
});
this.specialTypeList = typeList.data;
},
async chooseSpecialSkill(e, type, index) {
let funName = "listByStep";
@ -373,7 +388,8 @@
funName = "qrySpecialSkillList";
}
let res = await this.$request[funName]({
goodsCategoryId: e.goodsCategoryId
goodsCategoryId: e.goodsCategoryId,
type: 1
});
if (res.code == 0) {
switch (type) {

View File

@ -21,7 +21,7 @@
<picker :mode="'multiSelector'" @change="categoryChange" @columnchange="categoryColChange"
:value="categoryMultiIndex" :range-key="'goodsCategoryName'" :range="categoryList">
<input disabled class="line-input radius-input"
:value="formData.category && formData.category.length ? formData.category[0].goodsCategoryName + '-' + formData.category[1].goodsCategoryName : ''"
:value="formData.category && formData.category.length ? formData.category[0].goodsCategoryName + '-' + formData.category[1].goodsCategoryName + '-' + formData.category[2].goodsCategoryName : ''"
placeholder="请选择类目"></input>
</picker>
</view>
@ -278,7 +278,7 @@
cropHeight: 0,
curImgListField: '',
categoryList: [],
categoryMultiIndex: [0, 0],
categoryMultiIndex: [0, 0, 0],
regionList: [],
regionMultiIndex: [0, 0],
isShowAllSpecs: false,
@ -373,9 +373,16 @@
goodsCategoryId: col2Id
});
subSubTypeList = subSubTypeList.data;
let col3Id = idArr ? idArr[2] : subSubTypeList[0].goodsCategoryId;
let thirdTypeList = await this.$request.listByStep({
type: 1,
goodsCategoryId: col3Id
});
thirdTypeList = thirdTypeList.data;
// this.categoryList.push(typeList);
this.categoryList.push(subTypeList);
this.categoryList.push(subSubTypeList);
this.categoryList.push(thirdTypeList);
},
async loadRegionList() {
let regionList = await this.$request.areaListByStep();
@ -407,34 +414,36 @@
},
async categoryColChange(e) {
let colObj = e.detail;
// if (colObj.column == 0) {
// //
// let subTypeList = await this.$request.listByStep({
// type: 1,
// goodsCategoryId: this.categoryList[0][colObj.value].goodsCategoryId
// });
// subTypeList = subTypeList.data;
// let subSubTypeList = await this.$request.listByStep({
// type: 1,
// goodsCategoryId: subTypeList[0].goodsCategoryId
// });
// subSubTypeList = subSubTypeList.data;
// this.categoryList.pop();
// this.categoryList.pop();
// this.categoryList.push(subTypeList);
// this.categoryList.push(subSubTypeList);
// this.categoryMultiIndex = [colObj.value, 0, 0];
// } else
if (colObj.column == 0) {
//
let subTypeList = await this.$request.listByStep({
type: 1,
goodsCategoryId: this.categoryList[0][colObj.value].goodsCategoryId
});
subTypeList = subTypeList.data;
let subSubTypeList = [];
if (subTypeList && subTypeList.length) {
subSubTypeList = await this.$request.listByStep({
type: 1,
goodsCategoryId: subTypeList[0].goodsCategoryId
});
subSubTypeList = subSubTypeList.data;
}
this.categoryList.pop();
this.categoryList.pop();
this.categoryList.push(subTypeList);
this.categoryList.push(subSubTypeList);
this.categoryMultiIndex = [colObj.value, 0, 0];
} else if (colObj.column == 1) {
//
let subSubTypeList = await this.$request.listByStep({
type: 1,
goodsCategoryId: this.categoryList[0][colObj.value].goodsCategoryId
goodsCategoryId: this.categoryList[1][colObj.value].goodsCategoryId
});
subSubTypeList = subSubTypeList.data;
this.categoryList.pop();
this.categoryList.push(subSubTypeList);
this.categoryMultiIndex = [colObj.value, 0];
this.categoryMultiIndex = [this.categoryMultiIndex[0], colObj.value, 0];
}
},
async regionChange(e) {
@ -641,10 +650,10 @@
return;
}
let checkRes = await this.checkBankAndCertify();
if (!checkRes) {
return;
}
// let checkRes = await this.checkBankAndCertify();
// if (!checkRes) {
// return;
// }
// 01
let goodsImgsList = [];

View File

@ -427,21 +427,31 @@
}
},
async loadCategoryList(idArr) {
let typeList = await this.$request.listByStep();
let typeList = await this.$request.listByStep({
type: 1
});
typeList = typeList.data;
let col1Id = idArr ? idArr[0] : typeList[0].goodsCategoryId;
let subTypeList = await this.$request.listByStep({
type: 1,
goodsCategoryId: col1Id
});
subTypeList = subTypeList.data;
let col2Id = idArr ? idArr[1] : subTypeList[0].goodsCategoryId;
let subSubTypeList = await this.$request.listByStep({
type: 1,
goodsCategoryId: col2Id
});
subSubTypeList = subSubTypeList.data;
this.categoryList.push(typeList);
let col3Id = idArr ? idArr[2] : subSubTypeList[0].goodsCategoryId;
let thirdTypeList = await this.$request.listByStep({
type: 1,
goodsCategoryId: col3Id
});
thirdTypeList = thirdTypeList.data;
this.categoryList.push(subTypeList);
this.categoryList.push(subSubTypeList);
this.categoryList.push(thirdTypeList);
},
async loadRegionList() {
let regionList = await this.$request.areaListByStep();
@ -518,13 +528,18 @@
if (colObj.column == 0) {
//
let subTypeList = await this.$request.listByStep({
type: 1,
goodsCategoryId: this.categoryList[0][colObj.value].goodsCategoryId
});
subTypeList = subTypeList.data;
let subSubTypeList = await this.$request.listByStep({
goodsCategoryId: subTypeList[0].goodsCategoryId
});
subSubTypeList = subSubTypeList.data;
let subSubTypeList = [];
if (subTypeList && subTypeList.length) {
subSubTypeList = await this.$request.listByStep({
type: 1,
goodsCategoryId: subTypeList[0].goodsCategoryId
});
subSubTypeList = subSubTypeList.data;
}
this.categoryList.pop();
this.categoryList.pop();
this.categoryList.push(subTypeList);
@ -533,6 +548,7 @@
} else if (colObj.column == 1) {
//
let subSubTypeList = await this.$request.listByStep({
type: 1,
goodsCategoryId: this.categoryList[1][colObj.value].goodsCategoryId
});
subSubTypeList = subSubTypeList.data;