|
@@ -1,6 +1,6 @@
|
|
|
import React, { Component } from 'react'
|
|
|
import { connect } from 'react-redux'
|
|
|
-import { Input, Textarea, View, Text, Picker, Button, Image } from '@tarojs/components'
|
|
|
+import { Input, View, Text, Picker, Button, Image } from '@tarojs/components'
|
|
|
import Taro from '@tarojs/taro';
|
|
|
import {
|
|
|
AtButton, AtModal, AtModalContent, AtModalAction, AtTextarea
|
|
@@ -66,6 +66,7 @@ class PunchClocks extends Component {
|
|
|
nowTime = null;
|
|
|
|
|
|
componentDidMount() {
|
|
|
+ this.props.onRef && this.props.onRef(this);
|
|
|
this.imagePickerRef && this.imagePickerRef.clear();
|
|
|
this.getInfo()
|
|
|
}
|
|
@@ -78,7 +79,6 @@ class PunchClocks extends Component {
|
|
|
|
|
|
componentWillMount() {
|
|
|
const { year, month } = this.state
|
|
|
-
|
|
|
this.nowTime = setInterval(() => {
|
|
|
this.setState({
|
|
|
nowTime: dayjs().format('HH:mm:ss')
|
|
@@ -95,12 +95,11 @@ class PunchClocks extends Component {
|
|
|
})
|
|
|
}
|
|
|
|
|
|
- componentDidHide() {
|
|
|
-
|
|
|
- }
|
|
|
-
|
|
|
// 剩余打卡时间
|
|
|
onmyDuration() {
|
|
|
+ if (!this.state.data.id) {
|
|
|
+ return
|
|
|
+ }
|
|
|
myDuration({
|
|
|
id: this.state.data.id,
|
|
|
recordTime: this.state.dateSel,
|
|
@@ -196,18 +195,6 @@ class PunchClocks extends Component {
|
|
|
})
|
|
|
}
|
|
|
|
|
|
- refresh() {
|
|
|
- this.getData(() => {
|
|
|
- Taro.startLocationUpdate({
|
|
|
- success: () => {
|
|
|
- Taro.onLocationChange((v) => {
|
|
|
- this.getSpacing(v.latitude, v.longitude)
|
|
|
- })
|
|
|
- }
|
|
|
- })
|
|
|
- });
|
|
|
- }
|
|
|
-
|
|
|
onClose() {
|
|
|
const { clockId } = this.state
|
|
|
this.imagePickerRef && this.imagePickerRef.clear();
|
|
@@ -299,16 +286,6 @@ class PunchClocks extends Component {
|
|
|
|
|
|
<View className='item'>
|
|
|
<View className='ititle'><Text style={{ color: "red", width: "7px" }}>*</Text>研发时间:
|
|
|
- {/* <Picker mode='date'
|
|
|
- onChange={e => {
|
|
|
- this.setState({
|
|
|
- dateSel: e.detail.value
|
|
|
- })
|
|
|
- }}>
|
|
|
- <View className='picker'>
|
|
|
- {!!this.state.dateSel ? this.state.dateSel : "请选择"}
|
|
|
- </View>
|
|
|
- </Picker> */}
|
|
|
<View className='picker'>
|
|
|
{this.state.dateSel}
|
|
|
</View>
|