vod.js 1.4 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162
  1. // LocalAddress = "http://192.168.29.156:8099"
  2. import * as Utils from "./utils.js";
  3. export class VodShort {
  4. constructor() {
  5. this.vod_id = "" //id
  6. this.vod_name = "" //名称
  7. this.vod_pic = Utils.RESOURCEURL + "/resources/ali.jpg" //图片
  8. this.vod_remarks = "" //备注
  9. }
  10. to_dict() {
  11. return JSON.stringify(this);
  12. }
  13. load_dic(json_str) {
  14. let obj = JSON.parse(json_str)
  15. for (let propName in obj) {
  16. this[propName] = obj[propName];
  17. }
  18. }
  19. load_data(data) {
  20. for (let propName in JSON.parse(this.to_dict())) {
  21. this[propName] = data[propName];
  22. }
  23. }
  24. }
  25. export class VodDetail extends VodShort {
  26. constructor() {
  27. super();
  28. this.type_name = "" // 类别
  29. this.vod_year = "" // 年份
  30. this.vod_area = "" // 地区
  31. this.vod_actor = "" // 导演
  32. this.vod_director = "" // 演员
  33. this.vod_content = "" // 剧情
  34. this.vod_play_from = "" // 播放格式
  35. this.vod_play_url = "" // 播放连接
  36. }
  37. to_short() {
  38. let vodShort = new VodShort()
  39. vodShort.load_dic(this.to_dict())
  40. return vodShort
  41. }
  42. load_dic(json_str) {
  43. let obj = JSON.parse(json_str)
  44. for (let propName in JSON.parse(this.to_dict())) {
  45. this[propName] = obj[propName];
  46. }
  47. }
  48. }