From e8e13a41542566ac5f3bae8ef110384e4acf7a4b Mon Sep 17 00:00:00 2001 From: donqi Date: Tue, 2 Aug 2022 14:27:28 +0800 Subject: [PATCH] =?UTF-8?q?=E6=96=B0=E5=A2=9E=E6=9C=8D=E5=8A=A1=E7=B1=BB?= =?UTF-8?q?=E7=9B=AE=E9=80=89=E6=8B=A9=E4=BB=8E=E7=AC=AC=E4=BA=8C=E7=BA=A7?= =?UTF-8?q?=E7=B1=BB=E7=9B=AE=E5=BC=80=E5=A7=8B=EF=BC=8C=E9=BB=98=E8=AE=A4?= =?UTF-8?q?=E4=B8=80=E7=BA=A7=E7=B1=BB=E7=9B=AE=E4=B8=BA=E6=9C=8D=E5=8A=A1?= =?UTF-8?q?=E5=95=86=E5=9F=8E?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- pages/my/new-serv.vue | 63 ++++++++++++++++++++++++------------------- 1 file changed, 36 insertions(+), 27 deletions(-) diff --git a/pages/my/new-serv.vue b/pages/my/new-serv.vue index 66113db..f1165cc 100644 --- a/pages/my/new-serv.vue +++ b/pages/my/new-serv.vue @@ -21,7 +21,7 @@ @@ -270,7 +270,7 @@ videoList: [] }, categoryList: [], - categoryMultiIndex: [0, 0, 0], + categoryMultiIndex: [0, 0], regionList: [], regionMultiIndex: [0, 0], isShowAllSpecs: false, @@ -348,19 +348,23 @@ return true; }, 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({ + 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({ + let subSubTypeList = await this.$request.listByStep({ + type: 1, goodsCategoryId: col2Id }); subSubTypeList = subSubTypeList.data; - this.categoryList.push(typeList); + // this.categoryList.push(typeList); this.categoryList.push(subTypeList); this.categoryList.push(subSubTypeList); }, @@ -386,37 +390,42 @@ this.formData.category = chosenCategory; // 查询最后一级品类 - let res = await this.$request.listByStep({ - goodsCategoryId: chosenCategory[2].goodsCategoryId + let res = await this.$request.listByStep({ + type: 1, + goodsCategoryId: chosenCategory[chosenCategory.length - 1].goodsCategoryId }); this.formData.specsList = res.data; }, 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({ + // 通过二级查三级 + let subSubTypeList = 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; - 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({ - goodsCategoryId: this.categoryList[1][colObj.value].goodsCategoryId - }); subSubTypeList = subSubTypeList.data; this.categoryList.pop(); this.categoryList.push(subSubTypeList); - this.categoryMultiIndex = [this.categoryMultiIndex[0], colObj.value, 0]; + this.categoryMultiIndex = [colObj.value, 0]; } }, async regionChange(e) { @@ -638,7 +647,7 @@ goodsName: this.formData.servName, goodsDesc: this.formData.servDesc, goodsUnit: this.formData.goodsUnit, - deptGoodsCategoryId: this.formData.category[2].goodsCategoryId, + deptGoodsCategoryId: this.formData.category[this.formData.category.length - 1].goodsCategoryId, goodsStandardList: goodsStandardList, goodsAreaList: goodsAreaList, goodsImgUrl: this.formData.coverImgList[0],