


How to implement the WeChat applet page jump function to jump from the item in the list to the next page
This article mainly introduces the WeChat mini program page jump function and the method of jumping from the item item in the list to the next page. It summarizes and analyzes the WeChat mini program page jump and list item jump based on specific examples. Friends who need relevant operating skills on the page can refer to the following
This article describes the example of the page jump function of the WeChat applet on how to jump from the item in the list to the next page. Share it with everyone for your reference. The details are as follows:
Many projects will have a message record page, that is, a list page. Then click on an item in the list to enter the message details page. Here is the continuation of the previous article. , continue to share how to jump from the item in the list to the next page.
1. Rendering
Move from the list page on the left to the details page on the right
2. Jumping between pages
The first thing to look at is the page jumping. WeChat mini program has three jumping methods. Choice:
1. Keep the current page and jump to a page in the application. Use wx.navigateBack
to return to the original page.
wx.navigateTo({ url: 'test?id=1' })
2. Close the current page and jump to a page within the application.
wx.redirectTo({ url: 'test?id=1' })
3. Jump to the tabBar page and close all other non-tabBar pages
wx.switchTab({ url: '/index' })
Note: wx.navigateBack(OBJECT)
Close the current page and return to the previous page or multi-level page. You can get the current page stack through getCurrentPages())
and decide how many layers need to be returned.
3. Jump from the list item to the next page
The first step is to render the list and use wx:for on the component. By binding the control property to an array, the component can be repeatedly rendered using the data of each item in the array. By default, the subscript variable name of the current item in the array defaults to index, and the variable name of the current item in the array defaults to item
<view wx:for="{{array}}"> {{index}}: {{item.message}} </view>
The second step is to use wx:key Bind identifiers to the items in the list
<view wx:for="{{array}}" wx:key="{{item.viewid}}"> {{index}}: {{item.message}} </view>
The third step is to pass the corresponding parameters to the link corresponding to each item and use navigator navigation on the layout page Component, specify the URL and pass the corresponding parameters for the link corresponding to each item. Just follow the URL with ? and the key value. Multiple parameters are connected with &, for example:
url="../detail/detail?index={{item.viewid}}"
4. Demo source code
{{item.name}}
Page({ data: { words: [{message: '微信小程序',viewid:'1',time:'2017-01-09 8:00:00',money:'hello'}, {message: '微信小程序',viewid:'2',time:'2017-01-09 8:00:00',money:'hello'}, {message: '微信小程序',viewid:'3',time:'2017-01-09 8:00:00',money:'hello'}, {message: '微信小程序',viewid:'4',time:'2017-01-09 8:00:00',money:'hello'}, {message: '微信小程序',viewid:'5',time:'2017-01-09 8:00:00',money:'hello'}, {message: '微信小程序',viewid:'6',time:'2017-01-09 8:00:00',money:'hello'}, {message: '微信小程序',viewid:'7',time:'2017-01-09 8:00:00',money:'hello'}, {message: '微信小程序',viewid:'8',time:'2017-01-09 8:00:00',money:'hello'}, {message: '微信小程序',viewid:'9',time:'2017-01-09 8:00:00',money:'hello'}] } ... })
The above is the entire content of this article. I hope it will be helpful to everyone's study. For more related content, please pay attention to the PHP Chinese website!
Related recommendations:
Implementation of input input and dynamic setting buttons in WeChat Mini Program
Page in WeChat Mini Program Ways of communication between
Introduction to defining global data and function reuse and templates in WeChat mini programs
The above is the detailed content of How to implement the WeChat applet page jump function to jump from the item in the list to the next page. For more information, please follow other related articles on the PHP Chinese website!

Hot AI Tools

Undresser.AI Undress
AI-powered app for creating realistic nude photos

AI Clothes Remover
Online AI tool for removing clothes from photos.

Undress AI Tool
Undress images for free

Clothoff.io
AI clothes remover

Video Face Swap
Swap faces in any video effortlessly with our completely free AI face swap tool!

Hot Article

Hot Tools

Notepad++7.3.1
Easy-to-use and free code editor

SublimeText3 Chinese version
Chinese version, very easy to use

Zend Studio 13.0.1
Powerful PHP integrated development environment

Dreamweaver CS6
Visual web development tools

SublimeText3 Mac version
God-level code editing software (SublimeText3)

Hot Topics



Xianyu's official WeChat mini program has quietly been launched. In the mini program, you can post private messages to communicate with buyers/sellers, view personal information and orders, search for items, etc. If you are curious about what the Xianyu WeChat mini program is called, take a look now. What is the name of the Xianyu WeChat applet? Answer: Xianyu, idle transactions, second-hand sales, valuations and recycling. 1. In the mini program, you can post idle messages, communicate with buyers/sellers via private messages, view personal information and orders, search for specified items, etc.; 2. On the mini program page, there are homepage, nearby, post idle, messages, and mine. 5 functions; 3. If you want to use it, you must activate WeChat payment before you can purchase it;

In iOS 17, Apple added a handy little list feature to the Reminders app to help you when you're out shopping for groceries. Read on to learn how to use it and shorten your trip to the store. When you create a list using the new "Grocery" list type (named "Shopping" outside the US), you can enter a variety of food and groceries and have them automatically organized by category. This organization makes it easier to find what you need at the grocery store or while out shopping. Category types available in alerts include Produce, Bread & Cereals, Frozen Foods, Snacks & Candy, Meat, Dairy, Eggs & Cheese, Baked Goods, Baked Goods, Household Products, Personal Care & Wellness, and Wine, Beer & Spirits . The following is created in iOS17

When writing a website or application, you often encounter the need to jump to a specific page. In PHP, we can achieve page jump through several methods. Below I will demonstrate three common jump methods for you, including using the header() function, using JavaScript code, and using meta tags. Using the header() function The header() function is a function used in PHP to send original HTTP header information. This function can be used in combination when implementing page jumps. Below is a

Title: Implementation method of page jump in 3 seconds: PHP Programming Guide In web development, page jump is a common operation. Generally, we use meta tags in HTML or JavaScript methods to jump to pages. However, in some specific cases, we need to perform page jumps on the server side. This article will introduce how to use PHP programming to implement a function that automatically jumps to a specified page within 3 seconds, and will also give specific code examples. The basic principle of page jump using PHP. PHP is a kind of

To implement the drop-down menu effect in WeChat Mini Programs, specific code examples are required. With the popularity of mobile Internet, WeChat Mini Programs have become an important part of Internet development, and more and more people have begun to pay attention to and use WeChat Mini Programs. The development of WeChat mini programs is simpler and faster than traditional APP development, but it also requires mastering certain development skills. In the development of WeChat mini programs, drop-down menus are a common UI component, achieving a better user experience. This article will introduce in detail how to implement the drop-down menu effect in the WeChat applet and provide practical

Implementing picture filter effects in WeChat mini programs With the popularity of social media applications, people are increasingly fond of applying filter effects to photos to enhance the artistic effect and attractiveness of the photos. Picture filter effects can also be implemented in WeChat mini programs, providing users with more interesting and creative photo editing functions. This article will introduce how to implement image filter effects in WeChat mini programs and provide specific code examples. First, we need to use the canvas component in the WeChat applet to load and edit images. The canvas component can be used on the page

Use the WeChat applet to achieve the carousel switching effect. The WeChat applet is a lightweight application that is simple and efficient to develop and use. In WeChat mini programs, it is a common requirement to achieve carousel switching effects. This article will introduce how to use the WeChat applet to achieve the carousel switching effect, and give specific code examples. First, add a carousel component to the page file of the WeChat applet. For example, you can use the <swiper> tag to achieve the switching effect of the carousel. In this component, you can pass b

Methods to close the jump shopping app: 1. Turn off the jump function within the app; 2. Change browser settings; 3. Uninstall updates or reinstall the app. Detailed introduction: 1. Turn off the jump function in the app, open the shopping app, click on the product you want to buy on the homepage or search results page, and after entering the product details page, do not directly click "Buy Now" or similar buttons, but First click the "More" or "Settings" icon in the upper right corner of the page. In the pop-up menu, find "Turn off jump" or a similar option, click it, confirm to turn off the jump function, etc.
