| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906 |
- import { View, Image, PageMeta, NavigationBar, Input, Textarea, ScrollView, Snapshot } from "@tarojs/components";
- import './log_record.scss'
- import { useEffect, useState } from "react";
- import Taro, { useRouter, useShareAppMessage } from "@tarojs/taro";
- import { rpxToPx } from "@/utils/tools";
- import { IconAdd, IconArrow, IconCheck, 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 { BASE_IMG_URL, 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 { addEvents, addUserTag, createMoment, eventDetail, updateMoment, userTags } from "@/services/health";
- import PostMomentTime from "@/_health/components/post_moment_time";
- import ShareBtn from "@/components/basic/ShareBtn";
- import { jumpPage } from "@/features/trackTimeDuration/hooks/Common";
- 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";
- import FollowInfo from "@/_moment/components/follow_info";
- let useRoute;
- let useNavigation;
- 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 screenHeight = systemInfo.screenHeight
- 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 record = useSelector((state: any) => state.record);
- const user = useSelector((state: any) => state.user);
- const [title, setTitle] = useState('')
- const [chooseTitle, setChooseTitle] = useState('')
- const [desc, setDesc] = useState('')
- const [step, setStep] = useState(2)
- 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)
- const [result, setResult] = useState<any>(null)
- const [showResult, setShowResult] = useState(false)
- const [tags, setTags] = useState<any>([])
- const [selPostCount, setPostCount] = useState(1)
- const [showChoose, setShowChoose] = useState(false)
- const [selTag, setSelTag] = useState<any>(null)
- const [loading, setLoading] = 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, scenario, imgs, only_text, quick, join_id } = router.params
- const moment = router.params.moment ? JSON.parse(router.params.moment) : null
- const window = router.params.window ?? health.mode
- const [pics, setPics] = useState<any>(imgs ? JSON.parse(imgs) : [])
- const [focus, setFocus] = useState(only_text ? true : false)
- const [inputFocus, setInputFocus] = useState(false)
- const [quickStatus, setQuickStatus] = useState(quick ? true : false)
- if (process.env.TARO_ENV == 'weapp') {
- useShareAppMessage((e) => {
- var path;
- if (result && result.event_id) {
- var sharePath = `/_health/pages/timeline_detail?type=recent&fast_type=IF&event_id=${result.event_id}&uid=${user.id}&isfastsleep=${0}&disable_edit=1&enter_type=share`
- if (user.isLogin) {
- sharePath += `&share_uid=${user.id}`
- }
- path = sharePath
- }
- else {
- path = 'pages/clock/Clock'
- }
- return {
- title: '分享标题',
- path: path,
- // imageUrl: shareUrl
- }
- })
- }
- useEffect(() => {
- global.set_time = new Date().getTime()
- getTags()
- if (router.params.check_in == 1) {
- setStep(0)
- }
- if (router.params.quick) {
- quickSave()
- }
- if (router.params.edit) {
- eventDetail(router.params.id).then(res => {
- setTitle((res as any).title)
- setChooseTitle((res as any).title)
- if ((res as any).moment) {
- setDesc((res as any).moment.description)
- if ((res as any).moment.media && (res as any).moment.media.length > 0) {
- setPics((res as any).moment.media)
- }
- }
- if ((res as any).time) {
- setSelDate(dayjs((res as any).time.start_timestamp).format('YYYY-MM-DD'))
- setTime(dayjs((res as any).time.start_timestamp).format('HH:mm'))
- }
- })
- }
- }, [])
- useEffect(() => {
- if (step == 1) {
- setTimeout(() => {
- setInputFocus(true)
- }, 300)
- }
- }, [step])
- function getTags() {
- userTags({ scenario: scenario }).then(res => {
- if (chooseTitle == '' && !router.params.edit) {
- var current = dayjs().format('HH:mm');
- var isFind = false;
- (res as any).tags.map(item => {
- if (item.time_from && item.time_to) {
- if (isInTimeRange(current, item.time_from, item.time_to)) {
- isFind = true;
- setTitle(item.title)
- setChooseTitle(item.title)
- setPostCount(item.log_count + 1)
- }
- }
- })
- if (!isFind) {
- setTitle((res as any).tags[0].title)
- setChooseTitle((res as any).tags[0].title)
- setPostCount((res as any).tags[0].log_count + 1)
- }
- }
- setTags((res as any).tags)
- })
- }
- function isInTimeRange(currentTime, startTime, endTime) {
- // 将时间字符串转换为 Date 对象
- const current = new Date(`1970-01-01T${currentTime}:00`);
- const start = new Date(`1970-01-01T${startTime}:00`);
- const end = new Date(`1970-01-01T${endTime}:00`);
- // 如果结束时间小于开始时间,说明时间段跨越了午夜
- if (end < start) {
- end.setDate(end.getDate() + 1); // 将结束时间加一天
- if (current < start) {
- current.setDate(current.getDate() + 1); // 如果当前时间在午夜之前,加一天
- }
- }
- // 判断当前时间是否在时间段内
- return current >= start && current < end;
- }
- function addTag() {
- addUserTag({ scenario: scenario, title: title }).then(res => {
- getTags()
- })
- }
- function tapPic() {
- //, t('health.delete')
- showActionSheet({
- title: '',
- itemList: [t('health.add_photos'), t('health.camera2'), t('health.import_chat')],
- success: function (res) {
- switch (res) {
- case 0:
- addImage(false)
- break;
- case 1:
- addImage(true)
- break;
- case 2:
- 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 3:
- // setImgUrl('')
- break;
- }
- }
- })
- }
- function addImage(isCamera) {
- var source: any = isCamera ? ['camera'] : ['album']
- 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) {
- // 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 quickSave() {
- }
- function save() {
- if (router.params.edit) {
- edit()
- return
- }
- var date = TimeFormatter.stringToDate(selDate, time)
- date.setMilliseconds(new Date(enterTimestmap).getMilliseconds())
- var params: any = {
- scenario: scenario, //ACTIVITY
- type: 'POINT',
- sub_type: scenario,
- title: chooseTitle,
- time: {
- start_timestamp: date.getTime()
- }
- }
- if (router.params.join_id) {
- params.join_key = router.params.join_id
- }
- var moment: any = {
- description: desc,
- }
- 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
- })
- })
- moment.media = picList
- }
- params.moment = moment
- // 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'
- params.extra = {
- set_time: global.set_time ? global.set_time : new Date().getTime(),
- confirm_time: new Date().getTime()
- }
- if (posting) return
- setPosting(true)
- // Taro.showLoading({
- // title: t('health.uploading')
- // })
- addEvents(params).then(res => {
- setShowResult(true)
- setResult(res)
- setPosting(false)
- // Taro.hideLoading()
- Taro.reLaunch({
- url: '/pages/moment/moment'
- })
- }).catch(e => {
- setPosting(false)
- // Taro.hideLoading()
- })
- // 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)
- // // })
- // }
- // // global.refreshWindow()
- // // global.refreshHistory()
- // // if (global.postMomentSuccess) {
- // // global.postMomentSuccess()
- // // }
- // }).catch(e => {
- // setPosting(false)
- // })
- }
- function edit() {
- var date = TimeFormatter.stringToDate(selDate, time)
- date.setMilliseconds(new Date(enterTimestmap).getMilliseconds())
- var params: any = {
- id: router.params.id,
- scenario: scenario, //ACTIVITY
- type: 'POINT',
- sub_type: scenario,
- title: chooseTitle,
- time: {
- start_timestamp: date.getTime()
- }
- }
- if (router.params.join_id) {
- params.join_key = router.params.join_id
- }
- var moment: any = {
- description: desc,
- }
- 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
- })
- })
- moment.media = picList
- }
- else {
- moment.media = []
- }
- params.moment = moment
- params.extra = {
- set_time: global.set_time ? global.set_time : new Date().getTime(),
- confirm_time: new Date().getTime()
- }
- if (posting) return
- setPosting(true)
- // Taro.showLoading({
- // title: t('health.uploading')
- // })
- addEvents(params).then(res => {
- setShowResult(true)
- setResult(res)
- setPosting(false)
- Taro.eventCenter.trigger('refresh_timeline',(res as any).feed_item)
- if (global.refreshHistory){
- global.refreshHistory()
- }
- Taro.navigateBack()
- // Taro.hideLoading()
- // Taro.reLaunch({
- // url: '/pages/moment/moment'
- // })
- }).catch(e => {
- setPosting(false)
- // Taro.hideLoading()
- })
- }
- 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日 ')
- }
- }
- function getBackground() {
- var time = record.time
- if (!time) return '#fff'
- const { background_colors } = time
- if (!background_colors) {
- return '#fff'
- }
- else if (background_colors.length == 1) {
- return background_colors[0]
- }
- return `linear-gradient(to bottom, ${background_colors[0]}, ${background_colors[1]})`
- }
- 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 style={{
- position: 'absolute',
- 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={() => {
- if (showResult) {
- Taro.navigateBack()
- return
- }
- if (chooseTitle.length > 0 && step == 0) {
- setStep(2)
- return
- }
- if (step == 2) {
- showAlert({
- title: t('health.back_no_save'),
- content: '',
- showCancel: true,
- cancelText: t('health.cancel'),
- confirmText: t('health.exit'),
- confirm: () => {
- Taro.navigateBack()
- }
- })
- return
- }
- Taro.navigateBack()
- }}>
- <IconClose color={showResult ? "#fff" : "#000"} width={rpxToPx(64)} height={rpxToPx(64)} />
- </View>
- </View>
- </View>
- <View style={{ height: navigationBarHeight }} />
- {
- 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(26) }}>
- <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), }}>{t('health.add_a_tag')}</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 h34"
- style={{ backgroundColor: MainColorType.white_25, marginBottom: rpxToPx(100) }}
- onClick={() => {
- 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>{t('health.custom')}</View>
- </View>
- </View>
- {/* </Snapshot> */}
- </ScrollView>
- }
- {
- step == 1 && <View className="cardShowAni" style={{ display: 'flex', flexDirection: 'column', alignItems: 'center', marginTop: rpxToPx(300) }}>
- <View className="input_form">
- <Input className="input_content h36" placeholder={t('health.custom_name')} value={title}
- placeholderClass="input_content_placeholder"
- focus={inputFocus}
- autoFocus={inputFocus}
- maxlength={30}
- onBlur={() => {
- setInputFocus(false)
- }}
- onInput={(e: any) => {
- setTitle(e.target.value)
- setChooseTitle(e.target.value)
- }} />
- <View className="form_btns">
- <View className="form_cancel">
- <NewButton btnStyle={{ flex: 1 }} type={NewButtonType.img}
- onClick={() => {
- setStep(0)
- }}
- >
- <View className="h30 bold">{t('health.cancel')}</View>
- </NewButton>
- </View>
- <View className="form_cancel">
- <NewButton btnStyle={{ flex: 1 }} type={NewButtonType.img}
- onClick={() => {
- if (title.length == 0) return
- setChooseTitle(title)
- setPostCount(1)
- setStep(2)
- addTag()
- }}
- >
- <View className={title.length == 0 ? 'form_cancel form_confirm h30 bold' : 'form_cancel h30 bold'}
- >{t('health.confirm')}</View>
- </NewButton>
- </View>
- </View>
- </View>
- </View>
- }
- {
- step == 2 && <View className="cardShowAni">
- <View className="content_card">
- <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>
- {/* <Input placeholder="hhhhhhh" style={{textAlign:'center'}}/> */}
- <Textarea placeholder={t('health.add_text')} className="textarea2 h44"
- placeholder-style="color:rgba(0,0,0,0.2)"
- value={desc}
- focus={focus}
- onBlur={() => {
- setFocus(false)
- }}
- onInput={e => {
- setDesc(e.detail.value)
- }} />
- <View className="form2">
- {
- 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 && <NewButton
- type={NewButtonType.custom}
- onClick={tapPic}>
- <View className="cover" style={{}}><IconCamera color="#000" width={rpxToPx(48)} /></View>
- </NewButton>
- }
- </View>
- </View>
- <View className="time_view" onClick={() => {
- setShowTimePicker(true)
- }}>
- <View style={{ opacity: 0.25 }}>
- <IconClock width={rpxToPx(36)} color={MainColorType.black} />
- </View>
- <View className="h30" style={{ opacity: 0.3, marginLeft: rpxToPx(12) }}>{t('health.time')}</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>
- {
- router.params.join_id && <FollowInfo user={long.follow} />
- }
- </View>
- }
- {
- step == 2 && <View className="main_footer" style={{ backgroundColor: 'transparent' }}>
- <NewButton
- type={NewButtonType.fill}
- color={MainColorType.orange}
- width={rpxToPx(646)}
- height={rpxToPx(108)}
- title={t('health.share_to_moment')}
- onClick={save}
- />
- </View>
- }
- {
- showTimePicker && <PickerCard onClose={() => { setShowTimePicker(false) }}
- value={new Date(selDate + 'T' + time + ':00').getTime()}
- title={global.language == 'en' ? 'Choose Time' : "选择时间"}
- type="datetime"
- onConfirm={(e) => {
- setSelDate(dayjs(e).format('YYYY-MM-DD'))
- setTime(dayjs(e).format('HH:mm'))
- setShowTimePicker(false)
- }}
- />
- }
- {
- showResult && false && <View className="share_bg">
- <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'
- }}>
- <View style={{
- position: 'absolute',
- width: rpxToPx(92),
- height: rpxToPx(64),
- left: 22,
- top: 22 - rpxToPx(32)
- }}
- onClick={() => {
- Taro.navigateBack()
- // setShowShare(false)
- }}>
- <IconClose color="#fff" width={rpxToPx(64)} height={rpxToPx(64)} />
- </View>
- </View>
- </View>
- <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 && <View className="share_card_layer" />
- }
- <View style={{ position: 'relative', zIndex: 1, display: 'flex', flexDirection: 'column', alignItems: 'center', height: '100%' }}>
- <View className="log_result_success">
- <IconCheck color="#fff" width={rpxToPx(32)} height={rpxToPx(32)} />
- </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 className="h28" style={{ color: result.images.length == 0 ? '#000' : '#fff', marginBottom: rpxToPx(120) }}>{result.moment_description}</View>
- </View>
- </View>
- <ShareBtn>
- <NewButton type={NewButtonType.custom}>
- <View className="share_btn1" style={{ backgroundColor: MainColorType.success }}>
- <Image src={require('@assets/_health/wechat.png')} style={{ width: rpxToPx(48), height: rpxToPx(48) }} />
- <View className="white bold h34">Send to friends</View>
- </View>
- </NewButton>
- </ShareBtn>
- <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>
- }
- {/* {
- showChoose && <ChooseActions
- close={() => {
- setShowChoose(false)
- }}
- quick={() => {
- save()
- }}
- chooseText={() => {
- setStep(2)
- setFocus(true)
- }}
- chooseImg={(array) => {
- setPics(array)
- setStep(2)
- }}
- />
- } */}
- </View >
- }
|