HomeComponent.html 43 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798991001011021031041051061071081091101111121131141151161171181191201211221231241251261271281291301311321331341351361371381391401411421431441451461471481491501511521531541551561571581591601611621631641651661671681691701711721731741751761771781791801811821831841851861871881891901911921931941951961971981992002012022032042052062072082092102112122132142152162172182192202212222232242252262272282292302312322332342352362372382392402412422432442452462472482492502512522532542552562572582592602612622632642652662672682692702712722732742752762772782792802812822832842852862872882892902912922932942952962972982993003013023033043053063073083093103113123133143153163173183193203213223233243253263273283293303313323333343353363373383393403413423433443453463473483493503513523533543553563573583593603613623633643653663673683693703713723733743753763773783793803813823833843853863873883893903913923933943953963973983994004014024034044054064074084094104114124134144154164174184194204214224234244254264274284294304314324334344354364374384394404414424434444454464474484494504514524534544554564574584594604614624634644654664674684694704714724734744754764774784794804814824834844854864874884894904914924934944954964974984995005015025035045055065075085095105115125135145155165175185195205215225235245255265275285295305315325335345355365375385395405415425435445455465475485495505515525535545555565575585595605615625635645655665675685695705715725735745755765775785795805815825835845855865875885895905915925935945955965975985996006016026036046056066076086096106116126136146156166176186196206216226236246256266276286296306316326336346356366376386396406416426436446456466476486496506516526536546556566576586596606616626636646656666676686696706716726736746756766776786796806816826836846856866876886896906916926936946956966976986997007017027037047057067077087097107117127137147157167177187197207217227237247257267277287297307317327337347357367377387397407417427437447457467477487497507517527537547557567577587597607617627637647657667677687697707717727737747757767777787797807817827837847857867877887897907917927937947957967977987998008018028038048058068078088098108118128138148158168178188198208218228238248258268278288298308318328338348358368378388398408418428438448458468478488498508518528538548558568578588598608618628638648658668678688698708718728738748758768778788798808818828838848858868878888898908918928938948958968978988999009019029039049059069079089099109119129139149159169179189199209219229239249259269279289299309319329339349359369379389399409419429439449459469479489499509519529539549559569579589599609619629639649659669679689699709719729739749759769779789799809819829839849859869879889899909919929939949959969979989991000100110021003100410051006100710081009101010111012101310141015101610171018101910201021102210231024102510261027102810291030103110321033103410351036103710381039104010411042104310441045104610471048104910501051105210531054105510561057105810591060106110621063106410651066106710681069107010711072107310741075107610771078107910801081108210831084108510861087108810891090109110921093109410951096109710981099110011011102110311041105110611071108
  1. <!doctype html>
  2. <html class="no-js" lang="">
  3. <head>
  4. <meta charset="utf-8">
  5. <meta http-equiv="x-ua-compatible" content="ie=edge">
  6. <title>app-angular documentation</title>
  7. <meta name="description" content="">
  8. <meta name="viewport" content="width=device-width, initial-scale=1">
  9. <link rel="icon" type="image/x-icon" href="../images/favicon.ico">
  10. <link rel="stylesheet" href="../styles/style.css">
  11. </head>
  12. <body>
  13. <div class="navbar navbar-default navbar-fixed-top visible-xs">
  14. <a href="../" class="navbar-brand">app-angular documentation</a>
  15. <button type="button" class="btn btn-default btn-menu fa fa-bars" id="btn-menu"></button>
  16. </div>
  17. <div class="xs-menu menu" id="mobile-menu">
  18. <div id="book-search-input" role="search">
  19. <input type="text" placeholder="Type to search">
  20. </div>
  21. <nav>
  22. <ul class="list">
  23. <li class="title">
  24. <a href="../">app-angular documentation</a>
  25. </li>
  26. <li class="divider"></li>
  27. <li class="chapter">
  28. <a data-type="chapter-link" href="../"><span class="fa fa-home"></span>Getting started</a>
  29. <ul class="links">
  30. <li class="link">
  31. <a href="../" ><span class="fa fa-file-text-o"></span>README</a>
  32. </li>
  33. <li class="link">
  34. <a
  35. href="../overview.html"
  36. href="../overview.html"
  37. >
  38. <span class="fa fa-th"></span>Overview
  39. </a>
  40. </li>
  41. </ul>
  42. </li>
  43. <li class="chapter">
  44. <a data-type="chapter-link" href="./modules.html" >
  45. <span class="fa fa-archive"></span>
  46. <span>Modules</span>
  47. <span class="menu-toggler fa fa-angle-up" data-toggle="collapse"
  48. data-target="#xs-modules-links"
  49. ></span>
  50. </a>
  51. <ul class="links collapse in"
  52. id="xs-modules-links"
  53. >
  54. <li class="link">
  55. <a href="../modules/AppModule.html" >AppModule</a>
  56. </li>
  57. <li class="link">
  58. <a href="../modules/LessonModule.html" >LessonModule</a>
  59. </li>
  60. </ul>
  61. </li>
  62. <li class="chapter">
  63. <div class="simple">
  64. <span class="fa fa-cogs"></span>
  65. <span>Components</span>
  66. <span class="menu-toggler fa fa-angle-up" data-toggle="collapse"
  67. data-target="#xs-components-links"
  68. ></span>
  69. </div>
  70. <ul class="links collapse in"
  71. id="xs-components-links"
  72. >
  73. <li class="link">
  74. <a href="../components/AppComponent.html" >AppComponent</a>
  75. </li>
  76. <li class="link">
  77. <a href="../components/BblComponent.html" >BblComponent</a>
  78. </li>
  79. <li class="link">
  80. <a href="../components/DetailComponent.html" >DetailComponent</a>
  81. </li>
  82. <li class="link">
  83. <a href="../components/EcharsComponent.html" >EcharsComponent</a>
  84. </li>
  85. <li class="link">
  86. <a href="../components/EchartsExempleComponent.html" >EchartsExempleComponent</a>
  87. </li>
  88. <li class="link">
  89. <a href="../components/EditComponent.html" >EditComponent</a>
  90. </li>
  91. <li class="link">
  92. <a href="../components/FlowfatherComponent.html" >FlowfatherComponent</a>
  93. </li>
  94. <li class="link">
  95. <a href="../components/FlowtestComponent.html" >FlowtestComponent</a>
  96. </li>
  97. <li class="link">
  98. <a href="../components/HomeComponent.html" class="active" >HomeComponent</a>
  99. </li>
  100. <li class="link">
  101. <a href="../components/NavTabsComponent.html" >NavTabsComponent</a>
  102. </li>
  103. <li class="link">
  104. <a href="../components/PageMineComponent.html" >PageMineComponent</a>
  105. </li>
  106. <li class="link">
  107. <a href="../components/PageSpotDetailComponent.html" >PageSpotDetailComponent</a>
  108. </li>
  109. </ul>
  110. </li>
  111. <li class="chapter">
  112. <div class="simple">
  113. <span class="fa fa-file-code-o"></span>
  114. <span>Classes</span>
  115. <span class="menu-toggler fa fa-angle-up" data-toggle="collapse"
  116. data-target="#xs-classes-links"
  117. ></span>
  118. </div>
  119. <ul class="links collapse in"
  120. id="xs-classes-links"
  121. >
  122. <li class="link">
  123. <a href="../classes/TestChatCompletion.html" >TestChatCompletion</a>
  124. </li>
  125. </ul>
  126. </li>
  127. <li class="chapter">
  128. <div class="simple">
  129. <span class="fa fa-long-arrow-down"></span>
  130. <span>Injectables</span>
  131. <span class="menu-toggler fa fa-angle-up" data-toggle="collapse"
  132. data-target="#xs-injectables-links"
  133. ></span>
  134. </div>
  135. <ul class="links collapse in"
  136. id="xs-injectables-links"
  137. >
  138. <li class="link">
  139. <a href="../injectables/DataServiceService.html" >DataServiceService</a>
  140. </li>
  141. </ul>
  142. </li>
  143. <li class="chapter">
  144. <div class="simple">
  145. <span class="fa fa-info"></span>
  146. <span>Interfaces</span>
  147. <span class="menu-toggler fa fa-angle-up" data-toggle="collapse"
  148. data-target="#xs-interfaces-links"
  149. ></span>
  150. </div>
  151. <ul class="links collapse in"
  152. id="xs-interfaces-links"
  153. >
  154. <li class="link">
  155. <a href="../interfaces/TestChatMessage.html" >TestChatMessage</a>
  156. </li>
  157. </ul>
  158. </li>
  159. <li class="chapter">
  160. <div class="simple">
  161. <span class="fa fa-plus"></span>
  162. <span>Pipes</span>
  163. <span class="menu-toggler fa fa-angle-up" data-toggle="collapse"
  164. data-target="#xs-pipes-links"
  165. ></span>
  166. </div>
  167. <ul class="links collapse in"
  168. id="xs-pipes-links"
  169. >
  170. <li class="link">
  171. <a href="../pipes/TokPipe.html" >TokPipe</a>
  172. </li>
  173. </ul>
  174. </li>
  175. <li class="chapter">
  176. <a data-type="chapter-link" href="../coverage.html" ><span class="fa fa-tasks"></span>Documentation coverage</a>
  177. </li>
  178. <li class="divider"></li>
  179. <li class="copyright">
  180. Documentation generated using <a href="https://compodoc.github.io/compodoc/" target="_blank">
  181. <img src="..//images/compodoc-vectorise.svg" class="img-responsive">
  182. </a>
  183. </li>
  184. </ul>
  185. </nav>
  186. </div>
  187. <div class="container-fluid main">
  188. <div class="row main">
  189. <div class="hidden-xs menu">
  190. <nav>
  191. <ul class="list">
  192. <li class="title">
  193. <a href="../">app-angular documentation</a>
  194. </li>
  195. <li class="divider"></li>
  196. <div id="book-search-input" role="search">
  197. <input type="text" placeholder="Type to search">
  198. </div>
  199. <li class="chapter">
  200. <a data-type="chapter-link" href="../"><span class="fa fa-home"></span>Getting started</a>
  201. <ul class="links">
  202. <li class="link">
  203. <a href="../" ><span class="fa fa-file-text-o"></span>README</a>
  204. </li>
  205. <li class="link">
  206. <a
  207. href="../overview.html"
  208. href="../overview.html"
  209. >
  210. <span class="fa fa-th"></span>Overview
  211. </a>
  212. </li>
  213. </ul>
  214. </li>
  215. <li class="chapter">
  216. <a data-type="chapter-link" href="./modules.html" >
  217. <span class="fa fa-archive"></span>
  218. <span>Modules</span>
  219. <span class="menu-toggler fa fa-angle-up" data-toggle="collapse"
  220. data-target="#modules-links"
  221. ></span>
  222. </a>
  223. <ul class="links collapse in"
  224. id="modules-links"
  225. >
  226. <li class="link">
  227. <a href="../modules/AppModule.html" >AppModule</a>
  228. </li>
  229. <li class="link">
  230. <a href="../modules/LessonModule.html" >LessonModule</a>
  231. </li>
  232. </ul>
  233. </li>
  234. <li class="chapter">
  235. <div class="simple">
  236. <span class="fa fa-cogs"></span>
  237. <span>Components</span>
  238. <span class="menu-toggler fa fa-angle-up" data-toggle="collapse"
  239. data-target="#components-links"
  240. ></span>
  241. </div>
  242. <ul class="links collapse in"
  243. id="components-links"
  244. >
  245. <li class="link">
  246. <a href="../components/AppComponent.html" >AppComponent</a>
  247. </li>
  248. <li class="link">
  249. <a href="../components/BblComponent.html" >BblComponent</a>
  250. </li>
  251. <li class="link">
  252. <a href="../components/DetailComponent.html" >DetailComponent</a>
  253. </li>
  254. <li class="link">
  255. <a href="../components/EcharsComponent.html" >EcharsComponent</a>
  256. </li>
  257. <li class="link">
  258. <a href="../components/EchartsExempleComponent.html" >EchartsExempleComponent</a>
  259. </li>
  260. <li class="link">
  261. <a href="../components/EditComponent.html" >EditComponent</a>
  262. </li>
  263. <li class="link">
  264. <a href="../components/FlowfatherComponent.html" >FlowfatherComponent</a>
  265. </li>
  266. <li class="link">
  267. <a href="../components/FlowtestComponent.html" >FlowtestComponent</a>
  268. </li>
  269. <li class="link">
  270. <a href="../components/HomeComponent.html" class="active" >HomeComponent</a>
  271. </li>
  272. <li class="link">
  273. <a href="../components/NavTabsComponent.html" >NavTabsComponent</a>
  274. </li>
  275. <li class="link">
  276. <a href="../components/PageMineComponent.html" >PageMineComponent</a>
  277. </li>
  278. <li class="link">
  279. <a href="../components/PageSpotDetailComponent.html" >PageSpotDetailComponent</a>
  280. </li>
  281. </ul>
  282. </li>
  283. <li class="chapter">
  284. <div class="simple">
  285. <span class="fa fa-file-code-o"></span>
  286. <span>Classes</span>
  287. <span class="menu-toggler fa fa-angle-up" data-toggle="collapse"
  288. data-target="#classes-links"
  289. ></span>
  290. </div>
  291. <ul class="links collapse in"
  292. id="classes-links"
  293. >
  294. <li class="link">
  295. <a href="../classes/TestChatCompletion.html" >TestChatCompletion</a>
  296. </li>
  297. </ul>
  298. </li>
  299. <li class="chapter">
  300. <div class="simple">
  301. <span class="fa fa-long-arrow-down"></span>
  302. <span>Injectables</span>
  303. <span class="menu-toggler fa fa-angle-up" data-toggle="collapse"
  304. data-target="#injectables-links"
  305. ></span>
  306. </div>
  307. <ul class="links collapse in"
  308. id="injectables-links"
  309. >
  310. <li class="link">
  311. <a href="../injectables/DataServiceService.html" >DataServiceService</a>
  312. </li>
  313. </ul>
  314. </li>
  315. <li class="chapter">
  316. <div class="simple">
  317. <span class="fa fa-info"></span>
  318. <span>Interfaces</span>
  319. <span class="menu-toggler fa fa-angle-up" data-toggle="collapse"
  320. data-target="#interfaces-links"
  321. ></span>
  322. </div>
  323. <ul class="links collapse in"
  324. id="interfaces-links"
  325. >
  326. <li class="link">
  327. <a href="../interfaces/TestChatMessage.html" >TestChatMessage</a>
  328. </li>
  329. </ul>
  330. </li>
  331. <li class="chapter">
  332. <div class="simple">
  333. <span class="fa fa-plus"></span>
  334. <span>Pipes</span>
  335. <span class="menu-toggler fa fa-angle-up" data-toggle="collapse"
  336. data-target="#pipes-links"
  337. ></span>
  338. </div>
  339. <ul class="links collapse in"
  340. id="pipes-links"
  341. >
  342. <li class="link">
  343. <a href="../pipes/TokPipe.html" >TokPipe</a>
  344. </li>
  345. </ul>
  346. </li>
  347. <li class="chapter">
  348. <a data-type="chapter-link" href="../coverage.html" ><span class="fa fa-tasks"></span>Documentation coverage</a>
  349. </li>
  350. <li class="divider"></li>
  351. <li class="copyright">
  352. Documentation generated using <a href="https://compodoc.github.io/compodoc/" target="_blank">
  353. <img src="..//images/compodoc-vectorise.svg" class="img-responsive">
  354. </a>
  355. </li>
  356. </ul>
  357. </nav>
  358. </div>
  359. <div class="content component">
  360. <div class="content-data">
  361. <ol class="breadcrumb">
  362. <li>Components</li>
  363. <li>HomeComponent</li>
  364. </ol>
  365. <ul class="nav nav-tabs" role="tablist">
  366. <li class="active">
  367. <a href="#infos" id="infos-tab" role="tab" data-toggle="tab">Infos</a>
  368. </li>
  369. <li>
  370. <a href="#source" role="tab" id="source-tab" data-toggle="tab">Source</a>
  371. </li>
  372. </ul>
  373. <div class="tab-content">
  374. <div class="tab-pane fade active in" id="infos"><p class="comment">
  375. <h3>File</h3>
  376. </p>
  377. <p class="comment">
  378. <code>src/modules/lesson/home/home.component.ts</code>
  379. </p>
  380. <section>
  381. <h3>Metadata</h3>
  382. <table class="table table-sm table-hover">
  383. <tbody>
  384. <tr>
  385. <td class="col-md-3">selector</td>
  386. <td class="col-md-9"><code>app-home</code></td>
  387. </tr>
  388. <tr>
  389. <td class="col-md-3">styleUrls</td>
  390. <td class="col-md-9"><code>home.component.scss</code></td>
  391. </tr>
  392. <tr>
  393. <td class="col-md-3">templateUrl</td>
  394. <td class="col-md-9"><code>home.component.html</code></td>
  395. </tr>
  396. </tbody>
  397. </table>
  398. </section>
  399. <section>
  400. <h3 id="constructor">Constructor</h3>
  401. <table class="table table-sm table-bordered">
  402. <tbody>
  403. <tr>
  404. <td class="col-md-4">
  405. <code>constructor(formBuilder: <a href="https://angular.io/docs/ts/latest/api/forms/index/FormBuilder-class.html" target="_blank" >FormBuilder</a>, alertController: AlertController)</code>
  406. </td>
  407. </tr>
  408. </tbody>
  409. </table>
  410. </section>
  411. <section>
  412. <h3 id="methods">Methods</h3>
  413. <table class="table table-sm table-bordered">
  414. <tbody>
  415. <tr>
  416. <td class="col-md-4">
  417. <b><span class="modifier"></span> isNewDay</b>
  418. </td>
  419. </tr>
  420. <tr>
  421. <td class="col-md-4">
  422. <span class="modifier-icon method fa fa-play ">
  423. <span class="fa fa-"></span>
  424. </span>
  425. <code>isNewDay()</code>
  426. </td>
  427. </tr>
  428. <tr>
  429. <td class="col-md-4">
  430. <div class="io-description">
  431. <b>Returns: </b> <code>any</code>
  432. </div>
  433. </td>
  434. </tr>
  435. </tbody>
  436. </table>
  437. <table class="table table-sm table-bordered">
  438. <tbody>
  439. <tr>
  440. <td class="col-md-4">
  441. <b><span class="modifier"></span> getProfilePointer</b>
  442. </td>
  443. </tr>
  444. <tr>
  445. <td class="col-md-4">
  446. <span class="modifier-icon method fa fa-play ">
  447. <span class="fa fa-"></span>
  448. </span>
  449. <code>getProfilePointer()</code>
  450. </td>
  451. </tr>
  452. <tr>
  453. <td class="col-md-4">
  454. <div class="io-description">
  455. <b>Returns: </b> <code>void</code>
  456. </div>
  457. </td>
  458. </tr>
  459. </tbody>
  460. </table>
  461. <table class="table table-sm table-bordered">
  462. <tbody>
  463. <tr>
  464. <td class="col-md-4">
  465. <b><span class="modifier"></span> upload</b>
  466. </td>
  467. </tr>
  468. <tr>
  469. <td class="col-md-4">
  470. <span class="modifier-icon method fa fa-play ">
  471. <span class="fa fa-"></span>
  472. </span>
  473. <code>upload()</code>
  474. </td>
  475. </tr>
  476. <tr>
  477. <td class="col-md-4">
  478. <div class="io-description">
  479. <b>Returns: </b> <code>void</code>
  480. </div>
  481. </td>
  482. </tr>
  483. </tbody>
  484. </table>
  485. <table class="table table-sm table-bordered">
  486. <tbody>
  487. <tr>
  488. <td class="col-md-4">
  489. <b><span class="modifier"></span> Eatupload</b>
  490. </td>
  491. </tr>
  492. <tr>
  493. <td class="col-md-4">
  494. <span class="modifier-icon method fa fa-play ">
  495. <span class="fa fa-"></span>
  496. </span>
  497. <code>Eatupload()</code>
  498. </td>
  499. </tr>
  500. <tr>
  501. <td class="col-md-4">
  502. <div class="io-description">
  503. <b>Returns: </b> <code>void</code>
  504. </div>
  505. </td>
  506. </tr>
  507. </tbody>
  508. </table>
  509. <table class="table table-sm table-bordered">
  510. <tbody>
  511. <tr>
  512. <td class="col-md-4">
  513. <b><span class="modifier"></span> getLastUploadTime</b>
  514. </td>
  515. </tr>
  516. <tr>
  517. <td class="col-md-4">
  518. <span class="modifier-icon method fa fa-play ">
  519. <span class="fa fa-"></span>
  520. </span>
  521. <code>getLastUploadTime()</code>
  522. </td>
  523. </tr>
  524. <tr>
  525. <td class="col-md-4">
  526. <div class="io-description">
  527. <b>Returns: </b> <code>any</code>
  528. </div>
  529. </td>
  530. </tr>
  531. </tbody>
  532. </table>
  533. <table class="table table-sm table-bordered">
  534. <tbody>
  535. <tr>
  536. <td class="col-md-4">
  537. <b><span class="modifier"></span> presentAlert</b>
  538. </td>
  539. </tr>
  540. <tr>
  541. <td class="col-md-4">
  542. <span class="modifier-icon method fa fa-play ">
  543. <span class="fa fa-"></span>
  544. </span>
  545. <code>presentAlert()</code>
  546. </td>
  547. </tr>
  548. <tr>
  549. <td class="col-md-4">
  550. <div class="io-description">
  551. <b>Returns: </b> <code>void</code>
  552. </div>
  553. </td>
  554. </tr>
  555. </tbody>
  556. </table>
  557. <table class="table table-sm table-bordered">
  558. <tbody>
  559. <tr>
  560. <td class="col-md-4">
  561. <b><span class="modifier"></span> initializeHighlightedDates</b>
  562. </td>
  563. </tr>
  564. <tr>
  565. <td class="col-md-4">
  566. <span class="modifier-icon method fa fa-play ">
  567. <span class="fa fa-"></span>
  568. </span>
  569. <code>initializeHighlightedDates()</code>
  570. </td>
  571. </tr>
  572. <tr>
  573. <td class="col-md-4">
  574. <div class="io-description">
  575. <b>Returns: </b> <code>void</code>
  576. </div>
  577. </td>
  578. </tr>
  579. </tbody>
  580. </table>
  581. <table class="table table-sm table-bordered">
  582. <tbody>
  583. <tr>
  584. <td class="col-md-4">
  585. <b><span class="modifier"></span> getDate</b>
  586. </td>
  587. </tr>
  588. <tr>
  589. <td class="col-md-4">
  590. <span class="modifier-icon method fa fa-play ">
  591. <span class="fa fa-"></span>
  592. </span>
  593. <code>getDate()</code>
  594. </td>
  595. </tr>
  596. <tr>
  597. <td class="col-md-4">
  598. <div class="io-description">
  599. <b>Returns: </b> <code>any</code>
  600. </div>
  601. </td>
  602. </tr>
  603. </tbody>
  604. </table>
  605. </section>
  606. <section>
  607. <h3 id="inputs">Properties</h3>
  608. <table class="table table-sm table-bordered">
  609. <tbody>
  610. <tr>
  611. <td class="col-md-4">
  612. <b> alertButtons</b>
  613. </td>
  614. </tr>
  615. <tr>
  616. <td class="col-md-4">
  617. <code>alertButtons: <code>string[]</code>
  618. </bcode>
  619. </td>
  620. </tr>
  621. </tbody>
  622. </table>
  623. <table class="table table-sm table-bordered">
  624. <tbody>
  625. <tr>
  626. <td class="col-md-4">
  627. <b> date</b>
  628. </td>
  629. </tr>
  630. <tr>
  631. <td class="col-md-4">
  632. <code>date: <code>any</code>
  633. </bcode>
  634. </td>
  635. </tr>
  636. </tbody>
  637. </table>
  638. <table class="table table-sm table-bordered">
  639. <tbody>
  640. <tr>
  641. <td class="col-md-4">
  642. <b> food</b>
  643. </td>
  644. </tr>
  645. <tr>
  646. <td class="col-md-4">
  647. <code>food: <code>string</code>
  648. </bcode>
  649. </td>
  650. </tr>
  651. </tbody>
  652. </table>
  653. <table class="table table-sm table-bordered">
  654. <tbody>
  655. <tr>
  656. <td class="col-md-4">
  657. <b> height</b>
  658. </td>
  659. </tr>
  660. <tr>
  661. <td class="col-md-4">
  662. <code>height: <code>number</code>
  663. </bcode>
  664. </td>
  665. </tr>
  666. </tbody>
  667. </table>
  668. <table class="table table-sm table-bordered">
  669. <tbody>
  670. <tr>
  671. <td class="col-md-4">
  672. <b> highlightedDates</b>
  673. </td>
  674. </tr>
  675. <tr>
  676. <td class="col-md-4">
  677. <code>highlightedDates: <code>{ date: string; textColor: string; backgroundColor: string; }[]</code>
  678. </bcode>
  679. </td>
  680. </tr>
  681. </tbody>
  682. </table>
  683. <table class="table table-sm table-bordered">
  684. <tbody>
  685. <tr>
  686. <td class="col-md-4">
  687. <b> lastUploadDate</b>
  688. </td>
  689. </tr>
  690. <tr>
  691. <td class="col-md-4">
  692. <code>lastUploadDate: <code>any</code>
  693. </bcode>
  694. </td>
  695. </tr>
  696. </tbody>
  697. </table>
  698. <table class="table table-sm table-bordered">
  699. <tbody>
  700. <tr>
  701. <td class="col-md-4">
  702. <b> myForm</b>
  703. </td>
  704. </tr>
  705. <tr>
  706. <td class="col-md-4">
  707. <code>myForm: <code>any</code>
  708. </bcode>
  709. </td>
  710. </tr>
  711. </tbody>
  712. </table>
  713. <table class="table table-sm table-bordered">
  714. <tbody>
  715. <tr>
  716. <td class="col-md-4">
  717. <b> title</b>
  718. </td>
  719. </tr>
  720. <tr>
  721. <td class="col-md-4">
  722. <code>title: <code>string</code>
  723. </bcode>
  724. </td>
  725. </tr>
  726. <tr>
  727. <td class="col-md-4">
  728. <i>Default value: </i><code>app-angular</code>
  729. </td>
  730. </tr>
  731. </tbody>
  732. </table>
  733. <table class="table table-sm table-bordered">
  734. <tbody>
  735. <tr>
  736. <td class="col-md-4">
  737. <b> today</b>
  738. </td>
  739. </tr>
  740. <tr>
  741. <td class="col-md-4">
  742. <code>today: <code>Date</code>
  743. </bcode>
  744. </td>
  745. </tr>
  746. </tbody>
  747. </table>
  748. <table class="table table-sm table-bordered">
  749. <tbody>
  750. <tr>
  751. <td class="col-md-4">
  752. <b> weight</b>
  753. </td>
  754. </tr>
  755. <tr>
  756. <td class="col-md-4">
  757. <code>weight: <code>number</code>
  758. </bcode>
  759. </td>
  760. </tr>
  761. </tbody>
  762. </table>
  763. </section>
  764. </div>
  765. <div class="tab-pane fade tab-source-code" id="source">
  766. <pre><code class="hljs javascript">import { Component, OnInit } from &#x27;@angular/core&#x27;;
  767. import { FormBuilder, FormGroup, Validators } from &#x27;@angular/forms&#x27;;
  768. import { AlertController } from &#x27;@ionic/angular&#x27;;
  769. import * as Parse from &quot;parse&quot;
  770. (Parse as any).serverURL &#x3D; &quot;http://metapunk.cn:9999/parse&quot;
  771. Parse.initialize(&quot;dev&quot;)
  772. @Component({
  773. selector: &#x27;app-home&#x27;,
  774. templateUrl: &#x27;./home.component.html&#x27;,
  775. styleUrls: [&#x27;./home.component.scss&#x27;]
  776. })
  777. export class HomeComponent implements OnInit {
  778. alertButtons &#x3D; [&#x27;好的&#x27;];
  779. myForm: any;
  780. ngOnInit() {
  781. this.myForm &#x3D; this.formBuilder.group({
  782. height: [&#x27;&#x27;, Validators.required],
  783. weight: [&#x27;&#x27;, Validators.required]
  784. });
  785. }
  786. title &#x3D; &#x27;app-angular&#x27;;
  787. height: number | null &#x3D; null;
  788. weight: number | null &#x3D; null;
  789. food: string | null &#x3D; null;
  790. today: Date &#x3D; new Date();
  791. lastUploadDate: Promise&lt;Date | null&gt; &#x3D; this.getLastUploadTime();
  792. async isNewDay(): Promise&lt;boolean&gt; {
  793. const currentDate &#x3D; new Date();
  794. const lastUploadDate &#x3D; await this.lastUploadDate;
  795. return (
  796. lastUploadDate &#x3D;&#x3D;&#x3D; null ||
  797. currentDate.getDate() !&#x3D;&#x3D; lastUploadDate.getDate() ||
  798. currentDate.getMonth() !&#x3D;&#x3D; lastUploadDate.getMonth() ||
  799. currentDate.getFullYear() !&#x3D;&#x3D; lastUploadDate.getFullYear()
  800. );
  801. }
  802. async getProfilePointer() {
  803. // 定义要查询的profileId
  804. const profileId &#x3D; &quot;肖宇杰&quot;;
  805. // 创建查询对象
  806. const Profile &#x3D; Parse.Object.extend(&quot;Profile&quot;);
  807. const query &#x3D; new Parse.Query(Profile);
  808. // 设置查询条件
  809. query.equalTo(&quot;name&quot;, profileId);
  810. try {
  811. // 执行查询
  812. const result &#x3D; await query.first();
  813. if (result) {
  814. // 查询成功,result为查询到的行对象
  815. const profilePointer &#x3D; {
  816. __type: &quot;Pointer&quot;,
  817. className: &quot;Profile&quot;,
  818. objectId: result.id
  819. };
  820. console.log(&quot;指向Profile表中name为profileId的行的指针:&quot;, profilePointer);
  821. return profilePointer;
  822. } else {
  823. // 没有找到匹配的行
  824. console.log(&quot;找不到匹配的行&quot;);
  825. return null;
  826. }
  827. } catch (error) {
  828. // 查询出错
  829. console.log(&quot;查询出错:&quot;, error);
  830. return null;
  831. }
  832. }
  833. async upload() {
  834. // await this.isNewDay()
  835. if (true) {
  836. if (this.height &amp;&amp; this.weight) { // 添加验证条件
  837. // 在这里编写上传逻辑
  838. let YourClass &#x3D; Parse.Object.extend(&quot;HealthData&quot;);
  839. let yourObject &#x3D; new YourClass();
  840. yourObject.set(&quot;profile&quot;, await this.getProfilePointer());
  841. yourObject.set({ &quot;height&quot;: this.height, &quot;weight&quot;: this.weight });
  842. yourObject.save().then((result: any) &#x3D;&gt; {
  843. console.log(&quot;数据上传成功&quot;, result);
  844. this.height &#x3D; null;
  845. this.weight &#x3D; null;
  846. }).catch((error: any) &#x3D;&gt; {
  847. console.error(&quot;数据上传失败&quot;, error);
  848. });
  849. this.lastUploadDate &#x3D; Promise.resolve(this.today);
  850. } else {
  851. console.log(&quot;身高或体重为空&quot;);
  852. }
  853. } else {
  854. console.log(&quot;今天已经上传过了&quot;);
  855. this.height &#x3D; null;
  856. this.weight &#x3D; null;
  857. }
  858. }
  859. async Eatupload() {
  860. if (!this.food) {
  861. // 显示错误消息或执行其他操作
  862. console.log(&quot;请输入食物&quot;);
  863. return;
  864. }
  865. let YourClass &#x3D; Parse.Object.extend(&quot;HealthEat&quot;);
  866. let yourObject &#x3D; new YourClass();
  867. yourObject.set({ &quot;food&quot;: this.food, });
  868. yourObject.save().then((result: any) &#x3D;&gt; {
  869. console.log(&quot;数据上传成功&quot;, result);
  870. this.food &#x3D; &quot;&quot;
  871. }).catch((error: any) &#x3D;&gt; {
  872. console.error(&quot;数据上传失败&quot;, error);
  873. });
  874. }
  875. async getLastUploadTime(): Promise&lt;Date | null&gt; {
  876. const Upload &#x3D; Parse.Object.extend(&quot;HealthData&quot;);
  877. const query &#x3D; new Parse.Query(Upload);
  878. query.descending(&quot;createdAt&quot;);
  879. try {
  880. const result &#x3D; await query.first();
  881. if (result) {
  882. const lastUploadTime &#x3D; result.get(&quot;createdAt&quot;);
  883. console.log(&quot;最后一次上传时间:&quot;, lastUploadTime);
  884. return lastUploadTime;
  885. } else {
  886. return null;
  887. }
  888. } catch (error) {
  889. console.error(&quot;Error:&quot;, error);
  890. return null;
  891. }
  892. }
  893. date: Promise&lt;string[] | null&gt; &#x3D; this.getDate();
  894. highlightedDates: { date: string | null, textColor: string, backgroundColor: string }[] &#x3D; [];
  895. constructor(private formBuilder: FormBuilder, private alertController: AlertController) {
  896. this.initializeHighlightedDates();
  897. myForm: FormGroup;
  898. }
  899. async presentAlert() {
  900. const alert &#x3D; await this.alertController.create({
  901. message: &#x27;上传成功&#x27;,
  902. buttons: [&#x27;OK&#x27;],
  903. });
  904. await alert.present();
  905. }
  906. async initializeHighlightedDates() {
  907. const dates &#x3D; await this.date;
  908. if (dates &amp;&amp; dates.length &gt; 0) {
  909. this.highlightedDates &#x3D; dates.map(date &#x3D;&gt; ({
  910. date,
  911. textColor: &#x27;#09721b&#x27;,
  912. backgroundColor: &#x27;#c8e5d0&#x27;,
  913. }));
  914. }
  915. }
  916. async getDate(): Promise&lt;string[] | null&gt; {
  917. const Upload &#x3D; Parse.Object.extend(&quot;HealthData&quot;);
  918. const query &#x3D; new Parse.Query(Upload);
  919. query.descending(&quot;createdAt&quot;);
  920. try {
  921. const result &#x3D; await query.find();
  922. if (result.length &gt; 0) {
  923. const Dates &#x3D; result.map((result) &#x3D;&gt; {
  924. const date &#x3D; result.get(&quot;createdAt&quot;);
  925. return date.toISOString().split(&#x27;T&#x27;)[0];
  926. }).reverse();
  927. console.log(&quot;日期数组&quot;, Dates);
  928. return Dates;
  929. } else {
  930. return null;
  931. }
  932. } catch (error) {
  933. console.error(&quot;Error:&quot;, error);
  934. return null;
  935. }
  936. }
  937. }
  938. </code></pre>
  939. </div>
  940. </div>
  941. </div><div class="search-results">
  942. <div class="has-results">
  943. <h1 class="search-results-title"><span class='search-results-count'></span> results matching "<span class='search-query'></span>"</h1>
  944. <ul class="search-results-list"></ul>
  945. </div>
  946. <div class="no-results">
  947. <h1 class="search-results-title">No results matching "<span class='search-query'></span>"</h1>
  948. </div>
  949. </div>
  950. </div>
  951. </div>
  952. </div>
  953. <script src="../js/libs/bootstrap-native.js"></script>
  954. <script src="../js/libs/es6-shim.min.js"></script>
  955. <script src="../js/libs/EventDispatcher.js"></script>
  956. <script src="../js/libs/promise.min.js"></script>
  957. <script src="../js/libs/zepto.min.js"></script>
  958. <script src="../js/compodoc.js"></script>
  959. <script src="../js/search/search.js"></script>
  960. <script src="../js/search/lunr.min.js"></script>
  961. <script src="../js/search/search-lunr.js"></script>
  962. <script src="../js/menu.js"></script>
  963. <script src="../js/libs/highlight.pack.js"></script>
  964. <script src="../js/libs/highlightjs-line-numbers.min.js"></script>
  965. <script src="../js/search/search_index.js"></script>
  966. <script>
  967. document.addEventListener('DOMContentLoaded', function() {
  968. hljs.initHighlightingOnLoad();
  969. hljs.initLineNumbersOnLoad();
  970. });
  971. </script>
  972. </body>
  973. </html>