Leon 2 سال پیش
والد
کامیت
256234e1fb

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

@@ -90,7 +90,8 @@ export default {
                 min_value: '不能再小了',
                 max_value: '不能再大了',
                 update_success: '更新成功',
-                input_nickname:'请输入昵称'
+                input_nickname:'请输入昵称',
+                ongoing:'请先完成记录',//进行中点击加号,actionsheet item时弹此提示
             },
             action_sheet: {
                 delete: '删除'

+ 1 - 33
src/features/trackSomething/components/ActivityHistory.tsx

@@ -63,6 +63,7 @@ export default function Component(props: { records: any[] }) {
     }
 
     function schedules(item) {
+        console.log(item)
         var timelineItems: any = [];
         for (var i = item.records.length - 1; i > 0; i--) {
             var type = item.records[i].type == 'total' ? t('feature.track_something.activity.total') : 
@@ -115,10 +116,6 @@ export default function Component(props: { records: any[] }) {
 
                     <RecordItem onClick={() => showDetail(item)} delete={() => deleteRecord(item.records[0])}>
                         <View className="operate_item">
-                            {/* <View className="status_bg">
-                                <Text className="status_text">{item.records[0].type == 'total' ? '总计' : item.records[0].type == 'sync' ? '同步' : '打卡'}</Text>
-                            </View>
-                            <View style={{ width: 12 }} /> */}
                             <Text className="value" style={{ backgroundColor: global.isDebug ? 'red' : 'transparent' }}>{item.records[0].items[0].value}</Text>
                             <Text className="unit">步</Text>
                             <View style={{ flex: 1 }} />
@@ -131,33 +128,4 @@ export default function Component(props: { records: any[] }) {
             })
         }
     </View>
-
-    // return <View style={{ display: 'flex', flexDirection: 'column' }}>
-    //     {
-    //         user.test_user && <Text style={{ color: '#fff', position: 'absolute', right: 50, top: 0 }} onClick={()=>global.clearHistory()}>删除全部</Text>
-    //     }
-    //     {
-    //         (list as any).map(item => {
-    //             return <View style={{ display: 'flex', flexDirection: 'column' }}>
-    //                 <Text className="operate_day">{formateDate(item.date + '')}</Text>
-    //                 {
-    //                     item.records.map(record => {
-    //                         return <RecordItem delete={() => deleteRecord(record)}>
-    //                             <View className="operate_item">
-    //                                 <View className="status_bg">
-    //                                     <Text className="status_text">{record.type == 'total' ? '总计' : record.type == 'sync' ? '同步' : '打卡'}</Text>
-    //                                 </View>
-    //                                 <View style={{ width: 12 }} />
-    //                                 <Text className="value">{record.items[0].value}</Text>
-    //                                 <Text className="unit">步</Text>
-    //                                 <View style={{ flex: 1 }} />
-    //                                 <Text className="time">{formateHourMinutes(record.timestamp)}</Text>
-    //                             </View>
-    //                         </RecordItem>
-    //                     })
-    //                 }
-    //             </View>
-    //         })
-    //     }
-    // </View>
 }

+ 15 - 1
src/features/trackTimeDuration/components/TitleView.tsx

@@ -29,6 +29,13 @@ export default function Component(props: {
         }).then(res => {
             switch (res.tapIndex) {
                 case 1:
+                    if (time.status != 'WAIT_FOR_START') {
+                        Taro.showToast({
+                            title: t('feature.common.toast.ongoing'),
+                            icon: 'none'
+                        })
+                        return;
+                    }
                     if (time.scenario == 'FAST_SLEEP') {
                         dispatch(setStep(isFastFirst ? 'fast' : 'sleep'))
                     }
@@ -43,6 +50,13 @@ export default function Component(props: {
                     })
                     break;
                 case 0:
+                    if (time.status != 'WAIT_FOR_START') {
+                        Taro.showToast({
+                            title: t('feature.common.toast.ongoing'),
+                            icon: 'none'
+                        })
+                        return;
+                    }
                     Taro.navigateTo({
                         url: '/pages/clock/ChooseScenario'
                     })
@@ -61,7 +75,7 @@ export default function Component(props: {
                 fontSize: props.secondPage ? 28 : 36
             }}>{props.title}</Text>
             {
-                user.isLogin&&time.status == 'WAIT_FOR_START' && props.showAddBtn && <Image onClick={more} src={require('@/assets/images/add.png')} className='icon' />
+                user.isLogin && props.showAddBtn && <Image onClick={more} src={require('@/assets/images/add.png')} className='icon' />
             }
         </View>
         {

+ 2 - 2
src/pages/account/Profile.tsx

@@ -64,7 +64,7 @@ export default function Page() {
 
     }
 
-    function clear() {
+    function clearF() {
         Taro.showModal({
             title: t('feature.common.modal.deluser_title'),
             content: t('feature.common.modal.deluser_content'),
@@ -150,7 +150,7 @@ export default function Page() {
             } */}
 
             {
-                user.isLogin && user.test_user && <TableCell title="user_id" showArrow={true} onClick={clear}>
+                user.isLogin && user.test_user && <TableCell title="user_id" showArrow={true} onClick={clearF}>
                     <Text style={{ opacity: 0.8 }}>******{user.id.substring(user.id.length - 10, user.id.length)}</Text>
                 </TableCell>
             }

+ 1 - 1
src/pages/account/Setting.tsx

@@ -34,7 +34,7 @@ export default function Page() {
 
     return <View style={{ color: '#fff',display:'flex',flexDirection:'column' }}>
         <View style={{height:20}}/>
-        <TableCell title={t('page.setting.version')} ><Text style={{ opacity: 0.8 }}>1.2.3</Text></TableCell>
+        <TableCell title={t('page.setting.version')} ><Text style={{ opacity: 0.8 }}>1.2.4</Text></TableCell>
         {/* <Text style={{color:'#9E9E9E',textAlign:'center',fontSize:14}}>v1.2.2</Text> */}
         
         <Footer>

+ 1 - 1
src/utils/time_format.ts

@@ -1,5 +1,5 @@
 export class TimeFormatter {
-  static nowDuration = 30
+  static nowDuration = 30  
   //格式化时间
   static formatTimestamp(timestamp: number): string {
     const currentDate = new Date();