CN114840269A - Dialog box display method and device, electronic equipment and storage medium - Google Patents
Dialog box display method and device, electronic equipment and storage medium Download PDFInfo
- Publication number
- CN114840269A CN114840269A CN202210475991.3A CN202210475991A CN114840269A CN 114840269 A CN114840269 A CN 114840269A CN 202210475991 A CN202210475991 A CN 202210475991A CN 114840269 A CN114840269 A CN 114840269A
- Authority
- CN
- China
- Prior art keywords
- page
- dialog box
- display
- loaded
- control function
- 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
Links
- 238000000034 method Methods 0.000 title claims abstract description 57
- 230000006870 function Effects 0.000 claims description 101
- 238000012545 processing Methods 0.000 claims description 19
- 238000004590 computer program Methods 0.000 claims description 16
- 238000010586 diagram Methods 0.000 description 6
- 238000004891 communication Methods 0.000 description 3
- 230000036316 preload Effects 0.000 description 3
- 238000010276 construction Methods 0.000 description 2
- 230000004044 response Effects 0.000 description 2
- 238000013473 artificial intelligence Methods 0.000 description 1
- 230000006399 behavior Effects 0.000 description 1
- 230000009286 beneficial effect Effects 0.000 description 1
- 238000001514 detection method Methods 0.000 description 1
- 238000011161 development Methods 0.000 description 1
- 238000007599 discharging Methods 0.000 description 1
- 230000000694 effects Effects 0.000 description 1
- 238000005516 engineering process Methods 0.000 description 1
- 230000002452 interceptive effect Effects 0.000 description 1
- 238000012544 monitoring process Methods 0.000 description 1
- 230000003287 optical effect Effects 0.000 description 1
- 230000000750 progressive effect Effects 0.000 description 1
- 239000007787 solid Substances 0.000 description 1
- 230000000007 visual effect Effects 0.000 description 1
Images
Classifications
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F9/00—Arrangements for program control, e.g. control units
- G06F9/06—Arrangements 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/44—Arrangements for executing specific programs
- G06F9/445—Program loading or initiating
- G06F9/44521—Dynamic linking or loading; Link editing at or after load time, e.g. Java class loading
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F16/00—Information retrieval; Database structures therefor; File system structures therefor
- G06F16/90—Details of database functions independent of the retrieved data types
- G06F16/95—Retrieval from the web
- G06F16/953—Querying, e.g. by the use of web search engines
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F16/00—Information retrieval; Database structures therefor; File system structures therefor
- G06F16/90—Details of database functions independent of the retrieved data types
- G06F16/95—Retrieval from the web
- G06F16/957—Browsing optimisation, e.g. caching or content distillation
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F9/00—Arrangements for program control, e.g. control units
- G06F9/06—Arrangements 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/44—Arrangements for executing specific programs
- G06F9/451—Execution arrangements for user interfaces
Landscapes
- Engineering & Computer Science (AREA)
- Theoretical Computer Science (AREA)
- Software Systems (AREA)
- Databases & Information Systems (AREA)
- Physics & Mathematics (AREA)
- General Engineering & Computer Science (AREA)
- General Physics & Mathematics (AREA)
- Data Mining & Analysis (AREA)
- Human Computer Interaction (AREA)
- User Interface Of Digital Computer (AREA)
Abstract
The embodiment of the application discloses a dialog box display method, a dialog box display device, electronic equipment and a storage medium; the method comprises the steps of receiving a page loading instruction aiming at a page to be loaded; determining a dialog box corresponding to a page to be loaded based on a page loading instruction; displaying the page to be loaded to obtain a display page, and preloading the dialog box into the display page; when the dialog box is detected to be displayed, the preset display control function is used for controlling the dialog box to be displayed in the display page, and therefore the efficiency of dialog box display can be improved.
Description
Technical Field
The present application relates to the field of communications technologies, and in particular, to a dialog box display method and apparatus, an electronic device, and a storage medium.
Background
In a graphical user interface, a dialog box is a special window that is used to display information to the user in the user interface or to obtain input responses from the user when needed. These are called "dialog boxes" because they allow a dialog between the computer and the user, either to inform the user of some information, to request input from the user, or both. In the prior art, custom dialogs based on the Vue framework tend to be inconvenient to use, require writing lines of similar code, require writing dialog tags inside temp tags, and self-control display hiding, which can reduce the efficiency of dialog display.
Disclosure of Invention
The embodiment of the application provides a dialog box display method and device, electronic equipment and a storage medium, and the efficiency of dialog box display can be improved.
The embodiment of the application provides a dialog box display method, which comprises the following steps:
receiving a page loading instruction aiming at a page to be loaded;
determining a dialog box corresponding to the page to be loaded based on the page loading instruction;
displaying the page to be loaded to obtain a display page, and preloading the dialog box into the display page;
and when the dialog box is detected to be displayed, controlling the dialog box to be displayed in the display page by using a preset display control function.
Correspondingly, the embodiment of the present application further provides a dialog box display device, including:
the device comprises a receiving unit, a processing unit and a processing unit, wherein the receiving unit is used for receiving a page loading instruction aiming at a page to be loaded;
the determining unit is used for determining a dialog box corresponding to the page to be loaded based on the page loading instruction;
the pre-loading unit is used for displaying the page to be loaded to obtain a display page and pre-loading the dialog box into the display page;
and the display unit is used for controlling the dialog box to be displayed in the display page by utilizing a preset display control function when the dialog box is detected to be displayed.
In an embodiment, the preloading unit may include:
the acquiring subunit is used for acquiring the node structure information corresponding to the page to be loaded when the page to be loaded is displayed;
the searching subunit is used for searching the node structure information corresponding to the page to be loaded to obtain father node information of the page to be loaded;
and the adding child unit is used for adding the dialog box into the parent node information.
In an embodiment, the adding subunit may include:
the acquisition module is used for acquiring a script file constructed based on a preset framework;
the reading module is used for reading the attribute information corresponding to the dialog box from the script file;
and the adding module is used for adding the attribute information corresponding to the dialog box into the father node information.
In one embodiment, the display unit may include:
the reading subunit is configured to, when it is detected that the dialog box needs to be displayed, read the preset display control function to obtain a parameter corresponding to the preset display control function;
the parameter adjusting subunit is used for adjusting the parameters corresponding to the preset display control function to obtain an adjusted display control function;
and the display subunit is used for calling the adjusted display control function so as to display the dialog box in the display page.
In one embodiment, the dialog box display apparatus further includes:
an acquisition unit, configured to acquire script content of the dialog box;
the analysis unit is used for analyzing the script content to obtain the attribute information of the dialog box;
and the exposure global unit is used for carrying out exposure global processing on the attribute information of the dialog box to obtain a calling function corresponding to the dialog box.
In one embodiment, the dialog box display apparatus further includes:
a function acquisition unit for acquiring an initial display control function;
the setting unit is used for setting parameters corresponding to the initial display control function based on the attribute information of the dialog box to obtain a set display control function;
and the construction unit is used for constructing the incidence relation between the calling function corresponding to the dialog box and the set display control function to obtain the preset display control function.
In an embodiment, the determining unit may include:
the identification determining subunit is configured to determine, based on the page loading instruction, a page identification corresponding to the page loading instruction;
a content searching subunit, configured to search, based on the page identifier, script content of the page to be loaded;
and the content analysis subunit is used for analyzing the script content to obtain a dialog box corresponding to the page to be loaded.
Correspondingly, the embodiment of the application also provides an electronic device, which comprises a memory and a processor; the memory stores a computer program, and the processor is configured to run the computer program in the memory to execute the dialog box display method provided by any of the embodiments of the present application.
Correspondingly, the embodiment of the present application further provides a storage medium, where a computer program is stored, and when the computer program is executed by a processor, the dialog box display method provided in any embodiment of the present application is implemented.
The method comprises the steps of receiving a page loading instruction aiming at a page to be loaded; determining a dialog box corresponding to the page to be loaded based on the page loading instruction; displaying the page to be loaded to obtain a display page, and preloading the dialog box into the display page; when the dialog box is detected to be displayed, the dialog box is controlled to be displayed in the display page by using a preset display control function, and the efficiency of dialog box display can be improved.
Drawings
In order to more clearly illustrate the technical solutions in the embodiments of the present application, the drawings needed to be used in the description of the embodiments are briefly introduced below, and it is obvious that the drawings in the following description are only some embodiments of the present application, and it is obvious for those skilled in the art to obtain other drawings based on these drawings without creative efforts.
Fig. 1 is a scene schematic diagram of a dialog box display method provided in an embodiment of the present application;
FIG. 2 is a flowchart illustrating a dialog box display method according to an embodiment of the present application;
FIG. 3 is a schematic diagram of another scenario of a dialog box display method according to an embodiment of the present application;
FIG. 4 is a schematic diagram of another scenario of a dialog box display method according to an embodiment of the present application;
FIG. 5 is a schematic flow chart of a dialog box display method according to an embodiment of the present application;
FIG. 6 is a schematic structural diagram of a dialog box display device according to an embodiment of the present application;
fig. 7 is a schematic structural diagram of an electronic device provided in an embodiment of the present application.
Detailed Description
The technical solutions in the embodiments of the present application will be clearly and completely described below with reference to the drawings in the embodiments of the present application, however, the described embodiments are only a part of the embodiments of the present application, and not all of the embodiments of the present application. All other embodiments, which can be derived by a person skilled in the art from the embodiments given herein without making any creative effort, shall fall within the protection scope of the present application.
Embodiments of the present application provide a dialog box display method, which may be performed by a dialog box display apparatus, which may be integrated in an electronic device. The electronic device may include at least one of a terminal and a server. That is, the dialog box display method may be executed by the terminal or the server.
Wherein, this terminal can include personal computer, panel computer, smart television, smart mobile phone, intelligent house, wearable electronic equipment, VR/AR equipment, on-vehicle computer etc..
The server may be an interworking server or a background server among a plurality of heterogeneous systems, an independent physical server, a server cluster or a distributed system formed by a plurality of physical servers, a cloud server providing basic cloud computing services such as cloud service, a cloud database, cloud computing, a cloud function, cloud storage, network service, cloud communication, middleware service, domain name service, security service, big data, an artificial intelligence platform and the like, and the like.
In an embodiment, as shown in fig. 1, the dialog box display apparatus may be integrated on an electronic device such as a terminal or a server to implement the dialog box display method provided in the embodiment of the present application. Specifically, the electronic device may receive a page load instruction for a page to be loaded; determining a dialog box corresponding to a page to be loaded based on a page loading instruction; displaying the page to be loaded to obtain a display page, and preloading the dialog box into the display page; and when the dialog box is detected to be displayed, controlling the dialog box to be displayed in the display page by using a preset display control function.
The following are detailed below, and it should be noted that the order of description of the following examples is not intended to limit the preferred order of the examples.
The dialog box display method proposed by the embodiment of the present application will be described from the perspective of integrating a dialog box display device in an electronic device.
As shown in fig. 2, a dialog box display method is provided, and the specific flow includes:
101. a page load instruction for a page to be loaded is received.
The page to be loaded may include a page to be displayed.
In an embodiment, the page to be loaded may be a page on an application.
The application program may include a computer program that performs one or more specific functions, operates in an interactive mode, and interacts with an object used by the application program, and has a visual display interface.
For example, the application programs may include application software on various terminals. For example, the Application program may include various mobile phone software (APP), tablet Application software, Application software on a notebook Computer, Application software on a Personal Computer (PC), and the like.
For example, the application programs may include browsers, video playback software, game software, and so on.
As another example, an application may also include an applet. Among them, the applet (Mini Program) is an application that can be used without downloading and installing. In order to provide more diversified business services to users, developers can develop corresponding applets for applications (such as instant messaging applications, shopping applications, mail applications, and the like) of the terminal, the applets can be embedded into the applications of the terminal as sub-applications, and the corresponding business services can be provided for the users by running the sub-applications (i.e., the corresponding applets) in the applications.
For example, the page to be loaded may be a page to be displayed in a browser. As another example, the page to be loaded may be a page on an applet that is ready to be displayed.
In an embodiment, when the dialog box display device receives a page load instruction, the dialog box display device may determine, based on the page load instruction, a page to be loaded to which the page load instruction is directed. For example, when a user clicks a link in a browser through a mouse, the dialog box display device may receive a page loading instruction and determine a page to be loaded according to the page loading instruction.
102. And determining a dialog box corresponding to the page to be loaded based on the page loading instruction.
Among other things, dialog boxes may be used to display information to a user in a page.
In one embodiment, the dialog box is a special window in the graphical user interface that is used to display information to the user in the user interface or to obtain input responses from the user when desired. These are called "dialog boxes" because they allow a dialog between the computer and the user, either to inform the user of some information, to request input from the user, or both.
In an embodiment, the dialog box display device may also determine, based on the page load instruction, a dialog box corresponding to the loaded page. Determining the dialog box corresponding to the page to be loaded based on the page loading instruction may include determining whether the page to be loaded has a dialog box that can be displayed, and if the page to be loaded has a dialog box that can be displayed, which dialog boxes can be displayed.
The dialog box corresponding to the page to be loaded can be determined according to the step content corresponding to the page to be loaded.
Specifically, the step "determining a dialog box corresponding to the page to be loaded based on the page loading instruction" may include:
determining a page identifier corresponding to the page loading instruction based on the page loading instruction;
searching script content of a page to be loaded based on the page identification;
and analyzing the script content to obtain a dialog box corresponding to the page to be loaded.
The page identifier may indicate an identifier corresponding to a page to be loaded to which the page loading instruction is directed. Through the page identification, it can know which page the page loading instruction is directed to, and the location where the step content corresponding to the page is stored. For example, the page identifier may be a storage location information, and therefore, the script content of the page to be loaded may be searched based on the page identifier.
The script content may be programming content corresponding to a page to be loaded, and is usually saved as text and at least interpreted or compiled when called.
In one embodiment, the language format of the script content may be varied.
For example, the script content may be a document written in hypertext Markup Language (HTML). Among them, the HTML document may be a document that is read by various web browsers and generates a document capable of delivering various kinds of consultation. HTML, in turn, may be a markup language that includes a series of tags by which the meaning and structure of web page content is defined.
As another example, the script content can be a document embedded in HTML, such as a JavaScript scripting language. The JavaScript is a high-level scripting language applied to network development, and can add various dynamic functions to a webpage, so that the webpage content on a browser is more smooth and attractive in presentation effect. Embedding documents such as JavaScript scripting language in HTML can affect the behavior of web pages.
As another example, the script content may be written based on the Vue architecture. Vue is a set of progressive JavaScript frames for constructing a user interface. Vue employ designs developed in bottom-up increments. Vue focus only on the viewing layer and are very easy to learn and integrate with other libraries or existing projects. Vue, on the other hand, is fully capable of driving complex single-page applications developed using single-file components and libraries supported by Vue ecosystems.
In an embodiment, a page identifier corresponding to a page load instruction may be determined based on the page load instruction. For example, a page load instruction may be traversed to obtain the page identification. For another example, the page identifier may be analyzed to obtain a page to be loaded to which the page loading instruction is directed. Then, the page identifier corresponding to the page to be loaded may be extracted.
In an embodiment, script content of a page to be loaded may be searched based on the page identification. For example, when the page identifier is storage location information corresponding to the script content, a storage unit of the script content can be searched based on the page identifier. Then, the script content is read out from the storage unit.
In an embodiment, the script content may be analyzed to obtain a dialog box corresponding to the page to be loaded. For example, when the script content is a document embedded in HTML, such as a JavaScript scripting language, various web page tags may be included in the script content. Then, the webpage tags in the script content can be identified to obtain a dialog box corresponding to the page to be loaded.
The web page tags can be tags used for constructing a web page architecture, a web page layout and bearing content, namely, the browser can generate the web page architecture and layout corresponding to the web page tags and identify content information of the web page tag identification through the web page tags, and render the content of the web page tag identification to a position corresponding to a web page according to position information of the web page tag in the to-be-processed web page content, so that the content of the web page tag identification is presented on the web page.
For example, in HTML, a web page tag may be a tag consisting of block-level elements of "<" and ">" and "<", ">" wrappers. Wherein, the block-level elements can be used to construct network architecture, web page layout and bearer content. For example, block-level elements may include head, div, p, body, and so on. Thus, the webpage tag may be a < head >, < div >, < p >, < body >, etc. tag.
103. And displaying the page to be loaded to obtain a display page, and preloading the dialog box into the display page.
In an embodiment, the page to be loaded may be displayed to obtain a display page. When the page to be loaded is displayed, the dialog box can be preloaded into the display page. Wherein preloading the dialog box onto the display page may refer to adding the dialog box onto the display page, but the dialog box is not displayed, but is in a hidden state. The dialog box is only transferred from the hidden state to the displayed state when it needs to be displayed.
By the method, the dialog boxes can be loaded in advance on the page, and when the dialog boxes need to be displayed, the dialog boxes can be directly displayed without loading and then displaying the dialog boxes, so that the efficiency of displaying the dialog boxes is improved.
Specifically, the step of performing display processing on the page to be loaded to obtain a display page, and preloading the dialog box into the display page may include:
when a page to be loaded is displayed, acquiring node structure information corresponding to the page to be loaded;
searching node structure information corresponding to the page to be loaded to obtain father node information of the page to be loaded;
a dialog box is added to the parent node information.
In an embodiment, when the page to be loaded is displayed, the node structure information corresponding to the page to be loaded may be obtained. For example, when the page to be loaded is displayed, the script content corresponding to the page to be loaded may be obtained. Then, the script content can be analyzed, so as to obtain the node structure information corresponding to the page to be loaded.
The node structure information may indicate a structure of a web tag in script content of the page to be loaded. Through the node structure information, it can know that the webpage tags are included in the step content of the page to be loaded, and what the structure between the webpage tags is.
In an embodiment, parsing the script content may refer to performing Document Object Model (DOM) traversal on the script content to obtain node structure information corresponding to the page to be loaded.
In an embodiment, the node structure information corresponding to the page to be loaded may be searched to obtain parent node information of the page to be loaded.
The parent node information may include a node in the webpage label having a plurality of child nodes. For example, each web page tag in the script content may be referred to as a node, wherein the parent node information may include the root node and the content that the root node includes. For another example, the parent node information may be information customized by a developer. For example, a developer may customize a web page tag to be a parent node, and the information contained in the node may be parent node information.
In an embodiment, there are multiple methods for performing search processing on the node structure information corresponding to the page to be loaded to obtain parent node information of the page to be loaded.
For example, when the parent node is the root node, information of a position where the root node is located in the node structure information may be determined as the parent node.
For another example, when the parent node is customized by a developer, the node structure information may be matched with a preset reference node, so as to determine the parent node and information corresponding to the parent node.
In one embodiment, after the parent node information is searched, a dialog box may be added to the parent node information. There are various ways in which a dialog box may be added to parent node information.
For example, a dialog box may be added directly to parent node information. For example, the code statement document body appndchild () may be called to add a dialog to parent node information, enabling preloading of the dialog.
For another example, attribute information of a dialog box may be added to parent node information. Specifically, the step "add dialog box to parent node information" may include:
acquiring a script file constructed based on a preset framework;
reading attribute information corresponding to the dialog box from the script file;
and adding attribute information corresponding to the dialog box into the parent node information.
Wherein the preset frame may be an Vue frame. The script file constructed based on the preset framework may be a file describing a dialog box. For example, the script file may describe the style of the dialog box, what the dialog box will display, and so on.
The attribute information of the dialog box may include information describing the dialog box. For example, the attribute information of the dialog box may include a style of the dialog box, contents that the dialog box will display, and the like.
In one embodiment, a dialog box may be constructed as an object in the script file, and the attribute information corresponding to the dialog box may also be the name of the object. Where an object may refer to a function in a computer language for a particular program.
In an embodiment, after the attribute information corresponding to the dialog box is read from the script file, the attribute information corresponding to the dialog box may be added to the parent node information. For example, attribute information corresponding to the dialog box may be added to a corresponding location in the parent node information.
104. And when the dialog box is detected to be displayed, controlling the dialog box to be displayed in the display page by using a preset display control function.
In one embodiment, after the dialog box is preloaded into the display page, the dialog box is illustrated as being already included in the display page, except that the dialog box is hidden. And when the dialog box is detected to be required to be displayed, the dialog box can be controlled to be displayed in the real page by utilizing the preset display control function.
The preset display control function may have parameters, and thus, the display of the dialog box may be controlled by adjusting the parameters corresponding to the preset display control function.
Specifically, the step of controlling the dialog box to be displayed in the display page by using the preset display control function when the dialog box is detected to be displayed may include:
when the dialog box is detected to be displayed, reading a preset display control function to obtain a parameter corresponding to the preset display control function;
adjusting parameters corresponding to a preset display control function to obtain an adjusted display control function;
and calling the adjusted display control function to display the dialog box in the display page.
For example, the preset display control function is this. When the dialog box is hidden, the preset display control function is this. And when the dialog box needs to be displayed, the preset display control function may be adjusted to this.
In one embodiment, the dialog box may be exposed globally for preloading into a display page. Through the global exposure processing of the dialog box, the script content of the dialog box can be simplified, so that the dialog box can be conveniently preloaded into a display page. Then, the call function of the dialog box and the preset display control function may be associated, so that the display of the dialog box may be controlled by the preset display control function.
Specifically, the method provided by the embodiment of the present application may further include:
acquiring script content of the dialog box;
analyzing the script content to obtain attribute information of the dialog box;
and performing exposure global processing on the attribute information of the dialog box to obtain a calling function corresponding to the dialog box.
In one embodiment, after obtaining the script content of the dialog box, the script content may be parsed to obtain the attribute information of the dialog box. For example, the script content may be traversed to obtain attribute information for the dialog box. And then, performing exposure global processing on the attribute content of the dialog box to obtain function information corresponding to the dialog box. For example, the dialog box may be exposed to global processing using code statements. For example, the dialog box is subjected to exposure global processing using vue.
In one embodiment, a large amount of code is required to represent a dialog box without exposing the dialog box globally. For example, as shown in FIG. 3, the code for a dialog box may have 100 lines, which is very inconvenient to invoke. Each time a dialog box is loaded, a large amount of code needs to be run. For example, in the existing dialog box creation, firstly, a < dialog > tag needs to be written on the page, a display hidden flag needs to be saved globally, the display hidden flag needs to be modified to true at a method where the dialog box needs to be displayed, when the dialog box needs to be closed, the display hidden flag needs to be modified to false manually, a click-determined event needs to be found, a method needs to be searched again, and it is very inconvenient for a code line number to be close to 100.
By exposing the global processing to the dialog box, a large amount of codes can be replaced by calling functions, and the dialog box can be loaded by directly calling the functions. For example, as shown in FIG. 4, a call function showTwoEventDialog may be used instead of a large amount of code. After the functional calling is adopted, after the dialog box is loaded on the home page once, the dialog box can be opened by only calling a global method and transmitting in the dialog box title without writing a < dialog > tag on a subsequent page and maintaining and displaying a hidden flag bit, so that the code is greatly simplified.
The call function of the dialog box may then be associated with a preset display control function. Specifically, the method provided by the embodiment of the present application may further include:
acquiring an initial display control function;
setting parameters corresponding to the initial display control function based on the attribute information of the dialog box to obtain a set display control function;
and constructing an incidence relation between the call function corresponding to the dialog box and the set display control function to obtain a preset display control function.
In one embodiment, an initial display control function may be obtained, wherein the initial display control function may be an unset function. Then, based on the attribute information of the dialog box, a parameter corresponding to the initial display control function may be set, and the set display control function is obtained. For example, the initial display control function may be set based on the style and content of the dialog box, and the like. For another example, the object name of the dialog box may be added to the initial display control function to obtain the set display control function.
Then, an association relationship between the call function corresponding to the dialog box and the set display control function can be constructed, so that a preset display control function is obtained.
For example, the name of the calling function may be added to a preset display control function, and so on.
In an embodiment, the embodiment of the application can also write a code of a custom dialog box, can customize a style, reserve external input data, and dynamically modify the content of the dialog box. In Vue, the custom dialog box is loaded on top of the page node, so that all pages have this dialog box node and are hidden by default. Js at vue, the load-on-go dialog box is read out and the global method is exposed for displaying the hidden dialog box and the callback function can be written directly. And the global method can be directly called at the place where the dialog box needs to be displayed, so that the function type call of the pop-up dialog box is realized.
The embodiment of the application provides a dialog box display method, which comprises the following steps: receiving a page loading instruction aiming at a page to be loaded; determining a dialog box corresponding to a page to be loaded based on a page loading instruction; displaying the page to be loaded to obtain a display page, and preloading the dialog box into the display page; when the dialog box is detected to be displayed, the preset display control function is used for controlling the dialog box to be displayed in the display page, and therefore the efficiency of dialog box display can be improved.
The method described in the above examples is further illustrated in detail below by way of example.
The method of the embodiment of the present application will be described by taking an example in which a dialog box display method is integrated on an electronic device. Specifically, as shown in fig. 5, a flow of the dialog box display method provided in the embodiment of the present application may include:
201. the electronic device receives a page load instruction for a page to be loaded.
202. The electronic equipment determines a dialog box corresponding to the page to be loaded based on the page loading instruction.
203. The electronic equipment displays the page to be loaded to obtain a display page, and preloads the dialog box into the display page.
204. When the electronic equipment detects that the dialog box needs to be displayed, the dialog box is controlled to be displayed in the display page by using the preset display control function.
The embodiment of the application provides a dialog box display method, which comprises the following steps: the electronic equipment receives a page loading instruction aiming at a page to be loaded; based on the page loading instruction, the electronic equipment determines a dialog box corresponding to the page to be loaded; the electronic equipment displays the page to be loaded to obtain a display page, and preloads the dialog box into the display page; when the electronic equipment detects that the dialog box needs to be displayed, the preset display control function is used for controlling the dialog box to be displayed in the display page, and therefore the efficiency of dialog box display can be improved.
In order to better implement the dialog box display method provided by the embodiment of the application, in an embodiment, a dialog box display device is further provided, and the dialog box display device can be integrated in an electronic device. The terms are the same as those in the above dialog box display method, and details of implementation can be referred to the description in the method embodiment.
In an embodiment, there is provided a dialog box display apparatus, which may be integrated in an electronic device, as shown in fig. 6, and includes: the receiving unit 301, the determining unit 302, the preloading unit 303 and the displaying unit 304 are as follows:
a receiving unit 301, configured to receive a page load instruction for a page to be loaded;
a determining unit 302, configured to determine, based on the page loading instruction, a dialog box corresponding to the page to be loaded;
the preloading unit 303 is configured to perform display processing on the page to be loaded to obtain a display page, and preload the dialog box into the display page;
and the display unit 304 is configured to control the dialog box to be displayed in the display page by using a preset display control function when it is detected that the dialog box needs to be displayed.
In an embodiment, the preloading unit 303 may include:
the acquiring subunit is used for acquiring the node structure information corresponding to the page to be loaded when the page to be loaded is displayed;
the searching subunit is used for searching the node structure information corresponding to the page to be loaded to obtain father node information of the page to be loaded;
and the adding child unit is used for adding the dialog box into the parent node information.
In an embodiment, the adding subunit may include:
the acquisition module is used for acquiring a script file constructed based on a preset framework;
the reading module is used for reading the attribute information corresponding to the dialog box from the script file;
and the adding module is used for adding the attribute information corresponding to the dialog box into the father node information.
In an embodiment, the display unit 304 may include:
the reading subunit is configured to, when it is detected that the dialog box needs to be displayed, read the preset display control function to obtain a parameter corresponding to the preset display control function;
the parameter adjusting subunit is used for adjusting the parameters corresponding to the preset display control function to obtain an adjusted display control function;
and the display subunit is used for calling the adjusted display control function so as to display the dialog box in the display page.
In one embodiment, the dialog box display apparatus further includes:
an acquisition unit, configured to acquire script content of the dialog box;
the analysis unit is used for analyzing the script content to obtain the attribute information of the dialog box;
and the exposure global unit is used for carrying out exposure global processing on the attribute information of the dialog box to obtain a calling function corresponding to the dialog box.
In one embodiment, the dialog box display apparatus further includes:
a function acquisition unit for acquiring an initial display control function;
the setting unit is used for setting parameters corresponding to the initial display control function based on the attribute information of the dialog box to obtain a set display control function;
and the construction unit is used for constructing the incidence relation between the calling function corresponding to the dialog box and the set display control function to obtain the preset display control function.
In an embodiment, the determining unit 302 may include:
the identification determining subunit is configured to determine, based on the page loading instruction, a page identification corresponding to the page loading instruction;
a content searching subunit, configured to search, based on the page identifier, script content of the page to be loaded;
and the content analysis subunit is used for analyzing the script content to obtain a dialog box corresponding to the page to be loaded.
In a specific implementation, the above units may be implemented as independent entities, or may be combined arbitrarily to be implemented as the same or several entities, and the specific implementation of the above units may refer to the foregoing method embodiments, which are not described herein again.
The dialog box display device can realize the dialog box display function of the application program without depending on a specific interface provided by an operating system of the application program.
The embodiment of the application also provides an electronic device, which can comprise a terminal or a server; for example, the electronic device may be a server, such as a dialog display function or the like. As shown in fig. 7, it shows a schematic structural diagram of a terminal according to an embodiment of the present application, specifically:
the electronic device may include components such as a processor 401 of one or more processing cores, memory 402 of one or more computer-readable storage media, a power supply 403, and an input unit 404. Those skilled in the art will appreciate that the electronic device configuration shown in fig. 7 does not constitute a limitation of the electronic device and may include more or fewer components than shown, or some components may be combined, or a different arrangement of components. Wherein:
the processor 401 is a control center of the electronic device, connects various parts of the whole electronic device by using various interfaces and lines, and performs various services of the electronic device and processes data by running or executing software programs and/or modules stored in the memory 402 and calling data stored in the memory 402, thereby performing overall monitoring of the electronic device. Optionally, processor 401 may include one or more processing cores; preferably, the processor 401 may integrate an application processor and a modem processor, wherein the application processor mainly handles operating systems, user pages, application programs, and the like, and the modem processor mainly handles wireless communications. It will be appreciated that the modem processor described above may not be integrated into the processor 401.
The memory 402 may be used to store software programs and modules, and the processor 401 executes various service applications and data processing by operating the software programs and modules stored in the memory 402. The memory 402 may mainly include a storage program area and a storage data area, wherein the storage program area may store an operating system, an application program required by at least one service (such as a sound playing service, an image playing service, etc.), and the like; the storage data area may store data created according to use of the computer device, and the like. Further, the memory 402 may include high speed random access memory, and may also include non-volatile memory, such as at least one magnetic disk storage device, flash memory device, or other volatile solid state storage device. Accordingly, the memory 402 may also include a memory controller to provide the processor 401 access to the memory 402.
The electronic device further comprises a power supply 403 for supplying power to the various components, and preferably, the power supply 403 is logically connected to the processor 401 through a power management system, so that services such as charging, discharging, and power consumption management are managed through the power management system. The power supply 403 may also include any component of one or more dc or ac power sources, recharging systems, power failure detection circuitry, power converters or inverters, power status indicators, and the like.
The electronic device may further include an input unit 404, and the input unit 404 may be used to receive input numeric or character information and generate keyboard, mouse, joystick, optical or trackball signal inputs related to user settings and service control.
Although not shown, the electronic device may further include a display unit and the like, which are not described in detail herein. Specifically, in this embodiment, the processor 401 in the electronic device loads the executable file corresponding to the process of one or more application programs into the memory 402 according to the following instructions, and the processor 401 runs the application programs stored in the memory 402, thereby implementing various services, as follows:
receiving a page loading instruction aiming at a page to be loaded;
determining a dialog box corresponding to the page to be loaded based on the page loading instruction;
displaying the page to be loaded to obtain a display page, and preloading the dialog box into the display page;
and when the dialog box is detected to be displayed, controlling the dialog box to be displayed in the display page by using a preset display control function.
The above operations can be implemented in the foregoing embodiments, and are not described in detail herein.
According to an aspect of the application, there is provided a computer program application or computer program comprising computer instructions stored in a computer readable storage medium. The processor of the computer device reads the computer instructions from the computer-readable storage medium, and the processor executes the computer instructions to cause the computer device to perform the method provided in the various alternative implementations of the above embodiments.
It will be understood by those skilled in the art that all or part of the steps of the methods of the above embodiments may be performed by a computer program, which may be stored in a computer-readable storage medium and loaded and executed by a processor, or by related hardware controlled by the computer program.
To this end, embodiments of the present application further provide a storage medium, where a computer program is stored, where the computer program can be loaded by a processor to execute steps in any one of the dialog box display methods provided in the embodiments of the present application. For example, the computer program may perform the steps of:
receiving a page loading instruction aiming at a page to be loaded;
determining a dialog box corresponding to the page to be loaded based on the page loading instruction;
displaying the page to be loaded to obtain a display page, and preloading the dialog box into the display page;
and when the dialog box is detected to be displayed, controlling the dialog box to be displayed in the display page by using a preset display control function.
The above operations can be implemented in the foregoing embodiments, and are not described in detail herein.
Since the computer program stored in the storage medium can execute the steps in any dialog box display method provided in the embodiment of the present application, beneficial effects that can be achieved by any dialog box display method provided in the embodiment of the present application can be achieved, and detailed descriptions are omitted here for the foregoing embodiment.
The foregoing describes in detail a dialog box display method, apparatus, electronic device, and storage medium provided in the embodiments of the present application, and specific examples are applied herein to explain the principles and implementations of the present application, and the descriptions of the foregoing embodiments are only used to help understand the methods and core ideas of the present application; meanwhile, for those skilled in the art, according to the idea of the present application, there may be variations in the specific embodiments and the application scope, and in summary, the content of the present specification should not be construed as a limitation to the present application.
Claims (10)
1. A dialog box display method, comprising:
receiving a page loading instruction aiming at a page to be loaded;
determining a dialog box corresponding to the page to be loaded based on the page loading instruction;
displaying the page to be loaded to obtain a display page, and preloading the dialog box into the display page;
and when the dialog box is detected to be displayed, controlling the dialog box to be displayed in the display page by using a preset display control function.
2. The method according to claim 1, wherein the displaying the page to be loaded to obtain a display page, and preloading the dialog box into the display page comprises:
when the page to be loaded is displayed, acquiring node structure information corresponding to the page to be loaded;
searching the node structure information corresponding to the page to be loaded to obtain father node information of the page to be loaded;
adding the dialog box to the parent node information.
3. The method of claim 2, wherein the adding the dialog box to the parent node information comprises:
acquiring a script file constructed based on a preset framework;
reading attribute information corresponding to the dialog box from the script file;
and adding the attribute information corresponding to the dialog box into the parent node information.
4. The method according to claim 1, wherein when it is detected that the dialog box needs to be displayed, controlling the dialog box to be displayed in the display page by using a preset display control function comprises:
when the dialog box is detected to be displayed, reading the preset display control function to obtain a parameter corresponding to the preset display control function;
adjusting parameters corresponding to the preset display control function to obtain an adjusted display control function;
and calling the adjusted display control function to display the dialog box in the display page.
5. The method of claim 1, further comprising:
acquiring script content of the dialog box;
analyzing the script content to obtain attribute information of the dialog box;
and performing exposure global processing on the attribute information of the dialog box to obtain a calling function corresponding to the dialog box.
6. The method of claim 5, further comprising:
acquiring an initial display control function;
setting parameters corresponding to the initial display control function based on the attribute information of the dialog box to obtain a set display control function;
and constructing an incidence relation between the calling function corresponding to the dialog box and the set display control function to obtain the preset display control function.
7. The method according to claim 1, wherein the determining, based on the page load instruction, a dialog box corresponding to the page to be loaded comprises:
determining a page identifier corresponding to the page loading instruction based on the page loading instruction;
searching script content of the page to be loaded based on the page identification;
and analyzing the script content to obtain a dialog box corresponding to the page to be loaded.
8. A dialog display device, comprising:
the device comprises a receiving unit, a processing unit and a processing unit, wherein the receiving unit is used for receiving a page loading instruction aiming at a page to be loaded;
the determining unit is used for determining a dialog box corresponding to the page to be loaded based on the page loading instruction;
the pre-loading unit is used for displaying the page to be loaded to obtain a display page and pre-loading the dialog box into the display page;
and the display unit is used for controlling the dialog box to be displayed in the display page by utilizing a preset display control function when the dialog box is detected to be displayed.
9. An electronic device comprising a memory and a processor; the memory stores a computer program, and the processor is configured to execute the computer program in the memory to perform the dialog box display method according to any one of claims 1 to 7.
10. A storage medium storing a plurality of computer programs adapted to be loaded by a processor to perform the dialog display method of any of claims 1 to 7.
Priority Applications (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN202210475991.3A CN114840269A (en) | 2022-04-29 | 2022-04-29 | Dialog box display method and device, electronic equipment and storage medium |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN202210475991.3A CN114840269A (en) | 2022-04-29 | 2022-04-29 | Dialog box display method and device, electronic equipment and storage medium |
Publications (1)
Publication Number | Publication Date |
---|---|
CN114840269A true CN114840269A (en) | 2022-08-02 |
Family
ID=82568367
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
CN202210475991.3A Pending CN114840269A (en) | 2022-04-29 | 2022-04-29 | Dialog box display method and device, electronic equipment and storage medium |
Country Status (1)
Country | Link |
---|---|
CN (1) | CN114840269A (en) |
-
2022
- 2022-04-29 CN CN202210475991.3A patent/CN114840269A/en active Pending
Similar Documents
Publication | Publication Date | Title |
---|---|---|
US8365203B2 (en) | Method for creating a native application for mobile communications device in real-time | |
US20200357007A1 (en) | Page data acquisition method, apparatus, server, electronic device and computer readable medium | |
Firtman | jQuery mobile: up and running | |
US9749440B2 (en) | Systems and methods for hosted application marketplaces | |
US11550990B2 (en) | Machine first approach for identifying accessibility, non-compliances, remediation techniques and fixing at run-time | |
US9251267B2 (en) | Generating behavior information for a link | |
CN111783008A (en) | Information display method, device, equipment and medium | |
CN113792208B (en) | Picture interaction method, device, equipment, medium and program product based on webpage | |
CN112711731A (en) | Data point burying method, device, equipment and storage medium | |
US20180122405A1 (en) | Web technology responsive to mixtures of emotions | |
CN114048415A (en) | Form generation method and device, electronic equipment and computer readable storage medium | |
CN116701811B (en) | Webpage processing method, device, equipment and computer readable storage medium | |
CN103761020A (en) | Shortcut navigating method and device | |
CN117931188A (en) | Front-end layout code automatic generation method and device, electronic equipment and medium | |
CN114840269A (en) | Dialog box display method and device, electronic equipment and storage medium | |
CN112650959A (en) | Page loading duration statistical method, device, equipment and storage medium | |
CN108304169B (en) | Implementation method, device and equipment for HTML5 application | |
CN110717134A (en) | Product description issuing method and device, storage medium and electronic equipment | |
CN113934959B (en) | Program preview method and device, computer equipment and storage medium | |
CN111767111B (en) | Page data processing method and device, electronic equipment and storage medium | |
CN115081423A (en) | Document editing method and device, electronic equipment and storage medium | |
CN112199090B (en) | Information stream processing method, device and computer readable storage medium | |
Honkala | Web user interaction: a declarative approach based on XForms | |
CN112632436A (en) | Webpage display method and device, electronic equipment and storage medium | |
CN116108814B (en) | Gantt chart processing 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 |