Home  >  Article  >  WeChat Applet  >  WeChat Mini Program Development (5) Detailed explanation of the "Me" page of the business card box

WeChat Mini Program Development (5) Detailed explanation of the "Me" page of the business card box

零下一度
零下一度Original
2017-05-23 13:29:153215browse

The user has multiple business cards and needs to switch left and right to view them. Switching down is the menu button. Here we need to slide in two places. We use the sliding component swiper provided by WeChat and use it in a nested manner. The first layer is the up and down sliding of the business card display and the menu button. The second layer is the left and right sliding of the business card display (supports mutual embedding. It can be used as a set, so you can use it with confidence).

WeChat Mini Program Development (5) Detailed explanation of the

Vertical Adding it means sliding vertically, removing it means sliding left and right. The overall structure is as follows:

WeChat Mini Program Development (5) Detailed explanation of the

The click event is bound to the data switching method because it needs to support multiple click switching.

WeChat Mini Program Development (5) Detailed explanation of the

The initialization data is nextSlide:

WeChat Mini Program Development (5) Detailed explanation of the

Look again nextSlide event. currentSlide is the index of the current page. Changing it can complete the switching effect. You can see in the figure above that cs is set to 0 when initializing the data.

WeChat Mini Program Development (5) Detailed explanation of the

So assign the current data.cs+1, and then switch the bound click event clickNext to nextSlideAgain.

WeChat Mini Program Development (5) Detailed explanation of the

Look at the nextSlideAgain event again, subtracting 1 index to achieve the switching effect of multiple clicks.

WeChat Mini Program Development (5) Detailed explanation of the

The specific effect can be seen. Click on the personal business card to enter the editing business card page. Since parameters are required, wx.navgateTo is used.

WeChat Mini Program Development (5) Detailed explanation of the

You can see the effect:

WeChat Mini Program Development (5) Detailed explanation of the


WeChat Mini Program Development (5) Detailed explanation of the


Finally some interesting information:
Someone noticed this when we sent out the first tutorial , how to do real data interaction, you can learn about it below.
The first step is MD5 encryption, requster interaction layer.

WeChat Mini Program Development (5) Detailed explanation of the

How to quote MD5.js? Of course it is modular require, don’t forget to module.exports the referenced js.
The following is requester.js referencing MD5.js.
ApplicationRoot is the server address (check the AppID and AppSecret on the development settings page when configuring the server, and configure the server domain name).

WeChat Mini Program Development (5) Detailed explanation of the

Require.js Here module.exports exposes methods. .

WeChat Mini Program Development (5) Detailed explanation of the

At this time, require.js is introduced in the global app.js and mapped to the global global. This global is global.

WeChat Mini Program Development (5) Detailed explanation of the

If the page needs that page, just accept it directly. Is modularity very useful?

WeChat Mini Program Development (5) Detailed explanation of the

You can take a complete look at the implementation of a request for data interaction with the background as follows:
Figure 1 is the encapsulation in requester.js .
Figure 2 shows the page rendering that needs to call data.

WeChat Mini Program Development (5) Detailed explanation of the

WeChat Mini Program Development (5) Detailed explanation of the

If you have any questions, please give us some advice. Some known questions will be explained in the next chapter. .
There should be some people who like the sublime editor. Someone asked how to switch the highlight. Just switch to html in the lower right corner of your page.

WeChat Mini Program Development (5) Detailed explanation of the

【related suggestion】

1. Complete source code download of WeChat mini program

2. WeChat mini program demo: Kaka Auto

3. Simple left swipe operation and waterfall flow layout

The above is the detailed content of WeChat Mini Program Development (5) Detailed explanation of the "Me" page of the business card box. For more information, please follow other related articles on the PHP Chinese website!

Statement:
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn