Leon 1 年之前
父節點
當前提交
d9e27e689f

+ 1 - 0
ios/hola.xcodeproj/project.pbxproj

@@ -603,6 +603,7 @@
 				ENABLE_STRICT_OBJC_MSGSEND = YES;
 				ENABLE_TESTABILITY = YES;
 				EXCLUDED_ARCHS = "arm64 arm64e";
+				"EXCLUDED_ARCHS[sdk=iphonesimulator*]" = "";
 				GCC_C_LANGUAGE_STANDARD = gnu99;
 				GCC_DYNAMIC_NO_PIC = NO;
 				GCC_NO_COMMON_BLOCKS = YES;

+ 9 - 1
src/features/trackTimeDuration/components/DayNightCard.tsx

@@ -367,7 +367,15 @@ export default function DayNightCard(props: { isNight: boolean, count: number })
         var tomorrow = new Date(today.getTime() + 24 * 3600 * 1000 * 3)
         var strYesterday = `${yesterday.getFullYear()}-${TimeFormatter.padZero(yesterday.getMonth() + 1)}-${TimeFormatter.padZero(yesterday.getDate())}`
         var strTomorrow = `${tomorrow.getFullYear()}-${TimeFormatter.padZero(tomorrow.getMonth() + 1)}-${TimeFormatter.padZero(tomorrow.getDate())}`
-
+        systemLocation({
+            lat: 77,
+            lng: 20,
+            date_start: strYesterday,
+            date_end: strTomorrow,
+            coordinate_system_standard: 'GCJ-02'
+        }).then(data => {
+        })
+        return
 
         if (process.env.TARO_ENV == 'rn') {
             Taro.getLocation({

+ 9 - 0
src/features/trackTimeDuration/components/RecordFastSleep.tsx

@@ -553,6 +553,9 @@ const RecordFastSleep = memo((props: { data: any, type: string, index: number })
     }
 
     function touchStart(e) {
+        if (process.env.TARO_ENV=='rn'){
+            return
+        }
         startX = e.touches[0].clientX
         startY = e.touches[0].clientY
         setDisableDismiss(true)
@@ -560,6 +563,9 @@ const RecordFastSleep = memo((props: { data: any, type: string, index: number })
     }
 
     function touchMove(e) {
+        if (process.env.TARO_ENV=='rn'){
+            return
+        }
         let x = startX
         let y = startY
         let deltaX = e.touches[0].clientX - x
@@ -583,6 +589,9 @@ const RecordFastSleep = memo((props: { data: any, type: string, index: number })
     }
 
     function touchEnd(e) {
+        if (process.env.TARO_ENV=='rn'){
+            return
+        }
         startX = 0
         setDisableDismiss(false)
     }

+ 39 - 30
src/features/trackTimeDuration/components/WeekCalendar.tsx

@@ -1,6 +1,6 @@
 import { View, ScrollView, Text } from "@tarojs/components";
 import './WeekCalendar.scss'
-import { useEffect, useState, useMemo, memo } from "react";
+import { useEffect, useState, useMemo, memo, useRef } from "react";
 import { ColorType } from "@/context/themes/color";
 import WeekCalendarItem from "./WeekCalendarItem";
 import { rpxToPx } from "@/utils/tools";
@@ -24,6 +24,7 @@ const WeekCalendar = memo(() => {
     const [left, setLeft] = useState(0)
     const [isLoading, setIsLoading] = useState(false)
     const { t } = useTranslation()
+    const ref = useRef(null)
     const pageSize = 34
 
     useEffect(() => {
@@ -82,7 +83,12 @@ const WeekCalendar = memo(() => {
                 setCalendarData(list[list.length - 1])
                 setMinTime((res as any).extra.real_start_time_min)
                 setLeft((list.length - 1) * parseInt(rpxToPx(658) + ''))
-                setIsLoading(false)
+                setIsLoading(false);
+                if (ref.current) {
+                    (ref.current as any).scrollTo({
+                        x: (list.length - 1) * parseInt(rpxToPx(658) + ''), y: 0, animated: false
+                    });
+                }
             }
             else {
                 var array = list.concat(calendars)
@@ -102,6 +108,7 @@ const WeekCalendar = memo(() => {
                 setSummary(array[current + list.length].summary_stats ? array[current + list.length].summary_stats : null)
                 setCalendarData(array[current + list.length])
                 setLeft((current + list.length - 1) * parseInt(rpxToPx(658) + ''))
+                console.log('sssssss')
                 setIsLoading(false)
                 clearInterval(timer);
                 timer = null;
@@ -118,7 +125,7 @@ const WeekCalendar = memo(() => {
     }
 
     function onScroll(e) {
-        if (!fingerDrag) return
+        if (!fingerDrag && process.env.TARO_ENV == 'weapp') return
         isScrolling = true
         var x = e.detail.scrollLeft + 5
         // var page = parseInt(x / parseInt(rpxToPx(658) + '') + '')
@@ -172,33 +179,35 @@ const WeekCalendar = memo(() => {
                     bottom: parseInt(rpxToPx(60) + ''),
                     width: parseInt(rpxToPx(658) + ''),
                 }} />
-                <ScrollView
-                    // className="chart_scroll"
-                    style={{
-                        marginLeft: parseInt(rpxToPx(46) + ''),
-                        width: parseInt(rpxToPx(658) + ''),
-                        height: parseInt(rpxToPx(520) + ''),
-                        flexDirection: 'row', display: 'flex',
-                    }}
-                    onScroll={onScroll}
-                    onDragEnd={dragEnd}
-                    onDragStart={dragStart}
-                    scrollLeft={left}
-                    scrollX pagingEnabled={true}
-                    enableFlex enhanced>
-                    {
-                        calendars.map((item, index) => {
-                            // return <View style={{width: parseInt(rpxToPx(658) + ''),
-                            // height: parseInt(rpxToPx(520) + ''),backgroundColor:'red',flexShrink:0}}><Text style={{color:'#fff'}}>{index}</Text></View>
-
-                            // // 
-                            if (index == current || index == current - 1 || index == current + 1)
-                                return <WeekCalendarItem data={item} key={index} isCurrentWeek={index == calendars.length - 1} />
-                            return <View style={{ width: parseInt(rpxToPx(658) + ''), flexShrink: 0 }} />
-                        })
-                    }
-
-                </ScrollView>
+                <View>
+                    <ScrollView
+                        style={{
+                            marginLeft: parseInt(rpxToPx(46) + ''),
+                            width: parseInt(rpxToPx(658) + ''),
+                            height: parseInt(rpxToPx(520) + ''),
+                            flexDirection: 'row', display: 'flex',
+
+                        }}
+                        ref={ref}
+                        showScrollbar={false}
+                        onScroll={onScroll}
+                        onDragEnd={dragEnd}
+                        onDragStart={dragStart}
+                        scrollLeft={left}
+                        scrollX pagingEnabled={true}
+                        showsHorizontalScrollIndicator={false}
+                        enableFlex enhanced>
+                        {
+                            calendars.map((item, index) => {
+
+                                if (index == current || index == current - 1 || index == current + 1)
+                                    return <WeekCalendarItem data={item} key={index} isCurrentWeek={index == calendars.length - 1} />
+                                return <View style={{ width: parseInt(rpxToPx(658) + ''), flexShrink: 0 }} />
+                            })
+                        }
+
+                    </ScrollView>
+                </View>
                 <View className="chart_times" style={{ marginTop: parseInt(rpxToPx(60) + ''), marginBottom: parseInt(rpxToPx(60) + '') }}>
                     <Text className="chart_times_txt" style={{ left: 0, top: 0 }}>12:00</Text>
                     <Text className="chart_times_txt" style={{ left: 0, top: parseInt(rpxToPx(100 - 7) + '') }}>18:00</Text>

+ 1 - 1
src/pages/clock/Clock.tsx

@@ -664,7 +664,7 @@ export default function Page() {
                 }
 
                 {
-                    user.isLogin && !showErrorPage && process.env.TARO_ENV == 'weapp' && <View style={{ marginTop: rpxToPx(60), display: 'flex', flexDirection: 'column' }}>
+                    user.isLogin && !showErrorPage  && <View style={{ marginTop: rpxToPx(60), display: 'flex', flexDirection: 'column' }}>
                         <Text className="discovery1" >周统计</Text>
                         <WeekCalendar />
                     </View>