[go: up one dir, main page]

HK40037429B - Mini-program production method and apparatus, terminal, and storage medium - Google Patents

Mini-program production method and apparatus, terminal, and storage medium Download PDF

Info

Publication number
HK40037429B
HK40037429B HK42021027405.6A HK42021027405A HK40037429B HK 40037429 B HK40037429 B HK 40037429B HK 42021027405 A HK42021027405 A HK 42021027405A HK 40037429 B HK40037429 B HK 40037429B
Authority
HK
Hong Kong
Prior art keywords
program
mini
target basic
interface
editing
Prior art date
Application number
HK42021027405.6A
Other languages
Chinese (zh)
Other versions
HK40037429A (en
Inventor
郭沛然
宿海成
朱仕达
蔡雨利
刘历
Original Assignee
腾讯科技(深圳)有限公司
Filing date
Publication date
Application filed by 腾讯科技(深圳)有限公司 filed Critical 腾讯科技(深圳)有限公司
Publication of HK40037429A publication Critical patent/HK40037429A/en
Publication of HK40037429B publication Critical patent/HK40037429B/en

Links

Description

小程序的制作方法、装置、终端及存储介质Methods, devices, terminals, and storage media for creating mini-programs

技术领域Technical Field

本申请实施例涉及可视化编程领域,特别涉及一种小程序的制作方法、装置、终端及存储介质。This application relates to the field of visual programming, and in particular to a method, apparatus, terminal and storage medium for creating a mini-program.

背景技术Background Technology

随着应用程序的研发技术发展,应用程序提供商提供了“宿主程序和小程序”的生态体系。小程序是一种依赖于宿主程序运行的程序。用户只需要安装宿主程序,即可在宿主程序中随时添加和使用各种各样的小程序。With the development of application development technology, application providers have provided an ecosystem of "host programs and mini-programs". A mini-program is a program that depends on a host program to run. Users only need to install the host program to add and use various mini-programs at any time within the host program.

应用程序提供商提供宿主程序作为程序平台后,各个公司、服务机构甚至个人用户(简称程序员)都可以研发不同类型的小程序来提交给应用程序提供商,以宿主程序作为运行容器来提供不同服务。当需要研发小程序时,程序员需要从宿主程序的程序平台上下载开发者工具和开发文档。程序员参阅开发文档上所规定的各项要求,使用开发者工具进行代码编辑。在成功编辑得到小程序的程序包后,将小程序的程序包提交至宿主程序的程序平台,在审核通过后即可发布至各个用户使用。After an application provider offers a host application as its platform, various companies, service organizations, and even individual users (referred to as programmers) can develop different types of mini-programs and submit them to the application provider. The host application then serves as the runtime container to provide various services. When developing a mini-program, programmers need to download developer tools and development documentation from the host application's platform. Programmers refer to the requirements specified in the development documentation and use the developer tools to edit the code. After successfully creating the mini-program package, they submit the package to the host application's platform. Once approved, the mini-program can be released to users.

但是由于开发者工具的使用,需要程序员具有较为专业的代码编辑能力,需要长时间的知识学习和经验积累才能顺利完成该研发过程,难以推广至更为普通的个人用户来使用。However, because the use of developer tools requires programmers to have relatively professional code editing skills, and requires a long period of knowledge learning and experience accumulation to successfully complete the development process, it is difficult to promote it to more ordinary individual users.

发明内容Summary of the Invention

本申请实施例提供了一种小程序的制作方法、装置、终端及存储介质,能够解决小程序的研发难以推广至普通个人用户的问题。所述技术方案如下:This application provides a method, apparatus, terminal, and storage medium for creating mini-programs, which can solve the problem that mini-program development is difficult to promote to ordinary individual users. The technical solution is as follows:

一方面,提供了一种小程序的制作方法,所述小程序是依赖于宿主程序运行的程序,所述方法包括:On the one hand, a method for creating a mini-program is provided, wherein the mini-program is a program that depends on a host program to run, and the method includes:

显示可视化制作程序的小程序制作界面,所述小程序制作界面上显示有面板区和编辑区,所述面板区提供有n种基础用户界面(User Interface,UI)元素,n为正整数;The interface for creating a mini-program is a visual creation program. The interface includes a panel area and an editing area. The panel area provides n basic user interface (UI) elements, where n is a positive integer.

在接收到目标基础UI元素上的用户操作时,在所述编辑区中根据所述目标基础UI元素编辑得到所述小程序的程序界面,所述目标基础UI元素是所述n种基础UI元素中被选择的UI元素;When a user operation is received on a target basic UI element, the program interface of the mini program is obtained by editing the target basic UI element in the editing area. The target basic UI element is a UI element selected from the n basic UI elements.

根据所述小程序的程序界面生成所述小程序的程序包。The program package of the mini program is generated based on the program interface of the mini program.

另一方面,提供了一种小程序的制作装置,所述小程序是依赖于宿主程序运行的程序,所述装置包括:On the other hand, a device for creating mini-programs is provided, wherein the mini-program is a program that depends on a host program to run, and the device includes:

制作界面显示模块,用于显示可视化制作程序的小程序制作界面,所述小程序制作界面上显示有面板区和编辑区,所述面板区提供有n种基础UI元素,n为正整数;The interface display module is used to display the mini-program creation interface of the visual creation program. The mini-program creation interface displays a panel area and an editing area. The panel area provides n basic UI elements, where n is a positive integer.

程序界面生成模块,用于在接收到目标基础UI元素上的用户操作时,在所述编辑区中根据所述目标基础UI元素编辑得到所述小程序的程序界面,所述目标基础UI元素是所述n种基础UI元素中被选择的UI元素;The program interface generation module is used to edit the program interface of the mini-program in the editing area according to the target basic UI element when a user operation is received on the target basic UI element. The target basic UI element is a UI element selected from the n basic UI elements.

程序包生成模块,用于根据所述小程序的程序界面生成所述小程序的程序包。The package generation module is used to generate the package of the mini-program based on the program interface of the mini-program.

另一方面,提供了一种终端,其特征在于,所述终端包括处理器和存储器;所述存储器存储有至少一条指令,所述至少一条指令用于被所述处理器执行以实现如上述方面所述的小程序的制作方法。On the other hand, a terminal is provided, characterized in that the terminal includes a processor and a memory; the memory stores at least one instruction, which is executed by the processor to implement the method for creating a mini-program as described above.

另一方面,提供了一种计算机可读存储介质,其特征在于,所述存储介质存储有至少一条指令,所述至少一条指令用于被处理器执行以实现如上述方面所述的小程序的制作方法。On the other hand, a computer-readable storage medium is provided, characterized in that the storage medium stores at least one instruction, the at least one instruction being executed by a processor to implement the method for creating a small program as described above.

本申请实施例中,在通过可视化制作程序制作小程序时,可视化制作程序显示有包括面板区和编辑区的小程序制作界面,在接收到目标基础UI元素上的用户操作时,在编辑区中根据目标基础UI元素编辑得到小程序的程序界面,最后,可视化制作程序根据小程序的程序界面生成小程序的程序包。与相关小程序的开发过程相较而言,采用本申请的方法,在不需要开发者具有较强的研发能力的同时,通过接收用户可视化的操作,可视化制作程序在后台全程同步生成与当前操作相关的程序,使得普通用户不需要手动编辑代码即可通过可视化制作程序完成小程序的可视化制作。In this embodiment, when creating a mini-program using a visual creation program, the program displays a mini-program creation interface including a panel area and an editing area. Upon receiving user operations on the target basic UI elements, the program interface of the mini-program is edited in the editing area based on the target basic UI elements. Finally, the visual creation program generates the mini-program package based on the program interface. Compared with the development process of related mini-programs, the method of this application, without requiring developers to have strong R&D capabilities, allows the visual creation program to synchronously generate programs related to the current operation in the background by receiving user visual operations. This enables ordinary users to complete the visual creation of mini-programs without manually editing code.

附图说明Attached Figure Description

图1示出了本申请示例性实施例提供的一种通过可视化制作程序制作小程序的界面示意图;Figure 1 shows a schematic diagram of an interface for creating a mini-program using a visual creation program, provided by an exemplary embodiment of this application;

图2示出了本申请一个示例性实施例提供的计算机系统的结构框图;Figure 2 shows a structural block diagram of a computer system provided in an exemplary embodiment of this application;

图3示出了本申请一个示例性实施例示出的小程序的制作方法的流程图;Figure 3 shows a flowchart illustrating a method for creating a mini-program according to an exemplary embodiment of this application;

图4示出了本申请一个示例性实施例示出的小程序制作界面的界面示意图;Figure 4 shows a schematic diagram of the mini-program creation interface according to an exemplary embodiment of this application;

图5示出了本申请另一个示例性实施例示出的小程序的制作方法的流程图;Figure 5 shows a flowchart illustrating a method for creating a mini-program, as shown in another exemplary embodiment of this application;

图6示出了本申请一个示例性实施例示出的关于小程序制作界面页面编排的界面示意图;Figure 6 shows a schematic diagram of the page arrangement of the mini-program creation interface according to an exemplary embodiment of this application;

图7示出了本申请一个示例性实施例示出的关于目标UI元素绑定静态数据的界面示意图;Figure 7 shows a schematic diagram of an interface for binding static data to a target UI element, as illustrated in an exemplary embodiment of this application.

图8示出了本申请一个示例性实施例示出的关于目标UI元素中属性区的界面示意图;Figure 8 shows a schematic diagram of the interface regarding the attribute area of a target UI element, as illustrated in an exemplary embodiment of this application;

图9示出了本申请另一个示例性实施例示出的小程序制作界面的界面示意图;Figure 9 shows a schematic diagram of the mini-program creation interface as illustrated in another exemplary embodiment of this application;

图10示出了本申请一个示例性实施例示出的关于列表项绑定数据的界面示意图;Figure 10 shows a schematic diagram of an interface for binding list item data, as illustrated in an exemplary embodiment of this application.

图11示出了本申请另一个示例性实施例示出的关于列表项解绑数据的界面示意图;Figure 11 shows a schematic diagram of an interface for unbinding list item data, as illustrated in another exemplary embodiment of this application;

图12示出了本申请一个示例性实施例示出的小程序预览的界面示意图;Figure 12 shows a schematic diagram of the interface preview of the applet, illustrating an exemplary embodiment of this application;

图13示出了本申请一个示例性实施例示出的关于小程序制作界面同步生成代码的界面示意图;Figure 13 shows a schematic diagram of an exemplary embodiment of this application illustrating the synchronous generation of code from the mini-program creation interface;

图14示出了本申请一个示例性实施例提供的小程序的制作装置的结构框图;Figure 14 shows a structural block diagram of a device for creating a mini-program provided in an exemplary embodiment of this application;

图15示出了本申请一个示例性实施例提供的终端的结构方框图;Figure 15 shows a structural block diagram of a terminal provided in an exemplary embodiment of this application;

图16示出了本申请一个示例性实施例提供的服务器的结构示意图。Figure 16 shows a schematic diagram of the structure of a server provided in an exemplary embodiment of this application.

具体实施方式Detailed Implementation

为使本发明的目的、技术方案和优点更加清楚,下面将结合附图对本发明实施方式作进一步地详细描述。To make the objectives, technical solutions, and advantages of the present invention clearer, the embodiments of the present invention will be described in further detail below with reference to the accompanying drawings.

在本文中提及的“多个”是指两个或两个以上。“和/或”,描述关联对象的关联关系,表示可以存在三种关系,例如,A和/或B,可以表示:单独存在A,同时存在A和B,单独存在B这三种情况。字符“/”一般表示前后关联对象是一种“或”的关系。In this article, "multiple" refers to two or more. "And/or" describes the relationship between related objects, indicating that three relationships can exist. For example, A and/or B can represent: A alone, A and B simultaneously, or B alone. The character "/" generally indicates that the preceding and following related objects have an "or" relationship.

为了方便理解,下面对本申请实施例中涉及的名词进行解释说明。For ease of understanding, the terms used in the embodiments of this application are explained below.

可视化:可视化(Visualization)是利用计算机图形学和图像处理技术,将数据转换成图形或图像在屏幕上显示出来,再进行交互处理的理论、方法和技术。Visualization: Visualization is the theory, method and technology of using computer graphics and image processing to convert data into graphics or images and display them on a screen for interactive processing.

小程序:小程序是一种基于编程语言开发完成、依赖于宿主程序运行的应用程序,即用户无需下载和安装小程序就可以在宿主程序中运行该小程序。Mini Programs: A mini program is an application developed using a programming language that relies on a host program to run. This means that users can run the mini program within the host program without downloading and installing it.

宿主程序:在计算机环境下,软件(如本申请中的小程序)赖以生存的软件环境被称作是宿主环境,环境称作宿主。宿主就是运行环境(即宿主程序)。宿主环境(宿主程序)可以是操作系统,服务器程序,应用程序。Host program: In a computer environment, the software environment on which software (such as the applet in this application) depends for its existence is called the host environment, and the environment is called the host. The host is the runtime environment (i.e., the host program). The host environment (host program) can be an operating system, a server program, or an application program.

UI元素:UI元素是一种可视元素,是小程序中程序界面的基本组成部分。UI elements: UI elements are visual elements and are the basic components of the program interface in a mini-program.

本申请实施例中的基础UI元素,是指一些用于实现程序界面常用功能的UI元素,即为基础UI元素。The basic UI elements in this application embodiment refer to some UI elements used to implement common functions of the program interface, that is, basic UI elements.

下述实施例是在以宿主程序为应用程序来举例说明。The following examples illustrate the use of a host program as an application.

本申请实施例提供了一种小程序的制作方法,请参考图1,其示出了本申请示例性实施例提供的一种通过可视化制作程序制作小程序的界面示意图。This application provides a method for creating a mini-program. Please refer to Figure 1, which shows a schematic diagram of an interface for creating a mini-program using a visual creation program, as provided in an exemplary embodiment of this application.

如图1所示,安装可视化制作程序的终端为平板电脑110,平板电脑110的界面显示该可视化制作程序的小程序制作界面111,该小程序制作界面111上显示有:面板区112和编辑区113。As shown in Figure 1, the terminal with the visual production program installed is a tablet computer 110. The interface of the tablet computer 110 displays the mini-program production interface 111 of the visual production program. The mini-program production interface 111 displays a panel area 112 and an editing area 113.

面板区112提供了多种基础UI元素,用户可在多种基础UI元素中选择部分基础UI元素,并通过可视化的操作(如点击、拖拽等操作)将面板区112中的部分基础UI元素添加至小程序的程序界面。示意性的,如图1所示,可视化制作程序在编辑区113中显示有命名为“小程序2”的程序界面114,在程序界面114中的基础UI元素即由用户从面板区112中通过拖拽操作添加至程序界面114中的。Panel 112 provides a variety of basic UI elements. Users can select some of these elements and add them to the mini-program's interface through visual operations (such as clicking and dragging). As illustrated in Figure 1, the visual creation program displays a program interface 114 named "Mini-Program 2" in the editing area 113. The basic UI elements in program interface 114 are added by the user from panel 112 through drag-and-drop operations.

当“小程序2”完成可视化的编辑后,可视化制作程序根据小程序的程序界面114生成“小程序2”的程序包,并将该程序包发送至宿主程序的后台服务器120,其中,安装宿主程序的终端为手机130。在“小程序2”通过宿主程序的审核后,可通过手机130的小程序搜索界面131对“小程序2”进行搜索,搜索的结果为在小程序搜索界面131中显示“小程序2”的图标132,当小程序搜索界面131接收到对图标132的点击信号时,小程序搜索界面131跳转至小程序的程序界面114,从而通过可视化的操作实现小程序的可视化制作。After the "Mini Program 2" completes its visual editing, the visual creation program generates a "Mini Program 2" package based on the Mini Program's program interface 114 and sends the package to the host program's backend server 120. The terminal where the host program is installed is a mobile phone 130. After "Mini Program 2" passes the host program's review, it can be searched through the Mini Program search interface 131 on the mobile phone 130. The search result is displayed as an icon 132 of "Mini Program 2" in the Mini Program search interface 131. When the Mini Program search interface 131 receives a click signal on the icon 132, the Mini Program search interface 131 jumps to the Mini Program's program interface 114, thus realizing the visual creation of the Mini Program through visual operation.

请参考图2,其示出了本申请一个示例性实施例提供的计算机系统200的结构框图。该计算机系统200包括:第一终端210、服务器220和一个或多个第二终端230。Please refer to Figure 2, which shows a structural block diagram of a computer system 200 provided in an exemplary embodiment of this application. The computer system 200 includes: a first terminal 210, a server 220, and one or more second terminals 230.

第一终端210和第二终端230可以是手机、平板电脑、膝上型便携计算机和台式计算机等等。本文中,以第一终端210是平板电脑来举例说明,以第二终端230是手机来举例说明,即第一终端210可通过提供触屏互动功能来实现可视化小程序的制作。The first terminal 210 and the second terminal 230 can be mobile phones, tablets, laptops, desktop computers, etc. In this article, we take a tablet as an example and a mobile phone as an example. That is, the first terminal 210 can realize the creation of visual mini-programs by providing touch screen interaction functions.

该第一终端210中可以安装有第三方提供的可视化制作程序,该可视化制作程序用于实现下述各个方法实施例提供的小程序的制作方法,且该可视化制作程序可以具有帐号登录功能。用户可以在可视化制作程序中注册和登录自己的帐号。The first terminal 210 may be equipped with a third-party visual creation program, which is used to implement the mini-program creation methods provided in the following method embodiments, and the visual creation program may have an account login function. Users can register and log in to their own accounts in the visual creation program.

第二终端230中可以安装有第三方提供的宿主程序,该宿主程序用于为小程序提供可依赖的软件环境,且该宿主程序可以具有帐号登录功能。用户可以在宿主程序中注册和登录自己的帐号。The second terminal 230 may have a third-party provided host program installed. This host program provides a reliable software environment for the mini-program and may have an account login function. Users can register and log in to their own accounts in the host program.

第一终端210和第二终端230通过有线或无线网络与服务器220相连。The first terminal 210 and the second terminal 230 are connected to the server 220 via wired or wireless networks.

服务器220可以是一个服务器、服务器集群、虚拟云存储或云计算中心中的任意一种。服务器220用于为宿主程序提供后台服务。服务器220具有数据存储能力,可用于存储可视化制作程序的相关数据。Server 220 can be any of the following: a single server, a server cluster, virtual cloud storage, or a cloud computing center. Server 220 is used to provide background services for the host program. Server 220 has data storage capabilities and can be used to store data related to the visualization production program.

可选的,服务器220用于为可视化制作程序提供后台服务,同样的,可用于存储可视化制作程序的相关数据。Optionally, server 220 is used to provide background services for the visualization production program, and similarly, it can be used to store relevant data for the visualization production program.

下述实施例是以服务器220用于为宿主程序提供后台服务来举例说明。The following embodiment illustrates the use of server 220 to provide background services for the host program.

请参考图3,其示出了本申请一个示例性实施例示出的小程序的制作方法的流程图,该示例性实施例由安装于终端的可视化制作程序一侧执行。该方法包括:Please refer to Figure 3, which shows a flowchart of a method for creating a mini-program according to an exemplary embodiment of this application. This exemplary embodiment is executed by a visual creation program installed on a terminal. The method includes:

步骤301,显示可视化制作程序的小程序制作界面。Step 301: Display the mini-program creation interface of the visual creation program.

当通过可视化制作程序来实现小程序的制作时,可视化制作程序显示小程序制作界面,小程序制作界面用于为用户提供小程序制作的操作界面。小程序制作界面上显示有面板区和编辑区,面板区提供有n种基础用户界面UI元素,n为正整数。示意性的,如图4的(a)所示,小程序制作界面400显示有面板区410和编辑区430。When creating a mini-program using a visual creation program, the program displays the mini-program creation interface, which provides users with an operational interface for creating the mini-program. The mini-program creation interface displays a panel area and an editing area. The panel area provides n basic user interface (UI) elements, where n is a positive integer. Illustratively, as shown in Figure 4(a), the mini-program creation interface 400 displays a panel area 410 and an editing area 430.

面板区410包括但不限于标签UI元素411、按钮UI元素412、图片UI元素413、单行输入框UI元素414、多行输入框UI元素415、单选项UI元素416、多选项UI元素417、时间UI元素418、状态开关UI元素419、横排列表UI元素420和竖排列表UI元素421。Panel area 410 includes, but is not limited to, label UI elements 411, button UI elements 412, image UI elements 413, single-line input box UI elements 414, multi-line input box UI elements 415, radio button UI elements 416, multi-option UI elements 417, time UI elements 418, status switch UI elements 419, horizontal list UI elements 420, and vertical list UI elements 421.

其中,标签UI元素411在编辑后用于显示一段文本;按钮UI元素412在编辑后用于进行信息确认等与判断相关的事件;图片UI元素413在编辑后用于添加并显示图片;单行输入框UI元素414在编辑后用于向小程序使用者提供单行文本输入的输入框;多行输入框UI元素415在编辑后用于向小程序使用者提供多行文本输入的输入框;单选项UI元素416在编辑后用于向小程序使用者提供对于信息列表的单项选择;多选项UI元素417在编辑后用于向小程序使用者提供对于信息列表的多项选择;时间UI元素418在编辑后用于向小程序使用者提供时间的选择;状态开关UI元素419在编辑后用于向小程序使用者提供关于界面的状态选择;横排列表UI元素420和竖排列表UI元素421在编辑后分别用于向小程序使用者提供横排显示的列表和竖排显示的列表。Among them, the label UI element 411 is used to display a piece of text after editing; the button UI element 412 is used to perform information confirmation and other judgment-related events after editing; the image UI element 413 is used to add and display an image after editing; the single-line input box UI element 414 is used to provide a single-line text input box for the mini-program user after editing; the multi-line input box UI element 415 is used to provide a multi-line text input box for the mini-program user after editing; the radio button UI element 416 is used to provide a single selection for the information list for the mini-program user after editing; the multi-option UI element 417 is used to provide multiple selections for the information list for the mini-program user after editing; the time UI element 418 is used to provide the time selection for the mini-program user after editing; the status switch UI element 419 is used to provide the status selection of the interface for the mini-program user after editing; and the horizontal list UI element 420 and the vertical list UI element 421 are used to provide the mini-program user with a horizontally displayed list and a vertically displayed list, respectively, after editing.

其中,在可视化制作程序未接收到关于面板区410中目标基础UI元素上的用户操作时,编辑区430显示空白画布,即编辑区430的初始状态为空白画布。When the visualization production program does not receive any user operation on the target basic UI element in panel area 410, the editing area 430 displays a blank canvas, that is, the initial state of the editing area 430 is a blank canvas.

步骤302,在接收到目标基础UI元素上的用户操作时,在编辑区中根据目标基础UI元素编辑得到小程序的程序界面。Step 302: When a user operation is received on the target basic UI element, the program interface of the mini program is obtained by editing the target basic UI element in the editing area.

可选的,该用户操作包括对目标基础UI元素的单击操作、双击操作、长按操作、拖拽操作等,本申请对此不作限定。Optionally, the user operation may include single-click, double-click, long-press, drag and drop operations on the target basic UI element, etc., and this application does not limit this.

在可视化制作程序接收到关于面板区410中目标基础UI元素上的用户操作时,在编辑区430中根据目标基础UI元素编辑得到小程序的程序界面,其中,目标基础UI元素是n种基础UI元素中被选择的UI元素。When the visualization production program receives a user operation on the target basic UI element in panel area 410, the program interface of the mini-program is edited in editing area 430 according to the target basic UI element. The target basic UI element is the UI element selected from n basic UI elements.

可选的,小程序的程序界面可以是静态web页面,即小程序的程序界面没有访问后台服务器中数据库的能力,是基于宿主程序的客户端来显示程序界面的。Optionally, the interface of a mini-program can be a static web page, meaning that the mini-program's interface does not have the ability to access the database in the backend server, and the interface is displayed based on the client of the host program.

以小程序的程序界面为静态web页面为例。示意性的,如图4的(b)所示,可视化制作程序接收到对标签UI元素411、图片UI元素413和横排列表UI元素420的拖拽操作,则标签UI元素411、图片UI元素413和横排列表UI元素420为目标基础UI元素,可视化制作程序根据目标基础UI元素编辑得到小程序的静态程序界面440。Taking the program interface of the mini-program as a static web page as an example. As illustrated in Figure 4(b), when the visual creation program receives drag operations on the label UI element 411, the image UI element 413, and the horizontal list UI element 420, the label UI element 411, the image UI element 413, and the horizontal list UI element 420 become the target basic UI elements. The visual creation program then edits the static program interface 440 of the mini-program based on the target basic UI elements.

如静态程序界面440所示,在静态程序界面440中的文字部分是通过拖拽标签UI元素411编辑后生成的;在静态程序界面440中的图片部分是通过拖拽图片UI元素413编辑后生成的;在静态程序界面440中的列表控件是通过拖拽横排列表UI元素420编辑后生成的,该列表控件是由列表项1、列表项2和列表项3这三行构成的横排列表。As shown in the static program interface 440, the text portion in the static program interface 440 is generated by dragging and dropping the label UI element 411; the image portion in the static program interface 440 is generated by dragging and dropping the image UI element 413; the list control in the static program interface 440 is generated by dragging and dropping the horizontal list UI element 420, and this list control is a horizontal list consisting of three rows: list item 1, list item 2, and list item 3.

其中,静态程序界面440为静态web页面,实际展示的静态程序界面440无法进行页面的跳转以及不具备访问后台服务器或本地数据库的能力。Among them, the static program interface 440 is a static web page. The actual static program interface 440 cannot perform page jumps and does not have the ability to access the backend server or local database.

可选的,小程序的程序界面可以是动态web页面,即小程序的程序界面可实现访问后台服务器的数据库,并与其他页面产生交互。Optionally, the interface of a mini-program can be a dynamic web page, meaning that the interface of the mini-program can access the database of the backend server and interact with other pages.

以小程序的程序界面为动态web页面为例。示意性的,如图4的(c)所示,可视化制作程序接收到对标签UI元素411、图片UI元素413和横排列表UI元素420的拖拽操作,则标签UI元素411、图片UI元素413和横排列表UI元素420为目标基础UI元素,可视化制作程序根据目标基础UI元素编辑得到小程序的动态程序界面450。Taking the program interface of a mini-program as a dynamic web page as an example. Schematic, as shown in Figure 4(c), the visualization creation program receives drag operations on the label UI element 411, image UI element 413, and horizontal list UI element 420. The label UI element 411, image UI element 413, and horizontal list UI element 420 are the target basic UI elements. The visualization creation program edits the dynamic program interface 450 of the mini-program based on the target basic UI elements.

如动态程序界面450所示,在动态程序界面450中的文字部分是通过拖拽标签UI元素411编辑后生成的;在动态程序界面450中的图片部分是通过拖拽图片UI元素413编辑后生成的;在动态程序界面450中的列表控件是通过拖拽横排列表UI元素420编辑后生成的,该列表控件是由列表项1、列表项2和列表项3这三行构成的横排列表。As shown in the dynamic program interface 450, the text portion in the dynamic program interface 450 is generated by dragging and dropping the label UI element 411; the image portion in the dynamic program interface 450 is generated by dragging and dropping the image UI element 413; the list control in the dynamic program interface 450 is generated by dragging and dropping the horizontal list UI element 420, and this list control is a horizontal list consisting of three rows: list item 1, list item 2, and list item 3.

如动态程序界面450所示,动态程序界面450与静态程序界面440是不同的,当可视化制作程序接收到对列表控件的列表项1的用户操作时,动态程序界面450会跳转至程序界面460,显示程序界面460的编辑与静态程序界面440和动态程序界面450是一致的,都可以根据面板区410的基础UI元素编辑而成。此外,程序界面460也可以是静态web页面和动态web页面中的一种。As shown in the dynamic program interface 450, which differs from the static program interface 440, when the visual creation program receives a user operation on list item 1 of the list control, the dynamic program interface 450 will jump to the program interface 460. The editing of the program interface 460 is consistent with both the static program interface 440 and the dynamic program interface 450; both can be edited based on the basic UI elements of the panel area 410. Furthermore, the program interface 460 can also be either a static web page or a dynamic web page.

步骤303,根据小程序的程序界面生成小程序的程序包。Step 303: Generate the mini-program package based on the mini-program's interface.

可视化制作程序在接收到编辑区中对于目标基础UI元素上的编辑操作时,同步在后台生成与编辑操作对应的子程序,并当用户完成对目标基础UI元素的编辑时,将各个子程序打包为小程序的程序包,该程序包用于在宿主程序中运行。When the visual production program receives an editing operation on the target basic UI element in the editing area, it simultaneously generates a subroutine corresponding to the editing operation in the background. When the user finishes editing the target basic UI element, it packages each subroutine into a mini-program package, which is used to run in the host program.

本申请实施例中,在通过可视化制作程序制作小程序时,可视化制作程序显示有包括面板区和编辑区的小程序制作界面,在接收到目标基础UI元素上的用户操作时,在编辑区中根据目标基础UI元素编辑得到小程序的程序界面,最后,可视化制作程序根据小程序的程序界面生成小程序的程序包。与相关小程序的开发过程相较而言,采用本申请的方法,在不需要开发者具有较强的研发能力的同时,通过接收用户可视化的操作,可视化制作程序在后台全程同步生成与当前操作相关的程序,使得普通用户不需要手动编辑代码即可通过可视化制作程序完成小程序的可视化制作。In this embodiment, when creating a mini-program using a visual creation program, the program displays a mini-program creation interface including a panel area and an editing area. Upon receiving user operations on the target basic UI elements, the program interface of the mini-program is edited in the editing area based on the target basic UI elements. Finally, the visual creation program generates the mini-program package based on the program interface. Compared with the development process of related mini-programs, the method of this application, without requiring developers to have strong R&D capabilities, allows the visual creation program to synchronously generate programs related to the current operation in the background by receiving user visual operations. This enables ordinary users to complete the visual creation of mini-programs without manually editing code.

请参考图5,其示出了本申请另一个示例性实施例示出的小程序的制作方法的流程图,该示例性实施例由安装于终端的可视化制作程序一侧执行。该方法包括:Please refer to Figure 5, which shows a flowchart of a method for creating a mini-program according to another exemplary embodiment of this application. This exemplary embodiment is executed by a visual creation program installed on a terminal. The method includes:

步骤501,显示可视化制作程序的小程序制作界面。Step 501: Display the mini-program creation interface of the visual creation program.

本步骤的实施方式可以参考上述步骤301,本实施例在此不再赘述。The implementation method of this step can refer to step 301 above, and will not be repeated here in this embodiment.

其中,n种基础UI元素包括但不限于标签UI元素、按钮UI元素、图片UI元素、单行输入框UI元素、多行输入框UI元素、单选项UI元素、多选项UI元素、时间UI元素、状态开关UI元素、横排列表UI元素和竖排列表UI元素。Among them, the n basic UI elements include, but are not limited to, label UI elements, button UI elements, image UI elements, single-line input box UI elements, multi-line input box UI elements, radio button UI elements, multi-option UI elements, time UI elements, status switch UI elements, horizontal list UI elements, and vertical list UI elements.

步骤502,在接收到目标基础UI元素对应的页面编排操作时,根据页面编排操作在编辑区中对目标基础UI元素进行排版编辑,得到小程序的程序界面中的视觉部分。Step 502: Upon receiving the page layout operation corresponding to the target basic UI element, the target basic UI element is laid out and edited in the editing area according to the page layout operation to obtain the visual part of the program interface of the mini program.

在一种可能的实施方式中,目标基础UI元素对应的页面编排操作包括从n种基础UI元素中确定出目标基础UI元素、确定目标基础UI元素的位置和确定目标基础UI元素的大小等,本申请实施例对此不做限定。In one possible implementation, the page arrangement operation corresponding to the target basic UI element includes determining the target basic UI element from n basic UI elements, determining the position of the target basic UI element, and determining the size of the target basic UI element, etc., which are not limited in this embodiment of the application.

在一种可能的实施方式中,程序界面中的视觉部分包括目标基础UI元素、目标基础UI元素在程序界面中的位置和目标基础UI元素在程序界面中的大小等,本申请实施例对此不做限定。In one possible implementation, the visual portion of the program interface includes the target basic UI element, the position of the target basic UI element in the program interface, and the size of the target basic UI element in the program interface, etc., which are not limited in this embodiment.

在一种可能的实施方式中,本步骤包括如下步骤。In one possible implementation, this step includes the following steps.

一、在接收到目标基础UI元素上的选择操作时,根据选择操作在编辑区中的小程序的程序界面中增加目标基础UI元素。1. When a selection operation is received on the target basic UI element, the target basic UI element is added to the program interface of the mini program in the editing area according to the selection operation.

可选的,选择操作包括点击选择操作和拖动选择操作中的至少一种。Optionally, the selection operation includes at least one of click selection and drag selection.

可视化制作程序的面板区提供有n种基础UI元素,可视化制作程序将选择操作下的基础UI元素确定为目标基础UI元素,目标基础UI元素通过点击选择操作或拖动选择操作被增加至小程序的程序界面。The panel area of the visual production program provides n basic UI elements. The visual production program determines the basic UI element selected under the operation as the target basic UI element. The target basic UI element is added to the program interface of the mini program through the click selection operation or the drag selection operation.

示意性的,如图6的(a)所示,可视化制作程序中,小程序制作界面400接收到了对面板区410中图片UI元素413的拖动选择操作,从而在编辑区430中的小程序的程序界面610中增加图片UI元素413(即目标基础UI元素)。As illustrated in Figure 6(a), in the visualization production process, the mini-program production interface 400 receives a drag selection operation on the image UI element 413 in the panel area 410, thereby adding the image UI element 413 (i.e. the target basic UI element) to the mini-program's program interface 610 in the editing area 430.

二、在接收到目标基础UI元素上的移动操作时,根据移动操作在编辑区中的小程序的程序界面中移动目标基础UI元素的位置。2. When a move operation is received on the target basic UI element, the position of the target basic UI element is moved in the program interface of the mini-program in the editing area according to the move operation.

可选的,目标基础UI元素在小程序的程序界面中的初始位置并不是用户的满意位置,则用户可通过移动操作将目标基础UI元素拖动至程序界面的满意位置。Optionally, if the initial position of the target basic UI element in the program interface is not the user's desired position, the user can drag the target basic UI element to the desired position in the program interface through a movement operation.

示意性的,如图6的(b)所示,可视化制作程序中,小程序制作界面400接收到了对程序界面610中图片UI元素413的移动操作,从而将图片UI元素413移动至箭头所示位置。As illustrated in Figure 6(b), in the visualization production program, the mini-program production interface 400 receives a movement operation on the image UI element 413 in the program interface 610, thereby moving the image UI element 413 to the position indicated by the arrow.

三、在接收到目标基础UI元素上的缩放操作时,根据缩放操作在编辑区中的小程序的程序界面中改变目标基础UI元素的大小。3. When a scaling operation is received on the target basic UI element, the size of the target basic UI element is changed in the program interface of the mini-program in the editing area according to the scaling operation.

可选的,目标基础UI元素在小程序的程序界面中的大小并不是用户的满意大小,则用户可通过缩放操作将目标基础UI元素缩放至满意的大小,缩放操作包括缩小操作和放大操作。Optionally, if the size of the target basic UI element in the mini-program's interface is not satisfactory to the user, the user can use scaling operations to scale the target basic UI element to a satisfactory size. Scaling operations include shrinking and enlarging.

示意性的,如图6的(c)所示,可视化制作程序中,小程序制作界面400接收到了对程序界面610中图片UI元素413的缩小操作,从而按箭头所示的缩小范围将图片UI元素413进行缩小。As illustrated in Figure 6(c), in the visualization production program, the mini-program production interface 400 receives a scaling operation on the image UI element 413 in the program interface 610, and thus scales down the image UI element 413 according to the scaling range indicated by the arrow.

由于本申请实施例是基于可视化制作程序安装于平板电脑的场景下进行的,上述选择操作、移动操作和缩放操作可通过用户手触屏来实现。Since the embodiments of this application are based on a scenario where a visualization production program is installed on a tablet computer, the above-mentioned selection, movement, and zoom operations can be implemented by the user touching the screen.

可选的,当可视化制作程序所安装的终端不具备触屏功能,则可通过键鼠来实现上述选择操作、移动操作和缩放操作。Optionally, if the terminal on which the visualization production program is installed does not have touch screen functionality, the above selection, movement, and zoom operations can be performed using a keyboard and mouse.

步骤503,在接收到目标基础UI元素对应的逻辑编排操作时,根据逻辑编排操作在编辑区中对目标基础UI元素进行逻辑编辑,得到小程序的程序界面中的逻辑运行部分。Step 503: When the logical arrangement operation corresponding to the target basic UI element is received, the target basic UI element is logically edited in the editing area according to the logical arrangement operation to obtain the logical running part in the program interface of the mini program.

可选的,在完成步骤502中对目标基础UI元素进行排版编辑,得到小程序的程序界面中的视觉部分后,将对目标基础UI元素进行逻辑编辑。Optionally, after completing step 502 and editing the layout of the target basic UI elements to obtain the visual part of the mini program's interface, the target basic UI elements will be logically edited.

在一种可能的实施方式中,目标基础UI元素对应的逻辑编排操作包括与静态数据进行数据绑定、与动态数据进行数据绑定和与本地数据进行数据绑定等,本申请实施例对此不做限定。In one possible implementation, the logical orchestration operations corresponding to the target basic UI element include data binding with static data, data binding with dynamic data, and data binding with local data, etc., which are not limited in this embodiment.

在一种可能的实施方式中,本步骤包括如下步骤。In one possible implementation, this step includes the following steps.

一、在接收到目标UI元素对应的第一逻辑编排操作时,根据第一逻辑编排操作在编辑区中将目标基础UI元素与静态数据进行数据绑定,静态数据是预先写入至目标基础UI元素中进行显示的数据。1. Upon receiving the first logical arrangement operation corresponding to the target UI element, the target basic UI element and static data are bound in the editing area according to the first logical arrangement operation. The static data is data that is pre-written into the target basic UI element for display.

在接收到目标UI元素对应的第一逻辑编排操作时,根据第一逻辑编排操作在编辑区中将目标基础UI元素与静态数据进行数据绑定,其中,静态数据是预先写入至目标基础UI元素中的静态显示数据,即在小程序的制作阶段时展示的属性,同时也可以理解为可视化制作程序在后台同步编辑代码时写进程序内部的数据。Upon receiving the first logical arrangement operation corresponding to the target UI element, the target basic UI element and static data are bound together in the editing area according to the first logical arrangement operation. The static data is the static display data pre-written into the target basic UI element, that is, the attributes displayed during the creation stage of the mini program. It can also be understood as the data written into the program when the visual production program synchronously edits the code in the background.

如在设置图片UI元素的具体显示图片时,具体的显示图片为一种静态数据;又如在设置标签UI元素的具体文本内容以及标签UI元素的填充色时,具体文本内容以及填充色分别为一种静态数据。For example, when setting the specific image to display for an image UI element, the specific image is a type of static data; similarly, when setting the specific text content and fill color for a label UI element, the specific text content and fill color are each types of static data.

示意性的,在图6的(c)的基础上,如图7所示,可视化制作程序中,图片UI元素413在完成图6所示的排版编辑后,可通过接收对图片UI元素413的点击操作在小程序制作界面400显示与图片UI元素413对应的换图悬浮按钮701,并当通过换图悬浮按钮701接收到用户的触发操作后,在小程序的制作界面400显示有图片选择区702,图片选择区702中所显示的图片来自本地相册,用户可以在该图片选择区702中选择希望添加的目标图片(静态显示数据)。Indicatively, based on Figure 6(c), as shown in Figure 7, in the visualization production program, after the image UI element 413 completes the layout editing shown in Figure 6, a corresponding image change floating button 701 will be displayed on the mini-program production interface 400 by receiving a click operation on the image UI element 413. When the user triggers the operation through the image change floating button 701, an image selection area 702 will be displayed on the mini-program production interface 400. The images displayed in the image selection area 702 are from the local photo album, and the user can select the target image (static display data) to be added in the image selection area 702.

在一种可能的实施方式中,步骤502与步骤503中的步骤“一”可置换执行顺序。即对于目标UI元素而言,可以先执行与静态数据的数据绑定,后执行排版操作。In one possible implementation, the execution order of step "a" in steps 502 and 503 can be interchanged. That is, for the target UI element, data binding with static data can be performed first, followed by layout operations.

示意性的,如图8的(a)所示,图片UI元素413首先通过换图悬浮按钮701完成了与图片image6(静态数据)的数据绑定;其次,当图片UI元素413接收到对属性悬浮按钮801的触发操作时,如图8的(b)所示,在小程序的制作界面400的编辑区430显示有属性区802,该属性区802用于图片UI元素413的排版操作,即可通过属性区802执行步骤502中的内容。As illustrated in Figure 8(a), the image UI element 413 first completes the data binding with the image6 (static data) through the image change floating button 701; secondly, when the image UI element 413 receives a trigger operation on the attribute floating button 801, as shown in Figure 8(b), the attribute area 802 is displayed in the editing area 430 of the mini-program's creation interface 400. This attribute area 802 is used for the layout operation of the image UI element 413, and the content in step 502 can be executed through the attribute area 802.

示意性的,如图8的(c)所示,其示出了属性区802可能包括的内容。如对于图片image6而言,通过属性区802可以设置图片image6的边框类型(如直角矩形边框、圆角矩形边框、椭圆形边框等)、缩放类型(如缩放以填充、缩放以适应、拉伸、缩放以原始大小等)、区域高度和自适应高度等。本申请实施例对属性区802可能包括的内容不作限定。As illustrated in Figure 8(c), the attribute area 802 may include the following: For example, for the image image6, the attribute area 802 can be used to set the image image6's border type (such as a right-angled rectangle border, a rounded rectangle border, an elliptical border, etc.), scaling type (such as scaling to fill, scaling to fit, stretching, scaling to original size, etc.), area height, and adaptive height, etc. This application embodiment does not limit the possible contents of the attribute area 802.

不同目标UI元素对应有不同属性区,如标签UI元素的属性区可实现标签UI元素中关于文本的字体、颜色、字号等设置。本申请实施例对不同目标UI元素的不同属性区所包含的内容不作限定。Different target UI elements correspond to different attribute areas. For example, the attribute area of a label UI element allows for settings such as the font, color, and font size of the text within the label UI element. This application does not limit the content contained in the different attribute areas of different target UI elements.

二、在接收到目标UI元素对应的第二逻辑编排操作时,根据第二逻辑编排操作在编辑区中将目标基础UI元素与第一动态数据进行数据绑定,第一动态数据是在小程序的运行期间通过网络协议动态获取至目标基础UI元素中进行显示的数据。Second, upon receiving the second logical arrangement operation corresponding to the target UI element, the target basic UI element and the first dynamic data are bound in the editing area according to the second logical arrangement operation. The first dynamic data is the data that is dynamically obtained from the target basic UI element through the network protocol during the operation of the mini program and displayed therein.

可选的,第二逻辑编排操作可以理解为,当小程序运行于宿主程序时,目标UI元素在小程序制作过程中预先设置的第二逻辑编排操作下,可通过网络协议动态访问宿主程序的后台服务器,并从该后台服务器获取目标基础UI元素中的第一动态数据,并通过宿主程序运行并显示该第一动态数据,即第一动态数据存储于宿主程序的后台服务器。Optionally, the second logical orchestration operation can be understood as follows: when the mini-program runs on the host program, the target UI element can dynamically access the host program's backend server through the network protocol under the second logical orchestration operation pre-set during the mini-program's creation process, and obtain the first dynamic data in the target basic UI element from the backend server, and run and display the first dynamic data through the host program, that is, the first dynamic data is stored in the host program's backend server.

上述小程序制作过程中,在接收到目标UI元素对应的第二逻辑编排操作时,根据第二逻辑编排操作在编辑区中将目标基础UI元素与第一动态数据进行数据绑定。During the creation of the aforementioned mini-program, upon receiving the second logical arrangement operation corresponding to the target UI element, the target basic UI element is bound to the first dynamic data in the editing area according to the second logical arrangement operation.

在一个示意性的例子中,第二逻辑编排操作下,运行在宿主程序上的小程序可实现动态更新横排列表UI元素中的与列表项相关的数据与顺序,则与列表项相关的数据与顺序为动态数据,需要访问宿主程序的后台服务器获取与列表项相关的第一动态数据。In an illustrative example, under the second logical arrangement operation, the applet running on the host program can dynamically update the data and order related to the list items in the horizontal list UI elements. The data and order related to the list items are dynamic data, which needs to access the host program's backend server to obtain the first dynamic data related to the list items.

示意性的,如图9的(a)所示,可视化制作程序中,根据面板区410中的横排列表UI元素420在小程序制作界面400中显示小程序的程序界面910,其中,横排列表UI元素420包含5个列表项,分别为列表项1、列表项2、列表项3、列表项4和列表项5。As illustrated in Figure 9(a), in the visualization production process, the program interface 910 of the mini-program is displayed in the mini-program production interface 400 according to the horizontal list UI element 420 in the panel area 410. The horizontal list UI element 420 contains 5 list items, namely list item 1, list item 2, list item 3, list item 4 and list item 5.

列表项1为横排列表UI元素420的模板项,用于展示每一个列表项的结构。示意性的,如图9的(b)所示,模板项(即列表项1)包括第一字段911、第二字段912和第三字段913这三个数据字段。List item 1 is the template item for the horizontal list UI element 420, used to display the structure of each list item. Schematic, as shown in Figure 9(b), the template item (i.e., list item 1) includes three data fields: the first field 911, the second field 912, and the third field 913.

在小程序运行的过程中,通过获取可与列表项进行字段的数据绑定的第一动态数据,来显示包含横排列表UI元素420的程序界面910。下面通过结合示意图来描述列表项绑定第一动态数据的过程,该过程即为一种第二逻辑编排。During the operation of the mini-program, the program interface 910, which contains horizontal list UI elements 420, is displayed by obtaining the first dynamic data that can be bound to the list items' fields. The process of binding the list items to the first dynamic data is described below with reference to the diagram. This process is a kind of second logical arrangement.

示意性的,如图9的(c)所示,上述横排列表UI元素420的列表项的项数可通过小程序制作界面400中与横排列表UI元素420对应的属性设置悬浮按钮914来完成设置。其次,横排列表UI元素420的列表项的第一动态数据绑定可通过小程序制作界面400中与横排列表UI元素420对应的绑定数据悬浮按钮915来完成设置。As illustrated in Figure 9(c), the number of items in the horizontal list UI element 420 can be set using the attribute setting floating button 914 corresponding to the horizontal list UI element 420 in the mini-program creation interface 400. Secondly, the first dynamic data binding of the list items in the horizontal list UI element 420 can be set using the binding data floating button 915 corresponding to the horizontal list UI element 420 in the mini-program creation interface 400.

在一种可能的实施方式中,当小程序制作界面400接收到对绑定数据悬浮按钮915的点击操作时,显示如图10所示的界面。In one possible implementation, when the mini-program creation interface 400 receives a click operation on the bound data floating button 915, the interface shown in Figure 10 is displayed.

示意性的,如图10的(a)所示,数据表A包含5列可选的数据,分别为内容1(图片数据)、内容2(文字数据)、内容3(数字数据)、内容4(数字数据)和内容5(文字数据)。示意性的,如图10的(b)所示,小程序制作界面400显示列表绑定数据表的界面,横排列表UI元素420中的模板项(即列表项1)中包含有上述三个字段,其中三个字段分别选中了数据表A中的内容1、内容2和内容5进行数据绑定,则被选中的内容1、内容2和内容5即为第一动态数据。其中,模板项的第一动态数据选择可通过程序界面中的数据区1001来实现。As illustrated in Figure 10(a), data table A contains five selectable columns: content 1 (image data), content 2 (text data), content 3 (numerical data), content 4 (numerical data), and content 5 (text data). As illustrated in Figure 10(b), the mini-program interface 400 displays the list binding data table interface. The template item (i.e., list item 1) in the horizontal list UI element 420 contains the three fields mentioned above. These three fields respectively select content 1, content 2, and content 5 from data table A for data binding. Therefore, the selected content 1, content 2, and content 5 constitute the first dynamic data. The selection of the first dynamic data for the template item can be achieved through the data area 1001 in the program interface.

示意性的,如图10的(c)所示,其示出了数据区1001可能包括的内容。对于模板项(即列表项1)与数据表A进行数据绑定的场景来说,数据区1001包括:绑定关系中的绑定对象,即数据表A;绑定关系中的字段关联方式;已绑定数据表的数据查看、数据编辑与数据选择。As illustrated in Figure 10(c), this shows the possible contents of data area 1001. In a scenario where a template item (i.e., list item 1) is bound to data table A, data area 1001 includes: the bound object in the binding relationship, i.e., data table A; the field association method in the binding relationship; and the functions of viewing, editing, and selecting data from the bound data table.

字段关联是指模板项中的字段与数据表中所选择的数据的关联方式,其中,字段关联方式是可以是随机方式,或者指定方式。示意性的,如图10的(c)所示,当前的字段关联方式为随即方式。当用户不满意当前字段的关联方式时,可进行指定字段的数据解绑。可选的,如图11所示,列表项1中第三字段当前绑定了数据表A中内容5的数据,当接收到对第三字段的点击触发操作时,制作界面400显示对应第三字段的字段解绑选项1100,字段解绑选项1100根据第三字段的类型显示第三字段当前可重新绑定的数据,包括内容2、内容3和内容4。Field association refers to the way fields in a template item are associated with selected data in a data table. This association can be random or specified. For example, as shown in Figure 10(c), the current field association is random. If the user is not satisfied with the current field association, they can unbind the data for that specific field. Optionally, as shown in Figure 11, the third field in list item 1 is currently bound to data 5 from data table A. When a click trigger operation is received on the third field, the creation interface 400 displays the corresponding field unbinding option 1100. The field unbinding option 1100 displays the data that can be rebound to the third field based on its type, including content 2, content 3, and content 4.

当模板项完成数据绑定后,小程序通过宿主程序运行,并通过网络协议动态获取目标基础UI元素中每一个列表项的第一动态数据,从而宿主程序根据该第一动态数据进行小程序的程序界面的显示。Once the template item completes data binding, the mini-program runs through the host program and dynamically obtains the first dynamic data of each list item in the target basic UI element through network protocol. The host program then displays the mini-program's interface based on this first dynamic data.

三、在接收到目标UI元素对应的第三逻辑编排操作时,根据第三逻辑编排操作在编辑区中将目标基础UI元素与第二动态数据进行数据绑定,第二动态数据是在小程序的运行期间通过本地代码计算后写入至目标基础UI元素中进行显示的数据。Third, upon receiving the third logical arrangement operation corresponding to the target UI element, the target basic UI element and the second dynamic data are bound in the editing area according to the third logical arrangement operation. The second dynamic data is the data that is calculated by local code and written to the target basic UI element for display during the operation of the mini program.

在一种可能的实施方式中,上述基础UI元素还包括一种可以访问宿主程序所安装的本地终端的基础UI元素,并获取该本地终端的第二动态数据。In one possible implementation, the aforementioned basic UI element also includes a basic UI element that can access the local terminal installed by the host program and obtain second dynamic data of the local terminal.

在一个示意性的例子中,上述基础UI元素还包括定位UI元素,该定位UI元素在被触发时具有访问宿主程序所安装的本地终端定位信息的能力,并获取该定位信息,在小程序的程序界面显示与定位信息相关的第二动态数据。In an illustrative example, the aforementioned basic UI elements also include a location UI element, which, when triggered, has the ability to access the local terminal location information installed by the host program, obtain the location information, and display second dynamic data related to the location information on the program interface of the mini program.

在一个示意性的例子中,上述基础UI元素还包括与上传本地数据至小程序客户端相关的UI元素,该UI元素在被触发时具有访问宿主程序所安装的本地终端本地数据的能力,并获取目标本地数据,在小程序的程序界面显示该目标本地数据。In an illustrative example, the aforementioned basic UI elements also include UI elements related to uploading local data to the mini-program client. When triggered, these UI elements have the ability to access local data on the local terminal installed by the host program, obtain the target local data, and display the target local data in the mini-program's interface.

四、在接收到第一程序界面中的目标基础UI元素对应的第四逻辑编排操作时,根据第四逻辑编排操作在编辑区中对目标基础UI元素与第二程序界面进行数据绑定,第二程序界面是目标基础UI元素在触发后跳转显示的程序界面。Fourth, when the fourth logical arrangement operation corresponding to the target basic UI element in the first program interface is received, the target basic UI element and the second program interface are data bound in the editing area according to the fourth logical arrangement operation. The second program interface is the program interface that the target basic UI element jumps to and displays after being triggered.

在一种可能的实施方式中,本申请的小程序的程序界面包括存在层级显示关系的第一程序界面和第二程序界面,即小程序在运行时,第一程序界面可触发跳转至第二程序界面。In one possible implementation, the program interface of the mini-program of this application includes a first program interface and a second program interface that have a hierarchical display relationship. That is, when the mini-program is running, the first program interface can trigger a jump to the second program interface.

在图4的(c)中,所描述的动态web页面即为上述的第一程序界面。对于实现第一程序界面跳转至第二程序界面的过程即为第四逻辑编排操作,以图4的(c)举例说明,第四逻辑编排操作具体为:在完成程序界面460(即第二程序界面)的页面编排和逻辑编排后,动态程序界面450(即第一程序界面)中列表项1与程序界面460进行数据绑定,具体为当接收到对列表项1的触发操作时,动态程序界面450跳转至程序界面460。In Figure 4(c), the dynamic web page described is the first program interface mentioned above. The process of jumping from the first program interface to the second program interface is the fourth logical arrangement operation. Taking Figure 4(c) as an example, the fourth logical arrangement operation is as follows: After completing the page arrangement and logical arrangement of program interface 460 (i.e., the second program interface), list item 1 in dynamic program interface 450 (i.e., the first program interface) is data bound to program interface 460. Specifically, when a trigger operation is received for list item 1, dynamic program interface 450 jumps to program interface 460.

步骤504,根据小程序的程序界面生成小程序的程序包。Step 504: Generate the mini-program package based on the mini-program's interface.

本步骤的实施方式可以参考上述步骤303,本实施例在此不再赘述。The implementation method of this step can refer to step 303 above, and will not be repeated here in this embodiment.

步骤505,在接收到预览控件上的预览操作时,将小程序的程序包推送至宿主程序中进行运行。Step 505: Upon receiving a preview operation on the preview control, push the mini-program's package to the host program for execution.

在一种可能的实施方式中,小程序制作界面还包括预览控件,当可视化制作程序接收到预览控件上的预览操作时,将小程序的程序包推送至宿主程序中进行运行。In one possible implementation, the mini-program creation interface also includes a preview control. When the visual creation program receives a preview operation on the preview control, it pushes the mini-program package to the host program for execution.

示意性的,在图9和图10的基础上,当横排列表UI元素420完成数据绑定后,可通过小程序的制作界面400中的预览控件916实现小程序的预览,最终预览的效果如图12所示,每一个列表项中字段所绑定的数据来自图10的(a)所示的数据表A。Indicatively, based on Figures 9 and 10, after the horizontal list UI element 420 completes data binding, the preview of the mini program can be achieved through the preview control 916 in the mini program creation interface 400. The final preview effect is shown in Figure 12. The data bound to the fields in each list item comes from the data table A shown in Figure 10(a).

在一种可能的实施方式中,小程序制作界面还包括预览控件,且可视化制作程序与宿主程序安装于同一终端,则当可视化制作程序接收到预览控件上的预览操作时,宿主程序主动获取小程序的程序包。In one possible implementation, the mini-program creation interface also includes a preview control, and the visual creation program and the host program are installed on the same terminal. When the visual creation program receives a preview operation on the preview control, the host program actively obtains the mini-program's package.

步骤506,在接收到提交控件上的提交操作时,将小程序的程序包发送至宿主程序的程序平台进行审核或发布。Step 506: Upon receiving a submission operation on the submission control, the mini-program's package is sent to the host program's application platform for review or release.

小程序在完成制作后,由于考虑到小程序是否符合宿主程序的程序平台的要求,如包含有违法或不良内容的小程序将被该程序平台拒绝发布。After a mini-program is completed, it will be rejected by the platform if it contains illegal or inappropriate content, taking into account whether the mini-program meets the requirements of the host platform.

在一种可能的实施方式中,小程序制作界面还包括提交控件,当可视化制作程序接收到提交控件上的提交操作时,将小程序的程序包推送至宿主程序中进行运行。In one possible implementation, the mini-program creation interface also includes a submission control. When the visual creation program receives a submission operation on the submission control, it pushes the mini-program package to the host program for execution.

本申请实施例中,小程序的程序界面包括视觉部分和逻辑运行部分,其中,视觉部分根据页面编排操作得到,可视化制作程序根据该页面编排操作对目标基础UI元素进行排版编辑;逻辑运行部分根据逻辑编排操作得到,可视化制作程序根据该逻辑编排操作对目标基础UI元素进行逻辑编辑。本申请的页面编排操作与逻辑编排操作是一种可视化的操作,与相关小程序的开发过程相较而言,无需由复杂的代码编辑实现上述排版编辑与逻辑编辑,使得用户通过与触摸屏的交互操作实现小程序的可视化制作。In this embodiment, the mini-program's interface includes a visual component and a logical operation component. The visual component is obtained based on page layout operations, and the visualization creation program edits the target basic UI elements according to these operations. The logical operation component is obtained based on logical layout operations, and the visualization creation program edits the target basic UI elements logically according to these operations. The page layout and logical layout operations in this application are visual operations. Compared to the development process of related mini-programs, they do not require complex code editing to achieve the aforementioned layout and logical editing, allowing users to achieve visual creation of the mini-program through interactive operations with a touchscreen.

在上述各个实施例中,与小程序制作相关的操作都会在可视化制作程序的后台同步生成代码,如确定目标基础UI元素、完成页面编排操作和完成逻辑编排操作时,可视化制作程序同步生成与当前操作相关的代码。In the above embodiments, operations related to mini-program creation will generate code synchronously in the background of the visual creation program. For example, when determining the target basic UI elements, completing page arrangement operations, and completing logic arrangement operations, the visual creation program will synchronously generate code related to the current operation.

示意性的,如图13的(a)所示,在小程序的制作界面400显示有代码显示区域1301,在接收对程序界面1300的页面编排操作和逻辑编排操作时,同步在代码显示区域1301生成代码。As illustrated in Figure 13(a), a code display area 1301 is displayed on the creation interface 400 of the mini-program. When receiving page arrangement operations and logic arrangement operations on the program interface 1300, code is generated synchronously in the code display area 1301.

此外,用户也可以对代码显示区域1301中的代码进行编辑,即由可视化制作小程序转为代码编写制作小程序。In addition, users can also edit the code in the code display area 1301, that is, switch from visual creation of mini programs to code writing and creation of mini programs.

用户在该代码显示区域1301进行代码编辑时,若按照相关的代码编辑方法来操作,则需要用户了解各个目标UI元素的身份标识号(Identity document,ID),从而将当前所编辑的目标UI元素的ID键入所编辑的代码中,若用户对各个目标UI元素的ID并不了解,则会造成代码编辑上的困难。When a user edits code in the code display area 1301, if the user follows the relevant code editing method, the user needs to know the identity document (ID) of each target UI element, and then enter the ID of the target UI element being edited into the code. If the user does not know the ID of each target UI element, it will cause difficulties in code editing.

在一种可能的实施方式中,当接收到用户对目标UI元素的触发操作时,可视化制作程序获取该目标UI元素的ID,代码显示区域1301自动键入该目标UI元素的ID。即在需要键入ID的一行代码中自动键入当前编辑的目标UI元素的ID,为具有一定代码编辑能力的用户提供了便利。In one possible implementation, when a user triggers an action on a target UI element, the visual creation program obtains the ID of the target UI element, and the ID of the target UI element is automatically entered into the code display area 1301. That is, the ID of the currently edited target UI element is automatically entered into the line of code where the ID needs to be entered, providing convenience for users with some code editing skills.

可选的,在接收用户对目标UI元素的触发操作之前,还包括接收对需要键入ID的代码区域的触发操作。可选的,对目标UI元素的触发操作包括对目标UI元素的单击操作、双击操作等,本申请实施例对此不作限定。Optionally, before receiving the user's trigger operation on the target UI element, the system may also receive a trigger operation on a code area requiring an ID to be entered. Optionally, the trigger operation on the target UI element may include a single-click operation, a double-click operation, etc., and this embodiment of the application does not limit this.

示意性的,如图13的(b)所示,代码显示区域1301中,变量区1302所需键入的内容为当前目标UI元素的ID,即图片UI元素413的ID,在接收到用户对变量区1302的点击操作后,等待接收用户对目标UI元素的点击操作;在接收到用户对程序界面1300中图片UI元素413的点击操作后,可视化制作程序获取图片UI元素的ID,变量区1302将自动键入并显示该图片UI元素413的ID,而无需用户在变量区1302手动键入图片UI元素413的ID。As illustrated in Figure 13(b), in the code display area 1301, the content to be entered in the variable area 1302 is the ID of the current target UI element, namely the ID of the image UI element 413. After receiving the user's click operation on the variable area 1302, it waits to receive the user's click operation on the target UI element. After receiving the user's click operation on the image UI element 413 in the program interface 1300, the visualization program obtains the ID of the image UI element, and the variable area 1302 will automatically enter and display the ID of the image UI element 413, without the user having to manually enter the ID of the image UI element 413 in the variable area 1302.

通过可视化制作程序在后台同步生成与当前操作相关的代码,使得普通用户也可以通过可视化制作程序完成小程序的制作,同时对于具备一定编辑码能力的用户也可以通过上述代码显示区域进行代码的编辑,同样实现小程序的制作。The visual creation program synchronously generates code related to the current operation in the background, allowing ordinary users to create mini-programs. At the same time, users with certain code editing skills can also edit the code through the code display area to create mini-programs.

请参考图14,其示出了本申请一个实施例提供的小程序的制作装置的结构框图。该装置可以通过软件、硬件或者两者的结合实现成为计算机设备的全部或一部分。该装置包括:Please refer to Figure 14, which shows a structural block diagram of a software app creation apparatus according to an embodiment of this application. This apparatus can be implemented as all or part of a computer device through software, hardware, or a combination of both. The apparatus includes:

制作界面显示模块1401,用于显示可视化制作程序的小程序制作界面,所述小程序制作界面上显示有面板区和编辑区,所述面板区提供有n种基础UI元素,n为正整数;The interface display module 1401 is used to display the mini-program creation interface of the visual creation program. The mini-program creation interface displays a panel area and an editing area. The panel area provides n basic UI elements, where n is a positive integer.

程序界面生成模块1402,用于在接收到目标基础UI元素上的用户操作时,在所述编辑区中根据所述目标基础UI元素编辑得到所述小程序的程序界面,所述目标基础UI元素是所述n种基础UI元素中被选择的UI元素;The program interface generation module 1402 is used to edit the program interface of the mini-program in the editing area according to the target basic UI element when a user operation is received on the target basic UI element. The target basic UI element is a UI element selected from the n basic UI elements.

程序包生成模块1403,用于根据所述小程序的程序界面生成所述小程序的程序包。The package generation module 1403 is used to generate the package of the mini-program based on the program interface of the mini-program.

可选的,所述程序界面生成模块1402,包括:Optionally, the program interface generation module 1402 includes:

排版编辑子模块,用于在接收到目标基础UI元素对应的页面编排操作时,根据页面编排操作在编辑区中对目标基础UI元素进行排版编辑,得到小程序的程序界面中的视觉部分;The layout editing submodule is used to edit the layout of the target basic UI element in the editing area according to the page layout operation when the page layout operation is received, so as to obtain the visual part of the program interface of the mini program.

逻辑编辑子模块,用于在接收到目标基础UI元素对应的逻辑编排操作时,根据逻辑编排操作在编辑区中对目标基础UI元素进行逻辑编辑,得到小程序的程序界面中的逻辑运行部分。The logic editing submodule is used to perform logical editing on the target basic UI element in the editing area when a logical arrangement operation corresponding to the target basic UI element is received, so as to obtain the logical running part in the program interface of the mini program.

可选的,所述排版编辑子模块,用于在接收到目标基础UI元素上的选择操作(点击选择操作或拖动选择操作)时,根据选择操作在编辑区中的小程序的程序界面中增加目标基础UI元素;Optionally, the layout editing submodule is used to add the target basic UI element to the program interface of the mini-program in the editing area according to the selection operation when a selection operation (click selection operation or drag selection operation) is received on the target basic UI element.

在接收到目标基础UI元素上的移动操作时,根据移动操作在编辑区中的小程序的程序界面中移动目标基础UI元素的位置;When a move operation is received on the target basic UI element, the position of the target basic UI element is moved in the program interface of the mini program in the editing area according to the move operation;

在接收到目标基础UI元素上的缩放操作时,根据缩放操作在编辑区中的小程序的程序界面中改变目标基础UI元素的大小。When a scaling operation is received on the target basic UI element, the size of the target basic UI element is changed in the program interface of the mini-program in the editing area according to the scaling operation.

可选的,所述逻辑编辑子模块,用于在接收到目标UI元素对应的第一逻辑编排操作时,根据第一逻辑编排操作在编辑区中将目标基础UI元素与静态数据进行数据绑定,静态数据是预先写入至目标基础UI元素中进行显示的数据;Optionally, the logic editing submodule is used to bind the target basic UI element with static data in the editing area according to the first logic arrangement operation when the first logic arrangement operation is received. The static data is data that is pre-written into the target basic UI element for display.

在接收到目标UI元素对应的第二逻辑编排操作时,根据第二逻辑编排操作在编辑区中将目标基础UI元素与第一动态数据进行数据绑定,第一动态数据是在小程序的运行期间通过网络协议动态获取至目标基础UI元素中进行显示的数据;When the second logical arrangement operation corresponding to the target UI element is received, the target basic UI element and the first dynamic data are bound in the editing area according to the second logical arrangement operation. The first dynamic data is the data that is dynamically obtained from the target basic UI element through the network protocol during the operation of the mini program and displayed therein.

在接收到目标UI元素对应的第三逻辑编排操作时,根据第三逻辑编排操作在编辑区中将目标基础UI元素与第二动态数据进行数据绑定,第二动态数据是在小程序的运行期间通过本地代码计算后写入至目标基础UI元素中进行显示的数据。When the third logical arrangement operation corresponding to the target UI element is received, the target basic UI element and the second dynamic data are bound in the editing area according to the third logical arrangement operation. The second dynamic data is the data that is calculated by local code and written to the target basic UI element for display during the operation of the mini program.

可选的,小程序的程序界面包括:存在层级显示关系的第一程序界面和第二程序界面;Optionally, the program interface of a mini-program includes: a first program interface and a second program interface that have a hierarchical display relationship;

可选的,所述逻辑编辑子模块,用于在接收到第一程序界面中的目标基础UI元素对应的第四逻辑编排操作时,根据第四逻辑编排操作在编辑区中对目标基础UI元素与第二程序界面进行数据绑定,第二程序界面是目标基础UI元素在触发后跳转显示的程序界面。Optionally, the logic editing submodule is used to bind the target basic UI element to the second program interface in the editing area according to the fourth logic arrangement operation when the fourth logic arrangement operation is received from the target basic UI element in the first program interface. The second program interface is the program interface that the target basic UI element jumps to and displays after being triggered.

可选的,小程序制作界面还包括:预览控件;Optionally, the mini-program creation interface may also include: a preview control;

可选的,所述装置,还包括:Optionally, the device further includes:

程序包推送模块,用于在接收到预览控件上的预览操作时,将小程序的程序包推送至宿主程序中进行运行。The package push module is used to push the mini-program's package to the host program for execution when a preview operation is received on the preview control.

可选的,小程序制作界面还包括:提交控件;Optionally, the mini-program creation interface may also include: a submission control;

可选的,所述装置,还包括:Optionally, the device further includes:

程序包发送模块,用于在接收到提交控件上的提交操作时,将小程序的程序包发送至宿主程序的程序平台进行审核或发布。The package sending module is used to send the mini-program's package to the host program's application platform for review or release when a submission operation is received on the submission control.

请参考图15,其示出了本申请一个示例性实施例提供的终端1500的结构方框图。该终端1500可以是便携式移动终端,比如:智能手机、平板电脑、MP3播放器(MovingPicture Experts Group Audio Layer III,动态影像专家压缩标准音频层面3)、MP4(Moving Picture Experts Group Audio Layer IV,动态影像专家压缩标准音频层面4)播放器。终端1500还可能被称为用户设备、便携式终端等其他名称。Please refer to Figure 15, which shows a structural block diagram of a terminal 1500 provided in an exemplary embodiment of this application. The terminal 1500 may be a portable mobile terminal, such as a smartphone, tablet computer, MP3 player (Moving Picture Experts Group Audio Layer III), or MP4 player (Moving Picture Experts Group Audio Layer IV). The terminal 1500 may also be referred to as a user device, portable terminal, or other names.

通常,终端1500包括有:处理器1501和存储器1502。Typically, terminal 1500 includes a processor 1501 and a memory 1502.

处理器1501可以包括一个或多个处理核心,比如4核心处理器、8核心处理器等。处理器1501可以采用DSP(Digital Signal Processing,数字信号处理)、FPGA(Field-Programmable Gate Array,现场可编程门阵列)、PLA(Programmable Logic Array,可编程逻辑阵列)中的至少一种硬件形式来实现。处理器1501也可以包括主处理器和协处理器,主处理器是用于对在唤醒状态下的数据进行处理的处理器,也称CPU(Central ProcessingUnit,中央处理器);协处理器是用于对在待机状态下的数据进行处理的低功耗处理器。在一些实施例中,处理器1501可以在集成有GPU(Graphics Processing Unit,图像处理器),GPU用于负责显示屏所需要显示的内容的渲染和绘制。一些实施例中,处理器1501还可以包括AI(Artificial Intelligence,人工智能)处理器,该AI处理器用于处理有关机器学习的计算操作。Processor 1501 may include one or more processing cores, such as a quad-core processor, an octa-core processor, etc. Processor 1501 may be implemented using at least one hardware form selected from DSP (Digital Signal Processing), FPGA (Field-Programmable Gate Array), and PLA (Programmable Logic Array). Processor 1501 may also include a main processor and a coprocessor. The main processor, also known as a CPU (Central Processing Unit), is used to process data in the wake-up state; the coprocessor is a low-power processor used to process data in the standby state. In some embodiments, processor 1501 may integrate a GPU (Graphics Processing Unit), which is responsible for rendering and drawing the content to be displayed on the screen. In some embodiments, processor 1501 may also include an AI (Artificial Intelligence) processor, which is used to handle computational operations related to machine learning.

存储器1502可以包括一个或多个计算机可读存储介质,该计算机可读存储介质可以是有形的和非暂态的。存储器1502还可包括高速随机存取存储器,以及非易失性存储器,比如一个或多个磁盘存储设备、闪存存储设备。在一些实施例中,存储器1502中的非暂态的计算机可读存储介质用于存储至少一个指令,该至少一个指令用于被处理器1501所执行以实现本申请中提供的终端1500的小程序的制作方法。The memory 1502 may include one or more computer-readable storage media, which may be tangible and non-transitory. The memory 1502 may also include high-speed random access memory and non-volatile memory, such as one or more disk storage devices or flash memory devices. In some embodiments, the non-transitory computer-readable storage media in the memory 1502 is used to store at least one instruction, which is executed by the processor 1501 to implement the method for creating a small program for the terminal 1500 provided in this application.

在一些实施例中,终端1500还可选包括有:外围设备接口1503和至少一个外围设备。具体地,外围设备包括:射频电路1504、触摸显示屏1505、摄像头1506、音频电路1507、定位组件1508和电源1509中的至少一种。In some embodiments, the terminal 1500 may also optionally include: a peripheral device interface 1503 and at least one peripheral device. Specifically, the peripheral device includes at least one of: a radio frequency circuit 1504, a touch display screen 1505, a camera 1506, an audio circuit 1507, a positioning component 1508, and a power supply 1509.

外围设备接口1503可被用于将I/O(Input/Output,输入/输出)相关的至少一个外围设备连接到处理器1501和存储器1502。在一些实施例中,处理器1501、存储器1502和外围设备接口1503被集成在同一芯片或电路板上;在一些其他实施例中,处理器1501、存储器1502和外围设备接口1503中的任意一个或两个可以在单独的芯片或电路板上实现,本实施例对此不加以限定。Peripheral interface 1503 can be used to connect at least one I/O (Input/Output) related peripheral device to processor 1501 and memory 1502. In some embodiments, processor 1501, memory 1502 and peripheral interface 1503 are integrated on the same chip or circuit board; in some other embodiments, any one or two of processor 1501, memory 1502 and peripheral interface 1503 can be implemented on separate chips or circuit boards, which is not limited in this embodiment.

射频电路1504用于接收和发射RF(Radio Frequency,射频)信号,也称电磁信号。射频电路1504通过电磁信号与通信网络以及其他通信设备进行通信。射频电路1504将电信号转换为电磁信号进行发送,或者,将接收到的电磁信号转换为电信号。可选地,射频电路1504包括:天线系统、RF收发器、一个或多个放大器、调谐器、振荡器、数字信号处理器、编解码芯片组、用户身份模块卡等等。射频电路1504可以通过至少一种无线通信协议来与其它终端进行通信。该无线通信协议包括但不限于:万维网、城域网、内联网、各代移动通信网络(2G、3G、4G及5G)、无线局域网和/或WiFi(Wireless Fidelity,无线保真)网络。在一些实施例中,射频电路1504还可以包括NFC(Near Field Communication,近距离无线通信)有关的电路,本申请对此不加以限定。The radio frequency (RF) circuit 1504 is used to receive and transmit RF (Radio Frequency) signals, also known as electromagnetic signals. The RF circuit 1504 communicates with communication networks and other communication devices via electromagnetic signals. The RF circuit 1504 converts electrical signals into electromagnetic signals for transmission, or converts received electromagnetic signals back into electrical signals. Optionally, the RF circuit 1504 includes: an antenna system, an RF transceiver, one or more amplifiers, a tuner, an oscillator, a digital signal processor, a codec chipset, a user identity module card, etc. The RF circuit 1504 can communicate with other terminals through at least one wireless communication protocol. This wireless communication protocol includes, but is not limited to: the World Wide Web, metropolitan area networks, intranets, various generations of mobile communication networks (2G, 3G, 4G, and 5G), wireless local area networks, and/or WiFi (Wireless Fidelity) networks. In some embodiments, the RF circuit 1504 may also include circuitry related to NFC (Near Field Communication), which is not limited in this application.

触摸显示屏1505用于显示UI(User Interface,用户界面)。该UI可以包括图形、文本、图标、视频及其它们的任意组合。触摸显示屏1505还具有采集在触摸显示屏1505的表面或表面上方的触摸信号的能力。该触摸信号可以作为控制信号输入至处理器1501进行处理。触摸显示屏1505用于提供虚拟按钮和/或虚拟键盘,也称软按钮和/或软键盘。在一些实施例中,触摸显示屏1505可以为一个,设置终端1500的前面板;在另一些实施例中,触摸显示屏1505可以为至少两个,分别设置在终端1500的不同表面或呈折叠设计;在一些实施例中,触摸显示屏1505可以是柔性显示屏,设置在终端1500的弯曲表面上或折叠面上。甚至,触摸显示屏1505还可以设置成非矩形的不规则图形,也即异形屏。触摸显示屏1505可以采用LCD(Liquid Crystal Display,液晶显示器)、OLED(Organic Light-Emitting Diode,有机发光二极管)等材质制备。The touch display screen 1505 is used to display a user interface (UI). This UI may include graphics, text, icons, videos, and any combination thereof. The touch display screen 1505 also has the ability to collect touch signals on or above its surface. These touch signals can be input as control signals to the processor 1501 for processing. The touch display screen 1505 is used to provide virtual buttons and/or a virtual keyboard, also known as soft buttons and/or a soft keyboard. In some embodiments, there may be one touch display screen 1505, located on the front panel of the terminal 1500; in other embodiments, there may be at least two touch display screens, respectively located on different surfaces of the terminal 1500 or in a folded design; in some embodiments, the touch display screen 1505 may be a flexible display screen, located on a curved or folded surface of the terminal 1500. Furthermore, the touch display screen 1505 may also be configured as a non-rectangular, irregular shape, i.e., a non-rectangular screen. The touch display 1505 can be made of materials such as LCD (Liquid Crystal Display) and OLED (Organic Light-Emitting Diode).

摄像头组件1506用于采集图像或视频。可选地,摄像头组件1506包括前置摄像头和后置摄像头。通常,前置摄像头用于实现视频通话或自拍,后置摄像头用于实现照片或视频的拍摄。在一些实施例中,后置摄像头为至少两个,分别为主摄像头、景深摄像头、广角摄像头中的任意一种,以实现主摄像头和景深摄像头融合实现背景虚化功能,主摄像头和广角摄像头融合实现全景拍摄以及VR(Virtual Reality,虚拟现实)拍摄功能。在一些实施例中,摄像头组件1506还可以包括闪光灯。闪光灯可以是单色温闪光灯,也可以是双色温闪光灯。双色温闪光灯是指暖光闪光灯和冷光闪光灯的组合,可以用于不同色温下的光线补偿。The camera assembly 1506 is used to acquire images or videos. Optionally, the camera assembly 1506 includes a front-facing camera and a rear-facing camera. Typically, the front-facing camera is used for video calls or selfies, and the rear-facing camera is used for taking photos or videos. In some embodiments, there are at least two rear-facing cameras, which are any one of a main camera, a depth-sensing camera, and a wide-angle camera, to achieve background blurring by fusion of the main camera and the depth-sensing camera, and panoramic shooting and VR (Virtual Reality) shooting by fusion of the main camera and the wide-angle camera. In some embodiments, the camera assembly 1506 may also include a flash. The flash can be a single-color temperature flash or a dual-color temperature flash. A dual-color temperature flash is a combination of a warm-light flash and a cool-light flash, which can be used for light compensation at different color temperatures.

音频电路1507用于提供用户和终端1500之间的音频接口。音频电路1507可以包括麦克风和扬声器。麦克风用于采集用户及环境的声波,并将声波转换为电信号输入至处理器1501进行处理,或者输入至射频电路1504以实现语音通信。出于立体声采集或降噪的目的,麦克风可以为多个,分别设置在终端1500的不同部位。麦克风还可以是阵列麦克风或全向采集型麦克风。扬声器则用于将来自处理器1501或射频电路1504的电信号转换为声波。扬声器可以是传统的薄膜扬声器,也可以是压电陶瓷扬声器。当扬声器是压电陶瓷扬声器时,不仅可以将电信号转换为人类可听见的声波,也可以将电信号转换为人类听不见的声波以进行测距等用途。在一些实施例中,音频电路1507还可以包括耳机插孔。Audio circuit 1507 provides an audio interface between the user and terminal 1500. Audio circuit 1507 may include a microphone and a speaker. The microphone is used to collect sound waves from the user and the environment, converting the sound waves into electrical signals that are input to processor 1501 for processing, or input to radio frequency circuit 1504 for voice communication. For stereo sound acquisition or noise reduction purposes, multiple microphones may be used, each located at a different location on terminal 1500. The microphone may also be an array microphone or an omnidirectional microphone. The speaker converts electrical signals from processor 1501 or radio frequency circuit 1504 into sound waves. The speaker may be a conventional diaphragm speaker or a piezoelectric ceramic speaker. When the speaker is a piezoelectric ceramic speaker, it can convert electrical signals not only into audible sound waves but also into inaudible sound waves for purposes such as distance measurement. In some embodiments, audio circuit 1507 may also include a headphone jack.

定位组件1508用于定位终端1500的当前地理位置,以实现导航或LBS(LocationBased Service,基于位置的服务)。定位组件1508可以是基于美国的GPS(GlobalPositioning System,全球定位系统)、中国的北斗系统或俄罗斯的伽利略系统的定位组件。The positioning component 1508 is used to locate the current geographic location of the terminal 1500 in order to enable navigation or LBS (Location Based Service). The positioning component 1508 can be a positioning component based on the US GPS (Global Positioning System), China's BeiDou system, or Russia's Galileo system.

电源1509用于为终端1500中的各个组件进行供电。电源1509可以是交流电、直流电、一次性电池或可充电电池。当电源1509包括可充电电池时,该可充电电池可以是有线充电电池或无线充电电池。有线充电电池是通过有线线路充电的电池,无线充电电池是通过无线线圈充电的电池。该可充电电池还可以用于支持快充技术。Power supply 1509 is used to power the various components in terminal 1500. Power supply 1509 can be AC power, DC power, a disposable battery, or a rechargeable battery. When power supply 1509 includes a rechargeable battery, the rechargeable battery can be a wired rechargeable battery or a wireless rechargeable battery. A wired rechargeable battery is a battery that is charged via a wired line, and a wireless rechargeable battery is a battery that is charged via a wireless coil. The rechargeable battery can also be used to support fast charging technology.

在一些实施例中,终端1500还包括有一个或多个传感器1510。该一个或多个传感器1510包括但不限于:加速度传感器1511、陀螺仪传感器1512、压力传感器1513、指纹传感器1514、光学传感器1515以及接近传感器1516。In some embodiments, the terminal 1500 further includes one or more sensors 1510. The one or more sensors 1510 include, but are not limited to: an accelerometer 1511, a gyroscope 1512, a pressure sensor 1513, a fingerprint sensor 1514, an optical sensor 1515, and a proximity sensor 1516.

加速度传感器1511可以检测以终端1500建立的坐标系的三个坐标轴上的加速度大小。比如,加速度传感器1511可以用于检测重力加速度在三个坐标轴上的分量。处理器1501可以根据加速度传感器1511采集的重力加速度信号,控制触摸显示屏1505以横向视图或纵向视图进行用户界面的显示。加速度传感器1511还可以用于游戏或者用户的运动数据的采集。Accelerometer 1511 can detect the magnitude of acceleration along the three coordinate axes of a coordinate system established by terminal 1500. For example, accelerometer 1511 can be used to detect the components of gravitational acceleration along the three coordinate axes. Processor 1501 can control touchscreen 1505 to display the user interface in landscape or portrait view based on the gravitational acceleration signal acquired by accelerometer 1511. Accelerometer 1511 can also be used for games or for acquiring user motion data.

陀螺仪传感器1512可以检测终端1500的机体方向及转动角度,陀螺仪传感器1512可以与加速度传感器1511协同采集用户对终端1500的3D动作。处理器1501根据陀螺仪传感器1512采集的数据,可以实现如下功能:动作感应(比如根据用户的倾斜操作来改变UI)、拍摄时的图像稳定、游戏控制以及惯性导航。The gyroscope sensor 1512 can detect the orientation and rotation angle of the terminal 1500. The gyroscope sensor 1512, in conjunction with the accelerometer sensor 1511, can collect 3D motion data from the user on the terminal 1500. Based on the data collected by the gyroscope sensor 1512, the processor 1501 can perform the following functions: motion sensing (e.g., changing the UI based on the user's tilt), image stabilization during shooting, game control, and inertial navigation.

压力传感器1513可以设置在终端1500的侧边框和/或触摸显示屏1505的下层。当压力传感器1513设置在终端1500的侧边框时,可以检测用户对终端1500的握持信号,根据该握持信号进行左右手识别或快捷操作。当压力传感器1513设置在触摸显示屏1505的下层时,可以根据用户对触摸显示屏1505的压力操作,实现对UI界面上的可操作性控件进行控制。可操作性控件包括按钮控件、滚动条控件、图标控件、菜单控件中的至少一种。The pressure sensor 1513 can be disposed on the side bezel of the terminal 1500 and/or on the lower layer of the touch display screen 1505. When the pressure sensor 1513 is disposed on the side bezel of the terminal 1500, it can detect the user's grip signal on the terminal 1500 and perform left/right hand recognition or quick operation based on the grip signal. When the pressure sensor 1513 is disposed on the lower layer of the touch display screen 1505, it can control the operable controls on the UI interface based on the user's pressure operation on the touch display screen 1505. The operable controls include at least one of button controls, scroll bar controls, icon controls, and menu controls.

指纹传感器1514用于采集用户的指纹,以根据采集到的指纹识别用户的身份。在识别出用户的身份为可信身份时,由处理器1501授权该用户执行相关的敏感操作,该敏感操作包括解锁屏幕、查看加密信息、下载软件、支付及更改设置等。指纹传感器1514可以被设置终端1500的正面、背面或侧面。当终端1500上设置有物理按键或厂商Logo时,指纹传感器1514可以与物理按键或厂商Logo集成在一起。The fingerprint sensor 1514 is used to collect a user's fingerprint to identify the user's identity. When the user's identity is identified as trusted, the processor 1501 authorizes the user to perform relevant sensitive operations, including unlocking the screen, viewing encrypted information, downloading software, making payments, and changing settings. The fingerprint sensor 1514 can be located on the front, back, or side of the terminal 1500. When the terminal 1500 has a physical button or manufacturer logo, the fingerprint sensor 1514 can be integrated with the physical button or manufacturer logo.

光学传感器1515用于采集环境光强度。在一个实施例中,处理器1501可以根据光学传感器1515采集的环境光强度,控制触摸显示屏1505的显示亮度。具体地,当环境光强度较高时,调高触摸显示屏1505的显示亮度;当环境光强度较低时,调低触摸显示屏1505的显示亮度。在另一个实施例中,处理器1501还可以根据光学传感器1515采集的环境光强度,动态调整摄像头组件1506的拍摄参数。An optical sensor 1515 is used to collect ambient light intensity. In one embodiment, the processor 1501 can control the display brightness of the touch screen 1505 based on the ambient light intensity collected by the optical sensor 1515. Specifically, when the ambient light intensity is high, the display brightness of the touch screen 1505 is increased; when the ambient light intensity is low, the display brightness of the touch screen 1505 is decreased. In another embodiment, the processor 1501 can also dynamically adjust the shooting parameters of the camera assembly 1506 based on the ambient light intensity collected by the optical sensor 1515.

接近传感器1516,也称距离传感器,通常设置在终端1500的正面。接近传感器1516用于采集用户与终端1500的正面之间的距离。在一个实施例中,当接近传感器1516检测到用户与终端1500的正面之间的距离逐渐变小时,由处理器1501控制触摸显示屏1505从亮屏状态切换为息屏状态;当接近传感器1516检测到用户与终端1500的正面之间的距离逐渐变大时,由处理器1501控制触摸显示屏1505从息屏状态切换为亮屏状态。The proximity sensor 1516, also known as a distance sensor, is typically located on the front of the terminal 1500. The proximity sensor 1516 is used to detect the distance between the user and the front of the terminal 1500. In one embodiment, when the proximity sensor 1516 detects that the distance between the user and the front of the terminal 1500 is gradually decreasing, the processor 1501 controls the touchscreen display 1505 to switch from a screen-on state to a screen-off state; when the proximity sensor 1516 detects that the distance between the user and the front of the terminal 1500 is gradually increasing, the processor 1501 controls the touchscreen display 1505 to switch from a screen-off state to a screen-on state.

本领域技术人员可以理解,图13中示出的结构并不构成对终端1500的限定,可以包括比图示更多或更少的组件,或者组合某些组件,或者采用不同的组件布置。Those skilled in the art will understand that the structure shown in FIG13 does not constitute a limitation on the terminal 1500, and may include more or fewer components than shown, or combine certain components, or use different component arrangements.

请参考图16,其示出了本申请一个实施例提供的服务器的结构示意图。该服务器用于实施上述实施例提供的小程序的制作方法。具体来讲:Please refer to Figure 16, which shows a schematic diagram of the structure of a server provided in one embodiment of this application. This server is used to implement the method for creating applets provided in the above embodiments. Specifically:

所述服务器1600包括中央处理单元(CPU)1601、包括随机存取存储器(RAM)1602和只读存储器(ROM)1603的系统存储器1604,以及连接系统存储器1604和中央处理单元1601的系统总线1605。所述服务器1600还包括帮助计算机内的各个器件之间传输信息的基本输入/输出系统(I/O系统)1606,和用于存储操作系统1613、应用程序1614和其他程序模块1615的大容量存储设备1607。The server 1600 includes a central processing unit (CPU) 1601, a system memory 1604 including random access memory (RAM) 1602 and read-only memory (ROM) 1603, and a system bus 1605 connecting the system memory 1604 and the CPU 1601. The server 1600 also includes a basic input/output system (I/O system) 1606 to facilitate information transfer between various devices within the computer, and a mass storage device 1607 for storing the operating system 1613, application programs 1614, and other program modules 1615.

所述基本输入/输出系统1606包括有用于显示信息的显示器1608和用于用户输入信息的诸如鼠标、键盘之类的输入设备1609。其中所述显示器1608和输入设备1609都通过连接到系统总线1605的输入输出控制器1610连接到中央处理单元1601。所述基本输入/输出系统1606还可以包括输入输出控制器1610以用于接收和处理来自键盘、鼠标、或电子触控笔等多个其他设备的输入。类似地,输入输出控制器1610还提供输出到显示屏、打印机或其他类型的输出设备。The basic input/output system 1606 includes a display 1608 for displaying information and an input device 1609 for user input, such as a mouse or keyboard. Both the display 1608 and the input device 1609 are connected to the central processing unit 1601 via an input/output controller 1610 connected to the system bus 1605. The basic input/output system 1606 may also include the input/output controller 1610 for receiving and processing input from multiple other devices such as a keyboard, mouse, or electronic stylus. Similarly, the input/output controller 1610 also provides output to a display screen, printer, or other types of output devices.

所述大容量存储设备1607通过连接到系统总线1605的大容量存储控制器(未示出)连接到中央处理单元1601。所述大容量存储设备1607及其相关联的计算机可读介质为服务器1600提供非易失性存储。也就是说,所述大容量存储设备1607可以包括诸如硬盘或者CD-ROM驱动器之类的计算机可读介质(未示出)。The mass storage device 1607 is connected to the central processing unit 1601 via a mass storage controller (not shown) connected to the system bus 1605. The mass storage device 1607 and its associated computer-readable media provide non-volatile storage for the server 1600. That is, the mass storage device 1607 may include computer-readable media (not shown) such as a hard disk or a CD-ROM drive.

不失一般性,所述计算机可读介质可以包括计算机存储介质和通信介质。计算机存储介质包括以用于存储诸如计算机可读指令、数据结构、程序模块或其他数据等信息的任何方法或技术实现的易失性和非易失性、可移动和不可移动介质。计算机存储介质包括RAM、ROM、EPROM、EEPROM、闪存或其他固态存储其技术,CD-ROM、DVD或其他光学存储、磁带盒、磁带、磁盘存储或其他磁性存储设备。当然,本领域技术人员可知所述计算机存储介质不局限于上述几种。上述的系统存储器1604和大容量存储设备1607可以统称为存储器。Without loss of generality, the computer-readable medium may include computer storage media and communication media. Computer storage media include volatile and non-volatile, removable and non-removable media implemented using any method or technology for storing information such as computer-readable instructions, data structures, program modules, or other data. Computer storage media include RAM, ROM, EPROM, EEPROM, flash memory or other solid-state storage technologies, CD-ROM, DVD or other optical storage, magnetic tape cassettes, magnetic tape, disk storage, or other magnetic storage devices. Of course, those skilled in the art will recognize that the computer storage media are not limited to the above-mentioned types. The system memory 1604 and mass storage device 1607 described above can be collectively referred to as memory.

根据本申请的各种实施例,所述服务器1600还可以通过诸如因特网等网络连接到网络上的远程计算机运行。也即服务器1600可以通过连接在所述系统总线1605上的网络接口单元1611连接到网络1612,或者说,也可以使用网络接口单元1611来连接到其他类型的网络或远程计算机系统。According to various embodiments of this application, the server 1600 can also be connected to a remote computer on a network, such as the Internet. That is, the server 1600 can be connected to the network 1612 via the network interface unit 1611 connected to the system bus 1605, or the network interface unit 1611 can be used to connect to other types of networks or remote computer systems.

所述存储器中存储有至少一条指令、至少一段程序、代码集或指令集,所述至少一条指令、至少一段程序、代码集或指令集经配置以由一个或者一个以上处理器执行,以实现上述小程序的制作方法中各个步骤的功能。The memory stores at least one instruction, at least one program, code set, or instruction set, which is configured to be executed by one or more processors to implement the functions of each step in the above-mentioned method for creating a mini-program.

本申请实施例还提供一种计算机可读存储介质,该存储介质中存储有至少一条指令、至少一段程序、代码集或指令集,所述至少一条指令、所述至少一段程序、所述代码集或指令集由所述处理器加载并执行以实现如上述各个实施例提供的小程序的制作方法。This application also provides a computer-readable storage medium storing at least one instruction, at least one program, code set, or instruction set, wherein the at least one instruction, the at least one program, the code set, or the instruction set is loaded and executed by the processor to implement the method for creating a small program as provided in the above embodiments.

可选地,该计算机可读存储介质可以包括:只读存储器(ROM,Read Only Memory)、随机存取记忆体(RAM,Random Access Memory)、固态硬盘(SSD,Solid State Drives)或光盘等。其中,随机存取记忆体可以包括电阻式随机存取记忆体(ReRAM,Resistance RandomAccess Memory)和动态随机存取存储器(DRAM,Dynamic Random Access Memory)。Optionally, the computer-readable storage medium may include: read-only memory (ROM), random access memory (RAM), solid-state drives (SSDs), or optical discs, etc. The random access memory may include resistive random access memory (ReRAM) and dynamic random access memory (DRAM).

上述本申请实施例序号仅仅为了描述,不代表实施例的优劣。以上所述仅为本申请的可选实施例,并不用以限制本申请,凡在本申请的精神和原则之内,所作的任何修改、等同替换、改进等,均应包含在本申请的保护范围之内。The sequence numbers of the embodiments in this application are for descriptive purposes only and do not represent the superiority or inferiority of the embodiments. The above descriptions are merely optional embodiments of this application and are not intended to limit this application. Any modifications, equivalent substitutions, improvements, etc., made within the spirit and principles of this application should be included within the protection scope of this application.

Claims (10)

1.一种小程序的制作方法,其特征在于,所述小程序是依赖于宿主程序运行的程序,所述方法包括:1. A method for creating a mini-program, characterized in that the mini-program is a program that depends on a host program to run, the method comprising: 显示可视化制作程序的小程序制作界面,所述小程序制作界面上显示有面板区、编辑区以及代码显示区域,所述面板区提供有n种基础UI元素,n为正整数;The interface for creating a mini-program is a visual creation program. The interface includes a panel area, an editing area, and a code display area. The panel area provides n basic UI elements, where n is a positive integer. 在接收到目标基础UI元素上的用户操作时,在所述编辑区中根据所述目标基础UI元素编辑得到所述小程序的程序界面,所述目标基础UI元素是所述n种基础UI元素中被选择的UI元素;When a user operation is received on a target basic UI element, the program interface of the mini program is obtained by editing the target basic UI element in the editing area. The target basic UI element is a UI element selected from the n basic UI elements. 根据所述小程序的程序界面生成所述小程序的程序包;The program package of the mini program is generated based on the program interface of the mini program; 在接收到所述目标基础UI元素上的用户操作时,在所述代码显示区域显示与当前操作相关的代码;When a user action is received on the target basic UI element, code related to the current action is displayed in the code display area; 在接收到所述代码显示区域内的代码编辑操作,且所述代码编辑操作中包括对所述目标基础UI元素的身份标识号的输入操作的情况下,响应于对所述目标基础UI元素的触发操作,在所述代码显示区域内自动键入所述目标基础UI元素的所述身份标识号。Upon receiving a code editing operation within the code display area, and the code editing operation includes an input operation for the identity number of the target basic UI element, in response to a trigger operation on the target basic UI element, the identity number of the target basic UI element is automatically entered within the code display area. 2.根据权利要求1所述的方法,其特征在于,所述在接收到目标基础UI元素上的用户操作时,在所述编辑区中根据所述目标基础UI元素编辑得到所述小程序的程序界面,包括:2. The method according to claim 1, characterized in that, upon receiving a user operation on a target basic UI element, editing the program interface of the mini-program in the editing area according to the target basic UI element includes: 在接收到所述目标基础UI元素对应的页面编排操作时,根据所述页面编排操作在所述编辑区中对所述目标基础UI元素进行排版编辑,得到所述小程序的程序界面中的视觉部分;When a page arrangement operation corresponding to the target basic UI element is received, the target basic UI element is arranged and edited in the editing area according to the page arrangement operation to obtain the visual part of the program interface of the mini program; 在接收到所述目标基础UI元素对应的逻辑编排操作时,根据所述逻辑编排操作在所述编辑区中对所述目标基础UI元素进行逻辑编辑,得到所述小程序的程序界面中的逻辑运行部分。Upon receiving the logical arrangement operation corresponding to the target basic UI element, the target basic UI element is logically edited in the editing area according to the logical arrangement operation to obtain the logical operation part in the program interface of the mini program. 3.根据权利要求2所述的方法,其特征在于,所述在接收到所述目标基础UI元素对应的页面编排操作时,根据所述页面编排操作在所述编辑区中对所述目标基础UI元素进行排版编辑,得到所述小程序的程序界面中的视觉部分,包括如下步骤中的至少一个:3. The method according to claim 2, characterized in that, upon receiving the page arrangement operation corresponding to the target basic UI element, the step of arranging and editing the target basic UI element in the editing area according to the page arrangement operation to obtain the visual part of the program interface of the mini-program includes at least one of the following steps: 在接收到所述目标基础UI元素上的选择操作时,根据所述选择操作在所述编辑区中的所述小程序的程序界面中增加所述目标基础UI元素;Upon receiving a selection operation on the target basic UI element, the target basic UI element is added to the program interface of the mini-program in the editing area according to the selection operation; 在接收到所述目标基础UI元素上的移动操作时,根据所述移动操作在所述编辑区中的所述小程序的程序界面中移动所述目标基础UI元素的位置;Upon receiving a move operation on the target basic UI element, the position of the target basic UI element is moved within the program interface of the mini-program in the editing area according to the move operation; 在接收到所述目标基础UI元素上的缩放操作时,根据所述缩放操作在所述编辑区中的所述小程序的程序界面中改变所述目标基础UI元素的大小。Upon receiving a scaling operation on the target basic UI element, the size of the target basic UI element is changed in the program interface of the mini-program in the editing area according to the scaling operation. 4.根据权利要求2所述的方法,其特征在于,所述在接收到所述目标基础UI元素对应的逻辑编排操作时,根据所述逻辑编排操作在所述编辑区中对所述目标基础UI元素进行逻辑编辑,得到所述小程序的程序界面中的逻辑运行部分,包括:4. The method according to claim 2, characterized in that, upon receiving the logical arrangement operation corresponding to the target basic UI element, logically editing the target basic UI element in the editing area according to the logical arrangement operation to obtain the logical operation part in the program interface of the mini-program, includes: 在接收到所述目标基础UI元素对应的第一逻辑编排操作时,根据所述第一逻辑编排操作在所述编辑区中将所述目标基础UI元素与静态数据进行数据绑定,所述静态数据是预先写入至所述目标基础UI元素中进行显示的数据;Upon receiving the first logical arrangement operation corresponding to the target basic UI element, the target basic UI element is data-bound with static data in the editing area according to the first logical arrangement operation. The static data is data that is pre-written into the target basic UI element for display. 在接收到所述目标基础UI元素对应的第二逻辑编排操作时,根据所述第二逻辑编排操作在所述编辑区中将所述目标基础UI元素与第一动态数据进行数据绑定,所述第一动态数据是在所述小程序的运行期间通过网络协议动态获取至所述目标基础UI元素中进行显示的数据;Upon receiving the second logical arrangement operation corresponding to the target basic UI element, the target basic UI element is data-bound to the first dynamic data in the editing area according to the second logical arrangement operation. The first dynamic data is data dynamically obtained from the target basic UI element through network protocol during the operation of the mini program and displayed thereon. 在接收到所述目标基础UI元素对应的第三逻辑编排操作时,根据所述第三逻辑编排操作在所述编辑区中将所述目标基础UI元素与第二动态数据进行数据绑定,所述第二动态数据是在所述小程序的运行期间通过本地代码计算后写入至所述目标基础UI元素中进行显示的数据。Upon receiving the third logical arrangement operation corresponding to the target basic UI element, the target basic UI element is bound to the second dynamic data in the editing area according to the third logical arrangement operation. The second dynamic data is data that is calculated by local code and written to the target basic UI element for display during the operation of the mini program. 5.根据权利要求2所述的方法,其特征在于,所述小程序的程序界面包括:存在层级显示关系的第一程序界面和第二程序界面;5. The method according to claim 2, wherein the program interface of the mini-program includes: a first program interface and a second program interface having a hierarchical display relationship; 所述在接收到所述目标基础UI元素对应的逻辑编排操作时,根据所述逻辑编排操作在所述编辑区中对所述目标基础UI元素进行逻辑编辑,得到所述小程序的程序界面中的逻辑运行部分,包括:Upon receiving the logical arrangement operation corresponding to the target basic UI element, the step of logically editing the target basic UI element in the editing area according to the logical arrangement operation to obtain the logical operation part in the program interface of the mini-program, including: 在接收到所述第一程序界面中的目标基础UI元素对应的第四逻辑编排操作时,根据所述第四逻辑编排操作在所述编辑区中对所述目标基础UI元素与所述第二程序界面进行数据绑定,所述第二程序界面是所述目标基础UI元素在触发后跳转显示的程序界面。When a fourth logical arrangement operation corresponding to the target basic UI element in the first program interface is received, the target basic UI element and the second program interface are data bound in the editing area according to the fourth logical arrangement operation. The second program interface is the program interface that the target basic UI element jumps to and displays after being triggered. 6.根据权利要求1至5任一所述的方法,其特征在于,所述小程序制作界面还包括:预览控件;6. The method according to any one of claims 1 to 5, wherein the mini-program creation interface further includes: a preview control; 所述方法还包括:The method further includes: 在接收到所述预览控件上的预览操作时,将所述小程序的程序包推送至所述宿主程序中进行运行。Upon receiving a preview operation from the preview control, the mini-program package is pushed to the host program for execution. 7.根据权利要求1至5任一所述的方法,其特征在于,所述小程序制作界面还包括:提交控件;7. The method according to any one of claims 1 to 5, wherein the mini-program creation interface further includes: a submission control; 所述方法还包括:The method further includes: 在接收到所述提交控件上的提交操作时,将所述小程序的程序包发送至所述宿主程序的程序平台进行审核或发布。Upon receiving a submission operation from the submission control, the mini-program's package is sent to the host program's platform for review or release. 8.一种小程序的制作装置,其特征在于,所述小程序是依赖于宿主程序运行的程序,所述装置包括:8. A device for creating a mini-program, characterized in that the mini-program is a program that depends on a host program to run, and the device comprises: 制作界面显示模块,用于显示可视化制作程序的小程序制作界面,所述小程序制作界面上显示有面板区、编辑区以及代码显示区域,所述面板区提供有n种基础UI元素,n为正整数;The interface display module is used to display the mini-program creation interface of the visual creation program. The mini-program creation interface displays a panel area, an editing area, and a code display area. The panel area provides n basic UI elements, where n is a positive integer. 程序界面生成模块,用于在接收到目标基础UI元素上的用户操作时,在所述编辑区中根据所述目标基础UI元素编辑得到所述小程序的程序界面,所述目标基础UI元素是所述n种基础UI元素中被选择的UI元素;The program interface generation module is used to edit the program interface of the mini-program in the editing area according to the target basic UI element when a user operation is received on the target basic UI element. The target basic UI element is a UI element selected from the n basic UI elements. 程序包生成模块,用于根据所述小程序的程序界面生成所述小程序的程序包;A package generation module is used to generate a package for the mini-program based on the mini-program's interface. 用于在接收到所述目标基础UI元素上的用户操作时,在所述代码显示区域显示与当前操作相关的代码;在接收到所述代码显示区域内的代码编辑操作,且所述代码编辑操作中包括对所述目标基础UI元素的身份标识号的输入操作的情况下,响应于对所述目标基础UI元素的触发操作,在所述代码显示区域内自动键入所述目标基础UI元素的所述身份标识号的功能模块。A functional module for displaying code related to the current operation in the code display area when a user operation is received on the target basic UI element; and for automatically typing the identity number of the target basic UI element in the code display area in response to a trigger operation on the target basic UI element when a code editing operation is received in the code display area, and the code editing operation includes an input operation for the identity number of the target basic UI element. 9.一种终端,其特征在于,所述终端包括处理器和存储器;所述存储器存储有至少一条指令,所述至少一条指令用于被所述处理器执行以实现如权利要求1至7任一所述的小程序的制作方法。9. A terminal, characterized in that the terminal includes a processor and a memory; the memory stores at least one instruction, the at least one instruction being executed by the processor to implement the method for creating a mini-program as described in any one of claims 1 to 7. 10.一种计算机可读存储介质,其特征在于,所述存储介质存储有至少一条指令,所述至少一条指令用于被处理器执行以实现如权利要求1至7任一所述的小程序的制作方法。10. A computer-readable storage medium, characterized in that the storage medium stores at least one instruction, the at least one instruction being executed by a processor to implement the method for creating a small program as described in any one of claims 1 to 7.
HK42021027405.6A 2021-03-16 Mini-program production method and apparatus, terminal, and storage medium HK40037429B (en)

Publications (2)

Publication Number Publication Date
HK40037429A HK40037429A (en) 2021-06-11
HK40037429B true HK40037429B (en) 2023-11-03

Family

ID=

Similar Documents

Publication Publication Date Title
US11954464B2 (en) Mini program production method and apparatus, terminal, and storage medium
US11231845B2 (en) Display adaptation method and apparatus for application, and storage medium
JP7217357B2 (en) Mini-program data binding method, apparatus, device and computer program
US9674445B2 (en) Portable apparatus and method for taking a photograph by using widget
US8068121B2 (en) Manipulation of graphical objects on a display or a proxy device
CN107908929B (en) Method and device for playing audio data
AU2014312481B2 (en) Display apparatus, portable device and screen display methods thereof
KR102072584B1 (en) Digital device and method for controlling the same
CN105739813A (en) User terminal device and control method thereof
CN107407945A (en) From the system and method for screen locking capture images
CN112416485A (en) Information guiding method, device, terminal and storage medium
WO2022134632A1 (en) Work processing method and apparatus
CN108717365A (en) The method and apparatus for executing function in the application
CN112230910A (en) Page generation method, device, equipment and storage medium of embedded program
CN111191176A (en) Website content updating method, device, terminal and storage medium
CN111597359A (en) Information stream sharing method, device, equipment and storage medium
CN112257006B (en) Page information configuration method, device, equipment and computer readable storage medium
CN112416486B (en) Information guidance method, device, terminal and storage medium
CN114138250A (en) Method, device and equipment for generating steps of system case and storage medium
HK40037429B (en) Mini-program production method and apparatus, terminal, and storage medium
HK40037429A (en) Mini-program production method and apparatus, terminal, and storage medium
HK40037423B (en) Embedded program page generation method and apparatus, device, and storage medium
HK40022653B (en) Method and apparatus for displaying user interface, device and medium
HK40048707B (en) Control creation method and apparatus, device and storage medium
HK40074448B (en) Message display method and apparatus, terminal, server, and medium