Micro letter applet page event - pull down to refresh, the Raja upload more

1. The pull-down refresh concepts and application scenarios.

Concept: drop-down list to refresh the mobile client update data interactions, user by sliding your finger on the screen the child down, and can trigger pull down to refresh the page, update the list data.

Scenario: In the mobile terminal, data lists are common results page, the update page list data is the most basic needs, compared to the Refresh button, regularly updated, the pull-down refresh convenient and friendly user experience, has become a mobile terminal to refresh the list the best solution for the data.

 

Small micro-channel pull-down refresh program starts:

In two ways:

1. The need to open the configuration page or enablePullDownRefresh in app.json of window options, but, in general, it is recommended to open a separate pull-down refresh behavior for the desired page in the page configuration.

2. Can () is triggered by the drop-down refresh wx.startPullDownRefresh, after calling the drop-down refresh trigger animations, effects and consistent user manual pull-down refresh.

 

Configuration pull-down pattern refresh the window:

You need to modify or page configuration options app.json backbroundColor and backgroundTextStyle of window options.

backgroundColor: used to configure the drop-down refresh the window's background color, only supports hexadecimal color value.

backgroundTextStyle to refresh loading configuration drop-down style, only support dark and light

onPullDownRefresh: page-related event handler - pull-down operation executed when a user listens
 
Stop the drop-down refresh effect:
When the pull-down processing Wan refresh, refresh loading the pull-down effect it will always show that the initiative will not disappear, you need to manually hide the drop-down refresh loading effect, at this time, jump with wx.stopPullDownRefresh () can stop the pull-down refresh the current page.
 

On Raja upload more
1. Raja upload more on the concept and application scenarios.
The concept: a mobile terminal, with the continued slide your finger up, when the content will reach the bottom of the screen, the page will load will continue to follow content, knowing nothing new position, we call on Raja upload more, the pull the essence is to load more pages to load data.
Scenario: In the mobile terminal, paging load list data, the preferred implementation is on Raja upload more.
 
Configuration from the pull-bottom:
Or you can set the bottom of the page configuration options on app.json the window unit from onReachBottomDistance px, defaults bottomed distance of 50px.
 
Pull bottoming event on the listener: onReachBottom () function, the user can listen to pull bottoming events on the current page, so as to achieve the effect on the list Raja upload more data.
 
 

 

 

 

Guess you like

Origin www.cnblogs.com/liea/p/11802636.html