service.js 1.3 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849
  1. $(function() {
  2. vm = new Vue({
  3. el: "#app",
  4. data: {
  5. company: '',
  6. bottom: '',
  7. statement: '',
  8. servicesList:[]
  9. }
  10. ,
  11. created() {
  12. var datas = {
  13. };
  14. var ajaxUrl = 'http://lanbo.frp.liuniu946.com/apis/product';
  15. AJAX('get', ajaxUrl, datas, function(res) {
  16. vm.statement = res.data.list.filter(item => item.category_ids == "65")
  17. console.log(vm.statement)
  18. })
  19. var ajaxUrl = 'http://lanbo.frp.liuniu946.com/apis/product';
  20. AJAX('get', ajaxUrl, datas, function(res) {
  21. vm.bottom = res.data.list.filter(item => item.category_ids == "64")
  22. console.log(vm.bottom)
  23. })
  24. var ajaxUrl = 'http://lanbo.frp.liuniu946.com/apis/product';
  25. AJAX('get', ajaxUrl, datas, function(res) {
  26. vm.servicesList = res.data.list.filter(item => item.category_ids == "45")
  27. console.log(vm.servicesList)
  28. })
  29. },
  30. // var ajaxUrl = 'http://lanbo.frp.liuniu946.com/apis/about/10';
  31. // AJAX('get',ajaxUrl,datas,function(res){
  32. // console.log(res)
  33. // vm.company = res.data.content;
  34. // })
  35. methods:{
  36. dianji(item) {
  37. // debugger
  38. console.log(item);
  39. //存储这个localStronge,存储的是点击的这个内容的id,在需要展示的详情页去接收
  40. localStorage.setItem('id',item);
  41. }
  42. }
  43. });
  44. })