|
@@ -1,4 +1,4 @@
|
|
|
-import { View, Image, PageMeta, NavigationBar, Input, Textarea } from "@tarojs/components";
|
|
|
|
|
|
|
+import { View, Image, PageMeta, NavigationBar, Input, Textarea, ScrollView, Snapshot } from "@tarojs/components";
|
|
|
import './log_record.scss'
|
|
import './log_record.scss'
|
|
|
import { useEffect, useState } from "react";
|
|
import { useEffect, useState } from "react";
|
|
|
import Taro, { useRouter, useShareAppMessage } from "@tarojs/taro";
|
|
import Taro, { useRouter, useShareAppMessage } from "@tarojs/taro";
|
|
@@ -8,7 +8,7 @@ import { MainColorType } from "@/context/themes/color";
|
|
|
import { useTranslation } from "react-i18next";
|
|
import { useTranslation } from "react-i18next";
|
|
|
import showAlert from "@/components/basic/Alert";
|
|
import showAlert from "@/components/basic/Alert";
|
|
|
import showActionSheet from "@/components/basic/ActionSheet";
|
|
import showActionSheet from "@/components/basic/ActionSheet";
|
|
|
-import { baseUrl } from "@/services/http/api";
|
|
|
|
|
|
|
+import { BASE_IMG_URL, baseUrl } from "@/services/http/api";
|
|
|
import { checkAuthorized } from "@/utils/check_authorized";
|
|
import { checkAuthorized } from "@/utils/check_authorized";
|
|
|
import NewButton, { NewButtonType } from "@/_health/base/new_button";
|
|
import NewButton, { NewButtonType } from "@/_health/base/new_button";
|
|
|
import dayjs from "dayjs";
|
|
import dayjs from "dayjs";
|
|
@@ -19,6 +19,9 @@ import PostMomentTime from "@/_health/components/post_moment_time";
|
|
|
import ShareBtn from "@/components/basic/ShareBtn";
|
|
import ShareBtn from "@/components/basic/ShareBtn";
|
|
|
import { jumpPage } from "@/features/trackTimeDuration/hooks/Common";
|
|
import { jumpPage } from "@/features/trackTimeDuration/hooks/Common";
|
|
|
import ChooseActions from "@/pages/clock/components/choose_actions";
|
|
import ChooseActions from "@/pages/clock/components/choose_actions";
|
|
|
|
|
+import PickerCard from "../components/picker_card";
|
|
|
|
|
+import { IconCamera, IconClock } from "../components/record_icon";
|
|
|
|
|
+import QuickLog from "../components/quick_log";
|
|
|
|
|
|
|
|
let useRoute;
|
|
let useRoute;
|
|
|
let useNavigation;
|
|
let useNavigation;
|
|
@@ -29,6 +32,8 @@ if (process.env.TARO_ENV == 'rn') {
|
|
|
export default function LogRecord() {
|
|
export default function LogRecord() {
|
|
|
const systemInfo: any = Taro.getWindowInfo ? Taro.getWindowInfo() : Taro.getSystemInfoSync();
|
|
const systemInfo: any = Taro.getWindowInfo ? Taro.getWindowInfo() : Taro.getSystemInfoSync();
|
|
|
const navigationBarHeight = systemInfo.statusBarHeight + 44;
|
|
const navigationBarHeight = systemInfo.statusBarHeight + 44;
|
|
|
|
|
+ const screenHeight = systemInfo.screenHeight
|
|
|
|
|
+
|
|
|
const scale = '?x-oss-process=image/format,jpg/resize,w_400'
|
|
const scale = '?x-oss-process=image/format,jpg/resize,w_400'
|
|
|
const long = useSelector((state: any) => state.long);
|
|
const long = useSelector((state: any) => state.long);
|
|
|
const health = useSelector((state: any) => state.health);
|
|
const health = useSelector((state: any) => state.health);
|
|
@@ -38,7 +43,7 @@ export default function LogRecord() {
|
|
|
const [title, setTitle] = useState('')
|
|
const [title, setTitle] = useState('')
|
|
|
const [chooseTitle, setChooseTitle] = useState('')
|
|
const [chooseTitle, setChooseTitle] = useState('')
|
|
|
const [desc, setDesc] = useState('')
|
|
const [desc, setDesc] = useState('')
|
|
|
- const [step, setStep] = useState(0)
|
|
|
|
|
|
|
+ const [step, setStep] = useState(2)
|
|
|
const { t } = useTranslation()
|
|
const { t } = useTranslation()
|
|
|
|
|
|
|
|
const [time, setTime] = useState(dayjs().format('HH:mm'))
|
|
const [time, setTime] = useState(dayjs().format('HH:mm'))
|
|
@@ -72,13 +77,14 @@ export default function LogRecord() {
|
|
|
router = useRouter()
|
|
router = useRouter()
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
- const { event_id, is_temp, schedule_id, scenario, imgs, only_text } = router.params
|
|
|
|
|
|
|
+ const { event_id, is_temp, schedule_id, scenario, imgs, only_text, quick } = router.params
|
|
|
|
|
|
|
|
const moment = router.params.moment ? JSON.parse(router.params.moment) : null
|
|
const moment = router.params.moment ? JSON.parse(router.params.moment) : null
|
|
|
|
|
|
|
|
const window = router.params.window ?? health.mode
|
|
const window = router.params.window ?? health.mode
|
|
|
const [pics, setPics] = useState<any>(imgs ? JSON.parse(imgs) : [])
|
|
const [pics, setPics] = useState<any>(imgs ? JSON.parse(imgs) : [])
|
|
|
const [focus, setFocus] = useState(only_text ? true : false)
|
|
const [focus, setFocus] = useState(only_text ? true : false)
|
|
|
|
|
+ const [quickStatus, setQuickStatus] = useState(quick ? true : false)
|
|
|
|
|
|
|
|
if (process.env.TARO_ENV == 'weapp') {
|
|
if (process.env.TARO_ENV == 'weapp') {
|
|
|
|
|
|
|
@@ -111,6 +117,9 @@ export default function LogRecord() {
|
|
|
if (router.params.check_in == 1) {
|
|
if (router.params.check_in == 1) {
|
|
|
setStep(0)
|
|
setStep(0)
|
|
|
}
|
|
}
|
|
|
|
|
+ if (router.params.quick) {
|
|
|
|
|
+ quickSave()
|
|
|
|
|
+ }
|
|
|
}, [])
|
|
}, [])
|
|
|
|
|
|
|
|
function getTags() {
|
|
function getTags() {
|
|
@@ -206,7 +215,7 @@ export default function LogRecord() {
|
|
|
|
|
|
|
|
|
|
|
|
|
chooseSuccess(results, true)
|
|
chooseSuccess(results, true)
|
|
|
- checkAuthorized()
|
|
|
|
|
|
|
+ // checkAuthorized()
|
|
|
},
|
|
},
|
|
|
fail: function (res) {
|
|
fail: function (res) {
|
|
|
}
|
|
}
|
|
@@ -298,6 +307,10 @@ export default function LogRecord() {
|
|
|
});
|
|
});
|
|
|
};
|
|
};
|
|
|
|
|
|
|
|
|
|
+ function quickSave() {
|
|
|
|
|
+
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
function save() {
|
|
function save() {
|
|
|
if (router.params.edit) {
|
|
if (router.params.edit) {
|
|
|
edit()
|
|
edit()
|
|
@@ -368,6 +381,9 @@ export default function LogRecord() {
|
|
|
setResult(res)
|
|
setResult(res)
|
|
|
setPosting(false)
|
|
setPosting(false)
|
|
|
Taro.hideLoading()
|
|
Taro.hideLoading()
|
|
|
|
|
+ Taro.reLaunch({
|
|
|
|
|
+ url: '/pages/moment/moment'
|
|
|
|
|
+ })
|
|
|
}).catch(e => {
|
|
}).catch(e => {
|
|
|
setPosting(false)
|
|
setPosting(false)
|
|
|
Taro.hideLoading()
|
|
Taro.hideLoading()
|
|
@@ -496,8 +512,14 @@ export default function LogRecord() {
|
|
|
return `linear-gradient(to bottom, ${background_colors[0]}, ${background_colors[1]})`
|
|
return `linear-gradient(to bottom, ${background_colors[0]}, ${background_colors[1]})`
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
- return <View style={{ position: 'relative' }}>
|
|
|
|
|
- <View className="main_bg" style={{ background: getBackground() }} />
|
|
|
|
|
|
|
+ if (quick) {
|
|
|
|
|
+ return <QuickLog tag={chooseTitle} scenario={scenario} updateTag={() => {
|
|
|
|
|
+
|
|
|
|
|
+ }} />
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
|
|
+ return <View style={{ position: 'relative', overflow: showChoose ? 'hidden' : 'auto' }}>
|
|
|
|
|
+ <View className="main_bg" style={{ background: getBackground(), position: 'absolute' }} />
|
|
|
<View className="navi_bar" style={{ height: navigationBarHeight, zIndex: 1000 }}>
|
|
<View className="navi_bar" style={{ height: navigationBarHeight, zIndex: 1000 }}>
|
|
|
<View style={{
|
|
<View style={{
|
|
|
position: 'absolute',
|
|
position: 'absolute',
|
|
@@ -517,66 +539,105 @@ export default function LogRecord() {
|
|
|
top: 22 - rpxToPx(32)
|
|
top: 22 - rpxToPx(32)
|
|
|
}}
|
|
}}
|
|
|
onClick={() => {
|
|
onClick={() => {
|
|
|
|
|
+ if (showResult) {
|
|
|
|
|
+ Taro.navigateBack()
|
|
|
|
|
+ return
|
|
|
|
|
+ }
|
|
|
debugger
|
|
debugger
|
|
|
|
|
+ if (chooseTitle.length > 0 && step == 0) {
|
|
|
|
|
+ setStep(2)
|
|
|
|
|
+ return
|
|
|
|
|
+ }
|
|
|
|
|
+ if (step == 2) {
|
|
|
|
|
+ showAlert({
|
|
|
|
|
+ title: t('health.back_no_save'),
|
|
|
|
|
+ content: '',
|
|
|
|
|
+ showCancel: true,
|
|
|
|
|
+ cancelText: '取消',
|
|
|
|
|
+ confirmText: '退出',
|
|
|
|
|
+ confirm: () => {
|
|
|
|
|
+ Taro.navigateBack()
|
|
|
|
|
+ }
|
|
|
|
|
+ })
|
|
|
|
|
+ return
|
|
|
|
|
+ }
|
|
|
Taro.navigateBack()
|
|
Taro.navigateBack()
|
|
|
}}>
|
|
}}>
|
|
|
- <IconClose color="#000" width={rpxToPx(64)} height={rpxToPx(64)} />
|
|
|
|
|
|
|
+ <IconClose color={showResult ? "#fff" : "#000"} width={rpxToPx(64)} height={rpxToPx(64)} />
|
|
|
</View>
|
|
</View>
|
|
|
- {/* <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>
|
|
</View>
|
|
|
<View style={{ height: navigationBarHeight }} />
|
|
<View style={{ height: navigationBarHeight }} />
|
|
|
{
|
|
{
|
|
|
- step == 0 && <View className="cardShowAni" 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">选择打卡的{scenario == 'MEAL' ? '餐次' : '活动'}</View>
|
|
|
|
|
- <View className="operate_bg">
|
|
|
|
|
- {
|
|
|
|
|
- tags.map((item, index) => {
|
|
|
|
|
- return <View key={index} className="operate_item h34"
|
|
|
|
|
- style={{ backgroundColor: MainColorType.white_25 }}
|
|
|
|
|
- onClick={() => {
|
|
|
|
|
- setChooseTitle(item.title)
|
|
|
|
|
- setPostCount(item.log_count + 1)
|
|
|
|
|
- // setStep(2)
|
|
|
|
|
- setSelTag(item)
|
|
|
|
|
- setShowChoose(true)
|
|
|
|
|
- }}>
|
|
|
|
|
- <View className="first_letter h36">{item.title.substring(0, 1).toUpperCase()}</View>
|
|
|
|
|
- {item.title}
|
|
|
|
|
- <View style={{ flex: 1 }} />
|
|
|
|
|
- <IconAdd color={MainColorType.g02} width={rpxToPx(36)} />
|
|
|
|
|
- </View>
|
|
|
|
|
- })
|
|
|
|
|
- }
|
|
|
|
|
|
|
+ step == 0 && <ScrollView style={{ flex: 1, position: 'relative', zIndex: 1000, height: screenHeight - navigationBarHeight }} scrollY>
|
|
|
|
|
+ {/* <Snapshot id="temp"> */}
|
|
|
|
|
+ <View className="cardShowAni" style={{ display: 'flex', flexDirection: 'column', alignItems: 'center', marginTop: rpxToPx(152) }}>
|
|
|
|
|
+ <Image src={BASE_IMG_URL + 'tag.svg'} style={{ width: rpxToPx(96), height: rpxToPx(96), marginBottom: rpxToPx(24) }} />
|
|
|
|
|
+ <View className="h50 bold" style={{ textAlign: 'center', width: rpxToPx(600) }}>选择打卡的{scenario == 'MEAL' ? '餐次' : '活动'}</View>
|
|
|
|
|
+ <View className="operate_bg">
|
|
|
|
|
+ {
|
|
|
|
|
+ tags.map((item, index) => {
|
|
|
|
|
+ return <NewButton key={index} type={NewButtonType.custom}
|
|
|
|
|
+ onClick={() => {
|
|
|
|
|
+ setChooseTitle(item.title)
|
|
|
|
|
+ setPostCount(item.log_count + 1)
|
|
|
|
|
+ setStep(2)
|
|
|
|
|
+ setSelTag(item)
|
|
|
|
|
+ // setShowChoose(true)
|
|
|
|
|
+ }}>
|
|
|
|
|
+ <View key={index} className="operate_item h34"
|
|
|
|
|
+ style={{ backgroundColor: MainColorType.white_25 }}
|
|
|
|
|
+ >
|
|
|
|
|
+ <View className="first_letter h36">{item.title.substring(0, 1).toUpperCase()}</View>
|
|
|
|
|
+ {item.title}
|
|
|
|
|
+ <View style={{ flex: 1 }} />
|
|
|
|
|
+ <IconAdd color={MainColorType.g02} width={rpxToPx(36)} />
|
|
|
|
|
+ </View>
|
|
|
|
|
+ </NewButton>
|
|
|
|
|
+ })
|
|
|
|
|
+ }
|
|
|
|
|
|
|
|
- <View className="operate_item h30 bold"
|
|
|
|
|
- style={{ backgroundColor: MainColorType.white_25 }}
|
|
|
|
|
- onClick={() => {
|
|
|
|
|
- setTitle('')
|
|
|
|
|
- setChooseTitle('')
|
|
|
|
|
- setPostCount(1)
|
|
|
|
|
- setStep(1)
|
|
|
|
|
- }}><View className="first_letter h36">自</View>自定义</View>
|
|
|
|
|
|
|
+ <View className="operate_item h34"
|
|
|
|
|
+ style={{ backgroundColor: MainColorType.white_25 }}
|
|
|
|
|
+ onClick={() => {
|
|
|
|
|
+
|
|
|
|
|
+ // Taro.createSelectorQuery().select('#temp').node().exec(res=>{
|
|
|
|
|
+ // console.log('9527')
|
|
|
|
|
+ // const node = res[0].node
|
|
|
|
|
+ // node.takeSnapshot({
|
|
|
|
|
+ // type:'file',
|
|
|
|
|
+ // format:'png',
|
|
|
|
|
+ // success:(res)=>{
|
|
|
|
|
+ // console.log(res)
|
|
|
|
|
+ // Taro.saveImageToPhotosAlbum({
|
|
|
|
|
+ // filePath:res.tempFilePath
|
|
|
|
|
+ // })
|
|
|
|
|
+ // },
|
|
|
|
|
+ // fail(res){
|
|
|
|
|
+ // console.log(res)
|
|
|
|
|
+ // debugger
|
|
|
|
|
+ // }
|
|
|
|
|
+ // })
|
|
|
|
|
+ // })
|
|
|
|
|
+ // return
|
|
|
|
|
+ setTitle('')
|
|
|
|
|
+ setChooseTitle('')
|
|
|
|
|
+ setPostCount(1)
|
|
|
|
|
+ setStep(1)
|
|
|
|
|
+ }}><View className="first_letter h36">
|
|
|
|
|
+ <Image src={BASE_IMG_URL + 'edit.svg'} style={{ width: rpxToPx(36), height: rpxToPx(36) }} />
|
|
|
|
|
+ </View>自定义</View>
|
|
|
|
|
+ </View>
|
|
|
</View>
|
|
</View>
|
|
|
- </View>
|
|
|
|
|
|
|
+ {/* </Snapshot> */}
|
|
|
|
|
+ </ScrollView>
|
|
|
}
|
|
}
|
|
|
{
|
|
{
|
|
|
- step == 1 && <View className="cardShowAni" style={{ display: 'flex', flexDirection: 'column', alignItems: 'center', marginTop: rpxToPx(152) }}>
|
|
|
|
|
|
|
+ step == 1 && <View className="cardShowAni" style={{ display: 'flex', flexDirection: 'column', alignItems: 'center', marginTop: rpxToPx(300) }}>
|
|
|
<View className="input_form">
|
|
<View className="input_form">
|
|
|
<Input className="input_content h36" placeholder="请输入自定义名称" value={title}
|
|
<Input className="input_content h36" placeholder="请输入自定义名称" value={title}
|
|
|
focus
|
|
focus
|
|
|
|
|
+ maxlength={10}
|
|
|
onInput={(e: any) => {
|
|
onInput={(e: any) => {
|
|
|
setTitle(e.target.value)
|
|
setTitle(e.target.value)
|
|
|
}} />
|
|
}} />
|
|
@@ -611,28 +672,35 @@ export default function LogRecord() {
|
|
|
}
|
|
}
|
|
|
{
|
|
{
|
|
|
step == 2 && <View className="cardShowAni">
|
|
step == 2 && <View className="cardShowAni">
|
|
|
|
|
+
|
|
|
<View className="content_card">
|
|
<View className="content_card">
|
|
|
- <View style={{ display: 'flex', flexDirection: 'row' }} onClick={() => {
|
|
|
|
|
- setStep(0)
|
|
|
|
|
- setFocus(false)
|
|
|
|
|
- }}>
|
|
|
|
|
- <View className="sel_tag">
|
|
|
|
|
- <View className="h34 bold">{selPostCount}</View>
|
|
|
|
|
- <View className="h34" style={{ marginLeft: rpxToPx(6) }}>次</View>
|
|
|
|
|
- <View style={{
|
|
|
|
|
- width: rpxToPx(2),
|
|
|
|
|
- height: rpxToPx(32),
|
|
|
|
|
- backgroundColor: '#000',
|
|
|
|
|
- opacity: 0.2,
|
|
|
|
|
- marginLeft: rpxToPx(12),
|
|
|
|
|
- marginRight: rpxToPx(12)
|
|
|
|
|
- }} />
|
|
|
|
|
- <View className="h34">{chooseTitle}</View>
|
|
|
|
|
- <View style={{ width: rpxToPx(6) }} />
|
|
|
|
|
- <IconArrow width={rpxToPx(34)} color='#000' />
|
|
|
|
|
- </View>
|
|
|
|
|
|
|
+ <View style={{ display: 'flex', flexDirection: 'row' }} >
|
|
|
|
|
+ <NewButton type={NewButtonType.custom}
|
|
|
|
|
+ onClick={() => {
|
|
|
|
|
+ setStep(0)
|
|
|
|
|
+ setFocus(false)
|
|
|
|
|
+ }}>
|
|
|
|
|
+
|
|
|
|
|
+ <View className="sel_tag">
|
|
|
|
|
+ {/* <View className="h34 bold">{selPostCount}</View>
|
|
|
|
|
+ <View className="h34" style={{ marginLeft: rpxToPx(6) }}>次</View>
|
|
|
|
|
+ <View style={{
|
|
|
|
|
+ width: rpxToPx(2),
|
|
|
|
|
+ height: rpxToPx(32),
|
|
|
|
|
+ backgroundColor: '#000',
|
|
|
|
|
+ opacity: 0.2,
|
|
|
|
|
+ marginLeft: rpxToPx(12),
|
|
|
|
|
+ marginRight: rpxToPx(12)
|
|
|
|
|
+ }} /> */}
|
|
|
|
|
+ <View className="h34 bold">{chooseTitle}</View>
|
|
|
|
|
+ <View style={{ width: rpxToPx(6) }} />
|
|
|
|
|
+ <IconArrow width={rpxToPx(34)} color='#000' />
|
|
|
|
|
+
|
|
|
|
|
+ </View>
|
|
|
|
|
+ </NewButton>
|
|
|
</View>
|
|
</View>
|
|
|
- <Textarea placeholder={t('health.add_text')} className="textarea2 h44 bold"
|
|
|
|
|
|
|
+
|
|
|
|
|
+ <Textarea placeholder={t('health.add_text')} className="textarea2 h44"
|
|
|
placeholder-style="color:rgba(0,0,0,0.2)"
|
|
placeholder-style="color:rgba(0,0,0,0.2)"
|
|
|
value={desc}
|
|
value={desc}
|
|
|
focus={focus}
|
|
focus={focus}
|
|
@@ -674,7 +742,11 @@ export default function LogRecord() {
|
|
|
})
|
|
})
|
|
|
}
|
|
}
|
|
|
{
|
|
{
|
|
|
- pics.length < 9 && <View onClick={tapPic} className="cover" style={{}}><Image src={require('@assets/_health/camera.png')} style={{ width: 40, height: 40 }} /></View>
|
|
|
|
|
|
|
+ pics.length < 9 && <NewButton
|
|
|
|
|
+ type={NewButtonType.custom}
|
|
|
|
|
+ onClick={tapPic}>
|
|
|
|
|
+ <View className="cover" style={{}}><IconCamera color="#000" width={rpxToPx(48)} /></View>
|
|
|
|
|
+ </NewButton>
|
|
|
}
|
|
}
|
|
|
</View>
|
|
</View>
|
|
|
</View>
|
|
</View>
|
|
@@ -685,8 +757,8 @@ export default function LogRecord() {
|
|
|
<View className="time_view" onClick={() => {
|
|
<View className="time_view" onClick={() => {
|
|
|
setShowTimePicker(true)
|
|
setShowTimePicker(true)
|
|
|
}}>
|
|
}}>
|
|
|
-
|
|
|
|
|
- <View className="h30" style={{ opacity: 0.3 }}>时间</View>
|
|
|
|
|
|
|
+ <IconClock width={rpxToPx(36)} color={MainColorType.black_25} />
|
|
|
|
|
+ <View className="h30" style={{ opacity: 0.3, marginLeft: rpxToPx(12) }}>时间</View>
|
|
|
<View style={{ flex: 1 }} />
|
|
<View style={{ flex: 1 }} />
|
|
|
<View className="h30" style={{ opacity: 0.3 }}>{getDate() + time}</View>
|
|
<View className="h30" style={{ opacity: 0.3 }}>{getDate() + time}</View>
|
|
|
<IconArrow width={rpxToPx(34)} color={MainColorType.g02} />
|
|
<IconArrow width={rpxToPx(34)} color={MainColorType.g02} />
|
|
@@ -703,29 +775,22 @@ export default function LogRecord() {
|
|
|
type={NewButtonType.fill}
|
|
type={NewButtonType.fill}
|
|
|
color={MainColorType.orange}
|
|
color={MainColorType.orange}
|
|
|
width={rpxToPx(646)}
|
|
width={rpxToPx(646)}
|
|
|
- height={rpxToPx(96)}
|
|
|
|
|
|
|
+ height={rpxToPx(108)}
|
|
|
title={t('health.log_moment')}
|
|
title={t('health.log_moment')}
|
|
|
onClick={save}
|
|
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)
|
|
|
|
|
|
|
+ showTimePicker && <PickerCard onClose={() => { setShowTimePicker(false) }}
|
|
|
|
|
+ value={new Date().getTime()}
|
|
|
|
|
+ type="datetime"
|
|
|
|
|
+ onConfirm={(e) => {
|
|
|
|
|
+ setSelDate(dayjs(e).format('YYYY-MM-DD'))
|
|
|
|
|
+ setTime(dayjs(e).format('HH:mm'))
|
|
|
setShowTimePicker(false)
|
|
setShowTimePicker(false)
|
|
|
- }} dismiss={() => {
|
|
|
|
|
- setShowTimePicker(false)
|
|
|
|
|
- }} />
|
|
|
|
|
|
|
+ }}
|
|
|
|
|
+ />
|
|
|
}
|
|
}
|
|
|
{
|
|
{
|
|
|
showResult && <View className="share_bg">
|
|
showResult && <View className="share_bg">
|
|
@@ -756,7 +821,7 @@ export default function LogRecord() {
|
|
|
</View>
|
|
</View>
|
|
|
|
|
|
|
|
</View>
|
|
</View>
|
|
|
- <View className="share_card1" style={{ background: getBackground() }}>
|
|
|
|
|
|
|
+ <View className="share_card1" style={{ background: getBackground(), marginTop: rpxToPx(20) }}>
|
|
|
{
|
|
{
|
|
|
result.images && result.images.length > 0 && <Image className="share_card_cover" mode="aspectFill" src={result.images[0]} />
|
|
result.images && result.images.length > 0 && <Image className="share_card_cover" mode="aspectFill" src={result.images[0]} />
|
|
|
}
|
|
}
|
|
@@ -767,10 +832,10 @@ export default function LogRecord() {
|
|
|
<View className="log_result_success">
|
|
<View className="log_result_success">
|
|
|
<IconCheck color="#fff" width={rpxToPx(32)} height={rpxToPx(32)} />
|
|
<IconCheck color="#fff" width={rpxToPx(32)} height={rpxToPx(32)} />
|
|
|
</View>
|
|
</View>
|
|
|
- <View className="h50 bold" style={{ color: '#fff', marginTop: rpxToPx(24), marginBottom: rpxToPx(12) }}>{result.title}</View>
|
|
|
|
|
- <View className="h30" style={{ color: '#fff' }}>{result.description}</View>
|
|
|
|
|
|
|
+ <View className="h50 bold" style={{ color: result.images.length == 0 ? '#000' : '#fff', marginTop: rpxToPx(24), marginBottom: rpxToPx(12) }}>{result.title}</View>
|
|
|
|
|
+ <View className="h30" style={{ color: result.images.length == 0 ? '#000' : '#fff' }}>{result.description}</View>
|
|
|
<View style={{ flex: 1 }} />
|
|
<View style={{ flex: 1 }} />
|
|
|
- <View className="h28" style={{ color: '#fff', marginBottom: rpxToPx(120) }}>{result.moment_description}</View>
|
|
|
|
|
|
|
+ <View className="h28" style={{ color: result.images.length == 0 ? '#000' : '#fff', marginBottom: rpxToPx(120) }}>{result.moment_description}</View>
|
|
|
</View>
|
|
</View>
|
|
|
</View>
|
|
</View>
|
|
|
<ShareBtn>
|
|
<ShareBtn>
|
|
@@ -780,25 +845,21 @@ export default function LogRecord() {
|
|
|
<View className="white bold h34">Send to friends</View>
|
|
<View className="white bold h34">Send to friends</View>
|
|
|
</View>
|
|
</View>
|
|
|
</NewButton>
|
|
</NewButton>
|
|
|
- {/* <NewButton
|
|
|
|
|
- type={NewButtonType.fill}
|
|
|
|
|
- color={MainColorType.success}
|
|
|
|
|
- width={rpxToPx(698)}
|
|
|
|
|
- height={rpxToPx(108)}
|
|
|
|
|
- borderRadius={rpxToPx(28)}
|
|
|
|
|
- title="Send to friends"
|
|
|
|
|
- /> */}
|
|
|
|
|
</ShareBtn>
|
|
</ShareBtn>
|
|
|
|
|
|
|
|
- <View className="h30" style={{ marginTop: rpxToPx(26), color: 'rgba(255,255,255,0.5)' }} onClick={() => {
|
|
|
|
|
- Taro.reLaunch({
|
|
|
|
|
- url: '/pages/moment/moment'
|
|
|
|
|
- })
|
|
|
|
|
- }}>去搭子圈查看</View>
|
|
|
|
|
|
|
+ <NewButton type={NewButtonType.custom}
|
|
|
|
|
+ onClick={() => {
|
|
|
|
|
+ Taro.reLaunch({
|
|
|
|
|
+ url: '/pages/moment/moment'
|
|
|
|
|
+ })
|
|
|
|
|
+ }}
|
|
|
|
|
+ >
|
|
|
|
|
+ <View className="h30" style={{ marginTop: rpxToPx(26), color: 'rgba(255,255,255,0.5)', height: rpxToPx(96), lineHeight: rpxToPx(96) + 'px' }} >去搭子圈查看</View>
|
|
|
|
|
+ </NewButton>
|
|
|
|
|
|
|
|
</View>
|
|
</View>
|
|
|
}
|
|
}
|
|
|
- {
|
|
|
|
|
|
|
+ {/* {
|
|
|
showChoose && <ChooseActions
|
|
showChoose && <ChooseActions
|
|
|
close={() => {
|
|
close={() => {
|
|
|
setShowChoose(false)
|
|
setShowChoose(false)
|
|
@@ -815,6 +876,6 @@ export default function LogRecord() {
|
|
|
setStep(2)
|
|
setStep(2)
|
|
|
}}
|
|
}}
|
|
|
/>
|
|
/>
|
|
|
- }
|
|
|
|
|
|
|
+ } */}
|
|
|
</View >
|
|
</View >
|
|
|
}
|
|
}
|