chunk-6aaac5d4.4381af8f.js 12 KB

1
  1. (window["webpackJsonp"]=window["webpackJsonp"]||[]).push([["chunk-6aaac5d4","chunk-3d5fe0de"],{"55ef":function(t,e,a){},"675c":function(t,e,a){},9727:function(t,e,a){"use strict";var s=a("675c"),o=a.n(s);o.a},"9e95":function(t,e,a){"use strict";a.r(e);var s=function(){var t=this,e=t.$createElement,a=t._self._c||e;return a("div",{staticClass:"app-list-content"},[a("cl-crud",{staticClass:"liu-crud-wrap",on:{load:t.onLoad},scopedSlots:t._u([{key:"slot-tabs",fn:function(e){e.scope;return[a("el-tabs",{staticClass:"liu-tabs",attrs:{type:"border-card"},on:{"tab-click":t.handleClick},model:{value:t.tabIndex,callback:function(e){t.tabIndex=e},expression:"tabIndex"}},t._l(t.tabsData,(function(t,e){return a("el-tab-pane",{key:e,attrs:{label:t.text,name:t.key}})})),1)]}},{key:"table-column-adImgUrl",fn:function(e){var s=e.scope;return[a("div",[a("cl-avatar",{style:{margin:"auto"},attrs:{shape:"square",size:40,src:t._f("default_avatar")(s.row.adImgUrl)}})],1)]}},{key:"table-column-endTime",fn:function(e){var s=e.scope;return["4102416000"==s.row.endTime?a("div",[t._v("永久有效")]):s.row.endTime?a("div",[t._v(t._s(t._f("formatTime")(s.row.endTime)))]):a("div",[t._v("-")])]}},{key:"table-column-status",fn:function(e){var s=e.scope;return[a("el-switch",{attrs:{"active-value":"1","inactive-value":"0"},on:{change:function(e){return t.changeStatus(s.row)}},model:{value:s.row.status,callback:function(e){t.$set(s.row,"status",e)},expression:"scope.row.status"}})]}},{key:"slot-modify",fn:function(e){var s=e.scope;return[a("el-button",{attrs:{type:"text"},on:{click:function(e){return t.modifyBtnFn(s.row)}}},[t._v("编辑")])]}},{key:"slot-del",fn:function(e){var s=e.scope;return[a("el-button",{attrs:{type:"text"},on:{click:function(e){return t.delBtnFn(s.row)}}},[t._v("删除")])]}},{key:"slot-add-ad-btn",fn:function(e){e.scope;return[a("el-button",{attrs:{type:"primary",size:"mini"},on:{click:t.addBtnFn}},[t._v("添加")])]}}])}),a("el-dialog",{attrs:{title:(1==t.addOrModify?"添加":"修改")+"广告图",visible:t.addDialog,"close-on-click-modal":!1,width:"600px"},on:{"update:visible":function(e){t.addDialog=e}}},[a("div",{staticClass:"ad-modal-content"},[a("el-form",{ref:"adForm",staticClass:"demo-form",attrs:{model:t.adForm,rules:t.adFormRules,"label-width":"100px"}},[a("el-form-item",{attrs:{label:"广告图名称",prop:"adName"}},[a("el-input",{attrs:{placeholder:"请输入名称",size:"small"},model:{value:t.adForm.adName,callback:function(e){t.$set(t.adForm,"adName",e)},expression:"adForm.adName"}})],1),a("el-form-item",{attrs:{label:"请选择时间"}},[a("el-col",{attrs:{span:11}},[a("el-form-item",{attrs:{prop:"startTime"}},[a("el-date-picker",{staticStyle:{width:"100%"},attrs:{type:"date",placeholder:"选择开始日期","value-format":"yyyy-MM-dd"},model:{value:t.adForm.startTime,callback:function(e){t.$set(t.adForm,"startTime",e)},expression:"adForm.startTime"}})],1)],1),a("el-col",{staticClass:"app-center",attrs:{span:2}},[t._v("-")]),a("el-col",{attrs:{span:11}},[a("el-form-item",{attrs:{prop:"endTime"}},[a("el-date-picker",{staticStyle:{width:"100%"},attrs:{type:"date",placeholder:"选择到期日期","value-format":"yyyy-MM-dd"},model:{value:t.adForm.endTime,callback:function(e){t.$set(t.adForm,"endTime",e)},expression:"adForm.endTime"}})],1)],1)],1),a("el-form-item",[a("el-checkbox",{model:{value:t.isLong,callback:function(e){t.isLong=e},expression:"isLong"}}),t._v(" 永久有效")],1),a("el-form-item",{attrs:{label:"广告图片",prop:"adImg"}},[a("cl-upload",{attrs:{success:t.uploadSuccess},model:{value:t.adForm.adImg,callback:function(e){t.$set(t.adForm,"adImg",e)},expression:"adForm.adImg"}})],1),a("el-form-item",{attrs:{label:"马上启用",prop:"status"}},[a("el-switch",{attrs:{"active-value":"1","inactive-value":"0"},model:{value:t.adForm.status,callback:function(e){t.$set(t.adForm,"status",e)},expression:"adForm.status"}})],1),a("el-form-item",{attrs:{label:"链接方式",prop:"style"}},[a("el-radio-group",{model:{value:t.adForm.style,callback:function(e){t.$set(t.adForm,"style",e)},expression:"adForm.style"}},[a("el-radio",{attrs:{label:"0"}},[t._v("自定义链接")]),a("el-radio",{attrs:{label:"1"}},[t._v("链接商品")])],1),0==t.adForm.style?[a("div",[a("el-form-item",{attrs:{prop:"url"}},[a("el-input",{attrs:{placeholder:"请填写链接,留空点图片不跳转",size:"small"},model:{value:t.adForm.url,callback:function(e){t.$set(t.adForm,"url",e)},expression:"adForm.url"}})],1)],1)]:[a("div",[t.$util.isEmpty(t.goodsData)?t._e():a("div",{staticClass:"goods-list-wrap"},[a("div",{staticClass:"goods-list"},[a("div",{staticClass:"list-img"},[a("img",{attrs:{src:t.goodsData.imgUrl,alt:"商品图片",mode:"center"}})]),a("div",{staticClass:"list-right"},[a("div",[t._v(t._s(t.goodsData.goodsName))]),a("div",{staticClass:"app-price"},[t._v("¥"+t._s(t.goodsData.price))])])])]),a("div",[a("el-button",{attrs:{type:"primary",size:"small"},on:{click:t.selGoods}},[t._v("选择商品")])],1)])]],2)],1)],1),a("div",{staticClass:"dialog-footer",attrs:{slot:"footer"},slot:"footer"},[a("el-button",{attrs:{size:"small"},on:{click:t.resetForm}},[t._v("取 消")]),a("el-button",{attrs:{type:"primary",size:"small"},on:{click:t.addFn}},[t._v("确认")])],1)]),a("sel-Search",{attrs:{show:t.selGoodsModal},on:{"update:show":function(e){t.selGoodsModal=e},confirm:t.selGoodsConfirmFn,cancel:function(e){t.selGoodsModal=!1}}})],1)},o=[],r=(a("4160"),a("b64b"),a("159b"),a("5530")),i=a("edf4"),n={name:"list-ad",components:{selSearch:i["default"]},data:function(){var t=this;return{app:null,tabIndex:"0",tabsData:[{text:"商城首页轮播图",key:"0"},{text:"门店轮播图",key:"1"}],modifyData:{},addOrModify:1,addDialog:!1,adForm:{adName:"",adImg:"",status:"1",inTurn:0,type:"1",style:"0",startTime:"",url:"",endTime:""},adFormRules:{adName:{required:!0,message:"广告图名称不能为空"},startTime:{required:!0,message:"开始时间不能为空",validator:function(e,a,s){if(!t.isLong&&!a)return s(new Error("到期时间不能为空"));s()}},endTime:{required:!0,message:"到期时间不能为空",validator:function(e,a,s){if(!t.isLong&&!a)return s(new Error("到期时间不能为空"));s()}},adImg:{required:!0,message:"广告图片不能为空"},style:{validator:function(e,a,s){var o=t.adForm,r=o.url,i=o.style;if("0"==i){if(!r)return s(new Error("链接不能为空"))}else if(!t.goodsData.id)return s(new Error("请选择商品"));s()}}},selGoodsModal:!1,goodsData:{},goodsList:[],isLong:!1}},methods:{delBtnFn:function(t){var e=this;this.$confirm("是否删除该广告?","提示",{confirmButtonText:"确定",cancelButtonText:"取消",type:"warning"}).then((function(){e.$service.ad.delete({id:t.id}).then((function(t){e.$message.success("删除成功!"),e.app.refresh({type:e.tabIndex})}))})).catch()},modifyBtnFn:function(t){var e=this;this.$service.ad.info({id:t.id}).then((function(t){e.modifyData=t,e.isLong=!!t.startTime,e.addOrModify=2,e.addDialog=!0;var a=JSON.parse(JSON.stringify(t));a.startTime=e.$util.$formatDate(a.startTime),a.endTime=e.$util.$formatDate(a.endTime),e.$util.isEmpty(a)||(Object.keys(e.adForm).forEach((function(t,s){e.adForm[t]=a[t]})),e.goodsData={id:t.goodsId})}))},addBtnFn:function(){this.addDialog=!0,this.isLong=!1,this.addOrModify=1,this.adForm={adName:"",adImg:"",status:"1",inTurn:0,type:"1",style:"0",startTime:"",url:"",endTime:""}},handleClick:function(t,e){this.app.refresh({type:this.tabIndex})},changeStatus:function(t){var e=this;this.$service.ad.updateStatus({id:t.id,status:t.status}).then((function(t){e.$message.success("操作成功!")}))},resetForm:function(){this.goodsData={},this.$refs["adForm"].resetFields(),this.addDialog=!1},addFn:function(){var t=this;this.$refs.adForm.validate((function(e){if(e){var a=JSON.parse(JSON.stringify(t.adForm));a.type=t.tabIndex,"1"==a.style&&(a.url="",a.goodsId=t.goodsData.id),t.isLong&&(a.startTime="",a.endTime="");var s=null;s=1==t.addOrModify?function(){return t.$service.ad.add(a)}:function(){return t.$service.ad.update(Object(r["a"])({id:t.modifyData.id},a))},s().then((function(e){t.$message.success("操作成功!"),t.resetForm(),t.app.refresh({type:t.tabIndex})}))}}))},selGoods:function(){this.selGoodsModal=!0},selGoodsConfirmFn:function(t){this.goodsData=t,this.selGoodsModal=!1,this.$refs.adForm.validateField("style")},onLoad:function(t){var e=t.ctx,a=t.app;this.app=a,e.service(this.$service.ad).set("table",{columns:[{prop:"id",label:"id",align:"center","min-width":100},{prop:"adName",label:"广告名称",align:"center"},{prop:"adImgUrl",label:"广告图片",align:"center"},{prop:"endTime",label:"到期时间",align:"center"},{prop:"status",label:"启用状态",align:"center"},{prop:"viewTimes",label:"点击次数",align:"center"},{prop:"inTurn",label:"排序",align:"center"}],op:{visible:!0,props:{width:100,align:"center",fixed:"right",label:"操作"},layout:["slot-modify","slot-del"]}}).set("layout",[["slot-tabs"],["flex1","slot-add-ad-btn","refresh-btn"],["data-table"],["flex1","pagination"]]).done(),a.refresh({type:this.tabIndex})},uploadSuccess:function(){this.$refs["adForm"].validateField("adImg")}}},l=n,d=(a("9727"),a("2877")),c=Object(d["a"])(l,s,o,!1,null,"60a8d996",null);e["default"]=c.exports},edf4:function(t,e,a){"use strict";a.r(e);var s=function(){var t=this,e=t.$createElement,a=t._self._c||e;return a("el-dialog",{attrs:{title:"选择商品",visible:t.selDialog,"close-on-click-modal":!1,"append-to-body":!0,width:"800px"},on:{"update:visible":function(e){t.selDialog=e}}},[a("div",{staticClass:"recharge-modal-content"},[a("el-radio-group",{staticClass:"radio-wrap",model:{value:t.radio,callback:function(e){t.radio=e},expression:"radio"}},[a("cl-crud",{staticClass:"liu-crud-wrap",on:{load:t.onLoad},scopedSlots:t._u([{key:"table-column-radio",fn:function(e){var s=e.scope;return[a("div",[a("el-radio",{attrs:{label:s.row.index}},[t._v("选择")])],1)]}},{key:"table-column-imgUrl",fn:function(e){var s=e.scope;return[a("div",[a("cl-avatar",{style:{margin:"auto"},attrs:{shape:"square",size:40,src:t._f("default_avatar")(s.row.imgUrl)}})],1)]}}])})],1)],1),a("div",{staticClass:"dialog-footer",attrs:{slot:"footer"},slot:"footer"},[a("el-button",{attrs:{size:"small"},on:{click:t.resetForm}},[t._v("取 消")]),a("el-button",{attrs:{type:"primary",size:"small"},on:{click:t.confirmFn}},[t._v("确定")])],1)])},o=[],r=(a("d81d"),a("96cf"),a("1da1")),i={name:"sel-search",props:{show:{type:Boolean,default:!1},multi:{type:Boolean,default:!1}},data:function(){return{selDialog:!1,ruleForm:{},radio:"",list:[],selData:{}}},computed:{},watch:{show:function(t){this.selDialog=t}},created:function(){},methods:{confirmFn:function(){this.$emit("confirm",this.list[this.radio])},resetForm:function(){this.$emit("cancel")},onLoad:function(t){var e=this,a=t.ctx,s=t.app;this.app=s,a.service(this.$service.goods).set("table",{columns:[{prop:"radio",label:"选择",align:"center","min-width":60},{prop:"imgUrl",label:"商品图片",align:"center"},{prop:"goodsName",label:"商品名称",align:"center"},{prop:"price",label:"商品价格",align:"center"}],op:{visible:!1}}).set("dict",{search:{keyWord:"goodsName"}}).set("search",{key:{placeholder:"商品名称"}}).set("pagination",{size:6}).set("layout",[["slot-tabs"],["search-key","flex1","refresh-btn"],["data-table"],["flex1","pagination"]]).on("refresh",function(){var t=Object(r["a"])(regeneratorRuntime.mark((function t(a,s){var o,r,i,n;return regeneratorRuntime.wrap((function(t){while(1)switch(t.prev=t.next){case 0:return o=s.next,r=s.render,t.next=3,o(a);case 3:i=t.sent,n=i.list,n.map((function(t,e){t.index=e,t.imgUrl=t.smallImgList[0]})),e.list=n,r(n);case 8:case"end":return t.stop()}}),t)})));return function(e,a){return t.apply(this,arguments)}}()).done(),s.refresh({type:this.tabIndex})}}},n=i,l=(a("f8c0"),a("2877")),d=Object(l["a"])(n,s,o,!1,null,null,null);e["default"]=d.exports},f8c0:function(t,e,a){"use strict";var s=a("55ef"),o=a.n(s);o.a}}]);