activityAdd.js
4.25 KB
(global["webpackJsonp"]=global["webpackJsonp"]||[]).push([["pages/activityAdd/activityAdd"],{"503a":function(e,t,n){"use strict";(function(e){Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var n={data:function(){return{fileList:[],form:{activityName:"",startTime:"",endTime:"",activityType:"",maxParticipants:"",region:"",content:"",auditStatus:"1",createUser:"",createDate:"",coverImage:"",num:0},active:"",startShow:!1,endShow:!1,params:{year:!0,month:!0,day:!0,hour:!0,minute:!0,second:!0},typeShow:!1,typeList:[{value:"1",label:"类型1"},{value:"2",label:"类型2"}],readOnly:!1,formats:{}}},methods:{startTimeChange:function(e){this.form.startTime=this.timeChange(e),this.form.endTime=""},endTimeChange:function(e){var t=this.timeChange(e);new Date(t).getTime()>new Date(this.form.startTime).getTime()?this.form.endTime=t:this.$refs.uToast.show({title:"结束时间不能小于开始时间",type:"error"})},timeChange:function(e){var t=e.year,n=e.month,o=e.day,u=e.hour,i=e.minute,r=e.second;return"".concat(t,"-").concat(n,"-").concat(o," ").concat(u,":").concat(i,":").concat(r)},typeChange:function(e){this.form.activityType=e[0].label},submit:function(){var t=this,n=[];n=this.$refs.uUpload.lists.filter((function(e){return 100==e.progress})),n.map((function(e){var n={name:e.file.name,url:e.response.data.url};t.fileList.push(n)})),0!=this.fileList.length&&(this.form.coverImage=this.fileList[0].url),this.form.createUser=e.getStorageSync("shopId"),this.form.createDate=this.currentTime(),this.$http.sendRequest("/cereActivityApplication/add","POST",this.form,1).then((function(t){e.navigateTo({url:"/pages/mycreated/mycreated"})})).catch((function(e){console.log(e)}))},currentTime:function(){var e=new Date,t=e.getFullYear(),n=e.getMonth()+1,o=e.getDate(),u=e.getHours(),i=e.getMinutes(),r=e.getSeconds();n=n<10?"0"+n:n,o=o<10?"0"+o:o,u=u<10?"0"+u:u,i=i<10?"0"+i:i,r=r<10?"0"+r:r;var a="".concat(t,"-").concat(n,"-").concat(o," ").concat(u,":").concat(i,":").concat(r);return a}}};t.default=n}).call(this,n("df3c")["default"])},"7a97":function(e,t,n){"use strict";n.r(t);var o=n("503a"),u=n.n(o);for(var i in o)["default"].indexOf(i)<0&&function(e){n.d(t,e,(function(){return o[e]}))}(i);t["default"]=u.a},"81f9":function(e,t,n){},b862:function(e,t,n){"use strict";n.r(t);var o=n("fd8a"),u=n("7a97");for(var i in u)["default"].indexOf(i)<0&&function(e){n.d(t,e,(function(){return u[e]}))}(i);n("cae9");var r=n("828b"),a=Object(r["a"])(u["default"],o["b"],o["c"],!1,null,"bcfa27f6",null,!1,o["a"],void 0);t["default"]=a.exports},cae9:function(e,t,n){"use strict";var o=n("81f9"),u=n.n(o);u.a},fd8a:function(e,t,n){"use strict";n.d(t,"b",(function(){return u})),n.d(t,"c",(function(){return i})),n.d(t,"a",(function(){return o}));var o={uForm:function(){return n.e("node-modules/uview-ui/components/u-form/u-form").then(n.bind(null,"f56d"))},uFormItem:function(){return Promise.all([n.e("common/vendor"),n.e("node-modules/uview-ui/components/u-form-item/u-form-item")]).then(n.bind(null,"3396"))},uUpload:function(){return Promise.all([n.e("common/vendor"),n.e("node-modules/uview-ui/components/u-upload/u-upload")]).then(n.bind(null,"e581"))},uInput:function(){return Promise.all([n.e("common/vendor"),n.e("node-modules/uview-ui/components/u-input/u-input")]).then(n.bind(null,"84bb"))},uPicker:function(){return Promise.all([n.e("common/vendor"),n.e("node-modules/uview-ui/components/u-picker/u-picker")]).then(n.bind(null,"95ac"))},uSelect:function(){return n.e("node-modules/uview-ui/components/u-select/u-select").then(n.bind(null,"ba16"))},uNumberBox:function(){return n.e("node-modules/uview-ui/components/u-number-box/u-number-box").then(n.bind(null,"f4f4"))},uToast:function(){return n.e("node-modules/uview-ui/components/u-toast/u-toast").then(n.bind(null,"9a7b"))},uButton:function(){return n.e("node-modules/uview-ui/components/u-button/u-button").then(n.bind(null,"2221"))}},u=function(){var e=this,t=e.$createElement;e._self._c;e._isMounted||(e.e0=function(t){e.startShow=!0},e.e1=function(t){e.endShow=!0},e.e2=function(t){e.typeShow=!0})},i=[]},ff3d:function(e,t,n){"use strict";(function(e,t){var o=n("47a9");n("06cb");o(n("3240"));var u=o(n("b862"));e.__webpack_require_UNI_MP_PLUGIN__=n,t(u.default)}).call(this,n("3223")["default"],n("df3c")["createPage"])}},[["ff3d","common/runtime","common/vendor"]]]);