|
|
@@ -9,10 +9,12 @@ import { useTranslation } from 'react-i18next'
|
|
|
import { jumpPage } from '@/features/trackTimeDuration/hooks/Common'
|
|
|
import { MainColorType } from '@/context/themes/color'
|
|
|
import { useEffect, useState } from 'react'
|
|
|
+import Modal from '@/components/layout/Modal.weapp'
|
|
|
|
|
|
export default function ChooseActions(props: { close: any, quick: any, chooseText: any, chooseImg: any }) {
|
|
|
const systemInfo: any = Taro.getWindowInfo ? Taro.getWindowInfo() : Taro.getSystemInfoSync();
|
|
|
const navigationBarHeight = systemInfo.statusBarHeight + 44;
|
|
|
+ const screenHeight = systemInfo.screenHeight
|
|
|
const [hideContent, setHideContent] = useState(false)
|
|
|
const { t } = useTranslation()
|
|
|
|
|
|
@@ -157,65 +159,80 @@ export default function ChooseActions(props: { close: any, quick: any, chooseTex
|
|
|
});
|
|
|
};
|
|
|
|
|
|
- return <View className="actions_bg" catchMove onClick={props.close}>
|
|
|
+ function content() {
|
|
|
|
|
|
- <View className="navi_bar" style={{
|
|
|
- position: 'fixed',
|
|
|
- left: 0,
|
|
|
- right: 0,
|
|
|
- top: 0, height: navigationBarHeight, zIndex: 1000
|
|
|
- }}>
|
|
|
- <View style={{
|
|
|
- position: 'absolute',
|
|
|
+ return <View className="actions_bg" style={{
|
|
|
+ position: process.env.TARO_ENV == 'weapp' ? 'fixed' : 'absolute'
|
|
|
+ }} catchMove onClick={props.close}>
|
|
|
+
|
|
|
+ <View className="navi_bar" style={{
|
|
|
+ position: process.env.TARO_ENV == 'weapp' ? 'fixed' : 'absolute',
|
|
|
left: 0,
|
|
|
right: 0,
|
|
|
- bottom: 0,
|
|
|
- height: 44,
|
|
|
- display: 'flex',
|
|
|
- alignItems: 'center',
|
|
|
- justifyContent: 'center'
|
|
|
+ top: 0, height: navigationBarHeight, zIndex: 1000,
|
|
|
}}>
|
|
|
<View style={{
|
|
|
position: 'absolute',
|
|
|
- width: rpxToPx(92),
|
|
|
- height: rpxToPx(64),
|
|
|
- left: 22,
|
|
|
- top: 22 - rpxToPx(32)
|
|
|
- }}
|
|
|
- onClick={() => {
|
|
|
- Taro.navigateBack()
|
|
|
- }}>
|
|
|
- <IconClose color="#fff" width={rpxToPx(64)} height={rpxToPx(64)} />
|
|
|
+ left: 0,
|
|
|
+ right: 0,
|
|
|
+ bottom: 0,
|
|
|
+ height: 44,
|
|
|
+ display: 'flex',
|
|
|
+ alignItems: 'center',
|
|
|
+ justifyContent: 'center'
|
|
|
+ }}>
|
|
|
+ <View style={{
|
|
|
+ position: 'absolute',
|
|
|
+ width: rpxToPx(92),
|
|
|
+ height: rpxToPx(64),
|
|
|
+ left: 22,
|
|
|
+ top: 22 - rpxToPx(32)
|
|
|
+ }}
|
|
|
+ onClick={() => {
|
|
|
+ props.close()
|
|
|
+ }}>
|
|
|
+ <IconClose color="#fff" width={rpxToPx(64)} height={rpxToPx(64)} />
|
|
|
+ </View>
|
|
|
</View>
|
|
|
</View>
|
|
|
- </View>
|
|
|
- <View style={{ opacity: hideContent ? 0 : 1 }}>
|
|
|
- <NewButton type={NewButtonType.img} onClick={album}>
|
|
|
- <View className='action_btn h30 bold cardShowAni'>{t('health.add_photos')}
|
|
|
- <Image className='action_btn_img' src={BASE_IMG_URL + 'image.svg'} />
|
|
|
- </View>
|
|
|
- </NewButton>
|
|
|
- <NewButton type={NewButtonType.img} onClick={text}>
|
|
|
- <View className='action_btn h30 bold cardShowAni'>{t('health.add_text')}
|
|
|
- <Image className='action_btn_img' src={BASE_IMG_URL + 'text.svg'} />
|
|
|
- </View>
|
|
|
- </NewButton>
|
|
|
- <NewButton type={NewButtonType.img} onClick={camera}>
|
|
|
- <View className='action_btn h30 bold cardShowAni'>{t('health.camera2')}
|
|
|
- <Image className='action_btn_img' src={BASE_IMG_URL + 'camera.svg'} />
|
|
|
- </View>
|
|
|
- </NewButton>
|
|
|
+ <View style={{ opacity: hideContent ? 0 : 1 }}>
|
|
|
+ <NewButton type={NewButtonType.img} onClick={album}>
|
|
|
+ <View className='action_btn h30 bold cardShowAni'>{t('health.add_photos')}
|
|
|
+ <View className='action_btn_img'>
|
|
|
+ <Image className='action_btn_img' style={{ left: 0, top: 0 }} src={BASE_IMG_URL + 'image.svg'} />
|
|
|
+ </View>
|
|
|
+ </View>
|
|
|
+ </NewButton>
|
|
|
+ <NewButton type={NewButtonType.img} onClick={text}>
|
|
|
+ <View className='action_btn h30 bold cardShowAni'>{t('health.add_text')}
|
|
|
+ <View className='action_btn_img'>
|
|
|
+ <Image className='action_btn_img' style={{ left: 0, top: 0 }} src={BASE_IMG_URL + 'text.svg'} />
|
|
|
+ </View>
|
|
|
+ </View>
|
|
|
+ </NewButton>
|
|
|
+ <NewButton type={NewButtonType.img} onClick={camera}>
|
|
|
+ <View className='action_btn h30 bold cardShowAni'>{t('health.camera2')}
|
|
|
+ <View className='action_btn_img'>
|
|
|
+ <Image className='action_btn_img' style={{ left: 0, top: 0 }} src={BASE_IMG_URL + 'camera.svg'} />
|
|
|
+ </View>
|
|
|
+ </View>
|
|
|
+ </NewButton>
|
|
|
+ {
|
|
|
+ process.env.TARO_ENV == 'weapp' && <NewButton type={NewButtonType.img} onClick={chat}>
|
|
|
+ <View className='action_btn h30 bold cardShowAni'>{t('health.import_chat')}
|
|
|
|
|
|
- <NewButton type={NewButtonType.img} onClick={chat}>
|
|
|
- <View className='action_btn h30 bold cardShowAni'>{t('health.import_chat')}
|
|
|
- <Image className='action_btn_img' src={BASE_IMG_URL + 'wechat.svg'} />
|
|
|
- </View>
|
|
|
- </NewButton>
|
|
|
- <View style={{ height: rpxToPx(120) }} />
|
|
|
- </View>
|
|
|
+ <View className='action_btn_img'>
|
|
|
+ <Image className='action_btn_img' style={{ left: 0, top: 0 }} src={BASE_IMG_URL + 'wechat.svg'} />
|
|
|
+ </View>
|
|
|
+ </View>
|
|
|
+ </NewButton>
|
|
|
+ }
|
|
|
+
|
|
|
+ <View style={{ height: rpxToPx(120) }} />
|
|
|
+ </View>
|
|
|
|
|
|
|
|
|
- {/* <View className='cardShowAni' style={{ display: 'flex', flexDirection: 'row', alignItems: 'center', height: rpxToPx(64), marginTop: rpxToPx(26) }}>
|
|
|
+ {/* <View className='cardShowAni' style={{ display: 'flex', flexDirection: 'row', alignItems: 'center', height: rpxToPx(64), marginTop: rpxToPx(26) }}>
|
|
|
<View className='or_line'/>
|
|
|
<View className='white h30 bold' style={{marginLeft:rpxToPx(24),marginRight:rpxToPx(24)}}>OR</View>
|
|
|
<View className='or_line'/>
|
|
|
@@ -227,8 +244,18 @@ export default function ChooseActions(props: { close: any, quick: any, chooseTex
|
|
|
</NewButton> */}
|
|
|
|
|
|
|
|
|
- {/* <View className='btnAni' style={{ marginBottom: rpxToPx(84), marginTop: rpxToPx(60) }} onClick={props.close}>
|
|
|
+ {/* <View className='btnAni' style={{ marginBottom: rpxToPx(84), marginTop: rpxToPx(60) }} onClick={props.close}>
|
|
|
<IconClose color="#fff" width={rpxToPx(64)} height={rpxToPx(64)} />
|
|
|
</View> */}
|
|
|
- </View>
|
|
|
+ </View>
|
|
|
+ }
|
|
|
+ if (process.env.TARO_ENV == 'weapp')
|
|
|
+ return content()
|
|
|
+ return <Modal dismiss={props.close}>
|
|
|
+ <View style={{ width: rpxToPx(750), height: screenHeight }}>
|
|
|
+ {
|
|
|
+ content()
|
|
|
+ }
|
|
|
+ </View>
|
|
|
+ </Modal>
|
|
|
}
|