selectType

This commit is contained in:
花有清香月有阴
2021-12-30 20:51:37 +08:00
parent 24d5fa8f5d
commit 15b3caefb6
5 changed files with 287 additions and 56 deletions

View File

@@ -2,24 +2,28 @@
<div class="detail">
<div>
<div class="item-content" v-for="(item, index) in userList" :key="index">
<div class="title" @click="showUserType(index)">
<div class="title" @click="showUserType(item, index)">
<h2>{{ item.label }}</h2>
<img src="./img/down-icon.png" alt="" :class="item.check ? 'img-active' : ''" />
</div>
<div class="user-list" v-if="item.check">
<div class="user-item" v-for="(e, indexs) in item.value" :key="indexs" v-if="item.value && item.value.length">
<div class="user-img">
<img src="./img/user-img.png" alt="" />
</div>
<div class="user-info">
<p class="name">{{ e.name }}</p>
<div class="phone">
<div v-if="statisticsList.length > 0">
<div class="user-item" v-for="(e, indexs) in statisticsList" :key="indexs">
<!-- v-if="item.value && item.value.length" -->
<div class="user-img">
<img src="./img/user-img.png" alt="" />
</div>
<div class="user-info">
<p class="name">{{ e.name }}</p>
<!-- <div class="phone">
<span>{{ idNumberInit(e.idNumber) }}</span>
<span>{{ e.phone }}</span>
</div> -->
</div>
</div>
</div>
<p class="text" v-if="!item.value.length">{{ '暂无' + item.label + '信息' }}</p>
<p class="text" v-else>{{ '暂无' + item.label + '信息' }}</p>
</div>
</div>
@@ -112,10 +116,10 @@ export default {
// },
// ],
// nameList: [],
// current: 1,
// appId: '',
current: 1,
appId: '',
// value: '',
// menuLevel3Name: '',
menuLevel3Name: '',
// num: 1,
// flag: false,
}
@@ -124,15 +128,10 @@ export default {
computed: {
...mapState(['user']),
},
// created() {
// console.log(1)
// this.getDiyList()
// },
created() {
this.getStatistic()
this.getUserList()
uni.$on('specialPeopleList', () => {
this.getStatistic()
this.getUserList()
})
},
@@ -149,29 +148,33 @@ export default {
})
},
getStatistic() {
this.statisticsList = []
this.$http.post(`/app/appapplicationinfo/specialStatistic?type=0&range=0`).then((res) => {
getStatistic(item) {
// this.statisticsList = []
this.menuLevel3Name = item.value.menuLevel3Name
this.appId = item.value.id
this.$http.post(`/app/appapplicationinfo/list?appId=${item.value.id}&current=${this.current}&size=${999}`).then((res) => {
if (res.code == 0) {
for (let i in res.data) {
var obj = {
label: i,
value: res.data[i],
}
this.statisticsList.push(obj)
}
this.statisticsList = res.data.records
// for (let i in res.data) {
// var obj = {
// label: i,
// value: res.data[i],
// }
// this.statisticsList.push(obj)
// }
}
})
},
getUserList() {
this.userList = []
this.$http.post(`/app/appapplicationinfo/queryApplicationListByType?type=0`).then((res) => {
this.$http.post(`/app/appapplicationinfo/queryApplicationListByType?type=0&status=1`).then((res) => {
if (res.code == 0) {
console.log(res.data);
for (let i in res.data) {
var obj = {
label: i,
// label: i,
label: res.data[i].applicationName,
value: res.data[i],
check: false,
}
@@ -190,16 +193,24 @@ export default {
return idNumber
},
showUserType(index) {
showUserType(item, index) {
this.getStatistic(item)
if (this.userList[index].check) {
this.userList[index].check = false
console.log(1)
this.statisticsList = []
} else {
this.userList.map((item) => {
item.check = false
this.statisticsList = []
})
this.userList[index].check = true
}
},
radioGroupChange(e) {
console.log(e)
},
},
// methods: {
@@ -207,11 +218,11 @@ export default {
// this.num = this.num + 1
// this.$forceUpdate()
// if (this.num % 2 == 0) {
// console.log('偶数')
//
// this.flag == true
// this.$forceUpdate()
// } else {
// console.log('奇数')
//
// this.flag == false
// this.$forceUpdate()
// }
@@ -225,16 +236,16 @@ export default {
// })
// },
// selectUser(item) {
// this.userList = []
// this.menuLevel3Name = item.menuLevel3Name
// this.appId = item.id
// this.$http.post(`/app/appapplicationinfo/list?appId=${item.id}&current=${this.current}&size=${99}`, { searchParam: this.keyword }).then((res) => {
// if (res.code == 0) {
// this.userList = res.data.records
// }
// })
// },
// selectUser(item) {
// this.userList = []
// this.menuLevel3Name = item.menuLevel3Name
// this.appId = item.id
// this.$http.post(`/app/appapplicationinfo/list?appId=${'2677c070764f4779920c1a2923a8afb0'}&current=${this.current}&size=${99}`, { searchParam: this.keyword }).then((res) => {
// if (res.code == 0) {
// this.userList = res.data.records
// }
// })
// },
// submit() {
// this.userList.map((item) => {
@@ -357,6 +368,7 @@ export default {
.user-item {
padding: 24px 32px;
display: flex;
align-items: center;
.user-img {
width: 112px;
img {