leon 1 ano atrás
pai
commit
8117f27891

+ 17 - 1
src/_health/base/new_button.tsx

@@ -80,6 +80,7 @@ export default function NewButton(props: {
 }) {
 
     const [isTouched, setIsTouched] = useState(false)
+    const [noTouch, setNoTouch] = useState(false)
     let style = {}
     switch (props.type) {
         case NewButtonType.fill:
@@ -119,7 +120,7 @@ export default function NewButton(props: {
                 height: props.height ?? rpxToPx(72),
                 width: props.width ?? rpxToPx(198),
                 borderRadius: props.height ? props.height / 4 : rpxToPx(72 / 4),
-                backgroundColor: isTouched ? MainColorType.g02+'4d' : MainColorType.g02+'1a',
+                backgroundColor: isTouched ? MainColorType.g02 + '4d' : MainColorType.g02 + '1a',
                 color: props.disable ? '#b2b2b2' : props.color,
                 fontSize: props.fontSize ?? rpxToPx(30),
                 fontWeight: props.fontNormal ? 'normal' : 'bold',//props.bold ? 'bold' : 'normal',
@@ -245,7 +246,12 @@ export default function NewButton(props: {
                         vibrate();
                         return;
                     }
+                    if (noTouch) return;
                     props.onClick()
+                    setNoTouch(true)
+                    setTimeout(() => {
+                        setNoTouch(false)
+                    }, 500)
                 }}
                 onTouchStart={(e) => {
                     if (process.env.TARO_ENV == 'weapp') {
@@ -272,7 +278,12 @@ export default function NewButton(props: {
                     vibrate();
                     return;
                 }
+                if (noTouch) return;
                 props.onClick()
+                setNoTouch(true)
+                setTimeout(() => {
+                    setNoTouch(false)
+                }, 500)
             }}
                 onTouchStart={(e) => {
                     if (process.env.TARO_ENV == 'weapp') {
@@ -304,7 +315,12 @@ export default function NewButton(props: {
                 vibrate();
                 return;
             }
+            if (noTouch) return;
             props.onClick()
+            setNoTouch(true)
+            setTimeout(() => {
+                setNoTouch(false)
+            }, 500)
         }}
         onTouchStart={(e) => {
             if (process.env.TARO_ENV == 'weapp') {

+ 4 - 0
src/_health/base/new_date_picker.tsx

@@ -47,6 +47,9 @@ export default function NewDatePicker(props: {
     function longDatas() {
         let result: any = []
         const currentDate = new Date()
+        currentDate.setHours(23)
+        currentDate.setMinutes(59)
+        currentDate.setSeconds(59)
         const startDate = new Date(props.minTimestamp!)
         let date = startDate
 
@@ -64,6 +67,7 @@ export default function NewDatePicker(props: {
             result.push(string)
             date.setDate(date.getDate() + 1)
         }
+        
         return [result]
     }
 

+ 3 - 3
src/_health/components/fast_sleep_card.tsx

@@ -278,7 +278,7 @@ export default function FastSleepCard(props: { step: number, data: any }) {
                     targetRing={target0SmallRing()}
                     realRing={real0SmallRing()}
                     canvasId={'circle0_small'}
-                    currentDot={currentDot('SLEEP', outRange2)}
+                    currentDot={sleep.status=='DONE'?null:currentDot('SLEEP', outRange2)}
                 />
             </View>
         </View>
@@ -299,7 +299,7 @@ export default function FastSleepCard(props: { step: number, data: any }) {
             targetRing={target1BigRing()}
             realRing={real1BigRing()}
             canvasId={'circle1_big'}
-            currentDot={currentDot('FAST', outRange)}
+            currentDot={status=='OG2'||status=='OG3'?null:currentDot('FAST', outRange)}
         /></View>
     }
 
@@ -317,7 +317,7 @@ export default function FastSleepCard(props: { step: number, data: any }) {
             targetRing={target2BigRing()}
             realRing={real2BigRing()}
             canvasId={'circle2_big'}
-            currentDot={currentDot('SLEEP', outRange)}
+            currentDot={sleep.status=='DONE'?null:currentDot('SLEEP', outRange)}
 
         /></View>
     }

+ 1 - 1
src/_health/components/fast_sleep_popup.scss

@@ -43,7 +43,7 @@
 
 .pop_line1 {
     width: 440px;
-    height: 1px;
+    height: 2px;
     transform: scaleY(0.5);
     margin-top: 36px;
     margin-bottom: 36px;

+ 3 - 1
src/_health/components/schedule_item.tsx

@@ -141,7 +141,9 @@ export default function ScheduleItem(props: {
                             }} style={itemStyle(props.obj)}>{props.obj.time}</View>
                         }
                         {
-                            props.disable && <View className="edit_item_time" style={{ backgroundColor: 'transparent', color: props.gray ? MainColorType.g02 : '#000' }}>{props.obj.time}</View>
+                            props.disable && <View style={{borderWidth:1,borderColor:'transparent',borderStyle: 'solid'}}>
+                                <View className="edit_item_time" style={{ backgroundColor: 'transparent', color: props.gray ? MainColorType.g02 : '#000' }}>{props.obj.time}</View>
+                            </View>
                         }
 
 

+ 10 - 1
src/_health/pages/move.tsx

@@ -38,6 +38,7 @@ export default function Move() {
     const [moreActive, setMoreActive] = useState(false)
     const [hours, setHours] = useState<any>([])
     const [startDate, setStarteDate] = useState('')
+    const [btnDisable,setBtnDisable] = useState(false)
 
     const [isPulling, setIsPulling] = useState(false)
     const [itemLayouts, setItemLayouts] = useState<any>([])
@@ -142,7 +143,7 @@ export default function Move() {
 
     function getMovesHistory(page) {
         setIndex(page)
-        setIsPulling(true)
+        // setIsPulling(true)
         setLoading(true)
         getActiveMoves({
             page: page,
@@ -247,6 +248,10 @@ export default function Move() {
             }
         })
 
+        if (btnDisable) return
+
+        setBtnDisable(true)
+
         thirdPartRequest(RequestType.RequestTypeWXRunData).then(res => {
             console.log(res)
             uploadActiveMoves({
@@ -273,9 +278,13 @@ export default function Move() {
                 jumpPage('./post_result?data=' + JSON.stringify((res as any).post_result))
                 getMovesCurrent()
                 getMovesHistory(1)
+                setBtnDisable(false)
+            }).catch(e=>{
+                setBtnDisable(false)
             })
         }).catch(_ => {
             dispatch(setResult({ isSuccess: false }) as any)
+            setBtnDisable(false)
         })
     }
 

+ 2 - 0
src/_health/pages/post_result.tsx

@@ -181,10 +181,12 @@ export default function PostResult() {
                             setShowSetting(true)
                         }}
                     >
+                        <View style={{marginRight:rpxToPx(8)}}>
                         {
                             data.next.reminder ? <IconNotification color={MainColorType.link} width={rpxToPx(26)} /> :
                                 <IconNotificationOff color={MainColorType.link} width={rpxToPx(26)} />
                         }
+                        </View>
 
                     </NewButton>
                 </View>

+ 10 - 2
src/_health/pages/streak_weekly.tsx

@@ -7,6 +7,7 @@ import { View, Text } from "@tarojs/components";
 import { useState } from "react";
 import { useTranslation } from "react-i18next";
 import '../../pages/clock/Clock2.scss'
+import NewButton, { NewButtonType } from "../base/new_button";
 
 let GradientText
 if (process.env.TARO_ENV == 'rn') {
@@ -37,13 +38,20 @@ export default function StreakWeekly() {
                 <Text className="index_section_title">{t('feature.track_time_duration.weekly.title')}</Text>
             </View>
             <WeekCalendar isFastSleep={true} />
-            <View className="vip_calendar" onClick={() => setShowEatCalendar(true)}>
+            <View style={{marginTop:30}}>
+                <NewButton 
+                    type={NewButtonType.link}
+                    title={t('feature.track_time_duration.weekly.show_eating_window')}
+                    onClick={() => setShowEatCalendar(true)}
+                />
+            </View>
+            {/* <View className="vip_calendar" onClick={() => setShowEatCalendar(true)}>
                 {
                     process.env.TARO_ENV == 'weapp' ? <Text className="eat_calendar_text">{t('feature.track_time_duration.weekly.show_eating_window')}</Text> :
                         <GradientText style={{ fontSize: rpxToPx(28), color: 'black', fontWeight: 'bold' }} colors={[ColorType.food, ColorType.activity]}>{t('feature.track_time_duration.weekly.show_eating_window')}</GradientText>
                 }
 
-            </View>
+            </View> */}
         </View>
         {
             showEatCalendar && <Modal

+ 5 - 5
src/app.scss

@@ -465,16 +465,16 @@ page {
     line-height: 60px;
 }
 
-.h42 {
-    font-size: 42px;
-    line-height: 50px;
-}
-
 .h44 {
     font-size: 44px;
     line-height: 52px;
 }
 
+.h42 {
+    font-size: 42px;
+    line-height: 50px;
+}
+
 .h36 {
     font-size: 36px;
     line-height: 44px;

BIN
src/assets/_health/guide_en.png


BIN
src/assets/_health/guide_zh.png


+ 1 - 1
src/context/locales/zh.js

@@ -43,7 +43,7 @@ export default {
             stone: '成为 Pro 会员',
             stone_desc: '解锁会员专享功能。',
             pro_member: 'Pro 会员',
-            member_desc: '{{time}} 到期',
+            member_desc: '{{time}} 到期',
             setting: '设置',
             reset_session: '重置session',
             debug_mode: '走查模式'

+ 0 - 1
src/features/health/MainConsole.scss

@@ -103,7 +103,6 @@
 }
 
 .main_summary_time {
-  font-size: 36px;
   color: #000;
   height: 48px;
   line-height: 48px;

+ 14 - 8
src/features/health/MainConsole.tsx

@@ -645,10 +645,6 @@ export default function MainConsole(props: { type: WindowType }) {
     }
 
     function tapSwitchBtn() {
-        if (!user.isLogin) {
-            jumpPage('/pages/account/ChooseAuth', 'ChooseAuth', navigation)
-            return
-        }
         switch (health.mode) {
             case 'FAST':
                 dispatch(setMode('EAT'));
@@ -798,10 +794,20 @@ export default function MainConsole(props: { type: WindowType }) {
     }
 
     function ogTime() {
-        return <View style={{ display: 'flex', flexDirection: 'row', alignItems: 'center', justifyContent: 'center' }}>
-            <View className="console_tag_bg" style={{backgroundColor:getThemeColor(health.mode)}}>
+        return <View className="h30 bold" style={{
+            display: 'flex',
+            color: '#fff',
+            borderRadius:rpxToPx(10),
+            minWidth:rpxToPx(137),
+            paddingLeft:rpxToPx(9),
+            paddingRight:rpxToPx(9),
+            boxSizing:'border-box',
+            height:rpxToPx(48),
+            flexDirection: 'row', alignItems: 'center', justifyContent: 'center', backgroundColor: getThemeColor(health.mode)
+        }}>
+            {/* <View className="console_tag_bg" style={{backgroundColor:getThemeColor(health.mode)}}>
                 <Image src={global.language=='en'?require('@assets/_health/tag_log.png'):require('@assets/_health/tag_record.png')} className="console_tag_img"/>
-            </View>
+            </View> */}
             {
                 getCountownTime(health.windows, health.mode)
             }
@@ -811,7 +817,7 @@ export default function MainConsole(props: { type: WindowType }) {
     return <View className="main-console-bg">
         <Image className="main_arrow" src={require('@assets/images/center_arrow.png')} />
         <View className="main_summary">
-            <View className="main_summary_time bold" style={{
+            <View className="main_summary_time h30 bold" style={{
                 marginTop: rpxToPx(14),
                 // color: getTitleColor()
             }} >{getScenario(health.windows, health.mode).status == 'OG' ? ogTime() : getDuration(health.windows, health.mode)}

+ 3 - 3
src/features/health/hooks/health_hooks.tsx

@@ -90,9 +90,9 @@ export function getCountownTime(windows: any, mode: any) {
         case WindowStatusType.upcoming:
             stringTime = TimeFormatter.countdown(now, scenario.target.start_timestamp)
     }
-    if (stringTime.indexOf('0')==0){
-        stringTime = stringTime.substring(1,stringTime.length)
-    }
+    // if (stringTime.indexOf('0')==0){
+    //     stringTime = stringTime.substring(1,stringTime.length)
+    // }
     return stringTime
 }
 

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

@@ -72,8 +72,6 @@
     line-height: 28px;
     letter-spacing: -2px;
     height: 28px;
-    color: #b2b2b2;
-    opacity: 0.4;
     font-weight: 400;
 }
 

+ 1 - 1
src/features/trackSomething/components/MetricItem.tsx

@@ -81,7 +81,7 @@ export default function Component(props: {
             valueContent()
         }
         <View className="metric_desc_bg" onClick={() => props.onClickDetail()}>
-            <Text className="mteric_desc">{props.desc}</Text>
+            <Text className="mteric_desc g02">{props.desc}</Text>
             {
                 props.showDetail && <Image src={require('@assets/images/arrow3.png')} className="metric_arrow" />
             }

+ 2 - 2
src/features/trackSomething/components/MetricModalChoose.tsx

@@ -163,8 +163,8 @@ export default function Component(props: {
 
                                         <Text className='modal_item_text' style={{ color: color, marginLeft: 10, marginRight: 10 }}>{obj.name}</Text>
                                         {
-                                            obj.classification != 'single' && <View className="metric_tag_bg" style={{ position: 'relative' }}>
-                                                <Text className="metric_tag_text" style={{ color: color }}>{obj.classification == 'combo' ? t('feature.track_something.metric.combo') : t('feature.track_something.metric.derived')}</Text>
+                                            obj.classification != 'single' && <View className="metric_tag_bg" style={{ position: 'relative',backgroundColor:props.themeColor }}>
+                                                <Text className="metric_tag_text" style={{ color: '#fff' }}>{obj.classification == 'combo' ? t('feature.track_something.metric.combo') : t('feature.track_something.metric.derived')}</Text>
                                             </View>
                                         }
                                         <View style={{ flex: 1 }} />

+ 11 - 11
src/features/trackTimeDuration/components/Rings.weapp.tsx

@@ -316,26 +316,26 @@ export default function Rings(props: {
             const yPrime = center + r * Math.sin(radians);
 
             ctx.beginPath();
-            var dotLineWidth = 1
+            var dotLineWidth = 2.5
             // if (lineWidth == 28) {
             //     dotLineWidth = 4
 
             // }
-            ctx.arc(xPrime, yPrime, lineWidth / 2.0 + dotLineWidth / 2, 0, 2 * Math.PI);
+            ctx.arc(xPrime, yPrime, lineWidth / 2.0 + dotLineWidth / 2-0.75, 0, 2 * Math.PI);
             ctx.lineWidth = dotLineWidth;
-            ctx.fillStyle = props.currentDot.borderColor
-            ctx.fill()
+            // ctx.fillStyle = props.currentDot.borderColor
+            // ctx.fill()
             ctx.strokeStyle = props.currentDot.borderColor//'#1C1C1C';
             ctx.lineCap = 'round'; // 设置为圆角
             ctx.stroke();
 
-            if (props.currentDot.color != '#ffffffff') {
-                ctx.beginPath();
-                // ctx.translate(xPrime, yPrime)
-                ctx.arc(xPrime, yPrime, (lineWidth-1) / 2 * dotScale, 0, 2 * Math.PI, false);
-                ctx.fillStyle = props.currentDot.color;
-                ctx.fill();
-            }
+            // if (props.currentDot.color != '#ffffffff') {
+            //     ctx.beginPath();
+            //     // ctx.translate(xPrime, yPrime)
+            //     ctx.arc(xPrime, yPrime, (lineWidth-1) / 2 * dotScale, 0, 2 * Math.PI, false);
+            //     ctx.fillStyle = props.currentDot.color;
+            //     ctx.fill();
+            // }
 
 
 

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

@@ -47,7 +47,7 @@
     position: absolute;
     top: 0;
     bottom: 0;
-    background-color: #5A5A5A;
+    background-color: #999999;
     -webkit-transform: scaleX(0.5);
     transform: scaleX(0.5);
     transform-origin: left;
@@ -58,7 +58,7 @@
     position: absolute;
     left: 0;
     right: 0;
-    background-color: #5A5A5A;
+    background-color: #999999;
     -webkit-transform: scaleY(0.5);
     transform: scaleY(0.5);
     height: 2px;

+ 3 - 3
src/features/trackTimeDuration/components/WeekCalendarItem.tsx

@@ -220,9 +220,9 @@ export default function WeekCalendarItem(props: { data: any, isCurrentWeek: bool
             <View className="verticalLine" style={{ left: parseInt(rpxToPx(94 * 4) + '') }} />
             <View className="verticalLine" style={{ left: parseInt(rpxToPx(94 * 5) + '') }} />
             <View className="verticalLine" style={{ left: parseInt(rpxToPx(94 * 6) + '') }} />
-            <View className="horizontalLine" style={{ top: rpxToPx(100), backgroundColor: '#262626' }} />
-            <View className="horizontalLine" style={{ top: rpxToPx(200), backgroundColor: '#383838' }} />
-            <View className="horizontalLine" style={{ top: rpxToPx(300), backgroundColor: '#262626' }} />
+            <View className="horizontalLine" style={{ top: rpxToPx(100) }} />
+            <View className="horizontalLine" style={{ top: rpxToPx(200) }} />
+            <View className="horizontalLine" style={{ top: rpxToPx(300) }} />
             {
                 charts.map((item, index) => {
                     return <View className="lineContent" key={index * 9527} style={{ left: rpxToPx(94 * index) }}>

+ 3 - 3
src/pages/account/Album.tsx

@@ -52,7 +52,7 @@ export default function Album() {
     }
 
     function getAlbumsData(str, index = 1) {
-        setIsPulling(true)
+        // setIsPulling(true)
         setLoading(true)
         getAlbums({
             page: index,
@@ -252,7 +252,7 @@ export default function Album() {
                         style={{ backgroundColor: window == '' ? '#B2B2B21A' : 'transparent' }}
                     >
                         <Text className={window == '' ? 'bold h30' : 'h30'}
-                            style={{ color: window == '' ? '#000' : MainColorType.g01 }}>全部 <Text className="h20" style={{ lineHeight: '20px', verticalAlign: 'text-top' }}>{stat.total}</Text></Text>
+                            style={{ color: window == '' ? '#000' : MainColorType.g01 }}>全部 <Text className="h20" style={{ lineHeight: '20px', verticalAlign: 'middle' }}>{stat.total}</Text></Text>
                     </View>
                 </NewButton>
 
@@ -267,7 +267,7 @@ export default function Album() {
                                     style={{ backgroundColor: window == item.window ? getThemeColor(item.window) + '1A' : 'transparent' }}
                                 >
                                     <Text className={window == item.window ? 'bold h30' : 'h30'}
-                                        style={{ color: window == item.window ? getThemeColor(item.window) : MainColorType.g01 }}>{item.window} <Text className="h20" style={{ lineHeight: '20px', verticalAlign: 'text-top' }}>{item.image_count}</Text></Text>
+                                        style={{ color: window == item.window ? getThemeColor(item.window) : MainColorType.g01 }}>{item.window} <Text className="h20" style={{ lineHeight: '20px', verticalAlign: 'middle' }}>{item.image_count}</Text></Text>
                                 </View>
                             </NewButton>
                         </View>

+ 0 - 1
src/pages/account/Profile.tsx

@@ -328,7 +328,6 @@ export default function Page() {
                             <View style={{ width: rpxToPx(8) }} />
                             <View className="h34 bold" style={{ color: MainColorType.blue }}>成为 Pro 会员</View>
                         </View>
-
                         <View className="h24" style={{ color: MainColorType.g02, marginTop: rpxToPx(12) }}>{isMember() ? memberdesc() : '解锁会员专项功能'}</View>
                         <View style={{ height: rpxToPx(18), flexShrink: 0 }} />
                     </View>