1 |
- (window["webpackJsonp"]=window["webpackJsonp"]||[]).push([["chunk-b5291802"],{"0759":function(e,t,r){"use strict";r.r(t);var o,a=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)},n=[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("c80c")),i=r("db72"),l=(r("96cf"),r("3b8d")),c=(r("bc3a"),r("5f87"),r("333d")),u=(r("3908"),r("ed08"),r("ff39")),d=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=[],p=r("896b"),f={name:"eidtCamp",components:{ImageCropper:p["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(i["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(l["a"])(Object(s["a"])().mark((function t(r){var o,a;return Object(s["a"])().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(i["a"])({},e.formes),t.next=6,Object(u["d"])(Object(i["a"])({},o));case 6:t.sent,e.$message.success("修改成功"),e.onClose(),e.$emit("getList"),t.next=19;break;case 12:return a=Object(i["a"])({},e.formes),t.next=15,Object(u["a"])(Object(i["a"])({},a));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()}}}}},b=f,v=(r("2d15"),r("2877")),g=Object(v["a"])(b,d,m,!1,null,"7be93738",null),h=g.exports,w={components:{pagination:c["a"],eidtLiveShop:h},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(l["a"])(Object(s["a"])().mark((function e(){var t,r;return Object(s["a"])().wrap((function(e){while(1)switch(e.prev=e.next){case 0:return t=Object(i["a"])(Object(i["a"])({},this.searchForm),{},{page:this.rules.page,rows:this.rules.limit}),e.prev=1,e.next=4,Object(u["c"])(Object(i["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(u["b"])({goodsId:e.id}).then((function(e){200===e.code&&(t.$message.success("删除成功"),t.getList())}))})).catch()}}},_=w,k=Object(v["a"])(_,a,n,!1,null,"74d73e5e",null);t["default"]=k.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 a(e){document.documentElement.scrollTop=e,document.body.parentNode.scrollTop=e,document.body.scrollTop=e}function n(){return document.documentElement.scrollTop||document.body.parentNode.scrollTop||document.body.scrollTop}function s(e,t,r){var s=n(),i=e-s,l=20,c=0;t="undefined"===typeof t?500:t;var u=function e(){c+=l;var n=Math.easeInOutQuad(c,s,i,t);a(n),c<t?o(e):r&&"function"===typeof r&&r()};u()}},"2d15":function(e,t,r){"use strict";r("848f")},"848f":function(e,t,r){},ed08:function(e,t,r){"use strict";r.d(t,"c",(function(){return s})),r.d(t,"b",(function(){return i})),r.d(t,"a",(function(){return l}));var o=r("bd86"),a=(r("c5f6"),r("28a5"),r("a481"),r("6b54"),r("7618"),r("5a0c")),n=r.n(a);var s=function(e){var t=[];for(var r in e)if(e.hasOwnProperty(r)){var o=e[r],a=r.toLocaleUpperCase();t.push({label:o,value:"TRUE"===a||"FALSE"===a?"TRUE"===a:r})}return t},i=function(e){var t,r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:[],a=arguments.length>2&&void 0!==arguments[2]?arguments[2]:"YYYY-MM-DD";return e&&e.length?(t={},Object(o["a"])(t,r[0]||"start",n()(e[0]).isValid()?n()(e[0]).format(a):""),Object(o["a"])(t,r[1]||"end",n()(e[1]).isValid()?n()(e[1]).format(a):""),t):{}},l=function(e){var t,r,a=arguments.length>1&&void 0!==arguments[1]?arguments[1]:[],s=arguments.length>2&&void 0!==arguments[2]?arguments[2]:"YYYY-MM-DD";return e&&e.length?"YYYY-MM-DD"===s?(t={},Object(o["a"])(t,a[0]||"start",n()(e[0]).isValid()?n()(e[0]).format(s)+" 00:00:00":""),Object(o["a"])(t,a[1]||"end",n()(e[1]).isValid()?n()(e[1]).format(s)+" 23:59:59":""),t):(r={},Object(o["a"])(r,a[0]||"start",n()(e[0]).isValid()?n()(e[0]).format(s):""),Object(o["a"])(r,a[1]||"end",n()(e[1]).isValid()?n()(e[1]).format(s):""),r):{}}},ff39:function(e,t,r){"use strict";r.d(t,"c",(function(){return a})),r.d(t,"a",(function(){return n})),r.d(t,"d",(function(){return s})),r.d(t,"b",(function(){return i}));var o=r("829b"),a=function(e){return Object(o["a"])({url:"/api-web/liveGoods/page",method:"post",data:e,requestType:"form"})},n=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"})}}}]);
|