原始JS.js 2.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990
  1. function init(ext) {
  2. console.log('init');
  3. }
  4. function home(filter) {
  5. console.log("home");
  6. let classes = [];
  7. classes.push({
  8. 'type_id': 'test',
  9. 'type_name': '测试分类'
  10. });
  11. let res = {
  12. 'class': classes
  13. };
  14. return JSON.stringify(res);
  15. }
  16. function homeVod(params) {
  17. console.log("homeVod");
  18. let d = [];
  19. d.push({
  20. vod_name:'测试',
  21. vod_id:'index.html',
  22. vod_pic:'https://gitee.com/CherishRx/imagewarehouse/raw/master/image/13096725fe56ce9cf643a0e4cd0c159c.gif',
  23. vod_remarks:'原始JS',
  24. });
  25. return JSON.stringify({
  26. list:d
  27. })
  28. }
  29. function category(tid, pg, filter, extend) {
  30. console.log("category");
  31. let d = [];
  32. d.push({
  33. vod_name:'测试',
  34. vod_id:'index.html',
  35. vod_pic:'https://gitee.com/CherishRx/imagewarehouse/raw/master/image/13096725fe56ce9cf643a0e4cd0c159c.gif',
  36. vod_remarks:'类型:'+tid,
  37. });
  38. return JSON.stringify({
  39. list:d
  40. })
  41. }
  42. function detail(vod_url) {
  43. console.log("detail");
  44. let vod = {
  45. // vod_id:id,
  46. vod_name:'测试二级',
  47. type_name:vod_url,
  48. vod_pic:'https://gitee.com/CherishRx/imagewarehouse/raw/master/image/13096725fe56ce9cf643a0e4cd0c159c.gif',
  49. vod_content:'这是一个原始js的测试案例',
  50. vod_play_from:'测试线路1$$$测试线路2',
  51. vod_play_url:'选集播放1$1.mp4#选集播放2$2.mp4$$$选集播放3$3.mp4#选集播放4$4.mp4',
  52. };
  53. return JSON.stringify({
  54. list: [vod]
  55. })
  56. }
  57. function play(flag, id, flags) {
  58. console.log("play");
  59. return '{}'
  60. }
  61. function search(wd, quick) {
  62. console.log("search");
  63. let d = [];
  64. d.push({
  65. vod_name:wd,
  66. vod_id:'index.html',
  67. vod_pic:'https://gitee.com/CherishRx/imagewarehouse/raw/master/image/13096725fe56ce9cf643a0e4cd0c159c.gif',
  68. vod_remarks:'测试搜索',
  69. });
  70. return JSON.stringify({
  71. list:d
  72. })
  73. }
  74. // 导出函数对象
  75. export default {
  76. init: init,
  77. home: home,
  78. homeVod: homeVod,
  79. category: category,
  80. detail: detail,
  81. play: play,
  82. search: search,
  83. }