(global["webpackJsonp"]=global["webpackJsonp"]||[]).push([["pages/activity/uploadFiel"],{"1f3d":function(t,e,n){"use strict";(function(t,e){var a=n("4ea4");n("8316");a(n("66fd"));var r=a(n("7aeb"));t.__webpack_require_UNI_MP_PLUGIN__=n,e(r.default)}).call(this,n("bc2e")["default"],n("543d")["createPage"])},2965:function(t,e,n){"use strict";(function(t,a){var r=n("4ea4");Object.defineProperty(e,"__esModule",{value:!0}),e.default=void 0;var i=r(n("2eee")),o=r(n("c973")),u=r(n("d730")),c=n("9b1a"),f=(t.getStorageSync("token"),{onLoad:function(t){this.activityId=t.activityId},data:function(){return{activityId:"",form:[]}},mounted:function(){var e=this;return(0,o.default)(i.default.mark((function n(){var r,o,c;return i.default.wrap((function(n){while(1)switch(n.prev=n.next){case 0:return n.next=2,u.default.getPhotos({activityId:e.activityId});case 2:if(o=n.sent,!o.errcode){n.next=7;break}return a.showToast({title:o.details,icon:"error"}),setTimeout((function(){t.navigateBack()}),1e3),n.abrupt("return");case 7:c=null===(r=o.data.photos)||void 0===r?void 0:r.map((function(t){return t.photo})),c&&(e.form=c);case 9:case"end":return n.stop()}}),n)})))()},methods:{submit:function(){var e=this;return(0,o.default)(i.default.mark((function n(){var r;return i.default.wrap((function(n){while(1)switch(n.prev=n.next){case 0:if(!(e.form.length<=0)){n.next=3;break}return a.showToast({title:"请选择图片",icon:"error"}),n.abrupt("return");case 3:return n.next=6,u.default.uploadImgs({activityId:e.activityId,photos:e.form});case 6:r=n.sent,200==r.code&&(a.showToast({title:"提交成功"}),setTimeout((function(){t.navigateBack()}),1e3));case 8:case"end":return n.stop()}}),n)})))()},upload:function(){var e=this,n=t.getStorageSync("token");t.chooseImage({count:1,success:function(){var r=(0,o.default)(i.default.mark((function r(o){var u;return i.default.wrap((function(r){while(1)switch(r.prev=r.next){case 0:a.showLoading({title:"上传中"}),u=o.tempFilePaths,t.uploadFile({url:c.BASE_URL.url+"/activity/photo",name:"file",header:{Authorization:"Bearer ".concat(n)},filePath:u[0],success:function(t){var n=JSON.parse(t.data);e.form.push(c.BASE_URL.fileUrl+n.imgUrl)},fail:function(t){console.log(t),a.showToast({title:"上传失败"})},complete:function(){a.hideLoading()}});case 3:case"end":return r.stop()}}),r)})));return function(t){return r.apply(this,arguments)}}()})},imgx:function(t){var e=t.url;this.form=this.form.filter((function(t){return t!==e}))}}});e.default=f}).call(this,n("543d")["default"],n("bc2e")["default"])},"45cb":function(t,e,n){"use strict";var a=n("d337"),r=n.n(a);r.a},5978:function(t,e,n){"use strict";n.r(e);var a=n("2965"),r=n.n(a);for(var i in a)["default"].indexOf(i)<0&&function(t){n.d(e,t,(function(){return a[t]}))}(i);e["default"]=r.a},"7aeb":function(t,e,n){"use strict";n.r(e);var a=n("f939"),r=n("5978");for(var i in r)["default"].indexOf(i)<0&&function(t){n.d(e,t,(function(){return r[t]}))}(i);n("45cb");var o=n("f0c5"),u=Object(o["a"])(r["default"],a["b"],a["c"],!1,null,null,null,!1,a["a"],void 0);e["default"]=u.exports},d337:function(t,e,n){},f939:function(t,e,n){"use strict";n.d(e,"b",(function(){return a})),n.d(e,"c",(function(){return r})),n.d(e,"a",(function(){}));var a=function(){var t=this.$createElement,e=(this._self._c,this.form.length);this.$mp.data=Object.assign({},{$root:{g0:e}})},r=[]}},[["1f3d","common/runtime","common/vendor"]]]);