|
|
@@ -0,0 +1,144 @@
|
|
|
+<template>
|
|
|
+ <view class="sign-in-container">
|
|
|
+ <view class="sign-in-header">
|
|
|
+ <text class="sign-in-title">签到领积分</text>
|
|
|
+ </view>
|
|
|
+ <view class="sign-in-days">
|
|
|
+ <view
|
|
|
+ v-for="(day, index) in signDays"
|
|
|
+ :key="index"
|
|
|
+ class="sign-day"
|
|
|
+ @click="handleSign(day, index)"
|
|
|
+ >
|
|
|
+ <view class="sign-day-circle" :class="getSignCircleClass(day)">
|
|
|
+ <image src="@/static/points/Signed.png" v-if="day.status === '1'"></image>
|
|
|
+ <image src="@/static/points/notSigned.png" v-else></image>
|
|
|
+ <text class="sign-day-number" v-if="day.status === ''">+{{ day.point }}</text>
|
|
|
+ </view>
|
|
|
+ <text :class="day.status === '1' ? 'sign-day-text' : 'day-text'">{{ getSignText(day) }}</text>
|
|
|
+ </view>
|
|
|
+ </view>
|
|
|
+ </view>
|
|
|
+</template>
|
|
|
+
|
|
|
+<script>
|
|
|
+import Image from "@/components/swiper/components/image.vue";
|
|
|
+
|
|
|
+export default {
|
|
|
+ components: {Image},
|
|
|
+ props: {
|
|
|
+ signData: {
|
|
|
+ type: Array,
|
|
|
+ default: () => []
|
|
|
+ }
|
|
|
+ },
|
|
|
+ data() {
|
|
|
+ return {
|
|
|
+ signDays: [
|
|
|
+ { day: '2.09', status: '1',point:'1' },
|
|
|
+ { day: '2.10', status: '0' ,point:'2' },
|
|
|
+ { day: '2.11', status: 'signed',point:'3' },
|
|
|
+ { day: '2.12', status: '',point:'1' },
|
|
|
+ { day: '2.13', status: '',point:'2' },
|
|
|
+ { day: '2.14', status: '',point:'5' },
|
|
|
+ { day: '2.15', status: '',point:'1' },
|
|
|
+ ]
|
|
|
+ }
|
|
|
+ },
|
|
|
+ methods: {
|
|
|
+ getSignCircleClass(day) {
|
|
|
+ return {
|
|
|
+ 'signed-circle': day.status === '1',
|
|
|
+ 'select-circle': day.status === 'signed'
|
|
|
+ }
|
|
|
+ },
|
|
|
+ getSignText(day) {
|
|
|
+ if (day.status === '1') return '已签到'
|
|
|
+ if (day.status === '0') return '未签到'
|
|
|
+ return day.day
|
|
|
+ },
|
|
|
+ handleSign(day, index) {
|
|
|
+ if (day.status === 'today') {
|
|
|
+ // 处理签到逻辑
|
|
|
+ this.$emit('sign', index)
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+}
|
|
|
+</script>
|
|
|
+
|
|
|
+<style lang="scss" scoped>
|
|
|
+.sign-in-container {
|
|
|
+ background-color: #fff;
|
|
|
+ border-radius: 20rpx;
|
|
|
+ padding: 24rpx;
|
|
|
+ margin-bottom: 24rpx;
|
|
|
+ box-shadow: 0 2rpx 12rpx rgba(0, 0, 0, 0.08);
|
|
|
+
|
|
|
+ .sign-in-header {
|
|
|
+ margin-bottom: 26rpx;
|
|
|
+
|
|
|
+ .sign-in-title {
|
|
|
+ font-size: 32rpx;
|
|
|
+ font-weight: 600;
|
|
|
+ color: #333;
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
+ .sign-in-days {
|
|
|
+ display: flex;
|
|
|
+ justify-content: space-between;
|
|
|
+ align-items: center;
|
|
|
+
|
|
|
+ .sign-day {
|
|
|
+ display: flex;
|
|
|
+ flex-direction: column;
|
|
|
+ align-items: center;
|
|
|
+
|
|
|
+ .sign-day-circle {
|
|
|
+ width: 80rpx;
|
|
|
+ height: 96rpx;
|
|
|
+ background: #FBF2E1;
|
|
|
+ border-radius: 12rpx;
|
|
|
+ display: flex;
|
|
|
+ justify-content: center;
|
|
|
+ align-items: center;
|
|
|
+ margin-bottom: 16rpx;
|
|
|
+ position: relative;
|
|
|
+ image{
|
|
|
+ width: 60rpx;
|
|
|
+ height: 74rpx;
|
|
|
+ }
|
|
|
+
|
|
|
+ &.signed-circle {
|
|
|
+ background: #F5F5F5;
|
|
|
+ }
|
|
|
+
|
|
|
+ &.select-circle {
|
|
|
+ background: #FFEBC7;
|
|
|
+ }
|
|
|
+
|
|
|
+ .sign-day-number {
|
|
|
+ font-size: 14rpx;
|
|
|
+ color: #282100;
|
|
|
+ position: absolute;
|
|
|
+ top: 34rpx;
|
|
|
+ }
|
|
|
+ }
|
|
|
+ .sign-day-text{
|
|
|
+ font-family: PingFang SC, PingFang SC;
|
|
|
+ font-weight: 500;
|
|
|
+ font-size: 24rpx;
|
|
|
+ color: #999999;
|
|
|
+ }
|
|
|
+
|
|
|
+ .day-text {
|
|
|
+ font-family: PingFang SC, PingFang SC;
|
|
|
+ font-weight: 500;
|
|
|
+ font-size: 24rpx;
|
|
|
+ color: #333333;
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+}
|
|
|
+</style>
|