timeline_detail.tsx 50 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957958959960961962963964965966967968969970971972973974975976977978979980981982983984985986987988989990991992993994995996997998999100010011002100310041005100610071008100910101011101210131014101510161017101810191020102110221023102410251026102710281029103010311032103310341035103610371038103910401041104210431044104510461047104810491050105110521053105410551056105710581059106010611062106310641065106610671068106910701071107210731074107510761077107810791080108110821083108410851086108710881089109010911092109310941095109610971098109911001101110211031104110511061107110811091110111111121113111411151116111711181119112011211122112311241125112611271128112911301131113211331134113511361137113811391140114111421143114411451146114711481149115011511152115311541155115611571158115911601161116211631164116511661167116811691170117111721173117411751176117711781179118011811182118311841185118611871188118911901191119211931194119511961197119811991200120112021203120412051206120712081209121012111212121312141215121612171218121912201221122212231224122512261227122812291230123112321233123412351236123712381239124012411242124312441245124612471248124912501251125212531254125512561257125812591260126112621263
  1. import { View, Image, Text, Input, Textarea, Button } from "@tarojs/components";
  2. import { useDispatch, useSelector } from "react-redux";
  3. import './timeline_detail.scss'
  4. import '@features/health/History.scss'
  5. import { useEffect, useState } from "react";
  6. import Taro, { useRouter, useShareAppMessage } from "@tarojs/taro";
  7. import dayjs from "dayjs";
  8. import { getScenario, getThemeColor } from "@/features/health/hooks/health_hooks";
  9. import { baseUrl, SHARE_COVER_URL } from "@/services/http/api";
  10. import { checkAuthorized } from "@/utils/check_authorized";
  11. import { createMoment, delEvents, delRecord, getEvents, getRecordDetail, homeInfo, makeDone, windows } from "@/services/health";
  12. import NewButton, { NewButtonType } from "../base/new_button";
  13. import { IconClose, IconError, IconLongFast, IconShare } from "@/components/basic/Icons";
  14. import { rpxToPx, vibrate } from "@/utils/tools";
  15. import { MainColorType } from "@/context/themes/color";
  16. import NewModal from "../base/new_modal";
  17. import Card from "../components/card";
  18. import ChooseDateTime from "../components/choose_date_time";
  19. import TimeTitleDesc from "../components/time_title_desc";
  20. import CoverList from "../components/cover_list";
  21. import ListFooter from "../components/list_footer";
  22. import showAlert from "@/components/basic/Alert";
  23. import showActionSheet from "@/components/basic/ActionSheet";
  24. import { useTranslation } from "react-i18next";
  25. import { jumpPage } from "@/features/trackTimeDuration/hooks/Common";
  26. import { TimeFormatter } from "@/utils/time_format";
  27. import TargetProgress from "../components/target_progress";
  28. import formatMilliseconds from "@/utils/format_time";
  29. import SingleImage from "../components/single_img";
  30. import { setFastWithSleep, setFirstActiveId, setFirstEatId, setLongFast, setShowActionTip, setWindows } from "@/store/health";
  31. import FastSleepPopupContent from "../components/fast_sleep_popup_content";
  32. import { StatusType } from "../base/status_indicator";
  33. import 'dayjs/locale/zh-cn';
  34. import 'dayjs/locale/en';
  35. import { getInfoSuccess } from "@/store/user";
  36. import LongCard from "@/_moment/components/long_card";
  37. import { setFollow, setJoinData } from "@/store/long";
  38. import MomentDetailShare from "@/pages/moment/moment_detail_share";
  39. import { followUser } from "@/services/friend";
  40. import { setActions, setEvents, setTimeData } from "@/store/record";
  41. import ShareBtn from "@/components/basic/ShareBtn";
  42. let useRoute;
  43. let useNavigation;
  44. if (process.env.TARO_ENV == 'rn') {
  45. useRoute = require("@react-navigation/native").useRoute
  46. useNavigation = require("@react-navigation/native").useNavigation
  47. }
  48. export default function TimelineDetail() {
  49. let showActionSheetWithOptions;
  50. const [enterTimestmap] = useState(new Date().getTime())
  51. const health = useSelector((state: any) => state.health);
  52. const user = useSelector((state: any) => state.user);
  53. const [list, setList] = useState<any>([])
  54. const [history, setHistory] = useState<any>([])
  55. const [detail, setDetail] = useState<any>(null)
  56. const [desc, setDesc] = useState('')
  57. const [imgUrl, setImgUrl] = useState('')
  58. const [btnDisable, setBtnDisable] = useState(true)
  59. const [showPop, setShowPop] = useState(false)
  60. const [publish, setPublish] = useState<any>(null)
  61. const [bottom, setBottom] = useState(20)
  62. const [loaded, setLoaded] = useState(false)
  63. const [showTimePicker, setShowTimePicker] = useState(false)
  64. const [time, setTime] = useState(dayjs().format('HH:mm'))
  65. const [selTime, setSelTime] = useState(dayjs().format('HH:mm'))
  66. const [selDate, setSelDate] = useState(dayjs().format('YYYY-MM-DD'))
  67. const [count, setCount] = useState(0)
  68. const [fastSleepPop, setFastSleepPop] = useState(false)
  69. const [shareUser, setShareUser] = useState<any>(null)
  70. const [join, setJoin] = useState<any>(null)
  71. const [showEmpty, setShowEmpty] = useState(false)
  72. const dispatch = useDispatch()
  73. const { t } = useTranslation()
  74. let router
  75. let navigation;
  76. if (useNavigation) {
  77. navigation = useNavigation()
  78. }
  79. if (process.env.TARO_ENV == 'rn') {
  80. router = useRoute()
  81. }
  82. else {
  83. router = useRouter()
  84. }
  85. const { schedule_id, event_id, window_id, isfastsleep, fast_type, disable_edit, uid, autoPost, op_page } = router.params
  86. console.log('进入页面获取参数')
  87. console.log(router.params)
  88. if (process.env.TARO_ENV == 'weapp') {
  89. const launchObj = Taro.getLaunchOptionsSync()
  90. console.log('launchObj', launchObj)
  91. if (launchObj.shareTicket) {
  92. Taro.getShareInfo({
  93. shareTicket: launchObj.shareTicket,
  94. success(result) {
  95. console.log('share info', result)
  96. },
  97. })
  98. }
  99. }
  100. if (process.env.TARO_ENV == 'weapp'/* && global.allowShare*/) {
  101. Taro.updateShareMenu({
  102. withShareTicket: true,
  103. success() { }
  104. })
  105. useShareAppMessage((e) => {
  106. console.log(detail)
  107. var timestamp = detail.events ? detail.events[0].time.timestamp : detail.moments[0].time.timestamp
  108. console.log(timestamp)
  109. var shareDate = ''
  110. if (TimeFormatter.isToday(timestamp)) {
  111. shareDate = global.language == 'en' ? 'Today\'s' : '今日'
  112. }
  113. else if (TimeFormatter.isYesterday(timestamp)) {
  114. shareDate = global.language == 'en' ? 'Yesterday\'s' : '昨日'
  115. }
  116. else if (TimeFormatter.isTimestampInThisWeek(timestamp)) {
  117. shareDate = global.language == 'en' ? (dayjs(timestamp).format('dddd') + '\'s') : dayjs(timestamp).format('dddd')
  118. }
  119. else {
  120. shareDate = global.language == 'en' ? dayjs(timestamp).format('MMMM D') : dayjs(timestamp).format('MMMD日')
  121. }
  122. var title = ''
  123. var defaultImg = SHARE_COVER_URL + 'my_fast.jpg'
  124. if (isfastsleep == '1') {
  125. title = t('health.share_check_in', { date: shareDate, type: t('health.fasting_with_sleep') })
  126. defaultImg = SHARE_COVER_URL + 'my_fast_with_sleep.jpg'
  127. }
  128. else if (fast_type == 'LF') {
  129. title = t('health.share_check_in', { date: shareDate, type: t('health.long_fast') })
  130. defaultImg = SHARE_COVER_URL + 'my_long_fast.jpg'
  131. }
  132. else {
  133. if (detail.events && detail.events.length > 0)
  134. switch (detail.events[0].window) {
  135. case 'FAST':
  136. title = t('health.share_check_in', { date: shareDate, type: t('health.fasting') })
  137. defaultImg = SHARE_COVER_URL + 'my_fast.jpg'
  138. break;
  139. case 'EAT':
  140. title = t('health.share_check_in', { date: shareDate, type: detail.title })
  141. defaultImg = SHARE_COVER_URL + 'my_meal.jpg'
  142. break;
  143. case 'ACTIVE':
  144. title = t('health.share_check_in', { date: shareDate, type: detail.title })
  145. defaultImg = SHARE_COVER_URL + 'my_activity.jpg'
  146. break;
  147. case 'SLEEP':
  148. title = t('health.share_check_in', { date: shareDate, type: t('health.sleep') })
  149. defaultImg = SHARE_COVER_URL + 'my_sleep.jpg'
  150. break;
  151. }
  152. if (detail.window)
  153. switch (detail.window) {
  154. case 'FAST':
  155. title = t('health.share_check_in', { date: shareDate, type: t('health.fasting') })
  156. defaultImg = SHARE_COVER_URL + 'my_fast.jpg'
  157. break;
  158. case 'EAT':
  159. title = t('health.share_check_in', { date: shareDate, type: detail.title })
  160. defaultImg = SHARE_COVER_URL + 'my_meal.jpg'
  161. break;
  162. case 'ACTIVE':
  163. title = t('health.share_check_in', { date: shareDate, type: detail.title })
  164. defaultImg = SHARE_COVER_URL + 'my_activity.jpg'
  165. break;
  166. case 'SLEEP':
  167. title = t('health.share_check_in', { date: shareDate, type: t('health.sleep') })
  168. defaultImg = SHARE_COVER_URL + 'my_sleep.jpg'
  169. break;
  170. }
  171. // switch (op_page) {
  172. // case 'HOME_FAST':
  173. // title = t('health.share_my_fasting')
  174. // defaultImg = SHARE_COVER_URL + 'my_fast.jpg'
  175. // break;
  176. // case 'HOME_FAST':
  177. // title = t('health.share_my_eating')
  178. // defaultImg = SHARE_COVER_URL + 'my_meal.jpg'
  179. // break;
  180. // case 'HOME_FAST':
  181. // title = t('health.share_my_activity')
  182. // defaultImg = SHARE_COVER_URL + 'my_activity.jpg'
  183. // break;
  184. // case 'HOME_FAST':
  185. // title = t('health.share_my_sleep')
  186. // defaultImg = SHARE_COVER_URL + 'my_sleep.jpg'
  187. // break;
  188. // }
  189. }
  190. var imgs = imgList()
  191. var imageUrl = imgs.length > 0 ? imgs[0] : defaultImg
  192. if (global.momentdetail_share_url) {
  193. imageUrl = global.momentdetail_share_url
  194. }
  195. var sharePath = `/_health/pages/timeline_detail?type=${router.params.type}&fast_type=${fast_type}&schedule_id=${schedule_id}&window_id=${window_id}&event_id=${event_id}&uid=${uid ?? user.id}&op_page=${op_page}&isfastsleep=${isfastsleep}&disable_edit=1&enter_type=share`
  196. if (user.isLogin) {
  197. sharePath += `&share_uid=${user.id}`
  198. }
  199. var strWindowId = window_id ?? ''
  200. if (op_page == 'HOME_EAT' || op_page == 'HOME_ACTIVE') {
  201. strWindowId = ''
  202. }
  203. sharePath += `&window_id=${strWindowId}`
  204. var nickname = detail.share_user ? detail.share_user.nickname : user.nickname
  205. if (nickname.length > 10) {
  206. nickname.substring(0, 10) + '...'
  207. }
  208. console.log('share_title', title)
  209. console.log('sharePath', imageUrl)
  210. return {
  211. title: nickname + ': ' + title,
  212. path: sharePath,
  213. imageUrl: imageUrl
  214. }
  215. })
  216. }
  217. useEffect(() => {
  218. Taro.setNavigationBarColor({
  219. backgroundColor: showPop ? '#191919' : '#f5f5f5',
  220. frontColor: '#000000'
  221. })
  222. Taro.setBackgroundColor({
  223. backgroundColor: '#ffffff',
  224. backgroundColorBottom: '#ffffff'
  225. })
  226. // var title = ''
  227. // if (router.params.timestamp) {
  228. // setTimeout(() => {
  229. // setTitle(router.params.timestamp)
  230. // }, 100)
  231. // }
  232. // Taro.setNavigationBarTitle({
  233. // title: title
  234. // })
  235. }, [showPop])
  236. useEffect(() => {
  237. if (router.params.enter_type == 'share') {
  238. if (global.shareTicket) {
  239. Taro.getShareInfo({
  240. shareTicket: global.shareTicket,
  241. success(result) {
  242. updateRelation(result)
  243. },
  244. })
  245. }
  246. else {
  247. updateRelation(null)
  248. }
  249. }
  250. }, [user.isLogin])
  251. function updateRelation(obj) {
  252. if (!user.isLogin) {
  253. Taro.setStorageSync('share_uid', router.params.share_uid)
  254. Taro.setStorageSync('share_info', JSON.stringify(obj))
  255. return
  256. }
  257. if (user.id != router.params.share_uid && router.params.share_uid) {
  258. var params: any = {
  259. follow_origin: obj ? 'WECHAT_GROUP_CHAT' : 'WECHAT_PRIVATE_CHAT',
  260. user_id: router.params.share_uid,
  261. }
  262. if (obj) {
  263. params.wechat = obj
  264. }
  265. followUser(params).then(res => {
  266. // myFriends()
  267. })
  268. }
  269. }
  270. useEffect(() => {
  271. if (!user.isLogin) {
  272. //用户未登录读取cache
  273. var gps = Taro.getStorageSync('gps')
  274. if (gps) {
  275. global.locationDetail = JSON.parse(gps)
  276. }
  277. global.memberAlert = Taro.getStorageSync('memberAlert') || false
  278. var userData = Taro.getStorageSync('userData')
  279. if (userData) {
  280. dispatch(getInfoSuccess(JSON.parse(userData)));
  281. }
  282. }
  283. }, [])
  284. function setTitle(timestamp) {
  285. dayjs.locale(global.language == 'en' ? 'en' : 'zh-cn');
  286. require('moment/locale/en-gb')
  287. require('moment/locale/zh-cn')
  288. var title = ''
  289. var t = parseInt(timestamp + '')
  290. if (TimeFormatter.isToday(t)) {
  291. title = TimeFormatter.getTodayUnit()
  292. }
  293. else if (TimeFormatter.isYesterday(t)) {
  294. title = TimeFormatter.getYesterdayUnit()
  295. }
  296. else {
  297. console.log(global.language)
  298. if (global.language && global.language == 'zh') {
  299. title = dayjs(t).format('MMMD日 dddd')
  300. }
  301. else {
  302. title = dayjs(t).format('dddd, MMM D')
  303. }
  304. }
  305. Taro.setNavigationBarTitle({
  306. title: title//global.language
  307. })
  308. }
  309. useEffect(() => {
  310. if (router.params.timestamp) {
  311. setTitle(router.params.timestamp)
  312. }
  313. }, [global.language])
  314. useEffect(() => {
  315. Taro.onKeyboardHeightChange(res => {
  316. setBottom(res.height > 0 ? res.height : 20)
  317. })
  318. // getDatas()
  319. if (!window_id && ((health.mode != 'ACTIVE' && health.mode != 'EAT') || fast_type == 'LF') && autoPost == '1') {
  320. setShowPop(true)
  321. }
  322. Taro.eventCenter.on('refresh_timeline', getDatas)
  323. return () => {
  324. Taro.eventCenter.off('refresh_timeline')
  325. }
  326. }, [])
  327. useEffect(() => {
  328. getDatas()
  329. if (user.isLogin) {
  330. windows().then(res => {
  331. dispatch(setFastWithSleep((res as any).fast_with_sleep))
  332. dispatch(setWindows((res as any).windows))
  333. dispatch(setLongFast((res as any).long_fast))
  334. }).catch(e => {
  335. })
  336. homeInfo().then(res => {
  337. console.log('events', res)
  338. dispatch(setEvents((res as any).events))
  339. dispatch(setActions((res as any).actions))
  340. dispatch(setTimeData(getTime(res)))
  341. }).catch(e => {
  342. })
  343. }
  344. }, [user.isLogin])
  345. function getTime(res) {
  346. var now = dayjs().format('HH:mm')
  347. for (var i = 0; i < res.time_messages.length; i++) {
  348. var obj = res.time_messages[i]
  349. if (now >= obj.start_time && now < obj.end_time) {
  350. return obj
  351. }
  352. }
  353. return res.time_messages[res.time_messages.length - 1]
  354. }
  355. useEffect(() => {
  356. if (desc.length > 0 || imgUrl.length > 0) {
  357. setBtnDisable(false)
  358. }
  359. else {
  360. setBtnDisable(true)
  361. }
  362. }, [desc, imgUrl])
  363. global.refreshMoment = () => {
  364. getDatas()
  365. }
  366. function getDatas() {
  367. var showWindow = true
  368. if (!window_id || op_page == 'HOME_EAT' || op_page == 'HOME_ACTIVE') showWindow = false
  369. if (window_id == 'undefined') showWindow = false
  370. if (showWindow) {
  371. var params: any = {}
  372. if (router.params.isfastsleep == '1') {
  373. params.op_page = 'FAST_WITH_SLEEP'
  374. }
  375. if (router.params.uid) {
  376. params.share_user_id = router.params.uid
  377. }
  378. console.log('获取window数据')
  379. getRecordDetail(window_id, params).then(res => {
  380. if ((res as any).events && (res as any).events.length > 0 && (res as any).events[0].time)
  381. setTitle((res as any).events[0].time.timestamp)
  382. setLoaded(true)
  383. setDetail(res)
  384. setHistory((res as any).events)
  385. // setList((res as any).moments)
  386. setPublish((res as any).publish)
  387. setJoin((res as any).join)
  388. if ((res as any).share_user) {
  389. setShareUser((res as any).share_user)
  390. dispatch(setFollow((res as any).share_user))
  391. }
  392. console.log('获取window数据成功')
  393. }).catch(e => {
  394. console.log('request failed', e)
  395. setLoaded(true)
  396. setShowEmpty(true)
  397. })
  398. }
  399. else {
  400. var params: any = {}
  401. if (router.params.uid) {
  402. params.share_user_id = router.params.uid
  403. }
  404. console.log('获取event数据')
  405. getEvents(event_id, params).then(res => {
  406. if ((res as any).time)
  407. setTitle((res as any).time.timestamp)
  408. setLoaded(true)
  409. setDetail(res)
  410. setList((res as any).moments)
  411. setPublish((res as any).publish)
  412. setJoin((res as any).join)
  413. if ((res as any).share_user) {
  414. setShareUser((res as any).share_user)
  415. dispatch(setFollow((res as any).share_user))
  416. }
  417. console.log('获取event数据成功')
  418. }).catch(e => {
  419. console.log('request failed', e)
  420. setLoaded(true)
  421. setShowEmpty(true)
  422. })
  423. }
  424. }
  425. function addImage(isCamera: boolean) {
  426. Taro.chooseMedia({
  427. count: 1,
  428. sizeType: ['compressed'],
  429. mediaType: ['image'],
  430. sourceType: [isCamera ? 'camera' : 'album'],
  431. success: function (res) {
  432. chooseSuccess(res, true)
  433. // checkAuthorized()
  434. },
  435. fail: function (res) {
  436. }
  437. })
  438. }
  439. async function chooseSuccess(res, isAlbum) {
  440. var params = {
  441. event: 'add_a_picture',
  442. value: isAlbum ? 'choose_from_album_confirm' : 'use_camera_confirm',
  443. }
  444. // saveFoodCache('create', params)
  445. var savedFilePath = process.env.TARO_ENV == 'rn' ? res.tempFiles[0].path : res.tempFiles[0].tempFilePath
  446. // var savedFilePath = res.savedFilePath
  447. // await Taro.setStorage({ key: 'pic', data: savedFilePath })
  448. // setImgUrl(savedFilePath as any)
  449. uploadFile(savedFilePath, isAlbum ? 'album' : 'camera')
  450. }
  451. function uploadFile(path, source) {
  452. Taro.showLoading({
  453. title: t('health.loading')
  454. })
  455. var dot = path.lastIndexOf('.')
  456. var fileExt = dot > 0 ? path.substring(dot) : ''
  457. Taro.request({
  458. method: 'GET',
  459. url: `${baseUrl}/api/thirdparty/aliyun/oss-form-upload`,
  460. header: {
  461. 'Authorization': 'bearer ' + global.token
  462. },
  463. data: {
  464. type: 'FOOD_JOURNAL',
  465. file_ext: fileExt
  466. },
  467. success: (rsp) => {
  468. if (rsp.statusCode != 200) {
  469. Taro.showToast({
  470. title: global.language == 'en' ? 'Posting failed. Please check your network.' : '操作失败,请检查网络',
  471. icon: 'none'
  472. })
  473. return
  474. }
  475. Taro.uploadFile({
  476. url: rsp.data.upload_url,
  477. filePath: path,
  478. name: 'file',
  479. formData: rsp.data.fields,
  480. success: rlt => {
  481. setImgUrl(rsp.data.view_url)
  482. Taro.hideLoading()
  483. // createData(rsp.data.view_url, source)
  484. // uploadAvatar(rsp.data.view_url)
  485. // _this.changeAvatar(rsp.data.view_url);
  486. },
  487. fail: rlt => {
  488. Taro.hideLoading()
  489. Taro.showModal({
  490. content: rlt.errMsg
  491. })
  492. }
  493. })
  494. }
  495. })
  496. }
  497. function tapPost() {
  498. if (desc.length == 0 && imgUrl.length == 0) {
  499. Taro.showToast({
  500. icon: 'none',
  501. title: '请输入描述或添加图片'
  502. })
  503. return
  504. }
  505. // var dt = new Date(selDate + 'T' + time + ':' + dayjs(enterTimestmap).format('ss'))
  506. var dt = TimeFormatter.stringToDate(selDate, time)
  507. dt.setSeconds(parseInt(dayjs(enterTimestmap).format('ss')))
  508. dt.setMilliseconds(new Date(enterTimestmap).getMilliseconds())
  509. var params: any = {
  510. schedule_id: schedule_id,
  511. description: desc,
  512. start: {
  513. date: dayjs(dt.getTime()).format('YYYYMMDD'),
  514. timestamp: dt.getTime()
  515. },
  516. // real_end_time: meal.target_end_time,
  517. }
  518. if (imgUrl.length > 0) {
  519. params.media = [{
  520. url: imgUrl,
  521. type: imgUrl.indexOf('mp4') != -1 ? 'video' : 'image',
  522. source: 'album'
  523. }]
  524. }
  525. params.event_id = event_id
  526. createMoment(params).then(res => {
  527. getDatas()
  528. setImgUrl('')
  529. setDesc('')
  530. if (global.refreshWindow) {
  531. global.refreshWindow()
  532. }
  533. if (global.refreshHistory)
  534. global.refreshHistory()
  535. setShowPop(false)
  536. })
  537. }
  538. function mediaCount() {
  539. // let count = 0;
  540. // list && list.map(moment => {
  541. // moment.media.map((obj) => {
  542. // count++
  543. // })
  544. // })
  545. // return count;
  546. return imgList().length;
  547. }
  548. function imgList() {
  549. var array: any = []
  550. list && list.map(moment => {
  551. moment.media.map((obj) => {
  552. array.push(obj.url)
  553. })
  554. })
  555. history && history.map(item => {
  556. item.moments && item.moments.map(moment => {
  557. moment.media && moment.media.map((obj) => {
  558. array.push(obj.url)
  559. })
  560. })
  561. })
  562. return array;
  563. }
  564. function edit() {
  565. if (list.length == 0) return
  566. var id = list[0].id
  567. // global.edit_timeline = detail
  568. // jumpPage(`./add_moment?edit=1&event_id=${event_id}&id=${id}`)
  569. jumpPage(`/_record/pages/log_record?edit=1&id=${detail.id}&scenario=${detail.scenario}`)
  570. }
  571. function del() {
  572. showAlert({
  573. title: t('health.del_title'),
  574. content: '',
  575. cancelText: t('health.del_cancel'),
  576. confirmText: t('health.del_confirm'),
  577. showCancel: true,
  578. confirm: () => {
  579. delEvents(event_id).then(res => {
  580. Taro.eventCenter.trigger('refreshMoments', '')
  581. Taro.navigateBack()
  582. if (global.refreshWindow) {
  583. global.refreshWindow()
  584. }
  585. if (global.refreshHistory)
  586. global.refreshHistory()
  587. if (global.refreshOtherHistory)
  588. global.refreshOtherHistory()
  589. if ((res as any).status_change) {
  590. if ((res as any).status_change.previous != (res as any).status_change.current) {
  591. //灵动岛弹窗
  592. setTimeout(() => {
  593. dispatch(setShowActionTip({
  594. isShow: true,
  595. isCompleted: false
  596. }))
  597. }, 1000)
  598. }
  599. }
  600. // global.refreshHistory()
  601. })
  602. }
  603. })
  604. }
  605. function delHistory() {
  606. var ids: any = [window_id]
  607. if (isfastsleep == '1') {
  608. ids = [detail.windows[0].id, detail.windows[1].id]
  609. }
  610. showAlert({
  611. title: t('health.del_title'),
  612. content: '',
  613. cancelText: t('health.del_cancel'),
  614. confirmText: t('health.del_confirm'),
  615. showCancel: true,
  616. confirm: () => {
  617. delRecord({ ids: ids }).then(res => {
  618. if (global.refreshWindow) {
  619. global.refreshWindow()
  620. }
  621. if (global.refreshHistory)
  622. global.refreshHistory()
  623. if (global.refreshOtherHistory)
  624. global.refreshOtherHistory()
  625. Taro.navigateBack()
  626. })
  627. }
  628. })
  629. }
  630. function tapMarkdone() {
  631. makeDone(window_id).then(res => {
  632. Taro.showToast({
  633. title: '操作成功',
  634. icon: 'none'
  635. })
  636. getDatas()
  637. global.refreshHistory()
  638. if (global.refreshArchiveHistory) {
  639. global.refreshArchiveHistory()
  640. }
  641. })
  642. }
  643. function tapMore() {
  644. var list: any = []
  645. if (window_id && window_id != 'undefined' && (op_page != 'HOME_EAT' && op_page != 'HOME_ACTIVE')) {
  646. if (detail.archived) {
  647. list = [t('health.delete'), 'Mark Done']
  648. }
  649. else {
  650. list = [t('health.delete')]
  651. }
  652. showActionSheet({
  653. showActionSheetWithOptions: showActionSheetWithOptions,
  654. title: t('health.more_actions'),
  655. itemList: list,
  656. success: (res) => {
  657. if (res == 0) {
  658. dispatch(setFirstEatId(''))
  659. dispatch(setFirstActiveId(''))
  660. if (event_id) {
  661. del()
  662. }
  663. else {
  664. delHistory()
  665. }
  666. }
  667. else if (res == 1) {
  668. tapMarkdone()
  669. }
  670. }
  671. })
  672. return
  673. }
  674. if (detail.window != 'ACTIVE' && detail.window != 'EAT') {
  675. list = [t('health.delete')]
  676. }
  677. else {
  678. list = [t('health.edit'), t('health.delete')]
  679. }
  680. showActionSheet({
  681. showActionSheetWithOptions: showActionSheetWithOptions,
  682. title: t('health.more_actions'),
  683. itemList: list,
  684. success: (res) => {
  685. if (res >= 0) {
  686. if (list[res] == t('health.delete')) {
  687. dispatch(setFirstEatId(''))
  688. dispatch(setFirstActiveId(''))
  689. del()
  690. }
  691. else if (list[res] == t('health.edit')) {
  692. edit()
  693. }
  694. }
  695. }
  696. })
  697. }
  698. function dayTag(obj) {
  699. var begin = history[0].time.timestamp
  700. var end = obj.time.timestamp
  701. return TimeFormatter.dayTagText(begin, end)
  702. }
  703. function showFastSleepPopDetail() {
  704. setFastSleepPop(true)
  705. }
  706. if (!loaded) return <View />
  707. function fastSleepPopContent() {
  708. function stepContent(str, index) {
  709. return <View className="bold h30" style={{ color: index == 1 ? MainColorType.sleep : MainColorType.fast }}>{str}</View>
  710. }
  711. if (fastSleepPop) {
  712. var fast = detail.windows[0]
  713. var sleep = detail.windows[1]
  714. return <FastSleepPopupContent
  715. close={() => { setFastSleepPop(false) }}
  716. beforeStatus={StatusType.normal}
  717. sleepStatus={StatusType.normal}
  718. afterStatus={StatusType.normal}
  719. title={t('health.my_fast_journal')}
  720. isFixed
  721. showStep={true}
  722. total={''}
  723. // total1={total1()}
  724. // total2={total2()}
  725. // total3={total3()}
  726. step1={stepContent(TimeFormatter.calculateTimeDifference(fast.window_range.start_timestamp, sleep.window_range.start_timestamp, false, true), 0)}
  727. step2={stepContent(TimeFormatter.calculateTimeDifference(sleep.window_range.start_timestamp, sleep.window_range.end_timestamp, false, true), 1)}
  728. step3={stepContent(TimeFormatter.calculateTimeDifference(sleep.window_range.end_timestamp, fast.window_range.end_timestamp, false, true), 2)}
  729. />
  730. }
  731. return null
  732. }
  733. function footerTime(publish) {
  734. if (publish.edited) {
  735. //dayjs(publish.timestamp).format('M月D日 HH:mm')
  736. return t('health.log_updated', {
  737. date_time: global.language == 'en' ?
  738. dayjs(publish.timestamp).format('MMM D HH:mm') :
  739. dayjs(publish.timestamp).format('M月D日 HH:mm')
  740. })
  741. }
  742. else {
  743. return t('health.log_created', {
  744. date_time: global.language == 'en' ?
  745. dayjs(publish.timestamp).format('MMM D HH:mm') :
  746. dayjs(publish.timestamp).format('M月D日 HH:mm')
  747. })
  748. }
  749. }
  750. function backHome() {
  751. Taro.reLaunch({
  752. url: '/pages/moment/moment'
  753. })
  754. // Taro.reLaunch({
  755. // url: '/pages/clock/Clock'
  756. // })
  757. }
  758. function postBtnColor() {
  759. if (detail.window)
  760. return getThemeColor(detail.window)
  761. if (detail.events) {
  762. return getThemeColor(detail.events[0].window)
  763. }
  764. }
  765. function goHome() {
  766. if (!user.isLogin) {
  767. jumpPage('/_account/pages/ChooseAuth')
  768. return
  769. }
  770. if (router.params.source == 'home') {
  771. Taro.navigateBack()
  772. return
  773. }
  774. jumpPage('/_moment/pages/home?uid=' + (shareUser ? shareUser.id : detail.share_user ? detail.share_user.id : user.id))
  775. }
  776. function moreBtn() {
  777. if (!detail.share_user || user.id == detail.share_user.id) {
  778. return <NewButton
  779. type={NewButtonType.more}
  780. onClick={tapMore}
  781. />
  782. }
  783. }
  784. function addNoteBtn() {
  785. if (!detail) return null
  786. if (!uid && (detail && detail.share_user && user.id != detail.share_user.id)) {
  787. return null
  788. }
  789. if (detail.windows && detail.windows[0].status != 'DONE' && ((health.mode != 'ACTIVE' && health.mode != 'EAT') || fast_type == 'LF'))
  790. return <View className="add_note"><NewButton type={NewButtonType.link} title={t('health.add_note')} onClick={() => {
  791. setShowPop(true)
  792. }} /></View>
  793. }
  794. return <View style={{ display: 'flex', flex: 1, flexDirection: 'column', backgroundColor: '#fff', minHeight: '101vh' }}>
  795. {/* <View>测试图片原图</View>
  796. <Image src="https://fast-prod.oss-cn-beijing.aliyuncs.com/users/6b3dd3ee205561e227e9e3a6dd30a8d4/food-journal/2024/e5631780-a045-4384-8837-3f34a91f37e1_20241227144547_701.jpg"
  797. style={{width:100,height:100}}
  798. />
  799. <View>测试图片压缩</View>
  800. <Image src="https://fast-prod.oss-cn-beijing.aliyuncs.com/users/6b3dd3ee205561e227e9e3a6dd30a8d4/food-journal/2024/e5631780-a045-4384-8837-3f34a91f37e1_20241227144547_701.jpg?x-oss-process=image/resize,w_400"
  801. style={{width:100,height:100}}
  802. />
  803. <View>测试图片webp</View>
  804. <Image src="https://fast-prod.oss-cn-beijing.aliyuncs.com/users/6b3dd3ee205561e227e9e3a6dd30a8d4/food-journal/2024/e5631780-a045-4384-8837-3f34a91f37e1_20241227144547_701.jpg?x-oss-process=image/format,webp"
  805. style={{width:100,height:100}}
  806. />
  807. <View>测试图片png</View>
  808. <Image src="https://fast-prod.oss-cn-beijing.aliyuncs.com/users/6b3dd3ee205561e227e9e3a6dd30a8d4/food-journal/2024/e5631780-a045-4384-8837-3f34a91f37e1_20241227144547_701.jpg?x-oss-process=image/format,png"
  809. style={{width:100,height:100}}
  810. />
  811. <View>测试图片jpg</View>
  812. <Image src="https://fast-prod.oss-cn-beijing.aliyuncs.com/users/6b3dd3ee205561e227e9e3a6dd30a8d4/food-journal/2024/e5631780-a045-4384-8837-3f34a91f37e1_20241227144547_701.jpg?x-oss-process=image/format,jpg"
  813. style={{width:100,height:100}}
  814. />
  815. <View>测试图片jpg+压缩</View>
  816. <Image src="https://fast-prod.oss-cn-beijing.aliyuncs.com/users/6b3dd3ee205561e227e9e3a6dd30a8d4/food-journal/2024/e5631780-a045-4384-8837-3f34a91f37e1_20241227144547_701.jpg?x-oss-process=image/format,jpg/resize,w_400"
  817. style={{width:100,height:100}}
  818. /> */}
  819. {
  820. !showEmpty && <View className="detail_header">
  821. <Image className="detail_header_header"
  822. onClick={goHome}
  823. src={shareUser ? shareUser.avatar : detail.share_user ? detail.share_user.avatar : user.avatar}
  824. mode="aspectFill"
  825. />
  826. <View className="detail_header_content">
  827. <Text className="detail_nickname" onClick={goHome}>{shareUser ? shareUser.nickname : detail.share_user ? detail.share_user.nickname : user.nickname}</Text>
  828. {
  829. (!window_id || window_id == 'undefined') && (detail.scenario != 'MEAL' && detail.scenario != 'ACTIVITY') &&
  830. <TimeTitleDesc
  831. timeObj={detail.time}
  832. time={dayjs(detail.time.timestamp).format('HH:mm')}
  833. title={detail.title}
  834. />
  835. }
  836. {
  837. !window_id && detail.scenario == 'ACTIVITY' && !list &&
  838. <TimeTitleDesc
  839. timeObj={detail.time}
  840. time={dayjs(detail.time.timestamp).format('HH:mm')}
  841. title={detail.title}
  842. />
  843. }
  844. {
  845. list && list.map((item, index) => {
  846. return <View key={index} style={{ flexDirection: 'column', display: 'flex' }}>
  847. {
  848. (item.title || item.description) && <TimeTitleDesc
  849. showPoint={detail.show}
  850. timeObj={detail.time}
  851. time={dayjs(item.time.timestamp).format('HH:mm')}
  852. title={item.title}
  853. desc={item.description}
  854. />
  855. }
  856. </View>
  857. })
  858. }
  859. {
  860. history && history.map((item, index) => {
  861. return <View key={index} style={{ flexDirection: 'column', display: 'flex' }}>
  862. {
  863. item.show && <TimeTitleDesc
  864. timeObj={item.time}
  865. time={dayjs(item.time.timestamp).format('HH:mm')}
  866. title={item.title}
  867. dayTag={dayTag(item)}
  868. desc=''
  869. />
  870. }
  871. {
  872. item.moments && item.moments.map((moment, j) => {
  873. return (moment.title || moment.description) && <View key={j * 10} style={{ flexDirection: 'column', display: 'flex' }}>
  874. <TimeTitleDesc
  875. showPoint={item.show}
  876. timeObj={moment.time}
  877. time={dayjs(moment.time.timestamp).format('HH:mm')}
  878. title={moment.title}
  879. dayTag={dayTag(moment)}
  880. desc={moment.description}
  881. />
  882. </View>
  883. })
  884. }
  885. {/* {
  886. item.moments && item.moments.map((moment, j) => {
  887. return <View key={j * 10} style={{ flexDirection: 'column', display: 'flex' }}>
  888. <TimeTitleDesc
  889. timeObj={moment.time}
  890. time={dayjs(item.time.timestamp).format('HH:mm')}
  891. title={moment.title ? moment.title : item.title}
  892. dayTag={dayTag(item)}
  893. desc={moment.description}
  894. />
  895. </View>
  896. })
  897. }
  898. {
  899. !item.moments && <TimeTitleDesc
  900. timeObj={item.time}
  901. time={dayjs(item.time.timestamp).format('HH:mm')}
  902. title={item.title}
  903. dayTag={dayTag(item)}
  904. desc=''
  905. />
  906. } */}
  907. </View>
  908. })
  909. }
  910. {/* {
  911. <View className="media" style={{ marginRight: mediaCount() == 4 ? 80 : 0, marginTop: rpxToPx(24) }}>
  912. {
  913. list && list.map(moment => {
  914. return moment.media.map((obj, j) => {
  915. return <Image className="media_item" mode="aspectFill" onClick={() => { }} src={obj.url} key={j * 10} />
  916. })
  917. })
  918. }
  919. </View>
  920. } */}
  921. {
  922. mediaCount() > 1 && <View style={{ marginTop: rpxToPx(17), display: 'flex', flexShrink: 0 }}>
  923. <CoverList imgs={imgList()} count={mediaCount()} />
  924. </View>
  925. }
  926. {
  927. mediaCount() == 1 && <View style={{ marginTop: rpxToPx(17), display: 'flex', flexShrink: 0 }}>
  928. <SingleImage url={imgList()[0]} />
  929. </View>
  930. }
  931. <View style={{ height: rpxToPx(17), flexShrink: 0, display: 'flex' }} />
  932. {
  933. isfastsleep != '1' && history && detail.windows && detail.windows[0].status == 'DONE' && detail.windows.map((item, index) => {
  934. return <TargetProgress key={index} showLine={index < detail.windows.length - 1}
  935. onClick={() => {
  936. vibrate()
  937. }}
  938. color={getThemeColor(item.window)}
  939. showRing={detail.fast_type == 'LF' ? false : true}
  940. desc={item.description}
  941. time_desc={item.time_desc}
  942. icon={
  943. detail.fast_type == 'LF' ? <IconLongFast color={MainColorType.fast} width={rpxToPx(32)} /> : null
  944. }
  945. canvasId={`${item.window}${item.window_range.start_timestamp}${index}aa`}
  946. startTimestamp={item.window_range.start_timestamp}
  947. endTimerstamp={item.window_range.end_timestamp}
  948. />
  949. })
  950. }
  951. {
  952. isfastsleep == '1' && history && detail.windows && detail.windows.length >= 2 && detail.windows[0].status == 'DONE' && <TargetProgress
  953. onClick={showFastSleepPopDetail}
  954. showRing={true}
  955. doubleRing={true}
  956. first={detail.windows[0]}
  957. second={detail.windows[1]}
  958. canvasId={`double_${detail.windows[0].window_range.start_timestamp}`}
  959. />
  960. }
  961. {
  962. join && <LongCard join={join} title={detail.title} />
  963. }
  964. {
  965. publish && <View style={{ display: 'flex', flexDirection: 'row', height: rpxToPx(60), marginTop: rpxToPx(17), alignItems: 'center' }}>
  966. {/* <Text className="h24 g02">{publish.edited ? '编辑于' : '发布于'}{dayjs(publish.timestamp).format('M月D日 HH:mm')}</Text> */}
  967. <Text className="h24 g02">{footerTime(publish)}</Text>
  968. <View style={{ flex: 1 }} />
  969. {
  970. join && join.status == 'JOIN' && <NewButton type={NewButtonType.custom} onClick={() => {
  971. if (!user.isLogin) {
  972. jumpPage('/_account/pages/ChooseAuth')
  973. return
  974. }
  975. dispatch(setFollow(shareUser ? shareUser : detail.share_user ? detail.share_user : user))
  976. dispatch(setJoinData(join))
  977. if (join.window == 'ACTIVE' || join.window == 'EAT') {
  978. jumpPage(`/_record/pages/log_record?scenario=${join.window == 'EAT' ? 'MEAL' : 'ACTIVITY'}&join_id=${join.key}`)
  979. }
  980. else if (join.window == 'FAST' || join.window == 'SLEEP') {
  981. jumpPage(`/_record/pages/time_record?scenario=${join.window}&join_id=${join.key}`)
  982. }
  983. // jumpPage(`/_moment/pages/long_detail?join_id=${join.key}&window=${join.window}&status=${join.status}`)
  984. }}>
  985. <View className="h24" style={{ color: MainColorType.link, padding: rpxToPx(13) }}>跟卡</View>
  986. </NewButton>
  987. }
  988. {/* <View className="share_btn_bg">
  989. <View className="share_icon_bg" style={{ paddingLeft: rpxToPx(20), paddingRight: rpxToPx(20) }}>
  990. <IconShare color={MainColorType.link + 'cc'} width={rpxToPx(32)} />
  991. </View>
  992. <Button className="share_btn" openType="share">1</Button>
  993. </View> */}
  994. <ShareBtn>
  995. <View className="share_icon_bg" >
  996. <IconShare color={MainColorType.link + 'cc'} width={rpxToPx(32)} />
  997. </View>
  998. </ShareBtn>
  999. {
  1000. moreBtn()
  1001. }
  1002. </View>
  1003. }
  1004. </View>
  1005. </View>
  1006. }
  1007. {
  1008. showEmpty && <View className="no_data_bg2" style={{ marginTop: rpxToPx(256) }}>
  1009. <View style={{
  1010. backgroundColor: MainColorType.g04,
  1011. width: rpxToPx(108),
  1012. height: rpxToPx(108),
  1013. borderRadius: rpxToPx(54),
  1014. display: 'flex',
  1015. alignItems: 'center',
  1016. justifyContent: 'center'
  1017. }}>
  1018. <IconError width={rpxToPx(88)} color="#fff" />
  1019. </View>
  1020. <Text className="h50 g01 bold" style={{ marginBottom: rpxToPx(92), marginTop: rpxToPx(24) }}>{t('health.no_content')}</Text>
  1021. </View>
  1022. }
  1023. <Text style={{ opacity: 0 }}>{count}</Text>
  1024. <ListFooter />
  1025. {
  1026. uid && <View style={{ height: 100 }} />
  1027. }
  1028. {/* {
  1029. !uid && detail.windows && detail.windows[0].status != 'DONE' && ((health.mode != 'ACTIVE' && health.mode != 'EAT') || fast_type == 'LF') && <View className="add_note"><NewButton type={NewButtonType.link} title={t('health.add_note')} onClick={() => {
  1030. setShowPop(true)
  1031. }} /></View>
  1032. } */}
  1033. {
  1034. addNoteBtn()
  1035. }
  1036. {
  1037. uid && <View className="main_footer" style={{ backgroundColor: '#fff' }}>
  1038. <NewButton
  1039. type={NewButtonType.fill}
  1040. color={MainColorType.success}
  1041. title={t('health.back_moment')}
  1042. width={rpxToPx(646)}
  1043. height={rpxToPx(96)}
  1044. onClick={backHome}
  1045. />
  1046. </View>
  1047. }
  1048. {
  1049. showPop && <View className="publish_bg">
  1050. <NewButton type={NewButtonType.img}
  1051. btnStyle={{
  1052. position: 'absolute', left: rpxToPx(52),
  1053. top: 0,
  1054. color: '#fff',
  1055. width: 32,
  1056. height: 32
  1057. }}
  1058. onClick={() => {
  1059. setShowPop(false)
  1060. }}>
  1061. <IconClose color="#fff" width={20} height={20} />
  1062. </NewButton>
  1063. <View onClick={() => setShowTimePicker(true)} style={{ height: rpxToPx(88), marginTop: rpxToPx(120), width: rpxToPx(80), color: MainColorType.link }}>{time}
  1064. </View>
  1065. <Textarea className="myTextarea" placeholder={t('health.how_feeling')} style={{ flex: 1, color: '#fff', caretColor: getThemeColor(detail.window) }} focus value={desc} onInput={(e) => {
  1066. setDesc(e.detail.value)
  1067. }} />
  1068. <View className="toolbar2">
  1069. {
  1070. imgUrl.length > 0 && <NewButton type={NewButtonType.img} onClick={() => addImage(false)}>
  1071. <Image src={imgUrl} mode="aspectFill" className="album" />
  1072. </NewButton>
  1073. }
  1074. {
  1075. imgUrl.length == 0 && <NewButton type={NewButtonType.img} onClick={() => addImage(false)}>
  1076. <Image src={require('@assets/_health/album.png')} className="album"
  1077. />
  1078. </NewButton>
  1079. }
  1080. {
  1081. imgUrl.length == 0 && <NewButton type={NewButtonType.img} onClick={() => addImage(true)}>
  1082. <Image src={require('@assets/_health/camera.png')} className="album"
  1083. /></NewButton>
  1084. }
  1085. <View style={{ flex: 1 }} />
  1086. <View className="btn" style={{ backgroundColor: btnDisable ? '#b2b2b2' : postBtnColor() }} onClick={tapPost}>{t('health.post')}</View>
  1087. </View>
  1088. <View style={{ height: bottom, flexShrink: 0 }} />
  1089. </View>
  1090. }
  1091. {
  1092. showTimePicker && <NewModal
  1093. title={t('health.note_time')}
  1094. dismiss={() => setShowTimePicker(false)}
  1095. confirm={() => {
  1096. var str = dayjs().format('HH:mm')
  1097. var date = new Date(selDate + ' ' + selTime + ':00')
  1098. var now = new Date()
  1099. if (date.getTime() > now.getTime()) {
  1100. setTime(str)
  1101. setCount(count => count + 1)
  1102. Taro.showToast({
  1103. title: t('health.future_time_limit'),
  1104. icon: 'none'
  1105. })
  1106. return
  1107. }
  1108. // props.onChange({
  1109. // date: selDate,
  1110. // time: time,
  1111. // duration: minutes,
  1112. // isYesterday: isYesterday
  1113. // })
  1114. setTime(selTime)
  1115. setShowTimePicker(false)
  1116. }}
  1117. themeColor={getThemeColor(detail.window)}>
  1118. <Card>
  1119. <ChooseDateTime title={null}
  1120. disable={false}
  1121. color={getThemeColor(detail.window)}
  1122. expand={true}
  1123. time={time}
  1124. hideFooter={true}
  1125. // timeChange={(e) => {
  1126. // setSelTime(e)
  1127. // }}
  1128. minTimestamp={new Date().getTime()}
  1129. date={selDate}
  1130. change={e => {
  1131. setSelDate(e[0])
  1132. setSelTime(e[1])
  1133. }}
  1134. // dateChange={(e) => {
  1135. // setSelDate(e)
  1136. // }}
  1137. />
  1138. </Card>
  1139. </NewModal>
  1140. }
  1141. {
  1142. fastSleepPopContent()
  1143. }
  1144. <MomentDetailShare
  1145. cover={mediaCount() > 0 ? imgList()[0] : null}
  1146. user={shareUser ? shareUser : detail.share_user}
  1147. btnColor={getThemeColor(detail.join ? detail.join.window : detail.window)} />
  1148. </View>
  1149. }