(window["webpackJsonp"]=window["webpackJsonp"]||[]).push([["chunk-d74c9840"],{"3bbe":function(e,t,r){var a=r("861d");e.exports=function(e){if(!a(e)&&null!==e)throw TypeError("Can't set "+String(e)+" as a prototype");return e}},7156:function(e,t,r){var a=r("861d"),i=r("d2bb");e.exports=function(e,t,r){var n,o;return i&&"function"==typeof(n=t.constructor)&&n!==r&&a(o=n.prototype)&&o!==r.prototype&&i(e,o),e}},"782d":function(e,t,r){"use strict";var a=r("ab5c"),i=r.n(a);i.a},a434:function(e,t,r){"use strict";var a=r("23e7"),i=r("23cb"),n=r("a691"),o=r("50c4"),s=r("7b0b"),l=r("65f0"),c=r("8418"),u=r("1dde"),m=r("ae40"),f=u("splice"),d=m("splice",{ACCESSORS:!0,0:0,1:2}),p=Math.max,v=Math.min,h=9007199254740991,g="Maximum allowed length exceeded";a({target:"Array",proto:!0,forced:!f||!d},{splice:function(e,t){var r,a,u,m,f,d,b=s(this),_=o(b.length),y=i(e,_),C=arguments.length;if(0===C?r=a=0:1===C?(r=0,a=_-y):(r=C-2,a=v(p(n(t),0),_-y)),_+r-a>h)throw TypeError(g);for(u=l(b,a),m=0;m_-a+r;m--)delete b[m-1]}else if(r>a)for(m=_-a;m>y;m--)f=m+a-1,d=m+r-1,f in b?b[d]=b[f]:delete b[d];for(m=0;m2)if(c=h(c),t=c.charCodeAt(0),43===t||45===t){if(r=c.charCodeAt(2),88===r||120===r)return NaN}else if(48===t){switch(c.charCodeAt(1)){case 66:case 98:a=2,i=49;break;case 79:case 111:a=8,i=55;break;default:return+c}for(n=c.slice(2),o=n.length,s=0;si)return NaN;return parseInt(n,a)}return+c};if(n(g,!b(" 0o1")||!b("0b1")||b("+0x1"))){for(var x,k=function(e){var t=arguments.length<1?0:e,r=this;return r instanceof k&&(y?m((function(){_.valueOf.call(r)})):l(r)!=g)?c(new b(C(t)),r,k):C(t)},w=a?d(b):"MAX_VALUE,MIN_VALUE,NaN,NEGATIVE_INFINITY,POSITIVE_INFINITY,EPSILON,isFinite,isInteger,isNaN,isSafeInteger,MAX_SAFE_INTEGER,MIN_SAFE_INTEGER,parseFloat,parseInt,isInteger".split(","),N=0;w.length>N;N++)s(b,x=w[N])&&!s(k,x)&&v(k,x,p(b,x));k.prototype=_,_.constructor=k,o(i,g,k)}},ab5c:function(e,t,r){},bf19:function(e,t,r){"use strict";var a=r("23e7");a({target:"URL",proto:!0,enumerable:!0},{toJSON:function(){return URL.prototype.toString.call(this)}})},d2bb:function(e,t,r){var a=r("825a"),i=r("3bbe");e.exports=Object.setPrototypeOf||("__proto__"in{}?function(){var e,t=!1,r={};try{e=Object.getOwnPropertyDescriptor(Object.prototype,"__proto__").set,e.call(r,[]),t=r instanceof Array}catch(n){}return function(r,n){return a(r),i(n),t?e.call(r,n):r.__proto__=n,r}}():void 0)},ed08:function(e,t,r){"use strict";r.d(t,"a",(function(){return a})),r.d(t,"b",(function(){return i})),r.d(t,"c",(function(){return n}));r("a9e3"),r("ac1f"),r("5319"),r("bf19");function a(e){var t=new Date(e).toJSON(),r=new Date(+new Date(t)+288e5).toISOString().replace(/T/g," ").replace(/\.[\d]{3}Z/,"");return r}function i(e){var t=new Date(e),r=t.getFullYear(),a=t.getMonth()+1<10?"0"+(t.getMonth()+1):t.getMonth()+1,i=t.getDate()<10?"0"+t.getDate():t.getDate(),n=t.getHours()<10?"0"+t.getHours():t.getHours(),o=t.getMinutes()<10?"0"+t.getMinutes():t.getMinutes(),s=t.getSeconds()<10?"0"+t.getSeconds():t.getSeconds();return r+"-"+a+"-"+i+" "+n+":"+o+":"+s}function n(e){var t=new Date(1e3*Number(e)),r=t.getFullYear()+"-",a=(t.getMonth()+1<10?"0"+(t.getMonth()+1):t.getMonth()+1)+"-",i=(t.getDate()<10?"0"+t.getDate():t.getDate())+" ",n=(t.getHours()<10?"0"+t.getHours():t.getHours())+":",o=(t.getMinutes()<10?"0"+t.getMinutes():t.getMinutes())+":",s=t.getSeconds()<10?"0"+t.getSeconds():t.getSeconds(),l=r+a+i+n+o+s;return l}},fa4c:function(e,t,r){"use strict";r.r(t);var a=function(){var e=this,t=e.$createElement,r=e._self._c||t;return r("div",{staticClass:"rollbagadd baiduUe"},[r("div",{staticClass:"outmain ba_f heighthv pad_20 bor_rad5"},[e._m(0),r("div",{staticClass:"mar_t20 flex-bet flex-y-top"},[r("div",{staticClass:"flex-g-1"},[r("el-form",{ref:"form",attrs:{model:e.form,"label-width":"180px"}},[r("el-form-item",{attrs:{label:"活动名称",required:!0}},[r("el-input",{attrs:{placeholder:"请输入活动名称"},model:{value:e.form.name,callback:function(t){e.$set(e.form,"name",t)},expression:"form.name"}}),r("div",{staticClass:"yb_margin lh16"},[e._v("建议名称由“店铺名+原总价+代金劵”组成")])],1),r("el-form-item",{attrs:{label:"活动时间",required:!0}},[r("el-date-picker",{attrs:{type:"datetimerange",align:"right","start-placeholder":"开始日期","end-placeholder":"结束日期","default-time":["08:00:00","23:59:59"]},model:{value:e.timeData,callback:function(t){e.timeData=t},expression:"timeData"}})],1),r("el-form-item",{attrs:{label:"卡券组合",required:!0}},[r("el-radio-group",{model:{value:e.form.type,callback:function(t){e.$set(e.form,"type",t)},expression:"form.type"}},[r("el-radio",{attrs:{label:"1"}},[e._v("品牌代金券")])],1),e._l(e.form.coupon,(function(t,a){return r("div",{key:a,staticClass:"flex"},[r("div",[r("div",[e._v("类型")]),r("div",{staticClass:"cusipw"},[r("el-select",{attrs:{placeholder:"请选择",disabled:""},model:{value:e.timeType,callback:function(t){e.timeType=t},expression:"timeType"}},[r("el-option",{attrs:{label:"代金券",value:"1"}})],1)],1)]),r("div",{staticClass:"mar_l20"},[r("div",[e._v("使用门槛")]),r("div",{staticClass:"cusipw"},[r("el-input",{attrs:{placeholder:"请输入金额",type:"number"},model:{value:t.fullMoney,callback:function(r){e.$set(t,"fullMoney",r)},expression:"item.fullMoney"}},[r("template",{slot:"append"},[e._v("元")])],2)],1)]),r("div",{staticClass:"mar_l20"},[r("div",[e._v("券金额")]),r("div",{staticClass:"cusipw"},[r("el-input",{attrs:{placeholder:"请输入金额",type:"number"},on:{input:e.priceChange},model:{value:t.money,callback:function(r){e.$set(t,"money",r)},expression:"item.money"}},[r("template",{slot:"append"},[e._v("元")])],2)],1)]),r("div",{staticClass:"mar_l20"},[r("div",[e._v("可用张数")]),r("div",{staticClass:"cusipw"},[r("el-input",{attrs:{placeholder:"请输入张数",type:"number"},on:{input:e.priceChange},model:{value:t.num,callback:function(r){e.$set(t,"num",r)},expression:"item.num"}},[r("template",{slot:"append"},[e._v("张")])],2)],1)]),r("el-button",{staticClass:"fon_12 mar_l20 mar_t20",attrs:{size:"small",type:"text"},on:{click:function(t){return e.delfullArr(a)}}},[e._v("删除")])],1)})),r("el-button",{directives:[{name:"show",rawName:"v-show",value:e.form.coupon.length<10,expression:"form.coupon.length<10"}],staticClass:"mar_t10",attrs:{type:"text"},on:{click:e.addfullArr}},[r("Icon",{attrs:{type:"md-add"}}),e._v("添加代金券,最多10种 ")],1),r("div",{staticClass:"flex"},[r("div",[r("div",[e._v("原总价")]),r("div",{staticClass:"cusipw"},[r("el-input",{attrs:{disabled:"",type:"number"},model:{value:e.form.price,callback:function(t){e.$set(e.form,"price",t)},expression:"form.price"}},[r("template",{slot:"append"},[e._v("元")])],2)],1)]),r("div",{staticClass:"mar_l20"},[r("div",[e._v("现总售价")]),r("div",{staticClass:"cusipw"},[r("el-input",{attrs:{placeholder:"请输入金额",type:"number"},model:{value:e.form.money,callback:function(t){e.$set(e.form,"money",t)},expression:"form.money"}},[r("template",{slot:"append"},[e._v("元")])],2)],1)])]),r("div",{staticClass:"yb_margin lh16"},[e._v("原总价 = 券金额 * 可用张数,现总售价为顾客需付款金额")])],2),r("el-form-item",{attrs:{label:"封面图"}},[e.form.icon?r("div",{staticClass:"uploadSource bor_de rel flex"},[r("label",{staticClass:"statusLabel curs",on:{mouseenter:function(t){return e.enter(1)},mouseleave:function(t){return e.leave(1)}}},[r("i",{ref:"imgicon1",staticClass:"el-icon-check"}),r("i",{staticClass:"el-icon-close",on:{click:function(t){return e.deleteMultiImage(e.form.icon,1)}}})]),r("img",{staticClass:"wid",attrs:{src:e.form.icon},on:{click:function(t){return e.test(1)}}})]):r("div",{staticClass:"uploadSource flex-center curs",on:{click:function(t){return e.test(1)}}},[r("i",{staticClass:"el-icon-plus fon_40 color_d9"})]),r("attachment-img",{ref:"img1",attrs:{type:"img"},on:{attachment:e.imgadd1}}),r("div",{staticClass:"yb_margin"},[e._v("建议尺寸: 800*800px")])],1),r("el-form-item",{attrs:{label:"展示图片"}},[e._l(e.form.media,(function(t,a){return r("div",{key:a,staticClass:"uploadSource bor_de rel flex"},[r("label",{staticClass:"statusLabel curs",on:{mouseenter:function(t){return e.enterMultigraph(a,1)},mouseleave:function(t){return e.leaveMultigraph(a,1)}}},[r("i",{ref:"list1"+a,refInFor:!0,staticClass:"el-icon-check"}),r("i",{staticClass:"el-icon-close",on:{click:function(r){return e.deleteMultiImage(t,2,"multigraph")}}})]),r("img",{staticClass:"wid img",attrs:{src:t},on:{click:function(t){return e.test(2)}}})])})),r("div",{staticClass:"uploadSource flex-center curs",on:{click:function(t){return e.test(2)}}},[r("i",{staticClass:"el-icon-plus fon_40 color_d9"})]),r("attachment-img",{ref:"img2",attrs:{type:"imgs"},on:{attachment:e.multigraph1}}),r("div",{staticClass:"yb_margin"},[e._v("建议尺寸: 800*800px")])],2),r("el-form-item",{attrs:{label:"库存",required:!0}},[r("el-input",{attrs:{placeholder:"请输入库存"},model:{value:e.form.stock,callback:function(t){e.$set(e.form,"stock",t)},expression:"form.stock"}})],1),r("el-form-item",{attrs:{label:"每人每日购买",required:!0}},[r("el-input",{attrs:{placeholder:"请输入份数",type:"number"},model:{value:e.form.dayNum,callback:function(t){e.$set(e.form,"dayNum",t)},expression:"form.dayNum"}},[r("template",{slot:"append"},[e._v("份")])],2)],1),r("el-form-item",{attrs:{label:"有效期",required:!0}},[r("span",{staticClass:"mar_lr10"},[e._v("购买后内")]),r("el-input",{attrs:{placeholder:"请输入天数",type:"number"},model:{value:e.form.days,callback:function(t){e.$set(e.form,"days",t)},expression:"form.days"}},[r("template",{slot:"append"},[e._v("天")])],2),r("span",{staticClass:"mar_lr10"},[e._v("有效")])],1),r("el-form-item",{attrs:{label:"券说明"}},[r("baidu-ueditor",{attrs:{content:e.form.details},on:{ueditor:e.getUeditor}})],1)],1)],1),r("div",{staticClass:"flex-g-0 pad_lr_20"},[r("div",{staticClass:"fon_16"},[e._v("常见问题")]),r("el-collapse",{staticClass:"mar_tb10",staticStyle:{width:"260px"},attrs:{accordion:""},model:{value:e.collapseName,callback:function(t){e.collapseName=t},expression:"collapseName"}},[r("el-collapse-item",{attrs:{title:"什么是券包?",name:"1"}},[r("div",[e._v("券包是指多种优惠券打包销售,让用户以更优惠的价格买到更高的优惠。")])]),r("el-collapse-item",{attrs:{title:"为什么要做券包功能?",name:"2"}},[r("div",[e._v("券包对商家是一种营销手段,帮助商家引流、拉新,进一步带动销售。")])]),r("el-collapse-item",{attrs:{title:"哪些用户可以购买券包",name:"3"}},[r("div",[e._v("满足条件的用户均可购买")])])],1),r("div",{staticClass:"fon_16 mar_t20"},[e._v("活动规则")]),e._m(1)],1)])]),r("div",{staticClass:"mar_t20 ba_f pad_20 t_c"},[r("el-button",{attrs:{type:"primary"},on:{click:e.submitForm}},[e._v("立即创建")])],1)])},i=[function(){var e=this,t=e.$createElement,r=e._self._c||t;return r("div",{staticClass:"shuju_title mar_b20"},[r("div",{staticClass:"shuju_title_text"},[r("span",[e._v("新建组合券包")])])])},function(){var e=this,t=e.$createElement,r=e._self._c||t;return r("div",{staticClass:"color_9 mar_t10 lh30 fon_13"},[r("div",[e._v("1.活动仅限在线支付订单;")]),r("div",[e._v("2.活动成本由商家承担,与店铺其他活动默认同享")])])}],n=(r("99af"),r("4160"),r("c975"),r("a434"),r("a9e3"),r("159b"),r("96cf"),r("1da1")),o=r("7cb7"),s=r("ed08"),l=r("fc6e"),c=r("9893"),u={created:function(){this.$route.query.id&&(this.id=this.$route.query.id,this.edit())},components:{attachmentImg:l["a"],baiduUeditor:c["a"]},data:function(){return{form:{name:"",money:"",details:"",coupon:[{fullMoney:"",money:"",num:""}],type:"1",icon:"",media:[],price:0,stock:"",dayNum:"",days:""},timeType:"1",timeData:[new Date,(new Date).setMonth((new Date).getMonth()+3)],collapseName:""}},methods:{addfullArr:function(){var e=this,t={fullMoney:"",money:"",num:""};this.$set(this.form.coupon,this.form.coupon.length,t),this.form.price=0,this.form.coupon.forEach((function(t){e.form.price+=Number(t.money)*Number(t.num)}))},delfullArr:function(e){var t=this;this.radioTrue=!0,this.$delete(this.form.coupon,e),this.form.price=0,this.form.coupon.forEach((function(e){t.form.price+=Number(e.money)*Number(e.num)}))},priceChange:function(){var e=this;this.form.price=0,this.form.coupon.forEach((function(t){e.form.price+=Number(t.money)*Number(t.num)}))},getUeditor:function(e){this.form.details=e},edit:function(){var e=this;return Object(n["a"])(regeneratorRuntime.mark((function t(){var r,a;return regeneratorRuntime.wrap((function(t){while(1)switch(t.prev=t.next){case 0:return t.next=2,Object(o["mc"])({id:e.id});case 2:r=t.sent,a=r.data,e.form2=e.form,e.form=Object.assign(e.form2,a),a.startTime&&(e.timeData=[a.startTime,a.endTime]);case 7:case"end":return t.stop()}}),t)})))()},enter:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:0;this.$refs["imgicon"+e].style.display="none"},leave:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:0;this.$refs["imgicon"+e].style.display="inline-block"},test:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:0;console.log(this.$refs,e),this.$refs["img"+e].dialogVisible=!0},imgadd1:function(e){this.form.icon=e.str},enterMultigraph:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0;this.$refs["list".concat(t).concat(e)][0].style.display="none"},leaveMultigraph:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0;this.$refs["list".concat(t).concat(e)][0].style.display="inline-block"},multigraph1:function(e){this.form.media&&this.form.media.length>0?this.form.media=this.form.media.concat(e.arr):this.form.media=e.arr},deleteMultiImage:function(e,t,r){if(Array.prototype.remove=function(e){var t=this.indexOf(e);t>-1&&this.splice(t,1)},"multigraph"==r)switch(t){case 2:this.form.media.remove(e);break}else switch(t){case 1:this.form.icon="";break}},submitForm:function(){var e=this;return Object(n["a"])(regeneratorRuntime.mark((function t(){return regeneratorRuntime.wrap((function(t){while(1)switch(t.prev=t.next){case 0:e.$refs["form"].validate(function(){var t=Object(n["a"])(regeneratorRuntime.mark((function t(r){var a,i;return regeneratorRuntime.wrap((function(t){while(1)switch(t.prev=t.next){case 0:if(!r){t.next=10;break}return e.timeData&&(e.form.startTime=Object(s["a"])(e.timeData[0]),e.form.endTime=Object(s["a"])(e.timeData[1])),t.next=4,Object(o["pc"])(e.form);case 4:a=t.sent,i=a.msg,e.$baseMessage(i,"success"),e.$router.go(-1),t.next=11;break;case 10:return t.abrupt("return",!1);case 11:case"end":return t.stop()}}),t)})));return function(e){return t.apply(this,arguments)}}());case 1:case"end":return t.stop()}}),t)})))()}}},m=u,f=(r("782d"),r("2877")),d=Object(f["a"])(m,a,i,!1,null,null,null);t["default"]=d.exports}}]);