Discovery.tsx 23 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559
  1. import { View, Text, Image, Switch } from "@tarojs/components";
  2. import { bigRingRadius, dotIsOuterRange, getBgRing, getCommon, getDot, getReal, getSchedule, getTarget, ringWidth, smallRingRadius, thirdRingRadius } from "@/features/trackTimeDuration/hooks/RingData";
  3. import { RealRing, CurrentDot } from "@/features/trackTimeDuration/components/Rings";
  4. import { ColorType } from "@/context/themes/color";
  5. import { useDispatch, useSelector } from "react-redux";
  6. import Rings from "@/features/trackTimeDuration/components/Rings";
  7. import { jumpPage } from "@/features/trackTimeDuration/hooks/Common";
  8. import { rpxToPx } from "@/utils/tools";
  9. import { useEffect, useState } from "react";
  10. import Taro, { useDidHide, useDidShow } from "@tarojs/taro";
  11. import './Discovery.scss'
  12. import { useTranslation } from "react-i18next";
  13. import { TimeFormatter } from "@/utils/time_format";
  14. import { getPerm, uploadPerm } from "@/services/user";
  15. import Box from "@/components/layout/Box";
  16. import { getPlans, setPlan } from "@/services/trackTimeDuration";
  17. import DayNightCard from "@/features/trackTimeDuration/components/DayNightCard";
  18. import { clearDayStore } from "@/store/day";
  19. import { AtActivityIndicator } from "taro-ui";
  20. import NoData from "@/components/view/NoData";
  21. // import AtActivityIndicator from "taro-ui/types/activity-indicator";
  22. let useNavigation;
  23. if (process.env.TARO_ENV == 'rn') {
  24. useNavigation = require("@react-navigation/native").useNavigation
  25. }
  26. let pauseTimer = false
  27. const defaultValue = `{"scenarios":[{"name":"FAST","count":0,"schedule":{"fast":{"start_time":"15:00","end_time":"08:00"}}},{"name":"SLEEP","count":0,"schedule":{"sleep":{"start_time":"22:00","end_time":"07:00"}}},{"name":"FAST_SLEEP","count":0,"schedule":{"fast":{"start_time":"15:00","end_time":"08:00"},"sleep":{"start_time":"22:00","end_time":"07:00"}}}],"select_count":0,"theme_color":{"fast":"#00FFFF","sleep":"#8183FF"}}`
  28. export default function Discovery() {
  29. const user = useSelector((state: any) => state.user);
  30. const day = useSelector((state: any) => state.day);
  31. const ring = useSelector((state: any) => state.ring);
  32. const [schedule, setSchedule] = useState(null)
  33. const [count, setCount] = useState(0)
  34. const [loaded, setLoaded] = useState(false)
  35. const [showErrorPage, setErrorPage] = useState(false)
  36. const dispatch = useDispatch();
  37. const { t } = useTranslation()
  38. let navigation;
  39. let timeStamp = new Date().getTime()
  40. if (useNavigation) {
  41. navigation = useNavigation()
  42. }
  43. useEffect(() => {
  44. setInterval(() => {
  45. if (global.pauseIndexTimer || pauseTimer) {
  46. return
  47. }
  48. setCount((prevCounter) => prevCounter + 1)
  49. }, 1000)
  50. }, [])
  51. useDidShow(() => {
  52. setCount(pre => pre + 1)
  53. //resume timer
  54. pauseTimer = false
  55. })
  56. useDidHide(() => {
  57. //pause timer
  58. pauseTimer = true
  59. })
  60. useEffect(() => {
  61. if (!user.isLogin) {
  62. dispatch(clearDayStore());
  63. }
  64. }, [user.isLogin])
  65. // useEffect(() => {
  66. // setSchedule(global.homeData.scenarios)
  67. // }, [global.homeData])
  68. useEffect(() => {
  69. getPlanData()
  70. setCount(pre => pre + 1)
  71. }, [user.isLogin])
  72. function getPlanData() {
  73. getPlans().then(res => {
  74. setSchedule((res as any).scenarios)
  75. setLoaded(true)
  76. setErrorPage(false)
  77. }).catch(e => {
  78. setSchedule(JSON.parse(defaultValue))
  79. setLoaded(true)
  80. setErrorPage(true)
  81. })
  82. }
  83. function getFoodTime() {
  84. if (ring.schedule) {
  85. return [ring.schedule.fast.end_time, ring.schedule.fast.start_time]
  86. }
  87. var obj;
  88. (schedule as any).map(item => {
  89. if (item.name == 'FAST') {
  90. obj = item
  91. }
  92. })
  93. if (!obj) {
  94. console.log('报错', schedule)
  95. return ['16:00', '08:00'];
  96. }
  97. return [obj.schedule.fast.end_time, obj.schedule.fast.start_time]
  98. }
  99. function getActivityTime() {
  100. if (ring.schedule) {
  101. return [ring.schedule.sleep.end_time, ring.schedule.sleep.start_time]
  102. }
  103. var obj;
  104. (schedule as any).map(item => {
  105. if (item.name == 'SLEEP') {
  106. obj = item
  107. }
  108. })
  109. return [obj.schedule.sleep.end_time, obj.schedule.sleep.start_time]
  110. }
  111. function bigRing() {
  112. var common = getCommon(null, true)
  113. common.radius = bigRingRadius;
  114. common.lineWidth = ringWidth;
  115. var bgRing = getBgRing()
  116. const targetRing: RealRing = {
  117. color: (ring.current_record && ring.current_record.scenario == 'SLEEP') ? ColorType.activity + '66' : ColorType.food + '66',
  118. startArc: 0,
  119. durationArc: 2
  120. }
  121. var list = getFoodTime()
  122. var start;
  123. var end;
  124. if (ring.current_record && ring.current_record.scenario == 'SLEEP') {
  125. var list2 = getActivityTime()
  126. start = parseInt(list2[0].split(':')[0]) * 60 + parseInt(list2[0].split(':')[1])
  127. end = parseInt(list2[1].split(':')[0]) * 60 + parseInt(list2[1].split(':')[1])
  128. if (ring.current_record.status != 'WAIT_FOR_START') {
  129. var startDate = new Date(ring.current_record.sleep.target_start_time)
  130. var endDate = new Date(ring.current_record.sleep.target_end_time)
  131. end = startDate.getHours() * 60 + startDate.getMinutes()
  132. start = endDate.getHours() * 60 + endDate.getMinutes()
  133. }
  134. }
  135. else {
  136. start = parseInt(list[0].split(':')[0]) * 60 + parseInt(list[0].split(':')[1])
  137. end = parseInt(list[1].split(':')[0]) * 60 + parseInt(list[1].split(':')[1])
  138. if (ring.current_record && ring.current_record.status != 'WAIT_FOR_START') {
  139. var startDate = new Date(ring.current_record.fast.target_start_time)
  140. var endDate = new Date(ring.current_record.fast.target_end_time)
  141. end = startDate.getHours() * 60 + startDate.getMinutes()
  142. start = endDate.getHours() * 60 + endDate.getMinutes()
  143. }
  144. }
  145. if (end < start) {
  146. end += 24 * 60
  147. }
  148. var duration = end - start
  149. targetRing.startArc = (start * 60) / (24 * 3600) * 2 * Math.PI - Math.PI / 2.0;
  150. targetRing.durationArc = (duration * 60) / (24 * 3600) * 2 * Math.PI;
  151. var currentDot = getDot(null, false)
  152. var date = new Date()
  153. var minutes = date.getHours() * 60 + date.getMinutes()
  154. if (minutes < start) {
  155. minutes += 1440
  156. }
  157. currentDot.color = ColorType.food
  158. var now = new Date()
  159. var t = now.getHours() * 60 + now.getMinutes()
  160. var duration2 = t - start
  161. if (duration2 < 0) {
  162. duration2 += 24 * 60
  163. }
  164. let realRing: RealRing = {
  165. color: ColorType.food,
  166. startArc: (start * 60) / (24 * 3600) * 2 * Math.PI - Math.PI / 2.0,
  167. durationArc: (duration2 * 60) / (24 * 3600) * 2 * Math.PI
  168. }
  169. if (ring.current_record && ring.current_record.scenario == 'SLEEP') {
  170. realRing.color = ColorType.activity
  171. currentDot.color = ColorType.activity
  172. }
  173. if (!user.isLogin) {
  174. currentDot = null
  175. realRing = null
  176. }
  177. if (ring.current_record.status == 'ONGOING1') {
  178. realRing = null
  179. }
  180. return <Rings common={common} bgRing={bgRing} targetRing={targetRing} realRing={duration2 <= duration ? realRing : null} currentDot={currentDot} canvasId={'day_big'} />
  181. }
  182. function smallRing() {
  183. var common = getCommon(null, false)
  184. common.radius = smallRingRadius;
  185. common.lineWidth = ringWidth;
  186. var bgRing = getBgRing()
  187. const realRingBig: RealRing = {
  188. color: ColorType.activity + '66',
  189. startArc: 0,
  190. durationArc: 2
  191. }
  192. var list = getActivityTime()
  193. var start = parseInt(list[0].split(':')[0]) * 60 + parseInt(list[0].split(':')[1])
  194. var end = parseInt(list[1].split(':')[0]) * 60 + parseInt(list[1].split(':')[1])
  195. if (ring.current_record) {
  196. if (ring.current_record.scenario == 'SLEEP') {
  197. if (ring.current_record.status == 'ONGOING') {
  198. var startDate = new Date(ring.current_record.sleep.target_start_time)
  199. var endDate = new Date(ring.current_record.sleep.target_end_time)
  200. end = startDate.getHours() * 60 + startDate.getMinutes()
  201. start = endDate.getHours() * 60 + endDate.getMinutes()
  202. }
  203. }
  204. else {
  205. if (ring.current_record.status == 'ONGOING2') {
  206. var startDate = new Date(ring.current_record.sleep.target_start_time)
  207. var endDate = new Date(ring.current_record.sleep.target_end_time)
  208. end = startDate.getHours() * 60 + startDate.getMinutes()
  209. start = endDate.getHours() * 60 + endDate.getMinutes()
  210. }
  211. else if (ring.current_record.status == 'ONGOING3') {
  212. //睡眠已完成时,睡眠小于24小时,使用真实的real_end_time-real_start_time
  213. //大于24小时,使用real_end_time+sleep_duration
  214. if (ring.current_record.sleep.real_end_time - ring.current_record.sleep.real_start_time < 24 * 3600 * 1000) {
  215. var startDate = new Date(ring.current_record.sleep.real_start_time)
  216. var endDate = new Date(ring.current_record.sleep.real_end_time)
  217. end = startDate.getHours() * 60 + startDate.getMinutes()
  218. start = endDate.getHours() * 60 + endDate.getMinutes()
  219. }
  220. else {
  221. var startDate = new Date(ring.current_record.sleep.real_end_time)
  222. var durationTemp = end - start//ring.current_record.sleep.target_end_time-ring.current_record.sleep.target_start_time
  223. if (durationTemp < 0) {
  224. durationTemp += 24 * 60
  225. }
  226. var endDate = new Date(startDate.getTime() + durationTemp * 60 * 1000)
  227. start = startDate.getHours() * 60 + startDate.getMinutes()
  228. end = endDate.getHours() * 60 + endDate.getMinutes()
  229. }
  230. }
  231. }
  232. }
  233. if (end < start) {
  234. end += 24 * 60
  235. }
  236. var duration = end - start
  237. realRingBig.startArc = (start * 60) / (24 * 3600) * 2 * Math.PI - Math.PI / 2.0;
  238. realRingBig.durationArc = (duration * 60) / (24 * 3600) * 2 * Math.PI;
  239. var currentDot = getDot(null, false)
  240. var date = new Date()
  241. var minutes = date.getHours() * 60 + date.getMinutes()
  242. if (minutes < start) {
  243. minutes += 1440
  244. }
  245. currentDot.color = ColorType.activity
  246. var now = new Date()
  247. var t = now.getHours() * 60 + now.getMinutes()
  248. var duration2 = t - start
  249. if (duration2 < 0) {
  250. duration2 += 24 * 60
  251. }
  252. let realRing: RealRing = {
  253. color: ColorType.activity,
  254. startArc: (start * 60) / (24 * 3600) * 2 * Math.PI - Math.PI / 2.0,
  255. durationArc: (duration2 * 60) / (24 * 3600) * 2 * Math.PI
  256. }
  257. if (!user.isLogin) {
  258. currentDot = null
  259. realRing = null
  260. }
  261. if (ring.current_record.status == 'ONGOING2') {
  262. realRing = null
  263. }
  264. return <Rings common={common} bgRing={bgRing} targetRing={realRingBig} realRing={duration2 <= duration ? realRing : null} currentDot={currentDot} canvasId={'day_small'} />
  265. }
  266. function dayRing() {
  267. var common = getCommon(null, true)
  268. common.radius = thirdRingRadius;
  269. common.lineWidth = ringWidth;
  270. var bgRing = getBgRing()
  271. const realRingBig: RealRing = {
  272. color: ColorType.day + '66',
  273. startArc: 0,
  274. durationArc: 2
  275. }
  276. var sunRise = 6 * 60
  277. var sunSet = 18 * 60
  278. var sunRiseObj = day.dayRingSunrise
  279. var sunSetObj = day.dayRingSunset
  280. sunRise = parseInt(sunRiseObj.split(':')[0]) * 60 + parseInt(sunRiseObj.split(':')[1])
  281. sunSet = parseInt(sunSetObj.split(':')[0]) * 60 + parseInt(sunSetObj.split(':')[1])
  282. var duration = sunSet - sunRise
  283. realRingBig.startArc = (sunRise * 60) / (24 * 3600) * 2 * Math.PI - Math.PI / 2.0;
  284. realRingBig.durationArc = (duration * 60) / (24 * 3600) * 2 * Math.PI;
  285. var currentDot = getDot(null, false)
  286. var date = new Date()
  287. var minutes = date.getHours() * 60 + date.getMinutes()
  288. if (minutes < sunRise) {
  289. minutes += 1440
  290. }
  291. currentDot.color = ColorType.day
  292. var now = new Date()
  293. var t = now.getHours() * 60 + now.getMinutes()
  294. var duration2 = t - sunRise
  295. if (duration2 < 0) {
  296. duration2 += 24 * 60
  297. }
  298. var realRing: RealRing = {
  299. color: ColorType.day,
  300. startArc: (sunRise * 60) / (24 * 3600) * 2 * Math.PI - Math.PI / 2.0,
  301. durationArc: (duration2 * 60) / (24 * 3600) * 2 * Math.PI
  302. }
  303. if (day.dayRingDate) {
  304. if (new Date(day.dayRingDate).getDate() != new Date().getDate()) {
  305. realRing = null;
  306. }
  307. }
  308. if (!user.isLogin) {
  309. currentDot = null
  310. realRing = null
  311. }
  312. return <Rings common={common} bgRing={bgRing} targetRing={realRingBig} realRing={duration2 <= duration ? realRing : null} currentDot={currentDot} canvasId={'day_day'} />
  313. }
  314. function goAcitivity() {
  315. if (user.isLogin) {
  316. jumpPage('/pages/workout/Workout', 'Workout', navigation)
  317. return
  318. }
  319. jumpPage('/pages/account/ChooseAuth', 'ChooseAuth', navigation)
  320. }
  321. function goFood() {
  322. if (user.isLogin) {
  323. jumpPage('/pages/food/Food', 'Food', navigation)
  324. return
  325. }
  326. jumpPage('/pages/account/ChooseAuth', 'ChooseAuth', navigation)
  327. }
  328. function dayDuration() {
  329. var sunRiseObj = day.dayRingSunrise
  330. var sunSetObj = day.dayRingSunset
  331. var sunRise = parseInt(sunRiseObj.split(':')[0]) * 60 + parseInt(sunRiseObj.split(':')[1])
  332. var sunSet = parseInt(sunSetObj.split(':')[0]) * 60 + parseInt(sunSetObj.split(':')[1])
  333. if (sunSetObj.indexOf('PM') != -1) {
  334. sunSet += 12 * 60
  335. }
  336. var duration = (sunSet - sunRise) * 60 * 1000
  337. return TimeFormatter.calculateTimeDifference(new Date().getTime(), new Date().getTime() + duration);
  338. }
  339. function eatDuration() {
  340. var list = getFoodTime()
  341. var start = parseInt(list[0].split(':')[0]) * 60 + parseInt(list[0].split(':')[1])
  342. var end = parseInt(list[1].split(':')[0]) * 60 + parseInt(list[1].split(':')[1])
  343. if (ring.current_record && ring.current_record.status != 'WAIT_FOR_START' && ring.current_record.scenario != 'SLEEP') {
  344. var startDate = new Date(ring.current_record.fast.target_start_time)
  345. var endDate = new Date(ring.current_record.fast.target_end_time)
  346. end = startDate.getHours() * 60 + startDate.getMinutes()
  347. start = endDate.getHours() * 60 + endDate.getMinutes()
  348. }
  349. if (end < start) {
  350. end += 24 * 60
  351. }
  352. var duration = (end - start) * 60 * 1000
  353. return TimeFormatter.calculateTimeDifference(new Date().getTime(), new Date().getTime() + duration);
  354. }
  355. function activityDuration() {
  356. var list = getActivityTime()
  357. var start = parseInt(list[0].split(':')[0]) * 3600 + parseInt(list[0].split(':')[1]) * 60
  358. var end = parseInt(list[1].split(':')[0]) * 3600 + parseInt(list[1].split(':')[1]) * 60
  359. if (ring.current_record) {
  360. if (ring.current_record.scenario == 'SLEEP') {
  361. if (ring.current_record.status == 'ONGOING') {
  362. var startDate = new Date(ring.current_record.sleep.target_start_time)
  363. var endDate = new Date(ring.current_record.sleep.target_end_time)
  364. end = startDate.getHours() * 3600 + startDate.getMinutes() * 60 + startDate.getSeconds()
  365. start = endDate.getHours() * 3600 + endDate.getMinutes() * 60 + endDate.getSeconds()
  366. }
  367. }
  368. else {
  369. if (ring.current_record.status == 'ONGOING2') {
  370. var startDate = new Date(ring.current_record.sleep.target_start_time)
  371. var endDate = new Date(ring.current_record.sleep.target_end_time)
  372. end = startDate.getHours() * 3600 + startDate.getMinutes() * 60 + startDate.getSeconds()
  373. start = endDate.getHours() * 3600 + endDate.getMinutes() * 60 + endDate.getSeconds()
  374. }
  375. else if (ring.current_record.status == 'ONGOING3') {
  376. //睡眠已完成时,睡眠小于24小时,使用真实的real_end_time-real_start_time
  377. //大于24小时,使用real_end_time+sleep_duration
  378. if (ring.current_record.sleep.real_end_time - ring.current_record.sleep.real_start_time < 24 * 3600 * 1000) {
  379. var startDate = new Date(ring.current_record.sleep.real_start_time)
  380. var endDate = new Date(ring.current_record.sleep.real_end_time)
  381. end = startDate.getHours() * 3600 + startDate.getMinutes() * 60 + startDate.getSeconds()
  382. start = endDate.getHours() * 3600 + endDate.getMinutes() * 60 + endDate.getSeconds()
  383. }
  384. else {
  385. var startDate = new Date(ring.current_record.sleep.real_end_time)
  386. var durationTemp = start - end//ring.current_record.sleep.target_end_time-ring.current_record.sleep.target_start_time
  387. if (durationTemp < 0) {
  388. durationTemp += 24 * 3600
  389. }
  390. var endDate = new Date(startDate.getTime() + durationTemp * 1000)
  391. end = startDate.getHours() * 3600 + startDate.getMinutes() * 60 + startDate.getSeconds()
  392. start = endDate.getHours() * 3600 + endDate.getMinutes() * 60 + endDate.getSeconds()
  393. debugger
  394. console.log('active', end, start, durationTemp)
  395. }
  396. }
  397. }
  398. }
  399. if (end < start) {
  400. end += 24 * 3600
  401. }
  402. var duration = (end - start) * 1000
  403. return TimeFormatter.calculateTimeDifference(new Date().getTime(), new Date().getTime() + duration);
  404. }
  405. function rings() {
  406. return <View style={{
  407. position: 'relative', zIndex: 1,
  408. marginLeft: day.showDayRing && false ? -6 : 0,
  409. }}>
  410. {
  411. bigRing()
  412. }
  413. {
  414. ring.current_record && ring.current_record.scenario == 'FAST_SLEEP' && <View style={{ display: 'flex', position: 'absolute', left: 0, right: 0, top: 0, bottom: 0, alignItems: 'center', justifyContent: 'center' }}>
  415. {
  416. smallRing()
  417. }
  418. </View>
  419. }
  420. {
  421. day.showDayRing && false && <View style={{ display: 'flex', position: 'absolute', left: -14, top: -14, right: -14, bottom: -14 }}>
  422. {
  423. dayRing()
  424. }
  425. </View>
  426. }
  427. </View>
  428. }
  429. if (!loaded) {
  430. return <View style={{ width: rpxToPx(750), height: rpxToPx(900), display: 'flex', alignItems: 'center', justifyContent: 'center' }}>
  431. <AtActivityIndicator size={40} color="#fff" />
  432. </View>
  433. }
  434. return <View style={{ display: 'flex', flexDirection: 'column' }}>
  435. <Box>
  436. <View>
  437. <View style={{
  438. marginLeft: rpxToPx(-40),
  439. marginRight: rpxToPx(-40),
  440. marginTop: rpxToPx(-40),
  441. padding: rpxToPx(48)
  442. }}>
  443. <View style={{
  444. display: 'flex',
  445. flexDirection: 'row',
  446. marginTop: day.showDayRing && false ? -6 : 0,
  447. marginBottom: day.showDayRing && false ? -6 : 0,
  448. padding: day.showDayRing && false ? 14 : 0,
  449. alignItems: 'center'
  450. }}>
  451. {
  452. schedule && rings()
  453. }
  454. {schedule && <View className="duration_bg3"
  455. style={{ marginLeft: day.showDayRing && false ? rpxToPx(68) : rpxToPx(52), height: bigRingRadius * 2, overflow: 'visible' }}>
  456. {
  457. day.showDayRing && false && <Text className="duration_title2">{t('feature.common.day')}</Text>
  458. }
  459. {
  460. day.showDayRing && false &&
  461. <Text className="duration_value2" style={{ color: ColorType.day }}>{dayDuration()}</Text>
  462. }
  463. {
  464. ring.current_record && ring.current_record.scenario != 'SLEEP' && <Text className="duration_title2">进食</Text>
  465. }
  466. {
  467. ring.current_record && ring.current_record.scenario != 'SLEEP' && <Text className="duration_value2" style={{ color: ColorType.food }}>{eatDuration()}</Text>
  468. }
  469. {
  470. ring.current_record && ring.current_record.scenario != 'FAST' && <Text className="duration_title2">活动</Text>
  471. }
  472. {
  473. ring.current_record && ring.current_record.scenario != 'FAST' && <Text className="duration_value2" style={{ color: ColorType.activity, marginBottom: 0 }}>{activityDuration()}</Text>
  474. }
  475. </View>
  476. }
  477. </View>
  478. </View>
  479. <View className="food_btn1" style={{ backgroundColor: ColorType.food }} onClick={goFood}>
  480. <Text style={{ fontWeight: 'bold' }}>{t('page.food.title')}</Text>
  481. </View>
  482. <View className="food_btn1" style={{ backgroundColor: ColorType.activity, marginBottom: 0 }} onClick={goAcitivity}>
  483. <Text style={{ fontWeight: 'bold' }}>{t('page.workout.title')}</Text>
  484. </View>
  485. </View>
  486. </Box>
  487. <DayNightCard isNight={false} count={count} />
  488. {
  489. showErrorPage && <NoData refresh={() => { getPlanData() }} />
  490. }
  491. </View>
  492. }