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

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

View File

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

View File

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

View File

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

View File

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