Sihai network

Alipay small program creation process Alipay small program development method

Alipay applet is open to enterprise account, and wants to be a Alipay small program developer. It needs to complete the three steps of registration, settlement and small program creation. So how to develop Alipay applet? Here is a little Alipay development tutorial, let's take a look.

How to create Alipay applet

Through the following steps to complete the creation of small programs, and access to appid.

Step 1: create an applet

Through the home page of the app, click 'login management center', enter the app management center, and click 'create app' on the page.

A maximum of 10 applets can be created under an account; applets that have not been submitted for audit can be deleted, and the deleted applets are not in the counting range.

Step 2: fill in the basic information of the applet

Please fill in the basic information of the applet accurately. The basic information is not allowed to contain prohibited words. The application information modification rules are as follows.

Before putting on the shelf, the application information can be modified for any number of times.

Application name / application English name will not be allowed to be modified after being put on the shelf; application introduction, application description and application category can be modified five times a month when the new version is submitted for review, and other information can be modified when the new version is submitted for review.

Step 3: get appid

After the applet is successfully created, you can view appid on the applet details page.

How to develop Alipay applet?

1、 Framework of small program

1. The small program is divided into app and page. App describes the whole program and page describes each page.

2. App represents the top-level application, manages all pages and global data, and provides life cycle methods. It is also a construction method to generate app instances. The top level of each applet generally contains three files: app.js (application logic), app.acss (application style), app.json (application configuration) app.json It is used for global configuration, determining the path of page file, window performance, setting network timeout, setting multiple tabs, etc.

Here is a simple configuration with some configuration options app.json .

Copy code

{'pages': ['pages/index/index','pages/logs/index'],'window':{ 'defaultTitle':'Demo' }}

3. Page represents a page of the application, responsible for page display and interaction. Each page corresponds to a subdirectory. Generally, as many pages as there are, there are as many subheadings

Record. It is also a constructor to generate page instances. Page consists of four file types: JS (page logic) AXML (page logic)

Structure) ACSS (page style sheet) JSON (page configuration). For details, please refer to [reference address]

2、 Small program debugging

1. simulator debugging ide simulator provides the following functions: device simulation (size accuracy, etc.), compile log, compile error prompts, refresh, Alipay JsAPI simulation and location, Bluetooth, startup parameters and other analog interface custom configuration (as shown below)

2. Debugging tools: with the simulator, IDE provides customized chrome devtool, and provides extensions such as AXML. Default display:

AXML, DOM and CSS debugging based on small program elements

Console, run log, view error

Storage, cache data view, edit

Sources, source view, breakpoint debugging

Network, network resources, request view

3. The following three points should be paid attention to in real machine debugging and preview: 1) first of all, you have to provide an app ID (if you have not applied, please go to the open platform to apply)

2) The preview of the production environment has permission restrictions. You need to choose to push yourself or the corresponding developer (the developer added under the app ID)

3) We provide debugging tools for the production environment. Select to open the real machine debugging tool.