2023-02-02 16:09:24 +08:00
|
|
|
|
<template>
|
|
|
|
|
|
<div class="AppSignIn">
|
|
|
|
|
|
<div class="title">签到记录</div>
|
|
|
|
|
|
|
|
|
|
|
|
<div class="sign_list">
|
2023-02-03 10:29:14 +08:00
|
|
|
|
<div class="sign_card" v-for="item in signlist" :key="item.id">
|
|
|
|
|
|
<div class="sign_left">{{ item.createTime.substring(0,5) }}</div>
|
2023-02-02 16:09:24 +08:00
|
|
|
|
<div class="sign_right">
|
2023-02-03 10:29:14 +08:00
|
|
|
|
<div class="time">{{ item.createDate }}</div>
|
2023-02-02 16:09:24 +08:00
|
|
|
|
<div class="tips">签到成功</div>
|
|
|
|
|
|
</div>
|
|
|
|
|
|
</div>
|
|
|
|
|
|
</div>
|
|
|
|
|
|
|
|
|
|
|
|
<div class="sign_btn">
|
2023-02-03 10:29:14 +08:00
|
|
|
|
<div class="btn" @click="signIn" :class="status==0? '': 'active'">
|
|
|
|
|
|
<div><span v-if="status==1">已</span>签到</div>
|
2023-02-02 16:09:24 +08:00
|
|
|
|
<div>{{ time }}</div>
|
|
|
|
|
|
</div>
|
|
|
|
|
|
</div>
|
|
|
|
|
|
</div>
|
|
|
|
|
|
</template>
|
|
|
|
|
|
|
|
|
|
|
|
<script>
|
|
|
|
|
|
import dayjs from "dayjs"
|
2023-02-03 10:29:14 +08:00
|
|
|
|
import { mapState } from "vuex"
|
|
|
|
|
|
import { set } from 'vue'
|
2023-02-02 16:09:24 +08:00
|
|
|
|
export default {
|
|
|
|
|
|
appName: "签到",
|
|
|
|
|
|
data() {
|
|
|
|
|
|
return {
|
|
|
|
|
|
time: '',
|
2023-02-03 10:29:14 +08:00
|
|
|
|
status: 0, // 签到状态:0、未签到;1、已签到
|
|
|
|
|
|
signlist: [],
|
|
|
|
|
|
current: 1,
|
2023-02-02 16:09:24 +08:00
|
|
|
|
}
|
|
|
|
|
|
},
|
2023-02-03 10:29:14 +08:00
|
|
|
|
computed: {
|
|
|
|
|
|
...mapState(['user'])
|
|
|
|
|
|
},
|
2023-02-02 16:09:24 +08:00
|
|
|
|
methods: {
|
2023-02-03 10:29:14 +08:00
|
|
|
|
getList() {
|
|
|
|
|
|
this.$http.post(`/api/appwechatsigninfo/listByWxUserId?current=${this.current}`).then(res=> {
|
|
|
|
|
|
if(res?.data?.records) {
|
|
|
|
|
|
this.signlist = res.data.records
|
|
|
|
|
|
}
|
|
|
|
|
|
})
|
|
|
|
|
|
},
|
|
|
|
|
|
// 今天的签到状态
|
|
|
|
|
|
getToday() {
|
|
|
|
|
|
this.$http.post(`/api/appwechatsigninfo/queryNowDetail`).then(res=> {
|
|
|
|
|
|
if(res?.data) {
|
|
|
|
|
|
this.status = res.data.status
|
|
|
|
|
|
}
|
|
|
|
|
|
})
|
|
|
|
|
|
},
|
|
|
|
|
|
// 签到
|
|
|
|
|
|
signIn() {
|
|
|
|
|
|
if(this.status == 1) return
|
|
|
|
|
|
|
|
|
|
|
|
this.$http.post(`/api/appwechatsigninfo/sign`).then(res=> {
|
|
|
|
|
|
if(res.code == 0) {
|
|
|
|
|
|
this.$confirm('签到成功!').then(() => {
|
|
|
|
|
|
this.getToday()
|
|
|
|
|
|
this.getList()
|
|
|
|
|
|
})
|
|
|
|
|
|
}
|
|
|
|
|
|
}).finally(err=> console.log(err))
|
|
|
|
|
|
}
|
|
|
|
|
|
},
|
|
|
|
|
|
onReachBottom() {
|
|
|
|
|
|
this.current++
|
|
|
|
|
|
this.getList()
|
2023-02-02 16:09:24 +08:00
|
|
|
|
},
|
|
|
|
|
|
onShow() {
|
|
|
|
|
|
document.title = '签到'
|
2023-02-03 10:29:14 +08:00
|
|
|
|
this.getToday()
|
|
|
|
|
|
this.getList()
|
2023-02-02 16:09:24 +08:00
|
|
|
|
setInterval(() => {
|
|
|
|
|
|
this.time = dayjs(new Date()).format('HH:mm:ss')
|
|
|
|
|
|
}, 1000)
|
|
|
|
|
|
}
|
|
|
|
|
|
}
|
|
|
|
|
|
</script>
|
|
|
|
|
|
|
|
|
|
|
|
<style lang="scss" scoped>
|
|
|
|
|
|
.AppSignIn {
|
|
|
|
|
|
padding: 100px 32px 420px 32px;
|
|
|
|
|
|
box-sizing: border-box;
|
|
|
|
|
|
|
|
|
|
|
|
.title {
|
|
|
|
|
|
font-weight: 600;
|
|
|
|
|
|
font-size: 28px;
|
|
|
|
|
|
color: #333333;
|
|
|
|
|
|
width: 100%;
|
|
|
|
|
|
height: 100px;
|
|
|
|
|
|
line-height: 100px;
|
|
|
|
|
|
padding-left: 32px;
|
|
|
|
|
|
box-sizing: border-box;
|
|
|
|
|
|
background: #F5F5F5;
|
|
|
|
|
|
position: fixed;
|
|
|
|
|
|
top: 0;
|
|
|
|
|
|
left: 0;
|
|
|
|
|
|
z-index: 9;
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
.sign_list {
|
|
|
|
|
|
.sign_card {
|
|
|
|
|
|
display: flex;
|
|
|
|
|
|
background: #FFFFFF;
|
|
|
|
|
|
padding: 24px;
|
|
|
|
|
|
box-sizing: border-box;
|
|
|
|
|
|
box-shadow: 0 0 8px 0 rgba(0,0,0,0.02);
|
|
|
|
|
|
border-radius: 16px;
|
|
|
|
|
|
margin-bottom: 24px;
|
|
|
|
|
|
|
|
|
|
|
|
.sign_left {
|
|
|
|
|
|
align-self: center;
|
|
|
|
|
|
font-weight: 600;
|
|
|
|
|
|
font-size: 40rpx;
|
|
|
|
|
|
color: #333333;
|
|
|
|
|
|
margin-right: 32px;
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
.sign_right {
|
|
|
|
|
|
font-weight: 400;
|
|
|
|
|
|
font-size: 26px;
|
|
|
|
|
|
color: #333333;
|
|
|
|
|
|
|
|
|
|
|
|
.tips {
|
|
|
|
|
|
color: #999999;
|
|
|
|
|
|
margin-top: 8px;
|
|
|
|
|
|
}
|
|
|
|
|
|
}
|
|
|
|
|
|
}
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
.sign_btn {
|
|
|
|
|
|
position: relative;
|
|
|
|
|
|
width: 100%;
|
|
|
|
|
|
height: 400px;
|
|
|
|
|
|
position: fixed;
|
|
|
|
|
|
bottom: 0;
|
|
|
|
|
|
left: 0;
|
|
|
|
|
|
background: #F5F5F5;
|
|
|
|
|
|
box-shadow: 0 -4px 8px 0 rgba(0,0,0,0.02);
|
|
|
|
|
|
z-index: 9;
|
|
|
|
|
|
|
|
|
|
|
|
.btn {
|
|
|
|
|
|
position: absolute;
|
|
|
|
|
|
left: 50%;
|
|
|
|
|
|
top: 50%;
|
|
|
|
|
|
transform: translate(-50%, -50%);
|
|
|
|
|
|
width: 240px;
|
|
|
|
|
|
height: 240px;
|
|
|
|
|
|
text-align: center;
|
2023-02-03 10:29:14 +08:00
|
|
|
|
background-image: linear-gradient(180deg, #75BDFF 0%, #4783FF 100%);
|
2023-02-02 16:09:24 +08:00
|
|
|
|
border: 8px solid #FFFFFF;
|
|
|
|
|
|
box-shadow: 0 8px 12px -4px rgba(133,196,255,0.65);
|
|
|
|
|
|
border-radius: 50%;
|
|
|
|
|
|
color: #FFFFFF;
|
|
|
|
|
|
|
|
|
|
|
|
& > div:first-child {
|
|
|
|
|
|
font-weight: 500;
|
|
|
|
|
|
font-size: 40px;
|
|
|
|
|
|
margin-top: 72px;
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
& > div:last-child {
|
|
|
|
|
|
margin-top: 10px;
|
|
|
|
|
|
font-weight: 400;
|
|
|
|
|
|
font-size: 28px;
|
|
|
|
|
|
}
|
|
|
|
|
|
}
|
2023-02-03 10:29:14 +08:00
|
|
|
|
|
|
|
|
|
|
.active {
|
|
|
|
|
|
background-image: linear-gradient(180deg, #bcff75 0%, hsl(132, 87%, 30%) 100%);
|
|
|
|
|
|
}
|
|
|
|
|
|
}
|
2023-02-02 16:09:24 +08:00
|
|
|
|
}
|
|
|
|
|
|
</style>
|