乡村相册

This commit is contained in:
yanran200730
2022-05-23 18:00:28 +08:00
parent 75034e8c35
commit 72d814c913
8 changed files with 131 additions and 49 deletions

View File

@@ -3,7 +3,7 @@
<div class="userinfo">
<image src="https://pica.zhimg.com/v2-abed1a8c04700ba7d72b45195223e0ff_is.jpg?source=32738c0c" />
<div class="right">
<h2>吴小米</h2>
<h2><AiOpenData v-if="userInfo.wxOpenUserId" type="userName" :openid="userInfo.wxOpenUserId"></AiOpenData></h2>
<p>欢迎使用乡村相册</p>
</div>
</div>
@@ -81,7 +81,8 @@
countPhotoNo: '',
countPhotographer: '',
list: [],
msgInfo: {}
msgInfo: {},
userInfo: {}
}
},
@@ -89,6 +90,7 @@
this.getCountPhotoNo()
this.getAlbumList()
this.getMsgList()
this.getUserInfo()
},
methods: {
@@ -98,6 +100,14 @@
})
},
getUserInfo () {
this.$http.post('/api/user/info').then(res => {
if (res.code === 0) {
this.userInfo = res.data
}
})
},
getCountPhotoNo () {
this.$http.post('/api/appalbumphoto/countPhotoNo').then(res => {
if (res.code === 0) {

View File

@@ -41,7 +41,7 @@
<span>拍照数</span>
<div class="info-total__item--bottom">
<h3>{{ photoTotal.allPhoto }}</h3>
<i></i>
<i></i>
</div>
</div>
</div>
@@ -54,34 +54,34 @@
<div class="info-work__wrapper">
<div class="top">
<div class="left">
<h2>8</h2>
<h2>{{ attendanceCount.hasIn || 0 }}</h2>
<span>人已打卡</span>
<i>12</i>
<i>{{ attendanceCount.all || 0 }}</i>
</div>
<span>66.6%</span>
<span>{{ rate }}%</span>
</div>
<div class="progress">
<div style="width: 60%"></div>
<div :style="{width: rate + '%'}"></div>
</div>
</div>
</div>
<div class="info-item info-rank">
<div class="info-item__title">
<h2>成员拍照排名</h2>
<image src="../images/right.png" @click="linkTo('./PhotoRank')" />
<image src="../images/right.png" @click="linkTo('./PhotoRank?date=' + date.replace(/年|月/g, '-'))" />
</div>
<div class="info-rank__wrapper">
<div class="rank-item" v-for="(item, index) in 10" :key="index">
<div class="rank-item" v-for="(item, index) in list" :key="index">
<div class="rank-item__left">
<image src="../images/rank1.png" v-if="index === 0" />
<image src="../images/rank2.png" v-else-if="index === 1" />
<image src="../images/rank3.png" v-else-if="index === 2" />
<span v-else>{{ index + 1 > 9 ? index + 1 : '0' + (index + 1) }}</span>
<h2>贡平娟</h2>
<h2><AiOpenData v-if="item.name" type="userName" :openid="item.name"/></h2>
</div>
<div class="rank-item__right">
<span>已上传</span>
<i>10</i>
<i>{{ item.num }}</i>
<span></span>
</div>
</div>
@@ -99,7 +99,8 @@
return {
photoTotal: {},
date: '',
list: []
list: [],
attendanceCount: {}
}
},
@@ -118,30 +119,44 @@
}
return ''
},
rate () {
if (!this.attendanceCount.all) {
return '0'
}
return (this.attendanceCount.hasIn / this.attendanceCount.all * 100).toFixed(2)
}
},
onLoad () {
mounted () {
this.date = this.$dayjs(new Date).format('YYYY年MM月DD')
this.getPhotoTotal()
},
methods: {
getPhotoTotal () {
this.$http.post(`/api/appattendancerecord/punchclocksum?queryTime=${this.date}`).then(res => {
this.$http.post(`/api/appattendancerecord/punchclocksum?queryTime=${this.date.replace(/年|月/g, '-')}`).then(res => {
if (res.code === 0) {
this.photoTotal = res.data
}
})
this.$http.post(`/api/appattendancerecord/alldetail?queryTime=${this.date}`).then(res => {
this.$http.post(`/api/appattendancerecord/attendanceCount?queryTime=${this.date.replace(/年|月/g, '-')}`).then(res => {
if (res.code === 0) {
this.attendanceCount = res.data
}
})
this.$http.post(`/api/appattendancerecord/userphotosort?queryTime=${this.date}`).then(res => {
this.$http.post(`/api/appattendancerecord/userphotosort?queryTime=${this.date.replace(/年|月/g, '-')}`).then(res => {
if (res.code === 0) {
this.list = res.data
this.list = Object.keys(res.data).map(v => {
return {
name: v,
num: res.data[v]
}
})
}
})
},