|
|
@@ -20,10 +20,13 @@ import MetricModalTime from "./MetricModalTime";
|
|
|
import Modal from "@/components/layout/Modal.weapp";
|
|
|
import { rpxToPx } from "@/utils/tools";
|
|
|
import { AtActivityIndicator } from "taro-ui";
|
|
|
+import showActionSheet from "@/components/basic/ActionSheet";
|
|
|
|
|
|
let useNavigation;
|
|
|
+let useActionSheet;
|
|
|
if (process.env.TARO_ENV == 'rn') {
|
|
|
useNavigation = require("@react-navigation/native").useNavigation
|
|
|
+ useActionSheet = require('@expo/react-native-action-sheet').useActionSheet
|
|
|
}
|
|
|
|
|
|
|
|
|
@@ -55,8 +58,10 @@ export default function Component(props: any) {
|
|
|
const [loaded, setLoaded] = useState(false)
|
|
|
const dispatch = useDispatch();
|
|
|
let navigation;
|
|
|
+ let showActionSheetWithOptions;
|
|
|
if (useNavigation) {
|
|
|
navigation = useNavigation()
|
|
|
+ showActionSheetWithOptions = useActionSheet()
|
|
|
}
|
|
|
|
|
|
|
|
|
@@ -284,6 +289,28 @@ export default function Component(props: any) {
|
|
|
}
|
|
|
|
|
|
function addBtnClick() {
|
|
|
+ if (process.env.TARO_ENV == 'rn') {
|
|
|
+ showActionSheet({
|
|
|
+ showActionSheetWithOptions: showActionSheetWithOptions,
|
|
|
+ itemList: [
|
|
|
+ t('feature.track_something.metric.choose_metric'),
|
|
|
+ t('feature.track_something.metric.order')
|
|
|
+ ],
|
|
|
+ success: (res) => {
|
|
|
+ switch (res) {
|
|
|
+ case 0:
|
|
|
+ chooseMore()
|
|
|
+ break;
|
|
|
+ case 1:
|
|
|
+ global.metricAdd = false
|
|
|
+ setModalType(MetricModalType.order)
|
|
|
+ setShowPageContainer(true)
|
|
|
+ break;
|
|
|
+ }
|
|
|
+ }
|
|
|
+ })
|
|
|
+ return;
|
|
|
+ }
|
|
|
Taro.showActionSheet({
|
|
|
itemList: [t('feature.track_something.metric.choose_metric'),
|
|
|
t('feature.track_something.metric.order')]
|