(global["webpackJsonp"]=global["webpackJsonp"]||[]).push([["pages/activity/uploadFiel"],{"06a7":function(t,e,n){"use strict";var r;n.d(e,"b",(function(){return a})),n.d(e,"c",(function(){return o})),n.d(e,"a",(function(){return r}));var a=function(){var t=this,e=t.$createElement;t._self._c},o=[]},"1d0c":function(t,e,n){"use strict";(function(t){Object.defineProperty(e,"__esModule",{value:!0}),e.default=void 0;var r=u(n("a34a")),a=u(n("a0c2")),o=n("68aa");function u(t){return t&&t.__esModule?t:{default:t}}function i(t,e,n,r,a,o,u){try{var i=t[o](u),c=i.value}catch(f){return void n(f)}i.done?e(c):Promise.resolve(c).then(r,a)}function c(t){return function(){var e=this,n=arguments;return new Promise((function(r,a){var o=t.apply(e,n);function u(t){i(o,r,a,u,c,"next",t)}function c(t){i(o,r,a,u,c,"throw",t)}u(void 0)}))}}t.getStorageSync("token");var f={onLoad:function(t){this.activityId=t.activityId},data:function(){return{activityId:"",form:[]}},mounted:function(){var e=this;return c(r.default.mark((function n(){var o,u,i;return r.default.wrap((function(n){while(1)switch(n.prev=n.next){case 0:return n.next=2,a.default.getPhotos({activityId:e.activityId});case 2:if(u=n.sent,!u.errcode){n.next=7;break}return wx.showToast({title:u.details,icon:"error"}),setTimeout((function(){t.navigateBack()}),1e3),n.abrupt("return");case 7:i=null===(o=u.data.photos)||void 0===o?void 0:o.map((function(t){return t.photo})),i&&(e.form=i);case 9:case"end":return n.stop()}}),n)})))()},methods:{submit:function(){var e=this;return c(r.default.mark((function n(){var o;return r.default.wrap((function(n){while(1)switch(n.prev=n.next){case 0:if(!(e.form.length<=0)){n.next=3;break}return wx.showToast({title:"请选择图片",icon:"error"}),n.abrupt("return");case 3:return n.next=6,a.default.uploadImgs({activityId:e.activityId,photos:e.form});case 6:o=n.sent,200==o.code&&(wx.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 a=c(r.default.mark((function a(u){var i;return r.default.wrap((function(r){while(1)switch(r.prev=r.next){case 0:wx.showLoading({title:"上传中"}),i=u.tempFilePaths,t.uploadFile({url:o.BASE_URL.url+"/activity/photo",name:"file",header:{Authorization:"Bearer ".concat(n)},filePath:i[0],success:function(t){var n=JSON.parse(t.data);e.form.push(o.BASE_URL.fileUrl+n.imgUrl)},fail:function(t){console.log(t),wx.showToast({title:"上传失败"})},complete:function(){wx.hideLoading()}});case 3:case"end":return r.stop()}}),a)})));function u(t){return a.apply(this,arguments)}return u}()})},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"])},"1d3b":function(t,e,n){"use strict";var r=n("3c5d"),a=n.n(r);a.a},"3c5d":function(t,e,n){},"6fc1":function(t,e,n){"use strict";(function(t){n("d69c");r(n("66fd"));var e=r(n("877a"));function r(t){return t&&t.__esModule?t:{default:t}}wx.__webpack_require_UNI_MP_PLUGIN__=n,t(e.default)}).call(this,n("543d")["createPage"])},"877a":function(t,e,n){"use strict";n.r(e);var r=n("06a7"),a=n("d024");for(var o in a)"default"!==o&&function(t){n.d(e,t,(function(){return a[t]}))}(o);n("1d3b");var u,i=n("f0c5"),c=Object(i["a"])(a["default"],r["b"],r["c"],!1,null,null,null,!1,r["a"],u);e["default"]=c.exports},d024:function(t,e,n){"use strict";n.r(e);var r=n("1d0c"),a=n.n(r);for(var o in r)"default"!==o&&function(t){n.d(e,t,(function(){return r[t]}))}(o);e["default"]=a.a}},[["6fc1","common/runtime","common/vendor"]]]);