|
|
@@ -1,5 +1,562 @@
|
|
|
-import { View, Image } from "@tarojs/components";
|
|
|
+import { View, Image, PageMeta, NavigationBar, Input, Textarea } from "@tarojs/components";
|
|
|
+import './log_record.scss'
|
|
|
+import { useEffect, useState } from "react";
|
|
|
+import Taro, { useRouter } from "@tarojs/taro";
|
|
|
+import { rpxToPx } from "@/utils/tools";
|
|
|
+import { IconArrow, IconClose } from "@/components/basic/Icons";
|
|
|
+import { MainColorType } from "@/context/themes/color";
|
|
|
+import { useTranslation } from "react-i18next";
|
|
|
+import showAlert from "@/components/basic/Alert";
|
|
|
+import showActionSheet from "@/components/basic/ActionSheet";
|
|
|
+import { baseUrl } from "@/services/http/api";
|
|
|
+import { checkAuthorized } from "@/utils/check_authorized";
|
|
|
+import NewButton, { NewButtonType } from "@/_health/base/new_button";
|
|
|
+import dayjs from "dayjs";
|
|
|
+import { TimeFormatter } from "@/utils/time_format";
|
|
|
+import { useSelector } from "react-redux";
|
|
|
+import { createMoment, updateMoment } from "@/services/health";
|
|
|
+import PostMomentTime from "@/_health/components/post_moment_time";
|
|
|
|
|
|
-export default function LogRecord(){
|
|
|
- return <View></View>
|
|
|
+let useRoute;
|
|
|
+let useNavigation;
|
|
|
+let scenario = '';
|
|
|
+if (process.env.TARO_ENV == 'rn') {
|
|
|
+ useRoute = require("@react-navigation/native").useRoute
|
|
|
+ useNavigation = require("@react-navigation/native").useNavigation
|
|
|
+}
|
|
|
+export default function LogRecord() {
|
|
|
+ const systemInfo: any = Taro.getWindowInfo ? Taro.getWindowInfo() : Taro.getSystemInfoSync();
|
|
|
+ const navigationBarHeight = systemInfo.statusBarHeight + 44;
|
|
|
+ const scale = '?x-oss-process=image/format,jpg/resize,w_400'
|
|
|
+ const long = useSelector((state: any) => state.long);
|
|
|
+ const health = useSelector((state: any) => state.health);
|
|
|
+ const [pics, setPics] = useState<any>([])
|
|
|
+ const [title, setTitle] = useState('')
|
|
|
+ const [desc, setDesc] = useState('')
|
|
|
+ const [step, setStep] = useState(0)
|
|
|
+ const { t } = useTranslation()
|
|
|
+
|
|
|
+ const [time, setTime] = useState(dayjs().format('HH:mm'))
|
|
|
+ const [selDate, setSelDate] = useState(dayjs().format('YYYY-MM-DD'))
|
|
|
+
|
|
|
+ const [enterTimestmap] = useState(new Date().getTime())
|
|
|
+ const [posting, setPosting] = useState(false)
|
|
|
+ const [showTimePicker, setShowTimePicker] = useState(false)
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+ let router
|
|
|
+ let navigation;
|
|
|
+ if (useNavigation) {
|
|
|
+ navigation = useNavigation()
|
|
|
+ }
|
|
|
+
|
|
|
+ if (process.env.TARO_ENV == 'rn') {
|
|
|
+ router = useRoute()
|
|
|
+ }
|
|
|
+ else {
|
|
|
+ router = useRouter()
|
|
|
+ }
|
|
|
+
|
|
|
+ const { event_id, is_temp, schedule_id } = router.params
|
|
|
+
|
|
|
+ const moment = router.params.moment ? JSON.parse(router.params.moment) : null
|
|
|
+
|
|
|
+ const window = router.params.window ?? health.mode
|
|
|
+
|
|
|
+ useEffect(() => {
|
|
|
+ console.log('sss')
|
|
|
+ // Taro.setBackgroundColor({
|
|
|
+ // backgroundColor:'red'
|
|
|
+ // })
|
|
|
+ }, [])
|
|
|
+
|
|
|
+ function tapPic() {
|
|
|
+ //, t('health.delete')
|
|
|
+ showActionSheet({
|
|
|
+ title: '',
|
|
|
+ itemList: [t('health.choose_photo'), t('health.import_wechat'), t('health.camera')],
|
|
|
+ success: function (res) {
|
|
|
+ switch (res) {
|
|
|
+ case 0:
|
|
|
+ addImage(false)
|
|
|
+ break;
|
|
|
+ case 1:
|
|
|
+ Taro.chooseMessageFile({
|
|
|
+ count: 9 - pics.length,
|
|
|
+ type: 'image',
|
|
|
+ success: async function (res) {
|
|
|
+ const results = await Promise.all(res.tempFiles.map(getImageInfo));
|
|
|
+ chooseSuccess(results, true)
|
|
|
+ },
|
|
|
+ fail(res) {
|
|
|
+ },
|
|
|
+ })
|
|
|
+ break;
|
|
|
+ case 2:
|
|
|
+ addImage(true)
|
|
|
+ break;
|
|
|
+ case 3:
|
|
|
+ // setImgUrl('')
|
|
|
+ break;
|
|
|
+ }
|
|
|
+ }
|
|
|
+ })
|
|
|
+ }
|
|
|
+
|
|
|
+ function addImage(isCamera) {
|
|
|
+ var source: any = isCamera ? ['camera'] : ['album']
|
|
|
+ console.log(source)
|
|
|
+ Taro.chooseMedia({
|
|
|
+ count: 9 - pics.length,
|
|
|
+ sizeType: ['compressed'],
|
|
|
+ mediaType: ['image'],
|
|
|
+ sourceType: source,
|
|
|
+ success: async function (res) {
|
|
|
+ const results = await Promise.all(res.tempFiles.map(getImageInfo));
|
|
|
+
|
|
|
+
|
|
|
+ chooseSuccess(results, true)
|
|
|
+ checkAuthorized()
|
|
|
+ },
|
|
|
+ fail: function (res) {
|
|
|
+ }
|
|
|
+ })
|
|
|
+ }
|
|
|
+
|
|
|
+ async function chooseSuccess(res, isAlbum) {
|
|
|
+ console.log('选择图片', res)
|
|
|
+ // const filePaths = res.map(file => file.path
|
|
|
+ // // process.env.TARO_ENV === 'rn' || isFilePath ? file.path : file.tempFilePath
|
|
|
+ // )
|
|
|
+ Taro.showLoading({
|
|
|
+ title: t('health.uploading')
|
|
|
+ })
|
|
|
+
|
|
|
+ try {
|
|
|
+ const uploadedUrls = await Promise.all(res.map(path => uploadFile2(path, isAlbum ? 'album' : 'camera')))
|
|
|
+ setPics([...pics, ...uploadedUrls])
|
|
|
+ Taro.hideLoading()
|
|
|
+ } catch (error) {
|
|
|
+ console.error('Error uploading files:', error)
|
|
|
+ Taro.hideLoading()
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
+ function uploadFile2(obj: any, source: string): Promise<string> {
|
|
|
+ return new Promise((resolve, reject) => {
|
|
|
+ var path = obj.path
|
|
|
+ const dot = path.lastIndexOf('.')
|
|
|
+ const fileExt = dot > 0 ? path.substring(dot) : ''
|
|
|
+ Taro.request({
|
|
|
+ method: 'GET',
|
|
|
+ url: `${baseUrl}/api/thirdparty/aliyun/oss-form-upload`,
|
|
|
+ header: {
|
|
|
+ 'Authorization': 'bearer ' + global.token
|
|
|
+ },
|
|
|
+ data: {
|
|
|
+ type: 'FOOD_JOURNAL',
|
|
|
+ file_ext: fileExt
|
|
|
+ },
|
|
|
+ success: (rsp) => {
|
|
|
+ if (rsp.statusCode !== 200) {
|
|
|
+ reject(new Error(t('health.networkError')))
|
|
|
+ return
|
|
|
+ }
|
|
|
+ Taro.uploadFile({
|
|
|
+ url: rsp.data.upload_url,
|
|
|
+ filePath: path,
|
|
|
+ name: 'file',
|
|
|
+ formData: rsp.data.fields,
|
|
|
+ success: () => {
|
|
|
+ var temp = JSON.parse(JSON.stringify(obj))
|
|
|
+ temp.url = rsp.data.view_url
|
|
|
+ // resolve(rsp.data.view_url)
|
|
|
+ resolve(temp)
|
|
|
+ },
|
|
|
+ fail: (error) => {
|
|
|
+
|
|
|
+ reject(error)
|
|
|
+ }
|
|
|
+ })
|
|
|
+ },
|
|
|
+ fail: reject
|
|
|
+ })
|
|
|
+ })
|
|
|
+ }
|
|
|
+
|
|
|
+
|
|
|
+ const getImageInfo = (src) => {
|
|
|
+ const { tempFilePath, path } = src
|
|
|
+ return new Promise((resolve) => {
|
|
|
+ Taro.getImageInfo({
|
|
|
+ src: tempFilePath ? tempFilePath : path,
|
|
|
+ success: (result) => resolve({
|
|
|
+ height: result.height,
|
|
|
+ width: result.width,
|
|
|
+ orientation: result.orientation,
|
|
|
+ path: result.path,
|
|
|
+ type: result.type
|
|
|
+ }),
|
|
|
+ fail: (error) => resolve({
|
|
|
+ height: 1024,
|
|
|
+ width: 1024,
|
|
|
+ orientation: 'up',
|
|
|
+ path: tempFilePath,
|
|
|
+ type: 'unknown'
|
|
|
+ }),
|
|
|
+ });
|
|
|
+ });
|
|
|
+ };
|
|
|
+
|
|
|
+ function save() {
|
|
|
+ if (router.params.edit) {
|
|
|
+ edit()
|
|
|
+ return
|
|
|
+ }
|
|
|
+ // var str = selDate + ' ' + time + ':' + dayjs(enterTimestmap).format('ss')
|
|
|
+ // console.log('系统时间',new Date())
|
|
|
+ // console.log('提交日期格式',str)
|
|
|
+ // console.log('转成日期',new Date(str))
|
|
|
+
|
|
|
+ // var date = new Date(selDate + 'T' + time + ':' + dayjs(enterTimestmap).format('ss'))
|
|
|
+ var date = TimeFormatter.stringToDate(selDate, time)
|
|
|
+ date.setMilliseconds(new Date(enterTimestmap).getMilliseconds())
|
|
|
+
|
|
|
+
|
|
|
+ var params: any = {
|
|
|
+ schedule_id: schedule_id,
|
|
|
+ title: title,
|
|
|
+ description: desc,
|
|
|
+ start: {
|
|
|
+ date: dayjs(date.getTime()).format('YYYYMMDD'),
|
|
|
+ timestamp: date.getTime()
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
+ if (router.params.join_id) {
|
|
|
+ params.join_key = router.params.join_id
|
|
|
+ }
|
|
|
+
|
|
|
+ if (pics.length > 0) {
|
|
|
+ var picList: any = []
|
|
|
+ pics.map((item) => {
|
|
|
+ picList.push({
|
|
|
+ url: item.url,
|
|
|
+ type: item.url.indexOf('mp4') != -1 ? 'video' : 'image',
|
|
|
+ source: 'album',
|
|
|
+ width: item.width,
|
|
|
+ height: item.height,
|
|
|
+ format: item.format
|
|
|
+ })
|
|
|
+ })
|
|
|
+ params.media = picList
|
|
|
+ }
|
|
|
+
|
|
|
+
|
|
|
+ // if (imgUrl.length > 0) {
|
|
|
+ // params.media = [{
|
|
|
+ // url: imgUrl,
|
|
|
+ // type: imgUrl.indexOf('mp4') != -1 ? 'video' : 'image',
|
|
|
+ // source: 'album'
|
|
|
+ // }]
|
|
|
+ // }
|
|
|
+ if (event_id && event_id != 'undefined') {
|
|
|
+ params.event_id = event_id
|
|
|
+ }
|
|
|
+
|
|
|
+ if (is_temp) {
|
|
|
+ params.event = window == 'EAT' ? 'EAT_CUSTOM' : 'ACTIVE_CUSTOM'
|
|
|
+ }
|
|
|
+ params.op_page = window == 'EAT' ? 'HOME_EAT' : 'HOME_ACTIVE'
|
|
|
+ // if (moment.target && moment.target.duration) {
|
|
|
+ // params.duration = durationT//moment.target.duration
|
|
|
+ // }
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+ params.extra = {
|
|
|
+ set_time: global.set_time ? global.set_time : new Date().getTime(),
|
|
|
+ confirm_time: new Date().getTime()
|
|
|
+ }
|
|
|
+ console.log('打卡提交数据', params)
|
|
|
+ if (posting) return
|
|
|
+ setPosting(true)
|
|
|
+ createMoment(params).then(res => {
|
|
|
+ // setTimeout(() => {
|
|
|
+ setPosting(false)
|
|
|
+ Taro.eventCenter.trigger('refreshMoments', '')
|
|
|
+ // }, 1000)
|
|
|
+
|
|
|
+ if (process.env.TARO_ENV == 'weapp') {
|
|
|
+ // Taro.navigateBack();
|
|
|
+ Taro.redirectTo({
|
|
|
+ url: '/_health/pages/post_result?data=' + JSON.stringify(res)
|
|
|
+ })
|
|
|
+ // Taro.navigateTo({
|
|
|
+ // url:'/_health/pages/post_result?data=' + JSON.stringify(res)
|
|
|
+ // })
|
|
|
+ }
|
|
|
+
|
|
|
+ Taro.disableAlertBeforeUnload({
|
|
|
+
|
|
|
+ })
|
|
|
+
|
|
|
+ global.refreshWindow()
|
|
|
+ global.refreshHistory()
|
|
|
+
|
|
|
+ if (global.postMomentSuccess) {
|
|
|
+ global.postMomentSuccess()
|
|
|
+ }
|
|
|
+ }).catch(e => {
|
|
|
+ debugger
|
|
|
+ setPosting(false)
|
|
|
+ })
|
|
|
+ }
|
|
|
+
|
|
|
+ function edit() {
|
|
|
+ // var date = new Date(selDate + 'T' + time + ':' + dayjs(enterTimestmap).format('ss'))
|
|
|
+ var date = TimeFormatter.stringToDate(selDate, time)
|
|
|
+ var params: any = {
|
|
|
+ schedule_id: schedule_id,
|
|
|
+ title: title,
|
|
|
+ description: desc,
|
|
|
+ start: {
|
|
|
+ date: dayjs(date.getTime()).format('YYYYMMDD'),
|
|
|
+ timestamp: date.getTime()
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
+
|
|
|
+ // if (imgUrl.length > 0) {
|
|
|
+ // params.media = [{
|
|
|
+ // url: imgUrl,
|
|
|
+ // type: imgUrl.indexOf('mp4') != -1 ? 'video' : 'image',
|
|
|
+ // source: 'album'
|
|
|
+ // }]
|
|
|
+ // }
|
|
|
+ if (pics.length > 0) {
|
|
|
+ var picList: any = []
|
|
|
+ pics.map((item) => {
|
|
|
+ picList.push({
|
|
|
+ url: item.url,
|
|
|
+ type: item.url.indexOf('mp4') != -1 ? 'video' : 'image',
|
|
|
+ source: 'album',
|
|
|
+ width: item.width,
|
|
|
+ height: item.height,
|
|
|
+ format: item.format
|
|
|
+ })
|
|
|
+ })
|
|
|
+ params.media = picList
|
|
|
+ }
|
|
|
+ else {
|
|
|
+ params.media = []
|
|
|
+ }
|
|
|
+ if (event_id && event_id != 'undefined') {
|
|
|
+ params.event_id = event_id
|
|
|
+ }
|
|
|
+
|
|
|
+ if (is_temp) {
|
|
|
+ params.event = window == 'EAT' ? 'EAT_CUSTOM' : 'ACTIVE_CUSTOM'
|
|
|
+ }
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+ params.extra = {
|
|
|
+ set_time: global.set_time ? global.set_time : new Date().getTime(),
|
|
|
+ confirm_time: new Date().getTime()
|
|
|
+ }
|
|
|
+
|
|
|
+ if (posting) return
|
|
|
+ setPosting(true)
|
|
|
+ updateMoment(params, router.params.id).then(res => {
|
|
|
+ Taro.eventCenter.trigger('refreshMoments', '')
|
|
|
+ setPosting(false)
|
|
|
+ if (process.env.TARO_ENV == 'weapp') {
|
|
|
+ Taro.navigateBack();
|
|
|
+ }
|
|
|
+
|
|
|
+ global.refreshWindow()
|
|
|
+ global.refreshHistory()
|
|
|
+ global.refreshMoment()
|
|
|
+ }).catch(e => {
|
|
|
+ setPosting(false)
|
|
|
+ })
|
|
|
+ }
|
|
|
+
|
|
|
+ function getDate() {
|
|
|
+ var sel = dayjs(selDate)
|
|
|
+ var now = dayjs().format('YYYY-MM-DD')
|
|
|
+ const yesterday = dayjs().subtract(1, 'day');
|
|
|
+ if (sel.format('YYYY-MM-DD') == now) {
|
|
|
+ return ''
|
|
|
+ }
|
|
|
+ if (yesterday.format('YYYY-MM-DD') == sel.format('YYYY-MM-DD')) {
|
|
|
+ return global.language == 'en' ? 'Yesterday ' : '昨天 '
|
|
|
+ }
|
|
|
+ else {
|
|
|
+ return global.language == 'en' ? sel.format('MMM D ') : sel.format('MMMD日 ')
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
+ return <View style={{ position: 'relative' }}>
|
|
|
+ <View className="main_bg" style={{ background: 'linear-gradient(to bottom, #F0CABF, #E1CDEE)' }} />
|
|
|
+ <View className="navi_bar" style={{ height: navigationBarHeight }}>
|
|
|
+ <View style={{
|
|
|
+ position: 'absolute',
|
|
|
+ left: 0,
|
|
|
+ right: 0,
|
|
|
+ bottom: 0,
|
|
|
+ height: 44,
|
|
|
+ display: 'flex',
|
|
|
+ alignItems: 'center',
|
|
|
+ justifyContent: 'center'
|
|
|
+ }}>
|
|
|
+ <Image src={require('@assets/_health/navi_back.png')} style={{
|
|
|
+ position: 'absolute',
|
|
|
+ width: rpxToPx(92),
|
|
|
+ height: rpxToPx(64),
|
|
|
+ left: 0,
|
|
|
+ top: 22 - rpxToPx(32)
|
|
|
+ }}
|
|
|
+ onClick={() => {
|
|
|
+ Taro.navigateBack()
|
|
|
+ }}
|
|
|
+ />
|
|
|
+ {/* <View className="h36 bold">upcoming fast</View> */}
|
|
|
+ </View>
|
|
|
+ </View>
|
|
|
+ <View style={{ height: navigationBarHeight }} />
|
|
|
+ {
|
|
|
+ step == 0 && <View style={{ display: 'flex', flexDirection: 'column', alignItems: 'center', marginTop: rpxToPx(152) }}>
|
|
|
+ <Image src={require('@assets/_health/eat.png')} style={{ width: rpxToPx(96), height: rpxToPx(96) }} />
|
|
|
+ <View className="h50 bold">选择打卡的餐次</View>
|
|
|
+ <View className="operate_bg">
|
|
|
+ <View className="operate_item h30 bold" onClick={() => {
|
|
|
+ setStep(2)
|
|
|
+ }}>早餐</View>
|
|
|
+ <View className="operate_item h30 bold" onClick={() => {
|
|
|
+ setStep(1)
|
|
|
+ }}>自定义</View>
|
|
|
+ </View>
|
|
|
+ </View>
|
|
|
+ }
|
|
|
+ {
|
|
|
+ step == 1 && <View style={{ display: 'flex', flexDirection: 'column', alignItems: 'center', marginTop: rpxToPx(152) }}>
|
|
|
+ <View className="input_form">
|
|
|
+ <Input className="input_content h36" placeholder="请输入自定义名称" value={title}
|
|
|
+ onInput={(e: any) => {
|
|
|
+ setTitle(e.target.value)
|
|
|
+ }} />
|
|
|
+ <View className="form_btns">
|
|
|
+ <View className="form_cancel h30 bold" onClick={() => {
|
|
|
+ setStep(0)
|
|
|
+ }}>取消</View>
|
|
|
+ <View className={title.length == 0 ? 'form_cancel form_confirm h30 bold' : 'form_cancel h30 bold'}
|
|
|
+ onClick={() => {
|
|
|
+ if (title.length == 0) return
|
|
|
+ setStep(2)
|
|
|
+ }}
|
|
|
+ >确定</View>
|
|
|
+ </View>
|
|
|
+ </View>
|
|
|
+ </View>
|
|
|
+ }
|
|
|
+ {
|
|
|
+ step == 2 && <View>
|
|
|
+ <View style={{ display: 'flex', flexDirection: 'row' }} onClick={()=>{
|
|
|
+ setStep(0)
|
|
|
+ }}>
|
|
|
+ <View className="sel_tag h34 bold">
|
|
|
+ {title}
|
|
|
+ <View style={{ width: rpxToPx(6) }} />
|
|
|
+ <IconArrow width={rpxToPx(34)} color={MainColorType.g02} />
|
|
|
+ </View>
|
|
|
+ </View>
|
|
|
+
|
|
|
+ <Textarea placeholder={t('health.add_text')} className="textarea2 h44 bold"
|
|
|
+ placeholder-style="color:rgba(0,0,0,0.2)"
|
|
|
+ value={desc}
|
|
|
+ onInput={e => {
|
|
|
+ setDesc(e.detail.value)
|
|
|
+ }} />
|
|
|
+ <View className="form">
|
|
|
+ {
|
|
|
+ pics.map((item, index) => {
|
|
|
+ return <View className="cover" key={index}>
|
|
|
+ <Image src={item.url + scale} mode="aspectFill" className="cover" style={{
|
|
|
+ margin: 0
|
|
|
+ }} key={index} onClick={() => {
|
|
|
+ Taro.previewImage({
|
|
|
+ current: pics[index].url,
|
|
|
+ urls: pics.map(file => file.url)
|
|
|
+ })
|
|
|
+ }} />
|
|
|
+ <View className="cover_del" onClick={() => {
|
|
|
+ showAlert({
|
|
|
+ title: t('health.del_title'),
|
|
|
+ content: '',
|
|
|
+ cancelText: t('health.del_cancel'),
|
|
|
+ confirmText: t('health.del_confirm'),
|
|
|
+ showCancel: true,
|
|
|
+ confirm: () => {
|
|
|
+ var array = JSON.parse(JSON.stringify(pics))
|
|
|
+ array.splice(index, 1)
|
|
|
+ setPics(array)
|
|
|
+ }
|
|
|
+ })
|
|
|
+ }}>
|
|
|
+ <View className="cover_del_btn">
|
|
|
+ <IconClose width={10} height={10} color="#fff" />
|
|
|
+ </View>
|
|
|
+ </View>
|
|
|
+ </View>
|
|
|
+ })
|
|
|
+ }
|
|
|
+ {
|
|
|
+ pics.length < 9 && <View onClick={tapPic} className="cover" style={{}}><Image src={require('@assets/_health/camera.png')} style={{ width: 40, height: 40 }} /></View>
|
|
|
+ }
|
|
|
+ </View>
|
|
|
+ <View className="time_view" onClick={() => {
|
|
|
+ setShowTimePicker(true)
|
|
|
+ }}>
|
|
|
+
|
|
|
+ <View className="h30" style={{ opacity: 0.3 }}>时间</View>
|
|
|
+ <View style={{ flex: 1 }} />
|
|
|
+ <View className="h30" style={{ opacity: 0.3 }}>{getDate() + time}</View>
|
|
|
+ <IconArrow width={rpxToPx(34)} color={MainColorType.g02} />
|
|
|
+ <View className="border_footer_line" style={{left:rpxToPx(48)}}/>
|
|
|
+ </View>
|
|
|
+ <View style={{ flex: 1 }} />
|
|
|
+
|
|
|
+ <View className="main_footer" style={{ backgroundColor: 'transparent' }}><NewButton
|
|
|
+ type={NewButtonType.fill}
|
|
|
+ color={MainColorType.orange}
|
|
|
+ width={rpxToPx(646)}
|
|
|
+ height={rpxToPx(96)}
|
|
|
+ title={t('health.log_moment')}
|
|
|
+ onClick={save}
|
|
|
+ /></View>
|
|
|
+
|
|
|
+ </View>
|
|
|
+ }
|
|
|
+ {
|
|
|
+ showTimePicker && <PostMomentTime
|
|
|
+ title={t('health.log_time_title')}
|
|
|
+ time={time}
|
|
|
+ date={selDate}
|
|
|
+ isTemp={is_temp}
|
|
|
+ moment={moment}
|
|
|
+ onChange={(e) => {
|
|
|
+ const { date, duration, time, isYesterday } = e;
|
|
|
+ setTime(time)
|
|
|
+ setSelDate(date)
|
|
|
+ // setIsYesterday(isYesterday)
|
|
|
+ // setDurationT(duration)
|
|
|
+ setShowTimePicker(false)
|
|
|
+ }} dismiss={() => {
|
|
|
+ setShowTimePicker(false)
|
|
|
+ }} />
|
|
|
+ }
|
|
|
+ </View>
|
|
|
}
|