Kindergarten Mini Program Practical Development Tutorial 04


This article is the fourth part of the practical development tutorial for kindergarten small programs. We use three articles to explain the development of the first page and second-level pages. In this section, we continue to develop the subsequent pages.

News Announcement List Page

On the home page, we have realized clicking on the title of the announcement to enter the details page of the article. We also have a function of viewing more that has not been realized. First of all, we will create a list page of the announcement and
insert image description here
open the list page. Our article list can use the data list. Component implementation, add a data list component to the page,
insert image description here
select our notification announcement data source , bind the text content of the first text component to the
insert image description here
title, and bind
insert image description here
insert image description here
the text content of the second text component to the release date
insert image description here
insert image description here
content. After binding, we give Add behavior to common containers and jump to the details page.
insert image description here
insert image description here
When jumping to the details page, we need to pass in the data identifier of the current data and
insert image description here
set it up. After that, we go back to the home page and set behaviors for viewing more common container components, jump to Go to the announcement list page
insert image description here
insert image description here

teaching classroom

In the teaching class, we add a function to click to preview the large image, just open the configuration
insert image description here
insert image description here

Appointment Enrollment List

For the application list page, we also use the data list component for development, first add the data list component to the page,
insert image description here
select the data model to book an appointment,
insert image description here
select the card list for the template, set the number of displayed items to 4
insert image description here
, and then select the picture component to bind the address as a list Image
insert image description here
Keep only one text component, and bind the text content as the title
insert image description here
insert image description here
. Bind the behavior to the outer ordinary container. When jumping to the reservation report details page
insert image description here
, we need to pass in the data identifier. You can create a new page parameter and set The parameter name is id, and the data ID is passed in
insert image description here

Appointment registration details page

When we display data on the details page, we need to define variables first, select model variables for variable types, select query singles for methods, and bind our parameter variables
insert image description here
. First, add a common container to the page, and add a picture component inside
insert image description here
to add a gray color to the common container. Background
insert image description here
Set the width of the image to 100% and the height to 320.
insert image description here
Bind the image address to the list image
insert image description here
in the variable. Add a common container under the image component, and add text and applet sharing components inside.
insert image description here

Set the background color of the normal container to white, a certain padding, and set the layout to flex layout
insert image description here

self {
    
    
    padding: 15px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-direction: row;
    background: rgb(255, 255, 255)
}

Bind the text content as the title in the variable
insert image description here
Set the width of the applet sharing component to 100.
insert image description here
At present, the two ends are not aligned. We need to add a style flex: 1 to the text component.
insert image description here
After the applet is shared, we need to pass in parameters. Binding with expressions
insert image description here

[{
    
    key:"id",value:$page.dataset.params.id}]

Then add a rich text display component and
insert image description here
bind the content field.
insert image description here
Then we implement the button at the bottom, first add a normal container, add two normal containers inside, and set the layout of the parent container to 50% of the width,
insert image description here
set the layout of the parent container to flex layout, and set the positioning to fixed positioning
insert image description here
. Add two icon components to one common container, add button components to the second common container, and set the style
insert image description here

Summarize

In this article, we continue to improve the applet and realize the effect of the page. In the next article, we will explain the functions of making calls, map navigation and submitting information, so stay tuned.

Guess you like

Origin blog.csdn.net/u012877217/article/details/127440445