[更新发现]

This commit is contained in:
zhangmanman
2022-01-13 13:56:32 +08:00
parent 9af54bc24a
commit c82f40ee09
27 changed files with 1274 additions and 295 deletions

View File

@@ -2,74 +2,80 @@
<view class="content">
<image class="setting" src="/static/find/sign_img.png" mode="widthFix"></image>
<view class="sign">
<!-- <view class="signTitle">
记得每日要签到哦
</view> -->
<view class="signAdd">
<view class="label">
<image class="picture" src="/static/find/sign.png" mode="aspectFill"></image>
<view class="day">
<view class="label-day">
<view class="number">
<text>10</text>
<text>{{ dateData.total }}</text>
</view>
本月签到
</view>
</view>
<view class="label">
<image class="picture" src="/static/find/sign_active.png" mode="aspectFill"></image>
<view class="day">
<view class="label-day">
<view class="number">
<text>1</text>
<text>{{ dateData.continue }}</text>
</view>
本月漏签
累计签到
</view>
</view>
</view>
<view class="signDate">
<view class="date">
2020-01-07
{{ dateData.month }}
</view>
<view class="list">
<view class="day">
1
<view class="week">
<view class="week-label">
</view>
<view class="week-label">
</view>
<view class="week-label">
</view>
<view class="week-label">
</view>
<view class="week-label">
</view>
<view class="week-label">
</view>
<view class="week-label">
</view>
</view>
<view class="day">
2
</view>
<view class="day">
3
</view>
<view class="day">
4
</view>
<view class="day">
5
</view>
<view class="day">
6
</view>
<view class="day">
7
</view>
<view class="day">
8
<view class="day" v-for="(item, index) in dateArr">
<view class="day-label" v-for="(items, index) in item">
<view class="label-block" :class="{active : items.isSign}" v-if="!items.isHidden">{{ items.isSign ? '' : items.date }}</view>
</view>
</view>
</view>
<view class="signBtn">
<view class="btn">
立即签到
<view class="btn" @click="signClick" :class="{active : dateData.isSign}">
{{ dateData.isSign ? '当日已签' : '立即签到'}}
</view>
</view>
</view>
<view class="tipsText">
ZH大健康用户签到
</view>
</view>
</view>
</template>
<script>
import { date } from '@/apis/interfaces/sign'
import { date, sign } from '@/apis/interfaces/sign'
export default {
data() {
return {
dateData: '',
dateArr : ''
}
},
mounted() {
@@ -79,7 +85,8 @@
// 用户登录
dateList() {
date().then(res => {
console.log(res)
this.dateData = res.base
this.dateArr = res.calendar
}).catch(err => {
uni.showToast({
title: err.message,
@@ -87,6 +94,23 @@
})
})
},
// 签到
signClick() {
sign().then(res => {
console.log(res)
uni.showToast({
title: '签到成功',
icon: "none"
})
this.dateList();
}).catch(err => {
uni.showToast({
title: err.message,
icon: "none"
})
})
}
}
}
</script>
@@ -125,20 +149,12 @@
.label {
display: flex;
font-size: $title-size-sm;
&:first-child {
flex: 1;
.day {
text {
color: $main-color;
}
}
}
.picture {
width: 74rpx;
height: 74rpx;
margin-right: $margin - 10;
}
.day {
.label-day {
color: $text-gray;
text {
font-size: $title-size-lg;
@@ -147,6 +163,14 @@
padding-right: $padding - 20;
}
}
&:first-child {
flex: 1;
.label-day {
text {
color: $main-color;
}
}
}
}
}
.signDate {
@@ -158,13 +182,40 @@
font-size: $title-size + 6;
margin-bottom: $margin;
font-weight: 600;
}
.list {
}
.list {
.week {
display: flex;
.week-label {
text-align: center;
font-size: $title-size-m;
width: 14.28%;
margin: $margin - 10 0;
}
display: flex;
.day {
width: 14.28%;
text-align: center;
}
.day {
flex-wrap: wrap;
display: flex;
.day-label {
width: 14.28%;
text-align: center;
line-height: 80rpx;
color: $text-color;
font-size: $title-size-m;
.label-block {
display: inline-block;
background-color: transparent;
color: $text-gray-m;
border-radius: 50%;
width: 56rpx;
height: 56rpx;
line-height: 56rpx;
text-align: center;
&.active {
background-color: $main-color;
color: white;
border-radius: 50%;
}
}
}
}
@@ -176,7 +227,18 @@
color: white;
background-color: $text-price;
text-align: center;
border-radius: $radius-m;
line-height: 90rpx;
&.active {
background-color: #ededed;
color: $text-gray;
}
}
}
}
.tipsText {
text-align: center;
line-height: 120rpx;
font-size: $title-size-sm;
color: $text-gray-m;