|
@@ -12,13 +12,16 @@ import Layout from '@/components/layout/layout'
|
|
|
import NoData from "@/components/view/NoData";
|
|
import NoData from "@/components/view/NoData";
|
|
|
import { ResultType, checkFail, checkRetry, checkStart, checkSuccess, resetStatus, setResult } from "@/store/action_results";
|
|
import { ResultType, checkFail, checkRetry, checkStart, checkSuccess, resetStatus, setResult } from "@/store/action_results";
|
|
|
import RequestType, { thirdPartRequest } from "@/services/thirdPartRequest";
|
|
import RequestType, { thirdPartRequest } from "@/services/thirdPartRequest";
|
|
|
-import { ModalType, NaviBarTitleShowType, TemplateType } from "@/utils/types";
|
|
|
|
|
|
|
+import { ModalType, NaviBarTitleShowType, TemplateType, WorkoutType } from "@/utils/types";
|
|
|
import { useTranslation } from "react-i18next";
|
|
import { useTranslation } from "react-i18next";
|
|
|
import { jumpPage } from "@/features/trackTimeDuration/hooks/Common";
|
|
import { jumpPage } from "@/features/trackTimeDuration/hooks/Common";
|
|
|
import TitleView from "@/features/trackTimeDuration/components/TitleView";
|
|
import TitleView from "@/features/trackTimeDuration/components/TitleView";
|
|
|
import './Activity.scss'
|
|
import './Activity.scss'
|
|
|
import Modal from "@/components/layout/Modal";
|
|
import Modal from "@/components/layout/Modal";
|
|
|
import MoveList from "./MoveList";
|
|
import MoveList from "./MoveList";
|
|
|
|
|
+import { ColorType } from "@/context/themes/color";
|
|
|
|
|
+import SetGoal from "@/features/workout/SetGoal";
|
|
|
|
|
+import Working from "@/features/workout/Working";
|
|
|
// import { useNavigation } from "@react-navigation/native";
|
|
// import { useNavigation } from "@react-navigation/native";
|
|
|
|
|
|
|
|
let useNavigation;
|
|
let useNavigation;
|
|
@@ -43,8 +46,10 @@ export default function Component(props: any) {
|
|
|
const [triggered, setTriggered] = useState(true)
|
|
const [triggered, setTriggered] = useState(true)
|
|
|
const [showErrorPage, setErrorPage] = useState(false)
|
|
const [showErrorPage, setErrorPage] = useState(false)
|
|
|
const [showModal, setShowModal] = useState(false)
|
|
const [showModal, setShowModal] = useState(false)
|
|
|
- const [loaded,setLoaded] = useState(false)
|
|
|
|
|
|
|
+ const [loaded, setLoaded] = useState(false)
|
|
|
const [count, setCount] = useState(0)
|
|
const [count, setCount] = useState(0)
|
|
|
|
|
+ const [isStart, setIsStart] = useState(false)
|
|
|
|
|
+ const [targetTime, setTargetTime] = useState(0)
|
|
|
let navigation;
|
|
let navigation;
|
|
|
if (useNavigation) {
|
|
if (useNavigation) {
|
|
|
navigation = useNavigation()
|
|
navigation = useNavigation()
|
|
@@ -339,15 +344,15 @@ export default function Component(props: any) {
|
|
|
isEnable = true;
|
|
isEnable = true;
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
- function addBtnClick() {
|
|
|
|
|
- setShowModal(true)
|
|
|
|
|
- }
|
|
|
|
|
-
|
|
|
|
|
function headerView() {
|
|
function headerView() {
|
|
|
return <TitleView title={t('page.activity.title')} showAddBtn={false}>
|
|
return <TitleView title={t('page.activity.title')} showAddBtn={false}>
|
|
|
</TitleView>
|
|
</TitleView>
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
|
|
+ function workout() {
|
|
|
|
|
+ setShowModal(true)
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
function detail() {
|
|
function detail() {
|
|
|
return <View className="activity_container">
|
|
return <View className="activity_container">
|
|
|
{
|
|
{
|
|
@@ -415,42 +420,22 @@ export default function Component(props: any) {
|
|
|
/>
|
|
/>
|
|
|
})
|
|
})
|
|
|
}
|
|
}
|
|
|
- </View>
|
|
|
|
|
- }
|
|
|
|
|
|
|
|
|
|
- function modalDetail() {
|
|
|
|
|
- return <View>
|
|
|
|
|
- <MoveList list={[
|
|
|
|
|
- { id: 1, name: '集美仓' },
|
|
|
|
|
- { id: 2, name: '海沧仓' },
|
|
|
|
|
- { id: 3, name: '思明仓' },
|
|
|
|
|
- { id: 4, name: '湖里仓' },
|
|
|
|
|
- { id: 11, name: '集美仓1' },
|
|
|
|
|
- { id: 21, name: '海沧仓1' },
|
|
|
|
|
- { id: 31, name: '思明仓1' },
|
|
|
|
|
- { id: 41, name: '湖里仓1' },
|
|
|
|
|
- { id: 10, name: '集美仓2' },
|
|
|
|
|
- { id: 20, name: '海沧仓2' },
|
|
|
|
|
- { id: 30, name: '思明仓2' },
|
|
|
|
|
- { id: 40, name: '湖里仓2' }
|
|
|
|
|
- ]}
|
|
|
|
|
- itemHeight={45}
|
|
|
|
|
- renderItem={(item) => (
|
|
|
|
|
- <View
|
|
|
|
|
- style={{
|
|
|
|
|
- height: 40,
|
|
|
|
|
- lineHeight: '40px',
|
|
|
|
|
- borderBottom: '1px solid #e8e8e8',
|
|
|
|
|
- padding: '0 15px',
|
|
|
|
|
- color:'#fff'
|
|
|
|
|
- }}
|
|
|
|
|
- >
|
|
|
|
|
- {item.name}
|
|
|
|
|
- </View>
|
|
|
|
|
- )}
|
|
|
|
|
- onchange={(e) => {
|
|
|
|
|
- console.log(e)
|
|
|
|
|
- }}/>
|
|
|
|
|
|
|
+ <MetricItem title='平板支撑'
|
|
|
|
|
+ // value={allowRun ? stepInfo ? (stepInfo as any).step : '' : '未开启'}
|
|
|
|
|
+ value={10}
|
|
|
|
|
+ unit={'分钟'}
|
|
|
|
|
+ desc={'昨天'}
|
|
|
|
|
+ btnText={'计时训练'}
|
|
|
|
|
+ isDisabled={false}
|
|
|
|
|
+ themeColor={ColorType.workout}
|
|
|
|
|
+ onClickDetail={() => { }}
|
|
|
|
|
+ showBadge={showErrorBadge && checkResult.type == 'idle'}
|
|
|
|
|
+ showDetail={false}
|
|
|
|
|
+ onClick={() => {
|
|
|
|
|
+ workout()
|
|
|
|
|
+ }}
|
|
|
|
|
+ />
|
|
|
</View>
|
|
</View>
|
|
|
}
|
|
}
|
|
|
|
|
|
|
@@ -463,9 +448,15 @@ export default function Component(props: any) {
|
|
|
titleShowStyle={NaviBarTitleShowType.scrollToShow}
|
|
titleShowStyle={NaviBarTitleShowType.scrollToShow}
|
|
|
/>
|
|
/>
|
|
|
{
|
|
{
|
|
|
- showModal && <Modal modalType={ModalType.bottom} dismiss={() => setShowModal(false)} confirm={() => { }}>
|
|
|
|
|
|
|
+ showModal && <Modal dismiss={() => {
|
|
|
|
|
+ setIsStart(false)
|
|
|
|
|
+ setShowModal(false)
|
|
|
|
|
+ }} confirm={() => { }} modalType={ModalType.center}>
|
|
|
|
|
+ {
|
|
|
|
|
+ !isStart && <SetGoal start={(count) => { setTargetTime(count); setIsStart(true) }} />
|
|
|
|
|
+ }
|
|
|
{
|
|
{
|
|
|
- modalDetail()
|
|
|
|
|
|
|
+ isStart && <Working targetCount={targetTime} type={WorkoutType.multi}/>
|
|
|
}
|
|
}
|
|
|
</Modal>
|
|
</Modal>
|
|
|
}
|
|
}
|