Page content display method, device, equipment, medium and product
By leveraging the cross-platform capabilities of H5 to display page content, different display effects are triggered based on the user's swipe distance and preset threshold range. This solves the problems of increased development workload and high cost for pull-down menus in mobile apps, achieving cross-platform compatibility and improved user experience.
Patent Information
- Application Number
- CN202510645390.6
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-05-19
- Publication Date
- 2026-11-20
AI Technical Summary
In mobile app applications, the implementation of the second-floor pull-down menu has the problems of increased development workload, high cost, and inconsistent performance, and it cannot achieve cross-platform compatibility.
By using a page content display method based on H5 cross-platform capabilities, different display effects are triggered according to the user's swipe distance and preset distance threshold range, displaying content hidden above the current page.
It achieves cross-platform compatibility with the second-floor dropdown content display, reducing development costs and improving user experience and page content display efficiency.
Smart Images

Figure CN123137544A_ABST
Abstract
Description
Technical Field
[0001] This disclosure relates to the field of computer technology, specifically to methods, apparatus, devices, media, and products for displaying page content. Background Technology
[0002] Currently, in mobile apps, to offer more possibilities for content display, users can pull down to reveal content hidden at the top of the current page. This allows users to access a second layer of content or functions beyond the main interface; this display method is called "pull-down second floor." Through pull-down, developers can display richer and more diverse content on this second floor, thereby increasing user clicks and retention rates, such as promotional videos, featured products, and heartfelt stories. Therefore, improving the user experience when using pull-down gestures has become a pressing issue. Summary of the Invention
[0003] This disclosure provides a method, apparatus, device, medium, and product for displaying page content, which can improve the efficiency of page content display.
[0004] According to a first aspect of this disclosure, a method for displaying page content is provided, comprising: in response to detecting a swipe operation on a terminal screen, determining whether to perform a pull-down operation on the currently displayed page of the terminal screen based on the current swipe distance; in response to determining that a pull-down operation has been performed on the currently displayed page of the terminal screen and the pull-down operation has been completed, determining a target display effect triggered by the pull-down operation based on the current swipe distance and a preset distance threshold range; and displaying the content to be displayed using the target display effect, wherein the content to be displayed is content hidden above the currently displayed page.
[0005] According to a second aspect of this disclosure, a page content display device is provided, including an operation determining module, an effect determining module, and a display module, wherein: the operation determining module is configured to, in response to detecting a swipe operation on a terminal screen, determine whether to perform a pull-down operation on the currently displayed page of the terminal screen based on the current swipe distance; the effect determining module is configured to, in response to determining that a pull-down operation has been performed on the currently displayed page of the terminal screen and the pull-down operation has been completed, determine a target display effect triggered by the pull-down operation based on the current swipe distance and a preset distance threshold range; and the display module is configured to display content to be displayed using the target display effect, wherein the content to be displayed is content hidden above the currently displayed page.
[0006] According to a third aspect of this disclosure, an electronic device is provided, comprising: at least one processor; and a memory communicatively connected to the at least one processor; wherein the memory stores instructions executable by the at least one processor, the instructions being executed by the at least one processor to enable the at least one processor to perform the method provided in the first aspect.
[0007] According to a fourth aspect of this disclosure, a non-transitory computer-readable storage medium is provided storing computer instructions for causing a computer to perform the method provided in the first aspect.
[0008] According to a fifth aspect of this disclosure, a computer program product is provided, including a computer program that, when executed by a processor, implements the method provided according to the first aspect.
[0009] According to the page content display method provided in this disclosure, firstly, in response to detecting a swipe operation on the terminal screen, it is determined whether to perform a pull-down operation on the currently displayed page of the terminal screen based on the current swipe distance; then, in response to determining that a pull-down operation has been performed on the currently displayed page of the terminal screen and the pull-down operation has been completed, the target display effect triggered by the pull-down operation is determined based on the current swipe distance and a preset distance threshold range; finally, the content to be displayed is displayed using the target display effect. This solution triggers different display effects based on the user's pull-down distance on the current page, and displays the second-floor content hidden above the currently displayed page based on the triggered display effect, thereby realizing the display of the second-floor content based on the user's intent, improving the efficiency of page content display, and also enhancing the user experience.
[0010] It should be understood that the description in this section is not intended to identify key or essential features of the embodiments of this disclosure, nor is it intended to limit the scope of this disclosure. Other features of this disclosure will become readily apparent from the following description. Attached Figure Description
[0011] The accompanying drawings are provided to better understand this solution and do not constitute a limitation of this disclosure. Wherein:
[0012] Figure 1 This is an exemplary system architecture diagram of the page content display method that can be applied to this disclosure;
[0013] Figure 2 This is a schematic diagram of one embodiment of a method for displaying page content according to this disclosure;
[0014] Figure 3 This is a schematic diagram of another embodiment of the method for displaying page content according to this disclosure;
[0015] Figure 4This is a schematic diagram of yet another embodiment of the method for displaying page content according to this disclosure;
[0016] Figure 5 This is a timeline diagram illustrating an application scenario of the method for displaying the content of this publicly disclosed page;
[0017] Figure 6 This is a schematic diagram of one embodiment of a page content display device according to the present disclosure;
[0018] Figure 7 This is a block diagram of an electronic device used to implement the page content display method of the embodiments of this disclosure. Detailed Implementation
[0019] The exemplary embodiments of this disclosure are described below with reference to the accompanying drawings, including various details of the embodiments to aid understanding, and should be considered merely exemplary. Therefore, those skilled in the art will recognize that various changes and modifications can be made to the embodiments described herein without departing from the scope and spirit of this disclosure. Similarly, for clarity and brevity, descriptions of well-known functions and structures are omitted in the following description.
[0020] Currently, in mobile apps, to offer more possibilities for content display, users can pull down to reveal content hidden at the top of the current page. This allows access to a second layer of content or functions beyond the main interface; this display method is called "pull-down second floor," and the content hidden at the top of the current page is called "second floor content." In other words, users can access content that was originally hidden at the top of the current page by pulling down.
[0021] Currently, there are two main ways to implement the second-floor pull-down functionality in mobile apps: 1. Native technologies, such as using their respective programming languages (Swift for iOS and Java for Android) and development tools to build native applications for iOS and Android, which are then uploaded to app stores for download; 2. Hybrid development based on Native UI (such as the Weex framework), using a specific compiler to compile Weex into a native application for a specific mobile device. However, using native technologies to implement the second-floor pull-down functionality requires different native technologies for different clients, making it impossible to achieve a single codebase for cross-platform applications, thus significantly increasing the development workload. While using Native UI allows for the use of a single set of code supporting different platforms, developers still need to compile, package, and release for different clients, increasing development costs. Furthermore, there are issues such as inconsistent performance between the two platforms and the app only displaying within one application and not working in other applications.
[0022] This disclosure provides a method for displaying page content, which triggers different display effects based on the user's pull-down distance of the current page, and displays hidden second-floor content according to the triggered display effects. This achieves the display of second-floor content based on the user's intent, improving the efficiency of page content display and enhancing the user experience.
[0023] Furthermore, the page content display method provided in this disclosure is based on the cross-platform capability of H5, which can be compatible with multiple mobile phone systems at the same time, thereby reducing development costs; different applications can use the same set of code, achieving a unified technical solution.
[0024] It should be noted that the acquisition, storage, and application of user personal information involved in the technical solution disclosed herein all comply with the provisions of relevant laws and regulations and do not violate public order and good morals.
[0025] Figure 1 An exemplary system architecture 100 is shown, illustrating an embodiment of a method or apparatus for displaying page content to which this disclosure may be applied.
[0026] like Figure 1 As shown, the system architecture 100 may include a terminal device 101, a network 102, and a server 103. The network 102 is used to provide a communication link between the terminal device 101 and the server 103, and may include various connection types, such as wired communication links, wireless communication links, or fiber optic cables, etc.
[0027] Users can use terminal device 101 to interact with server 103 via network 102 to receive or send information, etc. Various client applications can be installed on terminal device 101, such as social applications, human-computer interaction applications, leisure or entertainment applications, etc.
[0028] Terminal device 101 can be hardware or software. When terminal device 101 is hardware, it can be various electronic devices, including but not limited to smartphones, tablets, laptops, and desktop computers. When terminal device 101 is software, it can be installed in the aforementioned electronic devices. It can be implemented as multiple software programs or software modules, or as a single software program or software module. No specific limitations are made here.
[0029] Server 103 can be either hardware or software. When server 103 is hardware, it can be implemented as a distributed server cluster consisting of multiple servers, or as a single server. When server 103 is software, it can be implemented as multiple software programs or software modules (e.g., used to provide distributed services), or as a single software program or software module. No specific limitations are made here.
[0030] The page content display method provided in this embodiment is generally executed by server 103, and correspondingly, the page content display device is generally set in server 103.
[0031] It should be noted that, Figure 1 The number of terminal devices 101, network 102, and server 103 shown is merely illustrative. Depending on implementation needs, any number of terminal devices 101, network 102, and server 103 can be included.
[0032] Figure 2 A flow 200 illustrating an embodiment of a method for displaying page content according to this disclosure is shown, with reference to Figure 2 As shown, the method for displaying the content of this page includes the following steps:
[0033] Step S201: In response to detecting a swipe operation on the terminal screen, determine whether to perform a pull-down operation on the currently displayed page of the terminal screen based on the current swipe distance.
[0034] In this embodiment of the disclosure, the execution entity of the page content display method (such as...) Figure 1 The server 103 shown will determine whether the user should perform a pull-down operation on the currently displayed page of the terminal screen based on the swiping distance of the user when it detects a swipe operation on the terminal screen.
[0035] Specifically, the execution entity first obtains the initial touch point position (X0, Y0) when the user begins to swipe the screen, and then obtains the current touch point position (X1, Y1) at the current swipe position. Next, it calculates the vertical distance between the current touch point position and the initial touch point position, moveHeight, where moveHeight = Y1 - Y0, and records moveHeight as the current swipe distance. Finally, it determines whether the user performed a pull-down operation on the currently displayed page of the terminal screen based on the swipe distance. For example, if moveHeight > 0, it indicates that the user performed a pull-down operation; if moveHeight < 0, it indicates that the user performed an swipe-up operation.
[0036] Here, the aforementioned execution entity can obtain the user's finger position information on the terminal screen by calling an event listener function. Specifically, after the current page is rendered, the execution entity listens for the user's gesture events through the event listener function. When the user touches the screen, it obtains the initial position of the user's finger on the terminal screen, i.e., the initial touch point position. Then, when the user starts swiping the screen, it obtains the position of the user's finger on the screen after the swipe, i.e., the current touch point position. Based on the current touch point position and the initial touch point position, it determines the swipe distance and, based on the swipe distance, determines whether the user is on the current page displayed on the pull-down screen.
[0037] Step S202: In response to determining that a pull-down operation has been performed on the current display page of the terminal screen and the pull-down operation has been completed, the target display effect triggered by the pull-down operation is determined based on the current swipe distance and the preset distance threshold range.
[0038] In this embodiment of the disclosure, after determining that the user has pulled down the current display page of the terminal screen, the execution subject will also determine whether the pull-down operation has been completed. When the user's finger leaves the terminal screen (i.e., releases the hand), it is determined that the pull-down operation has been completed. At this time, the execution subject will determine the display effect triggered by the pull-down operation, i.e. the target display effect, based on the current sliding distance and the preset distance threshold range.
[0039] In other words, the executing entity determines the triggering of different events based on the distance the user slides down from the moment they touch the screen until they release it. This means different callback functions are triggered based on the varying swipe distances, thus executing the corresponding events. For example, when the swipe distance is small, within the minimum distance threshold range, the swipe operation triggers a bounce effect, resulting in a bounce effect in the target display. When the swipe distance is at one-third of the screen's width, within the middle distance threshold range, the swipe operation triggers both a bounce effect and a refresh effect, again resulting in a bounce effect and a refresh effect in the target display. When the swipe distance exceeds one-half of the screen's width, within the maximum distance threshold range, the swipe operation triggers a full-screen display effect, again resulting in a full-screen display.
[0040] Step S203: Display the content to be displayed using the target display effect.
[0041] In this embodiment of the disclosure, the executing entity displays the content to be displayed using a target display effect. The content to be displayed is content hidden above the currently displayed page. That is, the executing entity displays the content to be displayed according to the target display effect; the content to be displayed is the preset content hidden above the currently displayed page, i.e., the content on the second floor.
[0042] Specifically, when a user pulls down the page, the executing entity will display the second-floor content at a height corresponding to the pull-down distance in the drop-down window. Therefore, when the target display effect is a bounce effect, the executing entity will bounce the displayed second-floor content to an invisible state; when the target display effect is a bounce effect and a refresh effect, the executing entity will bounce the displayed second-floor content to an invisible state and refresh the currently displayed page; when the target display effect is a full-screen display effect, the executing entity will display the second-floor content in full screen, and the second-floor content will automatically pull down from the current release position until it fills the entire screen.
[0043] According to the page content display method provided in this disclosure embodiment, firstly, in response to detecting a swipe operation on the terminal screen, it is determined whether to perform a pull-down operation on the currently displayed page of the terminal screen based on the current swipe distance; then, in response to determining that a pull-down operation has been performed on the currently displayed page of the terminal screen and the pull-down operation has been completed, a target display effect triggered by the pull-down operation is determined based on the current swipe distance and a preset distance threshold range; finally, the content to be displayed is displayed using the target display effect. This solution triggers different display effects based on the user's pull-down distance on the current page, and displays hidden second-floor content based on the triggered display effect, thereby realizing the display of pull-down second-floor content according to the user's intention, improving the efficiency of page content display, and also improving the user experience.
[0044] Furthermore, this solution utilizes React's (a JS library developed by Facebook) JSX (a JavaScript extension) to construct the page's UI (User Interface) layout and the hierarchical relationships between various page elements. The UI layer first displays the page based on the data processed by the data layer. Then, when a listened-up event is triggered, the logic processing layer handles the corresponding event, updating the corresponding page display variables. The view layer renders the dropdown menu based on the height after event processing and executes rendering animations. This execution entity can encapsulate the dropdown menu into a React component library and upload it to a general platform. Developers using the page can obtain the dropdown functionality by importing the component or publish it as an H5 (HyperText Markup Language 5, HTML5) page with dropdown functionality, configuring the dropdown functionality by directly importing the dropdown levels. Therefore, this solution, implementing the dropdown menu as an H5 component, leverages H5's cross-platform capabilities, ensuring compatibility with multiple mobile operating systems, thus reducing development costs; and different applications can use the same code, achieving a unified technical solution.
[0045] Figure 3 A flow 300 illustrating another embodiment of a method for displaying page content according to this disclosure is shown, with reference to Figure 3 As shown, the method for displaying the content of this page includes the following steps:
[0046] Step S301: In response to detecting a swipe operation on the terminal screen, obtain the initial touch point position and the current touch point position of the swipe operation.
[0047] In this embodiment of the disclosure, the execution entity of the page content display method (such as...) Figure 1The server 103 shown will detect a user's swipe operation on the terminal screen and obtain the initial touch point position and the current touch point position. Here, the aforementioned execution entity can obtain the user's finger position information on the terminal screen by calling an event listener function. When the user touches the screen, the initial position of the user's finger on the terminal screen is obtained, i.e., the initial touch point position (X0, Y0). Then, when the user starts swiping the screen, the position of the user's finger on the screen after swiping is obtained in real time, i.e., the current touch point position (X1, Y1).
[0048] Step S302: Determine the current sliding distance as the vertical distance between the current touch point position and the initial touch point position.
[0049] In this embodiment of the disclosure, the executing entity determines the vertical distance between the current touch point position (X1, Y1) and the initial touch point position (X0, Y0) as the current sliding distance moveHeight, that is, moveHeight = Y1 - Y0.
[0050] In step S303, in response to determining that the current swipe distance is greater than zero, a pull-down operation is performed on the currently displayed page of the terminal screen.
[0051] In this embodiment of the disclosure, the execution entity will determine whether moveHeight is greater than 0. If moveHeight>0, it is determined that the user is performing a pull-down operation; if moveHeight<0, it is determined that the user is performing an swipe-up operation.
[0052] This allows us to first determine the user's swipe distance on the current page, and then determine if the swipe distance is greater than zero, thus accurately determining the user's action on the current page.
[0053] In step S304, in response to determining that a pull-down operation has been performed on the current display page of the terminal screen and the pull-down operation has not been completed, the display height of the pull-down display window is determined based on the current swipe distance.
[0054] In this embodiment of the disclosure, after determining that the user has performed a pull-down operation on the current page, the executing entity will further determine whether the pull-down operation has ended. For example, it can determine whether the pull-down operation has been completed by judging whether the user's finger has left the screen. If it is determined that the user's pull-down operation has not been completed, the display height of the pull-down display window is determined based on the current swipe distance. Specifically, the executing entity will determine the pull-down distance as the display height of the pull-down display window.
[0055] Step S305: Determine the target content that corresponds to the display height in the content to be displayed; and display the target content in the drop-down display window.
[0056] In this embodiment of the disclosure, the executing entity determines the target content that corresponds to the display height in the content to be displayed; and displays the target content in the drop-down display window.
[0057] Specifically, developers pre-define the second-floor dropdown content based on business or page design requirements. Then, based on the display height, they determine the corresponding target content from the second-floor content (i.e., the content to be displayed). For example, if the user's dropdown distance is 50px (pixels), then the display height can be determined to be 50px. The aforementioned execution entity will use the content to be displayed that corresponds to 50px as the target content; that is, the target content is the portion of the content to be displayed with a height of 0-50px, and then display the target content in the dropdown display window.
[0058] Since the drop-down operation is a continuous process, the aforementioned execution entity will determine the drop-down distance in real time, that is, determine the display height of the drop-down display window in real time, thereby realizing the dynamic display of the corresponding part of the content to be displayed.
[0059] In some implementations of the embodiments of this disclosure, the above method further includes: determining the display effect corresponding to the target content based on the sliding speed of the sliding operation; and displaying the target content in the drop-down display window, including: displaying the target content in the drop-down display window using the display effect corresponding to the target content.
[0060] Since the drag-and-drop operation is a linear change, the executing entity determines the drag animation effect using a preset algorithm; here, linear interpolation is used. Linear interpolation is the most basic interpolation algorithm. It assumes that the position and speed of intermediate frames have a linear relationship between keyframes. That is, it determines the corresponding display effect based on the user's swipe speed. The swipe speed can be determined by the swipe distance and swipe time. The determined display effect includes the keyframe time, specifically slow swipe, uniform swipe, fast swipe, etc. For example, when the user swipes quickly, the determined display effect can be a fast swipe animation; when the user swipes slowly, the determined display effect can be a slow swipe animation. The formula for linear interpolation is:
[0061] P(t)=(1-t)*P0+t*P1
[0062] Where P(t) is the current position, P0 and P1 are the keyframes of the sliding display process, and t is the time ratio, i.e. the sliding time (0≤t≤1).
[0063] When the display effect is a slow sliding animation, a more accurate interpolation algorithm—Bezier interpolation—can be used to determine the position and occurrence time of intermediate frames. The Bezier interpolation algorithm is as follows:
[0064] P(t)=(1-t) 3*P0+3*(1-t) 2 *t*P1+3*(1-t)*t2*P2+t 3 *P3
[0065] Where P(t) is the current position, P0, P1, P2, and P3 are the keyframes of the sliding display process, and t is the time ratio, i.e. the sliding time (0≤t≤1).
[0066] As can be seen, the Bessel interpolation algorithm can determine more keyframe position and time information.
[0067] This allows the display of pull-down content to be determined based on the user's scrolling speed on the current page, further enhancing the user experience.
[0068] Step S306: In response to determining that a pull-down operation has been performed on the current display page of the terminal screen and the pull-down operation has been completed, the target display effect triggered by the pull-down operation is determined based on the current swipe distance and the preset distance threshold range.
[0069] Step S307: Display the content to be displayed using the target display effect.
[0070] Steps S306-S307 and Figure 2 The steps S202-S203 of the illustrated embodiment are basically the same. For the specific implementation method, please refer to the above description of steps S202-S203, which will not be repeated here.
[0071] from Figure 3 It can be seen from this that, with Figure 2 Compared to the corresponding embodiments, the page content display method in this embodiment first determines whether the user has performed a pull-down operation by the sliding distance. While the user is performing the pull-down operation and the operation is not yet finished, the display height of the pull-down display window is determined by the sliding distance. The content corresponding to the display height of the content to be displayed is then displayed in the pull-down display window. This achieves dynamic display of the corresponding part of the content to be displayed based on the user's operation, and also improves the user experience.
[0072] In some implementations of the embodiments of this disclosure, the above method further includes: determining a display height threshold of the drop-down display window; and displaying target content in the drop-down display window, including: displaying the target content in the drop-down display window in response to determining that the display height is greater than or equal to the display height threshold.
[0073] In this implementation, a minimum display height threshold, `initHeight`, is pre-set for the height of the dropdown window. This threshold serves as the minimum display height. When a user begins to pull down the page, the second dropdown menu gradually changes from transparent to opaque, and the content begins to display from `initHeight`. In other words, when the display height of the dropdown window exceeds `initHeight`, the target content will be displayed in a way that gradually changes from transparent to opaque, thus further enhancing the user experience.
[0074] It should be noted that when setting the height threshold `initHeight` for the dropdown display window, `initHeight` must be further subtracted when calculating the scroll distance. That is, `moveHeight = Y1 - Y0`. - initHeight.
[0075] Figure 4 A flow 400 illustrating yet another embodiment of a method for displaying page content according to this disclosure is shown, with reference to Figure 4 As shown, the method for displaying the content of this page includes the following steps:
[0076] Step S401: In response to detecting a swipe operation on the terminal screen, obtain the initial touch point position and the current touch point position of the swipe operation.
[0077] Step S402: Determine the current sliding distance as the vertical distance between the current touch point position and the initial touch point position.
[0078] In step S403, in response to determining that the current swipe distance is greater than zero, a pull-down operation is performed on the currently displayed page of the terminal screen.
[0079] In step S404, in response to determining that a pull-down operation has been performed on the current display page of the terminal screen and the pull-down operation has not been completed, the display height of the pull-down display window is determined based on the current swipe distance.
[0080] Step S405: Determine the target content that corresponds to the display height in the content to be displayed; and display the target content in the drop-down display window.
[0081] Steps S401-S405 and Figure 3 The steps S301-S305 of the illustrated embodiment are basically the same. For the specific implementation method, please refer to the above description of steps S301-S305, which will not be repeated here.
[0082] Step S406: In response to determining that a pull-down operation has been performed on the current display page of the terminal screen and the pull-down operation has been completed, determine the preset distance threshold range corresponding to the current swipe distance.
[0083] In the embodiments of the present disclosure, the execution subject of the page content display method (such as Figure 1 the server 103 shown in the figure) will further determine whether the pull-down operation ends after confirming that the user performs a pull-down operation on the current page. For example, whether the pull-down operation is completed can be determined by judging whether the user's finger leaves the screen. When it is determined that the user's pull-down operation is completed, that is, when the user's finger leaves the screen (the user releases the hand), it will continue to determine the preset distance threshold range corresponding to the current sliding distance. The preset distance ranges herein may include a first distance threshold range, a second distance threshold range, and a third distance threshold range, where the upper limit of the first distance threshold range is less than or equal to the lower limit of the second distance threshold range, and the upper limit of the second distance threshold range is less than or equal to the lower limit of the third distance threshold range. For example, the first distance threshold range is (0, H1), the second distance threshold range is (H2, H3), and the third distance threshold range is (H4, H5), where H1<=H2, H2<H3, H3<=H4, H5 is the height of the current screen, and the values of H1, H2, H3, and H4 can be set according to actual conditions, which is not limited in this embodiment.
[0084] Step S407: If it is determined that the current sliding distance falls within the first distance threshold range, it is determined that the target display effect triggered by the pull-down operation is rebounding to an invisible state.
[0085] In the embodiments of the present disclosure, if the execution subject determines that the current sliding distance falls within the first distance threshold range, that is, the pull-down distance is relatively small, it determines that the target display effect triggered by the pull-down operation is rebounding to an invisible state.
[0086] Step S408: Rebound the target content to an invisible state.
[0087] In the embodiments of the present disclosure, the execution subject will rebound the target content currently displayed in the pull-down display window to an invisible state.
[0088] That is, when the user's pull-down distance is relatively small, it is considered that the user may perform a misoperation or has no further display demand for the second-floor content. At this time, the content displayed in the pull-down display window will be rebounded to an invisible state, so that the user's intention is understood and corresponding information display is performed according to the user's intention, thereby improving the user's use experience.
[0089] Step S409: If it is determined that the current sliding distance falls within the second distance threshold range, it is determined that the target display effect triggered by the pull-down operation is rebounding to an invisible state and a refresh effect.
[0090] In this embodiment of the disclosure, if the executing entity determines that the current sliding distance is within the range of the second distance threshold, that is, the pull-down distance is appropriate, the target display effect triggered by the pull-down operation is determined to include a refresh effect while bouncing back to an invisible state.
[0091] Step S410: Bounce the target content back to an invisible state and refresh the currently displayed page.
[0092] In this embodiment of the disclosure, the executing entity will bounce the target content currently displayed in the drop-down display window to an invisible state, and refresh the currently displayed page.
[0093] In other words, when the user pulls down the screen to a suitable distance, it's assumed the user doesn't have a high need for the content on the second floor. At this point, the content displayed in the drop-down window will bounce back to an invisible state, and the current page will be refreshed. By understanding the user's intent and displaying information accordingly, the user experience is improved.
[0094] Step S411: If it is determined that the current sliding distance is within the range of the third distance threshold, the target display effect triggered by the pull-down operation is determined to be full-screen display.
[0095] In this embodiment of the disclosure, if the executing entity determines that the current sliding distance is within the range of the third distance threshold, that is, the pull-down distance is large, it determines that the target display effect triggered by the pull-down operation is full-screen display.
[0096] Step S412: Display the content to be displayed in full screen on the current display page.
[0097] In this embodiment of the disclosure, the executing entity will display the content to be displayed in full screen on the current display page. That is, the content on the second floor (the content to be displayed) will be automatically pulled down from the current release position until it fills the entire screen.
[0098] In other words, if a user scrolls down a considerable distance, it's assumed they have a higher demand for the content on the second floor. In this case, the content to be displayed will be shown in full screen on the current page. By understanding the user's intent and displaying information accordingly, the user experience is improved.
[0099] from Figure 4 It can be seen from this that, with Figure 3 Compared to the corresponding embodiments, the page content display method in this embodiment determines the user's demand for the second-floor content by measuring the user's swipe distance, thereby fully understanding the user's intent and displaying the corresponding information according to the user's intent, thus improving the user experience.
[0100] Figure 5This diagram illustrates a timing sequence of an application scenario for displaying page content according to the present disclosure. In this timing sequence, the system architecture includes a UI view layer, a data layer, a logic layer, and a utility layer.
[0101] Specifically, the UI view layer uses React's JSX to construct the layout of the page UI and the hierarchical relationships between various page elements. First, the UI view layer displays the page based on the data processed by the data layer. Then, when a listener event is triggered, the logic processing layer handles the corresponding event, updates the corresponding variable data for the page display, and the UI view layer renders the content of the second-floor dropdown based on the height after event handling and executes rendering animations.
[0102] The data layer primarily receives, processes, and filters data, and mainly communicates with the logic processing layer and the UI layer. The UI layer relies on data from the data layer, and will re-render the UI view when the data changes. The logic processing layer processes relevant data through event functions and then outputs the modified data.
[0103] The logic processing layer is located in the second-floor dropdown menu. The core page processing logic mainly includes the following event handling: 1. When the page detects a user touches the screen, it determines whether the user has performed a pull-down operation based on the user's finger swipe distance (moveHeight). 2. When the user's finger leaves the screen, it checks the moveHeight distance. If moveHeight > maximum refresh height, it invokes a linear rendering animation to automatically fill the screen. If moveHeight < minimum refresh height, it indicates the swipe distance is very short, possibly due to a mis-touch; therefore, it simply bounces the second-floor page back to an invisible position. If moveHeight is in the middle range, a refresh callback function is executed.
[0104] The utility layer provides common functions and some general-purpose libraries, such as common functions for interface requests, exception reporting, and string processing.
[0105] exist Figure 5 In the sequence diagram shown, when a user touches the screen, the data layer calls the touch function, and the logic processing layer obtains the initial position. When a user swipes the screen, the data layer calls the swipe function, causing the logic processing layer to calculate the swipe distance (moveHeight) and return it to the UI layer for rendering. When a user releases their finger, the data layer calls the release function, causing the logic processing layer to calculate the release event based on the release height (moveHeight). The data layer then determines the control style corresponding to the release event, allowing the UI layer to render the content triggered by the release event based on the control style.
[0106] Specifically, if moveHeight > maximum refresh height, a linear rendering animation is invoked to automatically fill the screen; if moveHeight < minimum refresh height, it means the swipe distance is very short, possibly due to a mis-touch, so simply bounce the second-floor page upwards until it is invisible; if moveHeight is at the middle distance, the refresh callback function will be executed.
[0107] By using the above-mentioned H5-based drop-down second-floor display method, the rendering speed of each frame of animation is improved, achieving smooth rendering so that users do not experience frame drops, thereby further enhancing the user experience.
[0108] As an implementation of the method for displaying the page content shown in the above figures, Figure 6 An embodiment of a page content display device according to the present disclosure is shown. The page content display device 600 and... Figure 2 Corresponding to the method embodiments shown, this device can be applied to various electronic devices.
[0109] Reference Figure 6 As shown, the page content display device 600 provided in this embodiment includes: an operation determination module 601, an effect determination module 602, and a display module 603. The operation determination module 601 is configured to, in response to detecting a swipe operation on the terminal screen, determine whether to perform a pull-down operation on the currently displayed page of the terminal screen based on the current swipe distance; the effect determination module 602 is configured to, in response to determining that a pull-down operation has been performed on the currently displayed page of the terminal screen and the pull-down operation has been completed, determine the target display effect triggered by the pull-down operation based on the current swipe distance and a preset distance threshold range; the display module 603 is configured to display the content to be displayed using the target display effect, wherein the content to be displayed is content hidden above the currently displayed page.
[0110] In the page content display device 600 of this disclosure embodiment, the specific processing of the operation determination module 601, the effect determination module 602, and the display module 603, and the resulting technical effects, can be referred to respectively. Figure 2 The relevant descriptions of steps S201-S203 in the corresponding embodiments will not be repeated here.
[0111] In some implementations of the embodiments of this disclosure, the operation determination module 601 is further configured to: in response to detecting a swipe operation on the terminal screen, obtain the initial touch point position and the current touch point position of the swipe operation; determine the vertical distance between the current touch point position and the initial touch point position as the current swipe distance; and in response to determining that the current swipe distance is greater than zero, determine to perform a pull-down operation on the current display page of the terminal screen.
[0112] In some implementations of the embodiments of this disclosure, the page content display device 600 further includes: a display height determination module, configured to determine the display height of the drop-down display window based on the current sliding distance in response to determining that a pull-down operation is performed on the current display page of the terminal screen and the pull-down operation has not been completed; a target content module, configured to determine the target content corresponding to the display height in the content to be displayed; and a drop-down display module, configured to display the target content in the drop-down display window.
[0113] In some implementations of the embodiments of this disclosure, the page content display device 600 further includes: a display effect determination module, configured to determine the display effect corresponding to the target content based on the sliding speed of the sliding operation; and a drop-down display module further configured to: display the target content in the drop-down display window using the display effect corresponding to the target content.
[0114] In some implementations of the embodiments of this disclosure, the preset distance threshold range includes: a first distance threshold range, the target display effect includes: bounce to an invisible state; and the display module is further configured to: bounce the target content to an invisible state.
[0115] In some implementations of the embodiments of this disclosure, the preset distance threshold range further includes: a second distance threshold range, wherein the upper limit of the first distance threshold range is less than or equal to the lower limit of the second distance threshold range; the target display effect further includes: bounce to an invisible state and refresh effect; and the display module is further configured to: bounce the target content to an invisible state and refresh the currently displayed page.
[0116] In some implementations of the embodiments of this disclosure, the preset distance threshold range further includes: a third distance threshold range, wherein the upper limit of the second distance threshold range is less than or equal to the lower limit of the third distance threshold range; the target display effect further includes: full-screen display; and the display module is further configured to: display the content to be displayed in full-screen mode on the current display page.
[0117] In some implementations of the embodiments of this disclosure, the page content display device 600 further includes: a display height threshold determination module, configured to determine a display height threshold of the drop-down display window; and the drop-down display module is further configured to: display target content in the drop-down display window in response to determining that the display height is greater than or equal to the display height threshold.
[0118] According to embodiments of this disclosure, this disclosure also provides an electronic device, a readable storage medium, and a computer program product.
[0119] Figure 7A schematic block diagram of an example electronic device 700 that can be used to implement embodiments of the present disclosure is shown. The electronic device is intended to represent various forms of digital computers, such as laptop computers, desktop computers, workstations, personal digital assistants, servers, blade servers, mainframe computers, and other suitable computers. The electronic device may also represent various forms of mobile devices, such as personal digital processors, cellular phones, smartphones, wearable devices, and other similar computing devices. The components shown herein, their connections and relationships, and their functions are merely illustrative and are not intended to limit the implementation of the present disclosure described and / or claimed herein.
[0120] like Figure 7 As shown, device 700 includes a computing unit 701, which can perform various appropriate actions and processes based on a computer program stored in read-only memory (ROM) 702 or a computer program loaded from storage unit 708 into random access memory (RAM) 703. RAM 703 may also store various programs and data required for the operation of device 700. The computing unit 701, ROM 702, and RAM 703 are interconnected via bus 704. Input / output (I / O) interface 705 is also connected to bus 704.
[0121] Multiple components in device 700 are connected to I / O interface 705, including: input unit 706, such as keyboard, mouse, etc.; output unit 707, such as various types of monitors, speakers, etc.; storage unit 708, such as disk, optical disk, etc.; and communication unit 709, such as network card, modem, wireless transceiver, etc. Communication unit 709 allows device 700 to exchange information / data with other devices through computer networks such as the Internet and / or various telecommunications networks.
[0122] The computing unit 701 can be a variety of general-purpose and / or special-purpose processing components with processing and computing capabilities. Some examples of the computing unit 701 include, but are not limited to, a central processing unit (CPU), a graphics processing unit (GPU), various special-purpose artificial intelligence (AI) computing chips, various computing units running machine learning model algorithms, a digital signal processor (DSP), and any suitable processor, controller, microcontroller, etc. The computing unit 701 performs the various methods and processes described above, such as the method of displaying page content. For example, in some embodiments, the method of displaying page content may be implemented as a computer software program tangibly contained in a machine-readable medium, such as storage unit 708. In some embodiments, part or all of the computer program may be loaded and / or installed on device 700 via ROM 702 and / or communication unit 709. When the computer program is loaded into RAM 703 and executed by computing unit 701, one or more steps of the method of displaying page content described above may be performed. Alternatively, in other embodiments, the computing unit 701 may be configured to perform the method of displaying page content by any other suitable means (e.g., by means of firmware).
[0123] Various embodiments of the systems and techniques described above herein can be implemented in digital electronic circuit systems, integrated circuit systems, field-programmable gate arrays (FPGAs), application-specific integrated circuits (ASICs), application-specific standard products (ASSPs), systems-on-a-chip (SoCs), payload-programmable logic devices (CPLDs), computer hardware, firmware, software, and / or combinations thereof. These various embodiments may include implementations in one or more computer programs that can be executed and / or interpreted on a programmable system including at least one programmable processor, which may be a dedicated or general-purpose programmable processor, capable of receiving data and instructions from a storage system, at least one input device, and at least one output device, and transmitting data and instructions to the storage system, the at least one input device, and the at least one output device.
[0124] The program code used to implement the methods of this disclosure may be written in any combination of one or more programming languages. This program code may be provided to a processor or controller of a general-purpose computer, special-purpose computer, or other programmable data processing apparatus, such that when executed by the processor or controller, the program code causes the functions / operations specified in the flowcharts and / or block diagrams to be implemented. The program code may be executed entirely on a machine, partially on a machine, as a standalone software package partially on a machine and partially on a remote machine, or entirely on a remote machine or server.
[0125] In the context of this disclosure, a machine-readable medium can be a tangible medium that may contain or store a program for use by or in conjunction with an instruction execution system, apparatus, or device. A machine-readable medium can be a machine-readable signal medium or a machine-readable storage medium. A machine-readable medium can be, but is not limited to, electronic, magnetic, optical, electromagnetic, infrared, or semiconductor systems, apparatus, or devices, or any suitable combination of the foregoing. More specific examples of machine-readable storage media include electrical connections based on one or more wires, portable computer disks, hard disks, random access memory (RAM), read-only memory (ROM), erasable programmable read-only memory (EPROM or flash memory), optical fiber, portable compact disk read-only memory (CD-ROM), optical storage devices, magnetic storage devices, or any suitable combination of the foregoing.
[0126] To provide interaction with a user, the systems and techniques described herein can be implemented on a computer having: a display device for displaying information to the user (e.g., a CRT (cathode ray tube) or LCD (liquid crystal display) monitor); and a keyboard and pointing device (e.g., a mouse or trackball) through which the user provides input to the computer. Other types of devices can also be used to provide interaction with the user; for example, feedback provided to the user can be any form of sensory feedback (e.g., visual feedback, auditory feedback, or tactile feedback); and input from the user can be received in any form (including sound input, voice input, or tactile input).
[0127] The systems and technologies described herein can be implemented in computing systems that include backend components (e.g., as a data server), or computing systems that include middleware components (e.g., an application server), or computing systems that include frontend components (e.g., a user computer with a graphical user interface or web browser through which a user can interact with embodiments of the systems and technologies described herein), or any combination of such backend, middleware, or frontend components. The components of the system can be interconnected via digital data communication of any form or medium (e.g., a communication network). Examples of communication networks include local area networks (LANs), wide area networks (WANs), and the Internet.
[0128] Computer systems can include clients and servers. Clients and servers are generally located far apart and typically interact via communication networks. Client-server relationships are created by computer programs running on the respective computers and having a client-server relationship with each other. Servers can be cloud servers, servers in distributed systems, or servers incorporating blockchain technology.
[0129] It should be understood that the various forms of processes shown above can be used to rearrange, add, or delete steps. For example, the steps described in this disclosure can be executed in parallel, sequentially, or in different orders, as long as the desired result of the technical solution disclosed in this disclosure can be achieved, and this is not limited herein.
[0130] The specific embodiments described above do not constitute a limitation on the scope of protection of this disclosure. Those skilled in the art should understand that various modifications, combinations, sub-combinations, and substitutions can be made according to design requirements and other factors. Any modifications, equivalent substitutions, and improvements made within the spirit and principles of this disclosure should be included within the scope of protection of this disclosure.
Claims
1. A method for displaying page content, comprising: In response to detecting a swipe operation on the terminal screen, determine whether to perform a pull-down operation on the currently displayed page of the terminal screen based on the current swipe distance; In response to determining that the pull-down operation has been performed on the current display page of the terminal screen and that the pull-down operation has been completed, the target display effect triggered by the pull-down operation is determined based on the current swipe distance and a preset distance threshold range. The content to be displayed is displayed using the target display effect, wherein the content to be displayed is content hidden above the currently displayed page.
2. The method according to claim 1, wherein, The step of responding to the detection of a swipe operation on the terminal screen and determining whether to perform a pull-down operation on the currently displayed page of the terminal screen based on the current swipe distance includes: In response to detecting a swipe operation on the terminal screen, the initial touch point position and the current touch point position of the swipe operation are obtained; The vertical distance between the current touch point position and the initial touch point position is determined as the current sliding distance; In response to determining that the current swipe distance is greater than zero, a pull-down operation is performed on the currently displayed page of the terminal screen.
3. The method according to claim 2, wherein, Also includes: In response to determining that a pull-down operation is performed on the current display page of the terminal screen and the pull-down operation has not been completed, the display height of the pull-down display window is determined based on the current swipe distance; Identify the target content within the content to be displayed that corresponds to the display height; The target content is displayed in the drop-down display window.
4. The method according to claim 3, wherein, Also includes: The display effect corresponding to the target content is determined based on the sliding speed of the sliding operation; as well as Displaying the target content in the drop-down display window includes: The target content is displayed in the drop-down display window using the display effect corresponding to the target content.
5. The method according to claim 3, wherein, The preset distance threshold range includes: a first distance threshold range; the target display effect includes: bouncing back to an invisible state; and The process of displaying the content to be displayed using the target display effect includes: The target content is bounced back to an invisible state.
6. The method according to claim 5, wherein, The preset distance threshold range further includes: a second distance threshold range, wherein the upper limit of the first distance threshold range is less than or equal to the lower limit of the second distance threshold range; the target display effect further includes: bouncing back to an invisible state and a refresh effect; and The process of displaying the content to be displayed using the target display effect includes: The target content is bounced back to an invisible state, and the currently displayed page is refreshed.
7. The method according to claim 6, wherein, The preset distance threshold range further includes: a third distance threshold range, wherein the upper limit of the second distance threshold range is less than or equal to the lower limit of the third distance threshold range; the target display effect further includes: full-screen display; and The process of displaying the content to be displayed using the target display effect includes: The content to be displayed will be shown in full screen on the current display page.
8. The method according to claim 3, wherein, Also includes: Determine the display height threshold of the drop-down display window; as well as Displaying the target content in the drop-down display window includes: In response to determining that the display height is greater than or equal to the display height threshold, the target content is displayed in the drop-down display window.
9. A device for displaying page content, comprising: The operation determination module is configured to, in response to detecting a swipe operation on the terminal screen, determine whether to perform a pull-down operation on the currently displayed page of the terminal screen based on the current swipe distance; The effect determination module is configured to, in response to determining that the pull-down operation is performed on the current display page of the terminal screen and the pull-down operation is completed, determine the target display effect triggered by the pull-down operation based on the current swipe distance and a preset distance threshold range; The display module is configured to display content to be displayed using the target display effect, wherein the content to be displayed is content hidden above the currently displayed page.
10. An electronic device, comprising: At least one processor; as well as A memory communicatively connected to the at least one processor; wherein, The memory stores instructions that can be executed by the at least one processor to enable the at least one processor to perform the method of any one of claims 1-8.
11. A non-transitory computer-readable storage medium storing computer instructions for causing the computer to perform the method of any one of claims 1-8.
12. A computer program product comprising a computer program that, when executed by a processor, implements the method according to any one of claims 1-8.
