Secondary confirmation pop-up box generation method, device and equipment and readable storage medium
Through the secondary confirmation of the pop-up frame generation method, the development process of buttons and pop-up frame components in front-end web development is simplified, the problem of duplicate code is solved, and the development efficiency and process simplification is improved.
Patent Information
- Application Number
- CN202411160972.7
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-08-22
- Publication Date
- 2024-12-17
AI Technical Summary
In front-end web development, there is a lot of duplicate code during the development of buttons and pop-up components, especially when the button needs to be disabled, especially when the button is related to the server interface call, the development process is complex and not simplified enough.
Provide a method for generating a secondary confirmation box. By initializing component configuration data, calling the button rendering function to generate the target button, and calling the secondary confirmation box function in the click event to generate the pop-up box, and performing the target button click in response to the user's confirmation operation. Events, implement button disabling and unblocking, avoiding the additional introduction of components and writing duplicate code.
It greatly improves development efficiency, simplifies development process, reduces code redundancy, and realizes simple management of button disable state.
Smart Images

Figure CN119149152A_ABST
Abstract
Description
Technical Field
[0001] The present disclosure relates to the field of computer technology, and in particular to a method, device, equipment and readable storage medium for generating a secondary confirmation pop-up box. Background Art
[0002] In business systems, buttons are a very common web page element. When clicking on some important buttons such as "Order Delete" and "Order Confirmation", a second confirmation pop-up window is often required for the user to confirm. The main purpose is to avoid user misoperation.
[0003] At present, in front-end web development, there are often some third-party component libraries such as elementui, arco-design, etc. that provide button and pop-up components for users to call, thereby simplifying the development process and improving development efficiency.
[0004] However, in actual use, there is still a lot of repetitive code writing, such as the need to write code to add a pop-up window component, or to control the display and hiding of the pop-up window component, which complicates the development process. Moreover, when there is an interface call between the button and the server, the button needs to be set to an unclickable (disabled) state, and the unclickable state of some buttons is related. For example, when a piece of data is deleted, other modification operations of this data cannot be performed. In this case, repeated code will also be written to achieve the above purpose, and the development process is not simplified enough. Therefore, a method is urgently needed to simplify the above development process. Summary of the invention
[0005] In order to solve the above technical problem or at least partially solve the above technical problem, the present disclosure provides a method, device, equipment and readable storage medium for generating a secondary confirmation pop-up box.
[0006] In a first aspect, an embodiment of the present disclosure provides a method for generating a secondary confirmation pop-up box, the method comprising:
[0007] Initialize the component configuration data of the secondary confirmation pop-up box;
[0008] Call the button rendering function to generate the target button;
[0009] Detect the target button click event, call the secondary confirmation pop-up box function, and generate a secondary confirmation pop-up box;
[0010] In response to the user's confirmation operation in the secondary confirmation pop-up box, a target button click event is executed.
[0011] In some embodiments, initializing component configuration data of the secondary confirmation pop-up box includes:
[0012] Configuring the type of the secondary confirmation pop-up box and the display content of the secondary confirmation pop-up box; the type of the secondary confirmation pop-up box includes the first type or the second type;
[0013] Configures the identity of the target button and configures the identities of other buttons that share the disabled state with the target button.
[0014] In some embodiments, the calling of the button rendering function, before generating the target button, includes:
[0015] Encapsulate button rendering function;
[0016] The encapsulated button rendering function includes:
[0017] Bind the button property of the target button to the slot;
[0018] Set the target button disabling condition;
[0019] Bind the button rendering function to the target button click event.
[0020] In some embodiments, setting a target button disabling condition includes:
[0021] When the variable used to mark the disabled state of the button is the first variable, setting the target button to be disabled; and / or
[0022] When the disabled attribute of the target button in the disabled state collector is the first attribute, setting the target button to be disabled; and / or
[0023] When the disabled attribute of other buttons in the disabled state collector that share the disabled state with the target button is the first attribute, the target button is set to be disabled.
[0024] In some embodiments, detecting a target button click event, calling a secondary confirmation pop-up box function, and generating a secondary confirmation pop-up box include:
[0025] Encapsulate click event interceptor;
[0026] Detecting a target button click event, and intercepting the target button click event by a click event interceptor;
[0027] Based on the type of the secondary confirmation pop-up box and the display content of the secondary confirmation pop-up box, encapsulate the secondary confirmation pop-up box function;
[0028] The secondary confirmation pop-up box function is called to generate a secondary confirmation pop-up box corresponding to the type of the secondary confirmation pop-up box.
[0029] In some embodiments, intercepting the target button click event by a click event interceptor includes:
[0030] Setting a variable for marking a disabled state of a button as a first variable through a click event interceptor, and determining whether a user has passed an identifier of a target button into a disabled state collector based on the component configuration data;
[0031] If passed in, the target button's identifier is added to the disabled state collector, and the disabled attribute of the target button is set as the first attribute to intercept the target button click event.
[0032] In some embodiments, in response to the user's confirmation operation in the secondary confirmation pop-up box, executing the target button click event includes:
[0033] In response to the user's confirmation operation in the secondary confirmation pop-up box, triggering a target button click event through a click event interceptor;
[0034] Execute the target button click event;
[0035] When the target button click event is executed, the variable used to mark the button disabled state is set to the second variable through the click event interceptor, and the identifier of the target button in the disabled state collector is deleted.
[0036] In a second aspect, an embodiment of the present disclosure provides a device for generating a secondary confirmation pop-up box, the device comprising:
[0037] Initialization module, used to initialize the component configuration data of the secondary confirmation pop-up box;
[0038] The first calling module is used to call the button rendering function to generate a target button;
[0039] The second calling module is used to detect the target button click event, call the secondary confirmation pop-up box function, and generate a secondary confirmation pop-up box;
[0040] The execution module is used to execute a target button click event in response to a confirmation operation of the user in the secondary confirmation pop-up box.
[0041] In a third aspect, an embodiment of the present disclosure provides an electronic device, including:
[0042] Memory;
[0043] Processor; and
[0044] Computer programs;
[0045] The computer program is stored in the memory and is configured to be executed by the processor to implement the method as described in the first aspect.
[0046] In a fourth aspect, an embodiment of the present disclosure provides a computer-readable storage medium having a computer program stored thereon, wherein the computer program is executed by a processor to implement the method as described in the first aspect.
[0047] In a fifth aspect, an embodiment of the present disclosure further provides a computer program product, which includes a computer program or instructions, and when the computer program or instructions are executed by a processor, the method described in the first aspect is implemented.
[0048] The secondary confirmation pop-up box generation method, device, equipment and readable storage medium provided by the embodiments of the present disclosure initialize the component configuration data of the secondary confirmation pop-up box, call the button rendering function, generate the target button, detect the target button click event, call the secondary confirmation pop-up box function, generate the secondary confirmation pop-up box, and execute the target button click event in response to the user's confirmation operation in the secondary confirmation pop-up box. Compared with the prior art, the embodiments of the present disclosure call the button rendering function to generate the target button, detect the target button click event, call the secondary confirmation pop-up box function, and generate the secondary confirmation pop-up box. Through this method, there is no need to introduce an additional confirmation pop-up box component, nor is there any need to write related code, which greatly improves development efficiency. BRIEF DESCRIPTION OF THE DRAWINGS
[0049] The accompanying drawings, which are incorporated in and constitute a part of this specification, illustrate embodiments consistent with the present disclosure and, together with the description, serve to explain the principles of the present disclosure.
[0050] In order to more clearly illustrate the embodiments of the present invention or the technical solutions in the prior art, the drawings required for use in the embodiments or the description of the prior art will be briefly introduced below. Obviously, for ordinary technicians in this field, other drawings can be obtained based on these drawings without paying any creative labor.
[0051] Figure 1 A flow chart of a method for generating a secondary confirmation pop-up box provided in an embodiment of the present disclosure;
[0052] Figure 2 A schematic diagram of the overall process of the method for generating a secondary confirmation pop-up box provided in an embodiment of the present disclosure;
[0053] Figure 3 A schematic diagram of component configuration data of a secondary confirmation pop-up box provided in an embodiment of the present disclosure;
[0054] Figure 4 A flow chart of a method for generating a secondary confirmation pop-up box provided by another embodiment of the present disclosure;
[0055] Figure 5 A flow chart of a method for generating a secondary confirmation pop-up box provided by another embodiment of the present disclosure;
[0056] Figure 6 A schematic diagram of the structure of a device for generating a secondary confirmation pop-up box provided in an embodiment of the present disclosure;
[0057] Figure 7 A schematic diagram of the structure of an electronic device provided in an embodiment of the present disclosure. DETAILED DESCRIPTION
[0058] In order to more clearly understand the above-mentioned objectives, features and advantages of the present disclosure, the scheme of the present disclosure will be further described below. It should be noted that the embodiments of the present disclosure and the features in the embodiments can be combined with each other without conflict.
[0059] In the following description, many specific details are set forth to facilitate a full understanding of the present disclosure, but the present disclosure may also be implemented in other ways different from those described herein; it is obvious that the embodiments in the specification are only part of the embodiments of the present disclosure, rather than all of the embodiments.
[0060] In business systems, buttons are a very common web page element. When clicking on some important buttons such as "Order Delete" and "Order Confirmation", a second confirmation pop-up window is often required for the user to confirm. The main purpose is to avoid user misoperation.
[0061] At present, in front-end web development, there are often some third-party component libraries such as elementui, arco-design, etc. that provide button and pop-up components for users to call, thereby simplifying the development process and improving development efficiency.
[0062] However, in actual use, there is still a lot of repetitive code writing, such as the need to write code to add a pop-up window component, or to control the display and hiding of the pop-up window component, which complicates the development process. Moreover, when there is an interface call between the button and the server, the button needs to be set to an unclickable (disabled) state, and the unclickable state of some buttons is related. For example, when a piece of data is deleted, other modification operations of this data cannot be performed. In this case, repeated code will also be written to achieve the above purpose, and the development process is not simplified enough. Therefore, a method is urgently needed to simplify the above development process.
[0063] To address this problem, an embodiment of the present disclosure provides a method for generating a secondary confirmation pop-up box, which is described below in conjunction with a specific embodiment.
[0064] Figure 1A flow chart of the method for generating a secondary confirmation pop-up box provided in an embodiment of the present disclosure. The executor of the method is an electronic device, which may be a portable mobile device such as a smart phone, a tablet computer, a laptop computer, a car navigation device, or smart sports equipment; it may also be a fixed device such as a personal computer, a smart home appliance, or a server, wherein the server may be a single server or a server cluster, and the server cluster may be a distributed cluster or a centralized cluster. The method can be applied to the scenario of generating a secondary confirmation pop-up box, without the need to repeatedly write code, thus simplifying the development process. It is understandable that the method for generating a secondary confirmation pop-up box provided in an embodiment of the present disclosure may also be applied in other scenarios.
[0065] Below Figure 1 The method for generating a secondary confirmation pop-up box is introduced as shown in the figure. The specific steps of the method are as follows:
[0066] S101, initializing component configuration data of the secondary confirmation pop-up box.
[0067] like Figure 2 As shown, the electronic device initializes the components.
[0068] In some embodiments, S101 may include but is not limited to S1011 and S1012:
[0069] S1011. Configure the type of a secondary confirmation pop-up box and the display content of the secondary confirmation pop-up box; the type of the secondary confirmation pop-up box includes a first type or a second type.
[0070] Figure 3 Configure data for the secondary confirmation pop-up component, such as Figure 3 As shown, confirmType indicates the type of the secondary confirmation pop-up box, and the types of the secondary confirmation pop-up box include the first type or the second type. In some embodiments, the first type is pop, that is, a small confirmation box pops up next to the button, which is used to operate buttons with general impact; the first type is modal, that is, a mask pop-up window covering the entire page, which is used to operate buttons with greater impact. Optionally, the type of the secondary confirmation pop-up box can be expanded according to specific needs, and the pop-up box rendering function can be implemented in the component without specific limitation. Figure 3 As shown, content represents the display content of the secondary confirmation pop-up box. The display content can be a text type or a custom rendered element code snippet, without specific limitation.
[0071] S1012: Configure an identifier of a target button and configure identifiers of other buttons that share a disabled state with the target button.
[0072] like Figure 3As shown in the figure, ownKey represents the unique identifier of the target button, and the identifier of the target button is button1. disableConnectKeys is used to record the identifier information of other buttons that share the disabled state with the target button. The identifiers of other buttons can be added to disableConnectKeys. If the button corresponding to a certain ownKey identifier added in disableConnectKeys is in the disabled state, the target button will also be in the disabled state. That is, when other buttons in disableConnectKeys are disabled, the target button will also be disabled, so that the disabled state can be shared and the disabled state synchronization between associated buttons can be achieved.
[0073] S102: Call a button rendering function to generate a target button.
[0074] In this step, the electronic device can call the button rendering function to render the target button into the page. Figure 2 As shown, the electronic device calls the button rendering function to generate a target button.
[0075] S103: Detect a target button click event, call a secondary confirmation pop-up box function, and generate a secondary confirmation pop-up box.
[0076] like Figure 2 As shown, when the electronic device detects a target button click event, it will call the secondary confirmation pop-up box function to generate a secondary confirmation pop-up box. Specifically, if the electronic device detects a target button click event, it can call the secondary confirmation pop-up box function to render the secondary confirmation pop-up box into the page.
[0077] S104: In response to the user's confirmation operation in the secondary confirmation pop-up box, executing a target button click event.
[0078] In this step, if Figure 2 As shown, the user can click to confirm in the secondary confirmation pop-up box, and the electronic device will execute a target button click event in response to the user's confirmation operation in the secondary confirmation pop-up box.
[0079] The disclosed embodiment initializes the component configuration data of the secondary confirmation pop-up box, calls the button rendering function, generates the target button, detects the target button click event, calls the secondary confirmation pop-up box function, generates the secondary confirmation pop-up box, and executes the target button click event in response to the user's confirmation operation in the secondary confirmation pop-up box. Compared with the prior art, the disclosed embodiment calls the button rendering function, generates the target button, detects the target button click event, calls the secondary confirmation pop-up box function, and generates the secondary confirmation pop-up box. Through this method, there is no need to introduce an additional confirmation pop-up box component, nor is there any need to write related code, which greatly improves development efficiency.
[0080] Figure 4 A flow chart of a method for generating a secondary confirmation pop-up box provided in another embodiment of the present disclosure is shown in FIG. Figure 4 As shown, the method includes the following steps:
[0081] S201, initializing component configuration data of the secondary confirmation pop-up box.
[0082] Specifically, the implementation process and principle of S201 and S101 are the same, and will not be repeated here.
[0083] S202, encapsulate button rendering function.
[0084] In this step, the electronic device will encapsulate the button rendering function.
[0085] In some embodiments, S202 may include but is not limited to S2021, S2022, and S2023:
[0086] S2021. Bind the button properties of the target button to the slot.
[0087] First, bind the button attributes passed in by the client to slots. Slots are a mechanism for passing content in components. Through slots, you can pass any content in the parent component to a specific location in the child component, thereby achieving more flexible component reuse and customization.
[0088] S2022. Set the target button disabling condition.
[0089] In some embodiments, setting the target button disabling condition in S2022 may include:
[0090] a. When the variable used to mark the disabled state of the button is the first variable, setting the target button to be disabled; and / or
[0091] b. when the disabled attribute of the target button in the disabled state collector is the first attribute, setting the target button to be disabled; and / or
[0092] c. When the disabled attribute of other buttons in the disabled state collector that share the disabled state with the target button is the first attribute, set the target button to be disabled.
[0093] Then, set the target button disabling condition. Condition a: When the responsive data loading is true, that is, the variable used to mark the disabled state of the button is the first variable, the target button is set to be disabled. Responsive data means that when the data changes, these changes are automatically detected and the relevant views are updated; and / or, condition b: When the disabled attribute passed in by the user is true, that is, when the disabled attribute of the target button in the disabled state collector passed in by the user is the first attribute, the target button is set to be disabled; and / or, condition c: When the disabled attribute of other buttons in disableConnectKeys that share the disabled state with the target button in the loadingCollections collector is true, that is, when the disabled attribute of other buttons that share the disabled state with the target button in the disabled state collector is the first attribute, the target button is set to be disabled. In some embodiments, the first variable is true and the second variable is false. Optionally, the first variable can be 1 and the second variable can be 0, which is not limited here. In some embodiments, the first attribute is true and the second attribute is false. Optionally, the first attribute can be 1 and the second attribute can be 0, which is not limited here.
[0094] Among them, loadingCollections is used to collect the disabled status of all buttons in loading state, and is used to synchronize the status of buttons with disabled relationship.
[0095] S2023. Bind the button rendering function to the target button click event.
[0096] Next, bind the button rendering function to the target button click event to disable the target button when the target button is disabled.
[0097] S203: Call the button rendering function to generate a target button.
[0098] Specifically, the implementation process and principle of S203 and S102 are the same, and will not be repeated here.
[0099] S204, encapsulate the click event interceptor.
[0100] In this step, the electronic device will encapsulate a click event interceptor. The encapsulated click event interceptor is used to intercept the target button click event.
[0101] S205: Detect a target button click event, and intercept the target button click event by a click event interceptor.
[0102] In this step, when a target button click event is detected, the electronic device will intercept the target button click event through a click event interceptor.
[0103] In some embodiments, intercepting the target button click event through a click event interceptor includes: setting the variable used to mark the disabled state of the button as a first variable through the click event interceptor, and judging whether the user passes the target button identifier into the disabled state collector based on the component configuration data; if so, adding the target button identifier in the disabled state collector, and setting the disabled attribute of the target button to the first attribute to intercept the target button click event.
[0104] In this embodiment, the click event interceptor first sets the variable used to mark the disabled state of the button to the first variable, that is, true, and then determines whether the user passes the identifier (ownKey) of the target button into the disabled state collector. If so, the identifier (ownKey) of the target button is added to loadingCollections (disabled state collector), and the disabled attribute of the target button is set to the first attribute, that is, true.
[0105] S206: Encapsulate the secondary confirmation pop-up box function based on the type of the secondary confirmation pop-up box and the display content of the secondary confirmation pop-up box.
[0106] In this step, the electronic device will encapsulate the secondary confirmation pop-up box function according to the type of the secondary confirmation pop-up box and the display content of the secondary confirmation pop-up box. The encapsulated secondary confirmation pop-up box function is different depending on the type of the secondary confirmation pop-up box and / or the display content of the secondary confirmation pop-up box.
[0107] S207: Call the secondary confirmation pop-up box function to generate a secondary confirmation pop-up box corresponding to the type of the secondary confirmation pop-up box.
[0108] In this step, the electronic device calls the secondary confirmation pop-up box function to generate a secondary confirmation pop-up box corresponding to the type of the secondary confirmation pop-up box. Different secondary confirmation pop-up box functions are called, and different secondary confirmation pop-up boxes are displayed.
[0109] S208: In response to the user's confirmation operation in the secondary confirmation pop-up box, executing a target button click event.
[0110] Specifically, the implementation process and principle of S208 and S104 are the same, and will not be repeated here.
[0111] The disclosed embodiment initializes the component configuration data of the secondary confirmation pop-up box and encapsulates the button rendering function. Further, the button rendering function is called to generate a target button, a click event interceptor is encapsulated, a target button click event is detected, and the target button click event is intercepted by the click event interceptor. Then, based on the type of the secondary confirmation pop-up box and the display content of the secondary confirmation pop-up box, the secondary confirmation pop-up box function is encapsulated, the secondary confirmation pop-up box function is called, a secondary confirmation pop-up box corresponding to the type of the secondary confirmation pop-up box is generated, and in response to the user's confirmation operation in the secondary confirmation pop-up box, the target button click event is executed. Through this method, there is no need to introduce an additional confirmation pop-up box component, nor is there any need to write related code, which greatly improves development efficiency.
[0112] Figure 5 A flow chart of a method for generating a secondary confirmation pop-up box provided in another embodiment of the present disclosure is shown in FIG. Figure 5 As shown, the method includes the following steps:
[0113] S301, initializing component configuration data of the secondary confirmation pop-up box.
[0114] Specifically, the implementation process and principle of S301 and S101 are the same, and will not be repeated here.
[0115] S302: Call a button rendering function to generate a target button.
[0116] Specifically, the implementation process and principle of S302 and S102 are the same, and will not be repeated here.
[0117] S303, encapsulate the click event interceptor.
[0118] Specifically, the implementation process and principle of S303 and S204 are the same, and will not be repeated here.
[0119] S304: Detect a target button click event, and intercept the target button click event by a click event interceptor.
[0120] Specifically, the implementation process and principle of S304 and S205 are the same, and will not be repeated here.
[0121] S305: Encapsulate a secondary confirmation pop-up box function based on the type of the secondary confirmation pop-up box and the display content of the secondary confirmation pop-up box.
[0122] Specifically, the implementation process and principle of S305 and S206 are the same, and will not be repeated here.
[0123] S306: Call the secondary confirmation pop-up box function to generate a secondary confirmation pop-up box corresponding to the type of the secondary confirmation pop-up box.
[0124] Specifically, the implementation process and principle of S306 and S207 are the same, and will not be repeated here.
[0125] S307: In response to the user's confirmation operation in the secondary confirmation pop-up box, trigger a target button click event through a click event interceptor.
[0126] In this step, the user can click to confirm in the secondary confirmation pop-up box, and the electronic device responds to the user's confirmation operation in the secondary confirmation pop-up box by triggering a target button click event through a click event interceptor.
[0127] S308: Execute the target button click event.
[0128] In this step, the electronic device executes the target button click event and returns a Promise. Promise is an object used to process asynchronous operations. It indicates the final completion or failure of a click event and returns a result value or error information. Promise objects have three states: Pending: Indicates that the click event is being executed; Fulfilled: Indicates that the click event has been successfully executed; Rejected: Indicates that the click event has failed to execute.
[0129] S309: When the target button click event is executed, the variable used to mark the disabled state of the button is set as a second variable through the click event interceptor, and the identifier of the target button in the disabled state collector is deleted.
[0130] In this step, when the target button click event is executed, the electronic device will set the variable used to mark the button disabled state to the second variable, namely false, through the click event interceptor, and delete the identifier (owenKey) of the target button in the disabled state collector (loadingCollections).
[0131] The disclosed embodiment initializes the component configuration data of the secondary confirmation pop-up box, calls the button rendering function, and generates a target button. Further, the click event interceptor is encapsulated, the target button click event is detected, the target button click event is intercepted by the click event interceptor, and based on the type of the secondary confirmation pop-up box and the display content of the secondary confirmation pop-up box, the secondary confirmation pop-up box function is encapsulated, the secondary confirmation pop-up box function is called, and a secondary confirmation pop-up box corresponding to the type of the secondary confirmation pop-up box is generated. Next, in response to the user's confirmation operation in the secondary confirmation pop-up box, the target button click event is triggered by the click event interceptor, and the target button click event is executed. Then, when the target button click event is executed, the variable used to mark the disabled state of the button is set to the second variable by the click event interceptor, and the identifier of the target button in the disabled state collector is deleted. Through this method, there is no need to introduce an additional confirmation pop-up box component, nor is there any need to write related code, which greatly improves development efficiency.
[0132] Figure 6 A schematic diagram of the structure of a secondary confirmation pop-up box generation device provided in an embodiment of the present disclosure. The secondary confirmation pop-up box generation device may be an electronic device as described in the above embodiment, or the secondary confirmation pop-up box generation device may be a component or assembly in the electronic device. The secondary confirmation pop-up box generation device provided in an embodiment of the present disclosure may execute the processing flow provided in an embodiment of the secondary confirmation pop-up box generation method, such as Figure 6 As shown, the secondary confirmation pop-up box generating device 40 includes: an initialization module 41, a first calling module 42, a second calling module 43, and an execution module 44; wherein the initialization module 41 is used to initialize the component configuration data of the secondary confirmation pop-up box; the first calling module 42 is used to call the button rendering function to generate a target button; the second calling module 43 is used to detect a target button click event, call the secondary confirmation pop-up box function, and generate a secondary confirmation pop-up box; the execution module 44 is used to execute the target button click event in response to the user's confirmation operation in the secondary confirmation pop-up box.
[0133] Optionally, when the initialization module 41 initializes the component configuration data of the secondary confirmation pop-up box, it is specifically used to: configure the type of the secondary confirmation pop-up box and the display content of the secondary confirmation pop-up box; the type of the secondary confirmation pop-up box includes the first type or the second type; configure the identifier of the target button and configure the identifiers of other buttons that share a disabled state with the target button.
[0134] Optionally, before the first calling module 42 calls the button rendering function and generates the target button, it is further used to: encapsulate the button rendering function;
[0135] When the first calling module 42 encapsulates the button rendering function, it is specifically used to: bind the button attribute of the target button with the slot; set the target button disabling condition; and bind the button rendering function with the target button click event.
[0136] Optionally, when the first calling module 42 sets the target button disabling condition, it is specifically used to: when the variable used to mark the disabled state of the button is the first variable, set the target button to be disabled; and / or when the disabled attribute of the target button in the disabled state collector is the first attribute, set the target button to be disabled; and / or when the disabled attribute of other buttons in the disabled state collector that share the disabled state with the target button is the first attribute, set the target button to be disabled.
[0137] Optionally, when the second calling module 43 detects a target button click event, calls a secondary confirmation pop-up box function, and generates a secondary confirmation pop-up box, it is specifically used to: encapsulate a click event interceptor; detect a target button click event, and intercept the target button click event through the click event interceptor; based on the type of the secondary confirmation pop-up box and the display content of the secondary confirmation pop-up box, encapsulate the secondary confirmation pop-up box function; call the secondary confirmation pop-up box function to generate a secondary confirmation pop-up box corresponding to the type of the secondary confirmation pop-up box.
[0138] Optionally, when the second calling module 43 intercepts the target button click event through the click event interceptor, it is specifically used to: set the variable used to mark the disabled state of the button to the first variable through the click event interceptor, and determine whether the user passes the target button identifier into the disabled state collector based on the component configuration data; if so, add the target button identifier in the disabled state collector, and set the disabled attribute of the target button to the first attribute to intercept the target button click event.
[0139] Optionally, when the execution module 44 executes the target button click event in response to the user's confirmation operation in the secondary confirmation pop-up box, it is specifically used to: trigger the target button click event through the click event interceptor in response to the user's confirmation operation in the secondary confirmation pop-up box; execute the target button click event; when the target button click event is completed, set the variable used to mark the disabled state of the button to the second variable through the click event interceptor, and delete the identifier of the target button in the disabled state collector.
[0140] Figure 6 The secondary confirmation pop-up box generating device of the illustrated embodiment can be used to execute the technical solution of the above-mentioned method embodiment, and its implementation principle and technical effect are similar, which will not be repeated here.
[0141] Figure 7 Schematic diagram of the structure of an electronic device in the embodiment of the present disclosure. Figure 7, which shows a structural schematic diagram of an electronic device 600 suitable for implementing the embodiments of the present disclosure. Figure 7 The electronic device shown is only an example and should not bring any limitation to the functions and scope of use of the embodiments of the present disclosure.
[0142] like Figure 7 As shown, the electronic device 600 may include a processing device (e.g., a central processing unit, a graphics processing unit, etc.) 601, which can perform various appropriate actions and processes according to a program stored in a read-only memory (ROM) 602 or a program loaded from a storage device 608 into a random access memory (RAM) 603 to implement the secondary confirmation bullet box generation method of the embodiment described in the present disclosure. In RAM 603, various programs and data required for the operation of the electronic device 600 are also stored. The processing device 601, ROM 602, and RAM 603 are connected to each other via a bus 604. An input / output (I / O) interface 605 is also connected to the bus 604.
[0143] Typically, the following devices may be connected to the I / O interface 605: an input device 606 including, for example, a touch screen, a touch pad, a keyboard, a mouse, a camera, a microphone, an accelerometer, a gyroscope, etc.; an output device 607 including, for example, a liquid crystal display (LCD), a speaker, a vibrator, etc.; a storage device 608 including, for example, a magnetic tape, a hard disk, etc.; and a communication device 609. The communication device 609 may allow the electronic device 600 to communicate with other devices wirelessly or by wire to exchange data. Although Figure 7 The electronic device 600 is shown with various devices, but it should be understood that it is not required to implement or possess all the devices shown. More or fewer devices may be implemented or possessed instead.
[0144] In particular, according to an embodiment of the present disclosure, the process described above with reference to the flowchart can be implemented as a computer software program. For example, an embodiment of the present disclosure includes a computer program product, which includes a computer program carried on a non-transitory computer-readable medium, and the computer program contains a program code for executing the method shown in the flowchart, thereby implementing the secondary confirmation pop-up box generation method as described above. In such an embodiment, the computer program can be downloaded and installed from the network through the communication device 609, or installed from the storage device 608, or installed from the ROM 602. When the computer program is executed by the processing device 601, the above-mentioned functions defined in the method of the embodiment of the present disclosure are executed.
[0145] It should be noted that the computer-readable medium disclosed above may be a computer-readable signal medium or a computer-readable storage medium or any combination of the above two. The computer-readable storage medium may be, for example, but not limited to, an electrical, magnetic, optical, electromagnetic, infrared, or semiconductor system, device or device, or any combination of the above. More specific examples of computer-readable storage media may include, but are not limited to: an electrical connection with one or more wires, a portable computer disk, a hard disk, a random access memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or flash memory), an optical fiber, a portable compact disk read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination of the above. In the present disclosure, a computer-readable storage medium may be any tangible medium containing or storing a program that may be used by or in combination with an instruction execution system, device or device. In the present disclosure, a computer-readable signal medium may include a data signal propagated in a baseband or as part of a carrier wave, in which a computer-readable program code is carried. This propagated data signal may take a variety of forms, including but not limited to an electromagnetic signal, an optical signal, or any suitable combination of the above. The computer readable signal medium may also be any computer readable medium other than a computer readable storage medium, which may send, propagate or transmit a program for use by or in conjunction with an instruction execution system, apparatus or device. The program code contained on the computer readable medium may be transmitted using any suitable medium, including but not limited to: wires, optical cables, RF (radio frequency), etc., or any suitable combination of the above.
[0146] In some embodiments, the client and the server may communicate using any currently known or future developed network protocol such as HTTP (HyperText Transfer Protocol), and may be interconnected with any form or medium of digital data communication (e.g., a communication network). Examples of communication networks include a local area network ("LAN"), a wide area network ("WAN"), an internet (e.g., the Internet), and a peer-to-peer network (e.g., an ad hoc peer-to-peer network), as well as any currently known or future developed network.
[0147] The computer-readable medium may be included in the electronic device, or may exist independently without being incorporated into the electronic device.
[0148] The computer-readable medium carries one or more programs. When the one or more programs are executed by the electronic device, the electronic device:
[0149] Initialize the component configuration data of the secondary confirmation pop-up box;
[0150] Call the button rendering function to generate the target button;
[0151] Detect the target button click event, call the secondary confirmation pop-up box function, and generate a secondary confirmation pop-up box;
[0152] In response to the user's confirmation operation in the secondary confirmation pop-up box, a target button click event is executed.
[0153] Optionally, when the above one or more programs are executed by the electronic device, the electronic device may also execute other steps described in the above embodiments.
[0154] Computer program code for performing the operations of the present disclosure may be written in one or more programming languages or a combination thereof, including, but not limited to, object-oriented programming languages, such as Java, Smalltalk, C++, and conventional procedural programming languages, such as "C" or similar programming languages. The program code may be executed entirely on the user's computer, partially on the user's computer, as a separate software package, partially on the user's computer and partially on a remote computer, or entirely on a remote computer or server. In cases involving a remote computer, the remote computer may be connected to the user's computer through any type of network, including a local area network (LAN) or a wide area network (WAN), or may be connected to an external computer (e.g., through the Internet using an Internet service provider).
[0155] The flow chart and block diagram in the accompanying drawings illustrate the possible architecture, function and operation of the system, method and computer program product according to various embodiments of the present disclosure. In this regard, each square box in the flow chart or block diagram can represent a module, a program segment or a part of a code, and the module, the program segment or a part of the code contains one or more executable instructions for realizing the specified logical function. It should also be noted that in some implementations as replacements, the functions marked in the square box can also occur in a sequence different from that marked in the accompanying drawings. For example, two square boxes represented in succession can actually be executed substantially in parallel, and they can sometimes be executed in the opposite order, depending on the functions involved. It should also be noted that each square box in the block diagram and / or flow chart, and the combination of the square boxes in the block diagram and / or flow chart can be implemented with a dedicated hardware-based system that performs a specified function or operation, or can be implemented with a combination of dedicated hardware and computer instructions.
[0156] The units involved in the embodiments described in the present disclosure may be implemented by software or hardware, wherein the name of a unit does not, in some cases, limit the unit itself.
[0157] The functions described above herein may be performed at least in part by one or more hardware logic components. For example, without limitation, exemplary types of hardware logic components that may be used include: field programmable gate arrays (FPGAs), application specific integrated circuits (ASICs), application specific standard products (ASSPs), systems on chips (SOCs), complex programmable logic devices (CPLDs), and the like.
[0158] In the context of the present disclosure, a machine-readable medium may be a tangible medium that may contain or store a program for use by or in conjunction with an instruction execution system, device, or equipment. A machine-readable medium may be a machine-readable signal medium or a machine-readable storage medium. A machine-readable medium may include, but is not limited to, an electronic, magnetic, optical, electromagnetic, infrared, or semiconductor system, device, or equipment, or any suitable combination of the foregoing. A more specific example of a machine-readable storage medium may include an electrical connection based on one or more lines, a portable computer disk, a hard disk, a random access memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or flash memory), an optical fiber, a portable compact disk read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination of the foregoing.
[0159] The above description is only a preferred embodiment of the present disclosure and an explanation of the technical principles used. Those skilled in the art should understand that the scope of disclosure involved in the present disclosure is not limited to the technical solutions formed by a specific combination of the above technical features, but should also cover other technical solutions formed by any combination of the above technical features or their equivalent features without departing from the above disclosed concept. For example, the above features are replaced with the technical features with similar functions disclosed in the present disclosure (but not limited to) by each other to form a technical solution.
[0160] In addition, although each operation is described in a specific order, this should not be understood as requiring these operations to be performed in the specific order shown or in a sequential order. Under certain circumstances, multitasking and parallel processing may be advantageous. Similarly, although some specific implementation details are included in the above discussion, these should not be interpreted as limiting the scope of the present disclosure. Some features described in the context of a separate embodiment can also be implemented in a single embodiment in combination. On the contrary, the various features described in the context of a single embodiment can also be implemented in multiple embodiments individually or in any suitable sub-combination mode.
[0161] Although the subject matter has been described in language specific to structural features and / or methodological logical actions, it should be understood that the subject matter defined in the appended claims is not necessarily limited to the specific features or actions described above. On the contrary, the specific features and actions described above are merely example forms of implementing the claims.
Claims
1. A method for generating a secondary confirmation pop-up box, characterized in that: The method comprises: Initialize the component configuration data of the secondary confirmation pop-up box; Call the button rendering function to generate the target button; Detect the target button click event, call the secondary confirmation pop-up box function, and generate a secondary confirmation pop-up box; In response to the user's confirmation operation in the secondary confirmation pop-up box, a target button click event is executed.
2. The method according to claim 1, characterized in that Initializing the component configuration data of the secondary confirmation pop-up box includes: Configuring the type of the secondary confirmation pop-up box and the display content of the secondary confirmation pop-up box; the type of the secondary confirmation pop-up box includes the first type or the second type; Configures the identity of the target button and configures the identities of other buttons that share the disabled state with the target button.
3. The method according to claim 1, characterized in that The calling button rendering function, before generating the target button, includes: Encapsulate button rendering function; The encapsulated button rendering function includes: Bind the button property of the target button to the slot; Set the target button disabling condition; Bind the button rendering function to the target button click event.
4. The method according to claim 3, characterized in that The target button disabling conditions are as follows: When the variable used to mark the disabled state of the button is the first variable, setting the target button to be disabled; and / or When the disabled attribute of the target button in the disabled state collector is the first attribute, setting the target button to be disabled; and / or When the disabled attribute of other buttons in the disabled state collector that share the disabled state with the target button is the first attribute, the target button is set to be disabled.
5. The method according to claim 1, characterized in that The detecting of the target button click event, calling the secondary confirmation pop-up box function, and generating the secondary confirmation pop-up box include: Encapsulate click event interceptor; Detecting a target button click event, and intercepting the target button click event by a click event interceptor; Based on the type of the secondary confirmation pop-up box and the display content of the secondary confirmation pop-up box, encapsulate the secondary confirmation pop-up box function; The secondary confirmation pop-up box function is called to generate a secondary confirmation pop-up box corresponding to the type of the secondary confirmation pop-up box.
6. The method according to claim 5, characterized in that The step of intercepting the target button click event by a click event interceptor includes: Setting a variable for marking a disabled state of a button as a first variable through a click event interceptor, and determining whether a user has passed an identifier of a target button into a disabled state collector based on the component configuration data; If passed in, the target button's identifier is added to the disabled state collector, and the disabled attribute of the target button is set as the first attribute to intercept the target button click event.
7. The method according to claim 5, characterized in that The step of executing a target button click event in response to a user's confirmation operation in the secondary confirmation pop-up box includes: In response to the user's confirmation operation in the secondary confirmation pop-up box, triggering a target button click event through a click event interceptor; Execute the target button click event; When the target button click event is executed, the variable used to mark the button disabled state is set to the second variable through the click event interceptor, and the identifier of the target button in the disabled state collector is deleted.
8. A secondary confirmation pop-up box generation device, characterized in that: The device comprises: Initialization module, used to initialize the component configuration data of the secondary confirmation pop-up box; The first calling module is used to call the button rendering function to generate a target button; The second calling module is used to detect the target button click event, call the secondary confirmation pop-up box function, and generate a secondary confirmation pop-up box; The execution module is used to execute a target button click event in response to a confirmation operation of the user in the secondary confirmation pop-up box.
9. An electronic device, characterized in that: include: Memory; processor; as well as Computer programs; The computer program is stored in the memory and is configured to be executed by the processor to implement the method according to any one of claims 1 to 7.
10. A computer-readable storage medium having a computer program stored thereon, characterized in that: When the computer program is executed by a processor, the method according to any one of claims 1 to 7 is implemented.
Citation Information
Cited By
A dual-path conditional branch event routing method based on RTC state awareness
CN122764705A
