Leon 2 lat temu
rodzic
commit
25c6bc2f50

+ 7 - 0
src/app.scss

@@ -96,4 +96,11 @@ page {
 
 wx-scroll-view {
     -webkit-overflow-scrolling: auto !important;
+}
+
+::-webkit-scrollbar {
+    display: none;
+    width: 0;
+    height: 0;
+    color: transparent;
 }

BIN
src/assets/images/add.png


+ 1 - 1
src/components/layout/layout.scss

@@ -25,7 +25,7 @@
 .layout_title_view{
     display: flex;
     flex-shrink: 0;
-    margin-top: 10px;
+    margin-top: 24px;
     margin-bottom: 10px;
 }
 

+ 10 - 0
src/components/layout/layout.tsx

@@ -14,6 +14,7 @@ export default function Layout(props: {
     more?: Function,
     triggered?: boolean,
     title?: string,
+    header?: React.ReactNode,
     titleShowStyle: NaviBarTitleShowType
 }) {
     const { children, type, triggered } = props;
@@ -99,6 +100,15 @@ export default function Layout(props: {
                     </View>
                 }
                 {children}
+                <View style={{ height: 50 }} />
+            </View>
+        case TemplateType.customHeader:
+            return <View className='flex'>
+                {
+                    props.header
+                }
+                {children}
+                <View style={{ height: 50 }} />
             </View>
     }
     return <View />

+ 5 - 1
src/components/view/Timeline.scss

@@ -2,6 +2,8 @@
   display: flex;
   flex-direction: column;
   color: #fff;
+  max-height: 70vh;
+  overflow-y: scroll;
   // width: 100%;
   // margin-top: 20px;
   // background-color: aqua;
@@ -45,10 +47,12 @@
 
 .timeline-text {
   margin-bottom: 5px;
+  opacity: 0.7;
 }
 
 .timeline-time {
   color: #999;
+  opacity: 0.7;
 }
 
 .timeline-content-row {
@@ -56,7 +60,7 @@
   display: flex;
   flex-direction: row;
   align-items: center;
-  width: 406px;
+  width: 506px;
   // justify-content: space-between;
   padding-bottom: 16px;
   border-bottom-style: solid;

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

@@ -5,7 +5,7 @@ import { deleteActivityRecord } from "@/services/trackSomething";
 import { useEffect, useState } from "react";
 import { useSelector } from "react-redux";
 import Modal from "@/components/layout/Modal";
-import { ModalType } from "@/utils/types";
+import { ModalType, TimelineType } from "@/utils/types";
 import Timeline from "@/components/view/Timeline";
 import { TimeFormatter } from "@/utils/time_format";
 
@@ -69,7 +69,7 @@ export default function Component(props: { records: any[] }) {
             )
         }
         return <View>
-            <Timeline items={timelineItems} title={formateDate(item.date + '')} />
+            <Timeline items={timelineItems} title={formateDate(item.date + '')} type={TimelineType.timeSecond}/>
         </View>
     }
 

+ 17 - 14
src/features/trackTimeDuration/actions/TrackTimeActions.tsx

@@ -2,19 +2,22 @@ import { recordCheck } from "@/services/trackTimeDuration";
 import trackTimeService, { machine } from "@/store/trackTimeMachine"
 
 export const startFast = (start_time: number, duration: number) => {
-    duration = duration<3600*1000?3600*1000:duration;
-    // const duration = fastValues[0] * 3600 * 1000 + fastValues[1] * 60 * 1000
-    const extra = {
-        set_time: global.set_time,
-        confirm_time: new Date().getTime(),
-    }
-    recordCheck({
-        action: 'FAST_START',
-        real_check_time: start_time,
-        target_duration: duration,
-        extra: extra
-    }).then(res => {
-        trackTimeService.send({ type: 'START_FAST' });
+    return new Promise((resolve) => {
+        duration = duration < 3600 * 1000 ? 3600 * 1000 : duration;
+        // const duration = fastValues[0] * 3600 * 1000 + fastValues[1] * 60 * 1000
+        const extra = {
+            set_time: global.set_time,
+            confirm_time: new Date().getTime(),
+        }
+        recordCheck({
+            action: 'FAST_START',
+            real_check_time: start_time,
+            target_duration: duration,
+            extra: extra
+        }).then(res => {
+            resolve(res)
+            trackTimeService.send({ type: 'START_FAST' });
+        });
     });
 }
 
@@ -36,7 +39,7 @@ export const endFast = (start_time: number) => {
 
 
 export const startSleep = (start_time: number, duration: number) => {
-    duration = duration<3600*1000?3600*1000:duration;
+    duration = duration < 3600 * 1000 ? 3600 * 1000 : duration;
     // const duration = sleepValues[0] * 3600 * 1000 + sleepValues[1] * 60 * 1000
     const extra = {
         set_time: global.set_time,

+ 10 - 3
src/features/trackTimeDuration/components/Console.tsx

@@ -2,7 +2,7 @@
 import { View, Text, PickerView } from "@tarojs/components";
 import { useEffect, useRef, useState } from "react";
 import { TimeFormatter } from "@/utils/time_format";
-import { useSelector } from "react-redux";
+import { useDispatch, useSelector } from "react-redux";
 import Taro from "@tarojs/taro";
 import LimitPickers from '@/components/input/LimitPickers';
 import { endFast, endSleep, startFast, startSleep } from "../actions/TrackTimeActions";
@@ -13,6 +13,7 @@ import Stepper from "@/components/input/Stepper";
 import { EndFastBtn, EndSleepBtn, StartFastBtn, StartSleepBtn } from "@/features/common/SpecBtns";
 import Box from "@/components/layout/Box";
 import './Console.scss'
+import { ConsoleType, changeConsoleStatus } from "@/store/console";
 
 export default function Component(props: { isNextStep?: boolean }) {
     const scenario = useSelector((state: any) => state.scenario);
@@ -27,7 +28,7 @@ export default function Component(props: { isNextStep?: boolean }) {
     const [sleepPickerValue, setSleepPickerValue] = useState([0, 0])
     const limitPickerRef = useRef(null)
     const durationPickerRef = useRef(null)
-
+    const dispatch = useDispatch();
 
     useEffect(() => {
         getStateDetail();
@@ -199,7 +200,13 @@ export default function Component(props: { isNextStep?: boolean }) {
 
         if (isFast) {
             if (time.status == 'WAIT_FOR_START') {
-                startFast(t, fastDuration);
+                startFast(t, fastDuration).then(res=>{
+                    if ((res as any).current_record.scenario=='FAST_SLEEP' &&
+                    (res as any).current_record.status=='ONGOING1'){
+                        global.consoleType = 'going'
+                        dispatch(changeConsoleStatus({status:ConsoleType.going}));
+                    }
+                });
             }
             else {
                 endFast(t)

+ 18 - 15
src/features/trackTimeDuration/components/RecordFastSleep.tsx

@@ -68,15 +68,17 @@ export default function RecordFastSleep(props: { data: any, type: string, delSuc
                     </View>
                 }
                 <View style={{ position: 'relative' }}>
-                    <View style={{ opacity: global.segmentIndex == 0 ? 1 : 0 }}>
+                    <View style={{ opacity: segmentIndex == 0 ? 1 : 0 }}>
                         <TimelineFastSleep data={props.data} />
                     </View>
-                    <View style={{
-                        position: 'absolute', left: 0, top: 0, right: 0, bottom: 0,
-                        opacity: global.segmentIndex == 1 ? 1 : 0
-                    }}>
-                        <Stage data={props.data} />
-                    </View>
+                    {
+                        props.data.scenario == 'FAST_SLEEP' && <View style={{
+                            position: 'absolute', left: 0, top: 0, right: 0, bottom: 0,
+                            opacity: segmentIndex == 1 ? 1 : 0
+                        }}>
+                            <Stage data={props.data} />
+                        </View>
+                    }
 
                 </View>
             </View>
@@ -90,14 +92,15 @@ export default function RecordFastSleep(props: { data: any, type: string, delSuc
             setShowDetailModal(true)
             return;
         }
-        // 
-        var node = (<Modal children={schedules()}
-            modalType={ModalType.center}
-            dismiss={() => {
-                global.showModal(false, null)
-            }}
-            confirm={() => { }} />);
-        global.showModal(true, node);
+        setShowDetailModal(true)
+
+        // var node = (<Modal children={schedules()}
+        //     modalType={ModalType.center}
+        //     dismiss={() => {
+        //         global.showModal(false, null)
+        //     }}
+        //     confirm={() => { }} />);
+        // global.showModal(true, node);
     }
 
     function getDuration(obj) {

+ 8 - 0
src/features/trackTimeDuration/components/Schedule.scss

@@ -41,4 +41,12 @@
     opacity: 0.8;
     font-size: 28px;
 
+}
+
+.schedule_more{
+    display: flex;
+    flex-direction: row;
+    height: 84px;
+    align-items: center;
+    color: #AAFF00;
 }

+ 33 - 15
src/features/trackTimeDuration/components/Schedule.tsx

@@ -10,9 +10,11 @@ import Switch from "@/components/input/Switch";
 import { useDispatch, useSelector } from "react-redux";
 import { TimeFormatter } from "@/utils/time_format";
 import Buttons from "@/components/basic/Buttons";
-import { ButtonType } from "@/utils/types";
+import { ButtonType, ModalType } from "@/utils/types";
 import { setStep } from "@/store/scenario";
 import Segment from "@/components/navigation/Segment";
+import Modal from "@/components/layout/Modal";
+import Stage from "./Stage";
 
 
 export default function Component(props: { type?: string, data?: any, delSuccess?: Function }) {
@@ -20,6 +22,7 @@ export default function Component(props: { type?: string, data?: any, delSuccess
     const permission = useSelector((state: any) => state.permission);
     const common = useSelector((state: any) => state.common);
     const time = useSelector((state: any) => state.time);
+    const [showModal, setShowModal] = useState(false)
     const dispatch = useDispatch();
 
     function all() {
@@ -31,7 +34,7 @@ export default function Component(props: { type?: string, data?: any, delSuccess
     }
 
     function showStage() {
-
+        setShowModal(true)
     }
 
     function followWxPub() {
@@ -83,9 +86,9 @@ export default function Component(props: { type?: string, data?: any, delSuccess
             height: 18,
             display: 'flex', flexDirection: 'row', width: '100%',
             justifyContent: 'space-between', alignItems: 'center',
-            marginBottom:6,paddingRight:10,boxSizing:'border-box'
+            marginBottom: 6, paddingRight: 10, boxSizing: 'border-box'
         }}>
-            <Text style={{fontSize:18,lineHeight:18,fontWeight:500}}>{permission.wxPubFollow ? TimeFormatter.getDateAndWeek() : '日程提醒'}</Text>
+            <Text style={{ fontSize: 18, lineHeight: 18, fontWeight: 500 }}>{permission.wxPubFollow ? TimeFormatter.getDateAndWeek() : '日程提醒'}</Text>
             {
                 !permission.wxPubFollow && <View >
                     <Switch isOn={permission.wxPubFollow} onClick={() => followWxPub()} />
@@ -144,18 +147,23 @@ export default function Component(props: { type?: string, data?: any, delSuccess
         today.setHours(0)
         today.setMinutes(0)
         today.setSeconds(0)
-        if (nextCheckTimestamp!=0 && today.getTime()>nextCheckTimestamp){
+        if (nextCheckTimestamp != 0 && today.getTime() > nextCheckTimestamp) {
             return <View className="tip_bg2">
                 <Text className="tip_text2">完成当前记录,恢复今天的日程。</Text>
             </View >
         }
 
-        return <View style={{marginTop:10}}>
-            
+        return <View style={{ marginTop: 10 }}>
+
             <TimelineFastSleep data={props.data} />
-            <View>
-                <Text>show detail</Text>
-            </View>
+            {
+                props.data.scenario == 'FAST_SLEEP' && <View className="schedule_more" onClick={showStage}>
+                    <View style={{ flex: 1 }} />
+                    <Text style={{ textAlign: 'right' }}>{
+                        props.data.status == 'WAIT_FOR_START' ? 'Duration goals by stage' : 'Current stage'
+                    }</Text>
+                </View>
+            }
         </View>
     }
 
@@ -171,11 +179,6 @@ export default function Component(props: { type?: string, data?: any, delSuccess
             {
                 detailCenter()
             }
-            {
-                props.data.scenario == 'FAST_SLEEP' && (props.data.status == 'WAIT_FOR_START' ? <Text onClick={showStage}>Duration goals by stage</Text> : <Text onClick={showStage}>Current stage</Text>)
-            }
-
-
         </View >
     }
 
@@ -184,6 +187,21 @@ export default function Component(props: { type?: string, data?: any, delSuccess
         {
             detail()
         }
+        {
+            showModal && <Modal
+                modalType={ModalType.center}
+                confirm={() => { }}
+                dismiss={() => {
+                    setShowModal(false)
+                }}>
+                <View>
+                    <Text>Stage</Text>
+                    <View style={{ display: 'flex', flexDirection: 'column', alignItems: 'center' }}>
+                        <Stage data={time} />
+                    </View>
+                </View>
+            </Modal>
+        }
     </Box>
 
 

+ 64 - 0
src/features/trackTimeDuration/components/TitleView.scss

@@ -0,0 +1,64 @@
+.title_view{
+    height: 192px;
+    box-sizing: border-box;
+    width: 750px;
+    padding-left: 46px;
+    padding-right: 46px;
+    // background-color: palegoldenrod;
+    display: flex;
+    flex-direction: column;
+}
+
+.title {
+    flex-shrink: 0;
+    color: #fff;
+    font-size: 72px;
+    line-height: 72px;
+    font-weight: 500;
+}
+
+.title_bg{
+    display: flex;
+    flex-shrink: 0;
+    margin-top: 24px;
+    display: flex;
+    flex-direction: row;
+    align-items: center;
+    justify-content: space-between;
+}
+
+.icon {
+    width: 44px;
+    height: 44px;
+    padding: 20px;
+}
+
+.subcontent{
+    margin-top: 14px;
+    height: 48px;
+    display: flex;
+    flex-direction: row;
+    align-items: center;
+}
+
+.point{
+    width: 18px;
+    height: 18px;
+    border-radius: 9px;
+    margin-right: 10px;
+}
+
+.scenario{
+    display: flex;
+    flex-direction: row;
+    align-items: center;
+    margin-right: 24px;
+    
+}
+
+.name {
+    color: rgba(255,255,255,0.4);
+    font-size: 24px;
+    font-weight: 500;
+}
+

+ 84 - 0
src/features/trackTimeDuration/components/TitleView.tsx

@@ -0,0 +1,84 @@
+import { View, Text, Image } from '@tarojs/components'
+import './TitleView.scss'
+import { useSelector } from 'react-redux';
+
+export default function Component() {
+    const time = useSelector((state: any) => state.time);
+
+    function getFastName() {
+        var strName = '断食'
+        debugger
+        switch (time.scenario) {
+            case 'FAST':
+                {
+                    if (time.status == 'ONGOING') {
+                        strName = '断食进行中'
+                    }
+                }
+                break;
+            case 'SLEEP':
+                break;
+            case 'FAST_SLEEP':
+                {
+                    switch (time.status) {
+                        case 'ONGOING1':
+                        case 'ONGOING2':
+                        case 'ONGOING3':
+                            strName = '断食进行中'
+                            break;
+                    }
+                }
+                break;
+        }
+        
+        console.log(strName)
+        return strName
+    }
+
+    function getSleepName() {
+        var strName = '睡眠'
+        switch (time.scenario) {
+            case 'FAST':
+                break;
+            case 'SLEEP':
+                {
+                    if (time.status == 'ONGOING') {
+                        strName = '睡眠进行中'
+                    }
+                }
+                break;
+            case 'FAST_SLEEP':
+                {
+                    switch (time.status) {
+                        case 'ONGOING1':
+                            break;
+                        case 'ONGOING2':
+                            strName = '睡眠进行中'
+                            break;
+                        case 'ONGOING3':
+                            strName = '睡眠已结束'
+                            break;
+                    }
+                }
+                break;
+        }
+        return strName
+    }
+
+    return <View className='title_view'>
+        <View className='title_bg'>
+            <Text className='title'>时钟</Text>
+            <Image src={require('@/assets/images/add.png')} className='icon' />
+        </View>
+        <View className='subcontent'>
+            <View className='scenario'>
+                <View className='point' style={{ backgroundColor: '#AAFF00' }} />
+                <Text className='name'>{getFastName()}</Text>
+            </View>
+            <View className='scenario'>
+                <View className='point' style={{ backgroundColor: '#00FFFF' }} />
+                <Text className='name'>{getSleepName()}</Text>
+            </View>
+        </View>
+    </View>
+}

+ 5 - 0
src/pages/clock/Clock.scss

@@ -35,6 +35,11 @@
     height: 400px;
   }
 
+  .console_bg{
+    height: 440px;
+    overflow: hidden;
+  }
+
   .swiperItem{
     // height: 300px !important;
     // height: auto !important;

+ 69 - 15
src/pages/clock/Clock.tsx

@@ -30,6 +30,8 @@ import Layout from '@/components/layout/layout'
 import { CheckBoxType, NaviBarTitleShowType, TemplateType } from '@/utils/types'
 import { updateScenario } from '@/store/time'
 import { showModal } from '@/store/modal'
+import { ConsoleType, changeConsoleStatus } from '@/store/console'
+import TitleView from '@/features/trackTimeDuration/components/TitleView'
 // import TabBar from '../../components/Tabbar';
 
 export default function IndexPage() {
@@ -38,6 +40,7 @@ export default function IndexPage() {
   const user = useSelector((state: any) => state.user);
   const time = useSelector((state: any) => state.time);
   const common = useSelector((state: any) => state.common);
+  const consoleData = useSelector((state: any) => state.console);
   const [counter, setCounter] = useState(0)
   const [timerId, setTimerId] = useState(null)
   const [needShowAddTip, setNeedShowAddTip] = useState(false)
@@ -51,9 +54,11 @@ export default function IndexPage() {
   const [showModal2, setShowModal2] = useState(false)
   const [modalDetail2, setModalDetail2] = useState<any>({})
   const [showSingleFastEnd, setShowSingleFastEnd] = useState(false)
+  const [consoleStatus,setConsoleStatus] = useState(consoleData.status)
 
   global.dispatch = dispatch;
   useEffect(() => {
+    global.consoleType = 'idle'
     dispatch(staticResources() as any);
     // dispatch(gobalConfigs() as any);
     trackTimeService.onTransition(state => {
@@ -72,6 +77,27 @@ export default function IndexPage() {
 
   }, [])
 
+  useEffect(() => {
+    setConsoleStatus(consoleData.status)
+    switch (consoleData.status) {
+      // case ConsoleType.going:
+      //   setShowSingleFastEnd(true)
+      //   setTimeout(() => {
+      //     setShowSingleFastEnd(false)
+      //     setSwiperIndex(1)
+      //     setAutoPlay(true)
+      //     dispatch(changeConsoleStatus({ status: ConsoleType.end }))
+      //   }, 2000)
+      //   break
+      case ConsoleType.end:
+        setTimeout(() => {
+          dispatch(changeConsoleStatus({ status: ConsoleType.idle }))
+        }, 2000)
+
+        break
+    }
+  }, [consoleData.status])
+
   useEffect(() => {
     if (user.isLogin) {
       //检查用户是否添加过小程序
@@ -176,6 +202,7 @@ export default function IndexPage() {
 
   function getCheckData() {
     getClocks().then(res => {
+      console.log(consoleStatus)
       dispatch(updateScenario((res as any).current_record))
       dispatch(setConfigs((res as any).time_input_schema));
       dispatch(setScenario((res as any).scenario));
@@ -191,19 +218,41 @@ export default function IndexPage() {
       machine.context.currentStatus = `${key}.${status}`;//'mixed.ON_GOING2'
       setCheckData(res as any)
 
-      if ((res as any).current_record.status == 'ONGOING1') {
-        setShowSingleFastEnd(true)
-        setTimeout(() => {
-          setShowSingleFastEnd(false)
-          setSwiperIndex(1)
-          setAutoPlay(true)
-        }, 2000)
-
+      if ((res as any).current_record.status != 'ONGOING1') {
+        setSwiperIndex(0)
       }
       else {
-        setSwiperIndex(0)
-        setAutoPlay(false)
+        if (global.consoleType == 'going') {
+          
+          setShowSingleFastEnd(true)
+          setTimeout(() => {
+            setShowSingleFastEnd(false)
+            setSwiperIndex(1)
+            setAutoPlay(true)
+            global.consoleType = 'end'
+            dispatch(changeConsoleStatus({ status: ConsoleType.end }))
+            setTimeout(()=>{
+              global.consoleType = 'idle'
+            },2000)
+          }, 2000)
+        }
+        else {
+          console.log('bbb')
+        }
       }
+      // if ((res as any).current_record.status == 'ONGOING1') {
+      //   setShowSingleFastEnd(true)
+      //   setTimeout(() => {
+      //     setShowSingleFastEnd(false)
+      //     setSwiperIndex(1)
+      //     setAutoPlay(true)
+      //   }, 2000)
+
+      // }
+      // else {
+      //   setSwiperIndex(0)
+      //   setAutoPlay(false)
+      // }
 
     })
   }
@@ -251,21 +300,24 @@ export default function IndexPage() {
     setModalDetail2(detail)
   }
 
-
+  function headerView(){
+    return <TitleView />
+  }
   return (
-    <Layout type={TemplateType.flex} title='时钟' titleShowStyle={NaviBarTitleShowType.scrollToShow}>
+    <Layout type={TemplateType.customHeader} header={headerView()} title='时钟' titleShowStyle={NaviBarTitleShowType.scrollToShow}>
       <View style={{ flex: 1, flexDirection: 'column', display: 'flex', backgroundColor: '#000', color: '#fff' }}>
         {
           needShowAddTip && <Tooltip title="添加到我的小程序" closeTip={() => { setNeedShowAddTip(false) }} />
         }
 
-        <TitleBar />
+        {/* <TitleBar /> */}
         <Box>
           <View className='clock_bg'>
             <Clocks />
           </View>
         </Box>
 
+        <View className='console_bg'>
         {
           needSwiper() ? <Swiper className='swiper' indicatorColor='#333'
             indicatorActiveColor='#999'
@@ -273,12 +325,13 @@ export default function IndexPage() {
             autoplay={autoPlay}
             duration={300}
             interval={2000}
+            indicatorDots={global.consoleType =='idle'}
             onChange={(e) => {
               setSwiperIndex(e.detail.current)
               if (e.detail.current == 0)
                 setAutoPlay(false)
             }}
-            indicatorDots>
+          >
             <SwiperItem className='swiperItem'>
               <Console />
 
@@ -291,9 +344,10 @@ export default function IndexPage() {
             <Console isNextStep={showSingleFastEnd} />
 
         }
+        </View>
 
         {/* <Console /> */}
-        <More ref={global.moreRef} />
+        {/* <More ref={global.moreRef} /> */}
         {
           checkData && schedule()
         }

+ 4 - 2
src/pages/common/RecordsHistory.config.ts

@@ -1,4 +1,6 @@
 export default definePageConfig({
-    "disableScroll": true,
-    "navigationBarTitleText":""
+    "disableScroll": false,
+    "pullRefresh":true,
+    "navigationBarTitleText":"",
+    "enablePullDownRefresh":true
 })

+ 9 - 5
src/pages/common/RecordsHistory.tsx

@@ -68,10 +68,11 @@ export default function Page() {
         refresh()
     })
 
-    // useReachBottom(() => {
-    //     setPageIndex(pageIndex+1)
-    //     getHistory()
-    // })
+    useReachBottom(() => {
+        more()
+        // setPageIndex(pageIndex+1)
+        // getHistory()
+    })
 
     function refresh() {
         setIsLoading(true)
@@ -98,6 +99,7 @@ export default function Page() {
                 limit: pageSize,
                 only_finished: true
             }).then(res => {
+                Taro.stopPullDownRefresh()
                 setTriggered(false)
                 setTotal((res as any).total)
                 if (page == 1) {
@@ -116,6 +118,7 @@ export default function Page() {
                     code: '_walk'
                 }
             ).then(res => {
+                Taro.stopPullDownRefresh()
                 setTriggered(false)
                 setTotal((res as any).total)
                 if (page == 1) {
@@ -134,6 +137,7 @@ export default function Page() {
                     code: router.params.code
                 }
             ).then(res => {
+                Taro.stopPullDownRefresh()
                 setTriggered(false)
                 setTotal((res as any).total)
                 if (page == 1) {
@@ -221,7 +225,7 @@ export default function Page() {
     return <View style={{ position: 'relative' }}>
         <Layout children={showErrorPage ? <NoData refresh={() => { refresh() }} /> : detail()}
             title={router.params.title}
-            type={TemplateType.list}
+            type={TemplateType.flex}
             refresh={() => { refresh() }}
             triggered={triggered}
             more={() => { more() }}

+ 4 - 0
src/services/http/request.ts

@@ -58,6 +58,10 @@ export async function request<T>(param: RequestParam): Promise<T> {
         var timeZoneFormatted = split[split.length - 2];
 
         header['X-Time-Zone'] = timeZoneFormatted; //new Date().getTimezoneOffset() / 60
+        header['X-Platform'] = 'IOS'; //IOS ANDROID
+        header['X-Lang'] = 'zh' //zh en
+        header['X-Client-Type'] = 'WX_APP' //WX_APP APP
+        header['X-Client_Version'] = '1.0'
         if (token.length > 0) {
             header['Authorization'] = `Bearer ${token}`;
         }

+ 29 - 0
src/store/console.tsx

@@ -0,0 +1,29 @@
+import { PayloadAction, createSlice } from "@reduxjs/toolkit";
+
+export enum ConsoleType {
+    idle = 'idle',
+    going = 'going',
+    end = 'end'
+}
+
+interface ConsoleState {
+    status: ConsoleType
+}
+
+const initialState: ConsoleState = {
+    status: ConsoleType.idle,
+};
+
+const consoleSlice = createSlice({
+    name: 'console',
+    initialState,
+    reducers: {
+        changeConsoleStatus: (state, action: PayloadAction<{ status: ConsoleType }>) => {
+            state.status = action.payload.status;
+            debugger
+        },
+    },
+});
+
+export const { changeConsoleStatus } = consoleSlice.actions;
+export default consoleSlice.reducer;

+ 3 - 1
src/store/store.tsx

@@ -6,6 +6,7 @@ import commonReducer from './common';
 import resultReducer from './action_results';
 import timeReducer from './time';
 import modalReducer from './modal';
+import consoleReducer from './console';
 
 const store = configureStore({
   reducer: {
@@ -17,7 +18,8 @@ const store = configureStore({
     checkResult: resultReducer,
     codeResult: resultReducer,
     time: timeReducer,
-    modal:modalReducer
+    modal:modalReducer,
+    console:consoleReducer
   },
 });
 

+ 1 - 0
src/utils/types.ts

@@ -27,6 +27,7 @@ export enum TemplateType {
     list = 'list',
     grid = 'grid',
     flex = 'flex',
+    customHeader = 'customHeader'
 }
 
 export enum NaviBarTitleShowType {