(global["webpackJsonp"]=global["webpackJsonp"]||[]).push([["components/file-img-upload/w-upload"],{"380d":function(e,t,n){"use strict";n.r(t);var o=n("5d43"),i=n.n(o);for(var a in o)"default"!==a&&function(e){n.d(t,e,(function(){return o[e]}))}(a);t["default"]=i.a},"51a0":function(e,t,n){"use strict";n.r(t);var o=n("f3e4"),i=n("380d");for(var a in i)"default"!==a&&function(e){n.d(t,e,(function(){return i[e]}))}(a);n("84cd");var s,u=n("f0c5"),c=Object(u["a"])(i["default"],o["b"],o["c"],!1,null,"ccab44da",null,!1,o["a"],s);t["default"]=c.exports},"5d43":function(e,t,n){"use strict";(function(e){Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var o=n("fad1"),i={props:{token:{type:String,default:""},fileShow:{type:Boolean,default:!1},imgShow:{type:Boolean,default:!1},fileList:{type:Array,default:[]},imgList:{type:Array,default:[]},requestUrl:{type:String,default:""},uploadName:{type:String,default:"file"},fileType:{type:String,default:""},imgType:{type:String,default:""}},name:"WUpload",data:function(){return{isshow:!1,selectList:["文档","图片"]}},created:function(){},methods:{wclose:function(){this.isshow=!1},uploadOpen:function(){this.isshow=!0},wselect:function(e){0==e?this.upLoadFile():this.upLoadImg(),this.isshow=!1},wpriven:function(t){var n=this;e.showLoading({title:"下载中...",mask:!0}),n.udownload(t,"temporary").then((function(t){e.hideLoading(),n.uopen(t)})).catch((function(){e.hideLoading(),e.showToast({title:"下载失败",icon:"none"})}))},wdelete:function(e,t,n){var o=this;t.forEach((function(t,i){i==e&&(1==n?o.$emit("updateFileList",[i,t]):o.$emit("updateImgList",[i,t]))}))},udownload:function(t){var n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"temporary",o=this;return new Promise((function(i,a){e.downloadFile({url:t,success:function(t){var s=t.statusCode,u=t.tempFilePath;200===s&&("local"==n?e.saveFile({tempFilePath:u,success:function(e){var t=e.savedFilePath;return o.onCommit(i(t))},fail:function(){return o.errorHandler("下载失败",a)}}):o.onCommit(i(u)))},fail:function(){return o.errorHandler("下载失败",a)}})}))},onCommit:function(e){return e},errorHandler:function(t,n){return e.showToast({title:t,icon:"none"}),n(t)},uopen:function(t){var n=e.getSystemInfoSync().platform;"ios"==n&&(t=encodeURI(t)),e.openDocument({showMenu:!0,filePath:t,success:function(e){console.log("打开文档成功")},fail:function(n){e.getImageInfo({src:t,success:function(n){e.previewImage({current:t,urls:[t]})},fail:function(t){e.showToast({title:"不支持该格式",icon:"none"})}})}})},upLoadFile:function(){var t=this;e.chooseMessageFile({type:"file",success:function(n){n.tempFiles[0].size<5242880?(0,o.WUpload)(t.requestUrl,t.uploadName,t.token,{upload_type:t.fileType},n).then((function(o){if(1==o.state){var i=o.data;i.name=n.tempFiles[0].name,t.$emit("fileSuccess",i),e.showToast({title:"上传成功"})}else e.showToast({title:"上传失败",icon:"none"})})).catch((function(t){console.log(t),e.showToast({title:"上传失败",icon:"none"})})):e.showToast({title:"文件过大，无法上传",icon:"none"})}})},upLoadImg:function(t){var n=this;e.chooseImage({count:1,sizeType:["original","compressed"],sourceType:["camera","album"],success:function(i){i.tempFiles[0].size<2097152?e.getImageInfo({src:i.tempFilePaths[0],success:function(a){(0,o.WUpload)(n.requestUrl,n.uploadName,n.token,{upload_type:n.imgType},i).then((function(o){if(1==o.state){var a=o.data;a.name=i.tempFilePaths[0],1==t?n.$emit("imgSuccess",a):n.$emit("fileSuccess",a),e.showToast({title:"上传成功"})}else e.showToast({title:"上传失败",icon:"none"})})).catch((function(t){console.log(t),e.showToast({title:"上传失败",icon:"none"})}))},fail:function(e){console.log(e)}}):e.showToast({title:"图片过大，无法上传",icon:"none"})}})}}};t.default=i}).call(this,n("543d")["default"])},"84cd":function(e,t,n){"use strict";var o=n("8b03"),i=n.n(o);i.a},"8b03":function(e,t,n){},f3e4:function(e,t,n){"use strict";var o;n.d(t,"b",(function(){return i})),n.d(t,"c",(function(){return a})),n.d(t,"a",(function(){return o}));var i=function(){var e=this,t=e.$createElement;e._self._c},a=[]}}]);
;(global["webpackJsonp"] = global["webpackJsonp"] || []).push([
    'components/file-img-upload/w-upload-create-component',
    {
        'components/file-img-upload/w-upload-create-component':(function(module, exports, __webpack_require__){
            __webpack_require__('543d')['createComponent'](__webpack_require__("51a0"))
        })
    },
    [['components/file-img-upload/w-upload-create-component']]
]);
