diff --git a/src/apps/AppBuilding/AppBuilding.vue b/src/apps/AppBuilding/AppBuilding.vue index 402b65e6..416a3290 100644 --- a/src/apps/AppBuilding/AppBuilding.vue +++ b/src/apps/AppBuilding/AppBuilding.vue @@ -1,10 +1,6 @@ @@ -18,21 +14,17 @@ import Map from './map' export default { name: 'AppBuilding', appName: '以房找人', - data() { return { - component: 'SearchMap', - params: {} + show: true } }, - components: {Detail, Add, List, SearchMap, Map}, - - methods: { - onChange(e) { - this.params = e.params - this.component = e.type - } + onShow() { + this.show = false + this.$nextTick(() => { + this.show = true + }) }, mounted() { document.title = "以房找人" diff --git a/src/apps/AppBuilding/add.vue b/src/apps/AppBuilding/add.vue index 6ae8cb27..1299967e 100644 --- a/src/apps/AppBuilding/add.vue +++ b/src/apps/AppBuilding/add.vue @@ -1,7 +1,7 @@ diff --git a/src/apps/AppBuilding/components/searchMap.vue b/src/apps/AppBuilding/components/searchMap.vue index 5571592a..485922a5 100644 --- a/src/apps/AppBuilding/components/searchMap.vue +++ b/src/apps/AppBuilding/components/searchMap.vue @@ -100,7 +100,7 @@ - + diff --git a/src/apps/AppBuilding/selectResident.vue b/src/apps/AppComponent/selectResident.vue similarity index 76% rename from src/apps/AppBuilding/selectResident.vue rename to src/apps/AppComponent/selectResident.vue index 5c3f1c8f..1304fbb7 100644 --- a/src/apps/AppBuilding/selectResident.vue +++ b/src/apps/AppComponent/selectResident.vue @@ -10,7 +10,7 @@
- {{item.name}} + {{ item.name }}
@@ -25,21 +25,25 @@ import {mapState} from 'vuex' export default { - + name: "selectResident", + appName: "人员选择器(居民档案)", data() { return { current: 1, name: '', list: [], - cirIcon: require('./components/img/cir-icon.png'), - checkIcon: require('./components/img/check-icon.png'), + cirIcon: require('../AppBuilding/components/img/cir-icon.png'), + checkIcon: require('../AppBuilding/components/img/check-icon.png'), + selected: [] } }, computed: {...mapState(['user'])}, - mounted() { + onLoad(query) { + if (query.selected) { + this.selected = query.selected?.split(",") || [] + } this.getList() }, - methods: { getList() { this.$http.post(`/app/appresident/list`, null, { @@ -52,7 +56,7 @@ export default { }).then(res => { if (res?.data) { res.data.records.forEach(e => { - e.isCheck = false + e.isCheck = this.selected.includes(e.id) }) if (this.current > 1 && this.current > res.data.pages) { return @@ -65,23 +69,24 @@ export default { this.list[index].isCheck = !this.list[index].isCheck }, confirm() { - var checkList = [] + let checkList = [] this.list.map((item) => { - if(item.isCheck) { + if (item.isCheck) { checkList.push(item) } }) - - console.log(checkList) - - if(!checkList.length) { + if (!checkList.length) { return this.$u.toast('请先选择人员') + } else { + uni.navigateBack({ + success: () => { + uni.$emit("pagePicker", checkList) + } + }) } - } }, onReachBottom() { - console.log(111) this.current++ this.getList() }, @@ -90,25 +95,30 @@ export default {