Leon 2 năm trước cách đây
mục cha
commit
3fae12d269

+ 1 - 1
src/app.scss

@@ -113,7 +113,7 @@ page {
 
 .box_title{
     display: flex;
-    background-color: red;
+    // background-color: red;
     height: 48px;
     font-weight: bold;
     font-size: 48px;

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

@@ -1,7 +1,7 @@
 /* #ifdef weapp */
 .modal {
     position: fixed;
-    top: 0;
+    top: -2px;
     left: 0;
     z-index: 100000;
     right: 0;

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

@@ -5,6 +5,7 @@
   max-height: 70vh;
   overflow-y: scroll;
   letter-spacing: 0.05em;
+  z-index: 100000000;
   // width: 100%;
   // margin-top: 20px;
   // background-color: aqua;

+ 47 - 45
src/components/view/Timeline.tsx

@@ -1,56 +1,57 @@
-import { View, Text, Icon } from '@tarojs/components'
+import { View, Text, Icon, ScrollView } from '@tarojs/components'
 import './Timeline.scss'
 import { TimelineType } from '@/utils/types'
 import { IconRadio, IconRadioCheck, IconRadioCross } from '../basic/Icons'
 
 
 export default function Component(props: { items: any[], title?: string, type?: TimelineType, showLastLine?: boolean }) {
-    return <View className="timeline">
-        {
-            props.title && <Text className='timeline_title'>{props.title}</Text>
-        }
-        {
-            props.items.map((item, index) => (
-                <View className='timelineItem'>
-                    <View className='timelineContentView' style={{ background: global.isDebug ? 'red' : 'transparent' }}>
-                        {
-                            item.status == 'padding' && <IconRadio width={16} color={item.color} />
-                        }
-                        {
-                            item.status == 'done' && <IconRadioCheck width={16} color={item.color} />
-                        }
+    return <View className="timeline" catchMove>
+        <View>
+            {
+                props.title && <Text className='timeline_title'>{props.title}</Text>
+            }
+            {
+                props.items.map((item, index) => (
+                    <View className='timelineItem'>
+                        <View className='timelineContentView' style={{ background: global.isDebug ? 'red' : 'transparent' }}>
+                            {
+                                item.status == 'padding' && <IconRadio width={16} color={item.color} />
+                            }
+                            {
+                                item.status == 'done' && <IconRadioCheck width={16} color={item.color} />
+                            }
+                            {
+                                item.status == 'un_done' && <IconRadioCross width={16} color={item.color} />
+                            }
+                            <View className='timelineContentDetail'>
+                                <View className="timeline-time" style={{ color: item.color ? item.color : '#fff' }}>{item.title}</View>
+                                <View style={{ flex: 1 }} />
+                            </View>
+                        </View>
+                        <View className="timeline-detail">{item.content}
+                            {
+                                item.date && <View className="timeline-date">{item.date}</View>
+                            }
+                        </View>
+                        <View className={index !== props.items.length - 1 ? 'timeline_line1 line1_bottom_space' : 'timeline_line1 line1_bottom_zero'} />
                         {
-                            item.status == 'un_done' && <IconRadioCross width={16} color={item.color} />
+                            index !== props.items.length - 1 &&
+                            <View className='timeline-line-bg' style={{ width: 16, background: global.isDebug ? 'red' : 'transparent' }}>
+                                <View className='timeline-line1'
+                                    style={{ background: (props.items[index + 1].status == 'done' && item.status == 'done') ? 'linear-gradient(to top, ' + props.items[index + 1].color + ', ' + item.color + ')' : '#ffffff66' }}
+                                />
+                            </View>
                         }
-                        <View className='timelineContentDetail'>
-                            <View className="timeline-time" style={{ color: item.color ? item.color : '#fff' }}>{item.title}</View>
-                            <View style={{ flex: 1 }} />
-                        </View>
-                    </View>
-                    <View className="timeline-detail">{item.content}
                         {
-                            item.date && <View className="timeline-date">{item.date}</View>
+                            index == props.items.length - 1 && props.showLastLine &&
+                            <View className='timeline-line-bg' style={{ width: 16, background: global.isDebug ? 'red' : 'transparent' }}>
+                                <View className='timeline-line1'
+                                    style={{ background: item.color }}
+                                />
+                            </View>
                         }
-                    </View>
-                    <View className={index !== props.items.length - 1 ? 'timeline_line1 line1_bottom_space' : 'timeline_line1 line1_bottom_zero'} />
-                    {
-                        index !== props.items.length - 1 &&
-                        <View className='timeline-line-bg' style={{ width: 16,background: global.isDebug ? 'red' : 'transparent' }}>
-                            <View className='timeline-line1'
-                                style={{ background: (props.items[index + 1].status == 'done' && item.status == 'done') ? 'linear-gradient(to top, ' + props.items[index + 1].color + ', ' + item.color + ')' : '#ffffff66' }}
-                            />
-                        </View>
-                    }
-                    {
-                        index == props.items.length - 1 && props.showLastLine &&
-                        <View className='timeline-line-bg' style={{ width: 16,background: global.isDebug ? 'red' : 'transparent'}}>
-                            <View className='timeline-line1'
-                                style={{ background: item.color }}
-                            />
-                        </View>
-                    }
 
-                    {/* {index !== props.items.length - 1 && 
+                        {/* {index !== props.items.length - 1 && 
                         <View className='timeline-line'
                             style={{ background: (props.items[index + 1].status == 'done' && item.status == 'done') ? 'linear-gradient(to top, ' + props.items[index + 1].color + ', ' + item.color + ')' : '#ffffff66' }}
                         />}
@@ -61,9 +62,10 @@ export default function Component(props: { items: any[], title?: string, type?:
                         />
                     } */}
 
-                </View>
-            ))
-        }
+                    </View>
+                ))
+            }
+        </View>
 
     </View>
 }

+ 12 - 2
src/features/trackTimeDuration/components/Clock.tsx

@@ -7,6 +7,7 @@ import { getBgRing, getCommon, getDot, getReal, getTarget } from "../hooks/RingD
 import './Clock.scss'
 import { ColorType } from "@/context/themes/color";
 import { useSelector } from "react-redux";
+import { jumpPage } from "../hooks/Common";
 export default function Component(props: { showCoverView: boolean }) {
     const [checkData, setCheckData] = useState(null)
     const time = useSelector((state: any) => state.time);
@@ -97,8 +98,17 @@ export default function Component(props: { showCoverView: boolean }) {
         return null;
     }
 
+    function tapCover(){
+        if (user.isLogin){
+
+        }
+        else {
+            jumpPage('/pages/account/ChooseAuth', 'ChooseAuth', null)
+        }
+    }
+
     if (!checkData)
-        return <View style={{ display: 'flex', flexDirection: 'column', alignItems: 'center', width: '100%', marginTop: 20, position: 'relative', pointerEvents: 'none' }}>
+        return <View style={{ display: 'flex', flexDirection: 'column', alignItems: 'center', width: '100%',  position: 'relative', pointerEvents: 'none' }}>
             {
                 bigRing()
             }
@@ -108,7 +118,7 @@ export default function Component(props: { showCoverView: boolean }) {
                 }
             </View>
             {
-                showCover && <CoverView style={{
+                showCover && <CoverView onClick={tapCover} style={{
                     display: 'flex', position: 'absolute',
                     left: 0, right: 0, top: 0, bottom: 0, backgroundColor: 'transparent'
                 }} />

+ 11 - 7
src/features/trackTimeDuration/components/StatusIndicator.tsx

@@ -74,21 +74,25 @@ export default function Component() {
     }
 
     if (!time.scenario) {
-        return <View className='scenario'>
-            <View className='point' style={{ backgroundColor: global.fastColor ? global.fastColor : ColorType.fast }} />
-            <Text className='name'>{getFastName()}</Text>
+        return <View className='subcontent'>
+            <View className='scenario' style={{backgroundColor:global.isDebug?'red':'transparent'}}>
+                <View className='point' style={{ backgroundColor: global.fastColor ? global.fastColor : ColorType.fast }} />
+                <Text className='name'>{getFastName()}</Text>
+            </View>
         </View>
     }
     if (!user.isLogin) {
-        return <View className='scenario'>
-            <View className='point' style={{ backgroundColor: global.fastColor ? global.fastColor : ColorType.fast }} />
-            <Text className='name'>{getFastName()}</Text>
+        return <View className='subcontent'  >
+            <View className='scenario' style={{backgroundColor:global.isDebug?'red':'transparent'}}>
+                <View className='point' style={{ backgroundColor: global.fastColor ? global.fastColor : ColorType.fast }} />
+                <Text className='name'>{getFastName()}</Text>
+            </View>
         </View>
     }
 
     return <View className='subcontent'>
         {
-            time.scenario != 'SLEEP' && <View className='scenario'>
+            time.scenario != 'SLEEP' && <View className='scenario' style={{backgroundColor:global.isDebug?'red':'transparent'}}>
                 <View className='point' style={{ backgroundColor: global.fastColor ? global.fastColor : ColorType.fast }} />
                 <Text className='name'>{getFastName()}</Text>
             </View>

+ 8 - 2
src/features/trackTimeDuration/components/TitleView.tsx

@@ -65,14 +65,20 @@ export default function Component(props: {
             })
     }
 
-    return <View className='title_view'>
+    var showAddIcon = user.isLogin && props.showAddBtn
+
+    return <View className='title_view' >
         <View className='title_bg'>
             <Text className='title' style={{
                 color: props.titleColor ? props.titleColor : '#fff',
                 fontSize: props.secondPage ? 28 : 36
             }}>{props.title}</Text>
             {
-                user.isLogin && props.showAddBtn && <View className='iconAddBg' onClick={more}><Image src={require('@/assets/images/add.png')} className='iconAdd' /></View>
+                showAddIcon ? <View className='iconAddBg' onClick={more}>
+                    <Image src={require('@/assets/images/add.png')} className='iconAdd' />
+                </View>:<View className='iconAddBg' style={{opacity:0}}>
+                    <Image src={require('@/assets/images/add.png')} className='iconAdd' />
+                </View>
             }
         </View>
         {

+ 15 - 2
src/pages/clock/Clock.weapp.tsx

@@ -41,6 +41,8 @@ import { TimeFormatter } from '@/utils/time_format'
 import NoData from '@/components/view/NoData'
 import { ColorType } from '@/context/themes/color'
 import { jumpPage } from '@/features/trackTimeDuration/hooks/Common'
+import { ChooseScenarioBtn } from '@/features/common/SpecBtns'
+import { rpxToPx } from '@/utils/tools'
 // import TabBar from '../../components/Tabbar';
 
 // import Rings from '@components/view/Rings';
@@ -74,6 +76,7 @@ export default function IndexPage() {
   const [modalDetail2, setModalDetail2] = useState<any>({})
   const [showSingleFastEnd, setShowSingleFastEnd] = useState(false)
   const [consoleStatus, setConsoleStatus] = useState(consoleData.status)
+  const [showLogin, setShowLogin] = useState(false)
 
   let navigation;
   if (useNavigation) {
@@ -179,6 +182,7 @@ export default function IndexPage() {
     }
 
     const id = setInterval(() => {
+      setShowLogin(true)
       if (global.showModal) {
         return
       }
@@ -258,11 +262,15 @@ export default function IndexPage() {
     }
     else {
       Taro.vibrateShort({
-        type:'medium'
+        type: 'medium'
       })
     }
   }
 
+  function tapLogin(e){
+    jumpPage('/pages/account/ChooseAuth', 'ChooseAuth', navigation)
+  }
+
   function getCheckData() {
     getClocks().then(res => {
       setErrorPage(false)
@@ -432,9 +440,14 @@ export default function IndexPage() {
 
           <Box>
             <View className='clock_bg' onClick={tapClock}>
-              <Clocks showCoverView={!global.showModal}/>
+              <Clocks showCoverView={!global.showModal} />
             </View>
           </Box>
+          {
+            !user.isLogin && showLogin && <View style={{ display: 'flex', alignItems: 'center', justifyContent: 'center',marginTop:rpxToPx(36) }}>
+              <ChooseScenarioBtn title='登录体验' background={ColorType.fast} onClick={tapLogin} />
+            </View>
+          }
           {/* <Box>
             <View className='clock_bg' onClick={tapClock}>
               <Clocks />