WeChat positioning applet development method and device and electronic equipment
By creating and configuring uni-app projects in the code editor, the problem of low efficiency in development of WeChat positioning mini-programs is solved, and a more efficient development process is achieved.
Patent Information
- Application Number
- CN202310748300.7
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2023-06-21
- Publication Date
- 2024-12-24
AI Technical Summary
The existing WeChat positioning mini-program development method requires developers to spend a lot of time learning WeChat grammar, and it is prone to standard errors during the writing process, resulting in low development efficiency.
By creating the initial uni-app project in the code editor, adding preset source files, importing index files, and adding positioning tags to the preset bit page of the project, uploading coordinate data through these tags, and finally the configured project Compile and generate a WeChat location applet.
This method configures uni-app projects by calling preset source files, significantly improving the development efficiency of WeChat positioning mini programs, reducing specification errors caused by unfamiliarity with WeChat syntax, and improving development efficiency.
Smart Images

Figure CN119179470A_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the field of Internet development technology, and in particular to a WeChat positioning applet development method, device and electronic equipment. Background Art
[0002] At present, the existing WeChat positioning applet development method requires developers to spend a lot of time learning WeChat syntax, and it is easy to make standard errors in the program writing process due to unfamiliarity with WeChat syntax, resulting in the current WeChat positioning applet development method having low development efficiency. Summary of the invention
[0003] The purpose of the present invention is to provide a WeChat positioning applet development method, device and electronic device to improve the efficiency of WeChat positioning applet development.
[0004] In the first aspect, an embodiment of the present invention provides a method for developing a WeChat positioning applet, which includes: creating an initial uni-app project in a code editor; adding a preset source file to the above initial uni-app project; the above source file is a native code written based on WeChat programming syntax for obtaining positioning coordinates; importing the index file in the above source file into the root directory of the above initial uni-app project, and setting the positioning tag of the above source file; adding the above positioning tag to the preset positioning page of the above initial uni-app project; uploading coordinate data through the above positioning tag to obtain a configured uni-app project; compiling the above configured uni-app project to generate a WeChat positioning applet.
[0005] In combination with the first aspect, an embodiment of the present invention provides a first possible implementation of the first aspect, wherein the above-mentioned code editor is: HBuilderX code editor.
[0006] In combination with the first possible implementation of the first aspect, an embodiment of the present invention provides a second possible implementation of the first aspect, wherein the step of adding preset source files in the above-mentioned initial uni-app project includes: creating a WeChat component folder in the above-mentioned initial uni-app item, and adding preset source files in the above-mentioned WeChat component folder.
[0007] In combination with the first aspect, an embodiment of the present invention provides a third possible implementation method of the first aspect, wherein the step of importing the index file in the above-mentioned source file into the root directory of the above-mentioned initial uni-app project includes: importing the index file in the above-mentioned source file into the usage component property in the root directory of the above-mentioned initial uni-app project.
[0008] In combination with the WeChat positioning applet development method of any one of the first aspect to the third possible implementation manner of the first aspect, an embodiment of the present invention provides a fourth possible implementation manner of the first aspect, wherein, in the preset positioning page of the above-mentioned initial uni-app project, the step of adding the above-mentioned positioning tag includes: adding the above-mentioned positioning tag in the preset positioning page of the page folder of the above-mentioned initial uni-app project.
[0009] In combination with the first aspect, an embodiment of the present invention provides a fifth possible implementation method of the first aspect, wherein the step of compiling the configured uni-app project to generate a WeChat positioning applet includes: compiling the configured uni-app project through the code editor to obtain the WeChat applet source file; setting the permission attribute of continuous positioning in the global configuration file in the WeChat applet source file to obtain the configured WeChat applet source file; generating the WeChat positioning applet according to the configured WeChat applet source file.
[0010] In combination with the first aspect, an embodiment of the present invention provides a sixth possible implementation of the first aspect, wherein, after the step of creating an initial uni-app project in the code editor, the method further includes: based on a preset APP development language, writing an interaction file of the APP corresponding to the above APP development language; compiling the above interaction file to obtain an APP to be released; the above APP to be released has the same positioning function as the above WeChat positioning applet.
[0011] In the second aspect, an embodiment of the present invention also provides a WeChat positioning applet development device, which includes: a project creation module, used to create an initial uni-app project in a code editor; a source file adding module, used to add a preset source file in the above-mentioned initial uni-app project; the above-mentioned source file is a native code written based on WeChat programming syntax for obtaining positioning coordinates; a positioning tag setting module, used to import the index file in the above-mentioned source file into the root directory of the above-mentioned initial uni-app project, and set the positioning tag of the above-mentioned source file; a positioning tag adding module, used to add the positioning tag in the preset positioning page of the initial uni-app project; a configuration module, used to upload coordinate data through the above-mentioned positioning tag to obtain a configured uni-app project; a compilation module, used to compile the above-mentioned configured uni-app project to generate a WeChat positioning applet.
[0012] In a third aspect, an embodiment of the present invention provides an electronic device, wherein the electronic device includes a processor and a memory, the memory stores machine executable instructions that can be executed by the processor, and the processor executes the machine executable instructions to implement the WeChat positioning applet development method of any one of the first aspect to the sixth possible implementation methods of the first aspect.
[0013] In a fourth aspect, an embodiment of the present invention provides a computer storage medium, wherein the computer storage medium stores a computer program, and the computer program includes program instructions. When the program instructions are executed by a processor, the processor executes the WeChat positioning applet development method of any one of the first aspect to the sixth possible implementation methods of the first aspect.
[0014] The embodiments of the present invention bring the following beneficial effects:
[0015] The embodiment of the present invention provides a method, device and electronic device for developing a WeChat positioning applet, including: creating an initial uni-app project in a code editor; adding a preset source file to the initial uni-app project; the source file is a native code written based on WeChat programming syntax for obtaining positioning coordinates; importing the index file in the source file into the root directory of the initial uni-app project, and setting the positioning tag of the source file; adding the positioning tag in the preset positioning page of the initial uni-app project; uploading the coordinate data through the positioning tag to obtain the configured uni-app project; compiling the configured uni-app project to generate the WeChat positioning applet. The method calls the preset source file, then configures the initial uni-app project through the source file, and finally compiles the configured initial uni-app project to obtain the WeChat positioning applet, so as to improve the efficiency of the development of the WeChat positioning applet.
[0016] Other features and advantages disclosed in this embodiment will be described in the subsequent description, or some features and advantages can be inferred or determined without doubt from the description, or can be learned by implementing the above-mentioned technology of the present disclosure.
[0017] In order to make the above-mentioned objectives, features and advantages of the present disclosure more obvious and easy to understand, preferred embodiments are specifically cited below and described in detail with reference to the attached drawings. BRIEF DESCRIPTION OF THE DRAWINGS
[0018] In order to more clearly illustrate the specific implementation methods of the present invention or the technical solutions in the prior art, the drawings required for use in the specific implementation methods or the description of the prior art will be briefly introduced below. Obviously, the drawings described below are some implementation methods of the present invention. For ordinary technicians in this field, other drawings can be obtained based on these drawings without paying creative work.
[0019] Figure 1 A flowchart of a method for developing a WeChat positioning applet provided by an embodiment of the present invention;
[0020] Figure 2 A flowchart of another WeChat positioning applet development method provided by an embodiment of the present invention;
[0021] Figure 3 A schematic diagram of the structure of a WeChat positioning applet development device provided by an embodiment of the present invention;
[0022] Figure 4 A schematic diagram of the structure of an electronic device is provided for an embodiment of the present invention.
[0023] Icons: 31-project creation module; 32-source file adding module; 33-positioning tag setting module; 34-positioning tag adding module; 35-configuration module; 36-compilation module; 41-memory; 42-processor; 43-bus; 44-communication interface. DETAILED DESCRIPTION
[0024] In order to make the purpose, technical solutions and advantages of the embodiments of the present invention clearer, the technical solutions in the embodiments of the present invention will be clearly and completely described below in conjunction with the drawings in the embodiments of the present invention. Obviously, the described embodiments are part of the embodiments of the present invention, not all of the embodiments. Generally, the components of the embodiments of the present invention described and shown in the drawings here can be arranged and designed in various different configurations.
[0025] The existing WeChat positioning applet development method requires developers to spend a lot of time learning WeChat syntax, and it is easy to make standard errors in the program writing process due to unfamiliarity with WeChat syntax, resulting in the current WeChat positioning applet development method having low development efficiency.
[0026] Based on this, the embodiment of the present invention provides a WeChat positioning applet development method, device and electronic device, which calls a preset source file, then configures the initial uni-app project through the source file, and finally compiles the configured initial uni-app project to obtain the WeChat positioning applet, so as to improve the efficiency of the WeChat positioning applet development. To facilitate understanding of the embodiment of the present invention, a WeChat positioning applet development method disclosed in the embodiment of the present invention is first introduced in detail.
[0027] Example 1
[0028] In this embodiment, Figure 1 A flowchart of a WeChat positioning applet development method provided in an embodiment of the present invention.
[0029] Depend on Figure 1 As can be seen, the above methods include:
[0030] Step S101: Create an initial uni-app project in a code editor.
[0031] Step S102: Add a preset source file to the above initial uni-app project; the above source file is a native code written based on WeChat programming syntax for obtaining positioning coordinates.
[0032] Here, create a new folder named wxcomponets in the above initial uni-app project to place the above source files through the above wxcomponets folder.
[0033] Step S103: import the index file in the source file into the root directory of the initial uni-app project, and set the location tag of the source file.
[0034] In this embodiment, the step S103 further includes: setting the name of the positioning tag. Further, the step S104 further includes: adding the name of the positioning tag in the preset positioning page of the initial uni-app project to upload the coordinate data through the name of the positioning tag.
[0035] Step S104: Add the above positioning tag in the preset positioning page of the above initial uni-app project.
[0036] In actual operation, step S104 includes adding the above positioning tag in the pages folder in the folder corresponding to the above uni-app project.
[0037] Step S105: Upload the coordinate data through the positioning tag to obtain the configured uni-app project.
[0038] Step S106: Compile the uni-app project after the above configuration to generate a WeChat positioning applet.
[0039] In this embodiment, the uni-app project after the above configuration is compiled through the above code editor to generate the WeChat positioning applet.
[0040] The embodiment of the present invention provides a method for developing a WeChat positioning applet, including: creating an initial uni-app project in a code editor; adding a preset source file to the initial uni-app project; the source file is a native code written based on WeChat programming syntax for obtaining positioning coordinates; importing the index file in the source file into the root directory of the initial uni-app project, and setting the positioning tag of the source file; adding the positioning tag in the preset positioning page of the initial uni-app project; uploading the coordinate data through the positioning tag to obtain the configured uni-app project; compiling the configured uni-app project to generate the WeChat positioning applet. The method calls the preset source file, then configures the initial uni-app project through the source file, and finally compiles the configured initial uni-app project to obtain the WeChat positioning applet, so as to improve the efficiency of the development of the WeChat positioning applet.
[0041] Example 2
[0042] Based on the above embodiment, the embodiment of the present invention provides another WeChat positioning applet development method. Figure 2 A flowchart of another WeChat positioning applet development method provided for an embodiment of the present invention.
[0043] Depend on Figure 2 As can be seen, the above methods include:
[0044] Step S201: Create an initial uni-app project in the HBuilderX code editor.
[0045] In one embodiment, after the above step S201, the method includes: first, based on a preset APP development language, writing an interactive file of an APP corresponding to the above APP development language. Then, compiling the above interactive file to obtain an APP to be released; the above APP to be released has the same positioning function as the above WeChat positioning applet. Here, the above APP development language is vue+H5.
[0046] Step S202: Add a preset source file to the above initial uni-app project; the above source file is a native code written based on WeChat programming syntax for obtaining positioning coordinates.
[0047] In this embodiment, the step of adding preset source files to the initial uni-app project includes: creating a WeChat component folder in the initial uni-app item, and adding preset source files to the WeChat component folder.
[0048] Step S203: Import the index file in the source file into the root directory of the initial uni-app project, and set the location tag of the source file.
[0049] In actual operation, the above step S203 includes: importing the index file in the above source file into the use component attribute in the root directory of the above initial uni-app project.
[0050] Step S204: Add the above positioning tag in the preset positioning page of the above initial uni-app project.
[0051] In one possible implementation manner, the step S204 includes: adding the positioning tag to a preset positioning page of a page folder of the initial uni-app project.
[0052] Step S205: Upload the coordinate data through the positioning tag to obtain the configured uni-app project.
[0053] Step S206: Compile the uni-app project after the above configuration to generate the WeChat positioning applet.
[0054] In actual operation, the above step S206 includes the following steps A1-A3:
[0055] Step A1: Use the above code editor to compile the uni-app project after the above configuration to obtain the WeChat applet source file.
[0056] Step A2: In the global configuration file in the WeChat applet source file, set the permission attribute of continuous positioning to obtain the configured WeChat applet source file.
[0057] Step A3: Generate a WeChat positioning applet based on the WeChat applet source file after the above configuration.
[0058] In this embodiment, when the uni-app project after the above configuration is compiled and the WeChat positioning applet is generated, it is necessary to add the permission attribute of continuous positioning in the app.json in the MP-WEIXIN file in the WeChat positioning applet folder.
[0059] The embodiment of the present invention provides a method for developing a WeChat positioning applet, including: creating an initial uni-app project in an HBuilder X code editor; adding a preset source file in the initial uni-app project; the source file is a native code written based on WeChat programming syntax for obtaining positioning coordinates; importing the index file in the source file into the root directory of the initial uni-app project, and setting the positioning tag of the source file; adding the positioning tag in the preset positioning page of the initial uni-app project; uploading coordinate data through the positioning tag to obtain the configured uni-app project; compiling the configured uni-app project to generate the WeChat positioning applet. The method calls the preset source file, then creates the initial uni-app project through the HBuilderX code editor, calls the preset source file to configure the initial uni-app project, and finally compiles the configured initial uni-app project to obtain the WeChat positioning applet, further improving the efficiency of the WeChat positioning applet development.
[0060] Example 3
[0061] This embodiment provides a device for developing a WeChat positioning applet. Figure 3 A schematic diagram of the structure of a WeChat positioning applet development device provided in an embodiment of the present invention.
[0062] Depend on Figure 3 As can be seen, the above-mentioned device includes:
[0063] A project creation module 31, for creating an initial uni-app project in a code editor;
[0064] The source file adding module 32 is used to add a preset source file to the initial uni-app project; the source file is a native code written based on WeChat programming syntax for obtaining positioning coordinates.
[0065] The location tag setting module 33 is used to import the index file in the source file into the root directory of the initial uni-app project and set the location tag of the source file.
[0066] The positioning tag adding module 34 is used to add the positioning tag in the preset positioning page of the initial uni-app project.
[0067] The configuration module 35 is used to upload the coordinate data through the positioning tag to obtain the configured uni-app project.
[0068] The compiling module 36 is used to compile the configured uni-app project to generate a WeChat positioning applet.
[0069] Among them, the project creation module 31, the source file adding module 32, the positioning tag setting module 33, the positioning tag adding module 34, the configuration module 35 and the compilation module 36 are connected in sequence.
[0070] In one possible implementation manner, the source file adding module 32 is further used to create a WeChat component folder in the initial uni-app item, and add a preset source file in the WeChat component folder.
[0071] In one possible implementation manner, the positioning tag adding module 34 is further used to import the index file in the source file into the use component attribute in the root directory of the initial uni-app project.
[0072] In one possible implementation manner, the positioning tag setting module 33 is further configured to add the positioning tag to a preset positioning page of a page folder of the initial uni-app project.
[0073] In one possible implementation, the compilation module 36 is also used to compile the configured uni-app project through the code editor to obtain the WeChat applet source file; in the global configuration file in the WeChat applet source file, the permission attribute of continuous positioning is set to obtain the configured WeChat applet source file; based on the configured WeChat applet source file, a WeChat positioning applet is generated.
[0074] In one possible implementation, the configuration module 35 is also used to write an interactive file of the APP corresponding to the APP development language based on a preset APP development language; compile the interactive file to obtain the APP to be released; the APP to be released has the same positioning function as the WeChat positioning applet.
[0075] The WeChat positioning applet development device provided in the embodiment of the present invention has the same technical features as the WeChat positioning applet development method provided in the above embodiment, so it can also solve the same technical problems and achieve the same technical effects. Those skilled in the art can clearly understand that for the convenience and simplicity of description, the specific working process of the device described above can refer to the corresponding process in the above method embodiment, and will not be repeated here.
[0076] Example 4
[0077] This embodiment provides an electronic device, including a processor and a memory, wherein the memory stores computer-executable instructions that can be executed by the processor, and the processor executes the computer-executable instructions to implement the steps of the WeChat positioning applet development method.
[0078] This embodiment provides a computer-readable storage medium, which stores a computer program, which, when executed by a processor, implements the steps of the WeChat positioning applet development method.
[0079] See also Figure 4 A structural schematic diagram of an electronic device is shown, which includes: a memory 41 and a processor 42. The memory 41 stores a computer program that can be run on the processor 42. When the processor executes the computer program, the steps provided by the above-mentioned WeChat positioning applet development method are implemented.
[0080] like Figure 4 As shown, the device further includes: a bus 43 and a communication interface 44, a processor 42, a communication interface 44 and a memory 41 are connected via the bus 43; the processor 42 is used to execute executable modules stored in the memory 41, such as computer programs.
[0081] The memory 41 may include a high-speed random access memory (RAM), and may also include a non-volatile memory, such as at least one disk memory. The communication connection between the system network element and at least one other network element is realized through at least one communication interface 44 (which may be wired or wireless), and the Internet, wide area network, local area network, metropolitan area network, etc. may be used.
[0082] The bus 43 may be an ISA bus, a PCI bus, or an EISA bus. The bus may be divided into an address bus, a data bus, a control bus, etc. For ease of representation, Figure 4 Only one bidirectional arrow is used in the diagram, but this does not mean that there is only one bus or only one type of bus.
[0083] Among them, the memory 41 is used to store the program, and the processor 42 executes the program after receiving the execution instruction. The method performed by the WeChat positioning applet development device disclosed in any embodiment of the present invention can be applied to the processor 42, or implemented by the processor 42. The processor 42 may be an integrated circuit chip with signal processing capabilities. In the implementation process, each step of the above method can be completed by the hardware integrated logic circuit or software instructions in the processor 42. The above-mentioned processor 42 can be a general-purpose processor, including a central processing unit (CPU), a network processor (NP), etc.; it can also be a digital signal processor (DSP), an application specific integrated circuit (ASIC), a field-programmable gate array (FPGA) or other programmable logic devices, discrete gates or transistor logic devices, discrete hardware components. The disclosed methods, steps and logic block diagrams in the embodiments of the present invention can be implemented or executed. The general-purpose processor can be a microprocessor or the processor can also be any conventional processor. The steps of the method disclosed in the embodiment of the present invention can be directly embodied as being executed by a hardware decoding processor, or can be executed by a combination of hardware and software modules in the decoding processor. The software module can be located in a storage medium mature in the art such as a random access memory, a flash memory, a read-only memory, a programmable read-only memory, or an electrically erasable programmable memory, a register, etc. The storage medium is located in the memory 41, and the processor 42 reads the information in the memory 41 and completes the steps of the above method in combination with its hardware.
[0084] Furthermore, an embodiment of the present invention also provides a machine-readable storage medium, which stores machine-executable instructions. When the machine-executable instructions are called and executed by the processor 42, the machine-executable instructions prompt the processor 42 to implement the above-mentioned WeChat positioning applet development method.
[0085] The electronic device and computer-readable storage medium provided by the embodiments of the present invention have the same technical features, and therefore can solve the same technical problems and achieve the same technical effects.
[0086] In addition, in the description of the embodiments of the present invention, unless otherwise clearly specified and limited, the terms "installed", "connected", and "connected" should be understood in a broad sense, for example, it can be a fixed connection, a detachable connection, or an integral connection; it can be a mechanical connection or an electrical connection; it can be a direct connection or an indirect connection through an intermediate medium, or it can be the internal communication of two components. For ordinary technicians in this field, the specific meanings of the above terms in the present invention can be understood according to specific circumstances.
[0087] In the description of the present invention, it should be noted that the terms "center", "upper", "lower", "left", "right", "vertical", "horizontal", "inner", "outer", etc., indicating the orientation or positional relationship, are based on the orientation or positional relationship shown in the drawings, and are only for the convenience of describing the present invention and simplifying the description, rather than indicating or implying that the device or element referred to must have a specific orientation, be constructed and operated in a specific orientation, and therefore cannot be understood as limiting the present invention. In addition, the terms "first", "second", and "third" are used for descriptive purposes only, and cannot be understood as indicating or implying relative importance.
Claims
1. A method for developing a WeChat positioning applet, characterized in that: include: Create an initial uni-app project in your code editor; Add the preset source files to the initial uni-app project; The source file is a native code written based on WeChat programming syntax for obtaining positioning coordinates; Import the index file in the source file into the root directory of the initial uni-app project, and set the location tag of the source file; In the preset positioning page of the initial uni-app project, adding the positioning tag; Upload the coordinate data through the positioning tag to obtain the configured uni-app project; Compile the configured uni-app project to generate the WeChat positioning applet.
2. The WeChat positioning applet development method according to claim 1, characterized in that: The code editor is: HBuilderX code editor.
3. The WeChat positioning applet development method according to claim 2, characterized in that: The steps of adding preset source files to the initial uni-app project include: Create a WeChat component folder in the initial uni-app item, and add preset source files to the WeChat component folder.
4. The WeChat positioning applet development method according to claim 1, characterized in that: The step of importing the index file in the source file into the root directory of the initial uni-app project comprises: Import the index file in the source file into the use component property in the root directory of the initial uni-app project.
5. The WeChat positioning applet development method according to claim 4, characterized in that: In the preset positioning page of the initial uni-app project, the step of adding the positioning tag comprises: The positioning tag is added to the preset positioning page of the page folder of the initial uni-app project.
6. The WeChat positioning applet development method according to any one of claims 1-5, characterized in that: The steps of compiling the configured uni-app project to generate the WeChat positioning applet include: Compile the configured uni-app project through the code editor to obtain the WeChat applet source file; In a global configuration file in the WeChat applet source file, setting a permission attribute for continuous positioning to obtain the configured WeChat applet source file; Generate a WeChat positioning applet based on the configured WeChat applet source file.
7. The WeChat positioning applet development method according to claim 1, characterized in that: After the step of creating an initial uni-app project in a code editor, the method further comprises: Based on the preset APP development language, write the interaction file of the APP corresponding to the APP development language; The interactive file is compiled to obtain an APP to be released; the APP to be released has the same positioning function as the WeChat positioning applet.
8. A device for developing a WeChat positioning applet, characterized in that: include: A project creation module for creating an initial uni-app project in a code editor; A source file adding module, used to add a preset source file to the initial uni-app project; the source file is a native code written based on WeChat programming syntax for obtaining positioning coordinates; A positioning tag setting module, used to import the index file in the source file into the root directory of the initial uni-app project and set the positioning tag of the source file; A positioning tag adding module, used for adding the positioning tag in the preset positioning page of the initial uni-app project; A configuration module, used to upload coordinate data through the positioning tag to obtain a configured uni-app project; The compilation module is used to compile the configured uni-app project and generate a WeChat positioning applet.
9. An electronic device, characterized in that: The electronic device includes a processor and a memory, the memory stores computer-executable instructions that can be executed by the processor, and the processor executes the computer-executable instructions to implement the WeChat positioning applet development method described in any one of claims 1 to 7.
10. A computer storage medium, characterized in that: The computer storage medium stores a computer program, which includes program instructions. When the program instructions are executed by the processor, the processor executes the WeChat positioning applet development method as described in any one of claims 1 to 7.
Citation Information
Cited By
Method for realizing off-line speech synthesis based on unit-app framework
CN121260144A
