search
HomeWeChat AppletMini Program DevelopmentWeChat Mini Program Development (5) Detailed explanation of the 'Me' page of the business card box

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 'Me' page of the business card box

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 'Me' page of the business card box

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 'Me' page of the business card box

The initialization data is nextSlide:

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

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 'Me' page of the business card box

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 'Me' page of the business card box

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 'Me' page of the business card box

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 'Me' page of the business card box

You can see the effect:

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


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 'Me' page of the business card box

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 'Me' page of the business card box

Require.js Here module.exports exposes methods. .

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

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 'Me' page of the business card box

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

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

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 'Me' page of the business card box

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

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 'Me' page of the business card box

【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

Hot AI Tools

Undresser.AI Undress

Undresser.AI Undress

AI-powered app for creating realistic nude photos

AI Clothes Remover

AI Clothes Remover

Online AI tool for removing clothes from photos.

Undress AI Tool

Undress AI Tool

Undress images for free

Clothoff.io

Clothoff.io

AI clothes remover

AI Hentai Generator

AI Hentai Generator

Generate AI Hentai for free.

Hot Article

R.E.P.O. Energy Crystals Explained and What They Do (Yellow Crystal)
3 weeks agoBy尊渡假赌尊渡假赌尊渡假赌
R.E.P.O. Best Graphic Settings
3 weeks agoBy尊渡假赌尊渡假赌尊渡假赌
R.E.P.O. How to Fix Audio if You Can't Hear Anyone
4 weeks agoBy尊渡假赌尊渡假赌尊渡假赌
WWE 2K25: How To Unlock Everything In MyRise
1 months agoBy尊渡假赌尊渡假赌尊渡假赌

Hot Tools

SublimeText3 Mac version

SublimeText3 Mac version

God-level code editing software (SublimeText3)

Safe Exam Browser

Safe Exam Browser

Safe Exam Browser is a secure browser environment for taking online exams securely. This software turns any computer into a secure workstation. It controls access to any utility and prevents students from using unauthorized resources.

MantisBT

MantisBT

Mantis is an easy-to-deploy web-based defect tracking tool designed to aid in product defect tracking. It requires PHP, MySQL and a web server. Check out our demo and hosting services.

SecLists

SecLists

SecLists is the ultimate security tester's companion. It is a collection of various types of lists that are frequently used during security assessments, all in one place. SecLists helps make security testing more efficient and productive by conveniently providing all the lists a security tester might need. List types include usernames, passwords, URLs, fuzzing payloads, sensitive data patterns, web shells, and more. The tester can simply pull this repository onto a new test machine and he will have access to every type of list he needs.

ZendStudio 13.5.1 Mac

ZendStudio 13.5.1 Mac

Powerful PHP integrated development environment