|
|
@@ -14,6 +14,11 @@ import Footer from "@/components/layout/Footer";
|
|
|
export default function ChooseScenario() {
|
|
|
const [selected, setSelected] = useState(0);
|
|
|
const dispatch = useDispatch();
|
|
|
+ var navigation: any = null
|
|
|
+ if (process.env.TARO_ENV === 'rn') {
|
|
|
+ var useNavigation = require("@react-navigation/native").useNavigation
|
|
|
+ navigation = useNavigation()
|
|
|
+ }
|
|
|
|
|
|
useEffect(() => {
|
|
|
getPlans().then(res => {
|
|
|
@@ -39,11 +44,8 @@ export default function ChooseScenario() {
|
|
|
|
|
|
|
|
|
function goSuggestion() {
|
|
|
- var navigation: any = null
|
|
|
- if (process.env.TARO_ENV === 'rn') {
|
|
|
- var useNavigation = require("@react-navigation/native").useNavigation
|
|
|
- navigation = useNavigation()
|
|
|
- }
|
|
|
+
|
|
|
+
|
|
|
dispatch(updateStep({ step: 0 }))
|
|
|
jumpPage(`/pages/clock/Suggest`, 'Suggest', navigation, {})
|
|
|
}
|
|
|
@@ -62,7 +64,7 @@ export default function ChooseScenario() {
|
|
|
|
|
|
<View className={selected == 0 ? 'item_sel1' : 'item1'} onClick={() => chooseType(0)}>Fasting</View>
|
|
|
<View className={selected == 1 ? 'item_sel1' : 'item1'} onClick={() => chooseType(1)}>Fasting with Sleep</View>
|
|
|
- <View style={{flex:1}}/>
|
|
|
+ <View style={{ flex: 1 }} />
|
|
|
<Footer>
|
|
|
<View style={{ display: 'flex', alignItems: 'center', justifyContent: 'center' }}>
|
|
|
<ChooseScenarioBtn
|