chunk-0cd26d57.574b84b4.js 18 KB

12
  1. (window["webpackJsonp"]=window["webpackJsonp"]||[]).push([["chunk-0cd26d57"],{"0091":function(e,t,r){},"0137":function(e,t,r){"use strict";r.d(t,"b",function(){return i}),r.d(t,"c",function(){return a}),r.d(t,"a",function(){return o}),r.d(t,"e",function(){return s}),r.d(t,"d",function(){return c}),r.d(t,"f",function(){return u});var n=r("bf9a");function i(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return n["b"].get("coupon",{params:e})}function a(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return n["b"].get("coupon_user_bags",{params:e})}function o(e){return n["b"].get("coupon/".concat(e,"/edit"))}function s(e){return n["b"].post("coupon",e)}function c(e){return n["b"].post("coupon/giveCouponToUser",e)}function u(e,t){return n["b"].put("coupon/".concat(e),t)}},"0cd2":function(e,t,r){},"143d":function(e,t,r){"use strict";var n=r("a975"),i=r.n(n);i.a},"2b3d":function(e,t,r){"use strict";r.d(t,"c",function(){return i}),r.d(t,"a",function(){return a}),r.d(t,"e",function(){return o}),r.d(t,"f",function(){return s}),r.d(t,"b",function(){return c}),r.d(t,"d",function(){return u});var n=r("bf9a");function i(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return n["b"].get("invite_new_users_configs",{params:e})}function a(e){return n["b"].get("invite_new_users_configs/".concat(e,"/edit"))}function o(e){return n["b"].post("invite_new_users_configs",e)}function s(e,t){return n["b"].put("invite_new_users_configs/".concat(e),t)}function c(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return n["b"].get("invite_new_users",{params:e})}function u(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return n["b"].get("invite_new_users_give_gift_log",{params:e})}},"469f":function(e,t,r){r("6c1c"),r("1654"),e.exports=r("7d7b")},"5d73":function(e,t,r){e.exports=r("469f")},"6cbc":function(e,t,r){"use strict";var n=r("0cd2"),i=r.n(n);i.a},"768b":function(e,t,r){"use strict";var n=r("a745"),i=r.n(n);function a(e){if(i()(e))return e}var o=r("5d73"),s=r.n(o);function c(e,t){var r=[],n=!0,i=!1,a=void 0;try{for(var o,c=s()(e);!(n=(o=c.next()).done);n=!0)if(r.push(o.value),t&&r.length===t)break}catch(u){i=!0,a=u}finally{try{n||null==c["return"]||c["return"]()}finally{if(i)throw a}}return r}function u(){throw new TypeError("Invalid attempt to destructure non-iterable instance")}function l(e,t){return a(e)||c(e,t)||u()}r.d(t,"a",function(){return l})},"7d7b":function(e,t,r){var n=r("e4ae"),i=r("7cd6");e.exports=r("584a").getIterator=function(e){var t=i(e);if("function"!=typeof t)throw TypeError(e+" is not iterable!");return n(t.call(e))}},"8a92":function(e,t,r){"use strict";var n=r("0091"),i=r.n(n);i.a},a469:function(e,t,r){"use strict";r.d(t,"b",function(){return i}),r.d(t,"d",function(){return a}),r.d(t,"e",function(){return o}),r.d(t,"a",function(){return s}),r.d(t,"c",function(){return c});var n=r("bf9a");function i(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return n["b"].get("card_riding",{params:e})}function a(e){return n["b"].post("card_riding",e)}function o(e,t){return n["b"].put("card_riding/".concat(e),t)}function s(e){return n["b"].get("card_riding/".concat(e,"/edit"))}function c(e){return n["b"].post("card_riding/giveCardToUser",e)}},a975:function(e,t,r){},ada3:function(e,t,r){"use strict";r("8e6e"),r("456d");var n=r("bd86"),i=r("75fc"),a=(r("a481"),r("96cf"),r("3b8d")),o=(r("ac6a"),r("28a5"),r("9948")),s=r.n(o),c=r("9b02"),u=r.n(c),l=r("1a38"),d=r("873a"),f=r("a22f");function p(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),r.push.apply(r,n)}return r}function m(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?p(r,!0).forEach(function(t){Object(n["a"])(e,t,r[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):p(r).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))})}return e}var b,h,v={name:"LzForm",components:{FlexSpacer:f["a"]},inject:{view:{from:"view",default:null}},data:function(){return{loading:!1,stay:!1}},props:{getData:Function,submit:Function,errors:Object,form:Object,submitText:{type:String,default:"保存"},labelPosition:String,inDialog:Boolean,createdRedirect:{type:[String,Function],default:function(){var e=this.$route.path.split("/");return"/"+(e[e.length-2]||"")}},updatedRedirect:{type:[String,Function],default:function(){return this.$router.back.bind(this.$router)}},disableRedirect:Boolean,disableStay:Boolean,editMode:Boolean},computed:{realLabelPosition:function(){return this.labelPosition||(this.$store.state.miniWidth?"top":"right")},miniWidth:function(){return this.$store.state.miniWidth}},created:function(){this.copyMethods()},methods:{copyMethods:function(){var e=this;[l["default"].extends.methods,l["default"].methods].forEach(function(t){s()(t,function(t,r){e[r]=function(){t.apply(this.$refs.form,arguments)}})})},_getData:function(){var e=Object(a["a"])(regeneratorRuntime.mark(function e(){var t=this;return regeneratorRuntime.wrap(function(e){while(1)switch(e.prev=e.next){case 0:if(this.loading=!0,this.view&&this.$emit("update:form",this.view.formBak),e.prev=2,e.t0=this.getData,!e.t0){e.next=7;break}return e.next=7,this.getData();case 7:this.$nextTick(function(){t.setInitialValues()}),e.next=13;break;case 10:e.prev=10,e.t1=e["catch"](2),Promise.reject(e.t1);case 13:this.loading=!1;case 14:case"end":return e.stop()}},e,this,[[2,10]])}));function t(){return e.apply(this,arguments)}return t}(),onSubmit:function(){var e=Object(a["a"])(regeneratorRuntime.mark(function e(){var t;return regeneratorRuntime.wrap(function(e){while(1)switch(e.prev=e.next){case 0:if(this.$emit("update:errors",{}),e.prev=1,e.t0=this.submit,!e.t0){e.next=6;break}return e.next=6,this.submit();case 6:if(this.$message.success(Object(d["h"])(this.editMode?"updated":"created")),!this.stay&&!this.disableRedirect){e.next=9;break}return e.abrupt("return");case 9:t=this.editMode?this.updatedRedirect:this.createdRedirect,"string"===typeof t?this.$router.push(t):"function"===typeof t&&t(),e.next=17;break;case 13:e.prev=13,e.t1=e["catch"](1),this.$emit("update:errors",Object(d["j"])(e.t1.response)),422!==u()(e.t1,"response.status")&&Promise.reject(e.t1);case 17:case"end":return e.stop()}},e,this,[[1,13]])}));function t(){return e.apply(this,arguments)}return t}(),onReset:function(){this.$refs.form.resetFields()}},watch:{$route:{handler:function(){this.$active&&this._getData()},immediate:!0}},render:function(e){var t=this,r=this.$slots.default;Array.isArray(r)&&(r=r.map(function(r){var n=r.componentOptions,a=n.propsData,o=a.helper,s=a.label;if(o){o=o.replace(/\n/g,"<br>");var c=e("template",{slot:"label"},[e("span",[s]),e("el-tooltip",{attrs:{effect:"dark",placement:"top-start","popper-class":"form-helper-popper ".concat(t.miniWidth?"mini-width":"")}},[e("div",{slot:"content",domProps:{innerHTML:o}}),e("i",{class:"ml-1 el-icon-question helper"})])]);return e("el-form-item",{props:n.propsData},[c].concat(Object(i["a"])(n.children)))}return r}));!this.disableStay&&e("el-checkbox",{attrs:{title:"表单提交后,留在此页"},model:{value:t.stay,callback:function(e){t.stay=e}}},["留在此页"]);var n=this.$slots.footer||e("el-form-item",{class:"footer"},[e("loading-action",{attrs:{type:"primary",action:this.onSubmit}},[this.submitText]),e("el-button",{on:{click:this.onReset}},["重置"]),this.$slots.footerAppend,e("flex-spacer")]);return e("el-form",{props:m({model:this.form,errors:this.errors,labelPosition:this.realLabelPosition},this.$attrs),on:m({},this.$listeners),class:{"in-dialog":this.inDialog},style:{width:this.inDialog?"auto":"800px"},directives:[{name:"loading",value:this.loading}],ref:"form"},[r,n])}},_=v,g=(r("6cbc"),r("8a92"),r("2877")),y=Object(g["a"])(_,b,h,!1,null,"3084f0c4",null);t["a"]=y.exports},b64d:function(e,t,r){"use strict";r.d(t,"b",function(){return i}),r.d(t,"c",function(){return a}),r.d(t,"d",function(){return o}),r.d(t,"e",function(){return s}),r.d(t,"a",function(){return c});var n=r("bf9a");function i(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return n["b"].get("area",{params:e})}function a(e){return n["b"].get("area/".concat(e))}function o(e){return n["b"].post("area",e)}function s(e,t){return n["b"].put("area/".concat(e),t)}function c(e){return n["b"].get("area/".concat(e,"/edit"))}},da8a:function(e,t,r){"use strict";r.r(t);var n=function(){var e=this,t=e.$createElement,r=e._self._c||t;return r("el-card",{scopedSlots:e._u([{key:"header",fn:function(){return[r("content-header")]},proxy:!0}])},[r("el-row",{attrs:{type:"flex",justify:"center"}},[r("lz-form",{ref:"form",attrs:{"get-data":e.getData,submit:e.onSubmit,errors:e.errors,form:e.form,"edit-mode":e.editMode,rules:e.rules},on:{"update:errors":function(t){e.errors=t},"update:form":function(t){e.form=t}}},[r("el-form-item",{attrs:{label:"活动名称:",required:"",prop:"name"}},[r("el-input",{model:{value:e.form.name,callback:function(t){e.$set(e.form,"name",t)},expression:"form.name"}})],1),r("el-form-item",{attrs:{label:"背景图",required:"",prop:"background_image"}},[r("el-upload",{staticClass:"avatar-uploader",attrs:{action:"/admin-api/invite_new_users_configs/uploadImg",name:"background_image",headers:e.uploadHeaders,"show-file-list":!1,"on-success":e.handleAvatarSuccess,"before-upload":e.beforeAvatarUpload}},[e.form.background_image?r("img",{attrs:{src:e.form.background_image}}):r("i",{staticClass:"el-icon-plus avatar-uploader-icon"})])],1),r("el-form-item",{attrs:{label:"需要达成条件",required:"",prop:"condition"}},[r("el-radio",{attrs:{label:e.condition1,border:""},model:{value:e.form.condition,callback:function(t){e.$set(e.form,"condition",t)},expression:"form.condition"}},[e._v("实名认证")]),r("el-radio",{attrs:{label:e.condition2,border:""},model:{value:e.form.condition,callback:function(t){e.$set(e.form,"condition",t)},expression:"form.condition"}},[e._v("完成首单")])],1),r("el-form-item",{attrs:{label:"区域",prop:"area_id"}},[r("el-select",{attrs:{filterable:"",clearable:"",placeholder:"请选择"},model:{value:e.form.area_id,callback:function(t){e.$set(e.form,"area_id",t)},expression:"form.area_id"}},e._l(e.areas,function(e){return r("el-option",{key:e.id,attrs:{label:e.name,value:e.id}})}),1)],1),r("el-form-item",{attrs:{label:"活动开始时间",required:"",prop:"start_time"}},[r("el-date-picker",{attrs:{type:"datetime",placeholder:"选择日期时间"},model:{value:e.form.start_time,callback:function(t){e.$set(e.form,"start_time",t)},expression:"form.start_time"}})],1),r("el-form-item",{attrs:{label:"活动结束时间",required:"",prop:"end_time"}},[r("el-date-picker",{attrs:{type:"datetime",placeholder:"选择日期时间"},model:{value:e.form.end_time,callback:function(t){e.$set(e.form,"end_time",t)},expression:"form.end_time"}})],1),r("el-form-item",{attrs:{label:"是否启用:",required:"",prop:"status"}},[r("el-radio",{attrs:{label:e.status1,border:""},model:{value:e.form.status,callback:function(t){e.$set(e.form,"status",t)},expression:"form.status"}},[e._v("启用")]),r("el-radio",{attrs:{label:e.status0,border:""},model:{value:e.form.status,callback:function(t){e.$set(e.form,"status",t)},expression:"form.status"}},[e._v("停用")])],1),r("el-form-item",{attrs:{label:"是否可重复任务",required:"",prop:"is_repeat"}},[r("el-radio",{attrs:{label:e.is_repeat0,border:""},model:{value:e.form.is_repeat,callback:function(t){e.$set(e.form,"is_repeat",t)},expression:"form.is_repeat"}},[e._v("否")]),r("el-radio",{attrs:{label:e.is_repeat1,border:""},model:{value:e.form.is_repeat,callback:function(t){e.$set(e.form,"is_repeat",t)},expression:"form.is_repeat"}},[e._v("是")])],1),e._l(e.form.dynamic_item,function(t,n){return r("el-card",{key:n,attrs:{"body-style":"padding-left: 0;"}},[r("el-form-item",{attrs:{label:"需要邀请人数",required:"",prop:"dynamic_item."+n+".num"}},[r("el-input-number",{attrs:{precision:0,step:1,max:100},model:{value:t.num,callback:function(r){e.$set(t,"num",r)},expression:"item.num"}})],1),r("el-form-item",{attrs:{label:"赠送类别",required:"",prop:"dynamic_item."+n+".give_type"}},[r("el-radio",{attrs:{label:"card",border:""},model:{value:t.give_type,callback:function(r){e.$set(t,"give_type",r)},expression:"item.give_type"}},[e._v("送骑行卡")]),r("el-radio",{attrs:{label:"coupon",border:""},model:{value:t.give_type,callback:function(r){e.$set(t,"give_type",r)},expression:"item.give_type"}},[e._v("送优惠券")]),r("el-radio",{attrs:{label:"balance",border:""},model:{value:t.give_type,callback:function(r){e.$set(t,"give_type",r)},expression:"item.give_type"}},[e._v("送余额")])],1),r("el-form-item",{directives:[{name:"show",rawName:"v-show",value:"card"==t.give_type,expression:"item.give_type == 'card'"}],attrs:{prop:"dynamic_item."+n+".card_id",required:"",label:"骑行卡"}},[r("el-select",{staticClass:"limit-width",attrs:{placeholder:"请选择"},model:{value:t.card_id,callback:function(r){e.$set(t,"card_id",r)},expression:"item.card_id"}},e._l(e.cards,function(e){return r("el-option",{key:e.id,attrs:{label:e.name,value:e.id}})}),1)],1),r("el-form-item",{directives:[{name:"show",rawName:"v-show",value:"coupon"==t.give_type,expression:"item.give_type == 'coupon'"}],attrs:{prop:"dynamic_item."+n+".coupon_id",required:"",label:"优惠券"}},[r("el-select",{staticClass:"limit-width",attrs:{placeholder:"请选择"},model:{value:t.coupon_id,callback:function(r){e.$set(t,"coupon_id",r)},expression:"item.coupon_id"}},e._l(e.coupons,function(e){return r("el-option",{key:e.id,attrs:{label:e.title,value:e.id}})}),1)],1),r("el-form-item",{directives:[{name:"show",rawName:"v-show",value:"coupon"==t.give_type,expression:"item.give_type == 'coupon'"}],attrs:{label:"送券数量:",required:"",prop:"dynamic_item."+n+".coupon_num"}},[r("el-input-number",{attrs:{min:0,step:1,max:10},model:{value:t.coupon_num,callback:function(r){e.$set(t,"coupon_num",r)},expression:"item.coupon_num"}})],1),r("el-form-item",{directives:[{name:"show",rawName:"v-show",value:"balance"==t.give_type,expression:"item.give_type == 'balance'"}],attrs:{label:"赠送余额:",required:"",prop:"dynamic_item."+n+".balance"}},[r("el-input-number",{attrs:{min:0,step:.01,max:100},model:{value:t.balance,callback:function(r){e.$set(t,"balance",r)},expression:"item.balance"}})],1),r("el-form-item",[r("el-button",{directives:[{name:"show",rawName:"v-show",value:0!==n,expression:"index!==0"}],attrs:{type:"danger"},on:{click:function(r){return e.deleteItem(t,n)}}},[e._v("删除")])],1)],1)}),r("el-button",{attrs:{type:"warning"},on:{click:e.addItem}},[e._v("增加")])],2)],1)],1)},i=[],a=(r("ac6a"),r("5df3"),r("768b")),o=(r("96cf"),r("3b8d")),s=r("ada3"),c=r("0137"),u=r("2b3d"),l=r("b64d"),d=r("94b0"),f=r("a469"),p=r("fe06"),m={name:"Form",components:{LzForm:s["a"]},mixins:[p["a"]],data:function(){return{form:{name:"",background_image:"",condition:0,dynamic_item:[{give_type:"",num:0,card_id:"",coupon_id:"",coupon_num:0,balance:0}],is_repeat:0,start_time:new Date,end_time:new Date,status:1,area_id:""},rules:{},errors:{},areas:[],condition1:1,condition2:2,is_give_card0:0,is_give_card1:1,is_give_coupon0:0,is_give_coupon1:1,is_repeat0:0,is_repeat1:1,cards:[],coupons:[],status1:1,status0:0,uploadHeaders:{Authorization:""}}},created:function(){var e=Object(o["a"])(regeneratorRuntime.mark(function e(){var t,r,n,i,o;return regeneratorRuntime.wrap(function(e){while(1)switch(e.prev=e.next){case 0:return this.uploadHeaders.Authorization=Object(d["a"])(),e.next=3,Promise.all([Object(f["b"])({all:1,is_give:1})]);case 3:return t=e.sent,r=Object(a["a"])(t,1),n=r[0].data,this.cards=n,e.next=9,Object(c["b"])({all:1});case 9:i=e.sent,o=i.data,this.coupons=o;case 12:case"end":return e.stop()}},e,this)}));function t(){return e.apply(this,arguments)}return t}(),methods:{addItem:function(){this.form.dynamic_item.push({give_type:"",num:0,card_id:"",coupon_id:"",coupon_num:0,balance:0})},deleteItem:function(e,t){0!==t&&this.form.dynamic_item.splice(t,1)},onSubmit:function(){var e=Object(o["a"])(regeneratorRuntime.mark(function e(){return regeneratorRuntime.wrap(function(e){while(1)switch(e.prev=e.next){case 0:if(!this.editMode){e.next=5;break}return e.next=3,Object(u["f"])(this.resourceId,this.form);case 3:e.next=7;break;case 5:return e.next=7,Object(u["e"])(this.form);case 7:case"end":return e.stop()}},e,this)}));function t(){return e.apply(this,arguments)}return t}(),getData:function(){var e=Object(o["a"])(regeneratorRuntime.mark(function e(){var t,r,n,i,o;return regeneratorRuntime.wrap(function(e){while(1)switch(e.prev=e.next){case 0:return e.next=2,Promise.all([Object(l["b"])({all:1})]);case 2:if(t=e.sent,r=Object(a["a"])(t,1),n=r[0].data,this.areas=n,!this.editMode){e.next=12;break}return e.next=9,Object(u["a"])(this.resourceId);case 9:i=e.sent,o=i.data,this.fillForm(o);case 12:case"end":return e.stop()}},e,this)}));function t(){return e.apply(this,arguments)}return t}(),beforeAvatarUpload:function(e){var t="image/jpeg"===e.type,r="image/png"===e.type,n=e.size/1024/1024<2;return t||r||this.$message.error("上传头像图片只能是 JPG/PNG 格式!"),n||this.$message.error("上传头像图片大小不能超过 2MB!"),(t||r)&&n},handleAvatarSuccess:function(e,t){this.form.background_image=e.path}}},b=m,h=(r("143d"),r("2877")),v=Object(h["a"])(b,n,i,!1,null,"431b763b",null);t["default"]=v.exports},fe06:function(e,t,r){"use strict";var n=r("873a");t["a"]={provide:function(){return{view:this}},data:function(){return{formField:"form",idField:"id"}},computed:{editMode:function(){return!!this.resourceId},resourceId:function(){return this.$route.params[this.idField]}},created:function(){this.backupForm()},methods:{getResourceId:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"id";return this.$route.params[e]},backupForm:function(){this.formBak=JSON.parse(JSON.stringify(this.$data[this.formField]))},fillForm:function(e){this.$data[this.formField]=Object(n["b"])(this.$data[this.formField],e)}}}}}]);
  2. //# sourceMappingURL=chunk-0cd26d57.574b84b4.js.map