Leon hace 2 años
padre
commit
4c47c03d8e

+ 60 - 1
src/features/workout/Result.scss

@@ -1,11 +1,46 @@
 .result_detail_text{
+    color: #fff;
+    font-size: 48px;
+    line-height: 48px;
+    font-weight: bold;
+    margin-left: 32px;
+}
+
+.result_type{
+    margin-left: 32px;
+    margin-top: 20px;
+    color: #fff;
+    opacity: 0.4;
+    font-weight: bold;
+    font-size: 32px;
+    line-height: 32px;
+}
+
+.result_group_text{
+    font-weight: bold;
     color: #fff;
     font-size: 40px;
     line-height: 40px;
-    font-weight: bold;
+    margin-top: 34px;
     margin-left: 32px;
 }
 
+.result_summary_title{
+    margin-top: 28px;
+    color: #fff;
+    font-size: 32px;
+    line-height: 32px;
+    font-weight: bold;
+    opacity: 0.8;
+    margin-bottom: 10px;
+}
+
+.result_summary_total{
+    font-size: 48px;
+    line-height: 48px;
+    font-weight: bold;
+}
+
 .result_count{
     margin-top: 14px;
     color: #fff;
@@ -22,6 +57,7 @@
     margin-right: 32px;
     margin-bottom: 28px;
     background-color: #1c1c1c;
+    border-radius: 26px;
     padding-left: 40px;
     padding-right: 40px;
     padding-top: 28px;
@@ -36,10 +72,19 @@
     background-color: #121212;
 }
 
+.workout_result_value{
+    font-weight: bold;
+    font-size: 72px;
+    line-height: 72px;
+    margin-top: 40px;
+}
+
 .result_time{
     position: absolute;
     right: 32px;
     bottom: 28px;
+    color: #fff;
+    opacity: 0.4;
 }
 
 .result_del{
@@ -49,4 +94,18 @@
     bottom: 120px;
     color: #FA5151;
     text-align: center;
+}
+
+.result_summary_time{
+    font-size: 36px;
+    line-height: 36px;
+    font-weight: bold;
+    margin-bottom: 12px;
+}
+
+.result_summary_desc{
+    color: #fff;
+    opacity: 0.4;
+    font-size: 20px;
+    line-height: 20px;
 }

+ 19 - 19
src/features/workout/Result.tsx

@@ -31,10 +31,10 @@ export default function Component() {
         const seconds = Math.floor(time % 60);
         var strDuration = ''
         if (hours > 0) {
-            strDuration = `${hours}时`
+            strDuration = `${hours}时`
         }
         if (minutes > 0) {
-            strDuration += `${minutes}分`
+            strDuration += `${minutes}分`
         }
         if (seconds > 0) {
             strDuration += `${seconds}秒`
@@ -180,20 +180,20 @@ export default function Component() {
 
     return <View style={{ color: '#fff', display: 'flex', flexDirection: 'column' }}>
         <Text className="result_detail_text" style={{ color: router.params.themeColor }}>{router.params.title}</Text>
-        <Text className="result_detail_text" style={{ color: '#fff', opacity: 0.4, marginTop: rpxToPx(10), marginBottom: rpxToPx(20) }}>计时训练</Text>
-        <Text className="result_detail_text">训练统计</Text>
-        <View style={{ marginLeft: rpxToPx(32), display: 'flex', flexDirection: 'column' }}>
-            <Text>总量</Text>
-            <Text style={{ color: router.params.themeColor }}>{getTotalValue()}</Text>
-            <Text>用时</Text>
+        <Text className="result_type">计时训练</Text>
+        <Text className="result_group_text">训练统计</Text>
+        <View style={{ marginLeft: rpxToPx(32), display: 'flex', flexDirection: 'column',marginBottom:rpxToPx(56) }}>
+            <Text className="result_summary_title">总量</Text>
+            <Text className="result_summary_total" style={{ color: router.params.themeColor }}>{getTotalValue()}</Text>
+            <Text className="result_summary_title">用时</Text>
             <View style={{ flexDirection: 'row', display: 'flex', width: '100%' }}>
-                <View style={{ display: 'flex', flexDirection: 'column', alignItems: 'center', flex: 1 }}>
-                    <Text style={{ color: router.params.themeColor }}>{getRealDuration()}</Text>
-                    <Text>实际</Text>
+                <View style={{ display: 'flex', flexDirection: 'column', alignItems: 'center' }}>
+                    <Text className="result_summary_time" style={{ color: router.params.themeColor }}>{getRealDuration()}</Text>
+                    <Text className="result_summary_desc">实际</Text>
                 </View>
-                <View style={{ display: 'flex', flexDirection: 'column', alignItems: 'center', flex: 1 }}>
-                    <Text style={{ color: router.params.themeColor }}>{getPlanDuration()}</Text>
-                    <Text>计划</Text>
+                <View style={{ display: 'flex', flexDirection: 'column', alignItems: 'center', marginLeft:rpxToPx(90) }}>
+                    <Text className="result_summary_time" style={{ color: router.params.themeColor }}>{getPlanDuration()}</Text>
+                    <Text className="result_summary_desc">计划</Text>
                 </View>
             </View>
 
@@ -202,17 +202,17 @@ export default function Component() {
             <Text>用时</Text>
             <Text style={{ color: router.params.themeColor }}>111</Text>
         </View> */}
-        <Text className="result_detail_text">训练详情</Text>
-        {
+        <Text className="result_group_text" style={{marginBottom:rpxToPx(48),marginTop:0}}>训练详情</Text>
+        {/* {
             histories.length > 0 && <Text className="result_count">共{getCount()}组</Text>
-        }
+        } */}
 
 
         {
             histories.map((item, index) => {
-                return <View key={index} className={item.typ == 'WORK' ? 'result_item' : 'result_item result_item_rest'}>
+                return <View key={index} className={item.type == 'WORK' ? 'result_item' : 'result_item result_item_rest'}>
                     <Text>{item.type == 'WORK' ? `第${getIndex(index)}组` : '组间休息'}</Text>
-                    {item.type == 'WORK' && <Text style={{ color: router.params.themeColor }}>{getValue(item)}</Text>}
+                    {item.type == 'WORK' && <Text className="workout_result_value" style={{ color: router.params.themeColor }}>{getValue(item)}</Text>}
                     <Text className="result_time">{twoTimeDuration(item.start.timestamp, item.end.timestamp)}</Text>
                 </View>
             })

+ 19 - 17
src/features/workout/Workout.tsx

@@ -605,7 +605,7 @@ export default function Component(props: any) {
                         showDetail={showDetail}
                         longClick={() => {
 
-                            if (item.code != '_walk' && user.isLogin) {
+                            if (item.code != '_walk' && user.isLogin && workout.status != 'ing') {
                                 Taro.showActionSheet({
                                     itemList: ['content only mode'],
                                 }).then(res => {
@@ -613,7 +613,7 @@ export default function Component(props: any) {
                                         case 0:
                                             setSelItem(item)
                                             dispatch(setCurrentWorkoutItem(item))
-                                            Taro.navigateTo({ url: '/pages/workout/Working?count=0&type=stop_watch&content_only=true' })
+                                            Taro.navigateTo({ url: '/pages/workout/Working?type=content' })
                                             break
                                     }
                                 })
@@ -628,21 +628,23 @@ export default function Component(props: any) {
                 })
             }
 
-            <MetricItem title='TABATA'
-                value={'wait'}
-                unit={''}
-                desc={'total time'}
-                btnText={'开始计时'}
-                isDisabled={false}
-                themeColor={themeColor}
-                onClickDetail={() => {
-                }}
-                showBadge={showErrorBadge && checkResult.type == 'idle'}
-                showDetail={false}
-                onClick={() => {
-                    timeStart()
-                }}
-            />
+            {
+                user.isLogin && list.length > 0 && <MetricItem title='TABATA'
+                    value={'wait'}
+                    unit={''}
+                    desc={'total time'}
+                    btnText={'开始计时'}
+                    isDisabled={false}
+                    themeColor={themeColor}
+                    onClickDetail={() => {
+                    }}
+                    showBadge={showErrorBadge && checkResult.type == 'idle'}
+                    showDetail={false}
+                    onClick={() => {
+                        timeStart()
+                    }}
+                />
+            }
 
             {/* <MetricItem title='Content only'
                 value={'wait'}

+ 1 - 1
src/features/workout/WorkoutContent.tsx

@@ -5,7 +5,7 @@ import { useState } from "react";
 export default function Component() {
     const [showDataPicker, setShowDataPicker] = useState(false)
     const [showTimePicker, setShowTimePicker] = useState(false)
-    return <View style={{ display: 'flex', flexDirection: 'column' }}>
+    return <View style={{ display: 'flex', flexDirection: 'column',color:'#fff' }}>
         <Text>平板支撑</Text>
         <Text>训练内容</Text>
         <View onClick={() => { setShowTimePicker(true) }}>

+ 1 - 0
src/features/workout/WorkoutHistory.tsx

@@ -208,6 +208,7 @@ export default function Component(props: { records: any, count: number,summary_s
                 </View>
             })
         }
+        <View style={{height:30}}/>
 
     </View>
 }