Home  >  Article  >  Backend Development  >  How to display product details in app

How to display product details in app

WBOY
WBOYOriginal
2016-10-10 11:56:251356browse

A product has product details, which are generally saved as HTML using a rich text editor in the background.
What I want to ask is, how should I provide the interface? Which of the following methods is better?
1. Save product details in the background, use all pictures, and save them as a picture array. When returning to the interface, return an array of all pictures, so that on the app side, one picture can be displayed row by row;
2 .Use a rich text editor in the background, save it, and then write an h5 adaptive page to display these html contents. The return interface is directly given to an h5 web page, so that the app can directly load the web page to the designated area

Which method is suitable?

Reply content:

A product has product details, which are generally saved as HTML using a rich text editor in the background.
What I want to ask is, how should I provide the interface? Which of the following methods is better?
1. Save product details in the background, use all pictures, and save them as a picture array. When returning to the interface, return an array of all pictures, so that on the app side, one picture can be displayed row by row;
2 .Use a rich text editor in the background, save it, and then write an h5 adaptive page to display these html contents. The return interface is directly given to an h5 web page, so that the app can directly load the web page to the designated area

Which method is suitable?

The first method of using pure images has many disadvantages

  1. The size of the picture is larger than the text. When the network is not good, the picture cannot be loaded and you cannot see it at all, and the experience is very poor

  2. Pictures may be distorted when scaled at different resolutions, or may even be deformed if not processed properly

  3. Editing is also very troublesome, you have to pay attention to the quality, size and format of the picture, etc.

  4. Pictures cannot be subdivided and interacted, for example, you cannot simply click on the product name to jump

The second type of H5 is generally a temporary solution used when in a hurry. The experience is also very poor, and the interaction between H5 and native is also a problem. And I see that your description is not about writing H5 pages for mobile devices. The effect Worse.

The two methods you mentioned depend on your needs. If the product details page has no interaction at all, pure pictures are better than "adaptive H5 pages".

The best way is to mix native and H5 pages. Use native controls for fixed controls on the details page. The backend interface only provides control content, such as product names, image URLs, etc. Use H5 pages for content that changes more

The first practical graphic solution

The pictures used for details are just for display. If there are other operations, use native controls

Personally, I think the first method is better.
Because it is difficult to guarantee that the style displayed on the APP will not change.
If you handle it in the second way, if the APP is revised and the front-end display is re-layout, then it will be troublesome to deal with the old data.

Definitely use the first method as it has stronger plasticity

2. Use a rich text editor in the background, save it, and then write an h5 adaptive page to display these html contents. The return interface is directly given to an h5 web page, so that the app can directly load the web page to the designated area

Statement:
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn