[IMP]【电投优化】职业类别控件样式修改

This commit is contained in:
yuweiqi
2020-04-10 18:30:47 +08:00
parent 4992d4fa24
commit 622e0efddb

View File

@@ -40,14 +40,14 @@
<p class="fs14 pl20 fwb pv5">搜索结果</p>
<div class="item p10 search-result fs12 flex flex-direction-colunm">
<p class="p5 mv5" :class="[item.isActive ? 'active' : '']" v-for="(item, index) in searchList" @click="searchChoose(item, index)" :key="index">
{{ item.name }}
{{ item.showName }}
</p>
</div>
</div>
</div>
<div class="close-btn fixed">
<van-button type="danger" @click="ensureChoose">确认选择</van-button>
<van-button type="primary" @click="$emit('chooseOccupation', '')">取消</van-button>
<!-- <van-button type="primary" @click="$emit('chooseOccupation', '')">取消</van-button> -->
</div>
</div>
</template>
@@ -59,20 +59,20 @@ export default {
props: {
name: {
type: String,
default: '',
default: ''
},
code: {
type: String,
default: '',
default: ''
},
life: {
type: String,
default: '',
default: ''
},
health: {
type: String,
default: '',
},
default: ''
}
},
data() {
return {
@@ -93,51 +93,51 @@ export default {
lifeGrade: '1',
name: '一般学生',
healthGrade: '1',
isActive: false,
isActive: false
},
{
code: '2090301',
lifeGrade: '1',
name: '中学教师',
healthGrade: '1',
isActive: false,
isActive: false
},
{
code: '2090401',
lifeGrade: '1',
name: '小学教师',
healthGrade: '1',
isActive: false,
isActive: false
},
{
code: '4010101',
lifeGrade: '1',
name: '营业员',
healthGrade: '1',
isActive: false,
isActive: false
},
{
code: '1050102',
lifeGrade: '1',
name: '企业经理',
healthGrade: '1',
isActive: false,
isActive: false
},
{
code: '4071203',
lifeGrade: '1',
name: '家庭主妇',
healthGrade: '1',
isActive: false,
},
isActive: false
}
],
isSearch: false, // 是否搜索中
searchList: [],
searchList: []
}
},
components: {
[Search.name]: Search,
[Sticky.name]: Sticky,
[Sticky.name]: Sticky
},
created() {
// let occupationData = JSON.parse(window.localStorage.getItem('OccupationList'))
@@ -189,15 +189,18 @@ export default {
if (this.searchParams) {
this.searchList = []
this.isSearch = true
this.occupationList.forEach((first) => {
first.subs.forEach((second) => {
second.subs.forEach((third) => {
this.occupationList.forEach(first => {
first.subs.forEach(second => {
second.subs.forEach(third => {
if (third.name.indexOf(this.searchParams) != -1) {
this.searchList.push(Object.assign(third, { isActive: false }))
// this.searchList.push(Object.assign(third, { isActive: false }, { showName: first[index1].name + second[index2].name + third.name }))
this.searchList.push(Object.assign(third, { isActive: false }, { showName: first.name + ' - ' + second.name + ' - ' + third.name }))
console.log('first = ', first)
}
})
})
})
console.log('this.searchList ==', this.searchList)
} else {
this.isSearch = false
}
@@ -236,9 +239,9 @@ export default {
commonChoose(item, index) {
this.commonInit()
this.commonList[index].isActive = true
this.occupationList.forEach((occupation) => {
occupation.subs.forEach((sub) => {
sub.subs.forEach((occupaitonItem) => {
this.occupationList.forEach(occupation => {
occupation.subs.forEach(sub => {
sub.subs.forEach(occupaitonItem => {
if (occupaitonItem.code == item.code) {
this.first = occupation
this.sec = occupation.subs
@@ -252,7 +255,7 @@ export default {
})
},
searchChoose(item, index) {
this.searchList.forEach((item) => {
this.searchList.forEach(item => {
item.isActive = false
})
this.searchList[index].isActive = true
@@ -260,11 +263,11 @@ export default {
this.chooseName = this.third.name
},
commonInit() {
this.commonList.forEach((item) => {
this.commonList.forEach(item => {
item.isActive = false
})
},
},
}
}
}
</script>
<style lang="scss" scoped>
@@ -272,7 +275,7 @@ export default {
bottom: 0;
width: 100%;
.van-button {
width: 50% !important;
width: 100% !important;
}
}
.occupation {