This commit is contained in:
yanran200730
2022-01-14 17:42:10 +08:00
9 changed files with 145 additions and 82 deletions

View File

@@ -1,5 +1,6 @@
<template> <template>
<div class="BackUserList"> <div class="BackUserList">
<AiTopFixed>
<div class="header"> <div class="header">
<div class="tab-item"> <div class="tab-item">
<h2 style="color:#2C51CE;">{{totalInfo.total}}</h2> <h2 style="color:#2C51CE;">{{totalInfo.total}}</h2>
@@ -33,6 +34,7 @@
<div class="item" :class="!tabIndex ? 'active' : ''" @click="tabClick(0)">返乡人员<span></span></div> <div class="item" :class="!tabIndex ? 'active' : ''" @click="tabClick(0)">返乡人员<span></span></div>
<div class="item" :class="tabIndex ? 'active' : ''" @click="tabClick(1)">异常人员<span></span></div> <div class="item" :class="tabIndex ? 'active' : ''" @click="tabClick(1)">异常人员<span></span></div>
</div> </div>
</AiTopFixed>
<div class="user-list"> <div class="user-list">
<div class="item" @click="toUser(item)" v-for="(item,index) in list" :key="index"> <div class="item" @click="toUser(item)" v-for="(item,index) in list" :key="index">
<h2 class="name">{{item.name}}<span class="status" v-if="item.status == 0">有异常</span></h2> <h2 class="name">{{item.name}}<span class="status" v-if="item.status == 0">有异常</span></h2>
@@ -233,5 +235,20 @@ export default {
} }
} }
} }
::v-deep .AiTopFixed {
.placeholder {
.content {
padding: 0 !important;
}
}
.fixed {
margin: 0 !important;
background-color: #f5f5f5!important;
.content {
padding: 0 !important;
}
}
}
} }
</style> </style>

View File

@@ -38,12 +38,12 @@
<div class="line2"></div> <div class="line2"></div>
<u-tabs :list="tabList" :is-scroll="false" :current="currentTabs" height="96" bg-color="#fff" inactive-color="#333" bar-width="192" active-color="#135AB8 " @change="change"></u-tabs> <u-tabs :list="tabList" :is-scroll="false" :current="currentTabs" height="96" bg-color="#fff" inactive-color="#333" bar-width="192" active-color="#135AB8 " @change="change"></u-tabs>
<div class="line3"></div>
</AiTopFixed> </AiTopFixed>
<div class="bottoms"> <div class="bottoms">
<template v-if="data.length"> <template v-if="data.length">
<div class="line3"></div>
<div class="templates" v-for="(item, i) in data" :key="i" @click="goDetail(item)"> <div class="templates" v-for="(item, i) in data" :key="i" @click="goDetail(item)">
<img :src="item.avatar" alt="" v-if="item.avatar" /> <img :src="item.avatar" alt="" v-if="item.avatar" />
<img src="./components/img/user-img.png" alt="" v-else /> <img src="./components/img/user-img.png" alt="" v-else />
@@ -246,12 +246,11 @@ export default {
.line1 { .line1 {
height: 4px; height: 4px;
background: #f3f6f9; background: #f5f5f5;
} }
.middle { .middle {
display: flex; display: flex;
align-items: center;
padding: 24px 32px; padding: 24px 32px;
.left { .left {
width: 40%; width: 40%;
@@ -263,19 +262,22 @@ export default {
height: 48px; height: 48px;
} }
} }
.u-search {
margin-bottom: 0 !important;
}
} }
.line2 { .line2 {
height: 8px; height: 8px;
background: #f3f6f9; background: #f5f5f5;
}
.line3 {
height: 6px;
background: #f5f5f5;
} }
.bottoms { .bottoms {
.line3 {
height: 6px;
background: #f3f6f9;
}
.templates { .templates {
display: flex; display: flex;
align-items: center; align-items: center;

View File

@@ -1,9 +1,15 @@
<template> <template>
<div class="AddFamily"> <div class="AddFamily">
<div class="search"> <div class="search">
<div class="searchBox"> <div class="left">
<u-search v-model="value" placeholder:clearabled="true" placeholder="搜索" :show-action="false" bg-color="#F5F5F5" search-icon-color="#999" color="#999" height="58" @search="getListInit" @clear="value='',getListInit"></u-search> <AiAreaPicker v-model="areaId" :areaId="user.areaId" @select="areaSelect" :name.sync="areaName" style="color: #666">
<u-icon name="map-fill" color="#3192F4" size="20px" style="vertical-align: text-bottom"></u-icon>
<span style="margin-left: 4px" v-if="areaName">{{ areaName }}</span>
<span v-else>请选择</span>
<u-icon name="arrow-down" color="#666" size="28" style="margin-left: 4px" />
</AiAreaPicker>
</div> </div>
<u-search v-model="value" placeholder:clearabled="true" placeholder="搜索" :show-action="false" bg-color="#F5F5F5" search-icon-color="#999" color="#999" height="58" @search="getListInit" @clear="value='',getListInit"></u-search>
</div> </div>
<div class="userList"> <div class="userList">
<ul v-for="(item,index) in list" :key="index"> <ul v-for="(item,index) in list" :key="index">
@@ -22,7 +28,7 @@
<span class="user-name">{{item.name}}</span> <span class="user-name">{{item.name}}</span>
<span class="user-tel">{{item.phone}}</span> <span class="user-tel">{{item.phone}}</span>
</div> </div>
<div class="idCard">{{item.idNumber && item.idNumber.replace(/(.{6}).*(.{4})/,"$1********$2")}}</div> <div class="idCard">{{item.idNumber && item.idNumber.replace(/^(\d{6})\d{8}(.{4}$)/g, `$1${Array(9).join('*')}$2`)}}</div>
<div class="address">{{item.currentAreaName || '' + item.currentAddress}}</div> <div class="address">{{item.currentAreaName || '' + item.currentAddress}}</div>
</div> </div>
</div> </div>
@@ -46,13 +52,15 @@ export default {
value: '', value: '',
checked: true, checked: true,
userList: {}, userList: {},
userId: '' userId: '',
areaId: '',
areaName:''
} }
}, },
computed: { ...mapState(['user']) }, computed: { ...mapState(['user']) },
methods: { methods: {
getList(){ getList(){
this.$http.post(`/app/appresident/list?residentType=0&areaId=${this.user.areaId}&householdName=1&current=${this.current}&con=${this.value}`).then((res) => { this.$http.post(`/app/appresident/list?areaId=${this.areaId}&householdName=1&current=${this.current}&con=${this.value}`).then((res) => {
if (res.code == 0) { if (res.code == 0) {
res.data.records.map((item) => { res.data.records.map((item) => {
item.checked = false item.checked = false
@@ -84,7 +92,7 @@ export default {
} }
}) })
if(!checkUserList.length) { if(!checkUserList.length) {
this.$u.toast('请选择家庭') return this.$u.toast('请选择户主')
} }
this.$http.post(`/app/appgirdmemberresident/add`, {residentList:checkUserList}).then((res) => { this.$http.post(`/app/appgirdmemberresident/add`, {residentList:checkUserList}).then((res) => {
if (res.code == 0) { if (res.code == 0) {
@@ -97,10 +105,16 @@ export default {
}).catch((err) => { }).catch((err) => {
this.$u.toast(err) this.$u.toast(err)
}) })
} },
areaSelect(e) {
this.areaId =e
this.getListInit()
},
}, },
onLoad(option) { onLoad(option) {
this.userId = option.id this.userId = option.id
this.areaId = this.user.areaId
this.areaName = this.user.areaName
console.log(this.userId) console.log(this.userId)
}, },
onShow() { onShow() {
@@ -118,26 +132,16 @@ export default {
.AddFamily { .AddFamily {
background-color: #FFFFFF; background-color: #FFFFFF;
.search{ .search{
padding: 20px 32px;
height: 64px;
.searchBox {
display: flex;
justify-content: flex-start;
width: 100%; width: 100%;
height: 64px; height: 112px;
border-radius: 32px; padding: 32px;
background-color: #F5F5F5; box-sizing: border-box;
.searchIcon { background: #FFF;
width: 32px; display: flex;
height: 32px; margin-bottom: 8px;
padding: 16px 6px 16px 32px; .left{
width: calc(100% - 402px);
} }
.input {
width: 540px;
padding: 14px 6px 14px 6px;
}
}
;
} }
.userList { .userList {
width: 100%; width: 100%;

View File

@@ -77,7 +77,7 @@ export default {
this.isAdmin = false this.isAdmin = false
this.$http.post('/app/appgirdmemberinfo/checkLogOnUser').then((res) => { this.$http.post('/app/appgirdmemberinfo/checkLogOnUser').then((res) => {
if (res.code == 0) { if (res.code == 0) {
if (res.data.checkType) { if (res.data.checkType != '0') {
this.isAdmin = true this.isAdmin = true
} }
} }

View File

@@ -10,7 +10,7 @@
</div> </div>
<div class="title">网格人员</div> <div class="title">网格人员</div>
<div class="user-content" v-for="(item, index) in dataInfo.parentGirdMembers" :key="index"> <div class="user-content" v-for="(item, index) in dataInfo.parentGirdMembers" :key="index">
<img :src="item.photo" alt="" v-if="item.photo"> <image :src="item.photo" alt="" mode="aspectFill" v-if="item.photo" />
<img src="./components/img/big-user.png" alt="" v-else> <img src="./components/img/big-user.png" alt="" v-else>
<div class="right"> <div class="right">
<div class="name">{{item.name}}</div> <div class="name">{{item.name}}</div>
@@ -19,12 +19,12 @@
</div> </div>
</div> </div>
<div class="user-content user-item" v-for="(item, index) in dataInfo.girdMembers" :key="index"> <div class="user-content user-item" v-for="(item, index) in dataInfo.girdMembers" :key="index">
<img :src="item.photo" alt="" v-if="item.photo"> <image :src="item.photo" alt="" mode="aspectFill" v-if="item.photo" />
<img src="./components/img/user-img.png" alt="" v-else> <img src="./components/img/user-img.png" alt="" v-else />
<div class="right"> <div class="right">
<div class="name">{{item.name}} <div class="name">{{item.name}}
<span class="gird">{{item.checkType == 2 ? '网格长' : '网格员'}}</span> <span class="gird">{{item.checkType == 2 ? '网格长' : '网格员'}}</span>
<span class="family-btn" @click="linkTo(`./FamilyList?id=${item.id}`)">责任家庭 ></span> <span class="family-btn" @click="linkTo(`./FamilyList?id=${item.id}`)" v-if="item.checkType == 1">责任家庭 ></span>
</div> </div>
<p>{{item.girdName}} </p> <p>{{item.girdName}} </p>
</div> </div>
@@ -58,12 +58,10 @@ export default {
isGirdUser() { isGirdUser() {
this.$http.post('/app/appgirdmemberinfo/checkLogOnUser').then((res) => { this.$http.post('/app/appgirdmemberinfo/checkLogOnUser').then((res) => {
if (res.code == 0) { if (res.code == 0) {
if (res.data.checkType) { if (res.data.checkType != '0') {
this.checkType = res.data.checkType this.checkType = res.data.checkType
this.userGird = res.data.appGirdInfo this.userGird = res.data.appGirdInfo
this.getGirdUserList() this.getGirdUserList()
} else {
this.$u.toast('当前人员不是网格员或网格管理员')
} }
} }
}) })
@@ -85,6 +83,7 @@ export default {
<style lang="scss" scoped> <style lang="scss" scoped>
.Organization { .Organization {
padding-top: 32px; padding-top: 32px;
background-color: #f5f5f5;
.select-gird{ .select-gird{
width: calc(100% - 60px); width: calc(100% - 60px);
padding: 24px 32px; padding: 24px 32px;
@@ -142,7 +141,11 @@ export default {
width: 200px; width: 200px;
height: 200px; height: 200px;
margin-right: 32px; margin-right: 32px;
border-radius: 50%; }
image{
width: 200px;
height: 200px;
margin-right: 32px;
} }
.right{ .right{
width: 100%; width: 100%;
@@ -177,6 +180,12 @@ export default {
img{ img{
width: 96px; width: 96px;
height: 96px; height: 96px;
border-radius: 50%;
}
image{
width: 96px;
height: 96px;
border-radius: 50%;
} }
.gird{ .gird{
display: inline-block; display: inline-block;

View File

@@ -60,7 +60,7 @@ export default {
item.isChecked = false item.isChecked = false
}) })
this.userList = this.current > 1 ? res.data.records : [...this.userList, ...res.data.records] this.userList = this.current > 1 ? [...this.userList, ...res.data.records] : res.data.records
this.userList.map((item) => { this.userList.map((item) => {
this.selectUserList.map((e) => { this.selectUserList.map((e) => {

View File

@@ -105,8 +105,6 @@ export default {
this.girdMsgList = this.girdUser.appGirdInfo this.girdMsgList = this.girdUser.appGirdInfo
this.getList() this.getList()
} }
} else {
this.$u.toast('当前人员不是网格员或网格管理员')
} }
} }
}) })

View File

@@ -1,12 +1,16 @@
<template> <template>
<div class="AppHandSnapshot"> <div class="AppHandSnapshot">
<component v-if="refresh" :is="component" @change="onChange" :params="params"> </component> <component v-if="refresh && isAdmin" :is="component" @change="onChange" :params="params"> </component>
<div class="tabs" v-if="isTab"> <div class="tabs" v-if="isTab && isAdmin">
<div class="item" @click="tabClick(index, item.component)" v-for="(item, index) in tabs" :key="index"> <div class="item" @click="tabClick(index, item.component)" v-for="(item, index) in tabs" :key="index">
<img :src="tabIndex == index ? item.activeImg : item.img" alt="" /> <img :src="tabIndex == index ? item.activeImg : item.img" alt="" />
<p :class="tabIndex == index ? 'color-3267F0' : ''">{{ item.text }}</p> <p :class="tabIndex == index ? 'color-3267F0' : ''">{{ item.text }}</p>
</div> </div>
</div> </div>
<div v-if="!isAdmin" class="empty">
<img src="./components/img/no-admin.png" alt="">
<p>没有网格员权限<br />无法查看网格信息哦~</p>
</div>
</div> </div>
</template> </template>
@@ -46,6 +50,7 @@ export default {
} }
], ],
isTab: true, isTab: true,
isAdmin: false
} }
}, },
@@ -68,6 +73,19 @@ export default {
this.refresh = true this.refresh = true
}) })
}, },
isGirdUser() {
this.isAdmin = false
this.$http.post('/app/appgirdmemberinfo/checkLogOnUser').then((res) => {
if (res.code == 0) {
if (res.data.checkType != '0') {
this.isAdmin = true
}
}
})
},
},
onLoad() {
this.isGirdUser()
}, },
onShow() { onShow() {
document.title = '随手拍' document.title = '随手拍'
@@ -77,6 +95,7 @@ export default {
uni.$on('showTab', () => { uni.$on('showTab', () => {
this.isTab = true this.isTab = true
}) })
}, },
onReachBottom() { onReachBottom() {
if(!this.tabIndex) { if(!this.tabIndex) {
@@ -119,4 +138,18 @@ export default {
} }
} }
} }
.empty{
text-align: center;
img{
width: 282px;
height: 306px;
margin: 136px auto 0;
}
p{
font-size: 28px;
font-family: PingFangSC-Regular, PingFang SC;
color: #999;
line-height: 40px;
}
}
</style> </style>

Binary file not shown.

After

Width:  |  Height:  |  Size: 21 KiB