Design and implementation of shopping mall based on WeChat applet (paper + source code)_kaic

Design and implementation of shopping mall based on WeChat applet

Abstract
With the development of information technology and the upgrading of user consumption, traditional supermarkets, e-commerce online promotions and shopping experience have all encountered bottlenecks. Unmanned supermarkets have joined the high-tech experience of consumer shopping behavior, but with this cool black technology experience, there will also be high store cost investment and maintenance. If society generally replicates this model, technology and The cost threshold will be higher. Developing a wider range of applications for traditional online merchants, providing versatility and convenience to consumers. WeChat applet is "at your fingertips" and is very suitable for important low-frequency needs in people's lives. Compared with the original APP, it is more suitable for quickly increasing offline demand. This article takes the shopping method of traditional community convenience stores as the starting point, combines WeChat mini program technology, and adopts object-oriented development methods to develop a convenient and fast WeChat mini program shopping system, which can facilitate consumers to conduct offline promotions and online shopping.
This system mainly consists of WeChat applet client, server and data management terminal. The server uses ThinkPHP5 framework technology, the client uses the MINA framework of the WeChat applet, and the data management terminal uses the CMS framework. The client's page implementation obtains MySQL through the network and server REST API interface.
Mainly engaged in the design, development and testing of WeChat mini-program online shopping system clients, servers and databases.
During the design and implementation process of the system, the client code was designed and controlled in the MVC pattern. This template is used to improve code reusability and creates a token management mechanism for client users for user authentication and permission classification. This article focuses on the design and implementation process of the six modules of the mini program shopping system client product information display, product classification, shopping cart, order payment, personal information management and database design.

关键词:微信小程序网上购物;AJAX语言;Browse/server体系构成 
DESIGN AND IMPLEMENTATION OF ONLINE MALL
ABSTRACT
With the development of information technology and the upgrading of user consumption, traditional supermarkets, e-commerce online promotion and shopping experience have encountered bottlenecks. Unmanned supermarkets have joined the high-tech experience of consumer shopping behavior, but with this cool black technology experience, there is a high amount of store cost investment and maintenance, if the society generally replicates this model, technology and The cost threshold will be higher. Develop a wider range of applications for traditional online merchants, providing consumers with versatility and convenience. The WeChat applet is “at your fingertips” and is ideal for the low frequency needs of people in their lives. Compared with the original APP, it is more suitable for quickly improving offline demand. This article takes the shopping method of traditional community convenience store as the starting point, combines WeChat small program technology, adopts object-oriented development method, and develops a convenient and fast WeChat applet shopping system, which can facilitate consumers to carry out offline promotion and online shopping.
The system is mainly composed of WeChat applet client, server and data management terminal. The server adopts the ThinkPHP5 framework technology, the client uses the MINA framework of the WeChat applet, and the data management terminal adopts the CMS framework. The client's page implementation gets MySQL through the web and server REST API interfaces.
Mainly engaged in the design, development and testing of online shopping system clients, servers and databases.
In the design and implementation process of the system, the design and control of the MVC mode is performed on the client code. This template is used to improve code reusability and creates a token management mechanism for client users for user authentication and permission grading. This paper focuses on the design and implementation process of the six modules of the small program shopping system client product information display, product classification, shopping cart, order payment, personal information management and database design.
Key words: Online shopping; WeChat small program; Browse/server system composition 

Contents
Chapter 1 Introduction
1.1 Background and significance of project research
1.2 Analysis of domestic research status< /span> a> References  Conclusion 6.3 System testing methods 6.2 System testing rules 6.1 System Test Overview Chapter 6 Testing of WeChat Mini Program Online Shopping System 5.2 Elements used in interface design 5.1 User Operation Interface Detailed design Chapter 5 Detailed Design of WeChat Mini Program Online Shopping WeChat Mini Program 4.3 System Function Module Design 4.2 System Interface Design 4.1 Overall System Composition Design Chapter 4 Overall Design of WeChat Mini Program Online Shopping System 3.2 Database Protection of Information 3.1 Design of Data Table Chapter 3 WeChat Mini Program Online Shopping Database Design 2.2 System Requirements Analysis 2.1 Feasibility study Chapter 2 System-related technology research
1.3 Main research work of the paper



















 


Chapter 1 Introduction
The WeChat mini program online shopping system based on WeChat applet is a joint product of O2O, e-commerce and WeChat applet. It integrates WeChat applet development, ThinkPHP5 server development, database, network and other popular technologies. Consumers only need to scan the mini program code to quickly obtain store and product information, making it convenient for users to purchase goods anytime and anywhere. The addition of mini-program shopping clients has added new vitality to the development of e-commerce.
1.1 Background and significance of project research 
In recent years, with the continuous improvement of my country’s network infrastructure, the continuous development of information technology and third-party payment tools, WeChat mini programs The popularity of online shopping has become an important part of people's lives. The shopping system based on PC platform allows people to enjoy shopping without leaving home. Online shopping based on mobile phone WeChat mini programs makes portable terminals portable, allowing the public to purchase their favorite products anytime and anywhere. The emergence of community-oriented shopping model O2O combines offline business opportunities with the Internet, making the Internet a platform for offline transactions. This material purchasing system is a new e-commerce model based on the Internet, with the community as the basic unit, making full use of the community's information infrastructure, and combining small physical stores in the community with online malls. breakthrough. More emphasis on online is to meet the needs of consumers for convenience and member interactive marketing, as well as to divert traffic from physical stores. It is more convenient offline, providing users with more convenient modern smart shopping experience services.
At the same time, driven by information technology, consumption upgrades, competition and many other factors, China's retail industry has ushered in new opportunities for change, namely the "online + offline + logistics" New retail”. We are committed to promoting the process of online and offline integration and promoting the comprehensive transformation from the era of price consumption to the era of value consumption. The core of the technology is to achieve comprehensive access to consumer-centered membership, payment, inventory, services, etc. Promote the improvement of consumers' shopping experience and promote the transformation of consumers' shopping methods.
The core of new retail development is customers’ needs to meet specific shopping scenarios. Under the trends of customer informatization, technology and mobile Internet, shopping methods of fast shopping, fast delivery and fast sales are favored by users. However, for the traditional retail industry, providing offline stores with convenient WeChat mini program online shopping channels is an important way to enhance customer experience and improve retail efficiency. To this end, in recent years, domestic and foreign retailers have generally provided online and offline community purchasing combinations.
Among the mainstream WeChat mini program online shopping systems, there are mainly PC shopping systems, APP shopping systems and shopping portals that rely on third-party applications. In early 2017, the WeChat applet was officially launched, further activating the WeChat ecosystem. The biggest function of WeChat applet and local application is that users do not need to download and install, and can scan the code or search for a small program to see a platform for better offline services based on WeChat, a ready-made lightweight applet.
1.2 Analysis of domestic research status
In recent years, with the rapid development of the Internet, the popularity of mobile Internet and mobile payment has brought earth-shaking changes to people’s lives. Variety. E-commerce is also changing with the rapid development of the Internet. The popularization of intelligent applications from computer PCs to mobile phones has made people's lives more dependent on mobile phones. Large-scale APP shopping systems based on Taobao, JD.com, etc. play an important role in people's lives. The frequency of use is getting higher and higher. People can buy goods from all over the country and even the world on these large shopping APPs, which facilitates people's lives and speeds up the circulation efficiency of goods. However, with the continuous expansion of online shopping models and scope, the bottlenecks of traditional e-commerce have become increasingly apparent, such as the relative lag in logistics time and the "last mile" distribution problem. There is a big difference between the physical product received by users and the online product introduction. Problems, after-sales rights protection customers have to pay high postage and other issues. These problems degrade the user's shopping experience.
The emergence of new retail has narrowed the scope of WeChat mini-program online shopping, focusing on the combination of online and offline shopping to create more reliable and high-quality shopping services for users, which provides offline The development of large-scale supermarkets has brought new vitality and opportunities. With the development of mobile Internet, shopping methods have become more mobile and convenient, focusing on the social aspect of combining online shopping and offline shopping, and the shopping model with the help of social platforms has emerged. As the largest social platform in China, WeChat currently has one billion monthly active users. WeChat has become an important part of people's lives and interactions. The WeChat public platform launched by WeChat in August 2012 has not only formed a new media channel to obtain user traffic, but also promoted the growth of life service platforms based on WeChat public accounts, including "Meili Shuo" and "Jingdong Mall Group Purchasing" Through the operation of WeChat platform, the number of users has been greatly increased. The success of these cases shows that WeChat can well connect other life services with its social nature. On January 9, 2017, WeChat officially released the WeChat Mini Program. Zhang Xiaolong positioned the Mini Program as a lightweight application that is ready to use. As a new species that is different from the PC side and
APP side, mini programs are more suitable for connecting offline users with the help of WeChat’s massive users. For small and medium-sized traditional offline retail industries, under the second impact of new retail e-commerce, the positioning of mini programs provides an important technical driving force for their participation in this change.
1.3 Main research work of the paper
The shopping system studied in this paper is mainly an online shopping system for community residents. Combined with the new retail of small physical stores in the community, we can realize online and offline sales models covering surrounding areas and expand sales channels. The system consists of a backend server, a WeChat applet shopping client and a data management system. Since there are many system modules in the system, the main work of this article is to design and implement the interaction between the WeChat applet client and the background service and the database design. The shopping system combined with WeChat applet technology aims to combine the online and offline shopping methods of China Unicom Community Store. Users can go to the store to buy goods, check the appearance and quality of the product in person, then buy and leave when satisfied. If it is inconvenient for the user to shop in a store, the user can also obtain the WeChat applet store and purchase the WeChat applet online shopping shopping system client through the mini program, complete the entire shopping process of browsing products, adding products to the shopping cart, ordering and Settlement, user account information, shipping address can be modified, and order information can be viewed on the personal information management page of the mini program shopping system.
According to the above requirements, the entire WeChat applet shopping system project adopts B2C architecture, and the development method adopts the architectural model of server, client and data management. The server uses ThinkPHP5 and MySQL.
Build a REST API; the client implements the WeChat applet and obtains function communication data by sending http communication requests to the server API; the data management system serves as the data management background for managers or operators and passes it to server. Request data to manage product information, order data and status.
The main work of this article is to obtain user information, product information (including advertising products, special products, new products such as merchandise), product classification retrieval, shopping cart function, and orders in the WeChat applet shopping client system Payment function. , Personal information management functions (telephone, address management, etc.), order management functions, etc. This paper focuses on the design and implementation of six modules: product information display module, product classification retrieval module, shopping cart module, order payment module, personal information management module and database design.


Chapter 2 Research on System Related Technologies
2.1 WeChat Applet
WeChat applet is a new way to connect users and services. This applet provides users with a lightweight service that you can use with just the movement of your fingers. It is mainly reflected in the service concept of users obtaining and using mini programs. Users can scan the online or public number associated with the mini program code to obtain the applet application, or search for the mini program on the WeChat discovery page. Since the entire file of the mini program occupies a small memory space, the user downloads and installs the mini program. It's nearly inaudible, so getting the applet from the user to clicking start is very fast. The multi-entry access and end-of-life experience of the mini program reduce the cost of device dissemination and user acquisition. It can realize the basic functions of the native APP and is more suitable for offline life services in stores and non-urgent low-frequency. app. The MINA framework is the name of the framework provided by the WeChat team for small program development. The MINA framework provides a set of PHPScript APIs for the upper layer by encapsulating the basic functions of file system, network communication, task management and data security provided by the WeChat client. It is very convenient to quickly build applications using various basic functions and functions provided by WeChat client. In short, MINA is actually a collection of tools that make it easy to develop WeChat applets.
The framework provides its own view layer-specific description language WXML, WXSS and PHPscript-based logic layer, and provides data transmission and event mechanisms between the view layer and the logic layer. This data transfer and event mechanism is a data binding system that responds to user interaction, making it very simple to keep data and views in sync. When you need to update page data, you only need to call the corresponding method of the logic layer to return the result to the view layer.
2.2 Analysis of overall system functions
Based on the analysis of online shopping and basic shopping needs, a comparative analysis of the main functions of mobile shopping apps and PC shopping WeChat mini-programs module. There are three major principles for the development and design of small programs: From a functional point of view, small programs are more single than native apps; applet coin native apps are more concise; in terms of usage scenarios, applets should be more clear than native apps. The main positioning of this small program shopping system is the online shopping channel. For traditional community-oriented small stores, the online shopping channel is easy to spread and use. Based on the main positioning of mini programs, mini programs should be integrated with offline stores to provide users with clearer themes. The shopping service minimizes unnecessary functional modules that are not related to shopping, providing users with a convenient and fast experience. Based on the above analysis, the business logic module of the mini program shopping system is divided into user login, product information display, product classification retrieval, shopping cart, order payment, and personal information management functional modules. The entire system functional modules are shown in the figure below. Detailed requirements analysis in this chapter Will be executed for each functional module.

When a user obtains a WeChat applet, the client that enters the WeChat applet shopping system can browse to every page of the WeChat applet, regardless of whether the user is allowed to obtain WeChat avatar and nickname information, mainly when the user browses. The applet's "home page" triggers the user's ability to view items. Mainly for users to browse advertising products, browse special products, and browse new products.


Figure 2.2 User browsing product use case diagram

(1) Regardless of whether the user has obtained a WeChat avatar or nickname information or completed personal information, the user has the right to browse the product.
(2) When users enter the "Home" page of the WeChat applet, they can browse the advertising products at the top of the page, the three themed product columns, and the latest new products. Themed product columns can be transferred to special product details pages to display a matrix display of a group of products with the same theme.
(3) Advertising products can be implemented in the form of banner ads, which automatically scroll at the beginning of the page.
(4) Users can obtain the latest product information through manual pull-down operations on the page. Product details include product pictures, product names, product quantities, product prices, product inventory status, product parameters, detailed product picture display, etc. Users can select the product quantity and add products on the product details page. Go to shopping cart.

Chapter 3 WeChat Mini Program Online Shopping Database Design

The project is divided into three parts: WeChat applet client, server and data management. Its WeChat applet client part mainly uses WeChat applet (WXML, WXSS, and the rich components it provides, using the MVC design pattern to complete the client interface and feature set. Through implementation and implementation, the client can directly interact with consumer users, Provide a smooth shopping experience. The server side mainly uses ThinkPHP5 and MySQL to build a REST API to provide a data interface for the client, including using ThinkPHP5 as a service. An external framework for server development can be used to browse products using the WeChat applet shopping system. Client and database data requests and data processing are implemented in the business logic of consumer users who add shopping carts, place orders, etc. In addition to local server support, some functions implemented by the WeChat applet client also require support from the server writing industry . The API interface of the WeChat server to be implemented by logical call. MySQL mainly plays the role of a database, which can realize functions such as data storage and data table design. The MySQL database cooperates with the TP5 server to provide an accessible data interface for the client.
3.1 Database design of WeChat mini program shopping system    
Database design is the most basic and core part of software system development and construction. Good database design can make The system runs faster and better. At present, relational database is the mainstream choice for small and medium-sized systems in my country. The design of relational database must have strict design specifications to effectively organize and maintain various types of data in the software system, and provide data for the software system. It is required to provide efficient and accurate processing speed. In the process of achieving this goal, the standardized design of the database is particularly important. Maintaining the consistency and integrity of data storage is one of the important guarantees to improve the efficiency of data storage and processing. In database design , not only need to meet the design standards of the database, but also need to combine specific business knowledge to analyze the relationships between different entities in the system, and determine the types of relationships between these entities. Based on the functional requirements analysis of the mini-program shopping system, this article will According to the requirements of standard design, analyze and design the conceptual structure design, logical structure design, database configuration and implementation of database design of the mini program shopping system.
3.2 Database logical structure design
Convert the rules of the database based on the E-R diagram in the conceptual structure design, convert the E-R diagram entities and the connections between entities into relational schemas, and determine the attributes and codes in the relational schema. The attributes in the entities and the attributes in the relational schema Correspondingly, the code in the entity corresponds to the code in the relationship. The final data model of this system is presented in the form of a data table, which specifically explains the attribute names, primary keys, meanings, constraints, and whether it is empty in the data table. The main database table design in the system is detailed as follows:

Guess you like

Origin blog.csdn.net/weixin_39563171/article/details/134915055