< /p>
How do you combine multiple filtering functions like Taobao? I have now implemented the function of combining and filtering by clicking on conditions in the big red box, but how do I combine the input box and the price conditions inside with the conditions outside? For example, I want to filter women’s electronic watches in the price range of 500-1000, and I’m looking for ideas. Thank you
ringa_lee2017-05-16 13:15:41
Your question is whether the front-end is implemented or the server is implemented. I guess it is the front-end implementation.
Then this query condition can be used to filter table data directly using get
方式,比如用户点击 手表,JavaScript
中监听所有类别的点击事件,然后在当前 url
followed by the corresponding field name and field value of watch to jump.
Similarly for the price, the operation logic when clicking the OK button is the same as clicking the Watch.
Taobao does not combine various filtering conditions at once and then query. Instead, click on a certain filtering condition to perform a filter refresh.
曾经蜡笔没有小新2017-05-16 13:15:41
Generally, parameters are passed through get method for filtering. After entering the price, there should be a confirm button. When clicking the confirm button, use js to get the current link, and then assemble the price link to jump.
我想大声告诉你2017-05-16 13:15:41
Use sql to combine where conditions to query the database, and then return the queried data to the front end
世界只因有你2017-05-16 13:15:41
Your question is a bit strange. There is essentially no difference between clicking and typing. They are both part of the form.
As for how to check the database, you need to formulate sql according to your table structure.
However, to achieve this function, you generally need to use a search engine. It is not very good to directly check the database, and it is too stressful.