Demonstration of garbage classification applet based on springboot+WeChat applet [with project source code]

Demonstration of garbage classification applet based on springboot+WeChat applet

system development environment  

The running environment of the WeChat applet is divided into a rendering layer and a logic layer. There are two threads for management respectively. The interface uses WebView for rendering, and the logic layer uses JsCore to run JavaScript scripts. The communication between these two threads is relayed through the WeChat client. The WeChat client interacts with third-party servers through HTTPS requests, and WeChat opens a lot of functions to developers, which is very convenient to implement. WeChat mini programs bring a lot of convenience to learners, and at the same time reduce the workload of adapting to different devices and operating systems. Therefore, this system is developed using the WeChat mini program architecture.

WeChat mini program related technologies

The original intention of launching the WeChat mini program is not only to make it more convenient for users, but also to provide developers with a more convenient and convenient development environment for more efficient development. The design and development of any system requires a complete system framework to ensure the complete operation of the entire system. For WeChat mini programs, in order to make development faster, the framework used by WeChat mini programs is the MINA application framework. The MINA framework is mainly a system responsible for data interaction. Its composition mainly includes the view layer structure used to display the page and the logic layer system responsible for realizing data interaction. Among them, the view layer is responsible for issuing event requests, and the logic layer is responsible for receiving data and processing data. When the logical layer receives the data, the view layer makes corresponding updates based on the data changes in the logical layer. The MINA framework synchronizes the data changes in the logical layer and the view layer.

The framework is also responsible for many interactive operations. Developers only need to input the page methods and functions to be implemented, and the framework can manage the page routing and life cycle of the entire program, allowing the mini program to seamlessly jump to different child pages. Smooth. The view layer in the MINA framework is used to develop the front-end interface of the mini program. The page builds the interface and uses WXML and WXSS languages ​​for development. WXML and WXSS languages ​​are both description languages ​​provided by the framework itself, and WXML is used to describe the page structure. WXSS is used to control the display style of the page and build the basic view structure of the page. The AppService logical layer is the service center of MINA. It is responsible for the data required for page rendering and the logic of page interaction processing, managing the life cycle of the application and page routing. The view layer sends event requests to the logic layer, and the logic layer performs page data processing and processing through the requests. Transmitted, and then sent to the view layer for page rendering. The logic layer is written in JavaScript language to implement page interaction, network requests and data processing. The logic layer contains powerful API interface functions of small programs. When developing, developers can directly call any functions they need, including the interface for obtaining user information. , payment function interface, location service function interface, etc. In addition, the mini program uses JSBridge to mobilize the underlying API interface. JSBridge connects the Web and Native through JavaScript, so that Native can call the JS code of the WEB and the Web can call the native code. Therefore, the development of WeChat mini programs does not need to consider the differences between ios and Android operating systems. The two are compatible and only need to be developed at the view layer and logic layer. The following figure mainly shows the main structure of the MINA framework:

WeChat applet file directory

The development of every WeChat mini program must include an app whose main function is to describe the mini program as a whole, and a page which is mainly used to describe the page of the mini program. When developing the mini program, the code structure directory initialized by the WeChat mini program is very simple and clear. Only two directories are displayed, namely the pages directory and the utils directory, as well as app.js, app.json, and app.wxss. application files. For the pages directory, its main function is equivalent to a "memory" used to "store" each display page of the applet. A page corresponds to a directory, which contains four files: js files, wxml files, wxss files, and json files. As shown in the figure below, the pages directory mainly stores the files that constitute the two pages, index and logs. Utils is responsible for storing js libraries and digital format files

System page display

If necessary, you can scan the QR code below the article to contact the source code.

Guess you like

Origin blog.csdn.net/ybigbear/article/details/135196740