Currently developing the business logic of the search page. Since I rarely made interfaces before, the business logic is a bit unclear now. I hope the master can talk about the specific business logic and solve my concerns (such as sales sorting: how to achieve ascending and descending order, do you use variables to control whether the user clicks in ascending or descending order? Do you need to go to the backend request every time you click? One interface?).
The interface documentation is as follows:
Every time you want to request the interface from the background, such as sales volume, this changes in real time, and the data may change the next time you request it. For price sorting, if the first time is ascending order and the next time is descending order, when the amount of data is only one page, it can be sorted locally. However, when the amount of data exceeds one page and the rest of the data has not been obtained, the locally sorted data will be wrong. Yes.
If you just ask whether you want to go to the backend to request the interface, then the answer is "yes"
When requesting the backend, add order when reading the database. If you only want to sort by a single item, you can add a val to each button and pass it to the backend. The backend will determine what sorting it is and then order to read the database