|
|
@@ -19,8 +19,8 @@ import Modal from "@/components/layout/Modal";
|
|
|
import { ColorType } from "@/context/themes/color";
|
|
|
import SetGoal from "@/features/workout/SetGoal";
|
|
|
import Working from "@/features/workout/Working";
|
|
|
-import { startSuccess } from "@/store/workout";
|
|
|
-import { workoutFollows, workoutGroups } from "@/services/workout";
|
|
|
+import { setCurrentWorkoutItem, startSuccess } from "@/store/workout";
|
|
|
+import { workoutCards, workoutFollows, workoutGroups } from "@/services/workout";
|
|
|
import { setAuth } from "../trackSomething/hooks/werun";
|
|
|
import MetricModalOrder from "../trackSomething/components/MetricModalOrder";
|
|
|
import MetricModalChoose from "../trackSomething/components/MetricModalChoose";
|
|
|
@@ -63,6 +63,8 @@ export default function Component(props: any) {
|
|
|
const [newOrders, setNewOrders] = useState([])
|
|
|
const [resultOrders, setResultOrders] = useState([])
|
|
|
|
|
|
+ const [selItem,setSelItem] = useState(null)
|
|
|
+
|
|
|
let navigation;
|
|
|
if (useNavigation) {
|
|
|
navigation = useNavigation()
|
|
|
@@ -140,7 +142,7 @@ export default function Component(props: any) {
|
|
|
|
|
|
function getCards() {
|
|
|
setTriggered(true)
|
|
|
- activityCards().then(res => {
|
|
|
+ workoutCards().then(res => {
|
|
|
setErrorPage(false)
|
|
|
setTriggered(false)
|
|
|
checkAuth()
|
|
|
@@ -198,8 +200,14 @@ export default function Component(props: any) {
|
|
|
}
|
|
|
}
|
|
|
|
|
|
- function tapBtn() {
|
|
|
+ function tapBtn(item) {
|
|
|
if (user.isLogin) {
|
|
|
+ if (item.code!='_walk'){
|
|
|
+ setSelItem(item)
|
|
|
+ dispatch(setCurrentWorkoutItem(item))
|
|
|
+ workoutStart()
|
|
|
+ return
|
|
|
+ }
|
|
|
if (allowRun) {
|
|
|
checkout()
|
|
|
}
|
|
|
@@ -491,13 +499,13 @@ export default function Component(props: any) {
|
|
|
showBadge={showErrorBadge && checkResult.type == 'idle'}
|
|
|
showDetail={showDetail}
|
|
|
onClick={() => {
|
|
|
- tapBtn()
|
|
|
+ tapBtn(item)
|
|
|
}}
|
|
|
/>
|
|
|
})
|
|
|
}
|
|
|
|
|
|
- <MetricItem title='平板支撑'
|
|
|
+ {/* <MetricItem title='平板支撑'
|
|
|
// value={allowRun ? stepInfo ? (stepInfo as any).step : '' : '未开启'}
|
|
|
value={10}
|
|
|
unit={'分钟'}
|
|
|
@@ -515,7 +523,7 @@ export default function Component(props: any) {
|
|
|
onClick={() => {
|
|
|
workoutStart()
|
|
|
}}
|
|
|
- />
|
|
|
+ /> */}
|
|
|
</View>
|
|
|
}
|
|
|
|
|
|
@@ -614,7 +622,7 @@ export default function Component(props: any) {
|
|
|
setShowModal(false)
|
|
|
}} confirm={() => { }} modalType={ModalType.center}>
|
|
|
{
|
|
|
- !isStart && <SetGoal start={(count) => { setTargetTime(count); setShowModal(false); Taro.navigateTo({ url: '/pages/workout/Working?count=' + count }) }} />
|
|
|
+ !isStart && <SetGoal duration={(selItem as any).schemas[0].default_duration} start={(count) => { setTargetTime(count); setShowModal(false); Taro.navigateTo({ url: '/pages/workout/Working?count=' + count }) }} />
|
|
|
}
|
|
|
{
|
|
|
isStart && <Working targetCount={targetTime} type={WorkoutType.multi} end={() => {
|