The poster recently became a daddy, and he is often troubled by breastfeeding problems. The existing app records that you need to open the application first and then find the corresponding functions, which is a bit cumbersome, so he developed a breastfeeding card application for

2025/09/2121:38:37 baby 1758

The owner of the floor recently became a dad, and he is often troubled by breastfeeding problems. The existing app records that you need to open the application first and then find the corresponding function, which is a bit cumbersome, so he developed a breastfeeding card application for daily use.

The poster recently became a daddy, and he is often troubled by breastfeeding problems. The existing app records that you need to open the application first and then find the corresponding functions, which is a bit cumbersome, so he developed a breastfeeding card application for  - DayDayNews

This application is developed using the API8 version of JS UI components, and its functions still have many defects, which will be briefly described later.

effect display:

The poster recently became a daddy, and he is often troubled by breastfeeding problems. The existing app records that you need to open the application first and then find the corresponding functions, which is a bit cumbersome, so he developed a breastfeeding card application for  - DayDayNews

Slide

The poster recently became a daddy, and he is often troubled by breastfeeding problems. The existing app records that you need to open the application first and then find the corresponding functions, which is a bit cumbersome, so he developed a breastfeeding card application for  - DayDayNews

The poster recently became a daddy, and he is often troubled by breastfeeding problems. The existing app records that you need to open the application first and then find the corresponding functions, which is a bit cumbersome, so he developed a breastfeeding card application for  - DayDayNews

card details

The poster recently became a daddy, and he is often troubled by breastfeeding problems. The existing app records that you need to open the application first and then find the corresponding functions, which is a bit cumbersome, so he developed a breastfeeding card application for  - DayDayNews

Homepage

Through the above effect diagram, we can see that two cards were made of data entry and statistical charts.

data record card

When feeding children, we often ask ourselves when he ate milk last time, how much time has he eaten since the last time he ate milk? How much did he eat today? Whether he has defecated today? Is the recent defecation normal, etc.

data record card provides data entry and display of milk consumption and defecation. It can easily and quickly enter the breastfeeding/defecation status and remind you that the last breastfeeding/defecation has passed.

You can see through the card content. The card is simply arranged and combined through text and button components, and the recorded tasks are completed in combination with the corresponding event processing.

statistic card

merely recording data is not enough, it is not enough to visually display the feeding situation on that day, so the statistical card was developed.

statistics card uses the chart component to demonstrate the feeding data on the day, and counts the total amount of milk eaten on the day at the bottom in the form of text.

Homepage

Homepage displays the feeding records of the same day and the defecation records of the same day through two chart components.

PS: The layout code will be briefly introduced in subsequent articles. The only components used are text, div, chart, and button.

Interested friends can try to type on their own first, and the data records are recorded using @ohos.data.storage (lightweight storage). The on("change") event stored in

The poster recently became a daddy, and he is often troubled by breastfeeding problems. The existing app records that you need to open the application first and then find the corresponding functions, which is a bit cumbersome, so he developed a breastfeeding card application for  - DayDayNews during development.

②storage The path to store files is best to obtain the current app path through context. However, the path acquisition is an asynchronous process and does not want to deal with asynchronousness. You can record the path of the storage file during debugging and define it as a constant for use.

inferred path is:

"/data/user/0/{{bundleName}}/files/{{filename}}"; 

storage The put method stored in the store just pushes the content into memory, and also needs to call the flush method to store the data into the file.

④The trigger method was not found in the card serverAbility of API8 onCastToNormal and onVisibilityChange.

is described according to the official document onCastToNormal (the notification interface for the card provider to receive temporary cards to normal cards) but it is not triggered after fixing the card to the screen.

⑤ card does not support active refresh. I tried to use setInterval to actively refresh the card regularly, but it failed. So if you want to make a real-time refresh card, you probably have to return api6's Java to make ServerAbility. The

⑥ Chart component has poor functions, and the three-party library does not have good statistical charts. I hope that there will be a statistical chart as powerful as echart as soon as possible.

baby Category Latest News