1. 筛选弹窗组件封装
    2. 筛选弹窗内部交互实现
    3. 通过子父通信,将筛选条件传递给Job.vue组件
    4. 在Job.vue组件中,携带新的筛选条件到api/job.js中去加载新的数据

      • LeanCloud的比较查询

        1. curl -X GET \
        2. -H "X-LC-Id: 自己的id" \
        3. -H "X-LC-Key: 自己的key" \
        4. -H "Content-Type: application/json" \
        5. -G \
        6. --data-urlencode 'where={"district":{"$in":['渝中区','渝北区']}}' \
        7. https://API_BASE_URL/1.1/classes/Job
      • 逻辑代码

        1. import Vue from 'vue'
        2. let $u = Vue.prototype.$u
        3. export const getJobList=(condition,p)=>{
        4. // 处理前的条件对象
        5. // {
        6. // gender:'1',
        7. // cfytype:'2',
        8. // district:['渝中区','渝北区'],
        9. // payment:['1','2']
        10. // }
        11. // 处理后的条件对象
        12. // {
        13. // gender:'1',
        14. // cfytype:'2',
        15. // district:{"$in":['渝中区','渝北区']},
        16. // payment:{"$in":['1','2']}
        17. // }
        18. for(let attr in condition){
        19. if(attr=='district'||attr=='payment'){
        20. condition[attr] = {"$in":condition[attr]}
        21. }
        22. }
        23. let wh = JSON.stringify(condition) //整合查询条件
        24. let url = `/1.1/classes/Job?where=${wh}&limit=10&skip=${p*10}`
        25. return $u.get(url)
        26. }