| 1 |
- (window.webpackJsonp=window.webpackJsonp||[]).push([[53],{1009:function(e,t,o){"use strict";o.r(t);o(413),o(22),o(6),o(49),o(63),o(418),o(180),o(40),o(24),o(93),o(743),o(744),o(745),o(746),o(747),o(748),o(749),o(750),o(751),o(752),o(753),o(754),o(755),o(756),o(757),o(758),o(759),o(760),o(761),o(762),o(763),o(764),o(765),o(766),o(767),o(768);var l={layout:"video",data:function(){return{isRirst:!0,uploadUrl:"",uploadImage:"",file:"",videoPath:"",videoUrl:"",coverUrl:"",imgUrl:"",title:"",category_id:"",limit:0,showBox:!1,is_show_cate:!1,isNeedGoods:!1,categoryList:[],inputKeyword:"",good_id:"",chooseGoods:null,showGoods:null,show_good_id:"",per_page:15,total:0,page:1,goodList:[]}},mounted:function(){this.uploadUrl=this.fun.getRealUrl("plugin.video-share.frontend.upload.uploadAudio",{}),this.uploadImage=this.fun.getRealUrl("upload.uploadPic",{}),this.getPermission(),this.getList()},components:{pagination:o(716).default},methods:{getList:function(){var e=this;this.fun.$get("plugin.video-share.frontend.set.getLimit",{validate_page:1}).then((function(t){1==t.result?(e.is_show_cate="1"==t.data.is_show_cate,e.is_show_cate&&e.getCategory(),e.isNeedGoods=1==t.data.select_goods,e.fun.isTextEmpty(t.data.limit)?e.limit=60:e.limit=t.data.limit):e.$message.error(t.msg)}))},getPermission:function(){var e=this;this.fun.$get("plugin.video-share.frontend.permission.verify").then((function(t){1==t.result?t.data.ret||(e.$router.push(e.fun.getUrl("videoList",{})),e.$message.error(t.msg)):e.$message.error(t.msg)}))},getCategory:function(){var e=this;this.fun.$get("plugin.video-share.frontend.video.getCategory",{},"...").then((function(t){1==t.result?e.categoryList=t.data:e.$message.error(t.msg)})).catch((function(e){console.error(e)}))},beforeUpload:function(e){var t=e.raw;if(!(t.name.endsWith(".mp4")||t.name.endsWith(".MP4")||t.name.endsWith(".mov")||t.name.endsWith(".MOV")))return this.$message.error("请上传MP4或MOV格式视频"),!1;this.videoUrl=null;var o=null;null!=window.createObjectURL?o=window.createObjectURL(t):null!=window.URL?o=window.URL.createObjectURL(t):null!=window.webkitURL&&(o=window.webkitURL.createObjectURL(t)),this.videoUrl=o},handleVideoSuccess:function(e){var t=this;1==e.result?(this.videoPath=e.data.audio_url,this.file=e.data.file_name,this.$refs.upload.clearFiles(),this.uploadImageM().then((function(e){t.imgUrl=e}))):this.$message.error(e.msg)},handleSuccess:function(e){1==e.result?this.imgUrl=e.data.img_url:this.$message.error(e.msg)},isDuration:function(){var e=this.$refs.video;this.duration=e.duration,this.duration<1?(this.deleteVideo(),this.$message.error("视频时长太短了!")):this.duration>Number(this.limit)+1&&(this.deleteVideo(),this.$message.error("视频时长不能超过".concat(this.limit,"秒")))},captureImage:function(){if(this.videoUrl){var e=this.$refs.video,canvas=document.createElement("canvas");canvas.width=1*e.videoWidth,canvas.height=1*e.videoHeight,canvas.getContext("2d").drawImage(e,0,0,canvas.width,canvas.height),this.coverUrl=canvas.toDataURL("image/png"),this.$refs.upload.submit()}},dataURItoBlob:function(e){for(var t=atob(e.split(",")[1]),o=e.split(",")[0].split(":")[1].split(";")[0],l=new ArrayBuffer(t.length),d=new Uint8Array(l),i=0;i<t.length;i++)d[i]=t.charCodeAt(i);return new Blob([l],{type:o})},deleteVideo:function(){this.videoUrl=null,this.videoPath="",this.imgUrl="",this.$refs.upload.clearFiles()},uploadImageM:function(){var e=this;return new Promise((function(t,o){var l=new FormData;l.append("file",e.dataURItoBlob(e.coverUrl)),e.fun.$post(e.fun.getRealUrl("upload.uploadPic"),l,"loading","",{headers:{"Content-Type":"multipart/form-data"}}).then((function(e){1==e.result?t(e.data.img_url):(o(""),console.log("上传出错"))})).catch((function(){o(""),console.log("上传出错")}))}))},openGood:function(e){var t=this;this.showGoods&&(this.chooseGoods=JSON.parse(JSON.stringify(this.showGoods)),this.good_id=this.showGoods.id),this.inputKeyword?this.toSearch(e):this.fun.$get("plugin.video-share.frontend.goods.getRecommendGoods",{page:e.page},"load").then((function(e){1==e.result?(t.goodList=e.data.list.data,t.total=e.data.list.total,t.per_page=e.data.list.per_page,t.page=e.data.list.current_page,t.showBox=!0):t.$message.error(e.msg)}))},toSearch:function(e){var t=this;this.fun.$get("plugin.video-share.frontend.goods.getGoodsByKeyword",{page:e.page,keyword:this.inputKeyword}).then((function(e){1==e.result?(t.goodList=e.data.list.data,t.total=e.data.list.total,t.per_page=e.data.list.per_page,t.page=e.data.list.current_page,t.showBox=!0):t.$message.error(e.msg)}))},chooseGood:function(e){this.chooseGoods=e,this.good_id=this.chooseGoods.id},sureGood:function(){this.showGoods=JSON.parse(JSON.stringify(this.chooseGoods)),this.show_good_id=this.showGoods.id,this.showBox=!1},deleteGood:function(){this.showGoods=null,this.show_good_id=""},publishVideo:function(){var e=this;if(this.fun.isTextEmpty(this.title))this.$message.error("请输入4-18个字标题");else if(this.title.length<4)this.$message.error("标题不小于4个字");else if(this.fun.isTextEmpty(this.videoPath))this.$message.error("请选择视频进行上传!");else if(this.fun.isTextEmpty(this.imgUrl))this.$message.error("请选择一张图片作为视频封面图!");else if(!this.isNeedGoods||this.show_good_id){if(this.isRirst){this.isRirst=!1;var t={goods_id:this.show_good_id,title:this.title,video:this.videoPath,cover:this.imgUrl,file_name:this.file};this.is_show_cate&&(t.category_id=this.category_id||0),this.fun.$post("plugin.video-share.frontend.video.sub",t).then((function(t){e.isRirst=!0,1===t.result?(e.$message.success(t.msg),"1"==t.data.style_type?e.$router.push(e.fun.getUrl("videoList",{from:"release"})):e.$router.push(e.fun.getUrl("videoDetail",{activeType:"default"}))):e.$message.error(t.msg)}),(function(t){e.isRirst=!0,console.log(t)}))}}else this.$message.error("请选择商品!")}}},d=(o(901),o(1)),component=Object(d.a)(l,(function(){var e=this,t=e.$createElement,o=e._self._c||t;return o("div",{staticClass:"video"},[o("div",{staticClass:"video-box"},[o("div",{staticClass:"input-box"},[o("input",{directives:[{name:"model",rawName:"v-model",value:e.title,expression:"title"}],attrs:{type:"text",title:"",placeholder:"请输入标题"},domProps:{value:e.title},on:{input:function(t){t.target.composing||(e.title=t.target.value)}}})]),e._v(" "),o("div",{staticClass:"upload-video-box"},[o("el-upload",{ref:"upload",staticClass:"upload-demo",attrs:{accept:"video/*","auto-upload":!1,drag:"",action:e.uploadUrl,"on-change":e.beforeUpload,"on-success":e.handleVideoSuccess,"show-file-list":!1}},[e.videoUrl?e._e():[o("i",{staticClass:"el-icon-upload"}),e._v(" "),o("div",{staticClass:"el-upload__text"},[o("div",{staticClass:"upload-video-title"},[o("i",{staticClass:"iconfont icon-fontclass-shangchuan"}),e._v("点击或直接将视频文件拖入此区域")]),e._v(" "),o("span",[e._v("视频不应超过"+e._s(e.limit)+"秒")])])],e._v(" "),o("video",{directives:[{name:"show",rawName:"v-show",value:e.videoUrl,expression:"videoUrl"}],ref:"video",staticStyle:{background:"#fff"},attrs:{preload:"metadata",controlslist:"nodownload",width:"100%",height:"210px","custom-cache":"false",controls:"","webkit-playsinline":"true","x5-video-player-type":"h5",playsinline:"","x5-playsinline":"","x5-video-orientation":"portrait","x5-video-player-fullscreen":"",autoplay:"autoplay",src:e.videoUrl,id:"video"},on:{loadedmetadata:e.isDuration,loadeddata:e.captureImage}},[o("source",{attrs:{src:e.videoUrl,type:"video/ogg"}}),e._v(" "),o("source",{attrs:{src:e.videoUrl,type:"video/mp4"}}),e._v(" "),o("source",{attrs:{src:e.videoUrl,type:"video/webm"}}),e._v("\n 你的浏览器不支持video标签!\n ")]),e._v(" "),o("i",{directives:[{name:"show",rawName:"v-show",value:e.videoUrl,expression:"videoUrl"}],staticClass:"iconfont icon-fontclass-shanchu",on:{click:function(t){return t.stopPropagation(),e.deleteVideo.apply(null,arguments)}}})],2)],1),e._v(" "),o("div",{staticClass:"upload-box"},[e._m(0),e._v(" "),o("div",{staticStyle:{margin:"10px"}},[o("el-upload",{staticClass:"avatar-uploader",attrs:{"on-success":e.handleSuccess,accept:"image/*",action:e.uploadImage,"show-file-list":!1}},[e.imgUrl?o("img",{staticClass:"avatar",attrs:{src:e.imgUrl}}):o("i",{staticClass:"el-icon-plus avatar-uploader-icon"})])],1)]),e._v(" "),e.is_show_cate?o("div",{staticClass:"upload-box"},[o("div",{staticClass:"title"},[e._v("选择分类")]),e._v(" "),o("div",{staticStyle:{margin:"10px"}},[o("el-select",{attrs:{filterable:"",placeholder:"请选择"},model:{value:e.category_id,callback:function(t){e.category_id=t},expression:"category_id"}},e._l(e.categoryList,(function(e){return o("el-option",{key:e.id,attrs:{label:e.name,value:e.id}})})),1)],1)]):e._e(),e._v(" "),e.isNeedGoods?o("div",{staticClass:"upload-box"},[o("div",{staticClass:"title",staticStyle:{display:"flex"}},[e._m(1),e._v(" "),o("el-button",{attrs:{type:"primary",size:"mini",plain:""},on:{click:function(t){return e.openGood({page:1})}}},[e._v("选择商品")])],1),e._v(" "),e.show_good_id?o("div",{staticClass:"goods-list-box"},[o("div",{staticClass:"goods-item"},[o("img",{staticClass:"good-img",attrs:{src:e.showGoods.thumb,alt:""}}),e._v(" "),o("div",{staticClass:"good-right"},[o("p",{staticClass:"good-title"},[e._v(e._s(e.showGoods.title))]),e._v(" "),o("p",{staticStyle:{display:"flex"}},[o("span",{staticClass:"price"},[e._v("¥"+e._s(e.showGoods.price))]),e._v(" "),o("span",{staticClass:"old-price"},[e._v("¥"+e._s(e.showGoods.market_price))])])]),e._v(" "),o("i",{staticClass:"iconfont icon-fontclass-shanchu",on:{click:function(t){return t.stopPropagation(),e.deleteGood.apply(null,arguments)}}}),e._v(" "),o("i",{staticClass:"iconfont icon-fontclass-tihuan",on:{click:function(t){return t.stopPropagation(),e.openGood({page:1})}}})])]):e._e()]):e._e()]),e._v(" "),o("div",{staticStyle:{height:"60px"}}),e._v(" "),o("div",{staticClass:"bottom-box"},[o("div",{staticClass:"publish-btn",on:{click:e.publishVideo}},[e._v("发布")])]),e._v(" "),o("el-dialog",{attrs:{title:"商品列表",visible:e.showBox,width:"700px"},on:{"update:visible":function(t){e.showBox=t}}},[o("p",{staticClass:"search-box"},[o("el-input",{attrs:{placeholder:"搜索"},nativeOn:{keyup:function(t){return!t.type.indexOf("key")&&e._k(t.keyCode,"enter",13,t.key,"Enter")?null:e.toSearch({page:1})}},model:{value:e.inputKeyword,callback:function(t){e.inputKeyword=t},expression:"inputKeyword"}},[o("template",{slot:"append"},[o("el-button",{staticClass:"btn-search",on:{click:function(t){return e.toSearch({page:1})}}},[e._v("搜索商品标题")])],1)],2)],1),e._v(" "),o("div",{staticClass:"level-box"},e._l(e.goodList,(function(t){return o("div",{key:t.id,staticClass:"good-item flex",class:{levelActive:t.id==e.good_id},on:{click:function(o){return e.chooseGood(t)}}},[o("div",{staticClass:"radio_button",class:[t.id==e.good_id?"radio":""]}),e._v(" "),o("img",{staticClass:"good-item-img",attrs:{src:t.thumb,alt:""}}),e._v(" "),o("div",{staticClass:"good-item-right flex"},[o("p",{staticClass:"level-good-title"},[e._v(e._s(t.title))]),e._v(" "),o("p",{staticClass:"level-good-price"},[o("span",{staticClass:"price"},[e._v("¥"+e._s(t.price)+" ")]),e._v(" "),o("span",{staticClass:"old-price"},[e._v("¥"+e._s(t.market_price))])])])])})),0),e._v(" "),o("pagination",{directives:[{name:"show",rawName:"v-show",value:e.total,expression:"total"}],staticStyle:{"margin-top":"20px"},attrs:{total:e.total,pageSize:e.per_page,page:e.page},on:{pagination:e.openGood}}),e._v(" "),o("span",{staticClass:"dialog-footer",attrs:{slot:"footer"},slot:"footer"},[o("el-button",{on:{click:function(t){e.showBox=!1}}},[e._v("关 闭")]),e._v(" "),o("el-button",{attrs:{type:"primary"},on:{click:e.sureGood}},[e._v("确 定")])],1)],1)],1)}),[function(){var e=this,t=e.$createElement,o=e._self._c||t;return o("div",{staticClass:"title"},[e._v("添加封面 "),o("span",{staticStyle:{"font-size":"12px",color:"#707070"}},[e._v("(提示:封面图尽量和视频高度一致)")])])},function(){var e=this,t=e.$createElement,o=e._self._c||t;return o("div",{staticClass:"upload-box-title"},[o("i",{staticClass:"iconfont icon-shangcheng2"}),o("span",[e._v("添加商品")])])}],!1,null,"eacecff4",null);t.default=component.exports},803:function(e,t,o){var content=o(902);content.__esModule&&(content=content.default),"string"==typeof content&&(content=[[e.i,content,""]]),content.locals&&(e.exports=content.locals);(0,o(8).default)("45f1d6dd",content,!0,{sourceMap:!1})},901:function(e,t,o){"use strict";o(803)},902:function(e,t,o){var l=o(7)(!1);l.push([e.i,".col_red[data-v-eacecff4]{color:#f11111}.col_green[data-v-eacecff4]{color:#44be95}.col_white[data-v-eacecff4]{color:#fff}.flex-col[data-v-eacecff4]{flex-direction:column}.flex-j-c[data-v-eacecff4]{justify-content:center}.flex-j-sb[data-v-eacecff4]{justify-content:space-between}.flex-j-ar[data-v-eacecff4]{justify-content:space-around}.flex-a-c[data-v-eacecff4]{align-items:center}.flex-a-e[data-v-eacecff4]{align-items:flex-end}.w[data-v-eacecff4]{width:1200px}.m-auto[data-v-eacecff4]{margin:0 auto}.height-one[data-v-eacecff4]{height:100%}.flex[data-v-eacecff4]{display:flex}.text-overflow[data-v-eacecff4]{-webkit-line-clamp:4}.text-overflow[data-v-eacecff4],.text-overflow-2[data-v-eacecff4]{overflow:hidden;text-overflow:ellipsis;display:-webkit-box;-webkit-box-orient:vertical}.text-overflow-2[data-v-eacecff4]{-webkit-line-clamp:2}.text-overflow-3[data-v-eacecff4]{display:-webkit-box;-webkit-line-clamp:3;-webkit-box-orient:vertical}.overflow-hide[data-v-eacecff4],.text-overflow-3[data-v-eacecff4]{overflow:hidden;text-overflow:ellipsis}.overflow-hide[data-v-eacecff4]{white-space:nowrap}.hiddenScroll[data-v-eacecff4]{scrollbar-width:none;-ms-overflow-style:none;overflow-x:hidden;overflow-y:scroll}.hiddenScroll[data-v-eacecff4]::-webkit-scrollbar{display:none}.finger-point[data-v-eacecff4]{cursor:pointer}.cursor-default[data-v-eacecff4]{cursor:default}.el-icon-circle-close[data-v-eacecff4]{color:#fff}.video[data-v-eacecff4]{background:#f1f2f4;padding:10px 0 20px}.video-box[data-v-eacecff4]{background:#fff;border-radius:4px;box-sizing:border-box;width:1200px;margin:0 auto;padding:20px 30px;min-height:850px}.input-box[data-v-eacecff4]{padding-bottom:10px}.input-box input[data-v-eacecff4]{font-size:30px;font-weight:700;padding:8px;width:100%;box-sizing:border-box;box-shadow:none;background-color:#fefefe;color:#333;border:none;border-bottom:1px dotted #ccc;outline:none}.upload-video-box[data-v-eacecff4]{position:relative;height:300px;display:flex;flex-direction:column;align-items:center;justify-content:center}.upload-video-box[data-v-eacecff4] .el-upload-dragger{width:1140px;height:300px}.upload-video-box[data-v-eacecff4] .el-upload-dragger .el-icon-upload{margin-top:70px}.upload-video-box .upload-video-title[data-v-eacecff4]{font-weight:700;font-size:18px;cursor:pointer;margin-bottom:10px}.upload-video-box .upload-video-title .iconfont[data-v-eacecff4]{font-size:20px}.upload-video-box video[data-v-eacecff4]{width:100%;height:100%}.upload-video-box .icon-fontclass-shanchu[data-v-eacecff4]{color:#333;font-size:20px;position:absolute;top:20px;right:20px}.upload-box .title[data-v-eacecff4]{padding:10px 0;margin-bottom:10px;border-bottom:1px solid #efefef}.upload-box .upload-box-title[data-v-eacecff4]{line-height:28px;margin-right:10px;display:flex;align-items:center}.upload-box .upload-box-title .iconfont[data-v-eacecff4]{color:#7e7e7e}.upload-box .goods-list-box .goods-item[data-v-eacecff4]{position:relative;display:flex;background-color:#f3f3f3;border-radius:2px;padding:10px;width:35%}.upload-box .goods-list-box .good-right[data-v-eacecff4]{padding-right:15px}.upload-box .goods-list-box .good-img[data-v-eacecff4]{width:50px;height:50px;border-radius:4px;margin-right:10px}.upload-box .goods-list-box .good-title[data-v-eacecff4]{margin-bottom:6px}.upload-box .goods-list-box .price[data-v-eacecff4]{color:#ec544a;margin-right:10px}.upload-box .goods-list-box .old-price[data-v-eacecff4]{color:#737373;text-decoration:line-through}.upload-box .goods-list-box .icon-fontclass-shanchu[data-v-eacecff4],.upload-box .goods-list-box .icon-fontclass-tihuan[data-v-eacecff4]{cursor:pointer;position:absolute;right:5px}.upload-box .goods-list-box .icon-fontclass-tihuan[data-v-eacecff4]{bottom:10px}.upload-box[data-v-eacecff4] .avatar-uploader{width:150px}.upload-box[data-v-eacecff4] .avatar-uploader .el-upload{border:1px dashed #d9d9d9;border-radius:6px;cursor:pointer;position:relative;overflow:hidden}.upload-box[data-v-eacecff4] .avatar-uploader-icon{font-size:28px;color:#8c939d;width:150px;height:150px;line-height:150px;text-align:center}.upload-box[data-v-eacecff4] .avatar{width:150px;height:auto;display:block}.bottom-box[data-v-eacecff4]{position:fixed;bottom:0;left:50%;transform:translateX(-50%);width:1200px;height:35px;padding:15px 0;background:#fff;box-shadow:0 8px 23px 1px rgba(51,51,51,.3)}.bottom-box .publish-btn[data-v-eacecff4]{cursor:pointer;width:100px;height:35px;margin:0 auto;line-height:35px;background:var(--color);color:#fff;text-align:center;border-radius:4px}.search-box .btn-search[data-v-eacecff4]{z-index:2;border:none;color:#fff;padding:13px 20px;border-radius:0 4px 4px 0;background-color:var(--color)}.level-box[data-v-eacecff4]{max-height:380px;overflow-y:scroll;padding:10px 0}.level-box .good-item[data-v-eacecff4]{align-items:center;cursor:pointer;padding:15px 10px;border:1px solid #e1e1e1;border-radius:10px;margin-bottom:10px}.level-box .good-item-img[data-v-eacecff4]{width:60px;height:60px}.level-box .good-item-right[data-v-eacecff4]{height:50px;flex-direction:column;justify-content:space-between;padding:10px 20px}.level-box .level-good-price[data-v-eacecff4]{color:#f11111}.level-box .level-good-price .price[data-v-eacecff4]{margin-right:10px}.level-box .level-good-price .old-price[data-v-eacecff4]{color:#737373;text-decoration:line-through}.level-box .radio_button[data-v-eacecff4]{margin-right:10px;border-radius:50%;width:10px;height:10px;background-color:#e1e1e1}.level-box .good-item.levelActive[data-v-eacecff4]{border:1px solid var(--color)}.level-box .radio_button.radio[data-v-eacecff4]{background-color:var(--color)}.level-box[data-v-eacecff4]::-webkit-scrollbar{width:0}.level-box[data-v-eacecff4]{overflow:-moz-scrollbars-none}",""]),e.exports=l}}]);
|