flat: 暂存

This commit is contained in:
Apcallover
2024-03-25 22:07:09 +08:00
parent fb6772bf81
commit 56854b1c85
4 changed files with 59 additions and 33 deletions

View File

@@ -6,7 +6,7 @@
<view class="slo"> <view class="slo">
添加职业技能获得个性化的职位推荐 添加职业技能获得个性化的职位推荐
</view> </view>
<view class="jobcontent" @click="goAddind"> <!-- <view class="jobcontent" @click="goAddind">
<view class="jobinfo"> <view class="jobinfo">
<view class="jobAddress"> <view class="jobAddress">
我所属的行业 我所属的行业
@@ -15,7 +15,7 @@
<view v-else class="jobText nochoose">请选择</view> <view v-else class="jobText nochoose">请选择</view>
</view> </view>
<image src="../../../static/img/right.svg" mode=""></image> <image src="../../../static/img/right.svg" mode=""></image>
</view> </view> -->
<view class="border"></view> <view class="border"></view>
<view class="jobcontent" @click="skill"> <view class="jobcontent" @click="skill">
<view class="jobinfo"> <view class="jobinfo">
@@ -89,8 +89,9 @@ export default {
uni.$on('setSkill', ({ uni.$on('setSkill', ({
detail detail
}) => { }) => {
console.log('detail,', detail)
// this.skillsId = id // this.skillsId = id
this.skillsName = detail.parentLabel + "-" + detail.label this.skillsName = `${detail.parentLabel }-${detail.parentTwoLabel}-${detail.label}`
}) })
}, },
methods: { methods: {
@@ -100,33 +101,22 @@ export default {
}) })
}, },
skill: function () { skill: function () {
if (this.tradeId) { // if (this.tradeId) {
uni.navigateTo({ uni.navigateTo({
url: `./skill?id=${this.worktypesId}&tradeId=${this.tradeId}&maxLayer=2&type=1` url: `./skill?id=${this.worktypesId}&tradeId=${this.tradeId}&maxLayer=2&type=1`
}) })
} else { // } else {
uni.showToast({ // uni.showToast({
title: '请先选择从事的行业', // title: '请先选择从事的行业',
icon: 'none' // icon: 'none'
}); // });
} // }
}, },
skillLevel: function () { skillLevel: function () {
if (!this.tradeId) {
uni.showToast({
title: '请先选择从事的行业',
icon: 'none'
});
} else if (!this.worktypesName) {
uni.showToast({
title: '请先选择具备的技能',
icon: 'none'
});
} else {
uni.navigateTo({ 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 () { submit: function () {
console.log(this.tradeName, this.worktypesName, this.skillsName); console.log(this.tradeName, this.worktypesName, this.skillsName);
@@ -139,7 +129,7 @@ export default {
uni.navigateBack() 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() uni.navigateBack()
}) })
} }

View File

@@ -29,7 +29,7 @@
:button="buttonList"> :button="buttonList">
<view class="list"> <view class="list">
<view class="list_text"> <view class="list_text">
{{ item.trade }}{{ item.worktypes }}{{ item.skills }} {{ item.worktypes }}{{ item.skills }}
</view> </view>
</view> </view>
</m-slide-list> </m-slide-list>

View File

@@ -42,6 +42,7 @@ export default {
}, },
computed: { computed: {
city() { city() {
console.log(this.parentId, this.workTypeList)
if (this.parentId) { if (this.parentId) {
const parentItem = this.workTypeList.find(item => item.id == this.parentId); const parentItem = this.workTypeList.find(item => item.id == this.parentId);
if (parentItem) { if (parentItem) {

View File

@@ -32,17 +32,26 @@ export default {
choose: false, choose: false,
chooseIndex: '', chooseIndex: '',
parentId: undefined, parentId: undefined,
parentLabel: null,
layer: 1, layer: 1,
maxLayer: 2, maxLayer: 2,
id: '', id: '',
label: '', label: '',
parentTwoId: '',
parentTwoLabel: '',
tradeId: '', tradeId: '',
} }
}, },
computed: { computed: {
city() { 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); const parentItem = this.workTypeList.find(item => item.id == this.parentId);
if (parentItem) { if (parentItem) {
return parentItem.child; return parentItem.child;
@@ -55,7 +64,6 @@ export default {
mounted() { mounted() {
getWorktypesList(2).then(res => { getWorktypesList(2).then(res => {
this.workTypeList = res.data.data; this.workTypeList = res.data.data;
}) })
}, },
@@ -63,9 +71,15 @@ export default {
tradeId, tradeId,
parentId, parentId,
layer, layer,
maxLayer maxLayer,
parentLabel,
parentTwoId,
parentTwoLabel
}) { }) {
this.parentLabel = parentLabel
this.parentId = parentId this.parentId = parentId
this.parentTwoId = parentTwoId
this.parentTwoLabel = parentTwoLabel
this.tradeId = tradeId || 0 this.tradeId = tradeId || 0
this.layer = parseInt(layer || 1) this.layer = parseInt(layer || 1)
this.maxLayer = parseInt(maxLayer || 2) this.maxLayer = parseInt(maxLayer || 2)
@@ -73,17 +87,32 @@ export default {
onShow: function () { }, onShow: function () { },
methods: { methods: {
cityClick(item) { cityClick(item) {
console.log('items', item, this.layer, this.maxLayer)
if (this.layer === this.maxLayer) { if (this.layer === this.maxLayer) {
this.selectCity(item) this.selectCity(item)
} else { } else {
switch (this.layer) {
case 1:
this.goCityInfo(item) this.goCityInfo(item)
break
case 2:
this.goCityInfoTwo(item)
break
}
} }
}, },
selectCity(item) { selectCity(item) {
console.log(item, "item");
this.id = item.id; this.id = item.id;
this.label = item.name; 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) { goCityInfo(item) {
uni.navigateTo({ uni.navigateTo({
@@ -92,7 +121,13 @@ export default {
}, },
comfirm: function () { comfirm: function () {
if (this.id) { 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({ uni.navigateBack({
delta: this.layer delta: this.layer
}) })