dev01 1 yıl önce
ebeveyn
işleme
a6f2762cb0

+ 3 - 3
src/pages/detail/index.jsx

@@ -34,9 +34,9 @@ class Detail extends Component {
     this.getReleasetDails = this.getReleasetDails.bind(this);
   }
 
-  componentDidMount() {
-    this.getReleasetDails();
-  }
+  // componentDidMount() {
+  //   this.getReleasetDails();
+  // }
 
   componentDidShow() {
     this.setState({

+ 8 - 8
src/pages/mybusiness/index.jsx

@@ -59,9 +59,9 @@ class Examine extends Component {
     this.getPublicReleaseList();
   }
 
-  async componentDidMount() {
-    await this.getPublicReleaseList();
-  }
+  // async componentDidMount() {
+  //   await this.getPublicReleaseList();
+  // }
 
   onPullDownRefresh() {
     this.getPublicReleaseList();
@@ -71,11 +71,11 @@ class Examine extends Component {
     this.getPublicReleaseList(true);
   }
 
-  onTabItemTap(obj) {
-    if (obj.index === 1) {
-      this.onTabTap();
-    }
-  }
+  // onTabItemTap(obj) {
+  //   if (obj.index === 1) {
+  //     this.onTabTap();
+  //   }
+  // }
 
   async onTabTap() {
     await this.getMyList(1);

+ 9 - 9
src/pages/project/index.jsx

@@ -29,7 +29,7 @@ class Project extends Component {
     this.state = {
       typeList: [
         { title: '全部', type: 1 },
-        { title: '我创建', type: 2 },
+        // { title: '我创建', type: 2 },
         // { title: '我参与', type: 3 }
       ],
       current: 0,
@@ -47,9 +47,9 @@ class Project extends Component {
     this.getProjectList();
   }
 
-  async componentDidMount() {
-    await this.getProjectList();
-  }
+  // async componentDidMount() {
+  //   await this.getProjectList();
+  // }
 
   onPullDownRefresh() {
     this.getProjectList();
@@ -59,11 +59,11 @@ class Project extends Component {
     this.getProjectList(true);
   }
 
-  onTabItemTap(obj) {
-    if (obj.index === 1) {
-      this.onTabTap();
-    }
-  }
+  // onTabItemTap(obj) {
+  //   if (obj.index === 1) {
+  //     this.onTabTap();
+  //   }
+  // }
 
 
   async onTabTap() {

+ 3 - 3
src/pages/projectDetail/index.jsx

@@ -28,9 +28,9 @@ class ProjectDetail extends Component {
     this.getProjectDetail = this.getProjectDetail.bind(this);
   }
 
-  componentDidMount() {
-    this.getProjectDetail();
-  }
+  // componentDidMount() {
+  //   this.getProjectDetail();
+  // }
 
   componentDidShow() {
     this.getProjectDetail();

+ 4 - 29
src/pages/punchClock/index.jsx

@@ -1,45 +1,23 @@
 import React, { Component } from "react";
 import PunchClocks from './punchClocks';
 import UserFloatingLayer from "../../components/common/userFloatingLayer";
-import { AtModal, } from "taro-ui"
-import Taro from "@tarojs/taro";
-import { updateLocation } from '../../utils/servers/servers';
 
 class PunchClock extends Component {
   constructor(props) {
     super(props);
     this.state = {
-      data: {},
-      isOpened: false,
-      isHome: false,
+
     }
-    this.onClose = this.onClose.bind(this);
 
   }
 
   componentDidShow() {
-
-  }
-
-  onClose() {
-    this.setState({
-      data: {},
-      isOpened: false,
-      isHome: false,
-    })
-  }
-
-  getId(id, uid) {
-    this.setState({ id, uid })
-  }
-  // 判断是否是首页打卡切换位置
-  getHome() {
-    this.setState({ isHome: true })
+    this.clockRef.onmyDuration()
   }
 
 
   componentDidMount() {
-    Taro.eventCenter.trigger('GoPuncsshIn', { data: 'unread' })
+
   }
 
 
@@ -47,10 +25,7 @@ class PunchClock extends Component {
     return (
       <>
         <UserFloatingLayer />
-        <PunchClocks
-          getId={this.getId.bind(this)}
-          getHome={this.getHome.bind(this)}
-        />
+        <PunchClocks onRef={ref => this.clockRef = ref} />
       </>
     )
   }

+ 5 - 28
src/pages/punchClock/punchClocks.jsx

@@ -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>