Practical Development Tutorial of Gas Station Membership Management Mini Program 14 Membership Recharge

In the previous article, we introduced the business of membership card opening, which is to create membership card information. After we have the membership card information, we can recharge the members. Of course, the recharge business is initiated by members independently.

According to our product prototype, we display all the card information of the current member in the form of a carousel on my page. The membership card information needs to be read from the data source using variables first. When reading, we need to filter the data according to the openid of the current member.

1 Define membership card variables

Open our application, click Variables, and create a new object variable

insert image description here
Click on New Variable

insert image description here
We named the variable cardlist to represent member information

insert image description here
It should be noted here that we need to filter the data according to the openid of the current user. If you do not fill in the query conditions, all the membership card information will be queried, which is inconsistent with our actual business rules.

It should be noted here that if you set the filter conditions directly, you cannot pass in variables, you can only set constant conditions

insert image description here
Beginners may not be very clear about constants and variables. Constants and variables refer to the types of variables. If your variable does not change its value after definition, we can define it as a constant.

In the low-code method, we define constants using the const keyword,

Guess you like

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