WeChat application account (mini program, the new name of [application account]) is finally here! Everyone must be concerned about what the final form of the application account will look like? How to transform a [Service Account] into a [Mini Program]?
Before you start developing an application account, take a look at the official [Mini Program] tutorial! Yingqu Technology, a WeChat mini program development company, will take you through the initial creation of a WeChat mini program and experience the actual effect of the mini program on your mobile phone.
1. Obtain the AppID for WeChat applet development
First of all, we need to have an account. If you can see this document, we should have invited and created an account for you. Note that the AppID of the service account or subscription account cannot be used directly. Use the provided account to log in to the WeChat official website, and you can view the AppID developed by the WeChat applet in the website's [Settings] - [Developer Settings].
We need to use developer tools to complete mini program creation and code editing. After the developer toolsinstallation is completed, open and use WeChat to scan the QR code to log in. Select Create [Project], fill in the AppID obtained above, set a local project name (not the applet name), select a local folder as the directory for code storage, and click [New Project].
3. Write code
Click [Edit] on the left side of the developer tools Navigation, we can see that this project has been initialized and contains some simple code document. The most critical and essential ones are app.js, app.json, and app.wxss. Among them, the .js suffix is a script file, the .json suffix is a configuration file, and the .wxss suffix is a style sheet file. WeChat applet development will read these files and generate applet instances.
4. Create a page
In this tutorial, we have two pages, the index page and the logs page, namely the welcome page and the display page of the mini program startup log. They are both in the pages directory. Down. The [path + page name] of each page in WeChat mini program development needs to be written in the pages of app.json, and the first page in pages is the homepage of the mini program.
5. Mobile preview
Select [Project] on the left menu bar of the developer tools, click [Preview], and scan the code to experience it in the WeChat client. Currently, the preview and upload functions are not yet available, and you need to wait for the next official update from WeChat.
The official development guide provided by WeChat is very simple. Many details, codes and functions are not clearly displayed. Therefore, the specific WeChat applet development steps require developers to study and implement them carefully.
The above is the detailed content of A brief introduction to the steps for developing WeChat mini programs. For more information, please follow other related articles on the PHP Chinese website!