About Egret modular development-vip System, egret modularization-vip

Source: Internet
Author: User

About Egret modular development-vip System, egret modularization-vip
Modular development of Egret-vip System

Directory

Modular development of Egret --- vip system... 1

Preface... 1

1. Build the interface... 1

2. Create a data model... 3

1) Data Model Establishment: 3

2) Data creation... 4

3) add, delete, modify, and query data... 7

3. interaction, 7

End... 8

 

 

Preface

Playing games is about data and data model design. It is a basic design to experience mvc. It uses data to drive interface changes ..

As a program, you must learn the requirements of modularization, configuration, and scripting, and guard against the possibility of planned demand changes.

For example, to create a VIP System:

 

1. Build the interface

1) create a VIPWindow. ts class and associate it with VIPWindownSkin skin.

2) drag the skin to build the following interface.

3) and give the ID of the component to be interacted or used.

 

 

2. Establish a data model

Data Model = [model building, data creation, and general data management (add, delete, modify, and query )]

 

1) Data Model Construction:

1. Data Models are generally data structures.

2. create a VIPItemVO instance and define the required attributes. This class contains all the data of the vip level. that is to say, 20 VIP levels are created for this class 20 times. then press the corresponding data.

 

2) Data creation

Data creation requires a data class (VIPitemVO) and a data management class (add, delete, modify, and query data VIPManager)

VIPitemVO class


 

VIPManager class

 

 

1. When a number table is obtained, it takes a long time to convert it into a json file.

The decoding process is complicated because it is not lightweight enough. That is why excel Data is migrated to json.

Here we define it as the vip_json File

 

 

2. Move the data in the JSON file to an array to facilitate frontend and backend data calling.

First, obtain the entire json file and press vipData.

 

After this operation, we can call it like this.

Console. log (this. vipDataVO [I]. lv );;

Now, our data model has been created.

 

3) add, delete, modify, and query data

 

3. interaction,

Use Data to drive interface changes, that is, data operations.

The VIP System is nothing more than a query ,.

First, let's take a look. The button to be clicked is the changed component image, text. and so on. as long as the component is changed, name it an ID, and we can operate the event according to the ID.

The following simple interaction will not be explained in detail.

 

End

This simple VIP system is ready for reading.

As a program, you must learn the requirements of modularization, configuration, and scripting, and guard against the possibility of planned demand changes.

Try to simplify one thing. a vip system has a single interface. It is a system for viewing VIP-related data. This step is implemented first, and you are thinking about recharging later.

I personally think that no matter what system you do, you should first simply expand the functions, which is more conducive to writing code.

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.