Frontend development-preliminary business logic of the comment area on the playback page -- logic
1. This time mainly involves data interaction between the front and back ends.
Jquery Tutorial:
Http://www.w3school.com.cn/jquery/index.asp
2. Engineering address: https://github.com/digitalClass/web_page
Website publishing address: http: // 115.28.30.25: 8029/
3. Business Logic description:
The preliminary assumption is as follows:
After the user clicks submit, the front-end will post the comment content and user userid to the backend,
The currently scheduled route is/Addcomments /,Modifiable
In addition to some data provided by the backend at the beginning,
Backend needs are also involvedLogin User's UseridAndLogin UserUsernameThese two attributes enable the front-end to display data after submission.
The backend needs to return a json data structure:
If the successful code is marked as 0 and the code is not 0, the front-end considers the submission failed.
Shape:
{'Code': 0}
At the same time, the backend can return a msg field to indicate the error message \
Shape:
{'Msg ': "Unknown error "}
4. Display Results
Comment page
Error message:
Dynamic comment loading effect: