当前位置:网站首页>What processes are needed to build a wechat applet from scratch?

What processes are needed to build a wechat applet from scratch?

2022-06-25 16:19:00 、Packager

Build a wechat applet from scratch , What processes are needed ?

There are several modes for wechat applet , One is the cloud service mode , One is not to use cloud service mode , What is the difference between the two ?

Official explanation : Wechat cloud development is a professional applet development service launched by wechat team and Tencent cloud .
Developers can use cloud development to quickly develop small programs 、 Little games 、 The official account page, etc , And the original ability to open wechat .
Developers don't have to build servers , You can directly use the API Business development .
Personal understanding : Cloud service mode , That is, the background logic and data are hosted on Tencent server , Non cloud service mode , That is, the background logic is on the local server , The difference between the two lies in buying / Rent a server to deploy the background interface service , Or use the services officially provided by the applet , Of course , Use the official , Naturally, there are some security benefits , If you deploy it on the server , You need to perform authentication at the interface level 、 check 、 Encryption and other measures . What about here? , Let's take personal deployment as an example .

Okay , I don't say much nonsense , On dry , All of the following are not intended to be detailed , Just for the process steps built , There is something unclear that can QQ Click here to communicate with me , Or scan the wechat QR code below , Communicate with me !

 Insert picture description here

Construction process

Build wechat apps , We need to prepare the following :

First , On the wechat open platform , Register to apply for a wechat applet , Click here to go to
 Insert picture description here
After registration , Login account , On page : Development 》 Development management 》 Development and setup Get the appid
 Insert picture description here
Then download the developer tool of wechat applet , The download location is on the page : Development 》 development tool 》 Developer tools Download  Insert picture description here

Wechat developer tools , The main components used are those officially provided , You can also draw your own interface styles , See the official documents for specific development documents ,https://developers.weixin.qq.com/miniprogram/dev/framework, Practical and regular web development , Applet js The grammar is the same , Just say something similar vue The development mode of the framework , Data binding , Life cycle triggering, etc , The interface style is almost the same as css, The difference is that wechat applets have their own interface units :rpx etc. , It is also a common unit of wechat applet , What's better than a regular front end is , The screen width of wechat applet is constant :750rpx, This helps front-end developers cope with different screens , The same proportion is calculated and divided , Greatly improve the interface compatibility , It also provides a wealth of components , It reduces the developer's effort to redraw some components such as selectors

New applet project , After opening the wechat applet developer tool , New projects , Here you need to enter a appid, Here, fill in the wechat applet we registered above , Acquired Appid Just fill in , Choose not to use cloud services
 Insert picture description here
 Insert picture description here

This completes the initialization status of the applet , Initialization is officially provided demo Code , In this way, you can develop the interface on this basis , I won't go into details about how to develop small programs , If you are interested, you can look at the document and write demo Practice hands , This involves a key point , That is, front-end and back-end delivery , At present, the applet is the front end , What about the back end ?

There are many back ends , See what language you are familiar with , Just use what language to do the back-end interface , Most of the previous websites were not separated from the front and back , Now almost all of them are separated from the front end and the back end , What's the difference between separation and non separation ? If not separated , Interface rendering is done on the server side , The separation is done on the client side , Compared with , Front and rear end separation is a better choice , In this way, the front and rear end are developed by division of labor , More efficient , Reduce maintenance costs , A clearer division of labor , The back end focuses on logic , The front-end pays attention to interface rendering and logic processing , The wechat applet is also a complete front and back-end separation framework , Far away , Far away , Come back and continue , In the back end , I usually use Java、Pyhton、PHP Choose one of the three languages , Currently used Java、Python A little more , It depends on personal preferences and the stability requirements of the system , The back-end logic will not be demonstrated here , One thing to note is , Wechat applets require that the backend must support https Of ,https You need to SSL A security certificate , This certificate , Generally, you can get free when you buy a domain name , It is recommended to use Alibaba cloud or Tencent cloud , Of course , Just choose what you like , Take Alibaba cloud as an example :
 Insert picture description here
Apply for a free certificate and download it directly , As for what type of certificate to download, it depends on the back-end language you use , What is a frame , After downloading, it is placed on the corresponding back-end framework for configuration , Here we use java Linguistic spring boot For example , Put the downloaded Certificate in resources File directory , And on the configuration file ssl Related parameters
 Insert picture description here
When the configuration is complete , Package and deploy the interface to the ECS , Here the server is an application server , It depends on you / What server did you rent , Build and deploy the corresponding back-end language framework , here ssl After deployment , To put https The interface address of is configured in the secure domain name of the wechat applet , In this way, wechat applet can be delivered
Again , In the background interface of wechat applet : Development 》 Development management 》 Development and setup 》 request Legitimate domain name To configure
 Insert picture description here
After configuration , Submit the code version in wechat developer tool , Then submit the experience version to the wechat applet team for review in the background .
 Insert picture description here

This is the complete process , The article doesn't mention code related information , Because it's thin , It is too much and too troublesome to write , This is just an introduction to the overall process , There is something unclear that can QQ Click here to communicate with me , Or contact wechat :walei5201314.

原网站

版权声明
本文为[、Packager]所创,转载请带上原文链接,感谢
https://yzsam.com/2022/02/202202190534588708.html