1 |
- (window["webpackJsonp"]=window["webpackJsonp"]||[]).push([["chunk-052182fe"],{"0217":function(e,t,i){"use strict";i.r(t);var a,n=function(){var e=this,t=e.$createElement,i=e._self._c||t;return i("div",{staticClass:"addShareContent"},[i("addShare",{ref:"addShare",on:{update:e.handleUpdate}})],1)},r=[],o=function(){var e=this,t=e.$createElement,a=e._self._c||t;return a("div",{staticClass:"addShare"},[a("div",{staticClass:"shareBlock",on:{click:function(e){e.stopPropagation()}}},[a("div",{staticClass:"shareContent"},[a("van-cell-group",[a("van-field",{attrs:{required:"",label:"推荐内容标题","input-align":"right",placeholder:"请输入"},model:{value:e.form.title,callback:function(t){e.$set(e.form,"title",t)},expression:"form.title"}}),a("van-field",{attrs:{name:"radio",label:"内容类型","input-align":"right"},scopedSlots:e._u([{key:"input",fn:function(){return[a("div",{staticClass:"contentType"},[a("div",{class:{activeType:"1"==e.form.type},on:{click:function(t){e.form.type="1"}}},[e._v("视频")]),a("div",{class:{activeType:"2"==e.form.type},on:{click:function(t){e.form.type="2"}}},[e._v("图片")])])]},proxy:!0}])}),a("div",{staticClass:"uploadBox flex-column"},[a("div",{staticClass:"uploadTitle font28 color333"},[a("i",{staticClass:"requiredStyle"},[e._v("*")]),e._v("上传"+e._s(1==e.form.type?"视频":"图片")+" ")])]),2==e.form.type?a("input",{ref:"uploadFile",attrs:{hidden:"",type:"file",accept:"image/*"},on:{change:e.getImageFile}}):a("input",{ref:"uploadFile",attrs:{hidden:"",type:"file",accept:"video/*"},on:{change:e.getVideoFile}}),2==e.form.type?[a("div",{staticClass:"imgAndVideo"},["pc"==e.plaform?e._l(e.form.file_media_id,(function(t,i){return a("div",{key:i,staticClass:"imgItem"},[a("img",{attrs:{src:t.img,width:"100%",height:"100%",alt:""}}),a("div",{staticClass:"wzh_img_del",on:{click:function(t){return e.imageDel(i)}}},[a("van-icon",{staticClass:"del_icon",staticStyle:{color:"#fff"},attrs:{name:"cross"}})],1)])})):[2==e.isIosOrAndroid?e._l(e.form.file_media_id,(function(t,i){return a("div",{key:i,staticClass:"imgItem"},[a("img",{attrs:{src:t.img?t.img:t.base64Data,width:"100%",height:"100%",alt:""}}),a("div",{staticClass:"wzh_img_del",on:{click:function(t){return e.imageDel(i)}}},[a("van-icon",{staticClass:"del_icon",staticStyle:{color:"#fff"},attrs:{name:"cross"}})],1)])})):e._l(e.form.file_media_id,(function(t,i){return a("div",{key:i,staticClass:"imgItem"},[a("img",{attrs:{src:t.img?t.img:t.localId,width:"100%",height:"100%",alt:""}}),a("div",{staticClass:"wzh_img_del",on:{click:function(t){return e.imageDel(i)}}},[a("van-icon",{staticClass:"del_icon",staticStyle:{color:"#fff"},attrs:{name:"cross"}})],1)])}))],a("div",{staticClass:"addBox flex-column align-center justify-center",on:{click:e.upload}},[a("img",{staticClass:"addicon",attrs:{src:i("d510"),alt:""}}),a("span",{staticClass:"font24"},[e._v("上传")])])],2)]:[a("div",{staticClass:"imgAndVideo"},[a("div",{staticClass:"addBox flex-column align-center justify-center",on:{click:e.upload}},[a("img",{staticClass:"addicon",attrs:{src:i("d510"),alt:""}}),a("span",{staticClass:"font24"},[e._v("上传")])]),e._l(e.form.file_media_id,(function(t,i){return a("div",{key:i,staticClass:"videoBox"},[a("video",{attrs:{src:t.videoSrc,controls:""}}),a("van-icon",{staticClass:"deleteIcon",attrs:{name:"delete",size:"20",color:"red"},on:{click:function(t){return e.imageDel(i)}}})],1)}))],2)],a("div",{staticClass:"line"}),a("van-field",{attrs:{type:"textarea",placeholder:"请输入分享内容"},model:{value:e.form.content,callback:function(t){e.$set(e.form,"content",t)},expression:"form.content"}})],2)],1),a("div",{staticClass:"shareConfirm"},[a("van-button",{attrs:{type:"info",loading:e.loading,"loading-text":"正在提交数据...",round:""},on:{click:e.submit}},[e._v("立即保存并推荐分享 ")])],1)])])},s=[],l=(i("e7e5"),i("d399")),d=i("f3f3"),c=i("fc11"),f=(i("be7f"),i("565f")),m=(i("66b9"),i("b650")),u=(i("b0c0"),i("ac1f"),i("466d"),i("e9c4"),i("d81d"),i("5319"),i("99af"),i("d3b7"),i("1276"),i("5cc6"),i("907a"),i("9a8c"),i("a975"),i("735e"),i("c1ac"),i("d139"),i("3a7b"),i("d5d6"),i("82f8"),i("e91f"),i("60bd"),i("5f96"),i("3280"),i("3fcc"),i("ca91"),i("25a1"),i("cd26"),i("3c5d"),i("2954"),i("649e"),i("219c"),i("170b"),i("b39a"),i("72f7"),i("3ca3"),i("ddb0"),i("2b3d"),i("9861"),i("a434"),i("b311"),i("8c11")),h=i("18a0"),g=i.n(h),p=i("5880"),v={components:(a={},Object(c["a"])(a,m["a"].name,m["a"]),Object(c["a"])(a,f["a"].name,f["a"]),a),data:function(){return{loading:!1,showAdd:!1,webUrl:"https://o.nczyzs.com/",value:"",fileName:"",form:{title:"",type:"1",file_media_id:[],content:"",talkskill:"--"}}},computed:Object(d["a"])(Object(d["a"])({},Object(p["mapState"])({platform:function(e){return e.platform}})),{},{plaform:function(){return"browser"==this.platform||"windows"==this.platform||"mac"==this.platform?"pc":"mobile"},isIosOrAndroid:function(){var e=navigator.userAgent,t=e.indexOf("Android")>-1||e.indexOf("Adr")>-1;if(t)return 1;var i=!!e.match(/\(i[^;]+;( U;)? CPU.+Mac OS X/);return i?2:0}}),watch:{showAdd:function(e){e&&this.initForm()}},methods:{submit:function(){var e=this;if(!this.form.title)return this.$toast("请填写分享标题"),!1;if(!this.form.content)return this.$toast("请填写分享内容"),!1;if(this.form.talkskill){if(!this.form.file_media_id.length)return this.$toast("请上传".concat(1==this.form.type?"视频":"图片")),!1}else;this.loading=!0;var t=this.handleParams(),i=[];if(2==this.form.type)for(var a=0;a<this.form.file_media_id.length;a++)this.form.file_media_id[a].file&&this.uploadALY(this.form.file_media_id[a].file).then((function(a){i.push({img:a,serverId:"",video:""}),i.length==e.form.file_media_id.length&&(t.file_media_id=i,e.requestAddApi(t))}));else this.requestAddApi(t)},requestAddApi:function(e){var t=this;Object(u["A"])(e).then((function(e){t.loading=!1,0==e.data.code&&(t.showAdd=!1,t.$toast("保存成功"),t.$emit("update",{state:200}))})).catch((function(e){t.loading=!1}))},initForm:function(){this.form={title:"",type:"1",file_media_id:[],content:"",talkskill:""}},handleParams:function(){var e=JSON.parse(JSON.stringify(this.form));return 2==this.form.type&&delete e.file_media_id,1==this.form.type&&(e.file_media_id=e.file_media_id.map((function(e){return{serverId:"",img:"",video:e.video}}))),e},upload:function(){if("pc"==this.plaform||1==this.form.type)this.$refs.uploadFile.click();else{if(this.form.file_media_id.length>=9)return void this.$toast("只能上传9张图片");var e=this;g.a.chooseImage({count:9,sizeType:["original","compressed"],sourceType:["album","camera"],success:function(t){var i=t.localIds;e.isIosOrAndroid,e.getUploadImage(0,i)}})}},getUploadImage:function(e,t){var i=this;g.a.uploadImage({localId:t[e],isShowProgressTips:1,success:function(a){var n=a.serverId;i.form.file_media_id.push({localId:t[e],serverId:n,video:""}),e==t.length-1&&i.getLocalImageData(0)},complete:function(){var a=JSON.parse(JSON.stringify(e));a=parseInt(a),a++,a<t.length&&i.getUploadImage(a,t)}})},getLocalImageData:function(e){var t=this;if(t.form.file_media_id[e].base64Data||t.form.file_media_id[e].img){var i=JSON.parse(JSON.stringify(e));i=parseInt(i),i++,i<t.form.file_media_id.length&&t.getLocalImageData(i),e==t.form.file_media_id.length-1&&t.forUploadaly(0)}else this.$wx.getLocalImgData({localId:t.form.file_media_id[e].localId,success:function(i){var a=i.localData;0!=a.indexOf("data:image")&&(a="data:image/jpeg;base64,"+a),a=a.replace(/\r|\n/g,"").replace("data:image/jpg","data:image/jpeg"),t.form.file_media_id[e]["base64Data"]=a,t.$forceUpdate()},complete:function(){var i=JSON.parse(JSON.stringify(e));i=parseInt(i),i++,i<t.form.file_media_id.length&&t.getLocalImageData(i),e==t.form.file_media_id.length-1&&t.forUploadaly(0)}})},forUploadaly:function(e){var t=this;if(!t.form.file_media_id[e].img&&t.form.file_media_id[e].base64Data)this.base64DataToFile(t.form.file_media_id[e].base64Data,"".concat(Date.now()).concat(e,"crm")).then((function(i){t.form.file_media_id[e].file=i;var a=JSON.parse(JSON.stringify(e));a=parseInt(a),a++,a<t.form.file_media_id.length&&t.forUploadaly(a)}));else{var i=JSON.parse(JSON.stringify(e));i=parseInt(i),i++,i<t.form.file_media_id.length&&t.forUploadaly(i)}},base64DataToFile:function(e,t){return new Promise((function(i,a){var n=e.split(","),r=n[0].match(/:(.*?);/)[1],o=r.split("/")[1],s=atob(n[1]),l=s.length,d=new Uint8Array(l);while(l--)d[l]=s.charCodeAt(l);var c=new File([d],"".concat(t,".").concat(o),{type:r});i(c)}))},getImageFile:function(e){var t=window.URL||window.webkitURL,i=e.target.files[0];this.form.file_media_id.push({img:t.createObjectURL(i),file:i,id:this.form.file_media_id.length+1})},getVideoFile:function(e){var t=this,i=e.target.files[0];if(i.size>283115520)this.$toast("上传视频大小超出限制!");else{var a=l["a"].loading({message:"上传中...",forbidClick:!0});this.uploadALY(i).then((function(e){a.clear(),t.form.file_media_id.push({localId:"",serverId:"",video:e,videoSrc:t.webUrl+e}),t.$forceUpdate()}))}},uploadALY:function(e){var t=this,i="";return new Promise((function(a,n){var r=e.name.split("."),o=r[r.length-1],s=new OSS({region:"oss-cn-hangzhou",accessKeyId:"LTAI5tHjWupJSCAycy2yVbQZ",accessKeySecret:"eNFicm77Cfq3u7ZnQyw1urFmFNpf3w",bucket:"zyzswzh",secure:!0});"pc"!=t.plaform&&(i=e.name.indexOf(".")>-1?e.name.split(".")[0]:(new Date).getTime());var l=new Date,d=l.getFullYear()+""+(1*l.getMonth()+1)+l.getDate(),c="broker/"+d+"/"+"".concat(Date.now()).concat(i)+"."+(1==t.form.type?o:"jpeg");s.multipartUpload(c,e).then((function(e){a(e.name)})).catch((function(e){n(e)}))}))},imageDel:function(e){this.form.file_media_id.splice(e,1)}}},_=v,b=(i("ade1"),i("2877")),A=Object(b["a"])(_,o,s,!1,null,"58ebfe7b",null),y=A.exports,w={components:{addShare:y},data:function(){return{}},methods:{handleUpdate:function(e){200==e.state&&this.$router.go(-1)}}},C=w,S=(i("d7be"),Object(b["a"])(C,n,r,!1,null,"7e17fb28",null));t["default"]=S.exports},"0635":function(e,t,i){},"4df4":function(e,t,i){"use strict";var a=i("da84"),n=i("0366"),r=i("c65b"),o=i("7b0b"),s=i("9bdd"),l=i("e95a"),d=i("68ee"),c=i("07fa"),f=i("8418"),m=i("9a1f"),u=i("35a1"),h=a.Array;e.exports=function(e){var t=o(e),i=d(this),a=arguments.length,g=a>1?arguments[1]:void 0,p=void 0!==g;p&&(g=n(g,a>2?arguments[2]:void 0));var v,_,b,A,y,w,C=u(t),S=0;if(!C||this==h&&l(C))for(v=c(t),_=i?new this(v):h(v);v>S;S++)w=p?g(t[S],S):t[S],f(_,S,w);else for(A=m(t,C),y=A.next,_=i?new this:[];!(b=r(y,A)).done;S++)w=p?s(A,g,[b.value,S],!0):b.value,f(_,S,w);return _.length=S,_}},"4edd":function(e,t,i){},"66b9":function(e,t,i){"use strict";i("68ef"),i("9d70"),i("3743"),i("e3b3"),i("bc1b")},"99af":function(e,t,i){"use strict";var a=i("23e7"),n=i("da84"),r=i("d039"),o=i("e8b5"),s=i("861d"),l=i("7b0b"),d=i("07fa"),c=i("8418"),f=i("65f0"),m=i("1dde"),u=i("b622"),h=i("2d00"),g=u("isConcatSpreadable"),p=9007199254740991,v="Maximum allowed index exceeded",_=n.TypeError,b=h>=51||!r((function(){var e=[];return e[g]=!1,e.concat()[0]!==e})),A=m("concat"),y=function(e){if(!s(e))return!1;var t=e[g];return void 0!==t?!!t:o(e)},w=!b||!A;a({target:"Array",proto:!0,forced:w},{concat:function(e){var t,i,a,n,r,o=l(this),s=f(o,0),m=0;for(t=-1,a=arguments.length;t<a;t++)if(r=-1===t?o:arguments[t],y(r)){if(n=d(r),m+n>p)throw _(v);for(i=0;i<n;i++,m++)i in r&&c(s,m,r[i])}else{if(m>=p)throw _(v);c(s,m++,r)}return s.length=m,s}})},"9bdd":function(e,t,i){var a=i("825a"),n=i("2a62");e.exports=function(e,t,i,r){try{return r?t(a(i)[0],i[1]):t(i)}catch(o){n(e,"throw",o)}}},a434:function(e,t,i){"use strict";var a=i("23e7"),n=i("da84"),r=i("23cb"),o=i("5926"),s=i("07fa"),l=i("7b0b"),d=i("65f0"),c=i("8418"),f=i("1dde"),m=f("splice"),u=n.TypeError,h=Math.max,g=Math.min,p=9007199254740991,v="Maximum allowed length exceeded";a({target:"Array",proto:!0,forced:!m},{splice:function(e,t){var i,a,n,f,m,_,b=l(this),A=s(b),y=r(e,A),w=arguments.length;if(0===w?i=a=0:1===w?(i=0,a=A-y):(i=w-2,a=g(h(o(t),0),A-y)),A+i-a>p)throw u(v);for(n=d(b,a),f=0;f<a;f++)m=y+f,m in b&&c(n,f,b[m]);if(n.length=a,i<a){for(f=y;f<A-a;f++)m=f+a,_=f+i,m in b?b[_]=b[m]:delete b[_];for(f=A;f>A-a+i;f--)delete b[f-1]}else if(i>a)for(f=A-a;f>y;f--)m=f+a-1,_=f+i-1,m in b?b[_]=b[m]:delete b[_];for(f=0;f<i;f++)b[f+y]=arguments[f+2];return b.length=A-a+i,n}})},ade1:function(e,t,i){"use strict";i("4edd")},d510:function(e,t){e.exports="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAACAAAAAgCAYAAABzenr0AAAAAXNSR0IArs4c6QAAAMJJREFUWEftl7ENQjEMRH1U0NGwAEgg9ENB6nxRsQBiBuagQ4zAPPmUJEKEihHYAaMIsYBTBCSnv/PpybJjUMHzMR3BNHHWbKU2kAqzrgspMtG8taYv9SkNwLmws0bsIxbmwud4PzHzTgNUJkBjZ5t1lSb89IAGUAJK4N8J+MttD2AlGSRAb8r8GhDRVaQneqJ6AEnyr0YnoRJQAkrgRwjot7wigS6kuqdZF9KDiUetXQylS63oNvQhHQDM3LLZSAO8Af2AwkOF0sgkAAAAAElFTkSuQmCC"},d7be:function(e,t,i){"use strict";i("0635")},d81d:function(e,t,i){"use strict";var a=i("23e7"),n=i("b727").map,r=i("1dde"),o=r("map");a({target:"Array",proto:!0,forced:!o},{map:function(e){return n(this,e,arguments.length>1?arguments[1]:void 0)}})},e9c4:function(e,t,i){var a=i("23e7"),n=i("da84"),r=i("d066"),o=i("2ba4"),s=i("e330"),l=i("d039"),d=n.Array,c=r("JSON","stringify"),f=s(/./.exec),m=s("".charAt),u=s("".charCodeAt),h=s("".replace),g=s(1..toString),p=/[\uD800-\uDFFF]/g,v=/^[\uD800-\uDBFF]$/,_=/^[\uDC00-\uDFFF]$/,b=function(e,t,i){var a=m(i,t-1),n=m(i,t+1);return f(v,e)&&!f(_,n)||f(_,e)&&!f(v,a)?"\\u"+g(u(e,0),16):e},A=l((function(){return'"\\udf06\\ud834"'!==c("\udf06\ud834")||'"\\udead"'!==c("\udead")}));c&&a({target:"JSON",stat:!0,forced:A},{stringify:function(e,t,i){for(var a=0,n=arguments.length,r=d(n);a<n;a++)r[a]=arguments[a];var s=o(c,null,r);return"string"==typeof s?h(s,p,b):s}})}}]);
|