|
|
@ -1,13 +1,13 @@ |
|
|
|
<template> |
|
|
|
<view class="pageBg pad"> |
|
|
|
<zeng-calen :actDay="actDay" :chooseDayLack="chooseDayLack" @onDayClick='onDayClick' :chooseDay="chooseDay"></zeng-calen> |
|
|
|
<zeng-calen :actDay="actDay" :chooseDayLack="chooseDayLack" @onDayClick='onDayClick' @changeMonth="changeMonth" :chooseDay="chooseDay"></zeng-calen> |
|
|
|
<view class="btnBg" style="margin: 20rpx 0;" @click="scanCodeClick">去签到/去签退</view> |
|
|
|
<view class="card"> |
|
|
|
<view class="card" v-if="list.length"> |
|
|
|
<view class="h1"><text class="active">签到记录</text></view> |
|
|
|
<view class="ul"> |
|
|
|
<view class="li" v-for="(item,index) in 4" :key="index"> |
|
|
|
<view class="lab">{{ index%2==0? '签退成功':'签到成功'}}</view> |
|
|
|
<view class="date">2024-01-29 11:29</view> |
|
|
|
<view class="li" v-for="(item,index) in list" :key="index"> |
|
|
|
<view class="lab">{{ item.loginStatus==1? '签退成功':'签到成功'}}</view> |
|
|
|
<view class="date">{{item.signDate}} <text style="margin-left: 10rpx;">{{ item.time }}</text></view> |
|
|
|
</view> |
|
|
|
</view> |
|
|
|
</view> |
|
|
@ -17,6 +17,7 @@ |
|
|
|
<script> |
|
|
|
import zengCalen from '@/uni_modules/zeng-calen/components/zeng-calen/zeng-calen' |
|
|
|
import { scanCodeFn } from '@/config/utils.js' |
|
|
|
import { monthSignRecord, signDetail } from '@/config/api.js' |
|
|
|
export default { |
|
|
|
components: {zengCalen}, |
|
|
|
data() { |
|
|
@ -24,31 +25,37 @@ |
|
|
|
actDay: [], //用户选择的日期 |
|
|
|
chooseDay: ["2024-01-29", "2024-01-27", "2024-01-19", "2024-01-10"], //已被投标的数据 |
|
|
|
chooseDayLack: ["2024-01-29", ], //已被投标的数据 |
|
|
|
list: [], |
|
|
|
signMonth: '' |
|
|
|
} |
|
|
|
}, |
|
|
|
onLoad() { |
|
|
|
|
|
|
|
this.signMonth = this.$u.timeFormat(Date.now(), 'yyyy-mm') |
|
|
|
this.monthSignRecordFn() |
|
|
|
}, |
|
|
|
methods: { |
|
|
|
// 按月查询签到天数 |
|
|
|
async monthSignRecordFn() { |
|
|
|
const {data: res} = await monthSignRecord({signMonth: this.signMonth}) |
|
|
|
this.chooseDay = res |
|
|
|
if(res&&res.length) { |
|
|
|
let day = res[res.length-1] |
|
|
|
this.actDay = [day] |
|
|
|
this.onDayClick(day) |
|
|
|
} |
|
|
|
}, |
|
|
|
changeMonth(ym) { |
|
|
|
console.log(ym) |
|
|
|
this.signMonth = ym |
|
|
|
this.monthSignRecordFn(ym) |
|
|
|
this.list = [] |
|
|
|
}, |
|
|
|
// 展开日历 |
|
|
|
onDayClick(data) { |
|
|
|
async onDayClick(data) { |
|
|
|
this.actDay = [data] |
|
|
|
return |
|
|
|
// let choose = data.date //用户点中的数据 |
|
|
|
// if (this.actDay.includes(choose)) { //如果用户点击的日期已经存在 |
|
|
|
// // 移除元素下标 |
|
|
|
// const index = this.actDay.indexOf(choose); |
|
|
|
// //删除用户点击的日期 |
|
|
|
// this.actDay.splice(index, 1) |
|
|
|
// } else if (this.chooseDay.includes(choose)) { //判断是否已经被投标 |
|
|
|
// uni.showToast({ |
|
|
|
// title: "这个日期已经被投标了", |
|
|
|
// icon: "none" |
|
|
|
// }) |
|
|
|
// } else { |
|
|
|
// //添加用户点击的日期 |
|
|
|
// this.actDay.push(choose) |
|
|
|
// } |
|
|
|
const {data: res} = await signDetail({signDate: data}) |
|
|
|
this.list = res || [] |
|
|
|
|
|
|
|
}, |
|
|
|
// 扫码 |
|
|
|
scanCodeClick() { |
|
|
|