service.js 1.5 KB

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