From 56854b1c857f3467d07332ea2b20084168915295 Mon Sep 17 00:00:00 2001 From: Apcallover <1503963513@qq.com> Date: Mon, 25 Mar 2024 22:07:09 +0800 Subject: [PATCH] =?UTF-8?q?flat:=20=E6=9A=82=E5=AD=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- pageMy/my/resume/addSkill.vue | 38 +++++++++--------------- pageMy/my/resume/index.vue | 2 +- pageMy/my/resume/skill.vue | 1 + pageMy/my/resume/skillLevel.vue | 51 +++++++++++++++++++++++++++------ 4 files changed, 59 insertions(+), 33 deletions(-) diff --git a/pageMy/my/resume/addSkill.vue b/pageMy/my/resume/addSkill.vue index 34533e7..367ed6e 100644 --- a/pageMy/my/resume/addSkill.vue +++ b/pageMy/my/resume/addSkill.vue @@ -6,7 +6,7 @@ 添加职业技能,获得个性化的职位推荐 - + @@ -89,8 +89,9 @@ export default { uni.$on('setSkill', ({ detail }) => { + console.log('detail,', detail) // this.skillsId = id - this.skillsName = detail.parentLabel + "-" + detail.label + this.skillsName = `${detail.parentLabel }-${detail.parentTwoLabel}-${detail.label}` }) }, methods: { @@ -100,33 +101,22 @@ export default { }) }, skill: function () { - if (this.tradeId) { + // if (this.tradeId) { uni.navigateTo({ url: `./skill?id=${this.worktypesId}&tradeId=${this.tradeId}&maxLayer=2&type=1` }) - } else { - uni.showToast({ - title: '请先选择从事的行业', - icon: 'none' - }); - } + // } else { + // uni.showToast({ + // title: '请先选择从事的行业', + // icon: 'none' + // }); + // } }, skillLevel: function () { - if (!this.tradeId) { - uni.showToast({ - title: '请先选择从事的行业', - icon: 'none' - }); - } else if (!this.worktypesName) { - uni.showToast({ - title: '请先选择具备的技能', - icon: 'none' - }); - } else { + uni.navigateTo({ - url: `./skillLevel?id=${this.skillsId}&worktypesId=${this.worktypesId}&maxLayer=2&type=2` + url: `./skillLevel?id=${this.skillsId}&worktypesId=${this.worktypesId}&maxLayer=3&type=2` }) - } }, submit: function () { console.log(this.tradeName, this.worktypesName, this.skillsName); @@ -139,7 +129,7 @@ export default { uni.navigateBack() }) // 岗位 - addSkills(this.tradeName, result1[0], result1[1], 1).then(res => { + addSkills(this.tradeName, `${result1[0]}、${result1[1]}`, result1[2], 1).then(res => { uni.navigateBack() }) } diff --git a/pageMy/my/resume/index.vue b/pageMy/my/resume/index.vue index 9efac50..3f85db2 100644 --- a/pageMy/my/resume/index.vue +++ b/pageMy/my/resume/index.vue @@ -29,7 +29,7 @@ :button="buttonList"> - {{ item.trade }}、{{ item.worktypes }}、{{ item.skills }} + {{ item.worktypes }}、{{ item.skills }} diff --git a/pageMy/my/resume/skill.vue b/pageMy/my/resume/skill.vue index b96971d..105f698 100644 --- a/pageMy/my/resume/skill.vue +++ b/pageMy/my/resume/skill.vue @@ -42,6 +42,7 @@ export default { }, computed: { city() { + console.log(this.parentId, this.workTypeList) if (this.parentId) { const parentItem = this.workTypeList.find(item => item.id == this.parentId); if (parentItem) { diff --git a/pageMy/my/resume/skillLevel.vue b/pageMy/my/resume/skillLevel.vue index 8a24c34..334cb48 100644 --- a/pageMy/my/resume/skillLevel.vue +++ b/pageMy/my/resume/skillLevel.vue @@ -32,17 +32,26 @@ export default { choose: false, chooseIndex: '', parentId: undefined, + parentLabel: null, layer: 1, maxLayer: 2, id: '', label: '', - + parentTwoId: '', + parentTwoLabel: '', tradeId: '', } }, computed: { city() { - if (this.parentId) { + if(!this.workTypeList.length) return; + if(this.parentTwoId) { + const parentItem = this.workTypeList.find(item => item.id == this.parentId); + const parentChild = parentItem.child.find(item => item.id == this.parentTwoId); + if (parentItem) { + return parentChild.child + } + } else if (this.parentId) { const parentItem = this.workTypeList.find(item => item.id == this.parentId); if (parentItem) { return parentItem.child; @@ -55,7 +64,6 @@ export default { mounted() { getWorktypesList(2).then(res => { this.workTypeList = res.data.data; - }) }, @@ -63,9 +71,15 @@ export default { tradeId, parentId, layer, - maxLayer + maxLayer, + parentLabel, + parentTwoId, + parentTwoLabel }) { + this.parentLabel = parentLabel this.parentId = parentId + this.parentTwoId = parentTwoId + this.parentTwoLabel = parentTwoLabel this.tradeId = tradeId || 0 this.layer = parseInt(layer || 1) this.maxLayer = parseInt(maxLayer || 2) @@ -73,18 +87,33 @@ export default { onShow: function () { }, methods: { cityClick(item) { + console.log('items', item, this.layer, this.maxLayer) if (this.layer === this.maxLayer) { this.selectCity(item) } else { - this.goCityInfo(item) + switch (this.layer) { + case 1: + this.goCityInfo(item) + break + case 2: + this.goCityInfoTwo(item) + break + } + } }, selectCity(item) { - console.log(item, "item"); this.id = item.id; this.label = item.name; - }, + goCityInfoTwo(item) { + this.twoId = item.id; + this.twoLabel = item.name; + uni.navigateTo({ + url: `./skillLevel?layer=${this.layer + 1}&maxLayer=${this.maxLayer}&parentId=${this.parentId + }&parentLabel=${this.parentLabel}&parentTwoId=${item.id}&parentTwoLabel=${item.name}` + }) + }, goCityInfo(item) { uni.navigateTo({ url: `./skillLevel?layer=${this.layer + 1}&maxLayer=${this.maxLayer}&parentId=${item.id}&parentLabel=${item.name}` @@ -92,7 +121,13 @@ export default { }, comfirm: function () { if (this.id) { - uni.$emit('setSkill', { detail: { id: this.id, label: this.label, parentLabel: this.$route.query.parentLabel } }) + uni.$emit('setSkill', { detail: { + id: this.id, + label: this.label, + parentLabel: this.$route.query.parentLabel, + parentTwoLabel: this.$route.query.parentTwoLabel + } , + }) uni.navigateBack({ delta: this.layer })