(window["webpackJsonp"]=window["webpackJsonp"]||[]).push([["bargain"],{"15a4":function(e,t,r){"use strict";r.r(t);r("ac1f"),r("841c");var a=function(){var e=this,t=e._self._c;return t("a-card",{attrs:{bordered:!1}},[t("div",{staticClass:"card-title"},[e._v(e._s(e.$route.meta.title))]),t("div",{staticClass:"table-operator"},[t("a-row",[t("a-col",{staticClass:"flex flex-x-end"},[t("a-select",{staticStyle:{width:"220px","margin-right":"20px"},attrs:{placeholder:"是否购买"},model:{value:e.queryParam.isBuy,callback:function(t){e.$set(e.queryParam,"isBuy",t)},expression:"queryParam.isBuy"}},[t("a-select-option",{attrs:{value:-1}},[e._v("全部")]),t("a-select-option",{attrs:{value:0}},[e._v("未购买")]),t("a-select-option",{attrs:{value:1}},[e._v("已购买")])],1),t("a-select",{staticStyle:{width:"220px","margin-right":"20px"},attrs:{placeholder:"任务状态"},model:{value:e.queryParam.status,callback:function(t){e.$set(e.queryParam,"status",t)},expression:"queryParam.status"}},[t("a-select-option",{attrs:{value:-1}},[e._v("全部")]),t("a-select-option",{attrs:{value:1}},[e._v("进行中")]),t("a-select-option",{attrs:{value:0}},[e._v("已结束")])],1),t("a-input-search",{staticStyle:{"max-width":"300px","min-width":"150px"},attrs:{placeholder:"请输入会员昵称/商品名称"},on:{search:e.onSearch},model:{value:e.queryParam.search,callback:function(t){e.$set(e.queryParam,"search",t)},expression:"queryParam.search"}})],1)],1)],1),t("s-table",{ref:"table",attrs:{rowKey:"task_id",loading:e.isLoading,columns:e.columns,data:e.loadData,pagination:e.pagination,scroll:{x:1400}},scopedSlots:e._u([{key:"goods",fn:function(e){return[t("GoodsItem",{attrs:{data:{image:e.goods_image,imageAlt:"商品图片",title:e.goods_name,subtitle:"¥".concat(e.goods_price_min)},subTitleColor:!0}})]}},{key:"user",fn:function(e){return[t("UserItem",{attrs:{user:e}})]}},{key:"price",fn:function(r){return[t("p",{staticClass:"c-p",style:{textDecoration:"line-through"}},[e._v("¥"+e._s(r.goods_price))]),t("p",{staticClass:"c-p"},[e._v("¥"+e._s(r.floor_price))])]}},{key:"cut_money",fn:function(r){return[t("p",{staticClass:"c-p"},[e._v("¥"+e._s(r))])]}},{key:"peoples",fn:function(r){return[t("p",[e._v(e._s(r.peoples)+"人")]),t("p",[e._v(e._s(r.cut_people)+"人")])]}},{key:"is_buy",fn:function(r){return[t("a-tag",{attrs:{color:r?"green":""}},[e._v(e._s(r?"已购买":"未购买"))])]}},{key:"status",fn:function(r){return[t("a-tag",{attrs:{color:r?"green":""}},[e._v(e._s(r?"进行中":"已结束"))])]}},{key:"time",fn:function(r){return[t("p",[e._v(e._s(r.create_time))]),t("p",[e._v(e._s(r.end_time))])]}},{key:"action",fn:function(r,a){return t("span",{staticClass:"actions"},[t("a",{directives:[{name:"action",rawName:"v-action:help",arg:"help"}],on:{click:function(t){return e.handleHelp(a)}}},[e._v("砍价榜")]),t("a",{directives:[{name:"action",rawName:"v-action:delete",arg:"delete"}],on:{click:function(t){return e.handleDelete(a)}}},[e._v("删除")])])}}])}),t("HelpModal",{ref:"HelpModal"})],1)},i=[],n=r("5530"),o=(r("d3b7"),r("b775")),s={list:"/bargain.task/list",help:"/bargain.task/help",delete:"/bargain.task/delete"};function l(e){return Object(o["b"])({url:s.list,method:"get",params:e})}function u(e,t){return Object(o["b"])({url:s.help,method:"get",params:Object(n["a"])({taskId:e},t)})}function c(e,t){return Object(o["b"])({url:s.delete,method:"post",data:Object(n["a"])({taskId:e},t)})}var d=r("ab09"),m=function(){var e=this,t=e._self._c;return t("a-modal",{staticClass:"noborder",attrs:{title:e.title,width:820,visible:e.visible,isLoading:e.isLoading,maskClosable:!1},on:{ok:e.handleCancel,cancel:e.handleCancel}},[t("s-table",{ref:"table",attrs:{rowKey:"help_id",scroll:{y:"420px",scrollToFirstRowOnChange:!0},loading:e.isLoading,columns:e.columns,data:e.loadData,pagination:e.pagination},scopedSlots:e._u([{key:"user",fn:function(e){return[t("UserItem",{attrs:{user:e}})]}},{key:"mobile",fn:function(r){return[t("span",[e._v(e._s(r.user.mobile?r.user.mobile:"--"))])]}},{key:"cut_money",fn:function(r){return[t("span",{staticClass:"c-p"},[e._v("¥"+e._s(r))])]}},{key:"time",fn:function(r){return[t("span",[e._v(e._s(r.user.create_time))])]}}])})],1)},p=[],f=[{title:"记录ID",dataIndex:"help_id"},{title:"会员信息",dataIndex:"user",scopedSlots:{customRender:"user"}},{title:"砍掉的金额",dataIndex:"cut_money",scopedSlots:{customRender:"cut_money"}},{title:"操作时间",dataIndex:"create_time"}],v={components:{STable:d["b"],UserItem:d["d"]},data:function(){var e=this;return{title:"砍价助力榜",visible:!1,isLoading:!1,queryParam:{},columns:f,loadData:function(t){return u(e.taskId,Object(n["a"])(Object(n["a"])({},t),e.queryParam)).then((function(e){return e.data.list}))}}},methods:{show:function(e,t){var r=this;this.visible=!0,this.taskId=e,this.$nextTick((function(){r.handleRefresh(!0)}))},handleRefresh:function(){this.$refs.table.refresh(!0)},handleCancel:function(){this.visible=!1,this.queryParam={}}}},h=v,b=(r("2672"),r("2877")),g=Object(b["a"])(h,m,p,!1,null,"5ce7a04e",null),_=g.exports,w={name:"Index",components:{STable:d["b"],UserItem:d["d"],GoodsItem:d["a"],HelpModal:_},data:function(){var e=this;return{queryParam:{isBuy:void 0,status:void 0,search:""},isLoading:!1,columns:[{title:"任务ID",dataIndex:"task_id"},{title:"商品信息",dataIndex:"goods",width:"320px",scopedSlots:{customRender:"goods"}},{title:"会员信息",dataIndex:"user",width:"210px",scopedSlots:{customRender:"user"}},{title:"商品原价/底价",scopedSlots:{customRender:"price"}},{title:"帮砍/已砍人数",scopedSlots:{customRender:"peoples"}},{title:"已砍金额",dataIndex:"cut_money",scopedSlots:{customRender:"cut_money"}},{title:"发起/截止时间",width:"180px",scopedSlots:{customRender:"time"}},{title:"是否购买",dataIndex:"is_buy",scopedSlots:{customRender:"is_buy"}},{title:"砍价状态",dataIndex:"status",scopedSlots:{customRender:"status"}},{title:"操作",dataIndex:"action",width:"150px",fixed:"right",scopedSlots:{customRender:"action"}}],loadData:function(t){return l(Object(n["a"])(Object(n["a"])({},t),e.queryParam)).then((function(e){return e.data.list}))}}},created:function(){},methods:{handleHelp:function(e){this.$refs.HelpModal.show(e.task_id)},handleDelete:function(e){var t=this,r=t.$confirm({title:"您确定要删除该记录吗?",content:"删除后不可恢复",onOk:function(){return c(e.task_id).then((function(e){t.$message.success(e.message,1.5),t.handleRefresh()})).finally((function(e){return r.destroy()}))}})},handleRefresh:function(){var e=arguments.length>0&&void 0!==arguments[0]&&arguments[0];this.$refs.table.refresh(e)},onSearch:function(){this.handleRefresh(!0)}}},y=w,C=Object(b["a"])(y,a,i,!1,null,null,null);t["default"]=C.exports},"1da1":function(e,t,r){"use strict";r.d(t,"a",(function(){return i}));r("d3b7");function a(e,t,r,a,i,n,o){try{var s=e[n](o),l=s.value}catch(u){return void r(u)}s.done?t(l):Promise.resolve(l).then(a,i)}function i(e){return function(){var t=this,r=arguments;return new Promise((function(i,n){var o=e.apply(t,r);function s(e){a(o,i,n,s,l,"next",e)}function l(e){a(o,i,n,s,l,"throw",e)}s(void 0)}))}}},2672:function(e,t,r){"use strict";r("3c61")},"2ec16":function(e,t,r){},"3c61":function(e,t,r){},6417:function(e,t,r){"use strict";r.r(t);r("ac1f"),r("841c");var a=function(){var e=this,t=e._self._c;return t("a-card",{attrs:{bordered:!1}},[t("div",{staticClass:"card-title"},[e._v(e._s(e.$route.meta.title))]),t("div",{staticClass:"table-operator"},[t("a-row",[t("a-col",{attrs:{span:5}},[e.$auth("/apps/bargain/active/create")?t("a-button",{attrs:{type:"primary",icon:"plus"},on:{click:function(t){return e.handleAdd()}}},[e._v("新增")]):e._e()],1),t("a-col",{staticClass:"flex flex-x-end",attrs:{span:11,offset:8}},[t("a-input-search",{staticStyle:{"max-width":"300px","min-width":"150px"},attrs:{placeholder:"请输入商品名称"},on:{search:e.onSearch},model:{value:e.queryParam.search,callback:function(t){e.$set(e.queryParam,"search",t)},expression:"queryParam.search"}})],1)],1)],1),t("s-table",{ref:"table",attrs:{rowKey:"active_id",loading:e.isLoading,columns:e.columns,data:e.loadData,pagination:e.pagination,scroll:{x:1450}},scopedSlots:e._u([{key:"goods",fn:function(e){return[t("GoodsItem",{attrs:{data:{image:e.goods_image,imageAlt:"商品图片",title:e.goods_name,subtitle:"¥".concat(e.goods_price_min)},subTitleColor:!0}})]}},{key:"time",fn:function(r){return[t("p",[e._v("开始:"+e._s(r.start_time))]),t("p",[e._v("结束:"+e._s(r.end_time))])]}},{key:"floor_price",fn:function(r){return[t("p",{staticClass:"c-p"},[e._v("¥"+e._s(r))])]}},{key:"status",fn:function(r){return[t("a-tag",{attrs:{color:r?"green":"orange"}},[e._v(e._s(r?"进行中":"已结束"))])]}},{key:"action",fn:function(r,a){return t("span",{staticClass:"actions"},[e.$auth("/apps/bargain/active/update")?t("a",{on:{click:function(t){return e.handleEdit(a)}}},[e._v("编辑")]):e._e(),t("a",{directives:[{name:"action",rawName:"v-action:delete",arg:"delete"}],on:{click:function(t){return e.handleDelete(a)}}},[e._v("删除")])])}}])})],1)},i=[],n=r("5530"),o=(r("d3b7"),r("125d")),s=r("ab09"),l={name:"Index",components:{STable:s["b"],GoodsItem:s["a"]},data:function(){var e=this;return{queryParam:{search:""},isLoading:!1,columns:[{title:"活动ID",dataIndex:"active_id"},{title:"商品信息",dataIndex:"goods",width:"340px",scopedSlots:{customRender:"goods"}},{title:"活动时间",width:"220px",scopedSlots:{customRender:"time"}},{title:"砍价底价",dataIndex:"floor_price",scopedSlots:{customRender:"floor_price"}},{title:"帮砍人数",dataIndex:"peoples"},{title:"活动销量(件)",dataIndex:"actual_sales"},{title:"活动状态",dataIndex:"status",scopedSlots:{customRender:"status"}},{title:"排序",dataIndex:"sort"},{title:"创建时间",width:"180px",dataIndex:"create_time"},{title:"操作",width:"150px",fixed:"right",scopedSlots:{customRender:"action"}}],loadData:function(t){return o["e"](Object(n["a"])(Object(n["a"])({},t),e.queryParam)).then((function(e){return e.data.list}))}}},created:function(){},methods:{handleAdd:function(){this.$router.push("./create")},handleEdit:function(e){this.$router.push({path:"./update",query:{activeId:e.active_id}})},handleDelete:function(e){var t=this,r=t.$confirm({title:"您确定要删除该记录吗?",content:"删除后不可恢复",onOk:function(){return o["b"](e.active_id).then((function(e){t.$message.success(e.message,1.5),t.handleRefresh()})).finally((function(e){return r.destroy()}))}})},handleRefresh:function(){var e=arguments.length>0&&void 0!==arguments[0]&&arguments[0];this.$refs.table.refresh(e)},onSearch:function(){this.handleRefresh(!0)}}},u=l,c=r("2877"),d=Object(c["a"])(u,a,i,!1,null,null,null);t["default"]=d.exports},"7c5f":function(e,t,r){"use strict";r("2ec16")},"7db1":function(e,t,r){"use strict";r.r(t);var a=function(){var e=this,t=e._self._c;return t("a-card",{attrs:{bordered:!1}},[t("div",{staticClass:"card-title"},[e._v(e._s(e.$route.meta.title))]),t("a-spin",{attrs:{spinning:e.isLoading}},[t("a-form",{attrs:{form:e.form},on:{submit:e.handleSubmit}},[e.$module("apps-dealer")?t("a-form-item",{staticClass:"mt-30",attrs:{label:"是否参与分销",labelCol:e.labelCol,wrapperCol:e.wrapperCol}},[t("a-radio-group",{directives:[{name:"decorator",rawName:"v-decorator",value:["isDealer",{rules:[{required:!0}]}],expression:"['isDealer', { rules: [{ required: true }] }]"}]},[t("a-radio",{attrs:{value:!0}},[e._v("开启")]),t("a-radio",{attrs:{value:!1}},[e._v("关闭")])],1),t("div",{staticClass:"form-item-help"},[t("small",[e._v("注:砍价活动订单是否参与分销(需开启分销功能)")])])],1):e._e(),t("a-form-item",{attrs:{label:"砍价活动规则",labelCol:e.labelCol,wrapperCol:e.wrapperCol}},[t("a-textarea",{directives:[{name:"decorator",rawName:"v-decorator",value:["rulesDesc",{rules:[{required:!0,message:"请输入砍价规则"}]}],expression:"['rulesDesc', { rules: [{ required: true, message: '请输入砍价规则' }] }]"}],attrs:{"auto-size":{minRows:6,maxRows:12}}})],1),t("a-form-item",{attrs:{label:"每日帮砍限制",labelCol:e.labelCol,wrapperCol:e.wrapperCol}},[t("a-input-number",{directives:[{name:"decorator",rawName:"v-decorator",value:["helpCutLimitNum",{initialValue:0,rules:[{required:!0,message:"请输入每日帮砍限制"}]}],expression:"['helpCutLimitNum', { initialValue: 0, rules: [{ required: true, message: '请输入每日帮砍限制' }] }]"}],attrs:{min:0,precision:0}}),t("span",{staticClass:"ml-5"},[e._v("次")]),t("p",{staticClass:"form-item-help"},[t("small",[e._v("每人每日可以帮他人砍价的次数限制,如果为0则不限制")])])],1),t("a-form-item",{attrs:{wrapperCol:{span:e.wrapperCol.span,offset:e.labelCol.span}}},[t("a-button",{attrs:{type:"primary","html-type":"submit"}},[e._v("提交")])],1)],1)],1)],1)},i=[],n=(r("d3b7"),r("88bc")),o=r.n(n),s=r("ca00"),l=r("5530"),u=r("b775"),c={detail:"/bargain.setting/detail",update:"/bargain.setting/update"};function d(e){return Object(u["b"])({url:c.detail,method:"get",params:{key:e}})}function m(e,t){return Object(u["b"])({url:c.update,method:"post",data:Object(l["a"])({key:e},t)})}var p={data:function(){return{labelCol:{span:4},wrapperCol:{span:10},isLoading:!1,form:this.$form.createForm(this),key:"basic",record:{}}},created:function(){this.getDetail()},methods:{getDetail:function(){var e=this;this.isLoading=!0,d(this.key).then((function(t){e.record=t.data.detail,e.setFieldsValue()})).finally((function(){return e.isLoading=!1}))},setFieldsValue:function(){var e=this.record,t=this.$nextTick,r=this.form;!Object(s["f"])(r.getFieldsValue())&&t((function(){r.setFieldsValue(o()(e,["isDealer","rulesDesc","helpCutLimitNum"]))}))},handleSubmit:function(e){var t=this;e.preventDefault();var r=this.form.validateFields;r((function(e,r){!e&&t.onFormSubmit(r)}))},onFormSubmit:function(e){var t=this;this.isLoading=!0,m(this.key,{form:e}).then((function(e){return t.$message.success(e.message,1.5)})).finally((function(){return t.isLoading=!1}))}}},f=p,v=(r("c5b9"),r("2877")),h=Object(v["a"])(f,a,i,!1,null,"ecac45ee",null);t["default"]=h.exports},"88bc":function(e,t,r){(function(t){var r=1/0,a=9007199254740991,i="[object Arguments]",n="[object Function]",o="[object GeneratorFunction]",s="[object Symbol]",l="object"==typeof t&&t&&t.Object===Object&&t,u="object"==typeof self&&self&&self.Object===Object&&self,c=l||u||Function("return this")();function d(e,t,r){switch(r.length){case 0:return e.call(t);case 1:return e.call(t,r[0]);case 2:return e.call(t,r[0],r[1]);case 3:return e.call(t,r[0],r[1],r[2])}return e.apply(t,r)}function m(e,t){var r=-1,a=e?e.length:0,i=Array(a);while(++r0&&r(s)?t>1?y(s,t-1,r,a,i):p(i,s):a||(i[i.length]=s)}return i}function C(e,t){return e=Object(e),x(e,t,(function(t,r){return r in e}))}function x(e,t,r){var a=-1,i=t.length,n={};while(++a-1&&e%1==0&&e<=a}function D(e){var t=typeof e;return!!e&&("object"==t||"function"==t)}function F(e){return!!e&&"object"==typeof e}function $(e){return"symbol"==typeof e||F(e)&&h.call(e)==s}var P=q((function(e,t){return null==e?{}:C(e,m(y(t,1),L))}));e.exports=P}).call(this,r("c8ba"))},"911e":function(e,t,r){"use strict";r.r(t);var a=function(){var e=this,t=e._self._c;return t("a-card",{attrs:{bordered:!1}},[t("div",{staticClass:"card-title"},[e._v(e._s(e.$route.meta.title))]),t("a-spin",{attrs:{spinning:e.isLoading}},[t("a-form",{attrs:{form:e.form},on:{submit:e.handleSubmit}},[t("a-form-item",{attrs:{label:"砍价商品",labelCol:e.labelCol,wrapperCol:e.wrapperCol,required:""}},[e.goods?t("GoodsItem",{attrs:{data:{image:e.goods.goods_image,imageAlt:"商品图片",title:e.goods.goods_name,subtitle:"¥".concat(e.goods.goods_price_min)},subTitleColor:!0}}):e._e()],1),t("a-form-item",{attrs:{label:"活动时间",labelCol:e.labelCol,wrapperCol:e.wrapperCol}},[t("a-range-picker",{directives:[{name:"decorator",rawName:"v-decorator",value:["betweenTime",{initialValue:e.defaultDate,rules:[{required:!0,message:"请选择有效期范围"}]}],expression:"['betweenTime', { initialValue: defaultDate, rules: [{ required: true, message: '请选择有效期范围' }] }]"}],attrs:{format:"YYYY-MM-DD HH:mm:ss","show-time":{defaultValue:e.moment("00:00:00","HH:mm:ss")}}})],1),t("a-form-item",{attrs:{label:"砍价有效期",labelCol:e.labelCol,wrapperCol:e.wrapperCol}},[t("a-input-number",{directives:[{name:"decorator",rawName:"v-decorator",value:["expiryt_time",{initialValue:2,rules:[{required:!0,message:"请输入砍价有效期"}]}],expression:"['expiryt_time', { initialValue: 2, rules: [{ required: true, message: '请输入砍价有效期' }] }]"}],attrs:{min:2,precision:0}}),t("span",{staticClass:"ml-5"},[e._v("小时")]),t("p",{staticClass:"form-item-help"},[t("small",[e._v("自用户发起砍价到砍价截止的时间")])])],1),t("a-form-item",{attrs:{label:"砍价底价",labelCol:e.labelCol,wrapperCol:e.wrapperCol}},[t("a-input-number",{directives:[{name:"decorator",rawName:"v-decorator",value:["floor_price",{rules:[{required:!0,message:"请输入砍价底价"}]}],expression:"['floor_price', { rules: [{ required: true, message: '请输入砍价底价' }] }]"}],attrs:{min:.01,precision:2}}),t("span",{staticClass:"ml-5"},[e._v("元")]),t("div",{staticClass:"form-item-help"},[t("small",[e._v("砍价商品的最低价格")])])],1),t("a-form-item",{attrs:{label:"帮砍人数",labelCol:e.labelCol,wrapperCol:e.wrapperCol}},[t("a-input-number",{directives:[{name:"decorator",rawName:"v-decorator",value:["peoples",{initialValue:2,rules:[{required:!0,message:"请输入帮砍人数"}]}],expression:"['peoples', { initialValue: 2, rules: [{ required: true, message: '请输入帮砍人数' }] }]"}],attrs:{min:2,precision:0}}),t("span",{staticClass:"ml-5"},[e._v("人")]),t("p",{staticClass:"form-item-help"},[t("small",[e._v("每个砍价订单的帮砍人数,达到该人数才可砍至底价")])])],1),t("a-form-item",{attrs:{label:"可自砍一刀",labelCol:e.labelCol,wrapperCol:e.wrapperCol}},[t("a-radio-group",{directives:[{name:"decorator",rawName:"v-decorator",value:["is_self_cut",{initialValue:1,rules:[{required:!0}]}],expression:"['is_self_cut', { initialValue: 1, rules: [{ required: true }] }]"}]},[t("a-radio",{attrs:{value:1}},[e._v("允许")]),t("a-radio",{attrs:{value:0}},[e._v("不允许")])],1),t("div",{staticClass:"form-item-help"},[t("small",[e._v("砍价发起人自己砍一刀")])])],1),t("a-form-item",{attrs:{label:"必须底价购买",labelCol:e.labelCol,wrapperCol:e.wrapperCol}},[t("a-radio-group",{directives:[{name:"decorator",rawName:"v-decorator",value:["is_floor_buy",{initialValue:1,rules:[{required:!0}]}],expression:"['is_floor_buy', { initialValue: 1, rules: [{ required: true }] }]"}]},[t("a-radio",{attrs:{value:1}},[e._v("是")]),t("a-radio",{attrs:{value:0}},[e._v("否")])],1),t("div",{staticClass:"form-item-help"},[t("small",[e._v("只有砍到底价才可以购买")])])],1),t("a-form-item",{attrs:{label:"活动状态",labelCol:e.labelCol,wrapperCol:e.wrapperCol}},[t("a-radio-group",{directives:[{name:"decorator",rawName:"v-decorator",value:["status",{initialValue:1,rules:[{required:!0}]}],expression:"['status', { initialValue: 1, rules: [{ required: true }] }]"}]},[t("a-radio",{attrs:{value:1}},[e._v("进行中")]),t("a-radio",{attrs:{value:0}},[e._v("已结束")])],1)],1),t("a-form-item",{attrs:{label:"排序",labelCol:e.labelCol,wrapperCol:e.wrapperCol,extra:"数字越小越靠前"}},[t("a-input-number",{directives:[{name:"decorator",rawName:"v-decorator",value:["sort",{initialValue:100,rules:[{required:!0,message:"请输入排序值"}]}],expression:"['sort', { initialValue: 100, rules: [{ required: true, message: '请输入排序值' }] }]"}],attrs:{min:0}})],1),t("a-divider",{attrs:{orientation:"left"}},[e._v("其他设置")]),t("a-form-item",{attrs:{label:"初始销量",labelCol:e.labelCol,wrapperCol:e.wrapperCol}},[t("a-input-number",{directives:[{name:"decorator",rawName:"v-decorator",value:["initial_sales",{initialValue:0,rules:[{required:!0,message:"请输入初始销量"}]}],expression:"['initial_sales', { initialValue: 0, rules: [{ required: true, message: '请输入初始销量' }] }]"}],attrs:{min:0,precision:0}}),t("span",{staticClass:"ml-5"},[e._v("件")]),t("p",{staticClass:"form-item-help"},[t("small",[e._v("用户端显示的销量 = 初始销量 + 实际销量")])])],1),t("a-form-item",{attrs:{label:"活动限购",labelCol:e.labelCol,wrapperCol:e.wrapperCol}},[t("a-radio-group",{directives:[{name:"decorator",rawName:"v-decorator",value:["is_restrict",{initialValue:0,rules:[{required:!0}]}],expression:"['is_restrict', { initialValue: 0, rules: [{ required: true }] }]"}]},[t("a-radio",{attrs:{value:1}},[e._v("开启")]),t("a-radio",{attrs:{value:0}},[e._v("关闭")])],1),e.form.getFieldValue("is_restrict")?t("div",{staticClass:"mt-10"},[t("a-form-item",[t("span",{staticClass:"mr-10"},[e._v("总限购")]),t("a-input-number",{directives:[{name:"decorator",rawName:"v-decorator",value:["restrict_total",{rules:[{required:!0,message:"请输入总限购数量"}]}],expression:"['restrict_total', { rules: [{ required: true, message: '请输入总限购数量' }] }]"}],attrs:{min:1,precision:0}}),t("span",{staticClass:"ml-10"},[e._v("件/人")])],1)],1):e._e()],1),t("a-form-item",{attrs:{label:"分享标题",labelCol:e.labelCol,wrapperCol:e.wrapperCol}},[t("a-input",{directives:[{name:"decorator",rawName:"v-decorator",value:["share_title",{rules:[{required:!0,min:2,message:"请输入至少2个字符"}]}],expression:"['share_title', { rules: [{ required: true, min: 2, message: '请输入至少2个字符' }] }]"}],attrs:{placeholder:"请输入分享标题"}})],1),t("a-form-item",{attrs:{label:"砍价助力语",labelCol:e.labelCol,wrapperCol:e.wrapperCol}},[t("a-input",{directives:[{name:"decorator",rawName:"v-decorator",value:["prompt_words",{rules:[{required:!0,min:2,message:"请输入至少2个字符"}]}],expression:"['prompt_words', { rules: [{ required: true, min: 2, message: '请输入至少2个字符' }] }]"}],attrs:{placeholder:"请输入砍价助力语"}})],1),t("a-form-item",{staticClass:"mt-20",attrs:{wrapperCol:{span:e.wrapperCol.span,offset:e.labelCol.span}}},[t("a-button",{attrs:{type:"primary","html-type":"submit",loading:e.isBtnLoading}},[e._v("提交")])],1)],1)],1)],1)},i=[],n=r("c7eb"),o=r("1da1"),s=(r("d3b7"),r("ddb0"),r("c1df")),l=r.n(s),u=r("2ef0"),c=r.n(u),d=r("125d"),m=r("d084"),p=r("ca00"),f=r("ab09"),v={components:{GoodsItem:f["a"]},data:function(){return{isLoading:!1,isBtnLoading:!1,labelCol:{span:3},wrapperCol:{span:10},form:this.$form.createForm(this),defaultDate:[l()(),l()().add(7,"days")],activeId:null,record:{},goods:null}},beforeCreate:function(){this.moment=l.a},created:function(){var e=this;return Object(o["a"])(Object(n["a"])().mark((function t(){return Object(n["a"])().wrap((function(t){while(1)switch(t.prev=t.next){case 0:return e.activeId=e.$route.query.activeId,t.next=3,e.getDetail();case 3:return t.next=5,e.getGoodsInfo();case 5:case"end":return t.stop()}}),t)})))()},methods:{getDetail:function(){var e=this;return Object(o["a"])(Object(n["a"])().mark((function t(){var r;return Object(n["a"])().wrap((function(t){while(1)switch(t.prev=t.next){case 0:return r=e.activeId,e.isLoading=!0,t.next=4,d["c"]({activeId:r}).then((function(t){e.record=t.data.detail,e.setFieldsValue()})).finally((function(){return e.isLoading=!1}));case 4:case"end":return t.stop()}}),t)})))()},getGoodsInfo:function(){var e=this;return Object(o["a"])(Object(n["a"])().mark((function t(){var r;return Object(n["a"])().wrap((function(t){while(1)switch(t.prev=t.next){case 0:return r=e.record,e.isLoading=!0,t.next=4,m["b"](r.goods_id).then((function(t){return e.goods=t.data.detail})).finally((function(){return e.isLoading=!1}));case 4:case"end":return t.stop()}}),t)})))()},setFieldsValue:function(){var e=this,t=this.record,r=this.form,a=this.$nextTick,i=this.getExistFields;!Object(p["f"])(r.getFieldsValue())&&a((function(){var n=Object(u["pick"])(t,["expiryt_time","floor_price","peoples","is_self_cut","is_floor_buy","is_restrict","share_title","prompt_words","initial_sales","sort","status"]);n.betweenTime=e.getBetweenTime(t),r.setFieldsValue(n),a((function(){r.setFieldsValue(Object(u["pick"])(t,i(["restrict_total"])))}))}))},getExistFields:function(e){this.record;var t=this.form;return c.a.intersection(c.a.keys(t.getFieldsValue()),e)},getBetweenTime:function(e){return[l()(new Date(e.start_time)),l()(new Date(e.end_time))]},handleSubmit:function(e){e.preventDefault();var t=this.form.validateFields,r=this.onFormSubmit;t((function(e,t){!e&&r(t)}))},onFormSubmit:function(e){var t=this;this.isLoading=!0,this.isBtnLoading=!0,d["d"](this.activeId,{form:e}).then((function(e){t.$message.success(e.message,1.5),setTimeout((function(){return t.$router.push("./index")}),1200)})).catch((function(){return t.isBtnLoading=!1})).finally((function(){return t.isLoading=!1}))}}},h=v,b=(r("7c5f"),r("2877")),g=Object(b["a"])(h,a,i,!1,null,"ea3bde88",null);t["default"]=g.exports},9348:function(e,t,r){"use strict";r.r(t);var a=function(){var e=this,t=e._self._c;return t("a-card",{attrs:{bordered:!1}},[t("div",{staticClass:"card-title"},[e._v(e._s(e.$route.meta.title))]),t("a-spin",{attrs:{spinning:e.isLoading}},[t("a-form",{attrs:{form:e.form},on:{submit:e.handleSubmit}},[t("a-form-item",{attrs:{label:"砍价商品",labelCol:e.labelCol,wrapperCol:e.wrapperCol,required:""}},[t("SelectGoods",{directives:[{name:"decorator",rawName:"v-decorator",value:["goods_id",{rules:[{required:!0,message:"请选择指定的商品"}]}],expression:"['goods_id', { rules: [{ required: true, message: '请选择指定的商品' }] }]"}],attrs:{multiple:!1}}),t("p",{staticClass:"form-item-help"},[t("small",[e._v("每个活动只能选择一个商品")])])],1),t("a-form-item",{attrs:{label:"活动时间",labelCol:e.labelCol,wrapperCol:e.wrapperCol}},[t("a-range-picker",{directives:[{name:"decorator",rawName:"v-decorator",value:["betweenTime",{initialValue:e.defaultDate,rules:[{required:!0,message:"请选择有效期范围"}]}],expression:"['betweenTime', { initialValue: defaultDate, rules: [{ required: true, message: '请选择有效期范围' }] }]"}],attrs:{format:"YYYY-MM-DD HH:mm:ss","show-time":{defaultValue:e.moment("00:00:00","HH:mm:ss")}}})],1),t("a-form-item",{attrs:{label:"砍价有效期",labelCol:e.labelCol,wrapperCol:e.wrapperCol}},[t("a-input-number",{directives:[{name:"decorator",rawName:"v-decorator",value:["expiryt_time",{initialValue:24,rules:[{required:!0,message:"请输入砍价有效期"}]}],expression:"['expiryt_time', { initialValue: 24, rules: [{ required: true, message: '请输入砍价有效期' }] }]"}],attrs:{min:2,precision:0}}),t("span",{staticClass:"ml-5"},[e._v("小时")]),t("p",{staticClass:"form-item-help"},[t("small",[e._v("自用户发起砍价到砍价截止的时间")])])],1),t("a-form-item",{attrs:{label:"砍价底价",labelCol:e.labelCol,wrapperCol:e.wrapperCol}},[t("a-input-number",{directives:[{name:"decorator",rawName:"v-decorator",value:["floor_price",{rules:[{required:!0,message:"请输入砍价底价"}]}],expression:"['floor_price', { rules: [{ required: true, message: '请输入砍价底价' }] }]"}],attrs:{min:.01,precision:2}}),t("span",{staticClass:"ml-5"},[e._v("元")]),t("div",{staticClass:"form-item-help"},[t("small",[e._v("砍价商品的最低价格")])])],1),t("a-form-item",{attrs:{label:"帮砍人数",labelCol:e.labelCol,wrapperCol:e.wrapperCol}},[t("a-input-number",{directives:[{name:"decorator",rawName:"v-decorator",value:["peoples",{initialValue:2,rules:[{required:!0,message:"请输入帮砍人数"}]}],expression:"['peoples', { initialValue: 2, rules: [{ required: true, message: '请输入帮砍人数' }] }]"}],attrs:{min:2,precision:0}}),t("span",{staticClass:"ml-5"},[e._v("人")]),t("p",{staticClass:"form-item-help"},[t("small",[e._v("每个砍价订单的帮砍人数,达到该人数才可砍至底价")])])],1),t("a-form-item",{attrs:{label:"可自砍一刀",labelCol:e.labelCol,wrapperCol:e.wrapperCol}},[t("a-radio-group",{directives:[{name:"decorator",rawName:"v-decorator",value:["is_self_cut",{initialValue:1,rules:[{required:!0}]}],expression:"['is_self_cut', { initialValue: 1, rules: [{ required: true }] }]"}]},[t("a-radio",{attrs:{value:1}},[e._v("允许")]),t("a-radio",{attrs:{value:0}},[e._v("不允许")])],1),t("div",{staticClass:"form-item-help"},[t("small",[e._v("砍价发起人自己砍一刀")])])],1),t("a-form-item",{attrs:{label:"必须底价购买",labelCol:e.labelCol,wrapperCol:e.wrapperCol}},[t("a-radio-group",{directives:[{name:"decorator",rawName:"v-decorator",value:["is_floor_buy",{initialValue:1,rules:[{required:!0}]}],expression:"['is_floor_buy', { initialValue: 1, rules: [{ required: true }] }]"}]},[t("a-radio",{attrs:{value:1}},[e._v("是")]),t("a-radio",{attrs:{value:0}},[e._v("否")])],1),t("div",{staticClass:"form-item-help"},[t("small",[e._v("只有砍到底价才可以购买")])])],1),t("a-form-item",{attrs:{label:"活动状态",labelCol:e.labelCol,wrapperCol:e.wrapperCol}},[t("a-radio-group",{directives:[{name:"decorator",rawName:"v-decorator",value:["status",{initialValue:1,rules:[{required:!0}]}],expression:"['status', { initialValue: 1, rules: [{ required: true }] }]"}]},[t("a-radio",{attrs:{value:1}},[e._v("进行中")]),t("a-radio",{attrs:{value:0}},[e._v("已结束")])],1)],1),t("a-form-item",{attrs:{label:"排序",labelCol:e.labelCol,wrapperCol:e.wrapperCol,extra:"数字越小越靠前"}},[t("a-input-number",{directives:[{name:"decorator",rawName:"v-decorator",value:["sort",{initialValue:100,rules:[{required:!0,message:"请输入排序值"}]}],expression:"['sort', { initialValue: 100, rules: [{ required: true, message: '请输入排序值' }] }]"}],attrs:{min:0}})],1),t("a-divider",{attrs:{orientation:"left"}},[e._v("其他设置")]),t("a-form-item",{attrs:{label:"初始销量",labelCol:e.labelCol,wrapperCol:e.wrapperCol}},[t("a-input-number",{directives:[{name:"decorator",rawName:"v-decorator",value:["initial_sales",{initialValue:0,rules:[{required:!0,message:"请输入初始销量"}]}],expression:"['initial_sales', { initialValue: 0, rules: [{ required: true, message: '请输入初始销量' }] }]"}],attrs:{min:0,precision:0}}),t("span",{staticClass:"ml-5"},[e._v("件")]),t("p",{staticClass:"form-item-help"},[t("small",[e._v("用户端显示的销量 = 初始销量 + 实际销量")])])],1),t("a-form-item",{attrs:{label:"活动限购",labelCol:e.labelCol,wrapperCol:e.wrapperCol}},[t("a-radio-group",{directives:[{name:"decorator",rawName:"v-decorator",value:["is_restrict",{initialValue:0,rules:[{required:!0}]}],expression:"['is_restrict', { initialValue: 0, rules: [{ required: true }] }]"}]},[t("a-radio",{attrs:{value:1}},[e._v("开启")]),t("a-radio",{attrs:{value:0}},[e._v("关闭")])],1),e.form.getFieldValue("is_restrict")?t("div",{staticClass:"mt-10"},[t("a-form-item",[t("span",{staticClass:"mr-10"},[e._v("总限购")]),t("a-input-number",{directives:[{name:"decorator",rawName:"v-decorator",value:["restrict_total",{rules:[{required:!0,message:"请输入总限购数量"}]}],expression:"['restrict_total', { rules: [{ required: true, message: '请输入总限购数量' }] }]"}],attrs:{min:1,precision:0}}),t("span",{staticClass:"ml-10"},[e._v("件/人")])],1)],1):e._e()],1),t("a-form-item",{attrs:{label:"分享标题",labelCol:e.labelCol,wrapperCol:e.wrapperCol}},[t("a-input",{directives:[{name:"decorator",rawName:"v-decorator",value:["share_title",{initialValue:"麻烦帮我砍一刀!我真的很想要了,爱你哟!(๑′ᴗ‵๑)",rules:[{required:!0,min:2,message:"请输入至少2个字符"}]}],expression:"['share_title', { \n initialValue: '麻烦帮我砍一刀!我真的很想要了,爱你哟!(๑′ᴗ‵๑)', \n rules: [{ required: true, min: 2, message: '请输入至少2个字符' }] \n }]"}],attrs:{placeholder:"请输入分享标题"}})],1),t("a-form-item",{attrs:{label:"砍价助力语",labelCol:e.labelCol,wrapperCol:e.wrapperCol}},[t("a-input",{directives:[{name:"decorator",rawName:"v-decorator",value:["prompt_words",{initialValue:'"朋友一生一起走,帮砍一刀有没有"',rules:[{required:!0,min:2,message:"请输入至少2个字符"}]}],expression:"['prompt_words', { \n initialValue: '\"朋友一生一起走,帮砍一刀有没有\"', \n rules: [{ required: true, min: 2, message: '请输入至少2个字符' }] \n }]"}],attrs:{placeholder:"请输入砍价助力语"}})],1),t("a-form-item",{staticClass:"mt-20",attrs:{wrapperCol:{span:e.wrapperCol.span,offset:e.labelCol.span}}},[t("a-button",{attrs:{type:"primary","html-type":"submit",loading:e.isBtnLoading}},[e._v("提交")])],1)],1)],1)],1)},i=[],n=(r("d3b7"),r("c1df")),o=r.n(n),s=(r("2ef0"),r("125d")),l=(r("d084"),r("2af9")),u={components:{SelectGoods:l["h"]},data:function(){return{isLoading:!1,isBtnLoading:!1,labelCol:{span:3},wrapperCol:{span:10},form:this.$form.createForm(this),defaultDate:[o()(),o()().add(7,"days")]}},beforeCreate:function(){this.moment=o.a},methods:{handleSubmit:function(e){e.preventDefault();var t=this.form.validateFields,r=this.onFormSubmit;t((function(e,t){!e&&r(t)}))},onFormSubmit:function(e){var t=this;this.isLoading=!0,this.isBtnLoading=!0,s["a"]({form:e}).then((function(e){t.$message.success(e.message,1.5),setTimeout((function(){return t.$router.push("./index")}),1200)})).catch((function(){return t.isBtnLoading=!1})).finally((function(){return t.isLoading=!1}))}}},c=u,d=(r("fbbf"),r("2877")),m=Object(d["a"])(c,a,i,!1,null,"3c57eb08",null);t["default"]=m.exports},b214:function(e,t,r){},c5b9:function(e,t,r){"use strict";r("b214")},c7eb:function(e,t,r){"use strict";r.d(t,"a",(function(){return i}));r("a4d3"),r("e01a"),r("b636"),r("d28b"),r("944a"),r("fb6a"),r("b0c0"),r("0c47"),r("23dc"),r("3410"),r("131a"),r("d3b7"),r("3ca3"),r("159b"),r("ddb0");var a=r("53ca");function i(){ /*! regenerator-runtime -- Copyright (c) 2014-present, Facebook, Inc. -- license (MIT): https://github.com/facebook/regenerator/blob/main/LICENSE */ i=function(){return t};var e,t={},r=Object.prototype,n=r.hasOwnProperty,o=Object.defineProperty||function(e,t,r){e[t]=r.value},s="function"==typeof Symbol?Symbol:{},l=s.iterator||"@@iterator",u=s.asyncIterator||"@@asyncIterator",c=s.toStringTag||"@@toStringTag";function d(e,t,r){return Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}),e[t]}try{d({},"")}catch(e){d=function(e,t,r){return e[t]=r}}function m(e,t,r,a){var i=t&&t.prototype instanceof _?t:_,n=Object.create(i.prototype),s=new N(a||[]);return o(n,"_invoke",{value:O(e,r,s)}),n}function p(e,t,r){try{return{type:"normal",arg:e.call(t,r)}}catch(e){return{type:"throw",arg:e}}}t.wrap=m;var f="suspendedStart",v="suspendedYield",h="executing",b="completed",g={};function _(){}function w(){}function y(){}var C={};d(C,l,(function(){return this}));var x=Object.getPrototypeOf,q=x&&x(x(D([])));q&&q!==r&&n.call(q,l)&&(C=q);var k=y.prototype=_.prototype=Object.create(C);function L(e){["next","throw","return"].forEach((function(t){d(e,t,(function(e){return this._invoke(t,e)}))}))}function j(e,t){function r(i,o,s,l){var u=p(e[i],e,o);if("throw"!==u.type){var c=u.arg,d=c.value;return d&&"object"==Object(a["a"])(d)&&n.call(d,"__await")?t.resolve(d.__await).then((function(e){r("next",e,s,l)}),(function(e){r("throw",e,s,l)})):t.resolve(d).then((function(e){c.value=e,s(c)}),(function(e){return r("throw",e,s,l)}))}l(u.arg)}var i;o(this,"_invoke",{value:function(e,a){function n(){return new t((function(t,i){r(e,a,t,i)}))}return i=i?i.then(n,n):n()}})}function O(t,r,a){var i=f;return function(n,o){if(i===h)throw new Error("Generator is already running");if(i===b){if("throw"===n)throw o;return{value:e,done:!0}}for(a.method=n,a.arg=o;;){var s=a.delegate;if(s){var l=V(s,a);if(l){if(l===g)continue;return l}}if("next"===a.method)a.sent=a._sent=a.arg;else if("throw"===a.method){if(i===f)throw i=b,a.arg;a.dispatchException(a.arg)}else"return"===a.method&&a.abrupt("return",a.arg);i=h;var u=p(t,r,a);if("normal"===u.type){if(i=a.done?b:v,u.arg===g)continue;return{value:u.arg,done:a.done}}"throw"===u.type&&(i=b,a.method="throw",a.arg=u.arg)}}}function V(t,r){var a=r.method,i=t.iterator[a];if(i===e)return r.delegate=null,"throw"===a&&t.iterator["return"]&&(r.method="return",r.arg=e,V(t,r),"throw"===r.method)||"return"!==a&&(r.method="throw",r.arg=new TypeError("The iterator does not provide a '"+a+"' method")),g;var n=p(i,t.iterator,r.arg);if("throw"===n.type)return r.method="throw",r.arg=n.arg,r.delegate=null,g;var o=n.arg;return o?o.done?(r[t.resultName]=o.value,r.next=t.nextLoc,"return"!==r.method&&(r.method="next",r.arg=e),r.delegate=null,g):o:(r.method="throw",r.arg=new TypeError("iterator result is not an object"),r.delegate=null,g)}function S(e){var t={tryLoc:e[0]};1 in e&&(t.catchLoc=e[1]),2 in e&&(t.finallyLoc=e[2],t.afterLoc=e[3]),this.tryEntries.push(t)}function I(e){var t=e.completion||{};t.type="normal",delete t.arg,e.completion=t}function N(e){this.tryEntries=[{tryLoc:"root"}],e.forEach(S,this),this.reset(!0)}function D(t){if(t||""===t){var r=t[l];if(r)return r.call(t);if("function"==typeof t.next)return t;if(!isNaN(t.length)){var i=-1,o=function r(){for(;++i=0;--i){var o=this.tryEntries[i],s=o.completion;if("root"===o.tryLoc)return a("end");if(o.tryLoc<=this.prev){var l=n.call(o,"catchLoc"),u=n.call(o,"finallyLoc");if(l&&u){if(this.prev=0;--r){var a=this.tryEntries[r];if(a.tryLoc<=this.prev&&n.call(a,"finallyLoc")&&this.prev=0;--t){var r=this.tryEntries[t];if(r.finallyLoc===e)return this.complete(r.completion,r.afterLoc),I(r),g}},catch:function(e){for(var t=this.tryEntries.length-1;t>=0;--t){var r=this.tryEntries[t];if(r.tryLoc===e){var a=r.completion;if("throw"===a.type){var i=a.arg;I(r)}return i}}throw new Error("illegal catch attempt")},delegateYield:function(t,r,a){return this.delegate={iterator:D(t),resultName:r,nextLoc:a},"next"===this.method&&(this.arg=e),g}},t}},de69:function(e,t,r){},fbbf:function(e,t,r){"use strict";r("de69")}}]);