CN109032457B - Page display method, device, terminal and storage medium - Google Patents

Page display method, device, terminal and storage medium Download PDF

Info

Publication number
CN109032457B
CN109032457B CN201710712967.6A CN201710712967A CN109032457B CN 109032457 B CN109032457 B CN 109032457B CN 201710712967 A CN201710712967 A CN 201710712967A CN 109032457 B CN109032457 B CN 109032457B
Authority
CN
China
Prior art keywords
list data
list
data
page
cached
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Active
Application number
CN201710712967.6A
Other languages
Chinese (zh)
Other versions
CN109032457A (en
Inventor
邱浩新
谢子琪
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Kingdee Software China Co Ltd
Original Assignee
Kingdee Software China Co Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Kingdee Software China Co Ltd filed Critical Kingdee Software China Co Ltd
Priority to CN201710712967.6A priority Critical patent/CN109032457B/en
Publication of CN109032457A publication Critical patent/CN109032457A/en
Application granted granted Critical
Publication of CN109032457B publication Critical patent/CN109032457B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F3/00Input arrangements for transferring data to be processed into a form capable of being handled by the computer; Output arrangements for transferring data from processing unit to output unit, e.g. interface arrangements
    • G06F3/01Input arrangements or combined input and output arrangements for interaction between user and computer
    • G06F3/048Interaction techniques based on graphical user interfaces [GUI]
    • G06F3/0481Interaction techniques based on graphical user interfaces [GUI] based on specific properties of the displayed interaction object or a metaphor-based environment, e.g. interaction with desktop elements like windows or icons, or assisted by a cursor's changing behaviour or appearance
    • G06F3/0482Interaction with lists of selectable items, e.g. menus
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F3/00Input arrangements for transferring data to be processed into a form capable of being handled by the computer; Output arrangements for transferring data from processing unit to output unit, e.g. interface arrangements
    • G06F3/01Input arrangements or combined input and output arrangements for interaction between user and computer
    • G06F3/048Interaction techniques based on graphical user interfaces [GUI]
    • G06F3/0484Interaction techniques based on graphical user interfaces [GUI] for the control of specific functions or operations, e.g. selecting or manipulating an object, an image or a displayed text element, setting a parameter value or selecting a range

Abstract

The invention relates to a page display method, a page display device, a terminal and a storage medium. The page display method comprises the following steps: when the list page is loaded, list data in the list page is obtained; receiving trigger operation corresponding to the list data, and jumping to a detail page corresponding to the list data in response to the trigger operation; caching the list data, and recording a display position corresponding to the triggered list data; and receiving a return operation on the detail page, reading the cached list data and the display position in response to the return operation, and reloading the list page according to the display position and the cached list data. The method can continue to display at the position where the jump of the list page occurs.

Description

Page display method, device, terminal and storage medium
Technical Field
The present invention relates to the field of computer technologies, and in particular, to a page display method, apparatus, terminal, and storage medium.
Background
The user may browse a listing page, such as a merchandise listing page, through the mobile terminal. The user can browse the list data on the list page by sliding up and down. In the browsing process, a user can click a certain list data to jump to a corresponding detail page, such as a commodity detail page, and click a return key to return to the list page. But when the list page is returned from the details page, the data is reinitialized and the list page is set to the top again. If the user wishes to return to the list page and then can continue browsing from the previous jump position, the list page can only be manually slid from the first page to the corresponding page again, which is time-consuming and labor-consuming. Therefore, how to continue displaying from the jump position after returning to the list page becomes a technical problem to be solved at present.
Disclosure of Invention
In view of the above, it is desirable to provide a page display method, apparatus, terminal, and storage medium that can continue to display from a location where a jump has occurred after returning to a list page.
A page display method includes:
when a list page is loaded, obtaining list data in the list page;
receiving trigger operation corresponding to the list data, and jumping to a detail page corresponding to the list data in response to the trigger operation;
caching the list data, and recording a display position corresponding to the triggered list data;
and receiving a return operation on the detail page, reading the cached list data and the display position in response to the return operation, and reloading the list page according to the display position and the cached list data.
In one embodiment, the step of caching the list data includes:
calculating the number of cache pages corresponding to the list page according to the list data;
acquiring page numbers corresponding to the list pages and total page numbers of the loaded list pages;
if the page number and the loaded total page number do not exceed the number of cache pages, all cache is carried out on the loaded list data;
and if the page number exceeds the number of cache pages, or the total loaded page number exceeds the number of cache pages, locally caching the loaded list data.
In one embodiment, the step of recording the display position corresponding to the triggered list data includes:
respectively acquiring the height of the cached first item list data, the height of the first item list data on the screen and the height of the list data between the cached first item list data and the first item list data on the screen;
calculating the sum of the heights of the cached first item list data, the first item list data on the screen and the list data between the cached first item list data and the first item list data on the screen;
and recording the display position of the list page according to the sum of the heights.
In one embodiment, the step of recording the display position corresponding to the triggered list data includes:
acquiring a data identifier corresponding to first item list data on a screen and a data identifier corresponding to the first item list data needing to be cached;
calculating the number of data items according to the data identification corresponding to the first item list data needing to be cached and the data identification corresponding to the first item list data on the screen;
acquiring the average height of the single list data;
calculating the sliding distance of the list data according to the number of the data items and the average height of the single list data;
and recording the display position of the triggered list data according to the sliding distance.
In one embodiment, the list data has a corresponding data identification; before the step of reading the cached list data and the display position, the method further comprises the following steps:
responding to the returning operation, and sending a data synchronization request to the server, wherein the data synchronization request carries a data identifier corresponding to the cached list data, so that the server returns the corresponding list data according to the data identifier;
comparing whether the list data returned by the server is consistent with the cached list data or not;
and if not, updating the cached list data according to the returned list data.
A page display apparatus, the apparatus comprising:
the loading module is used for acquiring list data in a list page when the list page is loaded;
the skip module is used for receiving trigger operation corresponding to the list data and skipping to a detail page corresponding to the list data in response to the trigger operation; caching the list data, and recording a display position corresponding to the triggered list data;
and the return module is used for receiving the return operation on the detail page, reading the cached list data and the display position in response to the return operation, and reloading the list page according to the display position and the cached list data.
In one embodiment, the skip module is further configured to calculate, according to the list data, a number of cache pages corresponding to the list page; acquiring page numbers corresponding to the list pages and total page numbers of the loaded list pages; if the page number and the loaded total page number do not exceed the number of cache pages, all cache is carried out on the loaded list data; and if the page number exceeds the number of cache pages, or the total loaded page number exceeds the number of cache pages, locally caching the loaded list data.
In one embodiment, the list data has a corresponding data identification; the device also comprises an updating module used for responding to the returning operation and sending a data synchronization request to the server, wherein the data synchronization request carries a data identifier corresponding to the cached list data, so that the server returns the corresponding list data according to the data identifier; comparing whether the list data returned by the server is consistent with the cached list data or not; and if not, updating the cached list data according to the returned list data.
A terminal comprising a memory, a processor and a computer program stored on the memory and executable on the processor, the processor implementing the steps of the page display method provided in one embodiment of the invention when executing the program.
A computer-readable storage medium, on which a computer program is stored, which instructions, when executed by a processor, implement the steps of a page display method provided in one embodiment of the present invention.
According to the page display method, the page display device, the terminal and the storage medium, when the list page jumps, the loaded list data is cached; when the list page is returned, the list data can be directly read in the cache, so that the time for requesting the list data from the server is reduced, and the loading speed of the list page can be improved. When the list page jumps, the display position of the page jump is recorded, so that the list data read from the cache can be displayed according to the recorded display position when the list page returns, the state of the list page jump can be maintained, the data cannot be initialized again from the server when the list page returns, and the display can be continuously performed at the position of the list page jump.
Drawings
FIG. 1 is a diagram of an application environment of a page display method in one embodiment;
FIG. 2 is a flow diagram of a page display method in one embodiment;
FIG. 3 is an interface diagram of a list page in one embodiment;
FIG. 4 is an interface diagram of a list page in another embodiment;
FIG. 5 is a schematic diagram of a page display apparatus according to an embodiment;
fig. 6 is a schematic structural diagram of a terminal in one embodiment.
Detailed Description
In order to make the objects, technical solutions and advantages of the present invention more apparent, the present invention is described in further detail below with reference to the accompanying drawings and embodiments. It should be understood that the specific embodiments described herein are merely illustrative of the invention and are not intended to limit the invention.
It will be understood that, as used herein, the terms "first," "second," and the like may be used herein to describe various elements, but these elements are not limited by these terms. These terms are only used to distinguish one element from another. For example, a first client may be referred to as a second client, and similarly, a second client may be referred to as a first client, without departing from the scope of the present application. Both the first client and the second client are clients, but they are not the same client.
The page display method provided in the embodiment of the present invention may be applied to an application environment as shown in fig. 1, where the application environment includes a terminal 102 and a server 104. Wherein the terminal 102 is capable of communicating with the server 104 via a network. The terminal 102 loads at least one list page. Each list page includes a plurality of items of list data. The user can browse the list data on the list page through sliding at the terminal 102, and can jump to the detail page corresponding to a certain list data by clicking the list data in the browsing process. When receiving a trigger operation on a certain list data, the terminal 102 skips from the current list page to the corresponding detail page in response to the trigger operation, caches the loaded list data, and records the display position corresponding to the triggered list data. The user may return from the details page to the list page at the terminal 102 by clicking a return key. When receiving a return operation on the detail page, the terminal 102 reads the cached list data and the display position in response to the return operation, and reloads the list page according to the display position and the cached list data, so that when returning to the list page from the detail page, display can be continued from the position where the list page is jumped.
In an embodiment, as shown in fig. 2, a page display method is provided, which is described by taking an example that the method is applied to a terminal, and specifically includes the following steps:
step 202, when the list page is loaded, list data in the list page is obtained.
The user can browse a list page such as a goods list page or an inline H5(HTML5, hypertext markup language) page or the like through a light application or the like on the terminal. The terminal can be a mobile phone or a tablet computer and the like. The list page includes a plurality of items of list data, each item of list data having a corresponding data identification.
When a user needs to browse a list page, the terminal receives the list page entering operation of the user, such as pressing a key or clicking a touch screen. And the terminal responds to the entry operation of the list page to enter the list page, loads the list data from the server and calculates the number of cache pages corresponding to the list page. Specifically, the terminal sends an HTTP request message to the server. The HTTP request message includes an HTTP request header field and request data. The request data comprises a plurality of data identifications corresponding to the list page. And the server returns an HTTP response message to the terminal according to the HTTP request message. The HTTP response message includes an HTTP response header field and response data. The HTTP response header field includes a data size (content-length field) of the response data. The response data includes list data corresponding to the list page. And the terminal loads the returned list data on the list page. And the terminal acquires the data size of the single-page list data according to the HTTP response header field. And the terminal calculates the number of cache pages according to the data size of the single-page list data and a preset cache threshold value. The number of cache pages is the maximum value of the number of pages of the list which can be cached by the terminal.
And 204, receiving a trigger operation corresponding to the list data, and jumping to a detail page corresponding to the list data in response to the trigger operation.
When the loaded list pages include a plurality of list pages, the terminal may display the loaded list pages in various ways. One of the display modes is that a plurality of loaded list pages are continuously displayed, that is, a plurality of list pages can be simultaneously displayed on the terminal screen. The user can browse different list pages by sliding at the terminal. Another display mode is to page a plurality of loaded list pages, i.e. each list page is displayed separately as a page. The user can browse different list pages by clicking controls such as 'previous page' or 'next page' on the terminal. Each list page that has been loaded has a corresponding page number. A user can browse different list data on each list page through sliding at a terminal, and can jump to a detail page corresponding to a certain list data by clicking the list data in the browsing process, such as a commodity detail page.
Step 206, caching the list data, and recording the display position corresponding to the triggered list data.
When receiving the trigger operation of a certain list data, the terminal skips from the current list page to the corresponding detail page in response to the trigger operation. The terminal acquires the page number of the list page and the total page number of the loaded list page, compares the page number of the list page and the loaded total page number with the number of cache pages respectively, and performs whole cache or local cache on the loaded list data according to the comparison result. Specifically, if the page number of the list page and the loaded total page number do not exceed the number of cache pages, all the loaded list data are cached. And if the page number of the list page exceeds the cache page number, or the total loaded page number exceeds the cache page number, locally caching the loaded list data. The list data of the local cache includes the list data on the list page where the jump occurs and the list data on a plurality of list pages consecutive to the list page number. For example, assuming that the number of cache pages is 20 pages, the page number of the list page is 15 pages, and the total page number of the loaded list page is 50 pages, the terminal may cache 6 to 25 pages of list data.
When receiving a trigger operation on certain list data, the terminal acquires a display position corresponding to the triggered list data and records the display position corresponding to the triggered list data. And acquiring the display position corresponding to the triggered list data in different display modes of the list pages. If a plurality of list pages are displayed in a paging mode, the terminal can acquire the distance between the first item list data on the triggered list page and the first item list data displayed on the screen, and acquire the display position corresponding to the triggered list data according to the distance. As shown in fig. 3, assuming that each list page includes 10 items of list data arranged in parallel, a user clicks the 8 th item of list data on the 15 th page list page to jump to the corresponding detail page, and the first item of list data displayed on the terminal screen when the jump occurs is the 6 th item of list data on the 15 th page list page, the terminal obtains a distance h1 between the 6 th item of list data on the 15 th page list page and the 1 st item of list data on the 15 th page list page. The terminal may also obtain the relative distance between the triggered list data and the top of the screen. For example, in the above example, the terminal acquires the relative distance between the 8 th item list data on the 15 th page list page and the top of the screen, and acquires the display position corresponding to the triggered list data according to the distance.
If a plurality of list pages are continuously displayed, the acquisition mode of the display position corresponding to the triggered list data comprises a plurality of modes. One of the obtaining modes is that when the jump occurs, the terminal obtains a relative distance between the triggered list data and the top of the screen, and obtains a display position corresponding to the triggered list data according to the relative distance. For example, when the user clicks the 3 rd item list data on the 15 th page list page to jump to the corresponding detail page, the distance between the 3 rd item list data on the 15 th page list page and the top of the screen is acquired. The other acquisition mode is that when jumping occurs, the terminal acquires the distance between the first item list data displayed on the screen and the first item list data needing to be cached, and acquires the display position corresponding to the triggered list data according to the distance.
In one embodiment, the step of recording the display position corresponding to the triggered list data includes: acquiring a data identifier corresponding to first item list data on a screen and a data identifier corresponding to the first item list data needing to be cached; calculating the number of data items according to the data identification corresponding to the first item list data needing to be cached and the data identification corresponding to the first item list data on the screen; acquiring the average height of the single list data; calculating the sliding distance of the list data according to the number of the data items and the average height of the single list data; and recording the display position of the triggered list data according to the sliding distance.
The data identifier is used for uniquely identifying one item of list data, and can be a data number and the like. If each item of list data has the same average height, calculating the number of data items according to the data number corresponding to the first item of list data needing to be cached and the data number corresponding to the first item of list data displayed on a screen; calculating the average height of the singleton list data by using a pre-written JS (JavaScript), an transliteration script language; and calculating the distance between the first item list data displayed on the screen and the first item list data needing to be cached according to the number of the data items and the average height of the single item list data, namely calculating the distance which needs to slide relative to the top of the screen when the cached list data is reloaded. As shown in fig. 4, in the above example, it is assumed that each list page includes 10 items of list data arranged in parallel, the multiple items of list data have consecutive data numbers, and if the data number corresponding to the first item of list data on the list page with the page number 1 is 1, and the first item of list data displayed on the terminal screen is the 8 th item of list data on the 14 th page, the terminal acquires that the data number ID of the 1 st item of list data on the 6 th page list page is (6-1) × 10+1 ═ 51, and the data number ID of the 8 th item of list data on the 14 th page list page is (14-1) × 10+8 ═ 138, so that the difference between the data items is 138-51 ═ 87. Assuming that the average height of each item list data is 100PX (pixel), the distance h2 between the first item list data displayed on the screen and the first item list data to be buffered is 87 × 100PX 8700 PX.
In one embodiment, the step of recording the display position corresponding to the triggered list data includes: respectively acquiring the height of the cached first item list data, the height of the first item list data on the screen and the height of the list data between the cached first item list data and the first item list data on the screen; calculating the sum of the heights of the cached first item list data, the first item list data on the screen and the list data between the cached first item list data and the first item list data on the screen; and recording the display position of the list page according to the sum of the heights.
If the height of each item of list data is different, the terminal respectively acquires the height of the first item of list data needing to be cached by using a pre-written JS script, and predicts the height of each item of list data between the first item of list data needing to be cached and the first item of list data displayed on a screen; calculating the sum of the heights of the plurality of items of list data; and acquiring the display position of the triggered list data according to the sum of the heights. For example, in the above example, when the user clicks the 3 rd item list data on the 15 th page list page to jump to the corresponding detail page, the terminal caches the list data of 6 to 25 pages, and then the terminal obtains the 1 st item list data on the 6 th page list page and the sum of the heights of the multiple item list data between the 1 st item list data on the 6 th page list page and the 8 th item list data on the 14 th page list page.
Step 208, receiving a return operation on the detail page, reading the cached list data and the display position in response to the return operation, and reloading the list page according to the display position and the cached list data.
The user may return from the details page to the list page at the terminal by clicking a return key. And when the returning operation on the detail page is received, the terminal reads the cached list data and the display position, and displays the read list data according to the display position. Specifically, the terminal may set a scrollTop value (vertical offset of a scroll bar) of the list data according to the recorded display position, and load the read list data according to the set scrollTop value, so as to position the returned list page to the last browsing position. For example, in the above example, when returning to the list page, the terminal reads all 20 (item/page) × 20 (page) ═ 400 items of list data from the cache, and when the read list data is directly displayed, the display starts from the first item of list data read, that is, from the list data with ID ═ 51 on the screen, and the triggered list data ID ═ 15-1) × 10+3 ═ 143 cannot be displayed. Thus, when the terminal reads the cached 400 items of list data, the scrollTop value of the list data is set to 8700PX, so that the read list data is slid 8700PX with respect to the top of the screen, and the list page can be continuously displayed at the jumped position.
The terminal can also realize the positioning of the list page according to the relative distance between the recorded triggered list data and the top of the screen. The terminal reads the triggered list data firstly, loads the triggered list data according to the relative distance between the triggered list data and the top of the screen, thereby positioning the triggered list data, and loads other read list data according to the triggered list data.
When returning to the list page, the terminal first displays the cached list data. If the user needs to browse the uncached list data after returning to the list page, the corresponding list data needs to be requested from the server according to the mode. For example, in the above example, after the list page is returned, the user needs to browse the list data of pages 1 to 5, and the terminal sends the HTTP request to the server to obtain the corresponding list data according to the above manner.
In this embodiment, when a list page skips, the terminal caches the loaded list data; when the list page is returned, the list data can be directly read in the cache, so that the time for requesting the list data from the server is reduced, and the loading speed of the list page can be improved. When the list page jumps, the display position of the page jump is recorded, so that the list data read from the cache can be displayed according to the recorded display position when the list page returns, the state of the list page jump can be maintained, the data cannot be initialized again from the server when the list page returns, and the display can be continuously performed at the position of the list page jump.
In one embodiment, the step of caching the list data comprises: calculating the number of cache pages corresponding to the list page according to the list data; acquiring page numbers corresponding to the list pages and total page numbers of the loaded list pages; if the page number and the loaded total page number do not exceed the number of the cache pages, all the loaded list data are cached; and if the page number exceeds the number of the cache pages, or the total loaded page number exceeds the number of the cache pages, locally caching the loaded list data.
And when receiving the list page entering operation of the user, the terminal sends an HTTP request message to the server. The HTTP request message comprises a plurality of data identifications corresponding to the list page. And the server returns an HTTP response message to the terminal according to the HTTP request message. The HTTP response message includes list data corresponding to the list page and an HTTP response header field containing a size of the list data corresponding to the list page. The terminal acquires the data size of the single page list data, such as 200 KB/page, according to the HTTP response header field. And the terminal calculates the number of cache pages according to the data size of the single-page list data and a preset cache threshold value. And if the number of the cache pages is a non-integer, the terminal rounds the number of the cache pages. If the preset buffer threshold is 4MB, the number of buffer pages is 20.48, and the number of buffer pages is 20 pages. The number of cache pages is the maximum value of the number of pages of the list which can be cached by the terminal.
When receiving a trigger operation of a user on the list data, the terminal acquires the page number of the list page and the total page number of the loaded list page, compares the page number of the list page and the loaded total page number with the number of cache pages respectively, and performs full cache or partial cache on the loaded list data according to the comparison result.
And if the page number of the list page and the loaded total page number do not exceed the number of the cache pages, the terminal caches all the list data on the loaded page. For example, assuming that the number of cache pages is 20 pages, the page number of the list page is 9 pages, and the total loaded page number is 15 pages, the terminal caches list data of 1 to 15 pages.
And if the page number of the list page is equal to the loaded total page number and exceeds the number of the cache pages, the terminal locally caches the newly loaded list data with the number corresponding to the number of the cache pages. For example, assuming that the number of cache pages is 20 pages, the page number of the list page is 50 pages, and the total page number of the loaded pages is 50 pages, the terminal caches the list data of 31 to 50 pages.
If the page number of the list page is smaller than the loaded total page number and the total page number of the loaded page exceeds the number of cache pages, the terminal locally caches the list data on the list page with a plurality of continuous page numbers including the list page. For example, assuming that the number of cache pages is 20 pages, the page number of the list page is 15 pages, and the total page number of the loaded pages is 50 pages, the terminal may cache list data of 6 to 25 pages. For another example, assuming that the number of cache pages is 20 pages, the page number of the list page is 45 pages, and the total page number of the loaded pages is 50 pages, the terminal may cache list data of 36 to 50 pages, 31 to 50 pages, or the like. The number of final cached list pages should not exceed the number of cached pages.
In this embodiment, according to whether the page number of the list page and the loaded total page number exceed the number of cache pages, the loaded list data may be completely cached or locally cached; the number of the finally cached list pages does not exceed the number of the cached pages, and appropriate caching can be performed on the list data, so that the influence on the performance of the terminal due to too much cached list data can be avoided, and the time consumption for reloading the list data when the list pages are returned is reduced due to less cached list data.
In one embodiment, the list data has a corresponding data identification; before the step of reading the cached list data and the display position, the method further comprises the following steps: sending a data synchronization request to the server in response to the return operation, wherein the data synchronization request carries a data identifier corresponding to the cached list data, so that the server returns the corresponding list data according to the data identifier; comparing whether the list data returned by the server is consistent with the cached list data or not; and if not, updating the cached list data according to the returned list data.
And when the returning operation on the detail page is received, the terminal updates the cached list data, reads the updated list data and reloads the list page according to the updated list data. Specifically, the terminal sends a data synchronization request to the server, where the data synchronization request carries a data identifier corresponding to the cached list data. And the server returns corresponding list data according to the data identifier. And the terminal compares the list data returned by the server with the cached list data and judges whether the returned list data is changed or not. And if so, the terminal updates the cached list data according to the returned list data.
In a traditional mode, the display is continued at the jump position when the list page returns by a mode of caching all loaded list data at the terminal. But all the loaded list data is cached at the terminal, and the latest list data cannot be synchronized due to isolation from the server.
In the embodiment, when a page jumps, a terminal caches loaded list data, and the cached list data has a corresponding data identifier; when the page returns, the corresponding list data can be requested from the server according to the cached data identification, and the cached list data can be updated by utilizing the list data returned by the server, so that the user can not only continue browsing at the jump position but also read the latest list data when returning to the list page.
In one embodiment, as shown in fig. 5, there is provided a page display apparatus including: a load module 502, a jump module 504, and a return module 506, wherein:
a loading module 502, configured to obtain list data in a list page when the list page is loaded;
a skip module 504, configured to receive a trigger operation corresponding to the list data, and skip to a detail page corresponding to the list data in response to the trigger operation; caching the list data, and recording a display position corresponding to the triggered list data;
and a returning module 506, configured to receive a returning operation on the detail page, read the cached list data and the display position in response to the returning operation, and reload the list page according to the display position and the cached list data.
In one embodiment, the skip module 504 is further configured to calculate the number of cache pages corresponding to the list page according to the list data; acquiring page numbers corresponding to the list pages and total page numbers of the loaded list pages; if the page number and the loaded total page number do not exceed the number of the cache pages, all the loaded list data are cached; and if the page number exceeds the number of the cache pages, or the total loaded page number exceeds the number of the cache pages, locally caching the loaded list data.
In one embodiment, the list data has a corresponding data identification. The apparatus further includes an updating module 508, configured to send a data synchronization request to the server in response to the return operation, where the data synchronization request carries a data identifier corresponding to the cached list data, so that the server returns the corresponding list data according to the data identifier; comparing whether the list data returned by the server is consistent with the cached list data or not; and if not, updating the cached list data according to the returned list data.
In one embodiment, a terminal is provided, as shown in fig. 6, which includes a processor, a non-volatile storage medium, an internal memory and a network interface, a display screen, and an input device connected by a system bus. Wherein the processor of the terminal is adapted to provide computing and control capabilities. The memory of the terminal comprises a nonvolatile storage medium and an internal memory. The nonvolatile storage medium of the terminal stores an operating system and a computer program, and the internal memory of the terminal provides an environment for the operating system and the computer program in the nonvolatile storage medium to run. The computer program is executed by a processor to implement a page display method. The network interface is used for performing network communication with the server, such as sending an HTTP request to the server, receiving list data returned by the server, and the like. The display screen of the terminal can be a liquid crystal display screen or an electronic ink display screen, and the input device can be a touch layer covered on the display screen, a key, a track ball or a touch pad arranged on a shell of the terminal, or an external keyboard, a touch pad or a mouse. The terminal can be a mobile phone, a tablet computer, a personal digital assistant or a wearable device. The processor, when executing the computer program, may perform the following steps: when the list page is loaded, list data in the list page is obtained; receiving trigger operation corresponding to the list data, and jumping to a detail page corresponding to the list data in response to the trigger operation; caching the list data, and recording a display position corresponding to the triggered list data; and receiving a return operation on the detail page, reading the cached list data and the display position in response to the return operation, and reloading the list page according to the display position and the cached list data.
Those skilled in the art will appreciate that the architecture shown in fig. 6 is a block diagram of only a portion of the architecture associated with the subject application, and does not constitute a limitation on the servers to which the subject application applies, as a particular server may include more or less components than those shown, or may combine certain components, or have a different arrangement of components.
In one embodiment, the processor, when executing the computer program, further performs the steps of: calculating the number of cache pages corresponding to the list page according to the list data; acquiring page numbers corresponding to the list pages and total page numbers of the loaded list pages; if the page number and the loaded total page number do not exceed the number of the cache pages, all the loaded list data are cached; and if the page number exceeds the number of the cache pages, or the total loaded page number exceeds the number of the cache pages, locally caching the loaded list data.
In one embodiment, the processor, when executing the computer program, further performs the steps of: the step of recording the display position corresponding to the triggered list data comprises the following steps: respectively acquiring the height of the cached first item list data, the height of the first item list data on the screen and the height of the list data between the cached first item list data and the first item list data on the screen; calculating the sum of the heights of the cached first item list data, the first item list data on the screen and the list data between the cached first item list data and the first item list data on the screen; and recording the display position of the list page according to the sum of the heights.
In one embodiment, the processor, when executing the computer program, further performs the steps of: the step of recording the display position corresponding to the triggered list data comprises the following steps: acquiring a data identifier corresponding to first item list data on a screen and a data identifier corresponding to the first item list data needing to be cached; calculating the number of data items according to the data identification corresponding to the first item list data needing to be cached and the data identification corresponding to the first item list data on the screen; acquiring the average height of the single list data; calculating the sliding distance of the list data according to the number of the data items and the average height of the single list data; and recording the display position of the triggered list data according to the sliding distance.
In one embodiment, the list data has a corresponding data identification; the processor, when executing the computer program, further performs the steps of: sending a data synchronization request to the server in response to the return operation, wherein the data synchronization request carries a data identifier corresponding to the cached list data, so that the server returns the corresponding list data according to the data identifier; comparing whether the list data returned by the server is consistent with the cached list data or not; and if not, updating the cached list data according to the returned list data.
In one embodiment, a computer-readable storage medium is provided, having a computer program stored thereon, the computer program, when executed by a processor, further performing the steps of: when the list page is loaded, list data in the list page is obtained; receiving trigger operation corresponding to the list data, and jumping to a detail page corresponding to the list data in response to the trigger operation; caching the list data, and recording a display position corresponding to the triggered list data; and receiving a return operation on the detail page, reading the cached list data and the display position in response to the return operation, and reloading the list page according to the display position and the cached list data.
In one embodiment, the computer program when executed by the processor further performs the steps of: calculating the number of cache pages corresponding to the list page according to the list data; acquiring page numbers corresponding to the list pages and total page numbers of the loaded list pages; if the page number and the loaded total page number do not exceed the number of the cache pages, all the loaded list data are cached; and if the page number exceeds the number of the cache pages, or the total loaded page number exceeds the number of the cache pages, locally caching the loaded list data.
In one embodiment, the computer program when executed by the processor further performs the steps of: respectively acquiring the height of the cached first item list data, the height of the first item list data on the screen and the height of the list data between the cached first item list data and the first item list data on the screen; calculating the sum of the heights of the cached first item list data, the first item list data on the screen and the list data between the cached first item list data and the first item list data on the screen; and recording the display position of the list page according to the sum of the heights.
In one embodiment, the computer program when executed by the processor further performs the steps of: acquiring a data identifier corresponding to first item list data on a screen and a data identifier corresponding to the first item list data needing to be cached; calculating the number of data items according to the data identification corresponding to the first item list data needing to be cached and the data identification corresponding to the first item list data on the screen; acquiring the average height of the single list data; calculating the sliding distance of the list data according to the number of the data items and the average height of the single list data; and recording the display position of the triggered list data according to the sliding distance.
In one embodiment, the list data has a corresponding data identification; the computer program when executed by the processor further performs the steps of: sending a data synchronization request to the server in response to the return operation, wherein the data synchronization request carries a data identifier corresponding to the cached list data, so that the server returns the corresponding list data according to the data identifier; comparing whether the list data returned by the server is consistent with the cached list data or not; and if not, updating the cached list data according to the returned list data.
It will be understood by those skilled in the art that all or part of the processes of the methods of the embodiments described above can be implemented by a computer program that can be stored in a non-volatile computer-readable storage medium and can be executed by associated hardware, and the computer program can include the processes of the embodiments of the methods described above. The storage medium may be a magnetic disk, an optical disk, a Read-Only Memory (ROM), or the like.
The technical features of the above embodiments can be arbitrarily combined, and for the sake of brevity, all possible combinations of the technical features in the above embodiments are not described, but should be considered as the scope of the present specification as long as there is no contradiction between the combinations of the technical features.
The above examples only show some embodiments of the present invention, and the description thereof is more specific and detailed, but not construed as limiting the scope of the invention. It should be noted that, for a person skilled in the art, several variations and modifications can be made without departing from the inventive concept, which falls within the scope of the present invention. Therefore, the protection scope of the present patent shall be subject to the appended claims.

Claims (10)

1. A page display method includes:
when a list page is loaded, obtaining list data in the list page;
receiving trigger operation corresponding to the list data, and jumping to a detail page corresponding to the list data in response to the trigger operation;
acquiring the page number of the list page and the total page number of the loaded list page, and determining list data needing to be cached according to the page number of the list page and the total page number of the loaded list page;
caching the list data, and recording the display position corresponding to the triggered list data, wherein the acquisition modes of the display positions corresponding to the triggered list data are different for list pages with different display modes:
if a plurality of list pages are displayed in a paging mode, acquiring the distance between the triggered list data and the top of a screen, or acquiring the distance between first item list data on the triggered list pages and the first item list data displayed on the screen, and acquiring the display positions corresponding to the triggered list data according to the distance;
if a plurality of list pages are continuously displayed, acquiring the distance between the triggered list data and the top of a screen, or acquiring the distance calculated according to the height of first item list data displayed on the screen, the height of first item list data required to be cached, and the height of list data between the first item list data displayed on the screen and the first item list data required to be cached, or acquiring the distance calculated according to the data identifier of the first item list data displayed on the screen and the first item list data required to be cached, and the average height of single item list data, and acquiring the display position corresponding to the triggered list data according to the distance;
receiving a return operation on the detail page, and sending a data synchronization request to the server in response to the return operation, wherein the data synchronization request carries a data identifier corresponding to the cached list data, so that the server returns the corresponding list data according to the data identifier;
comparing whether the list data returned by the server is consistent with the cached list data or not; if not, updating the cached list data according to the returned list data;
and reading the updated list data and the display position in response to the return operation, and reloading the list page according to the display position and the updated list data.
2. The method of claim 1, wherein the step of caching the list data comprises:
calculating the number of cache pages corresponding to the list page according to the list data;
acquiring page numbers corresponding to the list pages and total page numbers of the loaded list pages;
if the page number and the loaded total page number do not exceed the number of cache pages, all cache is carried out on the loaded list data;
and if the page number exceeds the number of cache pages, or the total loaded page number exceeds the number of cache pages, locally caching the loaded list data.
3. The method of claim 1, wherein the step of recording the display position corresponding to the triggered list data comprises:
respectively acquiring the height of the cached first item list data, the height of the first item list data on the screen and the height of the list data between the cached first item list data and the first item list data on the screen;
calculating the sum of the heights of the cached first item list data, the first item list data on the screen and the list data between the cached first item list data and the first item list data on the screen;
and recording the display position of the list page according to the sum of the heights.
4. The method of claim 1, wherein the step of recording the display position corresponding to the triggered list data comprises:
acquiring a data identifier corresponding to first item list data on a screen and a data identifier corresponding to the first item list data needing to be cached;
calculating the number of data items according to the data identification corresponding to the first item list data needing to be cached and the data identification corresponding to the first item list data on the screen;
acquiring the average height of the single list data;
calculating the sliding distance of the list data according to the number of the data items and the average height of the single list data;
and recording the display position of the triggered list data according to the sliding distance.
5. The method of claim 2, wherein the determining of the number of cache pages comprises:
acquiring the data size of the single-page list data according to the HTTP response header field;
and calculating to obtain the number of cache pages according to the data size of the single-page list data and a preset cache threshold, wherein the number of cache pages is the maximum value of the number of cache list pages.
6. A page display apparatus, characterized in that the apparatus comprises:
the loading module is used for acquiring list data in a list page when the list page is loaded;
the skip module is used for receiving trigger operation corresponding to the list data and skipping to a detail page corresponding to the list data in response to the trigger operation; caching the list data, and recording the display position corresponding to the triggered list data, wherein the acquisition modes of the display positions corresponding to the triggered list data are different for list pages with different display modes:
if a plurality of list pages are displayed in a paging mode, acquiring the distance between the triggered list data and the top of a screen, or acquiring the distance between first item list data on the triggered list pages and the first item list data displayed on the screen, and acquiring the display positions corresponding to the triggered list data according to the distance;
if a plurality of list pages are continuously displayed, acquiring the distance between the triggered list data and the top of a screen, or acquiring the distance calculated according to the height of first item list data displayed on the screen, the height of first item list data required to be cached, and the height of list data between the first item list data displayed on the screen and the first item list data required to be cached, or acquiring the distance calculated according to the data identifier of the first item list data displayed on the screen and the first item list data required to be cached, and the average height of single item list data, and acquiring the display position corresponding to the triggered list data according to the distance;
a returning module, configured to receive a returning operation on the detail page, and send a data synchronization request to the server in response to the returning operation, where the data synchronization request carries a data identifier corresponding to the cached list data, so that the server returns the corresponding list data according to the data identifier;
comparing whether the list data returned by the server is consistent with the cached list data or not; if not, updating the cached list data according to the returned list data;
and reading the updated list data and the display position in response to the return operation, and reloading the list page according to the display position and the updated list data.
7. The apparatus according to claim 6, wherein the skip module is further configured to calculate a number of cache pages corresponding to the list page according to the list data; acquiring page numbers corresponding to the list pages and total page numbers of the loaded list pages; if the page number and the loaded total page number do not exceed the number of cache pages, all cache is carried out on the loaded list data; and if the page number exceeds the number of cache pages, or the total loaded page number exceeds the number of cache pages, locally caching the loaded list data.
8. The apparatus of claim 6, wherein the list data has a corresponding data identification; the device also comprises an updating module used for responding to the returning operation and sending a data synchronization request to the server, wherein the data synchronization request carries a data identifier corresponding to the cached list data, so that the server returns the corresponding list data according to the data identifier; comparing whether the list data returned by the server is consistent with the cached list data or not; and if not, updating the cached list data according to the returned list data.
9. A terminal comprising a memory and a processor, the memory having stored thereon a computer program that, when executed by the processor, causes the processor to perform the steps of the method of any one of claims 1 to 5.
10. A computer-readable storage medium, on which a computer program is stored which, when being executed by a processor, carries out the steps of the method according to any one of claims 1 to 5.
CN201710712967.6A 2017-08-18 2017-08-18 Page display method, device, terminal and storage medium Active CN109032457B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201710712967.6A CN109032457B (en) 2017-08-18 2017-08-18 Page display method, device, terminal and storage medium

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201710712967.6A CN109032457B (en) 2017-08-18 2017-08-18 Page display method, device, terminal and storage medium

Publications (2)

Publication Number Publication Date
CN109032457A CN109032457A (en) 2018-12-18
CN109032457B true CN109032457B (en) 2021-01-29

Family

ID=64628553

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201710712967.6A Active CN109032457B (en) 2017-08-18 2017-08-18 Page display method, device, terminal and storage medium

Country Status (1)

Country Link
CN (1) CN109032457B (en)

Families Citing this family (14)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN109902244A (en) * 2019-01-17 2019-06-18 平安城市建设科技(深圳)有限公司 Page loading method, device, equipment and computer readable storage medium
CN111989668A (en) * 2019-02-26 2020-11-24 西安诺瓦星云科技股份有限公司 Data item display method, device and system and computer readable storage medium
CN110765398A (en) * 2019-10-14 2020-02-07 北京齐尔布莱特科技有限公司 Page content display method and mobile terminal
CN110851052B (en) * 2019-10-29 2021-03-23 维沃移动通信有限公司 Display method and flexible electronic equipment
CN110851043B (en) * 2019-11-14 2021-05-11 腾讯科技(深圳)有限公司 Page display method and device, storage medium and electronic device
CN110866202A (en) * 2019-11-15 2020-03-06 成都知道创宇信息技术有限公司 Front-end paging method and device and readable storage medium
CN111428164A (en) * 2020-03-27 2020-07-17 五八有限公司 Page display method and device, mobile terminal, electronic equipment and storage medium
CN111597488A (en) * 2020-05-06 2020-08-28 五八有限公司 Page loading method and device, electronic equipment and storage medium
CN111625167B (en) * 2020-05-28 2021-08-24 上海哔哩哔哩科技有限公司 Page switching method and device and computer equipment
CN112000255A (en) * 2020-08-21 2020-11-27 北京明略软件系统有限公司 List display method and apparatus, storage medium, and electronic apparatus
CN112836155A (en) * 2021-01-15 2021-05-25 北京高因科技有限公司 Method for increasing opening speed of detailed pages of building
CN112817977A (en) * 2021-01-28 2021-05-18 山东浪潮通软信息科技有限公司 Method for displaying and managing SaaS application by mobile terminal
CN114327453B (en) * 2021-12-17 2023-04-14 中科大数据研究院 Page display method, device, equipment and storage medium
CN117813600A (en) * 2022-06-20 2024-04-02 北京小米移动软件有限公司 Application control method, device, electronic equipment and storage medium

Citations (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN105550341A (en) * 2015-12-23 2016-05-04 北京奇虎科技有限公司 Positioning method and apparatus for returning dynamic data list page

Family Cites Families (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CA2559726C (en) * 2004-03-24 2015-10-20 A9.Com, Inc. System and method for displaying images in an online directory
US20110314395A1 (en) * 2010-06-17 2011-12-22 Microsoft Corporation Sequential and non-sequential access to records within a list
CN103699553B (en) * 2012-09-27 2017-02-15 北京新媒传信科技有限公司 Control method and device for displaying of dynamic data

Patent Citations (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN105550341A (en) * 2015-12-23 2016-05-04 北京奇虎科技有限公司 Positioning method and apparatus for returning dynamic data list page

Non-Patent Citations (1)

* Cited by examiner, † Cited by third party
Title
JS点击商品进入详情,返回后,回到原来的位置;我的头好大呀呀呀;《https://www.jianshu.com/p/f2af13698394》;20161206;第1-2页 *

Also Published As

Publication number Publication date
CN109032457A (en) 2018-12-18

Similar Documents

Publication Publication Date Title
CN109032457B (en) Page display method, device, terminal and storage medium
CN107784516B (en) Advertisement putting method and device
CN110096660B (en) Method and device for loading page pictures and electronic equipment
US20170364210A1 (en) Method and Apparatus for Displaying Content on Same Screen, and Terminal Device
EP3111339B1 (en) Systems and methods for managing content items having multiple resolutions
CN111177616B (en) Page restoration display method and device, computer equipment and storage medium
CN105051686A (en) Systems and methods for integrated recommendations
CN112114913B (en) Application program interface updating method and device, computer equipment and storage medium
CN110765379B (en) Method, device, computer equipment and storage medium for loading resource file
US11615443B2 (en) System and method to selectively update supplemental content rendered in placement regions of a rendered page
CN111259284A (en) Page lazy loading method and device, storage medium and processor
CN110377361A (en) Data load method, device, computer equipment and storage medium
US20170161235A1 (en) Device, method and system for displaying pages of a digital edition by efficient download of assets
CN108256014A (en) Page display method and device
WO2021018186A1 (en) Video update push method and terminal
CN101626339A (en) Method and system for downloading network data
CN113515717A (en) Navigation page updating method and device, electronic equipment and storage medium
CN108959393B (en) Dynamic picture processing method, device and storage medium
CN107368558B (en) Data object returning method and device
CN115933943A (en) Image display method and device and storage medium
CN112051952A (en) Picture dynamic browsing method and device, electronic equipment and readable storage medium
CN107045549B (en) Method and device for acquiring page number of electronic book
KR20100079052A (en) Method, system and computer-readable recording medium for providing web page using cache
CN111984278A (en) Method and device for acquiring animation image
CN112583702A (en) Information mass sending method and device, computer equipment and storage medium

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination
GR01 Patent grant
GR01 Patent grant