leon 1 jaar geleden
bovenliggende
commit
f9dc75abfd

BIN
ios/assets/src/assets/images/check_black.png


BIN
ios/assets/src/assets/images/lock.png


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

@@ -602,7 +602,7 @@
 				COPY_PHASE_STRIP = NO;
 				ENABLE_STRICT_OBJC_MSGSEND = YES;
 				ENABLE_TESTABILITY = YES;
-				EXCLUDED_ARCHS = arm64;
+				EXCLUDED_ARCHS = "arm64 arm64e";
 				GCC_C_LANGUAGE_STANDARD = gnu99;
 				GCC_DYNAMIC_NO_PIC = NO;
 				GCC_NO_COMMON_BLOCKS = YES;

File diff suppressed because it is too large
+ 1 - 1
ios/main.jsbundle


+ 2 - 3
src/app.config.ts

@@ -38,7 +38,6 @@ const appConfig = defineAppConfig({
     'mysvg': './components/basic/svg',
     // 't-popup':'tdesgin-miniprogram/popup/popup'
   },
-  restartStrategy:'homePage',
   "requiredPrivateInfos": [
     "chooseLocation"
   ],
@@ -47,6 +46,7 @@ const appConfig = defineAppConfig({
       "desc": "获取您选择的位置...."
     }
   },
+  
   // tabBar: {
   //   custom: true,
   //   list:[
@@ -74,8 +74,7 @@ const appConfig = defineAppConfig({
     "navigationBarBackgroundColor": "#000000",
     "navigationBarTitleText": "Weixin",
     "navigationBarTextStyle": "white",
-    "backgroundColor": "#000000",
-    "restartStrategy":"homePage"
+    "backgroundColor": "#000000"
   },
   // darkmode: true
 })

+ 234 - 13
src/features/trackTimeDuration/components/DayNightCard.tsx

@@ -16,6 +16,9 @@ import { rpxToPx } from '@/utils/tools'
 import { jumpPage } from '@/features/trackTimeDuration/hooks/Common'
 import DayNightDetailPopup from './DayNightDetailPopup'
 import { IconDay, IconInfo, IconNight } from '@/components/basic/Icons'
+import { getClocks } from '@/services/trackTimeDuration'
+import { request } from '@/services/http/request'
+import { API_USER_LOCATION } from '@/services/http/api'
 
 let useNavigation;
 if (process.env.TARO_ENV == 'rn') {
@@ -174,9 +177,24 @@ export default function DayNightCard(props: { isNight: boolean, count: number })
         }
     }, [user.test_user])
 
+    useDidShow(() => {
+        if (!user.isLogin) {
+            dispatch(showNight(false))
+            dispatch(showDay(false))
+            Taro.setStorage({
+                key: 'showNightRing',
+                data: false
+            })
+            Taro.setStorage({
+                key: 'showDayRing',
+                data: false
+            })
+        }
+    })
+
     async function getGPSCache() {
         var gps = await getStorage('gps')
-        if (gps && gps.length>0) {
+        if (gps && gps.length > 0) {
             locationDetail = JSON.parse(gps)
             global.locationDetail = JSON.parse(gps)
         }
@@ -344,16 +362,59 @@ export default function DayNightCard(props: { isNight: boolean, count: number })
         if (e && process.env.TARO_ENV == 'weapp') {
             e.stopPropagation()
         }
+        var today = new Date()
+        var yesterday = new Date(today.getTime() - 24 * 3600 * 1000)
+        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())}`
+
+
+        if (process.env.TARO_ENV == 'rn') {
+            Taro.getLocation({
+                success(res) {
+                    systemLocation({
+                        lat: res.latitude,
+                        lng: res.longitude,
+                        // name: 'app test',
+                        // address: 'app test',
+                        date_start: strYesterday,
+                        date_end: strTomorrow,
+                        // coordinate_system_standard: 'GCJ-02'
+                    }).then(data => {
+                        updateDate(data);
+                        locationDetail = data;
+                        global.locationDetail = locationDetail
+                        setAuthInfo(data as any)
+                        setSunriseTime((data as any).daylights[0].sunrise)
+                        setSunriseTmrTime((data as any).daylights[1].sunrise)
+                        setSunsetTime((data as any).daylights[0].sunset)
+                        Taro.setStorage({
+                            key: 'gps',
+                            data: JSON.stringify(data as any)
+                        })
+                        dispatch(updateMember({ isMember: isMember, gpsInfo: (data as any) }))
+                        showRing()
+                    })
+                },
+                fail(res) {
+                    if (res.errMsg=='Permissions denied!'){
+                        alert('aaa')
+                    }
+                    console.log(res)
+                    showRing()
+                },
+                complete(res) {
+
+                }
+            })
+            return
+        }
         joingMember = false;
         Taro.chooseLocation({
             latitude: authInfo && authInfo.lat ? authInfo.lat : undefined,
             longitude: authInfo && authInfo.lat ? authInfo.lng : undefined,
             success: function (res) {
-                var today = new Date()
-                var yesterday = new Date(today.getTime() - 24 * 3600 * 1000)
-                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: res.latitude,
                     lng: res.longitude,
@@ -374,6 +435,7 @@ export default function DayNightCard(props: { isNight: boolean, count: number })
                         key: 'gps',
                         data: JSON.stringify(data as any)
                     })
+                    showRing()
                     dispatch(updateMember({ isMember: isMember, gpsInfo: (data as any) }))
                 })
 
@@ -383,11 +445,28 @@ export default function DayNightCard(props: { isNight: boolean, count: number })
                     title: '位置修改失败!\n请重新选择就近位置',
                     icon: 'none'
                 })
+                showRing()
             },
+            complete(res) {
+
+            }
         })
 
     }
 
+    function showRing() {
+        dispatch(showNight(true))
+        dispatch(showDay(true))
+        Taro.setStorage({
+            key: 'showNightRing',
+            data: true
+        })
+        Taro.setStorage({
+            key: 'showDayRing',
+            data: true
+        })
+    }
+
     function getLocation() {
         var city = ''
         if ((authInfo as any).address.city.length > 0) {
@@ -683,6 +762,149 @@ export default function DayNightCard(props: { isNight: boolean, count: number })
         })
     }
 
+    function tapShow() {
+        dispatch(showNight(true))
+        dispatch(showDay(true))
+        Taro.showModal({
+            title: 'Login Required',
+            content: 'desc',
+            cancelText: 'Later',
+            confirmText: 'Login',
+            success: function (res) {
+                if (res.confirm) {
+                    Taro.setStorage({
+                        key: 'showNightRing',
+                        data: true
+                    })
+                    Taro.setStorage({
+                        key: 'showDayRing',
+                        data: true
+                    })
+                    if (!user.isLogin) {
+                        jumpPage('/pages/account/ChooseAuth', 'ChooseAuth', navigation)
+                        return
+                    }
+
+                } else if (res.cancel) {
+                    dispatch(showNight(false))
+                    dispatch(showDay(false))
+                    Taro.setStorage({
+                        key: 'showNightRing',
+                        data: false
+                    })
+                    Taro.setStorage({
+                        key: 'showDayRing',
+                        data: false
+                    })
+                }
+            }
+        })
+    }
+
+    function operate() {
+        Taro.showActionSheet({
+            itemList: ['选择位置', '重置'],
+            success: function (res) {
+                switch (res.tapIndex) {
+                    case 0:
+                        auth()
+                        break;
+                    case 1:
+                        reset()
+                        break;
+                }
+            },
+            fail: function (res) {
+                console.log(res.errMsg)
+            }
+        })
+    }
+
+    function reset() {
+        var content = ''
+        if (props.isNight) {
+            if (authInfo && authInfo.lat) {
+                content = '夜间+有位置信息'
+            }
+            else {
+                content = '夜间+无位置信息'
+            }
+        }
+        else {
+            if (authInfo && authInfo.lat) {
+                content = '白天+有位置信息'
+            }
+            else {
+                content = '白天+无位置信息'
+            }
+        }
+        Taro.showModal({
+            title: 'Reset Alert',
+            content: content,
+            success: function (res) {
+                if (res.confirm) {
+                    if (user.isLogin) {
+                        uploadPerm({ show_ring: false })
+                    }
+                    clearLocation().then(res => {
+                        if (global.clearNightLocation) {
+                            global.clearNightLocation()
+                        }
+                        if (global.clearDayLocation) {
+                            global.clearDayLocation()
+                        }
+                        lastNightInfo = null
+                        lastDayInfo = null
+
+                        dispatch(showNight(false))
+                        dispatch(showDay(false))
+                        Taro.setStorage({
+                            key: 'showNightRing',
+                            data: false
+                        })
+                        Taro.setStorage({
+                            key: 'showDayRing',
+                            data: false
+                        })
+                    })
+                } else if (res.cancel) {
+                    console.log('用户点击取消')
+                }
+            }
+
+        })
+
+    }
+
+    return <View>
+        {
+            !user.isLogin && <View style={{ color: '#fff' }} onClick={tapShow}>{props.isNight ? '显示当地夜晚时间' : '显示当地白天时间'}</View>
+        }
+        {
+            user.isLogin && !dayStore.showDayRing && <View style={{ color: '#fff' }} onClick={auth}>{props.isNight ? '显示当地夜晚时间' : '显示当地白天时间'}</View>
+        }
+        {
+            user.isLogin && dayStore.showDayRing && <View style={{ display: 'flex', flexDirection: 'column' }}>
+                <Text className='day_night_value' style={{ color: props.isNight ? ColorType.night : ColorType.day }}>{props.isNight ? nightDuration() : dayDuration()}</Text>
+                <Text className='day_night_desc'>{props.isNight ? nightDurationDesc1() : dayDurationDesc1()}</Text>
+                {
+                    authInfo && authInfo.lat ?
+                        <View style={{ display: 'flex', flexDirection: 'row', marginTop: rpxToPx(18) }} onClick={operate}>
+                            <View className={props.isNight ? 'night_location_btn' : 'day_location_btn'}>{getLocation()}</View>
+                        </View>
+                        :
+                        <View style={{ display: 'flex', flexDirection: 'row', marginTop: rpxToPx(18) }} onClick={operate}>
+                            <View className={props.isNight ? 'night_location_btn' : 'day_location_btn'} >
+                                {props.isNight ? t('feature.day_night.get_local_time') : t('feature.day_night.get_local_time_sunrise')}
+                            </View>
+                        </View>
+                }
+            </View>
+        }
+    </View>
+
+    /*
+
     return <View style={{ color: '#fff' }} onLongPress={longClick}>
         <Box onClick={tapCard}>
             <View style={{ marginTop: -rpxToPx(14), marginBottom: -rpxToPx(14) }}>
@@ -703,14 +925,13 @@ export default function DayNightCard(props: { isNight: boolean, count: number })
                             color={props.isNight ? ColorType.night : ColorType.day}
                             onClick={(e) => { e.stopPropagation() }}
                             onChange={(e) => {
-                                e.stopPropagation()
-                                // setExpand(e.detail.value)
-                                // if (props.isNight) {
+                                if (process.env.TARO_ENV == 'weapp') {
+                                    e.stopPropagation()
+                                }
+
                                 dispatch(showNight(e.detail.value))
-                                // }
-                                // else {
+  
                                 dispatch(showDay(e.detail.value))
-                                // }
 
 
                                 Taro.setStorage({
@@ -784,5 +1005,5 @@ export default function DayNightCard(props: { isNight: boolean, count: number })
         {
             showDetailModal && modalContent2()
         }
-    </View >
+    </View >*/
 }

+ 2 - 2
src/features/trackTimeDuration/components/WeekCalendarItem.scss

@@ -84,12 +84,12 @@
 .lineBgView{
     position: relative;
     height: 400px;
-    width: 20rpx;
+    width: 20px;
 }
 
 .detailLine{
     position: absolute;
     left: 0;
-    width: 20rpx;
+    width: 20px;
     min-height: 2px;
 }

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

@@ -270,7 +270,7 @@ export default function Page() {
         clientInfo({
             client: {
                 client_type: process.env.TARO_ENV == 'weapp' ? 'MP' : 'APP',
-                client_version: process.env.TARO_ENV == 'weapp' ? '1.3.6':'1.0',//Taro.getAccountInfoSync().miniProgram.version : '1.0',//'1.0'
+                client_version: process.env.TARO_ENV == 'weapp' ? '1.3.6' : '1.0',//Taro.getAccountInfoSync().miniProgram.version : '1.0',//'1.0'
                 wx_version: process.env.TARO_ENV == 'weapp' ? systemInfo.version : '_'
             },
             meta: {
@@ -577,19 +577,19 @@ export default function Page() {
     }
 
     function tapLogin() {
-        if (process.env.TARO_ENV=='rn'){
-            Taro.getLocation({
-                success(result) {
-                    console.log(result)
-                },
-                fail(res) {
-                    console.log(res)
-                },
-            })
-            return
-        }
+        // if (process.env.TARO_ENV=='rn'){
+        //     Taro.getLocation({
+        //         success(result) {
+        //             console.log(result)
+        //         },
+        //         fail(res) {
+        //             console.log(res)
+        //         },
+        //     })
+        //     return
+        // }
         if (!user.isLogin) {
-            jumpPage('/pages/account/ChooseAuth', 'ChooseAuth')
+            jumpPage('/pages/account/ChooseAuth', 'ChooseAuth', navigation)
             return
         }
     }
@@ -664,7 +664,7 @@ export default function Page() {
                 }
 
                 {
-                    user.isLogin && !showErrorPage && <View style={{ marginTop: rpxToPx(60), display: 'flex', flexDirection: 'column' }}>
+                    user.isLogin && !showErrorPage && process.env.TARO_ENV == 'weapp' && <View style={{ marginTop: rpxToPx(60), display: 'flex', flexDirection: 'column' }}>
                         <Text className="discovery1" >周统计</Text>
                         <WeekCalendar />
                     </View>

+ 1 - 1
src/services/http/api.js

@@ -1,4 +1,4 @@
-let online = process.env.TARO_ENV == 'rn' ? false : true;
+let online = process.env.TARO_ENV == 'rn' ? false : false;
 export let baseUrl = online ? 'https://api.fast.liveplus.fun' : 'https://api.fast.dev.liveplus.fun';
 export let imgUrl = online
     ? 'https://api.fast.liveplus.fun/static/image/'

+ 1 - 1
src/services/http/request.ts

@@ -88,7 +88,6 @@ export async function request<T>(param: RequestParam): Promise<T> {
             else {
                 ToastUtil.getInstance().showToast(method == 'GET' ? '网络连接失败,请检查网络' : '操作失败,请检查网络');
             }
-
             reject('timeout');
         }, kTimeout);
 
@@ -140,6 +139,7 @@ export async function request<T>(param: RequestParam): Promise<T> {
                 }
             },
             fail: err => {
+                debugger
                 if ((err as any).statusCode >= 200 && (err as any).statusCode < 300) {
                     clearTimeout(timer);
                     resolve()

+ 1 - 0
src/services/thirdPartRequest.tsx

@@ -13,6 +13,7 @@ export const thirdPartRequest = (type: RequestType) => {
     
     return new Promise((resolve, reject) => {
         var timer = setTimeout(() => {
+            debugger
             reject('timeout');
         }, kTimeOut);
         switch (type) {

+ 2 - 1
src/utils/check_authorized.tsx

@@ -2,9 +2,10 @@ import { clientInfo } from "@/services/common";
 import Taro from "@tarojs/taro";
 
 export function checkAuthorized() {
-    const appAuthorizeSetting = Taro.getAppAuthorizeSetting()
+    
 
     if (process.env.TARO_ENV == 'weapp') {
+        const appAuthorizeSetting = Taro.getAppAuthorizeSetting()
         Taro.getSetting({
             success: res => {
                 //第一步,检测是否有授权 - 没有授权

Some files were not shown because too many files changed in this diff