CN111552463A - Page jump method and device, computer equipment and storage medium - Google Patents

Page jump method and device, computer equipment and storage medium Download PDF

Info

Publication number
CN111552463A
CN111552463A CN202010235426.0A CN202010235426A CN111552463A CN 111552463 A CN111552463 A CN 111552463A CN 202010235426 A CN202010235426 A CN 202010235426A CN 111552463 A CN111552463 A CN 111552463A
Authority
CN
China
Prior art keywords
page
module
name
target
native
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.)
Pending
Application number
CN202010235426.0A
Other languages
Chinese (zh)
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.)
OneConnect Smart Technology Co Ltd
OneConnect Financial Technology Co Ltd Shanghai
Original Assignee
OneConnect Financial Technology Co Ltd Shanghai
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 OneConnect Financial Technology Co Ltd Shanghai filed Critical OneConnect Financial Technology Co Ltd Shanghai
Priority to CN202010235426.0A priority Critical patent/CN111552463A/en
Publication of CN111552463A publication Critical patent/CN111552463A/en
Pending legal-status Critical Current

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F8/00Arrangements for software engineering
    • G06F8/30Creation or generation of source code
    • G06F8/31Programming languages or programming paradigms
    • G06F8/315Object-oriented languages
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F9/00Arrangements for program control, e.g. control units
    • G06F9/06Arrangements for program control, e.g. control units using stored programs, i.e. using an internal store of processing equipment to receive or retain programs
    • G06F9/44Arrangements for executing specific programs
    • G06F9/445Program loading or initiating
    • G06F9/44505Configuring for program initiating, e.g. using registry, configuration files

Abstract

The embodiment of the application belongs to the technical field of computers, and relates to a page jump method, which comprises the steps of generating an RN module configuration table according to a pre-established RN module name, generating an H5module configuration table according to a pre-established static H5module name and a static H5page name, and executing a rewrite load method to generate a Native module configuration table; when monitoring that a Native terminal or an RN terminal receives a page jump request carrying a target module name and a target page name, confirming whether the target module name exists in an RN module configuration table or not; if yes, performing RN page skipping according to the target page name; if not, determining whether a target page of the page jump request is an H5page according to a preset condition; if the page is the H5page, carrying out H5page jumping according to an H5module configuration table; and if the page is not the H5page, carrying out Native page jumping according to the Native module configuration table. The application also provides a page jump device, computer equipment and a storage medium. The application adopts a unified skip mode, and the development efficiency is improved.

Description

Page jump method and device, computer equipment and storage medium
Technical Field
The present application relates to the field of computer technologies, and in particular, to a page jump method and apparatus, a computer device, and a storage medium.
Background
In the project for developing the application of the reactive-native framework, most pages are composed of RN (read native) pages written by JavaScript, and a few pages are composed of H5 pages and native (native) pages written by the native language. Such as: pages which are not easy to draw by JavaScript, such as OCR scanning, face recognition, code scanning payment and the like, are realized by native. For another example: portable modules for financing, insurance, etc. are typically implemented by H5.
Due to different languages of page writing, the RN page, the native page and the H5page jump to each other in different ways, and the jumping process is quite complicated, so that the system load is caused, and it is very important to seek a simple and uniform page jumping way.
Disclosure of Invention
The embodiment of the application aims to provide a page jump method, jump modes are uniformly set, and related personnel can directly call the set jump modes to develop software.
In order to solve the above technical problem, an embodiment of the present application provides a page jump method, which adopts the following technical solutions:
a page jump method comprises the following steps:
creating an information file storing the RN module name, and creating a group of static H5module names and static H5page names as H5module names and H5page names, respectively;
when detecting that the application is started, indicating a Native terminal to read the information file to obtain the RN module name, generating an RN module configuration table according to the obtained RN module name, generating an H5module configuration table according to the static H5module name and the static H5page name, and executing a rewrite load method to generate a Native module configuration table;
when monitoring that the Native end or the RN end receives a page jump request carrying a target module name and a target page name, confirming whether the target module name exists in the RN module configuration table or not, wherein the page jump request is used for requesting to jump to a target page;
if the target module name exists in the RN module configuration table, performing RN page skipping according to the target page name;
if the target module name does not exist, determining whether a target page of the page jump request is an H5page according to a preset condition;
if the page is the H5page, carrying out H5page jump according to an H5module configuration table; and
if the page is not the H5page, the Native page jump is directly carried out or the Native page jump is carried out according to a Native module configuration table.
Further, the step of instructing the Native terminal to read the information file to obtain the name of the RN module, and generating the RN module configuration table according to the obtained name of the RN module includes:
instructing the Native terminal to execute a module analysis script associated with an information file so as to read the information file to obtain the name of the RN module, and generating an RN module configuration table according to the obtained name of the RN module;
the step of executing the rewrite load method to generate a Native module configuration table comprises the following steps:
and indicating the Native terminal to execute a rewrite load method, loading preset Native module names and Native page names into the global array in the load method, and generating a Native module configuration table.
Further, the Native module configuration table further comprises module classes and page classes, the Native module names correspond to the module classes one by one, and the page classes correspond to the Native page names one by one; the module class and at least one page class have a corresponding relation; the step of Native page jump comprises the following steps:
acquiring a Native module configuration table according to the target module name, and determining the module class corresponding to the target module name;
determining a corresponding page class according to the target page name and the determined module class;
selecting a pre-configured controller according to the page class;
and Native page skipping is carried out through the controller.
Further, the RN module name starts with react _ native; the steps of instructing the Native terminal to execute a module analysis script associated with an information file, reading the information file to acquire the RN module name, and generating an RN module configuration table according to the acquired RN module name include:
instructing the Native terminal to execute a module analysis script associated with an information file, and reading a module name beginning with a react _ Native in the information file;
generating an RN module configuration table according to the acquired RN module name;
and storing the RN module configuration table into a JavaScript global array.
Further, the step of determining whether the target page of the page jump request is an H5page according to a preset condition includes:
when monitoring that the Native terminal receives a page jump request carrying a target module name and a target page name and the RN module configuration table does not have the target module name, acquiring the H5module configuration table, and judging whether the target module name is the same as the static H5module name;
if the target module name is the same as the static H5module name, confirming that a target page of the page jump request is an H5 page;
the page jump request also carries a target page jump transfer parameter, and the target page jump transfer parameter carries a URL;
the step of performing H5page jump comprises the following steps:
and acquiring a URL (uniform resource locator) through the target page jump transfer parameter, and performing H5page jump through the URL.
Further, the page jump request also carries a target page jump transfer parameter;
the step of performing RN page jump according to the target page name comprises the following steps:
when RN page skipping is carried out according to the target page name, custom information in the last page of the target page is obtained according to the target page skipping transmission parameter;
and transmitting the custom information to a target page.
Further, the step of confirming whether the target page of the page jump request is an H5page according to the preset condition includes:
when the RN end is monitored to receive a page jump request carrying a target module name and a target page name and the RN module configuration table does not have the target module name, identifying the page jump request;
judging whether the page jump request carries a URL or not;
if the page jump request carries a URL, confirming that a target page of the page jump request is an H5 page;
the step of performing H5page jump further comprises:
and transmitting the target module name and the target page name to the Native terminal to indicate the Native terminal to carry out H5page jump.
In order to solve the above technical problem, an embodiment of the present application further provides a page jump apparatus, which adopts the following technical scheme:
a page jump apparatus comprising:
the creating module is used for creating an information file for storing the RN module name and creating a group of static H5module names and static H5page names as H5module names and H5page names respectively; (ii) a
The generation module is used for indicating a Native terminal to read the information file to acquire the name of the RN module when application starting is detected, generating an RN module configuration table according to the acquired name of the RN module, generating an H5module configuration table according to the static H5module name and the static H5page name, and executing a rewrite load method to generate the Native module configuration table;
the first confirming module is used for confirming whether the target module name exists in the RN module configuration table or not when monitoring that the Native end or the RN end receives a page jump request carrying the target module name and the target page name, wherein the page jump request is used for requesting to jump to a target page;
and the first skip module is used for performing RN page skip according to the target page name if the target module name exists in the RN module configuration table.
A second confirming module, configured to confirm whether a target page of the page jump request is an H5page according to a preset condition if the target module name does not exist;
the second jumping module carries out H5page jumping according to the H5module configuration table if the page is an H5 page; and
and if the third skip module is not the H5page, directly performing Native page skip or performing Native page skip according to a Native module configuration table.
In order to solve the above technical problem, an embodiment of the present application further provides a computer device, which adopts the following technical solutions:
a computer device comprising a memory and a processor, the memory having stored therein a computer program, the processor implementing the steps of a page jump method as described above when executing the computer program.
In order to solve the above technical problem, an embodiment of the present application further provides a computer-readable storage medium, which adopts the following technical solutions:
a computer-readable storage medium, on which a computer program is stored which, when being executed by a processor, carries out the steps of a page jump method as described above.
Compared with the prior art, the embodiment of the application mainly has the following beneficial effects: the method comprises the steps of generating an RN configuration module table, a Native configuration module table and an H5 configuration module table, analyzing an incoming target module name and a target page name by using a unified method to judge what type of page the page jump of the page request belongs to, and further sending corresponding module names, page names and page parameters to complete the page jump.
In the method provided by the application, service developers do not need to care about internal implementation logic, and can call the method to perform page skipping by only knowing the name of a module and the name of a page to be skipped, so that the learning cost of how the RN page skips the Native page and the H5page, how the Native page skips the RN page and the H5page and the like is saved, and the development efficiency is greatly improved.
Drawings
In order to more clearly illustrate the solution of the present application, the drawings needed for describing the embodiments of the present application will be briefly described below, and it is obvious that the drawings in the following description are some embodiments of the present application, and that other drawings can be obtained by those skilled in the art without inventive effort.
FIG. 1 is an exemplary system architecture diagram in which the present application may be applied;
FIG. 2 is a flow diagram of one embodiment of a page jump method according to the present application;
FIG. 3 is a schematic diagram of an embodiment of a page jump apparatus according to the present application;
FIG. 4 is a schematic block diagram of one embodiment of a computer device according to the present application.
Reference numerals: 200. a computer device; 201. a memory; 202. a processor; 203. a network interface; 300. a page jump device; 301. a creation module; 302. a generation module; 303. a confirmation module; 304. and a first skip module.
Detailed Description
Unless defined otherwise, all technical and scientific terms used herein have the same meaning as commonly understood by one of ordinary skill in the art to which this application belongs; the terminology used in the description of the application herein is for the purpose of describing particular embodiments only and is not intended to be limiting of the application; the terms "including" and "having," and any variations thereof, in the description and claims of this application and the description of the above figures are intended to cover non-exclusive inclusions. The terms "first," "second," and the like in the description and claims of this application or in the above-described drawings are used for distinguishing between different objects and not for describing a particular order.
Reference herein to "an embodiment" means that a particular feature, structure, or characteristic described in connection with the embodiment can be included in at least one embodiment of the application. The appearances of the phrase in various places in the specification are not necessarily all referring to the same embodiment, nor are separate or alternative embodiments mutually exclusive of other embodiments. It is explicitly and implicitly understood by one skilled in the art that the embodiments described herein can be combined with other embodiments.
In order to make the technical solutions better understood by those skilled in the art, the technical solutions in the embodiments of the present application will be clearly and completely described below with reference to the accompanying drawings.
As shown in fig. 1, the system architecture 100 may include terminal devices 101, 102, 103, a network 104, and a server 105. The network 104 serves as a medium for providing communication links between the terminal devices 101, 102, 103 and the server 105. Network 104 may include various connection types, such as wired, wireless communication links, or fiber optic cables, to name a few.
The user may use the terminal devices 101, 102, 103 to interact with the server 105 via the network 104 to receive or send messages or the like. The terminal devices 101, 102, 103 may have various communication client applications installed thereon, such as a web browser application, a shopping application, a search application, an instant messaging tool, a mailbox client, social platform software, and the like.
The terminal devices 101, 102, 103 may be various electronic devices having a display screen and supporting web browsing, including but not limited to smart phones, tablet computers, e-book readers, MP3 players (Moving Picture experts Group Audio Layer III, mpeg compression standard Audio Layer 3), MP4 players (Moving Picture experts Group Audio Layer IV, mpeg compression standard Audio Layer 4), laptop portable computers, desktop computers, and the like.
The server 105 may be a server providing various services, such as a background server providing support for pages displayed on the terminal devices 101, 102, 103.
It should be noted that the page jump method provided in the embodiment of the present application is generally executed by a server/terminal device, and accordingly, the page jump apparatus is generally disposed in the server/terminal device.
It should be understood that the number of terminal devices, networks, and servers in fig. 1 is merely illustrative. There may be any number of terminal devices, networks, and servers, as desired for implementation.
With continued reference to FIG. 2, a flow diagram of one embodiment of a method of different types of page hopping is shown, in accordance with the present application. The page jump method comprises the following steps:
s1: creating an information file storing the RN module name, and creating a group of static H5module names and static H5page names as H5module names and H5page names, respectively; .
In this embodiment, the information file is in JSON format and named modules. The information file stores application module information, wherein the application module information comprises an RN module name, a warehouse address and a branch name of an application; the branch names are used for the manager to judge the version of the module in the application, and version control is facilitated. JSON (JavaScript Object Notation) is a lightweight data exchange format. The file is set to be in a JSON format, so that the file is easy to read and write by people, is easy to analyze and generate by a machine, and effectively improves the network transmission efficiency.
S2: when detecting that the application is started, indicating a Native terminal to read the information file to obtain the RN module name, generating an RN module configuration table according to the obtained RN module name, generating an H5module configuration table according to the static H5module name and the static H5page name, and executing a rewrite load method to generate the Native module configuration table.
In the embodiment, an RN module configuration table, a Native module configuration table and an H5module configuration table are generated, so that the RN module configuration table, the Native module configuration table and the H5module configuration table are convenient to store, record and view; in the prior art, an H5Page does not relate to information such as a Module Id (Module Id) and a Page name (Page Id), and different pages can be displayed only according to different incoming URLs (Uniform Resource locators). For example, the Module name of H5 is set to H5Module and the Page name is set to H5 Page.
Specifically, in step S2, that is, the step of instructing the Native terminal to read the information file to obtain the name of the RN module, and generating the RN module configuration table according to the obtained name of the RN module includes:
instructing a Native terminal to execute a module analysis script associated with the information file so as to read the information file to acquire an RN module name, and generating an RN module configuration table according to the acquired RN module name;
in step S2, the step of generating a Native module configuration table by executing the rewrite load method includes:
and instructing the Native terminal to execute a rewrite load method, loading preset Native module names and Native page names into the global array in the load method, and generating a Native module configuration table.
In this embodiment, the information file is read by the module parsing script to improve the reading speed. The Native module name and the Native page name are added by executing the rewrite load method according to the preset module name and the preset page name.
Further, the RN module name starts with react _ native; the step of instructing the Native terminal to execute a module analysis script associated with the information file so as to read the information file to acquire the name of the RN module, and generating the RN module configuration table according to the acquired name of the RN module comprises the following steps:
instructing a Native terminal to execute a module analysis script associated with an information file, and reading a module name beginning with a react _ Native in the information file;
generating an RN module configuration table according to the acquired RN module name;
and storing the RN module configuration table into a JavaScript global array.
In this embodiment, a module name beginning with a react _ native is extracted from a modules json file by executing a module parse (module parse) script; the name of the RN module is react _ native/xxx, and the native module is named directly by xxx. For the scheme that the RN module configuration table is stored into the local array, the RN module configuration table disappears after the page is closed; the RN module configuration table is stored in the global array, and the global array always exists in the Application (APP), so that the RN module configuration table always exists in the Application (APP) even if the page is closed. The RN module table, the H5module table and the Native module table are respectively and independently existed, when the module jumps, the RN module configuration table is firstly obtained through the Java Script global array, the RN configuration module table is traversed, then the H5module table is configured, and finally the Native configuration module table is configured.
S3: when a Native terminal or an RN terminal receives a page jump request carrying a target module name and a target page name to jump to a target page, whether the target module name exists in an RN module configuration table is confirmed, wherein the page jump request is used for requesting to jump to the target page.
In the embodiment, because the number of pages of the item RN is more, the method and the device preferentially search from an RN configuration module table; if the RN module configuration table has a target module name, performing RN page jump according to the target page name, where in the present application, because one module may have multiple page jumps, the module name and the page name are in a one-to-many relationship, for example: the module names are all activated-native-deposit, but for the concept of deposit, a current period and a regular period also exist, and the current period and the regular period respectively correspond to different pages; so the module name is the module of the reactive _ native-deposit, and the corresponding page names can be the current deposit and the periodic deposit. The method also comprises the following steps: when skipping to a code scanning page, the code scanning is divided into a main scanning page and a scanned page, the module names are the same, and the page names can be respectively marked as the main scanning page and the scanned page; the method comprises the steps of firstly determining the category of a page needing to be jumped through the name of a target module, and then further determining the page needing to be jumped under the category through the name of the target page, for example: the category of the scanned page is determined by the name of the target module, and then the page is determined as the main scanning page by the name of the target page.
S4: and if the target module name exists in the RN module configuration table, performing RN page skip according to the target page name.
In this embodiment, it may be determined that the current end is the Native end or the RN end by monitoring the received page jump request. The general page jump process is executed at a Native end, but when the current end is an RN end and is confirmed to be RN page jump, the jump can be executed after the RN end directly analyzes without passing through the Native end, so that the performance loss is reduced; however, when the current end is the RN end and the Native page jump and the H5page jump are confirmed, the jump is still executed by the Native end.
Specifically, the page jump request also carries a target page jump transfer parameter; in step S4, that is, the step of performing RN page jump according to the target page name includes: when RN page skipping is carried out according to the name of a target page, custom information in the previous page is obtained according to the skipping transmission parameter of the target page; and transmitting the custom information to a target page.
In this embodiment, the target Page jump transfer parameter (Page Config) is an initialization transfer parameter after jumping to a Page, and is used to transfer the custom information (flag) in the previous Page, where the custom information is data input by a user in the previous Page, rather than pre-configured data. The self-defined information can be user names, titles and other specific contents; such as: whether the jump is from the main page or the personal page, the target page jump transfer parameter (PageConfig) can carry a piece of custom information, and when the jump enters the next page, the system can extract the custom information through the target page jump transfer parameter to carry out the next processing. Such as: in the previous page, the user inputs XX in the user name column; when jumping to the next page, the XX in the user name column of the previous page needs to be acquired through the target page jumping transfer parameter, so as to realize the transfer of the mark and realize the unification of the information in the page.
Of course, when Native page jump and H5page jump are performed, the user-defined information can be obtained through the target page jump transfer parameter and transmitted to the target page.
S5: if the target module name does not exist, determining whether a target page of the page jump request is an H5page according to a preset condition;
s6: and if the page is H5, performing H5page jump according to the H5module configuration table.
In this embodiment, after excluding the RN page, first check whether the page is an H5page, because the module name and the page name of the H5page are fixed, it is not necessary to traverse the array to cause unnecessary performance loss, thereby improving efficiency.
Specifically, in step S5, the step of confirming whether the target page of the page jump request is an H5page according to the preset condition includes:
when a Native terminal receives a page jump request carrying a target module name and a target page name and the RN module configuration table does not have the target module name, acquiring the H5module configuration table, and judging whether the target module name is the same as the static H5module name;
if the target module name is the same as the static H5module name, confirming that a target page of a page jump request is an H5 page;
the page jump request also carries a target page jump transfer parameter, and the target page jump transfer parameter carries a URL;
in step S6, the step of performing H5page jump includes:
and acquiring a URL (uniform resource locator) through the target page jump transfer parameter, and performing H5page jump through the URL.
In this embodiment, after excluding the RN page, first check to see whether the page is an H5page, because the module name and the page name of the H5page are fixed, it is not necessary to traverse the array to cause unnecessary performance loss, and if the incoming target module name is consistent with the static H5module name, the H5page jump is directly performed through the URL.
Of course, the step of confirming whether the target page of the page jump request is the H5page according to the preset condition in the step S5 may include:
when monitoring that the RN end receives a page jump request carrying a target module name and a target page name and the RN module configuration table does not have the target module name, identifying the page jump request;
judging whether the page jump request carries a URL or not;
if the page jump request carries a URL, confirming that a target page of the page jump request is an H5 page;
in step S6, before the step of performing H5page jump, the method further includes:
and transmitting the target module name and the target page name to a Native terminal to indicate the Native terminal to carry out H5page jump.
In this embodiment, when a page jump request carrying a target module name, a target page name and a target page name jump transfer parameter is received, whether the target module name exists in an RN module configuration table is preferentially searched, and if so, page jump inside the RN is directly performed; if not, judging whether the page jump request carries a URL or not, if so, judging that the name of the target module is the name of an H5module, and transmitting the name of the target module and the name of the target page to a Native end so as to indicate the Native end to carry out H5page jump; if the page jump request does not carry the URL, judging that the name of the target module is the Native module name, and transmitting the name of the target module and the name of the target page to a Native end so as to indicate the Native end to carry out Native page jump. In addition, when the page jump is performed at the Native end or the RN end, the corresponding controller needs to be found through the H5module configuration table or the RN module configuration table for performing the page jump.
The method avoids that each page jump of the RN needs to be carried out to the Native end, and can directly carry out analysis at the RN end without passing through the Native end, thereby reducing performance loss. Because the kernel of the RN (read-Native) runs on the RN page and is essentially the page written in the JS language, the page inside the RN jumps, namely the JS page is loaded on the JS page, and performance loss is low because Native interaction is not involved. Because H5 can jump directly through the URL, the module name and the page name are not needed, so that the scheme can determine whether to jump to the H5page in a manner of directly judging whether the URL exists. The module name and the page name are configured for H5, so as to be unified with the jump mode of the Native page and the RN page.
S7: if the page is not the H5page, the Native page jump is directly carried out or the Native page jump is carried out according to a Native module configuration table.
In this embodiment, in the present application, for a reactive-Native project, the types of a page of an application include only an RN page, a Native page, and an H5page, so if the name of a target module is not consistent with the static name of an H5module, the target page of the page jump request may be considered as a Native page, and the name of the target module is definitely the name of a Native module, so that Native page jump is directly performed. The Native page skip method and the Native page skip device can also carry out Native page skip according to the name of the target page if the Native module configuration table comprises the name of the target module by confirming whether the Native module configuration table comprises the name of the target module. And if the Native module configuration table does not contain the target module name, acquiring error information and sending the error information to related personnel so as to ensure the availability of the unified jump method and improve the development efficiency.
More specifically, the Native module configuration table further includes a module class and a page class, the Native module names correspond to the module classes one by one, and the page class corresponds to the Native page names one by one; the module class and at least one page class have a corresponding relation; the step of Native page jump comprises the following steps:
acquiring a Native module configuration table according to the name of a target module, and determining a module class corresponding to the name of the target module;
determining a corresponding page class according to the target page name and the determined module class;
selecting a pre-configured controller according to the page class;
and Native page jumping is carried out through the controller.
In this embodiment, the Native module configuration table further includes a module class (modulecolass) and a page class (pageClass), where the module class corresponds to the Native module name one by one, and the page class corresponds to the Native page name one by one. After APP (application) starts, rewriting all class load methods; and each Native page name in the Native module configuration table corresponds to a page class. The following table is taken as an example of a generated Native module configuration table:
TABLE 1 Native Module configuration Table
First module name Class one module
Page First page name First page class
Second page name Second page class
Second Module name Second module class
Page First page name Class III page
Second page name Fourth step ofPages class
Third page name Class V Page
Name of third module Class III module
Page First page name Class six
…… …… ……
In the Native module configuration table, page names under any two different module names can be the same or different, and when contents in the Native module configuration table are searched, the module name is located first, and then the page name under the module name is located, so that even if the page names under different module names are repeated, interference cannot be caused; in the actual operation process, the setting can be flexibly carried out. In the application, the specific skipping mode of the Native page is as follows: according to the difference between the target module name and the static H5module name, the type of the page needing to be jumped is considered to be a Native page, and a module class (moduleClass) corresponding to the target module name in a Native module configuration table is obtained according to the target module name; after a module class (moduleClass) is determined, a page class (pageClass) corresponding to a target page name under the module class is obtained according to the target page name, the page class (pageClass) is positioned to a controller according to the page class (pageClass), wherein the controller is Activity or ViewController, and then a page jump process is executed through the Activity or ViewController, wherein the Activity is a controller of ios, and the ViewController is a controller of Android; and respectively controlling display pages adapted to ios or Android.
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, which can be stored in a computer-readable storage medium, and can include the processes of the embodiments of the methods described above when the computer program is executed. The storage medium may be a non-volatile storage medium such as a magnetic disk, an optical disk, a Read-Only Memory (ROM), or a Random Access Memory (RAM).
It should be understood that, although the steps in the flowcharts of the figures are shown in order as indicated by the arrows, the steps are not necessarily performed in order as indicated by the arrows. The steps are not performed in the exact order shown and may be performed in other orders unless explicitly stated herein. Moreover, at least a portion of the steps in the flow chart of the figure may include multiple sub-steps or multiple stages, which are not necessarily performed at the same time, but may be performed at different times, which are not necessarily performed in sequence, but may be performed alternately or alternately with other steps or at least a portion of the sub-steps or stages of other steps.
With further reference to fig. 3, as an implementation of the method shown in fig. 2, the present application provides an embodiment of a page jump apparatus, where the embodiment of the apparatus corresponds to the embodiment of the method shown in fig. 2, and the apparatus may be applied to various electronic devices.
As shown in fig. 4, the page jump apparatus 300 according to the present embodiment includes: a creation module 301, a generation module 302, a confirmation module 303, a first hopping module 304, a second confirmation module 305, a second hopping module 306, and a third hopping module 307. Wherein:
a creating module 301, configured to create an information file storing RN module names, and create a set of static H5module names and static H5page names as H5module names and H5page names, respectively; (ii) a
A generating module 302, configured to, when it is detected that an application is started, instruct a Native terminal to read the information file to obtain an RN module name, generate an RN module configuration table according to the obtained RN module name, generate an H5module configuration table according to the static H5module name and the static H5page name, and execute a rewrite load method to generate a Native module configuration table;
a first confirming module 303, configured to confirm whether a target module name exists in an RN module configuration table when a Native terminal or an RN terminal receives a page jump request carrying the target module name and a target page name, where the page jump request is used to request a jump to a target page;
a first skip module 304, configured to perform, if the target module name exists in the RN module configuration table, a RN page skip according to the target page name.
A second confirming module 305, configured to confirm whether a target page of the page jump request is an H5page according to a preset condition if the target module name does not exist;
the second skip module 306, if the page is an H5page, performs H5page skip according to the H5module configuration table; and
if the third jump module 307 is not the H5page, it directly performs Native page jump or performs Native page jump according to the Native module configuration table.
In some optional implementations of this embodiment, the generating module 302 includes a parsing submodule and a rewriting submodule; and the analysis submodule is used for indicating a Native terminal to execute a module analysis script associated with the information file so as to read the information file to acquire the name of the RN module and generate an RN module configuration table according to the acquired name of the RN module. The rewriting submodule is used for indicating a Native end to execute a rewriting load method, and loading a preset Native module name and a Native page name into a global array in the load method to generate a Native module configuration table.
The third skip module 307 includes a first determining sub-module, a second determining sub-module, a pre-configuration sub-module, and a skip sub-module. The first determining submodule is used for acquiring a Native module configuration table according to the name of a target module and determining a module class corresponding to the name of the target module; the second determining submodule is used for determining a corresponding page class according to the target page name and the determined module class; the pre-configuration sub-module is used for selecting a pre-configured controller according to the page class; and the skip submodule is used for carrying out Native page skip through the controller.
The generation module also comprises an execution submodule, a generation submodule and a storage submodule; the execution submodule is used for indicating a Native end to execute a module analysis script related to an information file and reading a module name beginning with a react _ Native in the information file; the generating submodule is used for generating an RN module configuration table according to the acquired RN module name; the storage submodule is used for storing the RN module configuration table into a JavaScript global array.
The first skip module comprises an acquisition submodule and a transmission submodule. The acquisition submodule is used for acquiring custom information in the last page of a target page according to the target page jump transfer parameter while performing RN page jump according to the target page name; and the transmission submodule is used for transmitting the custom information to a target page.
The second confirmation module comprises a first monitoring submodule and a first confirmation submodule,
The first monitoring submodule is used for acquiring the H5module configuration table and judging whether the target module name is the same as the static H5module name or not when a monitoring terminal receives a page jump request carrying the target module name and the target page name and the RN module configuration table does not have the target module name;
the first confirming submodule is used for confirming that a target page of a page jump request is an H5page when the name of the target module is the same as that of the static H5 module;
the page jump request also carries a target page jump transfer parameter, and the target page jump transfer parameter carries a URL;
the second skip module is further configured to obtain a URL through the target page skip transmission parameter, and perform H5page skip through the URL.
The second confirmation module comprises a second monitoring submodule, a judgment submodule and a second confirmation submodule
The second monitoring sub-module is used for identifying the page jump request when the RN terminal receives the page jump request carrying the name of the target module and the name of the target page and the RN module configuration table does not have the name of the target module;
the judging submodule is used for judging whether the page jump request carries a URL or not;
the second confirming submodule is used for confirming that a target page of the page jump request is an H5page when the page jump request carries a URL;
the page jump device further comprises an indication module, and the indication module is used for transmitting the target module name and the target page name to the Native end so as to indicate the Native end to carry out H5page jump.
The existing skipping process requires a developer to learn the skipping process of each page in advance; the method is a method for pre-packaging all page jumping processes into a unified jumping page, so that developers only need to call uniformly. The method comprises the steps of generating an RN configuration module table, a Native configuration module table and an H5 configuration module table, analyzing an incoming target module name and a target page name by using a unified method to judge what type of page the page jump of the page request belongs to, and further sending corresponding module names, page names and page parameters to complete the page jump.
In the method provided by the application, service developers do not need to care about internal implementation logic, and can call the method to perform page skipping by only knowing the name of a module and the name of a page to be skipped, so that the learning cost of how the RN page skips the Native page and the H5page, how the Native page skips the RN page and the H5page and the like is saved, and the development efficiency is greatly improved.
In order to solve the technical problem, an embodiment of the present application further provides a computer device. Referring to fig. 4, fig. 4 is a block diagram of a basic structure of a computer device according to the present embodiment.
The computer device 200 comprises a memory 201, a processor 202, a network interface 203 communicatively connected to each other via a system bus. It is noted that only computer device 200 having components 201 and 203 is shown, but it is understood that not all of the illustrated components are required and that more or fewer components may alternatively be implemented. As will be understood by those skilled in the art, the computer device is a device capable of automatically performing numerical calculation and/or information processing according to a preset or stored instruction, and the hardware includes, but is not limited to, a microprocessor, an Application Specific Integrated Circuit (ASIC), a Programmable Gate Array (FPGA), a Digital Signal Processor (DSP), an embedded device, and the like.
The computer device can be a desktop computer, a notebook, a palm computer, a cloud server and other computing devices. The computer equipment can carry out man-machine interaction with a user through a keyboard, a mouse, a remote controller, a touch panel or voice control equipment and the like.
The memory 201 includes at least one type of readable storage medium including a flash memory, a hard disk, a multimedia card, a card type memory (e.g., SD or DX memory, etc.), a Random Access Memory (RAM), a Static Random Access Memory (SRAM), a Read Only Memory (ROM), an Electrically Erasable Programmable Read Only Memory (EEPROM), a Programmable Read Only Memory (PROM), a magnetic memory, a magnetic disk, an optical disk, etc. In some embodiments, the storage 201 may be an internal storage unit of the computer device 200, such as a hard disk or a memory of the computer device 200. In other embodiments, the memory 201 may also be an external storage device of the computer device 200, such as a plug-in hard disk, a Smart Media Card (SMC), a Secure Digital (SD) Card, a Flash memory Card (Flash Card), or the like, provided on the computer device 200. Of course, the memory 201 may also include both internal and external storage devices of the computer device 200. In this embodiment, the memory 201 is generally used for storing an operating system installed in the computer device 200 and various application software, such as program codes of a page jump method. Further, the memory 201 may also be used to temporarily store various types of data that have been output or are to be output.
The processor 202 may be a Central Processing Unit (CPU), controller, microcontroller, microprocessor, or other data Processing chip in some embodiments. The processor 202 is generally operative to control overall operation of the computer device 200. In this embodiment, the processor 202 is configured to run a program code stored in the memory 201 or process data, for example, a program code for running the page jump method.
The network interface 203 may comprise a wireless network interface or a wired network interface, and the network interface 203 is generally used for establishing communication connection between the computer device 200 and other electronic devices.
In the embodiment, service developers do not need to care about internal implementation logic, and can call the method for page skipping by only knowing the name of a module and the name of a page to be skipped, so that the learning cost of how the RN page skips the Native page and the H5page, how the Native page skips the RN page and the H5page and the like is saved, and the development efficiency is greatly improved.
The present application further provides another embodiment, which is to provide a computer-readable storage medium storing different types of page jump programs, which are executable by at least one processor to cause the at least one processor to perform the steps of the page jump method as described above.
In the embodiment, service developers do not need to care about internal implementation logic, and can call the method for page skipping by only knowing the name of a module and the name of a page to be skipped, so that the learning cost of how the RN page skips the Native page and the H5page, how the Native page skips the RN page and the H5page and the like is saved, and the development efficiency is greatly improved.
Through the above description of the embodiments, those skilled in the art will clearly understand that the method of the above embodiments can be implemented by software plus a necessary general hardware platform, and certainly can also be implemented by hardware, but in many cases, the former is a better implementation manner. Based on such understanding, the technical solutions of the present application may be embodied in the form of a software product, which is stored in a storage medium (such as ROM/RAM, magnetic disk, optical disk) and includes instructions for enabling a terminal device (such as a mobile phone, a computer, a server, an air conditioner, or a network device) to execute the method according to the embodiments of the present application.
It is to be understood that the above-described embodiments are merely illustrative of some, but not restrictive, of the broad invention, and that the appended drawings illustrate preferred embodiments of the invention and do not limit the scope of the invention. This application is capable of embodiments in many different forms and is provided for the purpose of enabling a thorough understanding of the disclosure of the application. Although the present application has been described in detail with reference to the foregoing embodiments, it will be apparent to one skilled in the art that the present application may be practiced without modification or with equivalents of some of the features described in the foregoing embodiments. All equivalent structures made by using the contents of the specification and the drawings of the present application are directly or indirectly applied to other related technical fields and are within the protection scope of the present application.

Claims (10)

1. A page jump method is characterized by comprising the following steps:
creating an information file storing the RN module name, and creating a group of static H5module names and static H5page names as H5module names and H5page names, respectively;
when detecting that the application is started, indicating a Native terminal to read the information file to obtain the RN module name, generating an RN module configuration table according to the obtained RN module name, generating an H5module configuration table according to the static H5module name and the static H5page name, and executing a rewrite load method to generate a Native module configuration table;
when monitoring that the Native end or the RN end receives a page jump request carrying a target module name and a target page name, confirming whether the target module name exists in the RN module configuration table or not, wherein the page jump request is used for requesting to jump to a target page;
if the target module name exists in the RN module configuration table, performing RN page skipping according to the target page name;
if the target module name does not exist, determining whether a target page of the page jump request is an H5page according to a preset condition;
if the page is the H5page, carrying out H5page jump according to an H5module configuration table; and
if the page is not the H5page, the Native page jump is directly carried out or the Native page jump is carried out according to a Native module configuration table.
2. The page turning method according to claim 1, wherein the step of instructing a Native terminal to read the information file to obtain the RN module name and generating an RN module configuration table according to the obtained RN module name includes:
instructing the Native terminal to execute a module analysis script associated with an information file so as to read the information file to obtain the name of the RN module, and generating an RN module configuration table according to the obtained name of the RN module;
the step of executing the rewrite load method to generate a Native module configuration table comprises the following steps:
and indicating the Native terminal to execute a rewrite load method, loading preset Native module names and Native page names into the global array in the load method, and generating a Native module configuration table.
3. The page jump method according to claim 2, wherein the Native module configuration table further comprises a module class and a page class, the Native module name corresponds to the module class one to one, and the page class corresponds to the Native page name one to one; the module class and at least one page class have a corresponding relation; the step of Native page jump comprises the following steps:
acquiring a Native module configuration table according to the target module name, and determining the module class corresponding to the target module name;
determining a corresponding page class according to the target page name and the determined module class;
selecting a pre-configured controller according to the page class;
and Native page skipping is carried out through the controller.
4. The page jump method according to claim 2, wherein said RN module name starts with a react _ native; the steps of instructing the Native terminal to execute a module analysis script associated with an information file, reading the information file to acquire the RN module name, and generating an RN module configuration table according to the acquired RN module name include:
instructing the Native terminal to execute a module analysis script associated with an information file, and reading a module name beginning with a react _ Native in the information file;
generating an RN module configuration table according to the acquired RN module name;
and storing the RN module configuration table into a JavaScript global array.
5. The page jump method according to claim 4, wherein said step of confirming whether the target page of said page jump request is H5page according to preset conditions comprises:
when monitoring that the Native terminal receives a page jump request carrying a target module name and a target page name and the RN module configuration table does not have the target module name, acquiring the H5module configuration table, and judging whether the target module name is the same as the static H5module name;
if the target module name is the same as the static H5module name, confirming that a target page of the page jump request is an H5 page;
the page jump request also carries a target page jump transfer parameter, and the target page jump transfer parameter carries a URL;
the step of performing H5page jump comprises the following steps:
and acquiring a URL (uniform resource locator) through the target page jump transfer parameter, and performing H5page jump through the URL.
6. The page jump method according to claim 1, wherein said page jump request further carries a target page jump delivery parameter;
the step of performing RN page jump according to the target page name comprises the following steps:
when RN page skipping is carried out according to the target page name, custom information in the last page of the target page is obtained according to the target page skipping transmission parameter;
and transmitting the custom information to a target page.
7. The page jump method according to claim 1, wherein said step of confirming whether the target page of the page jump request is H5page according to the preset condition comprises:
when the RN end is monitored to receive a page jump request carrying a target module name and a target page name and the RN module configuration table does not have the target module name, identifying the page jump request;
judging whether the page jump request carries a URL or not;
if the page jump request carries a URL, confirming that a target page of the page jump request is an H5 page;
the step of performing H5page jump further comprises:
and transmitting the target module name and the target page name to the Native terminal to indicate the Native terminal to carry out H5page jump.
8. A page jump apparatus, comprising:
the creating module is used for creating an information file for storing the RN module name and creating a group of static H5module names and static H5page names as H5module names and H5page names respectively; (ii) a
The generation module is used for indicating a Native terminal to read the information file to acquire the name of the RN module when application starting is detected, generating an RN module configuration table according to the acquired name of the RN module, generating an H5module configuration table according to the static H5module name and the static H5page name, and executing a rewrite load method to generate the Native module configuration table;
the first confirming module is used for confirming whether the target module name exists in the RN module configuration table or not when monitoring that the Native end or the RN end receives a page jump request carrying the target module name and the target page name, wherein the page jump request is used for requesting to jump to a target page;
the first skip module is used for performing RN page skip according to the target page name if the target module name exists in the RN module configuration table;
a second confirming module, configured to confirm whether a target page of the page jump request is an H5page according to a preset condition if the target module name does not exist;
the second jumping module carries out H5page jumping according to the H5module configuration table if the page is an H5 page; and
and if the third skip module is not the H5page, directly performing Native page skip or performing Native page skip according to a Native module configuration table.
9. A computer device comprising a memory in which a computer program is stored and a processor which, when executing the computer program, carries out the steps of a page jump method according to any one of claims 1 to 7.
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 a page jump method according to any one of claims 1 to 7.
CN202010235426.0A 2020-03-27 2020-03-27 Page jump method and device, computer equipment and storage medium Pending CN111552463A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202010235426.0A CN111552463A (en) 2020-03-27 2020-03-27 Page jump method and device, computer equipment and storage medium

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202010235426.0A CN111552463A (en) 2020-03-27 2020-03-27 Page jump method and device, computer equipment and storage medium

Publications (1)

Publication Number Publication Date
CN111552463A true CN111552463A (en) 2020-08-18

Family

ID=72003781

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202010235426.0A Pending CN111552463A (en) 2020-03-27 2020-03-27 Page jump method and device, computer equipment and storage medium

Country Status (1)

Country Link
CN (1) CN111552463A (en)

Cited By (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN113177787A (en) * 2021-04-13 2021-07-27 北京健康之家科技有限公司 Cloud mobile phone payment method and device, storage medium and computer equipment
CN113434230A (en) * 2021-06-24 2021-09-24 青岛海尔科技有限公司 Jump control method and device for H5 page, storage medium and electronic device
CN114090145A (en) * 2021-10-26 2022-02-25 青岛海尔科技有限公司 Page jump determining method and device, storage medium and electronic device

Cited By (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN113177787A (en) * 2021-04-13 2021-07-27 北京健康之家科技有限公司 Cloud mobile phone payment method and device, storage medium and computer equipment
CN113434230A (en) * 2021-06-24 2021-09-24 青岛海尔科技有限公司 Jump control method and device for H5 page, storage medium and electronic device
CN114090145A (en) * 2021-10-26 2022-02-25 青岛海尔科技有限公司 Page jump determining method and device, storage medium and electronic device
CN114090145B (en) * 2021-10-26 2024-03-22 青岛海尔科技有限公司 Page jump determining method and device, storage medium and electronic device

Similar Documents

Publication Publication Date Title
CN111552463A (en) Page jump method and device, computer equipment and storage medium
CN112416458A (en) Preloading method and device based on ReactNative, computer equipment and storage medium
CN112631924A (en) Automatic testing method and device, computer equipment and storage medium
CN116644213A (en) XML file reading method, device, equipment and storage medium
CN104899203B (en) Webpage generation method and device and terminal equipment
CN111475237A (en) Menu processing method and device, electronic equipment and storage medium
CN113157523B (en) Service monitoring method and device, computer equipment and storage medium
CN113869789A (en) Risk monitoring method and device, computer equipment and storage medium
CN112860662A (en) Data blood relationship establishing method and device, computer equipment and storage medium
CN117033249A (en) Test case generation method and device, computer equipment and storage medium
CN114626352B (en) Report automatic generation method, device, computer equipment and storage medium
CN108037914B (en) Method and device for developing android native system by combining js
CN114637672A (en) Automatic data testing method and device, computer equipment and storage medium
CN113448578A (en) Page data processing method, processing system, electronic device and readable storage medium
CN116108814B (en) Gantt chart processing method and device, computer equipment and storage medium
CN116304431A (en) Webpage automation method and device, computer equipment and storage medium
CN116467145A (en) Page performance data acquisition method and device, computer equipment and storage medium
CN117271635A (en) List export method, device, computer equipment and storage medium
CN116149665A (en) XAML file modification method, XAML file modification device, computer equipment and storage medium
CN117785181A (en) Code execution method, device, equipment and storage medium thereof
CN114528220A (en) Test case generation method and device, computer equipment and storage medium
CN117278623A (en) Method and device for processing request data, computer equipment and storage medium
CN117499270A (en) Flow processing method and device, computer equipment and storage medium
CN117290019A (en) Interface calling method and device, computer equipment and storage medium
CN116467012A (en) Front-end service deployment method, system, 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