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

This commit is contained in:
aixianling
2022-08-18 09:58:03 +08:00

View File

@@ -16,7 +16,17 @@
</u-search> </u-search>
</div> </div>
<div class="dataes" v-if="datas.length"> <div class="dataes" v-if="datas.length">
<div class="datass" v-for="(item, index) in datas" :key="index" @click="toDetailCard(item)"> <u-swipe-action
:show="item.show"
:index="index"
v-for="(item, index) in datas"
:key="item.id"
@click="onClick"
@open="onOpen"
disabled="item.doRight !== '1'"
@content-click="toDetailCard(item)"
:options="options">
<div class="datass">
<div class="left"> <div class="left">
<img :src="item.photo" alt="" v-if="item.photo"/> <img :src="item.photo" alt="" v-if="item.photo"/>
<img src="./components/img/4.png" alt="" v-else/> <img src="./components/img/4.png" alt="" v-else/>
@@ -25,9 +35,6 @@
<div class="rightTop"> <div class="rightTop">
<span class="name">{{ item.name }}</span> <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> </span>
</div> </div>
<div class="rightBottom"> <div class="rightBottom">
@@ -36,6 +43,7 @@
</div> </div>
</div> </div>
</div> </div>
</u-swipe-action>
</div> </div>
<div class="empty" v-if="!datas.length && isMore"> <div class="empty" v-if="!datas.length && isMore">
<img src="https://cdn.cunwuyun.cn/dvcp/h5/no-data.png" alt=""> <img src="https://cdn.cunwuyun.cn/dvcp/h5/no-data.png" alt="">
@@ -72,7 +80,21 @@
currentTabs: 0, currentTabs: 0,
areaId: '', areaId: '',
isMore: false, isMore: false,
areaName: '' areaName: '',
options: [
{
text: '编辑',
style: {
backgroundColor: '#007aff'
}
},
{
text: '删除',
style: {
backgroundColor: '#dd524d'
}
}
]
} }
}, },
@@ -84,13 +106,31 @@
this.areaId = this.user.areaId this.areaId = this.user.areaId
this.areaName = this.user.areaName this.areaName = this.user.areaName
this.getList() this.getList()
uni.$on('reload', res => { uni.$on('reload', () => {
this.current = 1 this.current = 1
this.getList() this.getList()
}) })
}, },
methods: { methods: {
onClick (index, i) {
if (i == 1) {
this.del(this.datas[index].id)
} else {
this.datas[index].show = false
this.edit(this.datas[index].id)
}
},
onOpen (index) {
this.datas[index].show = true
this.datas.map((val, i) => {
if(index != i) {
this.datas[i].show = false
}
})
},
getList() { getList() {
this.$loading() this.$loading()
this.$http.post('/app/appresident/list', null, { this.$http.post('/app/appresident/list', null, {
@@ -102,7 +142,17 @@
} }
}).then((res) => { }).then((res) => {
if (res.code == 0) { if (res.code == 0) {
this.datas = this.current > 1 ? [...this.datas, ...res.data.records] : res.data.records this.datas = this.current > 1 ? [...this.datas, ...res.data.records.map(v => {
return {
...v,
show: false
}
})] : res.data.records.map(v => {
return {
...v,
show: false
}
})
this.pages = res.data.pages this.pages = res.data.pages