Leon преди 1 година
родител
ревизия
46e5c1663b

+ 0 - 3
src/app.tsx

@@ -22,13 +22,10 @@ if (process.env.TARO_ENV == 'rn') {
 
 
 const App: React.FC<PropsWithChildren> = ({ children }) => {
-  // console.log(Intl.DateTimeFormat().resolvedOptions().timeZone)
-  console.log(Taro.getSystemInfoSync().platform)
   if (process.env.TARO_ENV=='rn'){
     // alert(Intl.DateTimeFormat().resolvedOptions().timeZone)
   }
   if (process.env.TARO_ENV == 'weapp') {
-    console.log(Taro.getSystemInfoSync())
     global.isDebug = Taro.getStorageSync('isDebug')
 
     const updateManager = Taro.getUpdateManager()

+ 0 - 4
src/components/input/LimitPickers.tsx

@@ -145,10 +145,6 @@ const Component = forwardRef((props: {
     }
 
     function onPickerEnd(e) {
-        // console.log(e)
-        // console.log(values)
-        // setValues(values)
-        // setCount(count+1)
     }
 
     function cancel(e) {

+ 0 - 7
src/components/input/SlidngScale.tsx

@@ -130,8 +130,6 @@ export default function Component(props: {
 
     const handleScroll = throttle((e) => {
 
-        console.log(e)
-
         update(e)
 
 
@@ -164,8 +162,6 @@ export default function Component(props: {
 
     function dragEnd(e) {
         setIsEnd(true)
-        console.log('end')
-        // setIsDraging(false)
     }
 
     function update(e) {
@@ -214,9 +210,6 @@ export default function Component(props: {
     }
 
     const scrollEnd = (e) => {
-        console.log(e, 'end')
-        // const { scrollLeft } = e.detail;
-        // setLeft(scrollLeft)
     }
 
     function itemContent(data) {

+ 0 - 13
src/components/input/SlidngScale_backup.tsx

@@ -70,13 +70,7 @@ export default function Component(props: {
     }
 
     const handleScroll = throttle((e) => {
-
-        console.log(e)
-
         update(e)
-
-
-
     }, 500);
 
     function touchEnd() {
@@ -102,8 +96,6 @@ export default function Component(props: {
 
     function dragEnd(e) {
         setIsEnd(true)
-        console.log('end')
-        // setIsDraging(false)
     }
 
     function update(e) {
@@ -140,9 +132,6 @@ export default function Component(props: {
     }
 
     const scrollEnd = (e) => {
-        console.log(e, 'end')
-        // const { scrollLeft } = e.detail;
-        // setLeft(scrollLeft)
     }
 
     function itemContent(data) {
@@ -154,8 +143,6 @@ export default function Component(props: {
             }
         </View>
     }
-
-    console.log(isEnd, isDraging)
     return <View className="slidng">
         <View className="number_bg" style={{ opacity: enableText ? 1 : 0.4 }}>
             <Text className="number">{current}</Text>

+ 0 - 1
src/components/input/TimePickers.tsx

@@ -35,7 +35,6 @@ export default function Component(props: { time: string, content: string, change
         setDt(val)
         var strHour = hours[val[0]] < 10 ? '0' + hours[val[0]] : hours[val[0]]
         var strMinute = minutes[val[1]] < 10 ? '0' + minutes[val[1]] : minutes[val[1]]
-        console.log(strHour + ':' + strMinute)
         props.change(strHour + ':' + strMinute)
     }
 

+ 0 - 8
src/custom-tab-bar/index.tsx

@@ -10,14 +10,6 @@ export default function TabBar() {
     const { t } = useTranslation()
     const common = useSelector((state: any) => state.common);
     const [selIndex, setSelIndex] = useState(common.pageIndex)
-    const dispatch = useDispatch();
-    // useEffect(() => {
-    //     console.log('aaa',global.index)
-    //     setSelIndex(global.index?global.index:0)
-    //   }, [global.index])
-    // useEffect(()=>{
-    //     console.log('page 初始化')
-    // },[])
 
     useEffect(()=>{
         setSelIndex(common.pageIndex)

+ 0 - 1
src/features/auth/components/CreatePassword.tsx

@@ -84,7 +84,6 @@ export default function Component(prop: { name?: string, email?: string }) {
       dispatch(registerSuccess(res))
       clientId()
     }).catch(e => {
-      console.log('oppsu')
     })
   }
 

+ 0 - 1
src/features/auth/components/login.tsx

@@ -88,7 +88,6 @@ export default function Login(props: { register: () => void }) {
                 icon:'none',
                 title:e.error_message
             })
-            console.log('error',e)
         })
         // dispatch(login(name, password) as any);
     }

+ 0 - 1
src/features/common/RecordItem.tsx

@@ -47,7 +47,6 @@ export default function Component(props: { children: React.ReactNode, onClick?:
                 }
             })
             .catch(err => {
-                console.log(err.errMsg)
             })
 
     }

+ 5 - 2
src/features/food/FoodConsole.tsx

@@ -13,6 +13,7 @@ import { useTranslation } from 'react-i18next'
 import { ColorType } from '@/context/themes/color'
 import { clearFoodCache, getFoodCache, saveFoodCache } from './hooks/ExtraData'
 import { async } from 'q'
+import { checkAuthorized } from '@/utils/check_authorized'
 let useNavigation;
 if (process.env.TARO_ENV == 'rn') {
     useNavigation = require("@react-navigation/native").useNavigation
@@ -95,9 +96,11 @@ export default function Component(props: { addItem: Function, firstItem: any })
                 sourceType: [isAlbum ? 'album' : 'camera'],
                 success: function (res) {
                     chooseSuccess(res, isAlbum)
+                    checkAuthorized()
                 },
                 fail: function (res) {
                     chooseFailed(res, isAlbum)
+                    checkAuthorized()
                 }
             })
 
@@ -110,9 +113,11 @@ export default function Component(props: { addItem: Function, firstItem: any })
                 sourceType: [isAlbum ? 'album' : 'camera'],
                 success: function (res) {
                     chooseSuccess(res, isAlbum)
+                    checkAuthorized()
                 },
                 fail: function (res) {
                     chooseFailed(res, isAlbum)
+                    checkAuthorized()
                 }
             })
         }
@@ -130,7 +135,6 @@ export default function Component(props: { addItem: Function, firstItem: any })
 
         // var savedFilePath = res.savedFilePath
         await Taro.setStorage({key:'pic', data:savedFilePath})
-        console.log(savedFilePath)
         setImgUrl(savedFilePath as any)
 
         uploadFile(savedFilePath, isAlbum ? 'album' : 'camera')
@@ -153,7 +157,6 @@ export default function Component(props: { addItem: Function, firstItem: any })
         })
         var dot = path.lastIndexOf('.')
         var fileExt = dot > 0 ? path.substring(dot) : ''
-        // console.log(avatarUrl)
         Taro.request({
             method: 'GET',
             url: `${baseUrl}/api/thirdparty/aliyun/oss-form-upload`,

+ 0 - 1
src/features/food/FoodJournal.tsx

@@ -65,7 +65,6 @@ export default function Component() {
     })
 
     useReachBottom(() => {
-        console.log('bottom')
         more()
         // setPageIndex(pageIndex+1)
         // getHistory()

+ 0 - 1
src/features/food/FoodTimelineItem.tsx

@@ -73,7 +73,6 @@ export default function Component(props: {
                 }
             })
             .catch(err => {
-                console.log(err.errMsg)
             })
     }
 

+ 2 - 0
src/features/trackSomething/components/Activity.tsx

@@ -24,6 +24,7 @@ import SetGoal from "@/features/workout/SetGoal";
 import Working from "@/features/workout/WorkoutStopWatch";
 import { startSuccess } from "@/store/workout";
 import { workoutGroups } from "@/services/workout";
+import { checkAuthorized } from "@/utils/check_authorized";
 // import { useNavigation } from "@react-navigation/native";
 
 let useNavigation;
@@ -98,6 +99,7 @@ export default function Component(props: any) {
     useDidShow(() => {
         if (list.length > 0) {
             checkAuth()
+            checkAuthorized()
         }
     })
 

+ 7 - 7
src/features/trackSomething/components/DayNightCard.tsx

@@ -313,7 +313,6 @@ 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())}`
-                console.log(res)
                 systemLocation({
                     lat: res.latitude,
                     lng: res.longitude,
@@ -695,12 +694,13 @@ export default function DayNightCard(props: { isNight: boolean, count: number })
                             
 
                             if (user.isLogin) {
-                                if (props.isNight) {
-                                    uploadPerm({ show_night_ring: e.detail.value })
-                                }
-                                else {
-                                    uploadPerm({ show_day_ring: e.detail.value })
-                                }
+                                uploadPerm({ show_ring: e.detail.value })
+                                // if (props.isNight) {
+                                //     uploadPerm({ show_night_ring: e.detail.value })
+                                // }
+                                // else {
+                                //     uploadPerm({ show_day_ring: e.detail.value })
+                                // }
                             }
 
 

+ 12 - 6
src/features/trackTimeDuration/components/CircadianDetailPopup.tsx

@@ -177,18 +177,21 @@ export default function CircadianDetailPopup(props: { record: any, schedule?: an
 
         var fastRing: RealRing = null
         if (props.record.fast) {
+            var timestamp = TimeFormatter.transferTimestamp(props.record.fast.real_start_time, props.record.fast.real_end_time_zone)
             fastRing = {
                 color: global.fastColor ? global.fastColor : ColorType.fast,
-                startArc: startArc(props.record.fast.real_start_time),
+                startArc: startArc(timestamp),//startArc(props.record.fast.real_start_time),
                 durationArc: durationArc(props.record.fast.real_start_time, props.record.fast.real_end_time)
             }
         }
 
         var sleepRing: RealRing = null
         if (props.record.sleep && props.record.sleep.status == 'COMPLETED') {
+            var timestamp = TimeFormatter.transferTimestamp(props.record.sleep.real_start_time, 
+                props.record.fast?props.record.fast.real_end_time_zone:props.record.sleep.real_end_time_zone)
             sleepRing = {
                 color: global.sleepColor ? global.sleepColor : ColorType.sleep,
-                startArc: startArc(props.record.sleep.real_start_time),
+                startArc: startArc(timestamp),//startArc(props.record.sleep.real_start_time),
                 durationArc: durationArc(props.record.sleep.real_start_time, props.record.sleep.real_end_time)
             }
         }
@@ -440,25 +443,28 @@ export default function CircadianDetailPopup(props: { record: any, schedule?: an
         </View>
     }
 
-    function stage() {
+    function stage() { 
         var bgRing = getBgRing()
         var common = getCommon(null, false)
         common.radius = bigRingRadius;
         common.lineWidth = ringWidth;
 
+        var timestamp = TimeFormatter.transferTimestamp(props.record.fast.real_start_time, props.record.fast.real_end_time_zone)
+        var timestamp2 = TimeFormatter.transferTimestamp(props.record.sleep.real_start_time, props.record.fast.real_end_time_zone)
+        var timestamp3 = TimeFormatter.transferTimestamp(props.record.sleep.real_end_time, props.record.fast.real_end_time_zone)
         const preRing: RealRing = {
             color: global.fastColor ? global.fastColor : ColorType.fast,
-            startArc: startArc(props.record.fast.real_start_time),
+            startArc: startArc(timestamp),//startArc(props.record.fast.real_start_time),
             durationArc: durationArc(props.record.fast.real_start_time, props.record.sleep.real_start_time)
         }
         const sleepRing: RealRing = {
             color: global.sleepColor ? global.sleepColor : ColorType.sleep,
-            startArc: startArc(props.record.sleep.real_start_time),
+            startArc: startArc(timestamp2),//startArc(props.record.sleep.real_start_time),
             durationArc: durationArc(props.record.sleep.real_start_time, props.record.sleep.real_end_time)
         }
         const wakeRing: RealRing = {
             color: global.fastColor ? global.fastColor : ColorType.fast,
-            startArc: startArc(props.record.sleep.real_end_time),
+            startArc: startArc(timestamp3),//startArc(props.record.sleep.real_end_time),
             durationArc: durationArc(props.record.sleep.real_end_time, props.record.fast.real_end_time)
         }
         return <View>

+ 3 - 1
src/features/trackTimeDuration/components/Discovery.tsx

@@ -421,12 +421,14 @@ export default function Discovery() {
                     else {
                         var startDate = new Date(ring.current_record.sleep.real_end_time)
                         var durationTemp = start - end//ring.current_record.sleep.target_end_time-ring.current_record.sleep.target_start_time
+                        
                         if (durationTemp < 0) {
                             durationTemp += 24 * 3600
                         }
-                        var endDate = new Date(startDate.getTime() + durationTemp )
+                        var endDate = new Date(startDate.getTime() + durationTemp*1000 )
                         end = startDate.getHours() * 3600 + startDate.getMinutes()*60+startDate.getSeconds()
                         start = endDate.getHours() * 3600 + endDate.getMinutes()*60+endDate.getSeconds()
+                        debugger
                         console.log('active', end, start, durationTemp)
                     }
                 }

+ 6 - 1
src/pages/account/ProfileSetting.tsx

@@ -14,6 +14,7 @@ import { jumpPage } from "@/features/trackTimeDuration/hooks/Common";
 import Footer from "@/components/layout/Footer";
 import { ChooseScenarioBtn } from "@/features/common/SpecBtns";
 import { ColorType } from "@/context/themes/color";
+import { checkAuthorized } from "@/utils/check_authorized";
 
 let useNavigation;
 if (process.env.TARO_ENV == 'rn') {
@@ -65,7 +66,11 @@ export default function Page() {
                     var tempFilePaths = res.tempFilePaths
                     console.log(tempFilePaths)
                     operate(tempFilePaths[0])
-                }
+                    checkAuthorized()
+                },
+                fail(res) {
+                    checkAuthorized()
+                },
             })
         }
     }

+ 1 - 1
src/pages/account/Setting.tsx

@@ -61,7 +61,7 @@ export default function Page() {
 
     return <View style={{ color: '#fff', display: 'flex', flexDirection: 'column', flex: 1 }}>
         <View style={{ height: 20 }} />
-        <TableCell title={t('page.setting.version')} ><Text style={{ opacity: 0.8, color: '#fff' }}>1.3.3</Text></TableCell>
+        <TableCell title={t('page.setting.version')} ><Text style={{ opacity: 0.8, color: '#fff' }}>{process.env.TARO_ENV == 'weapp'?Taro.getAccountInfoSync().miniProgram.version:'1.3.3'}</Text></TableCell>
         {/* <Text style={{color:'#9E9E9E',textAlign:'center',fontSize:14}}>v1.2.2</Text> */}
         {
             process.env.TARO_ENV == 'rn' && <View style={{ flex: 1 }} />

+ 0 - 3
src/pages/clock/Clock.tsx

@@ -184,9 +184,6 @@ export default function IndexPage() {
         Taro.setStorage({ key: 'last_tz', data: timeZoneFormatted })
       }
     })
-
-
-
   }
 
   function checkSession() {

+ 59 - 4
src/pages/clock/Index.tsx

@@ -4,7 +4,7 @@ import IndexItem from '@/features/trackTimeDuration/components/IndexItem';
 import Rings from "@/features/trackTimeDuration/components/Rings";
 import './Index.scss'
 import { useDispatch, useSelector } from "react-redux";
-import { useDidHide, useDidShow, useReady } from "@tarojs/taro";
+import { useDidHide, useDidShow, useReady, useShareAppMessage } from "@tarojs/taro";
 import Taro from "@tarojs/taro";
 import { getInfoSuccess } from "@/store/user";
 import { clockHome, clockSummaryRecords, clockSummaryStats, getClockRecords, getClocks, getPlans } from "@/services/trackTimeDuration";
@@ -40,17 +40,22 @@ import { clearNightStore, showNight } from "@/store/night";
 import { showDay } from "@/store/day";
 import { clientInfo } from "@/services/common";
 import { changeFastDuration, changeSleepDuration, setCurrentRecord, setSchedule } from "@/store/ring";
+import { checkAuthorized } from "@/utils/check_authorized";
 
 let GradientText
 let useNavigation;
 let timer
 let pauseTimer = false;
+let AppState;
 
 if (process.env.TARO_ENV == 'rn') {
+    AppState = require("react-native").AppState
     GradientText = require('@/components/basic/GradientText').default
     useNavigation = require("@react-navigation/native").useNavigation
 }
 
+const defaultValue = `[{"scenario":{"name":"FAST_SLEEP","count":0,"schedule":{"fast":{"start_time":"15:00","end_time":"08:00"},"sleep":{"start_time":"22:00","end_time":"07:00"}}},"current_record":{"scenario":"FAST_SLEEP","status":"WAIT_FOR_START","fast":{"status":"WAIT_FOR_START","target_start_time":1710514800000,"target_end_time":1710576000000},"sleep":{"status":"WAIT_FOR_START","target_start_time":1710540000000,"target_end_time":1710572400000}},"wx_pub_followed":false,"time_input_schema":{"min":60,"max":1380,"step":5},"theme_color":{"fast":"#00FFFF","sleep":"#8183FF"}},{"scenarios":[{"name":"FAST","count":0,"schedule":{"fast":{"start_time":"15:00","end_time":"08:00"}}},{"name":"SLEEP","count":0,"schedule":{"sleep":{"start_time":"22:00","end_time":"07:00"}}},{"name":"FAST_SLEEP","count":0,"schedule":{"fast":{"start_time":"15:00","end_time":"08:00"},"sleep":{"start_time":"22:00","end_time":"07:00"}}}],"select_count":0,"theme_color":{"fast":"#00FFFF","sleep":"#8183FF"}}]`
+
 export default function Page() {
     const dispatch = useDispatch();
     global.dispatch = dispatch;
@@ -97,6 +102,11 @@ export default function Page() {
         else {
             loadRNCache()
         }
+
+        if (process.env.TARO_ENV == 'rn') {
+            AppState.addEventListener('change', handleAppStateChange);
+        }
+
     }, [])
 
     useEffect(() => {
@@ -105,11 +115,13 @@ export default function Page() {
 
         if (user.isLogin) {
             uploadUserClient();
+
+            checkAuthorized();
         }
         else {
             dispatch(clearNightStore());
         }
-        
+
     }, [user.isLogin, time.status])
 
     useReady(async () => {
@@ -121,10 +133,20 @@ export default function Page() {
 
         }
 
+        if (process.env.TARO_ENV == 'weapp') {
+            useShareAppMessage((e) => {
+                return {
+                    title: t('feature.track_time_duration.common.share_title'),
+                    path: 'pages/clock/Clock'
+                }
+            })
+        }
+
     })
 
     useDidShow(() => {
-        setCount(pre=>pre+1)
+        checkTimeZone()
+        setCount(pre => pre + 1)
         //resume timer
         pauseTimer = false
     })
@@ -139,6 +161,36 @@ export default function Page() {
         setCount((prevCounter) => prevCounter + 1)
     }
 
+    const handleAppStateChange = (nextAppState) => {
+        checkTimeZone()
+    };
+
+    function checkTimeZone() {
+        var split = new Date().toString().split(' ');
+        var timeZoneFormatted = split[split.length - 2];
+
+
+        Taro.getStorage({
+            key: 'last_tz',
+            success: function (res) {
+                if (res.data && res.data != timeZoneFormatted) {
+
+                    if (global.currentStatus != 'WAIT_FOR_START') {
+                        Taro.showModal({
+                            title: t('feature.track_time_duration.change_tz_alert.title'),
+                            content: t('feature.track_time_duration.change_tz_alert.content', { tz: timeZoneFormatted }),
+                            showCancel: false,
+                            confirmText: t('feature.track_time_duration.change_tz_alert.confirm'),
+                        })
+                    }
+                }
+            },
+            complete: function () {
+                Taro.setStorage({ key: 'last_tz', data: timeZoneFormatted })
+            }
+        })
+    }
+
     function uploadUserClient() {
         var systemInfo = Taro.getSystemInfoSync();
         var split = new Date().toString().split(' ');
@@ -146,7 +198,7 @@ export default function Page() {
         clientInfo({
             client: {
                 client_type: process.env.TARO_ENV == 'weapp' ? 'MP' : 'APP',
-                client_version: '1.0'
+                client_version: process.env.TARO_ENV == 'weapp' ? Taro.getAccountInfoSync().miniProgram.version : '1.0'//'1.0'
             },
             meta: {
                 language: systemInfo.language,
@@ -206,6 +258,7 @@ export default function Page() {
         Promise.all([getClocks(), getPlans()]).then((list) => {
             setHomeData(list[0] as any)
             global.homeData = list[0]
+            global.currentStatus = (list[0] as any).current_record.status;
             var array = (list[1] as any).scenarios
             var schedule = null
             array.map(item => {
@@ -225,6 +278,8 @@ export default function Page() {
             dispatch(setCurrentRecord((list[0] as any).current_record))
             dispatch(setSchedule(schedule))
             setLoaded(true)
+        }).catch((e)=>{
+            console.log('9527',e)
         })
 
         getHistory()

+ 0 - 1
src/pages/index/index.tsx

@@ -42,7 +42,6 @@ export default function IndexPage() {
 
   function checkWXPubFollow() {
     wxPubFollow().then(res => {
-      console.log(res);
     })
   }
 

+ 0 - 11
src/services/foodJournal.tsx

@@ -7,7 +7,6 @@ export const getFoodTags = (params) => {
             url: API_FOOD_TAGS, method: 'GET', data: { ...params }
         }).then(res => {
             resolve(res);
-            console.log(res);
             // dispatch(loginSuccess(res));
         }).catch(e => {
             reject(e)
@@ -21,8 +20,6 @@ export const getFoodScales = (params) => {
             url: API_FOOD_SCALE, method: 'GET', data: {...params}
         }).then(res => {
             resolve(res);
-            console.log(res);
-            // dispatch(loginSuccess(res));
         }).catch(e => {
             reject(e)
         })
@@ -34,8 +31,6 @@ export const getFoodJournals = (params) => {
             url: API_FOOD, method: 'GET', data: { ...params }
         }).then(res => {
             resolve(res);
-            console.log(res);
-            // dispatch(loginSuccess(res));
         }).catch(e => {
             reject(e)
         })
@@ -48,8 +43,6 @@ export const createFoodJournal = (params) => {
             url: API_FOOD, method: 'POST', data: { ...params }
         }).then(res => {
             resolve(res);
-            console.log(res);
-            // dispatch(loginSuccess(res));
         }).catch(e => {
             reject(e)
         })
@@ -62,8 +55,6 @@ export const editFoodJournal = (params, id) => {
             url: API_FOOD + `/${id}`, method: 'POST', data: { ...params }
         }).then(res => {
             resolve(res);
-            console.log(res);
-            // dispatch(loginSuccess(res));
         }).catch(e => {
             reject(e)
         })
@@ -76,8 +67,6 @@ export const delFoodJournal = (id) => {
             url: API_FOOD + `/${id}`, method: 'DELETE', data: {}
         }).then(res => {
             resolve(res);
-            console.log(res);
-            // dispatch(loginSuccess(res));
         }).catch(e => {
             reject(e)
         })

+ 0 - 1
src/services/permission.tsx

@@ -7,7 +7,6 @@ export const wxPubFollow = (params:any) => {
             url: API_WX_PUB_FOLLOWED, method: 'GET', data: { ...params }
         }).then(res => {
             resolve(res);
-            console.log(res);
             // dispatch(loginSuccess(res));
         })
     })

+ 0 - 4
src/services/thirdPartRequest.tsx

@@ -19,18 +19,14 @@ export const thirdPartRequest = (type: RequestType) => {
             case RequestType.RequestTypeWXRunData:
                 {
                     clearTimeout(timer);
-                    console.log('开始获取微信步数')
                     Taro.getWeRunData({
                         success: (res) => {
-                            console.log('获取微信步数成功')
                             resolve(res);
                         },
                         fail: (err) => {
-                            console.log('获取微信步数失败 ')
                             reject(err);
                         },
                         complete: () => {
-                            console.log('获取微信步数完成  ')
                         }
                     })
                 }

+ 0 - 4
src/services/trackTimeDuration.tsx

@@ -9,8 +9,6 @@ export const getPlans = () => {
             url: API_FAST_PLANS, method: 'GET', data: {}
         }).then(res => {
             resolve(res);
-            console.log(res);
-            // dispatch(loginSuccess(res));
         })
     })
 }
@@ -21,8 +19,6 @@ export const setPlan = (params: Record<string, any> | undefined) => {
             url: API_FAST_PLANS, method: 'POST', data: { ...params }
         }).then(res => {
             resolve(res);
-            console.log(res);
-            // dispatch(loginSuccess(res));
         }).catch(e => {
             reject(e)
         })

+ 0 - 1
src/store/scenario.tsx

@@ -31,7 +31,6 @@ const scenarioSlice = createSlice({
         },
         setScenarioName(state, action) {
             state.name = action.payload;
-            console.log(state.name);
         },
         setScenario(state, action) {
             state.schedule = action.payload.schedule;

+ 34 - 0
src/utils/check_authorized.tsx

@@ -0,0 +1,34 @@
+import { clientInfo } from "@/services/common";
+import Taro from "@tarojs/taro";
+
+export function checkAuthorized() {
+    const appAuthorizeSetting = Taro.getAppAuthorizeSetting()
+
+    if (process.env.TARO_ENV == 'weapp') {
+        Taro.getSetting({
+            success: res => {
+                //第一步,检测是否有授权 - 没有授权
+                var allowWerun = false;
+                if (res.authSetting['scope.werun']) {
+                    allowWerun = true;
+                }
+                clientInfo({
+                    perm: {
+                        album: appAuthorizeSetting.albumAuthorized == 'authorized',
+                        camera: appAuthorizeSetting.cameraAuthorized == 'authorized',
+                        health: {
+                            wx_steps: allowWerun
+                        }
+                    }
+                })
+            }
+        })
+    }
+    else {
+
+    }
+
+
+
+
+}