utils.js 1.2 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950
  1. /**
  2. * @description: roobo 工具类js
  3. * @author: libaojun@roo.bo
  4. * @version: V2
  5. * @update: 16/4/19
  6. **/
  7. /**
  8. utils.js 通用工具方法js里的方法列表
  9. */
  10. var utils = {
  11. pagesize:10,
  12. getList:function(){ //拿到设备播放列表,return设备播放列表数据
  13. var playtracklist;
  14. $.ajax({
  15. url :juli.URL.getplaytracklist,
  16. type:'get',
  17. async:false,
  18. cache:false,
  19. data:{
  20. deviceId:utils.getdevice()
  21. }
  22. })
  23. .done(function(res){
  24. console.log(res);
  25. playtracklist =res;
  26. })
  27. return playtracklist
  28. },
  29. postList:function(){ //创建播放列表
  30. var newjson = {
  31. id:0,
  32. deviceId: utils.getdevice(),
  33. name:"默认列表",
  34. coverSmallUrl:""
  35. };
  36. console.log(newjson)
  37. $.ajax({
  38. url: juli.URL.addlist,
  39. type: 'post',
  40. contentType: 'application/json',
  41. data: JSON.stringify(newjson)
  42. })
  43. .done(function(res){
  44. console.log(res);
  45. });
  46. }
  47. };