leon há 1 ano atrás
pai
commit
e3a7c15246

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

@@ -544,7 +544,7 @@
 				CODE_SIGN_ENTITLEMENTS = hola/hola.entitlements;
 				CODE_SIGN_IDENTITY = "Apple Development";
 				CODE_SIGN_STYLE = Automatic;
-				CURRENT_PROJECT_VERSION = 127;
+				CURRENT_PROJECT_VERSION = 130;
 				DEVELOPMENT_TEAM = GPMXAZ9G5N;
 				ENABLE_BITCODE = NO;
 				INFOPLIST_FILE = hola/Info.plist;
@@ -577,7 +577,7 @@
 				CODE_SIGN_ENTITLEMENTS = hola/hola.entitlements;
 				CODE_SIGN_IDENTITY = "Apple Development";
 				CODE_SIGN_STYLE = Automatic;
-				CURRENT_PROJECT_VERSION = 127;
+				CURRENT_PROJECT_VERSION = 130;
 				DEVELOPMENT_TEAM = GPMXAZ9G5N;
 				INFOPLIST_FILE = hola/Info.plist;
 				LD_RUNPATH_SEARCH_PATHS = (

+ 1 - 1
ios/hola/Info.plist

@@ -32,7 +32,7 @@
 		</dict>
 	</array>
 	<key>CFBundleVersion</key>
-	<string>127</string>
+	<string>130</string>
 	<key>ITSAppUsesNonExemptEncryption</key>
 	<false/>
 	<key>LSApplicationCategoryType</key>

Diff do ficheiro suprimidas por serem muito extensas
+ 0 - 0
ios/main.jsbundle


+ 3 - 2
src/features/trackSomething/components/MetricItem.scss

@@ -37,19 +37,20 @@
     margin-right: 2px;
     display: flex;
     flex-direction: row;
-    align-items: flex-end;
 }
 .metric_value {
     font-size: 48px;
-    line-height: 48px;
+    line-height: 50px;
     height: 50px;
     font-weight: 500;
     color: #ffffff;
+    // background-color: blue;
     // margin-top: 20px;
     // margin-bottom: 12px;
 }
 
 .metric_unit {
+    margin-top: 14px;
     font-size: 32px;
     line-height: 32px;
     color: #ffffff;

+ 11 - 8
src/features/trackSomething/components/MetricItem.tsx

@@ -2,6 +2,8 @@ import { View, Text, Image } from "@tarojs/components";
 import './MetricItem.scss'
 import { RecordMetricBtn } from "@/features/common/SpecBtns";
 import { rpxToPx } from "@/utils/tools";
+import { useEffect, useState } from "react";
+import { useSelector } from "react-redux";
 
 export default function Component(props: {
     title: string,
@@ -22,6 +24,7 @@ export default function Component(props: {
     special?: string
 }) {
 
+    const user = useSelector((state: any) => state.user);
     function clickBtn() {
         if (props.isDisabled) {
             return
@@ -42,20 +45,20 @@ export default function Component(props: {
     function valueContent() {
         if (props.special && props.special == 'FT_IN') {
 
-            return <View className="metric_value_bg" onClick={() => props.onClickDetail()}>
-                <Text className="metric_value">{parseInt(props.value / 12 + '')}</Text>
-                <Text className="metric_unit" style={{ marginBottom: 3, marginLeft: 2, marginRight: 2 }}>ft</Text>
-                <Text className="metric_value">{props.value % 12}</Text>
-                <Text className="metric_unit" style={{ marginBottom: 3, marginLeft: 2, marginRight: 2 }}>in</Text>
+            return <View className="metric_value_bg" style={{ backgroundColor: user.is_debug ? 'red' : 'transparent' }} onClick={() => props.onClickDetail()}>
+                <Text className="metric_value" style={{ backgroundColor: user.is_debug ? 'blue' : 'transparent' }}>{parseInt(props.value / 12 + '')}</Text>
+                <Text className="metric_unit" style={{ marginLeft: 2, marginRight: 2, backgroundColor: user.is_debug ? 'gray' : 'transparent' }}>ft</Text>
+                <Text className="metric_value" style={{ backgroundColor: user.is_debug ? 'blue' : 'transparent' }}>{props.value % 12}</Text>
+                <Text className="metric_unit" style={{ marginLeft: 2, marginRight: 2, backgroundColor: user.is_debug ? 'gray' : 'transparent' }}>in</Text>
 
             </View>
         }
-        return <View className="metric_value_bg" onClick={() => props.onClickDetail()}>
+        return <View className="metric_value_bg" style={{ backgroundColor: user.is_debug ? 'red' : 'transparent' }} onClick={() => props.onClickDetail()}>
             {
-                props.valueView ? props.valueView : <Text className="metric_value">{props.value}</Text>
+                props.valueView ? props.valueView : <Text className="metric_value" style={{ backgroundColor: user.is_debug ? 'blue' : 'transparent' }}>{props.value}</Text>
             }
             {
-                !props.valueView && <Text className="metric_unit" style={{ marginBottom: 3 }}>{props.unit}</Text>
+                !props.valueView && <Text className="metric_unit" style={{ backgroundColor: user.is_debug ? 'gray' : 'transparent' }}>{props.unit}</Text>
             }
         </View>
     }

+ 7 - 6
src/pages/account/Profile.tsx

@@ -13,7 +13,7 @@ import TableCell from "@/components/layout/TableCell";
 import { useEffect, useState } from "react";
 import { jumpPage } from "@/features/trackTimeDuration/hooks/Common";
 import Tabbar from "@/components/navigation/TabBar";
-import { getInfoSuccess } from "@/store/user";
+import { getInfoSuccess, updateDebug } from "@/store/user";
 import TitleView from "@/features/trackTimeDuration/components/TitleView";
 import showAlert from "@/components/basic/Alert";
 import { rpxToPx } from "@/utils/tools";
@@ -61,6 +61,7 @@ export default function Page() {
         setSwitchOn(e.detail.value)
         Taro.setStorageSync('isDebug', e.detail.value)
         global.isDebug = e.detail.value
+        dispatch(updateDebug({ is_debug: e.detail.value }))
     }
 
     function alertChanged(e) {
@@ -171,8 +172,8 @@ export default function Page() {
         </TitleView>
     }
 
-    function memberdesc(){
-        if (!accessObj.access){
+    function memberdesc() {
+        if (!accessObj.access) {
             return ''
         }
         if (accessObj.access.member.type == 'NON_CONSUMABLE') {
@@ -185,7 +186,7 @@ export default function Page() {
     }
 
     function member_expire() {
-        
+
         if (global.language == 'en') {
             return dayjs(accessObj.access.member.expire).format('MMM D HH:mm')
         }
@@ -217,9 +218,9 @@ export default function Page() {
 
             <Box>
                 {
-                    (!user.isLogin||(accessObj && accessObj.access && accessObj.access.member.status == 'NON_MEMBER')) ? <View className="balance" onClick={tapBalance}>
+                    (!user.isLogin || (accessObj && accessObj.access && accessObj.access.member.status == 'NON_MEMBER')) ? <View className="balance" onClick={tapBalance}>
                         <Text className="title">{t('page.more.stone')}</Text>
-                        <Text className="desc" style={{height:process.env.TARO_ENV=='weapp'?rpxToPx(32):rpxToPx(64)}}>{t('page.more.stone_desc')}</Text>
+                        <Text className="desc" style={{ height: process.env.TARO_ENV == 'weapp' ? rpxToPx(32) : rpxToPx(64) }}>{t('page.more.stone_desc')}</Text>
                     </View> :
                         <View className="balance" onClick={tapBalance}>
                             <Text className="title">{t('page.more.pro_member')}</Text>

+ 7 - 1
src/store/user.tsx

@@ -9,6 +9,7 @@ interface UserState {
     isLogin: boolean;
     test_user:boolean;
     is_new_user:boolean;
+    is_debug:boolean;
 }
 
 
@@ -22,6 +23,7 @@ const initialState: UserState = {
     token: null,
     test_user:false,
     is_new_user:false,
+    is_debug:false,
 }
 
 const userSlice = createSlice({
@@ -104,10 +106,14 @@ const userSlice = createSlice({
                 state.avatar = avatar;
             state.isLogin = true;
             Taro.setStorage({ key: 'userData', data: JSON.stringify(state) });
+        },
+        updateDebug(state,action: PayloadAction<any>){
+            const { is_debug } = action.payload;
+            state.is_debug = is_debug
         }
     },
 });
 
-export const { loginSuccess, registerSuccess, logoutSuccess, getInfoSuccess, updateSuccess, clearSuccess } = userSlice.actions;
+export const { loginSuccess, registerSuccess, logoutSuccess, getInfoSuccess, updateSuccess, clearSuccess,updateDebug } = userSlice.actions;
 export default userSlice.reducer;
 

Alguns ficheiros não foram mostrados porque muitos ficheiros mudaram neste diff