Applet prompt component injection calling method, device, equipment, medium and product
By injecting reference information and template nodes of general prompt components during the mini-program building phase, and receiving and issuing prompt tasks during the runtime phase, the repetitive and tedious development work of mini-program prompt components and the problem of cross-page calls are solved. Unified registration and cross-page scheduling of components are realized, improving development efficiency and consistency.
Patent Information
- Application Number
- CN202511657352.9
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2025-11-13
- Publication Date
- 2026-02-27
- Estimated Expiration
- 2045-11-13
AI Technical Summary
When existing mini-program prompt components are displayed on multiple pages, the development work is repetitive and tedious, difficult to maintain and update in a unified manner, and not convenient for cross-page calls. They cannot meet the requirements of modern mini-program front-end development for low coupling, centralized control, and cross-page calls.
During the mini-program building phase, scripts analyze and traverse all page directories, parse page configuration files and inject reference information for general prompt components, read page template files and pre-mount component template nodes on the page, and receive prompt requests during the runtime phase and send tasks to the pre-mounted components for display and interaction.
It enables unified registration, automatic mounting, and cross-page scheduling of prompt-type components, reducing development costs, improving component consistency and operational efficiency, and facilitating practical application and promotion.
Smart Images

Figure CN121092349B_ABST
Abstract
Description
TECHNICAL FIELD
[0001] The application belongs to the technical field of applet front-end development, and particularly relates to an applet prompt component injection calling method, device, equipment, medium and product. BACKGROUND
[0002] An applet is an application that can be used without downloading and installing, which realizes the dream of "reaching out to touch" the application, and the user can open the application by scanning or searching. The applet also embodies the concept of "walk away after use", and the user does not need to worry about whether too many applications are installed.
[0003] Currently, in the front-end development process of, for example, WeChat applets and other similar applets, if interface prompt content with unified style and behavior needs to be displayed in multiple pages (for example, in the form of a pop-up window, a confirmation box or a prompt window), the usual approach is as follows: first, the developer needs to explicitly import a pop-up window component in the configuration file (such as a json format file) of each page; then, the component tag is manually declared in the page template file (such as a wxml format file); finally, the view state is dynamically updated by using, for example, the this.setData() function in the business logic to control the display and hiding of the pop-up window.
[0004] However, the above approach has the following disadvantages: (1) the development work is repetitive and tedious, that is, the pop-up window logic needs to be manually imported, bound and controlled in each page; (2) the pop-up window function is scattered, that is, it is difficult to uniformly maintain and update the prompt logic in multiple pages; (3) it is not convenient for general scene reuse, that is, the pop-up window logic cannot be called in, for example, an interceptor, an interface exception or a unified error code logic position due to the limitation of the page structure.
[0005] In summary, the existing applet prompt display scheme cannot meet the actual needs of modern applet front-end development for "low coupling, centralized control and cross-page calling". SUMMARY
[0006] The purpose of the present application is to provide an applet prompt component injection calling method, device, computer equipment, computer readable storage medium and computer program product, which can realize the unified registration, automatic mounting and cross-page scheduling of prompt type components, reduce the development cost, and improve the component consistency and running efficiency.
[0007] In order to achieve the above purpose, the present application adopts the following technical scheme:
[0008] In a first aspect, an applet prompt component injection calling method is provided, comprising:
[0009] In the construction stage of a target applet, all page directories of the target applet are analyzed and traversed by a script;
[0010] For each page in the all page directory, parse the corresponding page configuration file, and inject the reference information of the preset general prompt component into the corresponding page configuration file;
[0011] For each page, read the corresponding page template file, and inject the template node of the general prompt component into the corresponding page structure, so that the general prompt component is pre-mounted on the corresponding page;
[0012] In the running stage of the target applet, if a prompt request is received from any logical position, a prompt task is generated according to the prompt request;
[0013] The prompt task is issued to the general prompt component that has been pre-mounted on the current page, so as to call the general prompt component to complete the prompt content display and user interaction.
[0014] Based on the above invention content, a new scheme capable of dynamically compiling and injecting and calling the applet general prompt component is provided, that is, in the construction stage of the target applet, first, for each page, parse the corresponding page configuration file, and inject the reference information of the general prompt component into the corresponding page configuration file, then read the corresponding page template file, and inject the prompt component template node into the corresponding page structure, finally, in the running stage of the applet, if a prompt request is received from any logical position, a prompt task is generated according to the prompt request, and the task is issued to the prompt component that has been pre-mounted on the current page, so as to call the prompt component to complete the prompt content display and user interaction, thereby realizing unified registration, automatic mounting and cross-page scheduling of the prompt component, reducing development cost, improving component consistency and running efficiency, and facilitating actual application and promotion.
[0015] In one possible design, in the construction stage of the target applet, all page directories of the target applet are analyzed and traversed through a script, including:
[0016] Based on the static module packaging tool webpack construction process to make the target applet enter the construction stage;
[0017] In the construction stage of the target applet, all page directories of the target applet are analyzed and traversed through a Loader script for scanning json configuration files and wxml template files of all pages in the applet.
[0018] In one possible design, for each page in the all page directory, the corresponding page configuration file is parsed, and the reference information of the preset general prompt component is injected into the corresponding page configuration file, including:
[0019] For a specific page in all the page directories, the corresponding page configuration file, which is in JSON format, is parsed using the @humanwhocodes / momoa tool to obtain the corresponding JSON configuration structure;
[0020] The page path indicated by the usingComponents configuration item is identified in the JSON configuration structure;
[0021] Determine whether a preset general prompt component has been introduced in the page path;
[0022] If not, the reference information of the general prompt component is injected into the usingComponents configuration item through the @humanwhocodes / momoa tool to modify the JSON configuration structure. The reference information includes the component definition content and the component path.
[0023] In one possible design, for each page, the corresponding page template file is read, and the template node of the general prompt component is injected into the corresponding page structure, including:
[0024] For any page in all the page directories, the htmlparser2 tool is used to read and parse the page template file in wxml format to obtain the corresponding page structure;
[0025] The template node of the general prompt component is injected into the page structure of any page in a valid form, and a preset unified component mark is appended to the end of the page structure.
[0026] In one possible design, the legal form includes an injection operation that is idempotent and incremental.
[0027] In one possible design, the method further includes:
[0028] After the general prompt component completes the display of the prompt content, it triggers the execution of pre-configured subsequent actions, which include continuing to jump actions and / or callback function actions.
[0029] Secondly, a mini-program prompt component injection and calling device is provided, including a page directory traversal unit, a page configuration modification unit, a page structure modification unit, a prompt task generation unit, and a task issuance prompt unit;
[0030] The page directory traversal unit is used to analyze and traverse all page directories of the target mini-program through scripts during the construction phase of the target mini-program.
[0031] The page configuration modification unit is in communication connection with the page directory traversal unit, configured to parse a corresponding page configuration file for each page in the all page directories, and inject reference information of a preset universal prompt component into the corresponding page configuration file;
[0032] The page structure modification unit is in communication connection with the page configuration modification unit, configured to read a corresponding page template file for each page, and inject a template node of the universal prompt component into the corresponding page structure, so that the universal prompt component is pre-mounted on the corresponding page;
[0033] The prompt task generation unit is configured to, in a running stage of the target applet, if a prompt request from any logical position is received, generate a prompt task according to the prompt request;
[0034] The task issuing and prompting unit is in communication connection with the page structure modification unit and the prompt task generation unit respectively, configured to issue the prompt task to the universal prompt component that has been pre-mounted on a current page, so as to call the universal prompt component to complete prompt content display and user interaction.
[0035] In a third aspect, the present application provides a computer device, comprising a storage module, a processing module and a transceiver module in communication connection, wherein the storage module is configured to store a computer program, the transceiver module is configured to transceive messages, and the processing module is configured to read the computer program and execute the applet prompt component injection and calling method as in the first aspect or any possible design in the first aspect.
[0036] In a fourth aspect, the present application provides a computer readable storage medium, having instructions stored thereon, when the instructions are executed on a computer, the applet prompt component injection and calling method as in the first aspect or any possible design in the first aspect is executed.
[0037] In a fifth aspect, the present application provides a computer program product, comprising a computer program or instructions, when the computer program or the instructions are executed by a computer, the applet prompt component injection and calling method as in the first aspect or any possible design in the first aspect is implemented.
[0038] The above-mentioned scheme has the following beneficial effects:
[0039] (1) The application creatively provides a new scheme capable of dynamically compiling, injecting and calling a common prompt component of a small program, that is, in the construction stage of the target small program, first, the corresponding page configuration file is parsed for each page, and the reference information of the common prompt component is injected into the corresponding page configuration file, then the corresponding page template file is read, and the prompt component template node is injected into the corresponding page structure, and finally in the small program running stage, if a prompt request from any logical position is received, a prompt task is generated according to the prompt request, and the task is issued to the prompt component pre-mounted on the current page, so as to call the prompt component to complete the prompt content display and user interaction, thereby realizing unified registration, automatic mounting and cross-page scheduling of the prompt component, reducing development cost, and improving component consistency and running efficiency;
[0040] (2) The page does not need to repeatedly introduce the prompt component, that is, the prompt component is uniformly injected by the system, thereby reducing the page development cost;
[0041] (3) The prompt component can be uniformly called across pages, that is, the prompt component can be displayed at any logical position, thereby improving the decoupling degree between system modules;
[0042] (4) The prompt component can support centralized style and behavior configuration, that is, the prompt style and behavior logic are uniformly maintained, thereby enhancing consistency;
[0043] (5) The development experience can be improved, that is, the prompt component is closer to the modern framework and has the declarative or functional popup calling experience of React / Vue;
[0044] (6) The prompt component has strong expansibility, that is, the prompt component can support various prompt styles (such as confirmation, selection and information, etc.), and is uniformly configured;
[0045] (7) By automatically analyzing all pages before the small program runs and batch inserting the definition and reference of the prompt component, the popup can be uniformly accessed without modifying the source page code;
[0046] (8) The prompt component has a non-invasive calling mechanism, that is, the prompt component can be displayed independently of the page life cycle without relying on the setData function for view update, thereby solving the state synchronization problem in complex interaction logic and facilitating practical application and promotion. BRIEF DESCRIPTION OF DRAWINGS
[0047] In order to more clearly illustrate the technical solutions in the embodiments of the application or the prior art, the following will briefly introduce the drawings needed to be used in the embodiments or prior art description. Obviously, the drawings in the following description only some embodiments of the application, and for those skilled in the art, other drawings can also be obtained without creative labor on the basis of these drawings.
[0048] Figure 1 A flowchart of a method for injecting a call of a programlet prompt component is provided for an embodiment of the present application.
[0049] Figure 2 A structural diagram of an apparatus for injecting a call of a programlet prompt component is provided for an embodiment of the present application.
[0050] Figure 3 A structural diagram of a computer device is provided for an embodiment of the present application. DETAILED DESCRIPTION
[0051] In order to more clearly illustrate the technical solutions of the embodiments of the present application or the prior art, the present application will be briefly introduced below in combination with the drawings and the description of the embodiments or the prior art. Obviously, the following description of the drawings is only some embodiments of the present application, and for those skilled in the art, other embodiments can be obtained without creative labor on the basis of these embodiments. It should be noted that the description of these embodiments is used to help understand the present application, but does not constitute a limitation on the present application.
[0052] It should be understood that although the terms first and second, etc. may be used herein to describe various objects, these objects should not be limited by these terms. These terms are only used to distinguish one object from another object. For example, a first object can be called a second object, and similarly, a second object can be called a first object, without departing from the scope of the example embodiments of the present application.
[0053] It should be understood that for the term "and / or" that may appear in the present text, it is only a description of the association relationship of the associated objects, which means that there can be three kinds of relationships, for example, A and / or B, which can represent three cases of existence of A alone, existence of B alone, or existence of A and B at the same time; for example, A, B and / or C, which means that any one of A, B and C or any combination thereof exists; for the term " / and" that may appear in the present text, it is another description of the relationship of another associated object, which means that there can be two kinds of relationships, for example, A / and B, which can represent two cases of existence of A alone or existence of A and B at the same time; in addition, for the character " / " that may appear in the present text, it generally represents an "or" relationship between the associated objects before and after it.
[0054] EMBODIMENT
[0055] As Figure 1As shown, the applet prompt component injection calling method provided in the first aspect of the present embodiment can be executed by a computer device with certain computing resources, but is not limited to this, for example, by a server, a personal computer (PC, a multi-purpose computer with size, price and performance suitable for personal use), a smart phone, a personal digital assistant (PDA) or a wearable device, etc. Figure 1 As shown, the applet prompt component injection calling method includes, but is not limited to, the following steps S1-S5.
[0056] S1. In the construction phase of the target applet, analyze and traverse all page directories of the target applet through a script.
[0057] In the step S1, the target applet is an applet development object, which can be, but is not limited to, a certain WeChat applet. The present embodiment mainly performs automatic analysis and prompt component injection on the applet source code in the construction phase. Specifically, in the construction phase of the target applet, all page directories of the target applet are analyzed and traversed through a script, including but not limited to the following steps S11-S12.
[0058] S11. Based on the static module packaging tool webpack construction process to make the target applet enter the construction phase.
[0059] In the step S11, the static module packaging tool webpack is a code compilation tool for modern JavaScript applications, which has an entry, an exit and a plug-in, etc. When processing an application, it will internally build a dependency graph, which will be mapped to each module required by the project, and generate one or more bundle files. Therefore, the specific construction process of the target applet can be derived based on the existing technology, and will not be described here.
[0060] S12. In the construction phase of the target applet, analyze and traverse all page directories of the target applet through a Loader script for scanning all pages of the applet.
[0061] In the step S12, the Loader script is equivalent to a project plug-in in the static module packaging tool webpack, can uniformly process the specified file, is also a function, and is equivalent to the source code passing through the function and becoming the desired target. In addition, the Loader script can be routinely customized.
[0062] S2. For each page in the all page directories, parse the corresponding page configuration file, and inject the reference information of the preset general prompt component into the corresponding page configuration file.
[0063] In the step S2, the general prompt component is a prompt component specially designed for general scene reuse, which can be routinely designed in advance based on existing component design means; the reference information specifically includes but is not limited to component definition content and component path, etc., which can facilitate the correct registration of the corresponding component when loaded in the page after being injected into the page configuration file. Specifically, for each page in the all page directories, parse the corresponding page configuration file, and inject the reference information of the preset general prompt component into the corresponding page configuration file, including but not limited to the following steps S21-S24.
[0064] S21. For a certain page in the all page directories, parse the corresponding page configuration file which is specifically in json format by using the @humanwhocodes / momoa tool, to obtain the corresponding json configuration structure.
[0065] In the step S21, the @humanwhocodes / momoa tool is an existing open source tool kit for processing JSON data, which provides functions such as parsing, word segmentation, traversal and printing, and supports fine operations on complex JSON structures, so the json configuration structure of the certain page can be routinely parsed.
[0066] S22. Identify the page path indicated by the usingComponents configuration item in the json configuration structure.
[0067] In the step S22, the usingComponents configuration item is a core configuration item for declaring and importing custom components in the WeChat mini program, mainly used for realizing component-based development, so the page path indicated by the usingComponents configuration item can be routinely identified.
[0068] S23. Determine whether the preset general prompt component has been imported in the page path.
[0069] In the step S23, the specific judgment process may include, but is not limited to, judging whether the component path of the general prompt component is contained in the page path. If yes, it is determined that the general prompt component has been introduced in the page path. Otherwise, it is determined that the general prompt component has not been introduced.
[0070] S24. If no, the reference information of the general prompt component is injected into the usingComponents configuration item by the @humanwhocodes / momoa tool, so as to complete the modification of the json configuration structure and ensure that the general prompt component is correctly registered when loaded in the certain page. The reference information may include, but is not limited to, component definition content and component path.
[0071] S3. For each page, a corresponding page template file is read, and a template node of the general prompt component is injected into a corresponding page structure, so that the general prompt component is pre-mounted on the corresponding page.
[0072] In the step S3, by pre-mounting the general prompt component on the page, it is not necessary to manually use the this.setData() function and the like to dynamically update the view state to control the display and hiding of the pop-up window when the applet is running. Specifically, for each page, a corresponding page template file is read, and a template node of the general prompt component is injected into a corresponding page structure, including but not limited to the following steps S31-S32.
[0073] S31. For any page in the all page directory, a corresponding page template file in wxml format is read and parsed by the htmlparser2 tool to obtain a corresponding page structure.
[0074] In the step S31, the htmlparser2 tool is an open-source existing HTML (Hyper Text Markup Language) parsing tool, which is mainly used for processing and operating HTML documents, and supports functions such as DOM (Document Object Model) construction and streaming parsing, so that the page structure of the any page can be obtained by regular syntax parsing.
[0075] S32. The template node of the general prompt component is injected into the page structure of the any page in a legal form, and a preset uniform component mark is appended at the end of the page structure.
[0076] In the step S32, the legal form is used to ensure that the injection process conforms to the structural hierarchy and format specification, so as to avoid damaging the original page logic or rendering order. Further preferably, the legal form also includes that the injection operation has idempotency and incremental characteristics, so as to avoid repeated injection and support incremental construction; the aforementioned idempotency, incremental characteristics and incremental construction are all existing terms, for example, idempotency refers to the effect of multiple executions of a specific operation consistent with single execution, incremental construction refers to specifying the split time column information for the data model, that is, reading the data within the specified time range for construction each time to form a segment; thus, by injecting the template node of the general prompt component through the aforementioned legal form, it can ensure that the general prompt component remains consistent even if each construction re-scans the changed page file and performs intelligent processing. The uniform component mark can be specifically exemplified as “ <c-m / > ”. In addition, the steps S1-S3 are all completed uniformly in the construction stage of the target applet, so that the developer does not need to manually introduce components or bind rendering logic.
[0077] S4. In the running stage of the target applet, if a prompt request is received from any logical position, a prompt task is generated according to the prompt request.
[0078] In the step S4, the any logical position specifically but not limited to is a logical position for triggering a request error, permission limitation or business callback, etc. In addition, the prompt content, button configuration and callback logic, etc. in the prompt request can be conventionally encapsulated as the prompt task.
[0079] S5. The prompt task is issued to the general prompt component which has been pre-mounted on the current page, so as to call the general prompt component to complete the prompt content display and user interaction.
[0080] In the step S5, the specific process of the general prompt component to complete the prompt content display and user interaction can be derived based on the existing pop-up window technical means, and will not be described here. The foregoing steps S4-S5 are completed in the running stage of the target mini-program, and can be specifically implemented through a pre-packaged global pop-up window triggering interface (such as the interface wx.$.alert(options) of the WeChat mini-program, etc.). When the general prompt component is called, the pop-up window display can be automatically controlled through the internal state of the component, such as automatically displaying or hiding the pop-up window according to the data loading state or user operation feedback, so that manual triggering from the outside is not required. Therefore, when the prompt logic is called, only the prompt data object needs to be transmitted, and the display, interaction and destruction of the pop-up window can be completed, so that the developer does not need to manually maintain the view layer state or component display in the page logic, and only one line of code is required to trigger the prompt behavior. In addition, in order to extend the injection and calling function of the mini-program prompt component, preferably, the method further includes but is not limited to the following: after the general prompt component completes the prompt content display, a pre-configured subsequent action is triggered to be executed, wherein the subsequent action includes but is not limited to a continue jump action and / or a callback function action.
[0081] Therefore, based on the mini-program prompt component injection and calling method described in the foregoing steps S1-S5, a new scheme is provided, which can dynamically compile, inject and call the general prompt component of the mini-program, that is, in the building stage of the target mini-program, the corresponding page configuration file is parsed for each page, the reference information of the general prompt component is injected into the corresponding page configuration file, the corresponding page template file is read, and the prompt component template node is injected into the corresponding page structure. Finally, in the running stage of the mini-program, if a prompt request is received from any logical position, a prompt task is generated according to the prompt request, and the task is issued to the prompt component that has been pre-mounted on the current page, so that the prompt component is responsible for completing the prompt content display and user interaction. Therefore, the unified registration, automatic mounting and cross-page scheduling of the prompt component can be realized, the development cost is reduced, the component consistency and running efficiency are improved, and the actual application and promotion are facilitated.
[0082] As shown in Figure 2 The second aspect of the present embodiment provides a virtual device for implementing the mini-program prompt component injection and calling method of the first aspect, which includes a page directory traversal unit, a page configuration modification unit, a page structure modification unit, a prompt task generation unit and a task issuing prompt unit.
[0083] The page directory traversal unit is configured to analyze and traverse all page directories of the target mini-program in the building stage of the target mini-program.
[0084] The page configuration modification unit is communicatively connected to the page directory traversal unit and configured to parse a corresponding page configuration file for each page in the all page directories and inject reference information of a preset universal prompt component into the corresponding page configuration file.
[0085] The page structure modification unit is communicatively connected to the page configuration modification unit and configured to read a corresponding page template file for each page and inject a template node of the universal prompt component into the corresponding page structure, so that the universal prompt component is pre-mounted on the corresponding page.
[0086] The prompt task generation unit is configured to, in a running stage of the target applet, generate a prompt task according to a prompt request from any logical position if the prompt request is received.
[0087] The task issuing and prompting unit is respectively communicatively connected to the page structure modification unit and the prompt task generation unit and configured to issue the prompt task to the universal prompt component that is pre-mounted on a current page, so as to call the universal prompt component to complete prompt content display and user interaction.
[0088] The working process, working details and technical effects of the foregoing device provided by the second aspect of the embodiment can be referred to the applet prompt component injection and calling method of the first aspect, which will not be described herein.
[0089] As shown in Figure 3 The third aspect of the embodiment provides a computer device for executing the applet prompt component injection and calling method of the first aspect, which includes a storage module, a processing module and a transceiver module that are communicatively connected in sequence. The storage module is configured to store a computer program, the transceiver module is configured to transceive messages, and the processing module is configured to read the computer program and execute the applet prompt component injection and calling method of the first aspect. Specifically, the storage module can include, but is not limited to, a random access memory (RAM), a read-only memory (ROM), a flash memory, a first input first output (FIFO) memory and / or a first input last output (FILO) memory, etc. The processing module can be, but is not limited to, a microprocessor with a model number of STM32F105 series. In addition, the computer device can further include, but is not limited to, a power module, a display screen and other necessary components.
[0090] The working process, working details and technical effects of the computer device provided in the third aspect of the embodiment can be referred to the applet prompt component injection calling method in the first aspect, and will not be repeated here.
[0091] The fourth aspect of the embodiment provides a computer readable storage medium storing instructions of the applet prompt component injection calling method in the first aspect, that is, the computer readable storage medium stores instructions, and when the instructions are run on a computer, the applet prompt component injection calling method in the first aspect is executed. Wherein, the computer readable storage medium refers to a carrier for storing data, which can include, but is not limited to, floppy disks, optical disks, hard disks, flash memories, USB flash disks and / or memory sticks and other computer readable storage media, and the computer can be a general-purpose computer, a special-purpose computer, a computer network or other programmable devices.
[0092] The working process, working details and technical effects of the computer readable storage medium provided in the fourth aspect of the embodiment can be referred to the applet prompt component injection calling method in the first aspect, and will not be repeated here.
[0093] The fifth aspect of the embodiment provides a computer program product, including a computer program or instructions, which, when executed by a computer, implements the applet prompt component injection calling method in the first aspect. Wherein, the computer can be a general-purpose computer, a special-purpose computer, a computer network or other programmable devices.
[0094] Finally, it should be pointed out that: the above only for the preferred embodiments of the present application, and not for limiting the protection scope of the present application. Any modification, equivalent replacement, improvement, etc. made within the spirit and principles of the present application shall be included in the protection scope of the present application.
Claims
1. A method for applet prompt component injection invocation, characterized in that, Comprise: In the construction phase of the target applet, all page directories of the target applet are analyzed and traversed by scripts, specifically including: based on the webpack static module packaging tool construction process to make the target applet enter the construction phase; in the construction phase of the target applet, the Loader script is used to scan the json configuration file and wxml template file of all pages in the applet to analyze and traverse all page directories of the target applet; For each page in the all page directories, parse the corresponding page configuration file, and inject the reference information of the preset universal prompt component into the corresponding page configuration file, specifically including: for a certain page in the all page directories, parse the corresponding json format page configuration file by using the @humanwhocodes / momoa tool to obtain the corresponding json configuration structure; identify the page path indicated by the usingComponents configuration item in the json configuration structure; determine whether the preset universal prompt component has been imported in the page path; if not, inject the reference information of the universal prompt component into the usingComponents configuration item by using the @humanwhocodes / momoa tool to complete the modification of the json configuration structure, wherein the reference information contains component definition content and component path; For the pages, read the corresponding page template file, and inject the template node of the universal prompt component into the corresponding page structure, so that the universal prompt component is pre-mounted on the corresponding page, specifically including: for any page in the all page directories, read and parse the corresponding wxml format page template file by using the htmlparser2 tool to obtain the corresponding page structure; inject the template node of the universal prompt component into the page structure of the any page in a legal form, and append a preset uniform component mark at the end of the page structure; In the running phase of the target applet, if a prompt request is received from any logical position, a prompt task is generated according to the prompt request; The prompt task is sent to the universal prompt component pre-mounted on the current page, so as to call the universal prompt component to complete the prompt content display and user interaction.
2. The applet prompt component injection invocation method according to claim 1, wherein, The legal form includes that the injection operation has idempotency and incremental characteristics.
3. The applet prompt component injection invocation method of claim 1, wherein, The method further comprises: After the universal prompt component completes the prompt content display, trigger the execution of the pre-configured subsequent action, wherein the subsequent action includes continue jumping action and / or callback function action.
4. An applet prompt component injection invocation apparatus, characterized by comprising: Comprise a page directory traversal unit, a page configuration modification unit, a page structure modification unit, a prompt task generation unit and a task delivery prompt unit; The page directory traversal unit is configured to, in a construction stage of the target applet, analyze and traverse all page directories of the target applet through a script, specifically including: entering the construction stage of the target applet based on a webpack static module packaging tool construction process; in the construction stage of the target applet, analyzing and traversing all page directories of the target applet through a Loader script for scanning json configuration files and wxml template files of all pages in the applet; The page configuration modification unit is communicatively connected to the page directory traversal unit and is configured to, for each page in the all page directories, parse a corresponding page configuration file and inject reference information of a preset universal prompt component into the corresponding page configuration file, specifically including: for a certain page in the all page directories, parsing a corresponding page configuration file in json format through a @humanwhocodes / momoa tool to obtain a corresponding json configuration structure; identifying a page path indicated by a usingComponents configuration item in the json configuration structure; determining whether the universal prompt component has been imported into the page path; if not, injecting reference information of the universal prompt component into the usingComponents configuration item through the @humanwhocodes / momoa tool to complete modification of the json configuration structure, wherein the reference information includes component definition content and a component path; The page structure modification unit is communicatively connected to the page configuration modification unit and is configured to, for the each page, read a corresponding page template file and inject a template node of the universal prompt component into a corresponding page structure, so that the universal prompt component is pre-mounted on the corresponding page, specifically including: for any page in the all page directories, reading and syntax analyzing a corresponding page template file in wxml format through an htmlparser2 tool to obtain a corresponding page structure; injecting a template node of the universal prompt component into the page structure of the any page in a legal form, and appending a preset uniform component marker at the end of the page structure; The prompt task generation unit is configured to, in a running stage of the target applet, if a prompt request from any logical position is received, generate a prompt task according to the prompt request; The task issuing and prompting unit is respectively communicatively connected to the page structure modification unit and the prompt task generation unit and is configured to issue the prompt task to the universal prompt component pre-mounted on a current page, so as to call the universal prompt component to complete prompt content display and user interaction.
5. A computer device, comprising: The application comprises a storage module, a processing module and a transceiver module connected in sequence, wherein the storage module is used for storing a computer program, the transceiver module is used for receiving and sending messages, and the processing module is used for reading the computer program and executing the applet prompt component injection calling method as claimed in any one of claims 1-3.
6. A computer-readable storage medium, characterized in that The computer readable storage medium stores instructions, and when the instructions run on the computer, the applet prompt component injection calling method as claimed in any one of claims 1-3 is executed.
7. A computer program product comprising computer programs or instructions, characterized in that, The computer program or the instructions realize the applet prompt component injection calling method as claimed in any one of claims 1-3 when executed by the computer.