Merge remote-tracking branch 'origin/dev' into dev

This commit is contained in:
aixianling
2022-08-15 18:39:57 +08:00
4 changed files with 91 additions and 25 deletions

View File

@@ -18,7 +18,7 @@
<span>重新定位</span>
</div>
</div>
<AiEmpty v-if="!list.length"/>
<AiEmpty v-if="!list.length && isMore" />
</div>
</div>
</template>
@@ -60,7 +60,7 @@ export default {
}
}).then(res => {
if (res?.data) {
if (res.data.records.length < 10) {
if (res.data.records.length < 10 && this.current === 1) {
this.isMore = true
}

View File

@@ -84,7 +84,7 @@
<div class="border">
<span class="label">现住址</span>
<span class="value">
<AiAreaPicker ref="address" class="aiArea" :fullName.sync="form.currentAreaName" :value="form.currentAreaId" mode="custom" all @select="onCurrentAreaChange">
<AiAreaPicker ref="address" :fullName.sync="form.currentAreaName" :value="form.currentAreaId" mode="custom" all @select="onCurrentAreaChange">
<div class="aiArea">
<span class="label" v-if="form.currentAreaName">{{ form.currentAreaName }}</span>
<span v-else class="color-999">请选择</span>
@@ -94,19 +94,6 @@
</span>
</div>
</div>
<div class="item">
<span class="tips">*</span>
<div class="border item-right">
<span class="label">居民标签</span>
<!-- <span class="value" @click="toChooseTags">
<span class="color-999">请选择</span>
<img src="./components/img/right-icon.png" alt="">
</span> -->
<div class="tag-list" @click="toChooseTags">
<div class="tag" v-for="(item, index) in 10" :key="index">残疾人</div>
</div>
</div>
</div>
<div class="item mar-b0">
<span class="tips"></span>
<div class="border not-border">
@@ -121,7 +108,7 @@
<div class="border">
<span class="label">户籍地址</span>
<span class="value">
<AiAreaPicker ref="address" class="aiArea" :fullName.sync="form.householdAreaName" :value="form.householdAreaId" mode="custom" all @select="onHouseAreaChange">
<AiAreaPicker ref="address" :fullName.sync="form.householdAreaName" :value="form.householdAreaId" mode="custom" all @select="onHouseAreaChange">
<div class="aiArea">
<span class="label" v-if="form.householdAreaName">{{ form.householdAreaName }}</span>
<span v-else class="color-999">请选择</span>
@@ -140,6 +127,19 @@
<div class="text-area">
<textarea placeholder="请输入" maxlength="30" v-model="form.householdAddress"></textarea>
</div>
<div class="item">
<div class="border" :class="[form.residentLabelList.length ? 'item-right' : '']">
<!-- <div class="border item-right"> -->
<span class="label">居民标签</span>
<div class="tag-list" @click="toChooseTags" v-if="form.residentLabelList.length">
<div class="tag" v-for="(item, index) in form.residentLabelList" :key="index">{{ item.labelName }}</div>
</div>
<span class="value" @click="toChooseTags" v-else>
<span class="color-999">请选择</span>
<img src="./components/img/right-icon.png" alt="">
</span>
</div>
</div>
<div class="pad-b152"></div>
<div class="add-btn" @click="submit">
<div>保存</div>
@@ -173,7 +173,8 @@ export default {
householdAreaName: '',
householdAddress: '',
residentType: '',
age: ''
age: '',
residentLabelList: []
},
showSelect: false,
formName: '',
@@ -190,6 +191,16 @@ export default {
this.form.residentType = options.type
}
this.$dict.load('yesOrNo', 'sex', 'householdRelation', 'nation', 'education', 'maritalStatus', 'politicsStatus', 'militaryStatus', 'faithType')
uni.$on('onChecked', e => {
console.log(e)
this.form.residentLabelList = e.map(v => {
return {
labelId: v.id,
labelName: v.labelName
}
})
})
},
computed: {
...mapState(['user']),
@@ -245,7 +256,9 @@ export default {
},
toChooseTags () {
uni.navigateTo({url: `./Tags`})
uni.navigateTo({
url: `./Tags?ids=${this.form.residentLabelList.map(v => v.labelId).join(',')}`
})
},
confirmSelect(e) {
@@ -301,6 +314,15 @@ export default {
<style scoped lang="scss">
.add {
::v-deep .aiArea {
display: flex;
align-items: center;
justify-content: flex-end;
.label {
width: 100%!important;
}
}
.item{
width: 100%;
padding-left: 14px;

View File

@@ -24,7 +24,8 @@
<div class="right">
<div class="rightTop">
<span class="name">{{ item.name }}</span>
<span class="btn" v-if="item.doRight == 1">
<!-- <span class="btn" v-if="item.doRight == 1"> -->
<span class="btn">
<img src="./components/img/edit-icon.png" alt="" @click.stop="edit(item.id)">
<img src="./components/img/del-icon.png" alt="" @click.stop="del(item.id)">
</span>

View File

@@ -1,9 +1,15 @@
<template>
<div class="tags">
<div class="tags-group" v-for="(label, i) in 2" :key="i">
<h2>年龄段</h2>
<div class="tags-group">
<h2>标签列表</h2>
<div class="tags-list">
<div class="item" v-for="(item, index) in 20" :class="[currIndex === index ? 'active' : '']" :key="index">婴儿</div>
<div class="item"
v-for="(item, index) in list"
:class="[checked.includes(item.id) ? 'active' : '']"
:key="index"
@click="onClick(item.id)">
{{ item.labelName }}
</div>
</div>
</div>
<div class="add-btn" @click="submit">
@@ -18,16 +24,53 @@
data () {
return {
currIndex: 0
currIndex: 0,
list: [],
checked: []
}
},
onLoad () {
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)
}
},
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>