hPutiManage.js 1.7 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182
  1. var _this;
  2. var baseTok = null, heAnth = null;
  3. var loading;
  4. new Vue({
  5. el: '#app',
  6. filters: {
  7. setTime(_key){
  8. let _sf = getDTime(new Date((_key+"").length>10?parseInt(_key):parseInt(_key)*1000));
  9. return _sf[0] + _sf[1];
  10. }
  11. },
  12. data: function() {
  13. return {
  14. nowTab: {},
  15. pictureLi: [],
  16. showPreview: false,
  17. imagePreview: []
  18. }
  19. },
  20. created:function(){
  21. _this = this;
  22. heAnth = JSON.parse(localStorage.getItem("nowShip"));
  23. _this.initAjax();
  24. },
  25. methods: {
  26. initAjax(){
  27. if(heAnth !=null && heAnth != "null"&&heAnth.other_info !=null && heAnth.other_info != ""){
  28. loading = _this.$toast({
  29. type: 'loading',
  30. loadingType: 'spinner',
  31. duration: 0
  32. });
  33. var dsd = heAnth.other_info.split(",");
  34. let _opts = {
  35. url: helUrl + "/index.php?ctl=bruce&act=get_group_member_list",
  36. type:"POST"
  37. };
  38. let _data = {
  39. admin_id: 7903,
  40. udid: "11111111",
  41. g_id: dsd[0]
  42. };
  43. postAxios(_opts, _data, {}).then((res) =>{
  44. if(res.status){
  45. let _obj = res.data;
  46. _this.nowTab = _obj.filter(item => item.device_id == dsd[1])[0];
  47. _this.getPlay();
  48. }else{
  49. _this.pictureLi = [];
  50. }
  51. loading.close();
  52. })
  53. }else{
  54. _this.pictureLi = [];
  55. }
  56. },
  57. getPlay(){
  58. let _opts = {
  59. url: helUrl + "/index.php?ctl=report&act=get_user_image",
  60. type:"POST"
  61. };
  62. let _data = {
  63. user_id: _this.nowTab.user_id,
  64. p: 1
  65. };
  66. postAxios(_opts, _data, {}).then((res) =>{
  67. if(res.status){
  68. _this.pictureLi = res.data;
  69. }else{
  70. _this.pictureLi = [];
  71. }
  72. })
  73. },
  74. previewImg(kyt){
  75. _this.showPreview = true;
  76. _this.imagePreview = [kyt];
  77. },
  78. goBack(){
  79. top.location.href = "../mainPh.html?sn=3";
  80. }
  81. }
  82. })