|
|
@@ -21,6 +21,7 @@ import ChooseDateTime from "../components/choose_date_time";
|
|
|
import { TimeFormatter } from "@/utils/time_format";
|
|
|
import StatusIndicator, { StatusType } from "../base/status_indicator";
|
|
|
import { t } from "i18next";
|
|
|
+import FollowInfo from "@/_moment/components/follow_info";
|
|
|
|
|
|
let useRoute;
|
|
|
let useNavigation;
|
|
|
@@ -60,7 +61,6 @@ export default function LogTime() {
|
|
|
const [longDuration, setLongDuration] = useState(24)
|
|
|
|
|
|
const [expandIndex, setExpandIndex] = useState(router.params.initIndex ? router.params.initIndex : tapIndex)
|
|
|
- const [chooseDate, setChooseDate] = useState(false)
|
|
|
const [array, setArray] = useState<any>([])
|
|
|
const [errors, setErrors] = useState<any>([])
|
|
|
const [showSuccess, setShowSuccess] = useState(false)
|
|
|
@@ -68,7 +68,6 @@ export default function LogTime() {
|
|
|
const [loaded, setLoaded] = useState(false)
|
|
|
const [autoCheck, setAutoCheck] = useState(false)
|
|
|
const [initCheck, setInitCheck] = useState(router.params.initCheck == '1')
|
|
|
- const [initSeconds, setInitSeconds] = useState(router.params.initCheck == '1') //初始化时,带入打卡时的秒数
|
|
|
const [count, setCount] = useState(0)
|
|
|
|
|
|
const [ignoreCheck, setIgnoreCheck] = useState(false)
|
|
|
@@ -176,7 +175,6 @@ export default function LogTime() {
|
|
|
const { fast, sleep, status } = res
|
|
|
|
|
|
var list: any = []
|
|
|
- debugger
|
|
|
if (isSingle) {
|
|
|
var timeline: any;
|
|
|
var time = dayjs().format('HH:mm')
|
|
|
@@ -599,6 +597,9 @@ export default function LogTime() {
|
|
|
confirm_time: new Date().getTime()
|
|
|
}
|
|
|
}
|
|
|
+ if (router.params.join_id) {
|
|
|
+ params.join_key = router.params.join_id
|
|
|
+ }
|
|
|
if (onlyCheck) {
|
|
|
var dt = new Date().getTime()
|
|
|
params.requestId = dt
|
|
|
@@ -805,6 +806,22 @@ export default function LogTime() {
|
|
|
}
|
|
|
}
|
|
|
|
|
|
+ function cancelAlert(){
|
|
|
+ showAlert({
|
|
|
+ title:'放弃旧的,开始新的?',
|
|
|
+ content:'',
|
|
|
+ showCancel:true,
|
|
|
+ cancelText:'取消',
|
|
|
+ confirmText:'继续',
|
|
|
+ cancel:()=>{
|
|
|
+ console.log('cancel')
|
|
|
+ },
|
|
|
+ confirm:()=>{
|
|
|
+ console.log('confirm')
|
|
|
+ }
|
|
|
+ })
|
|
|
+ }
|
|
|
+
|
|
|
function logItem(index: number, iFast: boolean, iStart: boolean, showLine: boolean) {
|
|
|
const { fast, sleep, status } = data
|
|
|
|
|
|
@@ -1142,6 +1159,29 @@ export default function LogTime() {
|
|
|
return <View />
|
|
|
}
|
|
|
|
|
|
+ function joinContent() {
|
|
|
+ if (router.params.join_id) {
|
|
|
+ const { index, window, is_start, single, join_status } = router.params
|
|
|
+ if (window == 'FAST') {
|
|
|
+ // if (index )
|
|
|
+ if (join_status == 'OG' && getScenario(health.windows, 'FAST').status == 'OG') {
|
|
|
+ return <View onClick={cancelAlert} className="h26" style={{ color: MainColorType.link }}>更多选项</View>
|
|
|
+ }
|
|
|
+ else if (join_status == 'DONE' && getScenario(health.windows, 'FAST').status == 'WFS') {
|
|
|
+ return <View className="h26" style={{ color: MainColorType.link }}>更多选项</View>
|
|
|
+ }
|
|
|
+ }
|
|
|
+ else {
|
|
|
+ if (join_status == 'OG' && getScenario(health.windows, 'SLEEP').status == 'OG') {
|
|
|
+ return <View onClick={cancelAlert} className="h26" style={{ color: MainColorType.link }}>更多选项</View>
|
|
|
+ } else if (join_status == 'DONE' && getScenario(health.windows, 'SLEEP').status == 'WFS') {
|
|
|
+ return <View className="h26" style={{ color: MainColorType.link }}>更多选项</View>
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+ return <View />
|
|
|
+ }
|
|
|
+
|
|
|
if (!loaded) return <View />
|
|
|
|
|
|
return <View className="page_container" style={{ minHeight: '101vh' }}>
|
|
|
@@ -1199,6 +1239,11 @@ export default function LogTime() {
|
|
|
justifyContent: 'center'
|
|
|
}}>{expectText()}</View>
|
|
|
}
|
|
|
+ {
|
|
|
+ router.params.join_id && <FollowInfo />
|
|
|
+ }
|
|
|
+
|
|
|
+
|
|
|
<View style={{ flex: 1 }} />
|
|
|
{/* <View style={{ marginBottom: rpxToPx(128), display: 'flex', alignItems: 'center', justifyContent: 'center' }}>
|
|
|
<NewButton
|
|
|
@@ -1211,7 +1256,11 @@ export default function LogTime() {
|
|
|
bold={true}
|
|
|
onClick={() => tapCommit(false)} />
|
|
|
</View> */}
|
|
|
+
|
|
|
<View className="main_footer">
|
|
|
+ {
|
|
|
+ joinContent()
|
|
|
+ }
|
|
|
<NewButton
|
|
|
color={footerBtnColor()}
|
|
|
type={NewButtonType.fill}
|