Leon 2 rokov pred
rodič
commit
3f9328b026

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

@@ -550,7 +550,7 @@
 				CODE_SIGN_ENTITLEMENTS = hola/hola.entitlements;
 				CODE_SIGN_IDENTITY = "Apple Development";
 				CODE_SIGN_STYLE = Automatic;
-				CURRENT_PROJECT_VERSION = 14;
+				CURRENT_PROJECT_VERSION = 15;
 				DEVELOPMENT_TEAM = GPMXAZ9G5N;
 				ENABLE_BITCODE = NO;
 				INFOPLIST_FILE = hola/Info.plist;
@@ -583,7 +583,7 @@
 				CODE_SIGN_ENTITLEMENTS = hola/hola.entitlements;
 				CODE_SIGN_IDENTITY = "Apple Development";
 				CODE_SIGN_STYLE = Automatic;
-				CURRENT_PROJECT_VERSION = 14;
+				CURRENT_PROJECT_VERSION = 15;
 				DEVELOPMENT_TEAM = GPMXAZ9G5N;
 				INFOPLIST_FILE = hola/Info.plist;
 				LD_RUNPATH_SEARCH_PATHS = (

Rozdielové dáta súboru neboli zobrazené, pretože súbor je príliš veľký
+ 0 - 0
ios/main.jsbundle


+ 6 - 6
src/components/input/PickerViews.tsx

@@ -52,8 +52,8 @@ const Component = forwardRef((props: {
         <Text className='modal_title' style={{ color: color }}>{props.title ? props.title : '测试标题 '}</Text>
         <PickerView value={v}
             // color='#fff'
-            itemStyle={{color:'#fff'}}
-            style={{color:'#fff'}}
+            itemStyle={{ color: '#fff' }}
+            style={{ color: '#fff' }}
             onChange={onPickerChange}
             indicatorStyle='height: 50px;'
             immediateChange={true}
@@ -62,10 +62,10 @@ const Component = forwardRef((props: {
         >
             {
                 props.items.map(item => {
-                    return <PickerViewColumn style={{color:'red'}} >
+                    return <PickerViewColumn style={{ color: 'red' }} >
                         {item.map(obj => {
                             return (
-                                <Text style={{ display: 'flex', alignItems: 'center', justifyContent: 'center', color: '#fff'}}>{obj}</Text>
+                                <Text style={{ display: 'flex', alignItems: 'center', justifyContent: 'center', color: '#fff' }}>{obj}</Text>
                             );
                         })}
                     </PickerViewColumn>
@@ -79,11 +79,11 @@ const Component = forwardRef((props: {
                     e.stopPropagation()
                 }; props.onCancel!()
             }}>
-                <Text className='modal_cancel_text' style={{ color: color }}>{t('feature.common.picker_cancel_btn')}</Text>
+                <Text className='modal_cancel_text' style={{ color: color, fontWeight: 'bold' }}>{t('feature.common.picker_cancel_btn')}</Text>
             </View>
             <View className='btn_space' />
             <View className='modal_btn' style={{ backgroundColor: color }} onClick={confirm}>
-                <Text className='modal_confirm_text' style={{ color: '#000' }}>{t('feature.common.picker_confirm_btn')}</Text>
+                <Text className='modal_confirm_text' style={{ color: '#000', fontWeight: 'bold' }}>{t('feature.common.picker_confirm_btn')}</Text>
             </View>
 
 

+ 9 - 0
src/context/locales/en.js

@@ -44,6 +44,15 @@ export default {
             sleep_title: 'Sleep Schedule',
             fast_subtitle: 'Set time and duration goals',
             sleep_subtitle: 'Set time and duration goals',
+            fast_target:'断食目标',
+            fast_target_desc:'计划每日断食{{target_time}}, 其余{{left_time}}进食。',
+            fast_schedule:'断食日程',
+            fast_schedule_desc:'计划每日{{start_time}}开始断食, {{next_day}}{{end_time}}结束断食。',
+            sleep_target:'睡眠目标',
+            sleep_target_desc:'计划每日睡眠{{target_time}}, 其余{{left_time}}清醒。',
+            sleep_schedule:'睡眠日程',
+            sleep_schedule_desc:'计划每日{{start_time}}开始睡眠, {{next_day}}{{end_time}}结束睡眠。',
+            next_day:'Next day'
         },
         choose_language: {
             title: '',

+ 31 - 8
src/features/trackSomething/components/MoveOrderList.rn.tsx

@@ -42,6 +42,16 @@ export default function Component(props: { array: any, itemHeight: number, color
 
     }, [])
 
+    function touchStart(e, index) {
+        setChangedIndex(index)
+        setStartOffsetY(index*props.itemHeight)
+        setStartPageY(e.touches[0].pageY)
+        setDragIndex(index)
+        setDragElement(list[index])
+        setMovaleViewY(index*props.itemHeight)
+        setCanScroll(false)
+    }
+
     function longPress(e, index) {
         alert('long press')
         setChangedIndex(index)
@@ -55,9 +65,10 @@ export default function Component(props: { array: any, itemHeight: number, color
 
     function touchMove(e) {
         if (dragElement) {
-            let clientY = e.touches[0].clientY;
+
+            let clientY = e.nativeEvent.locationY;
             pageScroll(clientY);
-            let pageY = e.touches[0].pageY;
+            let pageY = e.nativeEvent.pageY;
             let targetMoveDistance = pageY - startPageY
             let movaleViewY2 = startOffsetY + targetMoveDistance
 
@@ -182,13 +193,15 @@ export default function Component(props: { array: any, itemHeight: number, color
             return -1;  // 上滑
         }
     }
+
     return <View id="myScrollView" ref={ref} style={{ height: '100%', overflow: canScroll ? 'scroll' : 'hidden' }} catchMove>
         <MovableArea style={{ height: list.length * props.itemHeight, width: rpxToPx(750) }}>
             <View>
                 {
                     list.map((item, index) => {
-                        return <View key={index} style={{ opacity: changedIndex == index && hiddenContent ? 0 : 1, height: props.itemHeight, width: rpxToPx(750),backgroundColor:'pink' }}
-                            onLongPress={(e) => longPress(e, index)}
+                        return <View key={index} style={{ opacity: changedIndex == index && hiddenContent ? 0 : 1, height: props.itemHeight, width: rpxToPx(750) }}
+                            // onLongPress={(e) => longPress(e, index)}
+                            onTouchStart={(e) => touchStart(e, index)}
                             onTouchMove={(e) => touchMove(e)}
                             onTouchEnd={(e) => touchEnd(e)}
                         >
@@ -199,7 +212,7 @@ export default function Component(props: { array: any, itemHeight: number, color
                                     width: '100%',
                                     alignItems: 'center', justifyContent: 'space-between'
                                 }}>
-                                    <Text style={{ color: props.color,fontSize:rpxToPx(32) }}>{item.name}</Text>
+                                    <Text style={{ color: props.color, fontSize: rpxToPx(32) }}>{item.name}</Text>
                                     <IconDrag width={17} height={12} />
 
                                 </View>
@@ -208,11 +221,21 @@ export default function Component(props: { array: any, itemHeight: number, color
                         </View>
                     })
                 }
+                <View style={{position:'absolute',left:0,width:rpxToPx(750),top:movaleViewY,height: changedIndex >= 0 ? props.itemHeight : 0}}>
+                    <View className='drag_item' style={{ backgroundColor: props.color }}>
+                        {
+                            dragIndex >= 0 && <View className='modal_sel_item' style={{ height: 40, border: 'none' }}>
+                                <Text style={{ color: 'black', fontWeight: 'bold' }}>{list[changedIndex].name}</Text>
+                                <IconDrag width={17} height={12} />
+                            </View>
+                        }
+                    </View>
+                </View>
 
-                <MovableView style={{ height: changedIndex >= 0 ? props.itemHeight : 0, width: rpxToPx(750),backgroundColor:'red' }}
+                {/* <MovableView style={{ height: changedIndex >= 0 ? props.itemHeight : 0, width: rpxToPx(750),backgroundColor:'red' }}
                     direction='vertical'
                     disabled
-                    animation={false}
+                    animation={true}
                     y={movaleViewY}
                 >
                     <View className='drag_item' style={{ backgroundColor: props.color }}>
@@ -223,7 +246,7 @@ export default function Component(props: { array: any, itemHeight: number, color
                             </View>
                         }
                     </View>
-                </MovableView>
+                </MovableView> */}
             </View>
         </MovableArea>
     </View>

+ 33 - 4
src/features/trackTimeDuration/components/SetSchedule.rn.tsx

@@ -348,7 +348,24 @@ export default function Component() {
             cancel={() => { setIsTimeOpen(false) }} />
     }
 
+    function getTargetDesc() {
+        var count = 24*60-(hours * 60 + minutes)
+        var leftHours = Math.floor(count/60)
+        var leftMinutes = count%60
+        return scenario.step == 'fast' ? t('page.set_schedule.fast_target_desc', {
+            target_time: (hours > 0 ? hours + TimeFormatter.getPickerDurationHoursUnit() : '') + (minutes > 0 ? minutes + TimeFormatter.getPickerDurationMinutesUnit() : ''), 
+            left_time: (leftHours > 0 ? leftHours + TimeFormatter.getPickerDurationHoursUnit() : '') + (leftMinutes > 0 ? leftMinutes + TimeFormatter.getPickerDurationMinutesUnit() : '')
+        }) :
+            t('page.set_schedule.sleep_target_desc', {
+                target_time: (hours > 0 ? hours + TimeFormatter.getPickerDurationHoursUnit() : '') + (minutes > 0 ? minutes + TimeFormatter.getPickerDurationMinutesUnit() : ''), 
+                left_time: (leftHours > 0 ? leftHours + TimeFormatter.getPickerDurationHoursUnit() : '') + (leftMinutes > 0 ? leftMinutes + TimeFormatter.getPickerDurationMinutesUnit() : '')
+            })
+    }
+
     function detail() {
+        var isNextDay: boolean = parseInt(startTime.split(':')[0]) * 60 + parseInt(startTime.split(':')[1]) > parseInt(endTime.split(':')[0]) * 60 + parseInt(endTime.split(':')[1])
+
+
         return <View style={{ height: Taro.getSystemInfoSync().screenHeight - 200, flexDirection: 'column', display: 'flex' }}>
             {/* <Text className="subtitle">{t('page.set_schedule.fast_subtitle')}</Text> */}
             <TitleView title={scenario.step == 'fast' ? t('page.set_schedule.fast_title') : t('page.set_schedule.sleep_title')}
@@ -357,16 +374,16 @@ export default function Component() {
             />
 
             <View style={{ color: '#fff', marginTop: rpxToPx(64) }}>
-                <Text className="cell_header">{scenario.step == 'fast' ? '断食目标' : '睡眠目标'}</Text>
+                <Text className="cell_header">{scenario.step == 'fast' ? t('page.set_schedule.fast_target') : t('page.set_schedule.sleep_target')}</Text>
                 <View className="cell_full" onClick={() => { setIsModalTimePicker(false); setIsOpen(true) }}>
                     <Text className="cell_title">{t('feature.track_time_duration.dial.duration')}</Text>
                     <Text className="cell_value" style={{ color: scenario.step == 'fast' ? ColorType.fast : ColorType.sleep }}>{hours > 0 ? hours + TimeFormatter.getPickerDurationHoursUnit() : ''}{minutes > 0 ? minutes + TimeFormatter.getPickerDurationMinutesUnit() : ''}</Text>
                     <Image className="cell_arrow" src={require('@/assets/images/arrow3.png')} />
                 </View>
-                <Text className="cell_footer">时长描述</Text>
+                <Text className="cell_footer">{getTargetDesc()}</Text>
 
                 <View style={{ height: rpxToPx(60) }} />
-                <Text className="cell_header">{scenario.step == 'fast' ? '断食日程' : '睡眠日程'}</Text>
+                <Text className="cell_header">{scenario.step == 'fast' ? t('page.set_schedule.fast_schedule') : t('page.set_schedule.sleep_schedule')}</Text>
                 <View className="cell_top" onClick={() => {
                     setIsModalTimePicker(true)
                     setChooseStart(true)
@@ -383,10 +400,22 @@ export default function Component() {
                     setIsTimeOpen(true)
                 }}>
                     <Text className="cell_title">{t('feature.track_time_duration.dial.end_time')}</Text>
+                    {
+                        isNextDay &&
+                        <Text className="next_day">{t('page.set_schedule.next_day')}</Text>
+                    }
+
                     <Text className="cell_value" style={{ color: scenario.step == 'fast' ? ColorType.fast : ColorType.sleep }}>{endTime}</Text>
                     <Image className="cell_arrow" src={require('@/assets/images/arrow3.png')} />
                 </View>
-                <Text className="cell_footer">日程描述</Text>
+                <Text className="cell_footer">{scenario.step == 'fast' ? t('page.set_schedule.fast_schedule_desc', {
+                    start_time: startTime, end_time: endTime, next_day:
+                        isNextDay ? t('page.set_schedule.next_day') : ''
+                }) :
+                    t('page.set_schedule.sleep_schedule_desc', {
+                        start_time: startTime, end_time: endTime, next_day:
+                            isNextDay ? t('page.set_schedule.next_day') : ''
+                    })}</Text>
                 {/* <Text className="cell_footer">计划每日18:00开始断食,次日10:00结束断食。</Text> */}
             </View>
 

+ 7 - 0
src/features/trackTimeDuration/components/SetSchedule.scss

@@ -86,4 +86,11 @@
 .schedule_text_key{
     color: #fff;
     opacity: 0.6;
+}
+
+.next_day{
+    margin-right: 10px;
+    font-size: 28px;
+    color: #fff;
+    opacity: 0.4;
 }

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

@@ -60,7 +60,7 @@ export async function request<T>(param: RequestParam): Promise<T> {
         header['content-type'] = 'application/json'
         header['X-Time-Zone'] = timeZoneFormatted; //new Date().getTimezoneOffset() / 60
         header['X-Platform'] = 'IOS'; //IOS ANDROID
-        header['X-Lang'] = 'zh' //zh en
+        header['X-Lang'] = process.env.TARO_ENV=='rn'?'en':'zh' //zh en
         header['X-Client-Type'] = 'WX_APP' //WX_APP APP
         header['X-Client_Version'] = '1.0'
         if (token.length > 0) {

Niektoré súbory nie sú zobrazené, pretože je v týchto rozdielových dátach zmenené mnoho súborov