Update AppSignIn.vue

This commit is contained in:
刘仕伟
2023-02-10 17:57:44 +00:00
parent 07cb5f23e0
commit 190a164421

View File

@@ -7,7 +7,7 @@
</div> </div>
<div class="avatar_info"> <div class="avatar_info">
<div class="avatar_name">{{ user.name }}</div> <div class="avatar_name">{{ user.name }}</div>
<div class="avatar_time">每天需要完成2次打卡打卡间隔4小时以上才算完成打卡任务</div> <div class="avatar_time">{{ today }}</div>
</div> </div>
</div> </div>
<div class="title">打卡记录</div> <div class="title">打卡记录</div>
@@ -19,14 +19,13 @@
<div class="time">{{ item.createDate }}</div> <div class="time">{{ item.createDate }}</div>
<div class="tips">打卡成功</div> <div class="tips">打卡成功</div>
</div> </div>
<div class="count">打卡{{ item.times}}</div>
</div> </div>
</scroll-view> </scroll-view>
</div> </div>
<div class="sign_btn"> <div class="sign_btn">
<div class="btn" @click="signIn"> <div class="btn" @click="signIn" :class="status==0? '': 'active'">
<div>打卡</div> <div>{{ status==1? '已打卡':'打卡'}}</div>
<div>{{ time }}</div> <div>{{ time }}</div>
</div> </div>
</div> </div>
@@ -42,6 +41,7 @@ export default {
return { return {
time: '', time: '',
today: '', today: '',
status: 0, // 打卡状态0、未打卡1、已打卡
signlist: [], signlist: [],
current: 1, current: 1,
} }
@@ -73,22 +73,16 @@ export default {
}, },
// 打卡 // 打卡
signIn() { signIn() {
if(this.flag) return if(this.status == 1) {
this.flag = true return this.$u.toast("已打卡,请勿重复打卡!")
}
this.$http.post(`/api/appwechatsigninfo/sign`).then(res=> { this.$http.post(`/api/appwechatsigninfo/sign`).then(res=> {
if(res.code == 0) { if(res.code == 0) {
this.flag = false
this.$u.toast(`打卡成功`) this.$u.toast(`打卡成功`)
this.getToday() this.getToday()
this.getList() this.getList()
} else {
this.flag = false
this.$u.toast(res.msg)
} }
}).catch(err=> { }).catch(err=> console.log(err))
this.flag = false
this.$u.toast(err)
})
} }
}, },
onShow() { onShow() {
@@ -106,7 +100,7 @@ export default {
<style lang="scss" scoped> <style lang="scss" scoped>
.AppSignIn { .AppSignIn {
background: url('./img/bg.png') no-repeat; background: url('./img/bg.png') no-repeat;
background-size: 100% auto; background-size: contain;
padding: 32px 32px; padding: 32px 32px;
box-sizing: border-box; box-sizing: border-box;
height: 100vh; height: 100vh;
@@ -121,10 +115,11 @@ export default {
box-sizing: border-box; box-sizing: border-box;
.avatar_img { .avatar_img {
width: 96px; width: 96px;
height: 96px;
img { img {
width: 96px; width: 100%;
height: 96px; height: 100%;
border-radius: 50%; border-radius: 50%;
} }
} }
@@ -188,14 +183,6 @@ export default {
margin-top: 8px; margin-top: 8px;
} }
} }
.count {
margin-left: auto;
align-self: center;
color: #4783FF;
font-weight: 600;
font-size: 36px;
}
} }
} }
@@ -236,6 +223,10 @@ export default {
font-size: 28px; font-size: 28px;
} }
} }
.active {
background-image: linear-gradient(180deg, #bcff75 0%, hsl(132, 87%, 30%) 100%);
}
} }
} }
</style> </style>