flat: 暂存
This commit is contained in:
@@ -6,7 +6,7 @@
|
||||
<view class="slo">
|
||||
添加职业技能,获得个性化的职位推荐
|
||||
</view>
|
||||
<view class="jobcontent" @click="goAddind">
|
||||
<!-- <view class="jobcontent" @click="goAddind">
|
||||
<view class="jobinfo">
|
||||
<view class="jobAddress">
|
||||
我所属的行业
|
||||
@@ -15,7 +15,7 @@
|
||||
<view v-else class="jobText nochoose">请选择</view>
|
||||
</view>
|
||||
<image src="../../../static/img/right.svg" mode=""></image>
|
||||
</view>
|
||||
</view> -->
|
||||
<view class="border"></view>
|
||||
<view class="jobcontent" @click="skill">
|
||||
<view class="jobinfo">
|
||||
@@ -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()
|
||||
})
|
||||
}
|
||||
|
||||
@@ -29,7 +29,7 @@
|
||||
:button="buttonList">
|
||||
<view class="list">
|
||||
<view class="list_text">
|
||||
{{ item.trade }}、{{ item.worktypes }}、{{ item.skills }}
|
||||
{{ item.worktypes }}、{{ item.skills }}
|
||||
</view>
|
||||
</view>
|
||||
</m-slide-list>
|
||||
|
||||
@@ -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) {
|
||||
|
||||
@@ -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,17 +87,32 @@ export default {
|
||||
onShow: function () { },
|
||||
methods: {
|
||||
cityClick(item) {
|
||||
console.log('items', item, this.layer, this.maxLayer)
|
||||
if (this.layer === this.maxLayer) {
|
||||
this.selectCity(item)
|
||||
} else {
|
||||
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({
|
||||
@@ -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
|
||||
})
|
||||
|
||||
Reference in New Issue
Block a user