flat: 修改提示

This commit is contained in:
Apcallover
2024-04-23 21:08:23 +08:00
parent b15fbe0f85
commit 57ecc9fad1
3 changed files with 409 additions and 403 deletions

View File

@@ -1,183 +1,189 @@
<template> <template>
<view> <view>
<view class="title"> <view class="title">
全部 全部
</view> </view>
<block v-for="(item, index) in city" :key="index"> <block v-for="(item, index) in city" :key="index">
<view class="cityList" @click="cityClick(item)"> <view class="cityList" @click="cityClick(item)">
{{ item.name }} {{ item.name }}
<image src="../../../static/img/correct.svg" v-if="id === item.id" mode=""></image> <image src="../../../static/img/correct.svg" v-if="id === item.id" mode=""></image>
<image v-else-if="layer !== maxLayer" src="../../../static/img/right.svg" mode=""></image> <image v-else-if="layer !== maxLayer" src="../../../static/img/right.svg" mode=""></image>
</view> </view>
</block> </block>
<view class="" v-if="layer === maxLayer" style="height: 230rpx;background-color: #f6f6f6;"></view> <view class="" v-if="layer === maxLayer" style="height: 230rpx;background-color: #f6f6f6;"></view>
<view class="btn" v-if="layer === maxLayer" @click="comfirm"> <view class="btn" v-if="layer === maxLayer" @click="comfirm">
<view class="bottombtn"> <view class="bottombtn">
确定 确定
</view> </view>
</view> </view>
</view> </view>
</template> </template>
<script> <script>
import { import {
getWorktypesList getWorktypesList
} from '@/api/resume.js' } from '@/api/resume.js'
export default { export default {
data() { data() {
return { return {
workTypeList: [], workTypeList: [],
choose: false, choose: false,
chooseIndex: '', chooseIndex: '',
parentId: undefined, parentId: undefined,
layer: 1, layer: 1,
maxLayer: 2, maxLayer: 2,
id: '', id: '',
label: '', label: '',
tradeId: '', tradeId: '',
} }
}, },
computed: { computed: {
city() { city() {
console.log(this.parentId, this.workTypeList) 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) {
return parentItem.child; return parentItem.child;
} }
} else { } else {
return this.workTypeList; return this.workTypeList;
} }
} }
}, },
mounted() { mounted() {
getWorktypesList(1).then(res => { getWorktypesList(1).then(res => {
this.workTypeList = res.data.data; this.workTypeList = res.data.data;
}) })
}, },
onLoad({ onLoad({
tradeId, tradeId,
parentId, parentId,
layer, layer,
maxLayer maxLayer
}) { }) {
this.parentId = parentId this.parentId = parentId
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)
}, },
onShow: function () { }, onShow: function() {},
methods: { methods: {
cityClick(item) { cityClick(item) {
if (this.layer === this.maxLayer) { if (this.layer === this.maxLayer) {
this.selectCity(item) this.selectCity(item)
} else { } else {
this.goCityInfo(item) this.goCityInfo(item)
} }
}, },
selectCity(item) { selectCity(item) {
console.log(item, "item"); console.log(item, "item");
this.id = item.id; this.id = item.id;
this.label = item.name; this.label = item.name;
}, },
goCityInfo(item) { goCityInfo(item) {
uni.navigateTo({ uni.navigateTo({
url: `./skill?layer=${this.layer + 1}&maxLayer=${this.maxLayer}&parentId=${item.id}&parentLabel=${item.name}` url: `./skill?layer=${this.layer + 1}&maxLayer=${this.maxLayer}&parentId=${item.id}&parentLabel=${item.name}`
}) })
}, },
comfirm: function () { comfirm: function() {
if (this.id) { if (this.id) {
uni.$emit('setworkTypes', { detail: { id: this.id, label: this.label, parentLabel: this.$route.query.parentLabel } }) uni.$emit('setworkTypes', {
uni.navigateBack({ detail: {
delta: this.layer id: this.id,
}) label: this.label,
} else { parentLabel: this.$route.query.parentLabel
uni.showToast({ }
title: "请选择地点", })
icon: "none" uni.navigateBack({
}) delta: this.layer
} })
}, } else {
uni.showToast({
title: "请选择类别",
icon: "none"
})
}
},
} }
} }
</script> </script>
<style> <style>
.bottombtn { .bottombtn {
background-color: #1B66FF; background-color: #1B66FF;
color: #fff; color: #fff;
text-align: center; text-align: center;
border-radius: 10rpx; border-radius: 10rpx;
font-family: PingFangSC-Medium; font-family: PingFangSC-Medium;
font-size: 32rpx; font-size: 32rpx;
height: 90rpx; height: 90rpx;
line-height: 90rpx; line-height: 90rpx;
} }
.btn { .btn {
background-color: #fefefe; background-color: #fefefe;
width: 690rpx; width: 690rpx;
padding: 30rpx; padding: 30rpx;
padding-bottom: 80rpx; padding-bottom: 80rpx;
position: fixed; position: fixed;
bottom: 0; bottom: 0;
left: 0; left: 0;
} }
.cityList image { .cityList image {
width: 32rpx; width: 32rpx;
height: 32rpx; height: 32rpx;
} }
.cityList { .cityList {
display: flex; display: flex;
align-items: center; align-items: center;
justify-content: space-between; justify-content: space-between;
font-family: PingFangSC-Regular; font-family: PingFangSC-Regular;
font-size: 32rpx; font-size: 32rpx;
color: #333333; color: #333333;
padding: 30rpx; padding: 30rpx;
padding-left: 0; padding-left: 0;
margin-left: 30rpx; margin-left: 30rpx;
width: 690rpx; width: 690rpx;
border-bottom: 1rpx solid #dddddd; border-bottom: 1rpx solid #dddddd;
} }
.location { .location {
font-family: PingFangSC-Regular; font-family: PingFangSC-Regular;
font-size: 32rpx; font-size: 32rpx;
color: #333333; color: #333333;
display: flex; display: flex;
align-items: center; align-items: center;
justify-content: flex-start; justify-content: flex-start;
padding: 30rpx; padding: 30rpx;
} }
.comfirm { .comfirm {
margin-left: auto; margin-left: auto;
} }
.location image { .location image {
width: 40rpx; width: 40rpx;
height: 40rpx; height: 40rpx;
} }
.title { .title {
font-family: PingFangSC-Regular; font-family: PingFangSC-Regular;
font-size: 28rpx; font-size: 28rpx;
color: #999999; color: #999999;
background-color: #f6f6f6; background-color: #f6f6f6;
padding: 30rpx; padding: 30rpx;
} }
page { page {
background-color: #fefefe; background-color: #fefefe;
} }
</style> </style>

View File

@@ -1,217 +1,218 @@
<template> <template>
<view> <view>
<view class="title"> <view class="title">
全部 全部
</view> </view>
<block v-for="(item, index) in city" :key="index"> <block v-for="(item, index) in city" :key="index">
<view class="cityList" @click="cityClick(item)"> <view class="cityList" @click="cityClick(item)">
{{ item.name }} {{ item.name }}
<image src="../../../static/img/correct.svg" v-if="id === item.id" mode=""></image> <image src="../../../static/img/correct.svg" v-if="id === item.id" mode=""></image>
<image v-else-if="layer !== maxLayer" src="../../../static/img/right.svg" mode=""></image> <image v-else-if="layer !== maxLayer" src="../../../static/img/right.svg" mode=""></image>
</view> </view>
</block> </block>
<view class="" v-if="layer === maxLayer" style="height: 230rpx;background-color: #f6f6f6;"></view> <view class="" v-if="layer === maxLayer" style="height: 230rpx;background-color: #f6f6f6;"></view>
<view class="btn" v-if="layer === maxLayer" @click="comfirm"> <view class="btn" v-if="layer === maxLayer" @click="comfirm">
<view class="bottombtn"> <view class="bottombtn">
确定 确定
</view> </view>
</view> </view>
</view> </view>
</template> </template>
<script> <script>
import { import {
getWorktypesList getWorktypesList
} from '@/api/resume.js' } from '@/api/resume.js'
export default { export default {
data() { data() {
return { return {
workTypeList: [], workTypeList: [],
choose: false, choose: false,
chooseIndex: '', chooseIndex: '',
parentId: undefined, parentId: undefined,
parentLabel: null, parentLabel: null,
layer: 1, layer: 1,
maxLayer: 2, maxLayer: 2,
id: '', id: '',
label: '', label: '',
parentTwoId: '', parentTwoId: '',
parentTwoLabel: '', parentTwoLabel: '',
tradeId: '', tradeId: '',
} }
}, },
computed: { computed: {
city() { city() {
if(!this.workTypeList.length) return; if (!this.workTypeList.length) return;
if(this.parentTwoId) { if (this.parentTwoId) {
const parentItem = this.workTypeList.find(item => item.id == this.parentId); const parentItem = this.workTypeList.find(item => item.id == this.parentId);
const parentChild = parentItem.child.find(item => item.id == this.parentTwoId); const parentChild = parentItem.child.find(item => item.id == this.parentTwoId);
if (parentItem) { if (parentItem) {
return parentChild.child return parentChild.child
}
} else if (this.parentId) {
const parentItem = this.workTypeList.find(item => item.id == this.parentId);
if (parentItem) {
return parentItem.child;
}
} else {
return this.workTypeList;
} }
} else if (this.parentId) { }
const parentItem = this.workTypeList.find(item => item.id == this.parentId); },
if (parentItem) { mounted() {
return parentItem.child; getWorktypesList(2).then(res => {
} this.workTypeList = res.data.data;
} else {
return this.workTypeList;
}
}
},
mounted() {
getWorktypesList(2).then(res => {
this.workTypeList = res.data.data;
})
},
onLoad({
tradeId,
parentId,
layer,
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)
},
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) {
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}`
})
},
comfirm: function () {
if (this.id) {
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
})
} else {
uni.showToast({
title: "请选择地点",
icon: "none"
})
}
},
} onLoad({
} tradeId,
parentId,
layer,
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)
},
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) {
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}`
})
},
comfirm: function() {
if (this.id) {
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
})
} else {
uni.showToast({
title: "请选择类别",
icon: "none"
})
}
},
}
}
</script> </script>
<style> <style>
.bottombtn { .bottombtn {
background-color: #1B66FF; background-color: #1B66FF;
color: #fff; color: #fff;
text-align: center; text-align: center;
border-radius: 10rpx; border-radius: 10rpx;
font-family: PingFangSC-Medium; font-family: PingFangSC-Medium;
font-size: 32rpx; font-size: 32rpx;
height: 90rpx; height: 90rpx;
line-height: 90rpx; line-height: 90rpx;
} }
.btn { .btn {
background-color: #fefefe; background-color: #fefefe;
width: 690rpx; width: 690rpx;
padding: 30rpx; padding: 30rpx;
padding-bottom: 80rpx; padding-bottom: 80rpx;
position: fixed; position: fixed;
bottom: 0; bottom: 0;
left: 0; left: 0;
} }
.cityList image { .cityList image {
width: 32rpx; width: 32rpx;
height: 32rpx; height: 32rpx;
} }
.cityList { .cityList {
display: flex; display: flex;
align-items: center; align-items: center;
justify-content: space-between; justify-content: space-between;
font-family: PingFangSC-Regular; font-family: PingFangSC-Regular;
font-size: 32rpx; font-size: 32rpx;
color: #333333; color: #333333;
padding: 30rpx; padding: 30rpx;
padding-left: 0; padding-left: 0;
margin-left: 30rpx; margin-left: 30rpx;
width: 690rpx; width: 690rpx;
border-bottom: 1rpx solid #dddddd; border-bottom: 1rpx solid #dddddd;
} }
.location { .location {
font-family: PingFangSC-Regular; font-family: PingFangSC-Regular;
font-size: 32rpx; font-size: 32rpx;
color: #333333; color: #333333;
display: flex; display: flex;
align-items: center; align-items: center;
justify-content: flex-start; justify-content: flex-start;
padding: 30rpx; padding: 30rpx;
} }
.comfirm { .comfirm {
margin-left: auto; margin-left: auto;
} }
.location image { .location image {
width: 40rpx; width: 40rpx;
height: 40rpx; height: 40rpx;
} }
.title { .title {
font-family: PingFangSC-Regular; font-family: PingFangSC-Regular;
font-size: 28rpx; font-size: 28rpx;
color: #999999; color: #999999;
background-color: #f6f6f6; background-color: #f6f6f6;
padding: 30rpx; padding: 30rpx;
} }
page { page {
background-color: #fefefe; background-color: #fefefe;
} }
</style> </style>

View File

@@ -3,11 +3,10 @@ module.exports = {
port: 1887, port: 1887,
proxy: { proxy: {
'/api': { '/api': {
target: 'http://192.168.1.101:8200', target: 'http://10.165.0.173:8000',
ws: true, ws: true,
changeOrigin: true,
pathRewrite: { pathRewrite: {
"^/api/jobslink-api": "/" '^/api': '/'
} }
}, },
'/qq/map': { '/qq/map': {