require('../common/vendor.js');(global["webpackJsonp"]=global["webpackJsonp"]||[]).push([["plugin/digitalHumans/videoManager"],{"151a":function(e,t,n){"use strict";n.r(t);var o=n("4f2f"),i=n.n(o);for(var s in o)["default"].indexOf(s)<0&&function(e){n.d(t,e,(function(){return o[e]}))}(s);t["default"]=i.a},1777:function(e,t,n){"use strict";var o=n("6dce"),i=n.n(o);i.a},"4f2f":function(e,t,n){"use strict";(function(e){var o=n("47a9");Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var i=o(n("7ca3")),s=(n("3240"),n("8f59"));function r(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(e);t&&(o=o.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,o)}return n}var c={name:"VideoManager",data:function(){return{videoList:[],showCreate:!1,showPlayer:!1,createForm:{title:"",url:""},currentVideo:{},playingIndex:null}},onLoad:function(){if(!this.is_login)return this.$util.authLogin();this.getVideoList()},onPullDownRefresh:function(){this.getVideoList()},computed:function(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?r(Object(n),!0).forEach((function(t){(0,i.default)(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):r(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}({},(0,s.mapGetters)(["is_login"])),methods:{showCreateModal:function(){this.showCreate=!0},closeCreateModal:function(){this.showCreate=!1,this.createForm={title:"",url:""}},showVideoPlayer:function(e,t){this.currentVideo=e,this.playingIndex=t,this.showPlayer=!0},closeVideoPlayer:function(){this.showPlayer=!1,this.playingIndex=null,this.currentVideo={}},chooseFile:function(){var t=this;e.chooseVideo({extension:[".mp4",".avi",".mov"],compressed:!1,success:function(e){if(e.size>314572800)t.toast("文件大小不能超过300MB");else{var n=e.width,o=e.height;n<640||o<640||n>2048||o>2048?t.toast("视频边长需介于640-2048之间"):(t.createForm.url=e.name,t.uploadRequest((function(e){t.createForm.url=e.fullurl}),e.tempFilePath))}},fail:function(e){e.errMsg.includes("cancel")||t.toast(e.errMsg||"选择文件失败")}})},uploadRequest:function(e,t){var n=this;this.$util.upload("common/upload",{filePath:t}).then((function(t){1==t.code?e&&e(t.data):n.toast(t.message||t.msg)})).catch((function(e){n.toast("上传失败")}))},createVideo:function(){var t=this;this.createForm.title?this.createForm.url?this.$util.post("shuziren/shuziren/createVideo",this.createForm).then((function(e){1==e.code?t.toast(e.message,1500,(function(){t.closeCreateModal(),t.getVideoList()})):t.toast(e.message||"创建失败",1500)})).catch((function(e){t.toast("创建失败",1500)})):e.showToast({title:"请选择视频文件",icon:"none"}):e.showToast({title:"请输入视频标题",icon:"none"})},getVideoList:function(){var t=this;this.$util.get("shuziren/shuziren/getVideoList").then((function(n){e.stopPullDownRefresh(),1==n.code?t.videoList=n.data.list||[]:e.showToast({title:n.message||"获取列表失败",icon:"none"})})).catch((function(t){e.stopPullDownRefresh(),e.showToast({title:"获取列表失败",icon:"none"})}))},onVideoEnded:function(){this.playingIndex=null},onVideoPause:function(){},onVideoPlay:function(){},deleteVideo:function(t,n){var o=this;e.showModal({title:"确认删除",content:"确定要删除这个视频吗？",success:function(i){i.confirm&&o.$util.post("shuziren/shuziren/deleteVideo",{id:t.id}).then((function(t){1==t.code?(o.getVideoList(),o.playingIndex===n&&o.closeVideoPlayer()):e.showToast({title:t.message||"删除失败",icon:"none"})})).catch((function(t){e.showToast({title:"删除失败",icon:"none"})}))}})}}};t.default=c}).call(this,n("df3c")["default"])},"55e9":function(e,t,n){"use strict";n.d(t,"b",(function(){return i})),n.d(t,"c",(function(){return s})),n.d(t,"a",(function(){return o}));var o={uIcon:function(){return Promise.all([n.e("common/vendor"),n.e("uni_modules/uview-ui/components/u-icon/u-icon")]).then(n.bind(null,"b248"))},uPopup:function(){return Promise.all([n.e("common/vendor"),n.e("uni_modules/uview-ui/components/u-popup/u-popup")]).then(n.bind(null,"7d68"))},loginModal:function(){return Promise.all([n.e("common/vendor"),n.e("components/login-modal/login-modal")]).then(n.bind(null,"e34a"))}},i=function(){var e=this.$createElement,t=(this._self._c,this.videoList.length),n=this.videoList.length;this.$mp.data=Object.assign({},{$root:{g0:t,g1:n}})},s=[]},"6dce":function(e,t,n){},"99f3":function(e,t,n){"use strict";(function(e,t){var o=n("47a9");n("4c1a");o(n("3240"));var i=o(n("ac6f"));e.__webpack_require_UNI_MP_PLUGIN__=n,t(i.default)}).call(this,n("3223")["default"],n("df3c")["createPage"])},ac6f:function(e,t,n){"use strict";n.r(t);var o=n("55e9"),i=n("151a");for(var s in i)["default"].indexOf(s)<0&&function(e){n.d(t,e,(function(){return i[e]}))}(s);n("1777");var r=n("828b"),c=Object(r["a"])(i["default"],o["b"],o["c"],!1,null,"15f06e05",null,!1,o["a"],void 0);t["default"]=c.exports}},[["99f3","common/runtime","common/vendor"]]]);