(window["webpackJsonp"]=window["webpackJsonp"]||[]).push([["chunk-b5291802"],{"0759":function(e,t,r){"use strict";r.r(t);var o,n=function(){var e=this,t=e.$createElement,r=e._self._c||t;return r("div",{staticClass:"m-container"},[e._m(0),e._v(" "),r("div",{staticClass:"m-core"},[r("auth",{attrs:{auths:"liveGoods/add"}},[r("el-button",{staticStyle:{"margin-bottom":"30px","margian-right":"10px"},attrs:{type:"primary"},on:{click:e.addLiveShop}},[e._v("新建商品")])],1),e._v(" "),r("save-form",{ref:"searchForm",attrs:{inline:!0,model:e.searchForm},on:{submit:e.search,reset:e.onReSet}},[r("el-form-item",[r("el-input",{attrs:{clearable:"",placeholder:"商品编号/名称"},nativeOn:{keyup:function(t){return!t.type.indexOf("key")&&e._k(t.keyCode,"enter",13,t.key,"Enter")?null:function(t){t.target.blur(),e.$refs.searchForm.save(),e.search()}(t)}},model:{value:e.searchForm.search,callback:function(t){e.$set(e.searchForm,"search","string"===typeof t?t.trim():t)},expression:"searchForm.search"}})],1),e._v(" "),r("el-form-item",[r("el-button",{attrs:{"native-type":"submit",type:"primary"}},[e._v("搜索")]),e._v(" "),r("el-button",{attrs:{"native-type":"reset",type:"danger"}},[e._v("重置")])],1)],1),e._v(" "),r("div",{staticClass:"tableWrap"},[r("el-table",{staticStyle:{width:"100%"},attrs:{"header-cell-style":{background:"#EDEEF0",color:"#444"},data:e.tableList}},[r("el-table-column",{attrs:{align:"center",prop:"id",label:"商品编号"}}),e._v(" "),r("el-table-column",{attrs:{align:"center",prop:"name",label:"商品名称"}}),e._v(" "),r("el-table-column",{attrs:{align:"center",prop:"originalPrice",label:"原价"},scopedSlots:e._u([{key:"default",fn:function(t){return[r("div",[e._v("\n "+e._s(e._f("moneyFormat")(t.row.originalPrice,!0))+"\n ")])]}}])}),e._v(" "),r("el-table-column",{attrs:{align:"center",prop:"currentPrice",label:"直播价"},scopedSlots:e._u([{key:"default",fn:function(t){return[r("div",[e._v("\n "+e._s(e._f("moneyFormat")(t.row.currentPrice,!0))+"\n ")])]}}])}),e._v(" "),r("el-table-column",{attrs:{align:"center",prop:"stockCount",label:"库存"}}),e._v(" "),r("el-table-column",{attrs:{align:"center",prop:"studentId",label:"操作"},scopedSlots:e._u([{key:"default",fn:function(t){return[r("div",[r("auth",{attrs:{auths:"liveGoods/update"}},[r("el-button",{attrs:{type:"text"},on:{click:function(r){return e.resetShop(t.row)}}},[e._v("修改")])],1),e._v(" "),r("auth",{attrs:{auths:"liveGoods/delete"}},[r("el-button",{attrs:{type:"text"},on:{click:function(r){return e.deteleShop(t.row)}}},[e._v("删除")])],1)],1)]}}])})],1),e._v(" "),r("pagination",{attrs:{sync:"",total:e.rules.total,page:e.rules.page,limit:e.rules.limit,"page-sizes":e.rules.page_size},on:{"update:total":function(t){return e.$set(e.rules,"total",t)},"update:page":function(t){return e.$set(e.rules,"page",t)},"update:limit":function(t){return e.$set(e.rules,"limit",t)},pagination:e.getList}})],1)],1),e._v(" "),r("eidtLiveShop",{ref:"eidtLiveShop",on:{getList:e.getList}})],1)},a=[function(){var e=this,t=e.$createElement,r=e._self._c||t;return r("h2",[r("div",{staticClass:"squrt"}),e._v("\n 直播商品管理\n ")])}],s=(r("7f7f"),r("386d"),r("5530")),i=(r("96cf"),r("1da1")),l=(r("bc3a"),r("5f87"),r("333d")),c=(r("3908"),r("ed08"),r("ff39")),u=function(){var e=this,t=e.$createElement,r=e._self._c||t;return r("div",[r("el-dialog",{attrs:{width:"800px",title:e.title,visible:e.lookVisible,"before-close":e.onClose},on:{"update:visible":function(t){e.lookVisible=t}}},[r("el-form",{ref:"eidtCamp",attrs:{model:e.formes,"label-width":"120px"}},[r("el-row",{attrs:{gutter:10}},[r("el-col",{attrs:{xl:12,lg:12,md:12,xs:12}},[r("el-form-item",{attrs:{label:"商品名称",rules:[{required:!0,message:"请输入商品名称"}],prop:"name"}},[r("el-input",{staticClass:"w100",model:{value:e.formes.name,callback:function(t){e.$set(e.formes,"name",t)},expression:"formes.name"}})],1)],1),e._v(" "),r("el-col",{attrs:{xl:12,lg:12,md:12,xs:12}},[r("el-form-item",{attrs:{label:"库存",rules:[{required:!0,message:"请输入库存数量"}],prop:"stockCount"}},[r("el-input",{staticClass:"w100",model:{value:e.formes.stockCount,callback:function(t){e.$set(e.formes,"stockCount",t)},expression:"formes.stockCount"}},[r("template",{slot:"append"},[e._v("件")])],2)],1)],1)],1),e._v(" "),r("el-row",{attrs:{gutter:10}},[r("el-col",{attrs:{xl:12,lg:12,md:12,xs:12}},[r("el-form-item",{attrs:{label:"原价",rules:[{required:!0,message:"请输入商品原价"},{pattern:/(^[1-9]([0-9]+)?(\.[0-9]{1,2})?$)|(^(0){1}$)|(^[0-9]\.[0-9]([0-9])?$)/,message:"请输入正确的金额"}],prop:"originalPrice"}},[r("el-input",{staticClass:"w100",model:{value:e.formes.originalPrice,callback:function(t){e.$set(e.formes,"originalPrice",t)},expression:"formes.originalPrice"}},[r("template",{slot:"append"},[e._v("元")])],2)],1)],1),e._v(" "),r("el-col",{attrs:{xl:12,lg:12,md:12,xs:12}},[r("el-form-item",{attrs:{label:"直播价",rules:[{required:!0,message:"请输入商品直播价"},{pattern:/(^[1-9]([0-9]+)?(\.[0-9]{1,2})?$)|(^(0){1}$)|(^[0-9]\.[0-9]([0-9])?$)/,message:"请输入正确的金额"}],prop:"currentPrice"}},[r("el-input",{staticClass:"w100",model:{value:e.formes.currentPrice,callback:function(t){e.$set(e.formes,"currentPrice",t)},expression:"formes.currentPrice"}},[r("template",{slot:"append"},[e._v("元")])],2)],1)],1)],1),e._v(" "),r("el-row",{attrs:{gutter:10}},[r("el-col",{attrs:{xl:24,lg:24,md:24,xs:24}},[r("el-form-item",{attrs:{label:"描述",rules:[{required:!0,message:"请输入商品描述"}],prop:"desc"}},[r("el-input",{staticClass:"w100",model:{value:e.formes.desc,callback:function(t){e.$set(e.formes,"desc",t)},expression:"formes.desc"}})],1)],1),e._v(" "),r("el-col",{attrs:{xl:24,lg:24,md:24,xs:24}},[r("el-form-item",{attrs:{label:"商品详情链接",rules:[{required:!0,message:"请输入商品详情链接"}],prop:"goodsDetailUrl"}},[r("el-input",{staticClass:"w100",model:{value:e.formes.goodsDetailUrl,callback:function(t){e.$set(e.formes,"goodsDetailUrl",t)},expression:"formes.goodsDetailUrl"}})],1)],1),e._v(" "),r("el-col",{attrs:{xl:24,lg:24,md:24,xs:24}},[r("el-form-item",{attrs:{label:"商品图片",rules:[{required:!0,message:"请选择商品图片"}],prop:"image"}},[r("image-cropper",{attrs:{options:e.cropperOptions,imgSize:2,imageUrl:e.formes.image,bucket_name:"mall"},on:{"crop-upload-success":e.cropSuccess}})],1)],1)],1)],1),e._v(" "),r("div",{staticClass:"dialog-footer",attrs:{slot:"footer"},slot:"footer"},[r("el-button",{on:{click:e.onClose}},[e._v("取 消")]),e._v(" "),r("el-button",{attrs:{type:"primary"},on:{click:e.submitMsg}},[e._v("确 定")])],1)],1)],1)},m=[],d=r("896b"),p={name:"eidtCamp",components:{ImageCropper:d["a"]},data:function(){return{title:"",formes:{id:"",name:"",currentPrice:"",originalPrice:"",image:"",stockCount:"",desc:"",goodsDetailUrl:""},lookVisible:!1,chioseIdList:null,activeRow:null,cropperOptions:{autoCrop:!0,autoCropWidth:252,autoCropHeight:270,fixedBox:!0,previewsCircle:!1,title:"商品图片"}}},mounted:function(){o=this,this.init()},methods:{init:function(){},openDioag:function(e){e&&e.id?(this.activeRow=e,this.title="修改直播商品",this.formes=Object(s["a"])({},e)):this.title="新建直播商品",this.lookVisible=!0},onClose:function(){this.formes={id:"",name:"",currentPrice:"",originalPrice:"",image:"",stockCount:"",desc:"",goodsDetailUrl:""},this.activeRow=null,this.$refs["eidtCamp"].resetFields(),this.lookVisible=!1},submitMsg:function(){var e=this;this.$refs.eidtCamp.validate(function(){var t=Object(i["a"])(regeneratorRuntime.mark((function t(r){var o,n;return regeneratorRuntime.wrap((function(t){while(1)switch(t.prev=t.next){case 0:if(!r){t.next=24;break}if(t.prev=1,!e.activeRow||!e.activeRow.id){t.next=12;break}return o=Object(s["a"])({},e.formes),t.next=6,Object(c["d"])(Object(s["a"])({},o));case 6:t.sent,e.$message.success("修改成功"),e.onClose(),e.$emit("getList"),t.next=19;break;case 12:return n=Object(s["a"])({},e.formes),t.next=15,Object(c["a"])(Object(s["a"])({},n));case 15:t.sent,e.$message.success("新建成功"),e.onClose(),e.$emit("getList");case 19:t.next=24;break;case 21:t.prev=21,t.t0=t["catch"](1),console.log(t.t0);case 24:case"end":return t.stop()}}),t,null,[[1,21]])})));return function(e){return t.apply(this,arguments)}}())},getName:function(e){this.formes.fileName=e.data.name},payDate:function(){return{firstDayOfWeek:1,disabledDate:function(e){return e.getTime()+864e5<(new Date).getTime()}}},cropSuccess:function(e){console.log(e),this.formes.image=e.data.url}},computed:{payendTimer:function(){return{firstDayOfWeek:1,disabledDate:function(e){return o.formes.applyTime[1]?e.getTime()+864e5<=new Date(o.formes.applyTime[1]).getTime():e.getTime()+864e5<=(new Date).getTime()}}}}},f=p,g=(r("2d15"),r("2877")),v=Object(g["a"])(f,u,m,!1,null,"7be93738",null),b=v.exports,h={components:{pagination:l["a"],eidtLiveShop:b},data:function(){return{searchForm:{search:null},tableList:[],organList:[],rules:{limit:10,page:1,total:0,page_size:[10,20,40,50]}}},created:function(){},mounted:function(){this.init()},methods:{init:function(){this.getList()},getList:function(){var e=Object(i["a"])(regeneratorRuntime.mark((function e(){var t,r;return regeneratorRuntime.wrap((function(e){while(1)switch(e.prev=e.next){case 0:return t=Object(s["a"])(Object(s["a"])({},this.searchForm),{},{page:this.rules.page,rows:this.rules.limit}),e.prev=1,e.next=4,Object(c["c"])(Object(s["a"])({},t));case 4:r=e.sent,this.tableList=r.data.rows,this.rules.total=r.data.total,e.next=12;break;case 9:e.prev=9,e.t0=e["catch"](1),console.log(e.t0);case 12:case"end":return e.stop()}}),e,this,[[1,9]])})));function t(){return e.apply(this,arguments)}return t}(),search:function(){this.rules.page=1,this.getList()},onReSet:function(){this.searchForm.search="",this.search()},resetShop:function(e){this.$refs.eidtLiveShop.openDioag(e)},addLiveShop:function(){this.$refs.eidtLiveShop.openDioag()},deteleShop:function(e){var t=this;this.$confirm('确定删除"'.concat(e.name,'"?'),"提示",{confirmButtonText:"确定",cancelButtonText:"取消",type:"warning"}).then((function(){Object(c["b"])({goodsId:e.id}).then((function(e){200===e.code&&(t.$message.success("删除成功"),t.getList())}))})).catch()}}},w=h,_=Object(g["a"])(w,n,a,!1,null,"74d73e5e",null);t["default"]=_.exports},"09f4":function(e,t,r){"use strict";r.d(t,"a",(function(){return s})),Math.easeInOutQuad=function(e,t,r,o){return e/=o/2,e<1?r/2*e*e+t:(e--,-r/2*(e*(e-2)-1)+t)};var o=function(){return window.requestAnimationFrame||window.webkitRequestAnimationFrame||window.mozRequestAnimationFrame||function(e){window.setTimeout(e,1e3/60)}}();function n(e){document.documentElement.scrollTop=e,document.body.parentNode.scrollTop=e,document.body.scrollTop=e}function a(){return document.documentElement.scrollTop||document.body.parentNode.scrollTop||document.body.scrollTop}function s(e,t,r){var s=a(),i=e-s,l=20,c=0;t="undefined"===typeof t?500:t;var u=function e(){c+=l;var a=Math.easeInOutQuad(c,s,i,t);n(a),c1&&void 0!==arguments[1]?arguments[1]:[],n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:"YYYY-MM-DD";return e&&e.length?(t={},Object(o["a"])(t,r[0]||"start",a()(e[0]).isValid()?a()(e[0]).format(n):""),Object(o["a"])(t,r[1]||"end",a()(e[1]).isValid()?a()(e[1]).format(n):""),t):{}}},ff39:function(e,t,r){"use strict";r.d(t,"c",(function(){return n})),r.d(t,"a",(function(){return a})),r.d(t,"d",(function(){return s})),r.d(t,"b",(function(){return i}));var o=r("829b"),n=function(e){return Object(o["a"])({url:"/api-web/liveGoods/page",method:"post",data:e,requestType:"form"})},a=function(e){return Object(o["a"])({url:"/api-web/liveGoods/add",method:"post",data:e,requestType:"json"})},s=function(e){return Object(o["a"])({url:"/api-web/liveGoods/update",method:"post",data:e,requestType:"json"})},i=function(e){return Object(o["a"])({url:"/api-web/liveGoods/delete",method:"post",data:e,requestType:"form"})}}}]);