Water Ordering Mall Practical Tutorial 08-Carousel Picture

We have developed store information display and search functions on the homepage, and then we need to display carousel images. The carousel image needs to be stored in the data source, and when you click on the image, you need to access the official account's article.

1 Create a data source

First create a data source to store the carousel chart, open the console, click on the data model, click the + sign to create a new one
Insert image description here
Enter the name of the data source for the carousel chart
Insert image description here
Click Edit and add fields
Insert image description here
Add the first field image, select the type image
Insert image description here
Add the second field, official account article link, type Select URL
Insert image description here
Add a third field, whether to enable it, select Boolean as type
Insert image description here

2 carousel container

Add a carousel container to the page
Insert image description here
Then click the + sign in the code area to create a variable
Insert image description here
Select New Data Table Query< a i=3> Select the carousel image in the data table Query whether the condition setting is enabled equal to true Then bind the address to the image
Insert image description here

Insert image description here

Insert image description here

Insert image description here

$w.swaperlist.data.records[0].tp

Bind the second and third pictures as above

3 Create article details page

When we click on the picture, we need to open the official account article. We need to create a new page, click the new icon on the page
Insert image description here
and put it into the web page nested component
Insert image description here
Select the page component and create a new URL parameter
Insert image description here
Enter the parameter name URL
Insert image description here
Then nest and bind the URL parameter to the web page
Insert image description here
to the image The component is bound to the click event, select the open page, select the article details page
Insert image description here
The url is bound to our swapperlist's gzhwzlj
Insert image description here

$w.swaperlist.data.records[0].gzhwzlj

4 Set permissions

The default data source setting allows only the person to read and write. For public-facing data, we changed it to be available to everyone.
Insert image description here

Summarize

In this article, we introduced the use of the carousel component. The configuration of the carousel component is relatively simple. The main thing is to call the web page nested component to display the official account article when clicking on the image to jump, which involves the issue of page parameter transfer.

Guess you like

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