BUG 30927
This commit is contained in:
@@ -4,10 +4,10 @@
|
|||||||
<h2>标签列表</h2>
|
<h2>标签列表</h2>
|
||||||
<div class="tags-list">
|
<div class="tags-list">
|
||||||
<div class="item"
|
<div class="item"
|
||||||
v-for="(item, index) in list"
|
v-for="(item, index) in list"
|
||||||
:class="[checked.includes(item.id) ? 'active' : '']"
|
:class="[checked.includes(item.id) ? 'active' : '']"
|
||||||
:key="index"
|
:key="index"
|
||||||
@click="onClick(item.id)">
|
@click="onClick(item.id)">
|
||||||
{{ item.labelName }}
|
{{ item.labelName }}
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
@@ -19,121 +19,126 @@
|
|||||||
</template>
|
</template>
|
||||||
|
|
||||||
<script>
|
<script>
|
||||||
export default {
|
export default {
|
||||||
appName: '居民标签',
|
appName: '居民标签',
|
||||||
|
|
||||||
data () {
|
data() {
|
||||||
return {
|
return {
|
||||||
currIndex: 0,
|
currIndex: 0,
|
||||||
list: [],
|
list: [],
|
||||||
checked: []
|
checked: []
|
||||||
|
}
|
||||||
|
},
|
||||||
|
|
||||||
|
onLoad(query) {
|
||||||
|
this.getList()
|
||||||
|
|
||||||
|
if (query.ids) {
|
||||||
|
this.checked = query.ids.split(',')
|
||||||
|
}
|
||||||
|
},
|
||||||
|
|
||||||
|
methods: {
|
||||||
|
getList() {
|
||||||
|
this.$loading()
|
||||||
|
this.$http.post('/app/appresidentlabelinfo/list?size=1000').then((res) => {
|
||||||
|
if (res.code == 0) {
|
||||||
|
this.list = res.data.records
|
||||||
|
}
|
||||||
|
})
|
||||||
|
},
|
||||||
|
|
||||||
|
onClick(id) {
|
||||||
|
const index = this.checked.indexOf(id)
|
||||||
|
|
||||||
|
if (index === -1) {
|
||||||
|
this.checked.push(id)
|
||||||
|
} else {
|
||||||
|
this.checked.splice(index, 1)
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
|
||||||
onLoad (query) {
|
submit() {
|
||||||
this.getList()
|
if (!this.checked.length) {
|
||||||
|
return this.$u.toast('请选择标签')
|
||||||
if (query.ids) {
|
|
||||||
this.checked = query.ids.split(',')
|
|
||||||
}
|
}
|
||||||
},
|
|
||||||
|
|
||||||
methods: {
|
const list = this.list.filter(v => {
|
||||||
getList() {
|
return this.checked.includes(v.id)
|
||||||
this.$loading()
|
})
|
||||||
this.$http.post('/app/appresidentlabelinfo/list?size=1000').then((res) => {
|
|
||||||
if (res.code == 0) {
|
|
||||||
this.list = res.data.records
|
|
||||||
}
|
|
||||||
})
|
|
||||||
},
|
|
||||||
|
|
||||||
onClick (id) {
|
uni.$emit('onChecked', list)
|
||||||
const index = this.checked.indexOf(id)
|
|
||||||
|
|
||||||
if (index === -1) {
|
uni.navigateBack()
|
||||||
this.checked.push(id)
|
|
||||||
} else {
|
|
||||||
this.checked.splice(index, 1)
|
|
||||||
}
|
|
||||||
},
|
|
||||||
|
|
||||||
submit () {
|
|
||||||
if (!this.checked.length) {
|
|
||||||
return this.$u.toast('请选择标签')
|
|
||||||
}
|
|
||||||
|
|
||||||
const list = this.list.filter(v => {
|
|
||||||
return this.checked.includes(v.id)
|
|
||||||
})
|
|
||||||
|
|
||||||
uni.$emit('onChecked', list)
|
|
||||||
|
|
||||||
uni.navigateBack()
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
}
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
<style lang="scss" scoped>
|
<style lang="scss" scoped>
|
||||||
.tags {
|
.tags {
|
||||||
padding: 16px 0 130px;
|
padding: 16px 0 130px;
|
||||||
|
|
||||||
* {
|
* {
|
||||||
box-sizing: border-box;
|
box-sizing: border-box;
|
||||||
|
}
|
||||||
|
|
||||||
|
.add-btn {
|
||||||
|
position: fixed;
|
||||||
|
bottom: 0;
|
||||||
|
left: 0;
|
||||||
|
z-index: 999;
|
||||||
|
width: 100%;
|
||||||
|
height: 112px;
|
||||||
|
line-height: 112px;
|
||||||
|
background: #3975C6;
|
||||||
|
font-size: 32px;
|
||||||
|
font-family: PingFangSC-Medium, PingFang SC;
|
||||||
|
font-weight: 500;
|
||||||
|
color: #FFF;
|
||||||
|
|
||||||
|
div {
|
||||||
|
text-align: center;
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
.add-btn {
|
.tags-group {
|
||||||
position: fixed;
|
margin-bottom: 16px;
|
||||||
bottom: 0;
|
padding: 0 32px 16px;
|
||||||
left: 0;
|
background: #fff;
|
||||||
z-index: 999;
|
|
||||||
width: 100%;
|
& > h2 {
|
||||||
height: 112px;
|
height: 108px;
|
||||||
line-height: 112px;
|
line-height: 108px;
|
||||||
background: #3975C6;
|
color: #333333;
|
||||||
font-size: 32px;
|
font-size: 32px;
|
||||||
font-family: PingFangSC-Medium, PingFang SC;
|
|
||||||
font-weight: 500;
|
|
||||||
color: #FFF;
|
|
||||||
div{
|
|
||||||
text-align: center;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
.tags-group {
|
.tags-list {
|
||||||
margin-bottom: 16px;
|
display: flex;
|
||||||
padding: 0 32px 16px;
|
flex-wrap: wrap;
|
||||||
background: #fff;
|
line-height: 1;
|
||||||
|
|
||||||
& > h2 {
|
.item {
|
||||||
height: 108px;
|
height: 64px;
|
||||||
line-height: 108px;
|
line-height: 64px;
|
||||||
|
margin: 0 16px 16px 0;
|
||||||
|
padding: 0 32px;
|
||||||
color: #333333;
|
color: #333333;
|
||||||
font-size: 32px;
|
font-size: 28px;
|
||||||
}
|
background: #F3F4F7;
|
||||||
|
border-radius: 4px;
|
||||||
|
max-width: 100%;
|
||||||
|
text-overflow: ellipsis;
|
||||||
|
overflow: hidden;
|
||||||
|
white-space: nowrap;
|
||||||
|
|
||||||
.tags-list {
|
&.active {
|
||||||
display: flex;
|
color: #fff;
|
||||||
flex-wrap: wrap;
|
background: #1365DD;
|
||||||
line-height: 1;
|
|
||||||
|
|
||||||
.item {
|
|
||||||
height: 64px;
|
|
||||||
line-height: 64px;
|
|
||||||
margin: 0 16px 16px 0;
|
|
||||||
padding: 0 32px;
|
|
||||||
color: #333333;
|
|
||||||
font-size: 28px;
|
|
||||||
background: #F3F4F7;
|
|
||||||
border-radius: 4px;
|
|
||||||
|
|
||||||
&.active {
|
|
||||||
color: #fff;
|
|
||||||
background: #1365DD;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
}
|
||||||
</style>
|
</style>
|
||||||
|
|||||||
Reference in New Issue
Block a user