Commit ceb1ec23 by wang

update

parents aa8c15b5 2c5c7250
<!DOCTYPE html><html><head><meta charset=utf-8><meta http-equiv=X-UA-Compatible content="IE=edge,chrome=1"><meta name=renderer content=webkit><meta name=viewport content="width=device-width,initial-scale=1,maximum-scale=1,user-scalable=no"><link rel=icon href=/favicon.ico><title>Vue Element Admin</title><link href=/static/css/chunk-libs.5cf311f0.css rel=stylesheet><link href=/static/css/app.1b85534f.css rel=stylesheet></head><body><div id=app></div><script src=/static/js/chunk-elementUI.d1ab7f65.js></script><script src=/static/js/chunk-libs.a49098e1.js></script><script>(function(e){function n(n){for(var r,c,a=n[0],i=n[1],d=n[2],f=0,h=[];f<a.length;f++)c=a[f],u[c]&&h.push(u[c][0]),u[c]=0;for(r in i)Object.prototype.hasOwnProperty.call(i,r)&&(e[r]=i[r]);l&&l(n);while(h.length)h.shift()();return o.push.apply(o,d||[]),t()}function t(){for(var e,n=0;n<o.length;n++){for(var t=o[n],r=!0,c=1;c<t.length;c++){var a=t[c];0!==u[a]&&(r=!1)}r&&(o.splice(n--,1),e=i(i.s=t[0]))}return e}var r={},c={runtime:0},u={runtime:0},o=[];function a(e){return i.p+"static/js/"+({}[e]||e)+"."+{"chunk-0575145a":"59e0ff0b","chunk-05a99c67":"be1a1e89","chunk-19593038":"e94b4705","chunk-2162b876":"65a3d33f","chunk-2d2105d3":"7106a610","chunk-2d230fe7":"446e67d8","chunk-4ed577de":"4aed5d59","chunk-556562e8":"04d70197","chunk-667d2d85":"2d4f045d","chunk-71ee0ac8":"de063288","chunk-bf0cb8b0":"7e5e9a4e"}[e]+".js"}function i(n){if(r[n])return r[n].exports;var t=r[n]={i:n,l:!1,exports:{}};return e[n].call(t.exports,t,t.exports,i),t.l=!0,t.exports}i.e=function(e){var n=[],t={"chunk-0575145a":1,"chunk-05a99c67":1,"chunk-19593038":1,"chunk-2162b876":1,"chunk-4ed577de":1,"chunk-556562e8":1,"chunk-667d2d85":1,"chunk-71ee0ac8":1,"chunk-bf0cb8b0":1};c[e]?n.push(c[e]):0!==c[e]&&t[e]&&n.push(c[e]=new Promise((function(n,t){for(var r="static/css/"+({}[e]||e)+"."+{"chunk-0575145a":"40f76b5c","chunk-05a99c67":"d0296c60","chunk-19593038":"40f76b5c","chunk-2162b876":"40f76b5c","chunk-2d2105d3":"31d6cfe0","chunk-2d230fe7":"31d6cfe0","chunk-4ed577de":"40f76b5c","chunk-556562e8":"b043920c","chunk-667d2d85":"d1c64e6f","chunk-71ee0ac8":"d1151f43","chunk-bf0cb8b0":"40f76b5c"}[e]+".css",u=i.p+r,o=document.getElementsByTagName("link"),a=0;a<o.length;a++){var d=o[a],f=d.getAttribute("data-href")||d.getAttribute("href");if("stylesheet"===d.rel&&(f===r||f===u))return n()}var h=document.getElementsByTagName("style");for(a=0;a<h.length;a++){d=h[a],f=d.getAttribute("data-href");if(f===r||f===u)return n()}var l=document.createElement("link");l.rel="stylesheet",l.type="text/css",l.onload=n,l.onerror=function(n){var r=n&&n.target&&n.target.src||u,o=new Error("Loading CSS chunk "+e+" failed.\n("+r+")");o.request=r,delete c[e],l.parentNode.removeChild(l),t(o)},l.href=u;var s=document.getElementsByTagName("head")[0];s.appendChild(l)})).then((function(){c[e]=0})));var r=u[e];if(0!==r)if(r)n.push(r[2]);else{var o=new Promise((function(n,t){r=u[e]=[n,t]}));n.push(r[2]=o);var d,f=document.createElement("script");f.charset="utf-8",f.timeout=120,i.nc&&f.setAttribute("nonce",i.nc),f.src=a(e),d=function(n){f.onerror=f.onload=null,clearTimeout(h);var t=u[e];if(0!==t){if(t){var r=n&&("load"===n.type?"missing":n.type),c=n&&n.target&&n.target.src,o=new Error("Loading chunk "+e+" failed.\n("+r+": "+c+")");o.type=r,o.request=c,t[1](o)}u[e]=void 0}};var h=setTimeout((function(){d({type:"timeout",target:f})}),12e4);f.onerror=f.onload=d,document.head.appendChild(f)}return Promise.all(n)},i.m=e,i.c=r,i.d=function(e,n,t){i.o(e,n)||Object.defineProperty(e,n,{enumerable:!0,get:t})},i.r=function(e){"undefined"!==typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},i.t=function(e,n){if(1&n&&(e=i(e)),8&n)return e;if(4&n&&"object"===typeof e&&e&&e.__esModule)return e;var t=Object.create(null);if(i.r(t),Object.defineProperty(t,"default",{enumerable:!0,value:e}),2&n&&"string"!=typeof e)for(var r in e)i.d(t,r,function(n){return e[n]}.bind(null,r));return t},i.n=function(e){var n=e&&e.__esModule?function(){return e["default"]}:function(){return e};return i.d(n,"a",n),n},i.o=function(e,n){return Object.prototype.hasOwnProperty.call(e,n)},i.p="/",i.oe=function(e){throw console.error(e),e};var d=window["webpackJsonp"]=window["webpackJsonp"]||[],f=d.push.bind(d);d.push=n,d=d.slice();for(var h=0;h<d.length;h++)n(d[h]);var l=f;t()})([]);</script><script src=/static/js/app.c8396009.js></script></body></html> <!DOCTYPE html><html><head><meta charset=utf-8><meta http-equiv=X-UA-Compatible content="IE=edge,chrome=1"><meta name=renderer content=webkit><meta name=viewport content="width=device-width,initial-scale=1,maximum-scale=1,user-scalable=no"><link rel=icon href=/favicon.ico><title>Vue Element Admin</title><link href=/static/css/chunk-libs.5cf311f0.css rel=stylesheet><link href=/static/css/app.1b85534f.css rel=stylesheet></head><body><div id=app></div><script src=/static/js/chunk-elementUI.d1ab7f65.js></script><script src=/static/js/chunk-libs.a49098e1.js></script><script>(function(e){function n(n){for(var r,c,a=n[0],i=n[1],d=n[2],f=0,h=[];f<a.length;f++)c=a[f],u[c]&&h.push(u[c][0]),u[c]=0;for(r in i)Object.prototype.hasOwnProperty.call(i,r)&&(e[r]=i[r]);l&&l(n);while(h.length)h.shift()();return o.push.apply(o,d||[]),t()}function t(){for(var e,n=0;n<o.length;n++){for(var t=o[n],r=!0,c=1;c<t.length;c++){var a=t[c];0!==u[a]&&(r=!1)}r&&(o.splice(n--,1),e=i(i.s=t[0]))}return e}var r={},c={runtime:0},u={runtime:0},o=[];function a(e){return i.p+"static/js/"+({}[e]||e)+"."+{"chunk-0575145a":"59e0ff0b","chunk-05a99c67":"be1a1e89","chunk-19593038":"e94b4705","chunk-1cc1e7b2":"cad4e853","chunk-2162b876":"65a3d33f","chunk-2d2105d3":"7106a610","chunk-2d230fe7":"446e67d8","chunk-4ed577de":"4aed5d59","chunk-556562e8":"04d70197","chunk-667d2d85":"2d4f045d","chunk-bf0cb8b0":"7e5e9a4e"}[e]+".js"}function i(n){if(r[n])return r[n].exports;var t=r[n]={i:n,l:!1,exports:{}};return e[n].call(t.exports,t,t.exports,i),t.l=!0,t.exports}i.e=function(e){var n=[],t={"chunk-0575145a":1,"chunk-05a99c67":1,"chunk-19593038":1,"chunk-1cc1e7b2":1,"chunk-2162b876":1,"chunk-4ed577de":1,"chunk-556562e8":1,"chunk-667d2d85":1,"chunk-bf0cb8b0":1};c[e]?n.push(c[e]):0!==c[e]&&t[e]&&n.push(c[e]=new Promise((function(n,t){for(var r="static/css/"+({}[e]||e)+"."+{"chunk-0575145a":"40f76b5c","chunk-05a99c67":"d0296c60","chunk-19593038":"40f76b5c","chunk-1cc1e7b2":"d3c6c5a3","chunk-2162b876":"40f76b5c","chunk-2d2105d3":"31d6cfe0","chunk-2d230fe7":"31d6cfe0","chunk-4ed577de":"40f76b5c","chunk-556562e8":"b043920c","chunk-667d2d85":"d1c64e6f","chunk-bf0cb8b0":"40f76b5c"}[e]+".css",u=i.p+r,o=document.getElementsByTagName("link"),a=0;a<o.length;a++){var d=o[a],f=d.getAttribute("data-href")||d.getAttribute("href");if("stylesheet"===d.rel&&(f===r||f===u))return n()}var h=document.getElementsByTagName("style");for(a=0;a<h.length;a++){d=h[a],f=d.getAttribute("data-href");if(f===r||f===u)return n()}var l=document.createElement("link");l.rel="stylesheet",l.type="text/css",l.onload=n,l.onerror=function(n){var r=n&&n.target&&n.target.src||u,o=new Error("Loading CSS chunk "+e+" failed.\n("+r+")");o.request=r,delete c[e],l.parentNode.removeChild(l),t(o)},l.href=u;var s=document.getElementsByTagName("head")[0];s.appendChild(l)})).then((function(){c[e]=0})));var r=u[e];if(0!==r)if(r)n.push(r[2]);else{var o=new Promise((function(n,t){r=u[e]=[n,t]}));n.push(r[2]=o);var d,f=document.createElement("script");f.charset="utf-8",f.timeout=120,i.nc&&f.setAttribute("nonce",i.nc),f.src=a(e),d=function(n){f.onerror=f.onload=null,clearTimeout(h);var t=u[e];if(0!==t){if(t){var r=n&&("load"===n.type?"missing":n.type),c=n&&n.target&&n.target.src,o=new Error("Loading chunk "+e+" failed.\n("+r+": "+c+")");o.type=r,o.request=c,t[1](o)}u[e]=void 0}};var h=setTimeout((function(){d({type:"timeout",target:f})}),12e4);f.onerror=f.onload=d,document.head.appendChild(f)}return Promise.all(n)},i.m=e,i.c=r,i.d=function(e,n,t){i.o(e,n)||Object.defineProperty(e,n,{enumerable:!0,get:t})},i.r=function(e){"undefined"!==typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},i.t=function(e,n){if(1&n&&(e=i(e)),8&n)return e;if(4&n&&"object"===typeof e&&e&&e.__esModule)return e;var t=Object.create(null);if(i.r(t),Object.defineProperty(t,"default",{enumerable:!0,value:e}),2&n&&"string"!=typeof e)for(var r in e)i.d(t,r,function(n){return e[n]}.bind(null,r));return t},i.n=function(e){var n=e&&e.__esModule?function(){return e["default"]}:function(){return e};return i.d(n,"a",n),n},i.o=function(e,n){return Object.prototype.hasOwnProperty.call(e,n)},i.p="/",i.oe=function(e){throw console.error(e),e};var d=window["webpackJsonp"]=window["webpackJsonp"]||[],f=d.push.bind(d);d.push=n,d=d.slice();for(var h=0;h<d.length;h++)n(d[h]);var l=f;t()})([]);</script><script src=/static/js/app.1757914b.js></script></body></html>
\ No newline at end of file \ No newline at end of file
.pagination-container[data-v-6af373ef]{background:#fff;padding:32px 16px}.pagination-container.hidden[data-v-6af373ef]{display:none}.contentInput[data-v-4ee43c7a]{min-height:200px}
\ No newline at end of file
.pagination-container[data-v-6af373ef]{background:#fff;padding:32px 16px}.pagination-container.hidden[data-v-6af373ef]{display:none}.contentInput[data-v-29af2088]{min-height:200px}
\ No newline at end of file
This source diff could not be displayed because it is too large. You can view the blob instead.
(window["webpackJsonp"]=window["webpackJsonp"]||[]).push([["chunk-1cc1e7b2"],{"049c":function(t,e,i){},"333d":function(t,e,i){"use strict";var n=function(){var t=this,e=t.$createElement,i=t._self._c||e;return i("div",{staticClass:"pagination-container",class:{hidden:t.hidden}},[i("el-pagination",t._b({attrs:{background:t.background,"current-page":t.currentPage,"page-size":t.pageSize,layout:t.layout,"page-sizes":t.pageSizes,total:t.total},on:{"update:currentPage":function(e){t.currentPage=e},"update:current-page":function(e){t.currentPage=e},"update:pageSize":function(e){t.pageSize=e},"update:page-size":function(e){t.pageSize=e},"size-change":t.handleSizeChange,"current-change":t.handleCurrentChange}},"el-pagination",t.$attrs,!1))],1)},a=[];i("c5f6");Math.easeInOutQuad=function(t,e,i,n){return t/=n/2,t<1?i/2*t*t+e:(t--,-i/2*(t*(t-2)-1)+e)};var o=function(){return window.requestAnimationFrame||window.webkitRequestAnimationFrame||window.mozRequestAnimationFrame||function(t){window.setTimeout(t,1e3/60)}}();function l(t){document.documentElement.scrollTop=t,document.body.parentNode.scrollTop=t,document.body.scrollTop=t}function r(){return document.documentElement.scrollTop||document.body.parentNode.scrollTop||document.body.scrollTop}function s(t,e,i){var n=r(),a=t-n,s=20,u=0;e="undefined"===typeof e?500:e;var c=function t(){u+=s;var r=Math.easeInOutQuad(u,n,a,e);l(r),u<e?o(t):i&&"function"===typeof i&&i()};c()}var u={name:"Pagination",props:{total:{required:!0,type:Number},page:{type:Number,default:1},limit:{type:Number,default:20},pageSizes:{type:Array,default:function(){return[10,20,30,50]}},layout:{type:String,default:"total, sizes, prev, pager, next, jumper"},background:{type:Boolean,default:!0},autoScroll:{type:Boolean,default:!0},hidden:{type:Boolean,default:!1}},computed:{currentPage:{get:function(){return this.page},set:function(t){this.$emit("update:page",t)}},pageSize:{get:function(){return this.limit},set:function(t){this.$emit("update:limit",t)}}},methods:{handleSizeChange:function(t){this.$emit("pagination",{page:this.currentPage,limit:t}),this.autoScroll&&s(0,800)},handleCurrentChange:function(t){this.$emit("pagination",{page:t,limit:this.pageSize}),this.autoScroll&&s(0,800)}}},c=u,p=(i("e498"),i("2877")),d=Object(p["a"])(c,n,a,!1,null,"6af373ef",null);e["a"]=d.exports},"4b03":function(t,e,i){"use strict";i.r(e);var n=function(){var t=this,e=t.$createElement,i=t._self._c||e;return i("div",{staticClass:"app-container"},[i("div",{staticClass:"filter-container"},[i("el-input",{staticClass:"filter-item",staticStyle:{width:"200px"},attrs:{placeholder:"名称"},nativeOn:{keyup:function(e){return!e.type.indexOf("key")&&t._k(e.keyCode,"enter",13,e.key,"Enter")?null:t.handleFilter(e)}},model:{value:t.listQuery.title,callback:function(e){t.$set(t.listQuery,"title",e)},expression:"listQuery.title"}}),t._v(" "),i("el-button",{staticClass:"filter-item",attrs:{type:"primary",icon:"el-icon-search"},on:{click:t.handleFilter}},[t._v("\n 搜索\n ")]),t._v(" "),i("el-button",{staticClass:"filter-item",staticStyle:{"margin-left":"10px"},attrs:{type:"primary",icon:"el-icon-edit"},on:{click:t.importGroupGood}},[t._v("\n 导入链接\n ")]),t._v(" "),i("el-button",{staticClass:"filter-item",staticStyle:{"margin-left":"10px"},attrs:{type:"primary",icon:"el-icon-edit"},on:{click:t.createGroupGood}},[t._v("\n 新建\n ")])],1),t._v(" "),i("el-table",{directives:[{name:"loading",rawName:"v-loading",value:t.listLoading,expression:"listLoading"}],attrs:{data:t.list,"element-loading-text":"Loading",border:"",fit:"","highlight-current-row":""}},[i("el-table-column",{attrs:{align:"center",label:"ID",width:"95"},scopedSlots:t._u([{key:"default",fn:function(e){return[t._v("\n "+t._s(e.$index)+"\n ")]}}])}),t._v(" "),i("el-table-column",{attrs:{label:"标题"},scopedSlots:t._u([{key:"default",fn:function(e){return[t._v("\n "+t._s(e.row.title)+"\n ")]}}])}),t._v(" "),i("el-table-column",{attrs:{label:"时段"},scopedSlots:t._u([{key:"default",fn:function(e){return[t._v("\n "+t._s(e.row.hour[0]+"---"+e.row.hour[1])+"\n ")]}}])}),t._v(" "),i("el-table-column",{attrs:{label:"图片"},scopedSlots:t._u([{key:"default",fn:function(t){return[i("el-image",{staticStyle:{width:"100px",height:"100px"},attrs:{src:t.row.img_url,fit:"fill"}})]}}])}),t._v(" "),i("el-table-column",{attrs:{label:"内容"},scopedSlots:t._u([{key:"default",fn:function(e){return[t._v("\n "+t._s(e.row.content)+"\n ")]}}])}),t._v(" "),i("el-table-column",{attrs:{label:"操作",align:"center",width:"230","class-name":"small-padding fixed-width"},scopedSlots:t._u([{key:"default",fn:function(e){return[i("el-button",{attrs:{type:"primary",size:"mini"},on:{click:function(i){return t.updateGood(e.row)}}},[t._v("\n 编辑\n ")]),t._v(" "),i("el-button",{attrs:{type:"primary",size:"mini"},on:{click:function(i){return t.deleteGood(e.row.id)}}},[t._v("\n 删除\n ")])]}}])})],1),t._v(" "),i("pagination",{directives:[{name:"show",rawName:"v-show",value:t.total>0,expression:"total > 0"}],attrs:{total:t.total,page:t.listQuery.page,limit:t.listQuery.limit},on:{"update:page":function(e){return t.$set(t.listQuery,"page",e)},"update:limit":function(e){return t.$set(t.listQuery,"limit",e)},pagination:t.fetchData}}),t._v(" "),i("el-dialog",{staticClass:"el-dialog-medium",attrs:{title:t.title,visible:t.dialogTableVisible,"close-on-click-modal":!1,"close-on-press-escape":!1},on:{"update:visible":function(e){t.dialogTableVisible=e}}},[i("el-form",{ref:"form",attrs:{rules:t.rules,model:t.form,"label-position":"left","label-width":"80px"}},[i("el-form-item",{attrs:{label:"标题",prop:"title"}},[i("el-input",{attrs:{placeholder:"请输入标题"},model:{value:t.form.title,callback:function(e){t.$set(t.form,"title",e)},expression:"form.title"}})],1),t._v(" "),i("el-form-item",{attrs:{label:"图片地址",prop:"img_url"}},[i("el-upload",{staticClass:"upload-demo",attrs:{action:"http://jingdong-fe.kaibawang.cn/api/jingdong/upload","on-remove":t.handleRemove,"on-success":t.handleSuccess,"before-upload":t.checkBefore,"file-list":t.fileList,multiple:!1,"list-type":"picture"}},[i("el-button",{attrs:{size:"small",type:"primary"}},[t._v("点击上传")]),t._v(" "),i("div",{staticClass:"el-upload__tip",attrs:{slot:"tip"},slot:"tip"},[t._v("只能上传jpg/jpeg/png文件")])],1)],1),t._v(" "),i("el-form-item",{attrs:{label:"内容",prop:"content"}},[i("el-input",{staticClass:"contentInput",attrs:{type:"textarea",rows:8,placeholder:"请输入内容"},model:{value:t.form.content,callback:function(e){t.$set(t.form,"content",e)},expression:"form.content"}})],1),t._v(" "),i("el-form-item",{attrs:{label:"时段",prop:"hour"}},[i("el-date-picker",{attrs:{type:"datetimerange","range-separator":"至","start-placeholder":"开始日期","end-placeholder":"结束日期","value-format":"yyyy-MM-dd HH:mm:ss"},model:{value:t.form.hour,callback:function(e){t.$set(t.form,"hour",e)},expression:"form.hour"}})],1)],1),t._v(" "),i("div",{staticClass:"dialog-footer",attrs:{slot:"footer"},slot:"footer"},[i("el-button",{on:{click:function(e){t.dialogTableVisible=!1}}},[t._v("取 消")]),t._v(" "),i("el-button",{attrs:{type:"primary"},on:{click:function(e){return t.updateConfirm("form")}}},[t._v("确 定")])],1)],1)],1)},a=[],o=(i("28a5"),i("b775")),l=i("5f87");function r(t){return t.token=Object(l["a"])(),Object(o["a"])({url:"jingdong/group-good-list",method:"get",params:t})}function s(t){return t.token=Object(l["a"])(),Object(o["a"])({url:"jingdong/import-group-good-coupon",method:"post",params:t})}function u(t){return t.token=Object(l["a"])(),Object(o["a"])({url:"jingdong/create-group-good",method:"post",params:t})}function c(t){return t.token=Object(l["a"])(),Object(o["a"])({url:"jingdong/update-group-good",method:"post",params:t})}function p(t){return t.token=Object(l["a"])(),Object(o["a"])({url:"jingdong/"+t.id+"/delete-good",method:"delete",params:t})}var d=i("333d"),m={name:"Accounts",components:{Pagination:d["a"]},filters:{},data:function(){return{dialogTableVisible:!1,list:null,listLoading:!0,total:0,listQuery:{page:1,limit:15,title:"",hour:[]},hourList:[{value:0},{value:1},{value:2},{value:3},{value:5},{value:6},{value:7},{value:8},{value:9},{value:10},{value:11},{value:12},{value:13},{value:14},{value:15},{value:16},{value:17},{value:18},{value:19},{value:20},{value:21},{value:22},{value:23}],form:{id:0,img_url:"",content:"",hour:"",title:""},rules:{img_url:[{required:!0,message:"图片地址必须",trigger:"blur"}],content:[{required:!0,message:"内容必须",trigger:"blur"}],hour:[{required:!0,message:"时段必须",trigger:"blur"}]},fileList:[],types:["image/jpeg","image/jpg","image/png"],title:"新建"}},created:function(){this.fetchData()},methods:{deleteGood:function(t){var e=this;this.$confirm("确定删除吗?","提示",{confirmButtonText:"确定",cancelButtonText:"取消",type:"warning"}).then((function(){p({id:t}).then((function(t){e.$message({message:"操作成功!",type:"success"}),e.fetchData()}))})).catch((function(){e.$message({type:"error",message:"取消当前操作"})}))},updateConfirm:function(){var t=this;"新建"===this.title?u(this.form).then((function(e){t.$message({type:"success",message:"新建成功"}),t.dialogTableVisible=!1,t.fetchData()})):c(this.form).then((function(e){t.$message({type:"success",message:"保存成功"}),t.dialogTableVisible=!1,t.fetchData()}))},createGroupGood:function(){this.title="新建",this.form.id=0,this.form.img_url="",this.form.content="",this.form.title="",this.form.hour="",this.fileList=[],this.dialogTableVisible=!0},handleRemove:function(t,e){this.form.img_url="",this.fileList=[]},handleSuccess:function(t,e,i){this.form.img_url=t.data.url;var n=this.form.img_url.split("/");this.fileList[0]={name:n.pop(),url:this.form.img_url}},checkBefore:function(t){var e=this.types.indexOf(t.type)>=0;e||this.$message.error("上传图片格式不正确!")},importGroupGood:function(){var t=this;this.$prompt("请输入优惠券地址","提示",{confirmButtonText:"确定",cancelButtonText:"取消",inputPattern:/^([hH][tT]{2}[pP]:\/\/|[hH][tT]{2}[pP][sS]:\/\/)(([A-Za-z0-9-~]+)\.)+([A-Za-z0-9-~\/])+$/,inputErrorMessage:"格式不正确"}).then((function(e){var i=e.value;s({url:i}).then((function(e){t.$message({type:"info",message:"更新成功"}),t.fetchData()}))})).catch((function(){t.$message({type:"info",message:"取消输入"})}))},updateGood:function(t){this.title="编辑",this.form.id=t.id,this.form.img_url=t.img_url,this.form.content=t.content,this.form.title=t.title,this.form.hour=t.hour;var e=t.img_url.split("/");this.fileList=[],this.fileList[0]={name:e.pop(),url:t.img_url},this.dialogTableVisible=!0},fetchData:function(){var t=this;this.listLoading=!1,r(this.listQuery).then((function(e){t.list=e.data.data,t.total=e.data.meta.total,setTimeout((function(){t.listLoading=!1}),500)}))},handleFilter:function(){this.listQuery.page=1,this.fetchData()}}},f=m,g=(i("b0a3"),i("2877")),h=Object(g["a"])(f,n,a,!1,null,"4ee43c7a",null);e["default"]=h.exports},7456:function(t,e,i){},b0a3:function(t,e,i){"use strict";var n=i("049c"),a=i.n(n);a.a},e498:function(t,e,i){"use strict";var n=i("7456"),a=i.n(n);a.a}}]);
\ No newline at end of file
(window["webpackJsonp"]=window["webpackJsonp"]||[]).push([["chunk-71ee0ac8"],{"195a":function(t,e,i){},"333d":function(t,e,i){"use strict";var a=function(){var t=this,e=t.$createElement,i=t._self._c||e;return i("div",{staticClass:"pagination-container",class:{hidden:t.hidden}},[i("el-pagination",t._b({attrs:{background:t.background,"current-page":t.currentPage,"page-size":t.pageSize,layout:t.layout,"page-sizes":t.pageSizes,total:t.total},on:{"update:currentPage":function(e){t.currentPage=e},"update:current-page":function(e){t.currentPage=e},"update:pageSize":function(e){t.pageSize=e},"update:page-size":function(e){t.pageSize=e},"size-change":t.handleSizeChange,"current-change":t.handleCurrentChange}},"el-pagination",t.$attrs,!1))],1)},n=[];i("c5f6");Math.easeInOutQuad=function(t,e,i,a){return t/=a/2,t<1?i/2*t*t+e:(t--,-i/2*(t*(t-2)-1)+e)};var o=function(){return window.requestAnimationFrame||window.webkitRequestAnimationFrame||window.mozRequestAnimationFrame||function(t){window.setTimeout(t,1e3/60)}}();function l(t){document.documentElement.scrollTop=t,document.body.parentNode.scrollTop=t,document.body.scrollTop=t}function r(){return document.documentElement.scrollTop||document.body.parentNode.scrollTop||document.body.scrollTop}function s(t,e,i){var a=r(),n=t-a,s=20,u=0;e="undefined"===typeof e?500:e;var c=function t(){u+=s;var r=Math.easeInOutQuad(u,a,n,e);l(r),u<e?o(t):i&&"function"===typeof i&&i()};c()}var u={name:"Pagination",props:{total:{required:!0,type:Number},page:{type:Number,default:1},limit:{type:Number,default:20},pageSizes:{type:Array,default:function(){return[10,20,30,50]}},layout:{type:String,default:"total, sizes, prev, pager, next, jumper"},background:{type:Boolean,default:!0},autoScroll:{type:Boolean,default:!0},hidden:{type:Boolean,default:!1}},computed:{currentPage:{get:function(){return this.page},set:function(t){this.$emit("update:page",t)}},pageSize:{get:function(){return this.limit},set:function(t){this.$emit("update:limit",t)}}},methods:{handleSizeChange:function(t){this.$emit("pagination",{page:this.currentPage,limit:t}),this.autoScroll&&s(0,800)},handleCurrentChange:function(t){this.$emit("pagination",{page:t,limit:this.pageSize}),this.autoScroll&&s(0,800)}}},c=u,p=(i("e498"),i("2877")),d=Object(p["a"])(c,a,n,!1,null,"6af373ef",null);e["a"]=d.exports},"4b03":function(t,e,i){"use strict";i.r(e);var a=function(){var t=this,e=t.$createElement,i=t._self._c||e;return i("div",{staticClass:"app-container"},[i("div",{staticClass:"filter-container"},[i("el-input",{staticClass:"filter-item",staticStyle:{width:"200px"},attrs:{placeholder:"名称"},nativeOn:{keyup:function(e){return!e.type.indexOf("key")&&t._k(e.keyCode,"enter",13,e.key,"Enter")?null:t.handleFilter(e)}},model:{value:t.listQuery.title,callback:function(e){t.$set(t.listQuery,"title",e)},expression:"listQuery.title"}}),t._v(" "),i("el-button",{staticClass:"filter-item",attrs:{type:"primary",icon:"el-icon-search"},on:{click:t.handleFilter}},[t._v("\n 搜索\n ")]),t._v(" "),i("el-button",{staticClass:"filter-item",staticStyle:{"margin-left":"10px"},attrs:{type:"primary",icon:"el-icon-edit"},on:{click:t.importGroupGood}},[t._v("\n 导入链接\n ")]),t._v(" "),i("el-button",{staticClass:"filter-item",staticStyle:{"margin-left":"10px"},attrs:{type:"primary",icon:"el-icon-edit"},on:{click:t.createGroupGood}},[t._v("\n 新建\n ")])],1),t._v(" "),i("el-table",{directives:[{name:"loading",rawName:"v-loading",value:t.listLoading,expression:"listLoading"}],attrs:{data:t.list,"element-loading-text":"Loading",border:"",fit:"","highlight-current-row":""}},[i("el-table-column",{attrs:{align:"center",label:"ID",width:"95"},scopedSlots:t._u([{key:"default",fn:function(e){return[t._v("\n "+t._s(e.$index)+"\n ")]}}])}),t._v(" "),i("el-table-column",{attrs:{label:"标题"},scopedSlots:t._u([{key:"default",fn:function(e){return[t._v("\n "+t._s(e.row.title)+"\n ")]}}])}),t._v(" "),i("el-table-column",{attrs:{label:"时段"},scopedSlots:t._u([{key:"default",fn:function(e){return[t._v("\n "+t._s(e.row.hour[0]+"---"+e.row.hour[1])+"\n ")]}}])}),t._v(" "),i("el-table-column",{attrs:{label:"图片"},scopedSlots:t._u([{key:"default",fn:function(t){return[i("el-image",{staticStyle:{width:"100px",height:"100px"},attrs:{src:t.row.img_url,fit:"fill"}})]}}])}),t._v(" "),i("el-table-column",{attrs:{label:"内容"},scopedSlots:t._u([{key:"default",fn:function(e){return[t._v("\n "+t._s(e.row.content)+"\n ")]}}])}),t._v(" "),i("el-table-column",{attrs:{label:"操作",align:"center",width:"230","class-name":"small-padding fixed-width"},scopedSlots:t._u([{key:"default",fn:function(e){return[i("el-button",{attrs:{type:"primary",size:"mini"},on:{click:function(i){return t.updateGood(e.row)}}},[t._v("\n 编辑\n ")]),t._v(" "),i("el-button",{attrs:{type:"primary",size:"mini"},on:{click:function(i){return t.deleteGood(e.row.id)}}},[t._v("\n 删除\n ")])]}}])})],1),t._v(" "),i("pagination",{directives:[{name:"show",rawName:"v-show",value:t.total>0,expression:"total > 0"}],attrs:{total:t.total,page:t.listQuery.page,limit:t.listQuery.limit},on:{"update:page":function(e){return t.$set(t.listQuery,"page",e)},"update:limit":function(e){return t.$set(t.listQuery,"limit",e)},pagination:t.fetchData}}),t._v(" "),i("el-dialog",{staticClass:"el-dialog-medium",attrs:{title:t.title,visible:t.dialogTableVisible,"close-on-click-modal":!1,"close-on-press-escape":!1},on:{"update:visible":function(e){t.dialogTableVisible=e}}},[i("el-form",{ref:"form",attrs:{rules:t.rules,model:t.form,"label-position":"left","label-width":"80px"}},[i("el-form-item",{attrs:{label:"标题",prop:"title"}},[i("el-input",{attrs:{placeholder:"请输入标题"},model:{value:t.form.title,callback:function(e){t.$set(t.form,"title",e)},expression:"form.title"}})],1),t._v(" "),i("el-form-item",{attrs:{label:"图片地址",prop:"img_url"}},[i("el-upload",{staticClass:"upload-demo",attrs:{action:"http://jingdong-fe.kaibawang.cn/api/jingdong/upload","on-remove":t.handleRemove,"on-success":t.handleSuccess,"before-upload":t.checkBefore,"file-list":t.fileList,multiple:!1,"list-type":"picture"}},[i("el-button",{attrs:{size:"small",type:"primary"}},[t._v("点击上传")]),t._v(" "),i("div",{staticClass:"el-upload__tip",attrs:{slot:"tip"},slot:"tip"},[t._v("只能上传jpg/jpeg/png文件")])],1)],1),t._v(" "),i("el-form-item",{attrs:{label:"内容",prop:"content"}},[i("el-input",{staticClass:"contentInput",attrs:{type:"textarea",rows:8,placeholder:"请输入内容"},model:{value:t.form.content,callback:function(e){t.$set(t.form,"content",e)},expression:"form.content"}})],1),t._v(" "),i("el-form-item",{attrs:{label:"时段",prop:"hour"}},[i("el-date-picker",{attrs:{type:"datetimerange","range-separator":"至","start-placeholder":"开始日期","end-placeholder":"结束日期","value-format":"yyyy-MM-dd HH:mm:ss"},model:{value:t.form.hour,callback:function(e){t.$set(t.form,"hour",e)},expression:"form.hour"}})],1)],1),t._v(" "),i("div",{staticClass:"dialog-footer",attrs:{slot:"footer"},slot:"footer"},[i("el-button",{on:{click:function(e){t.dialogTableVisible=!1}}},[t._v("取 消")]),t._v(" "),i("el-button",{attrs:{type:"primary"},on:{click:function(e){return t.updateConfirm("form")}}},[t._v("确 定")])],1)],1)],1)},n=[],o=(i("28a5"),i("b775")),l=i("5f87");function r(t){return t.token=Object(l["a"])(),Object(o["a"])({url:"jingdong/group-good-list",method:"get",params:t})}function s(t){return t.token=Object(l["a"])(),Object(o["a"])({url:"jingdong/import-group-good-coupon",method:"post",params:t})}function u(t){return t.token=Object(l["a"])(),Object(o["a"])({url:"jingdong/create-group-good",method:"post",params:t})}function c(t){return t.token=Object(l["a"])(),Object(o["a"])({url:"jingdong/update-group-good",method:"post",params:t})}function p(t){return t.token=Object(l["a"])(),Object(o["a"])({url:"jingdong/"+t.id+"/delete-good",method:"delete",params:t})}var d=i("333d"),m={name:"Accounts",components:{Pagination:d["a"]},filters:{},data:function(){return{dialogTableVisible:!1,list:null,listLoading:!0,total:0,listQuery:{page:1,limit:15,title:"",hour:[]},hourList:[{value:0},{value:1},{value:2},{value:3},{value:5},{value:6},{value:7},{value:8},{value:9},{value:10},{value:11},{value:12},{value:13},{value:14},{value:15},{value:16},{value:17},{value:18},{value:19},{value:20},{value:21},{value:22},{value:23}],form:{id:0,img_url:"",content:"",hour:"",title:""},rules:{img_url:[{required:!0,message:"图片地址必须",trigger:"blur"}],content:[{required:!0,message:"内容必须",trigger:"blur"}],hour:[{required:!0,message:"时段必须",trigger:"blur"}]},fileList:[],types:["image/jpeg","image/jpg","image/png"],title:"新建"}},created:function(){this.fetchData()},methods:{deleteGood:function(t){var e=this;this.$confirm("确定删除吗?","提示",{confirmButtonText:"确定",cancelButtonText:"取消",type:"warning"}).then((function(){p({id:t}).then((function(t){e.$message({message:"操作成功!",type:"success"}),e.fetchData()}))})).catch((function(){e.$message({type:"error",message:"取消当前操作"})}))},updateConfirm:function(){var t=this;"新建"==this.title?u(this.form).then((function(e){t.$message({type:"success",message:"新建成功"}),t.dialogTableVisible=!1,t.fetchData()})):c(this.form).then((function(e){t.$message({type:"success",message:"保存成功"}),t.dialogTableVisible=!1,t.fetchData()}))},createGroupGood:function(){this.form.id=0,this.form.img_url="",this.form.content="",this.form.title="",this.fileList=[],this.dialogTableVisible=!0},handleRemove:function(t,e){this.form.img_url="",this.fileList=[]},handleSuccess:function(t,e,i){this.form.img_url=t.data.url;var a=this.form.img_url.split("/");this.fileList[0]={name:a.pop(),url:this.form.img_url}},checkBefore:function(t){var e=this.types.indexOf(t.type)>=0;e||this.$message.error("上传图片格式不正确!")},importGroupGood:function(){var t=this;this.$prompt("请输入优惠券地址","提示",{confirmButtonText:"确定",cancelButtonText:"取消",inputPattern:/^([hH][tT]{2}[pP]:\/\/|[hH][tT]{2}[pP][sS]:\/\/)(([A-Za-z0-9-~]+)\.)+([A-Za-z0-9-~\/])+$/,inputErrorMessage:"格式不正确"}).then((function(e){var i=e.value;s({url:i}).then((function(e){t.$message({type:"info",message:"更新成功"}),t.fetchData()}))})).catch((function(){t.$message({type:"info",message:"取消输入"})}))},updateGood:function(t){this.title="编辑",this.form.id=t.id,this.form.img_url=t.img_url,this.form.content=t.content,this.form.title=t.title,this.form.hour=t.hour;var e=t.img_url.split("/");this.fileList[0]={name:e.pop(),url:t.img_url},this.dialogTableVisible=!0},fetchData:function(){var t=this;this.listLoading=!1,r(this.listQuery).then((function(e){t.list=e.data.data,t.total=e.data.meta.total,setTimeout((function(){t.listLoading=!1}),500)}))},handleFilter:function(){this.listQuery.page=1,this.fetchData()}}},f=m,g=(i("92e1"),i("2877")),h=Object(g["a"])(f,a,n,!1,null,"29af2088",null);e["default"]=h.exports},7456:function(t,e,i){},"92e1":function(t,e,i){"use strict";var a=i("195a"),n=i.n(a);n.a},e498:function(t,e,i){"use strict";var a=i("7456"),n=i.n(a);n.a}}]);
\ No newline at end of file
...@@ -2,20 +2,20 @@ ...@@ -2,20 +2,20 @@
<div class="app-container"> <div class="app-container">
<div class="filter-container"> <div class="filter-container">
<el-input v-model="listQuery.title" placeholder="名称" style="width: 200px;" class="filter-item" @keyup.enter.native="handleFilter" /> <el-input v-model="listQuery.title" placeholder="名称" style="width: 200px;" class="filter-item" @keyup.enter.native="handleFilter" />
<!-- <el-select--> <!-- <el-select-->
<!-- v-model="listQuery.hour"--> <!-- v-model="listQuery.hour"-->
<!-- placeholder="请选择时段"--> <!-- placeholder="请选择时段"-->
<!-- class="width-full filter-item"--> <!-- class="width-full filter-item"-->
<!-- filterable--> <!-- filterable-->
<!-- clearable--> <!-- clearable-->
<!-- >--> <!-- >-->
<!-- <el-option--> <!-- <el-option-->
<!-- v-for="item in hourList"--> <!-- v-for="item in hourList"-->
<!-- :key="item.value"--> <!-- :key="item.value"-->
<!-- :label="item.value"--> <!-- :label="item.value"-->
<!-- :value="item.value"--> <!-- :value="item.value"-->
<!-- />--> <!-- />-->
<!-- </el-select>--> <!-- </el-select>-->
<el-button class="filter-item" type="primary" icon="el-icon-search" @click="handleFilter"> <el-button class="filter-item" type="primary" icon="el-icon-search" @click="handleFilter">
搜索 搜索
</el-button> </el-button>
...@@ -125,191 +125,194 @@ ...@@ -125,191 +125,194 @@
</template> </template>
<script> <script>
import { getGroupList, importGroupCoupon, updateGroup, createGroup, deleteGood } from '@/api/groupGoods' import { getGroupList, importGroupCoupon, updateGroup, createGroup, deleteGood } from '@/api/groupGoods'
import Pagination from '@/components/Pagination' import Pagination from '@/components/Pagination'
export default { export default {
name: 'Accounts', name: 'Accounts',
components: { Pagination }, components: { Pagination },
filters: { filters: {
}, },
data() { data() {
return { return {
dialogTableVisible: false, dialogTableVisible: false,
list: null, list: null,
listLoading: true, listLoading: true,
total: 0, total: 0,
listQuery: { listQuery: {
page: 1, page: 1,
limit: 15, limit: 15,
title: '', title: '',
hour: [], hour: []
}, },
hourList: [ hourList: [
{ value: 0 }, { value: 0 },
{ value: 1 }, { value: 1 },
{ value: 2 }, { value: 2 },
{ value: 3 }, { value: 3 },
{ value: 5 }, { value: 5 },
{ value: 6 }, { value: 6 },
{ value: 7 }, { value: 7 },
{ value: 8 }, { value: 8 },
{ value: 9 }, { value: 9 },
{ value: 10 }, { value: 10 },
{ value: 11 }, { value: 11 },
{ value: 12 }, { value: 12 },
{ value: 13 }, { value: 13 },
{ value: 14 }, { value: 14 },
{ value: 15 }, { value: 15 },
{ value: 16 }, { value: 16 },
{ value: 17 }, { value: 17 },
{ value: 18 }, { value: 18 },
{ value: 19 }, { value: 19 },
{ value: 20 }, { value: 20 },
{ value: 21 }, { value: 21 },
{ value: 22 }, { value: 22 },
{ value: 23 }, { value: 23 }
], ],
form: { form: {
id: 0, id: 0,
img_url: '', img_url: '',
content: '', content: '',
hour: '', hour: '',
title: '' title: ''
}, },
rules: { rules: {
img_url: [{ required: true, message: '图片地址必须', trigger: 'blur' }], img_url: [{ required: true, message: '图片地址必须', trigger: 'blur' }],
content: [{ required: true, message: '内容必须', trigger: 'blur' }], content: [{ required: true, message: '内容必须', trigger: 'blur' }],
hour: [{ required: true, message: '时段必须', trigger: 'blur' }] hour: [{ required: true, message: '时段必须', trigger: 'blur' }]
}, },
fileList: [], fileList: [],
types: [ types: [
'image/jpeg', 'image/jpeg',
'image/jpg', 'image/jpg',
'image/png', 'image/png'
], ],
title: '新建' title: '新建'
} }
}, },
created() { created() {
this.fetchData() this.fetchData()
}, },
methods: { methods: {
deleteGood(id) { deleteGood(id) {
this.$confirm('确定删除吗?', '提示', { this.$confirm('确定删除吗?', '提示', {
confirmButtonText: '确定', confirmButtonText: '确定',
cancelButtonText: '取消', cancelButtonText: '取消',
type: 'warning' type: 'warning'
}).then(() => { }).then(() => {
deleteGood({ id }).then(response => { deleteGood({ id }).then(response => {
this.$message({
message: '操作成功!',
type: 'success'
})
this.fetchData()
})
}).catch(() => {
this.$message({ this.$message({
type: 'error', message: '操作成功!',
message: '取消当前操作' type: 'success'
}) })
this.fetchData()
}) })
}, }).catch(() => {
updateConfirm() { this.$message({
if (this.title == '新建') { type: 'error',
createGroup(this.form).then(res => { message: '取消当前操作'
this.$message({ })
type: 'success', })
message: '新建成功' },
}); updateConfirm() {
this.dialogTableVisible = false if (this.title === '新建') {
this.fetchData() createGroup(this.form).then(res => {
}) this.$message({
} else { type: 'success',
updateGroup(this.form).then(res => { message: '新建成功'
this.$message({
type: 'success',
message: '保存成功'
});
this.dialogTableVisible = false
this.fetchData()
}) })
} this.dialogTableVisible = false
}, this.fetchData()
createGroupGood() { })
this.form.id = 0 } else {
this.form.img_url = '' updateGroup(this.form).then(res => {
this.form.content = '' this.$message({
this.form.title = '' type: 'success',
this.fileList = [] message: '保存成功'
this.dialogTableVisible = true
},
handleRemove(file, fileList) {
this.form.img_url = ''
this.fileList = []
},
handleSuccess(response, file, fileList) {
this.form.img_url = response.data.url
const params = this.form.img_url.split('/')
this.fileList[0] = { name: params.pop(), url: this.form.img_url }
},
checkBefore(file) {
const availableType = this.types.indexOf(file.type) >= 0
if (!availableType) {
this.$message.error('上传图片格式不正确!')
}
return
},
importGroupGood() {
this.$prompt('请输入优惠券地址', '提示', {
confirmButtonText: '确定',
cancelButtonText: '取消',
inputPattern: /^([hH][tT]{2}[pP]:\/\/|[hH][tT]{2}[pP][sS]:\/\/)(([A-Za-z0-9-~]+)\.)+([A-Za-z0-9-~\/])+$/,
inputErrorMessage: '格式不正确'
}).then(({ value }) => {
importGroupCoupon({url: value}).then(res => {
this.$message({
type: 'info',
message: '更新成功'
});
this.fetchData()
}) })
}).catch(() => { this.dialogTableVisible = false
this.fetchData()
})
}
},
createGroupGood() {
this.title = '新建'
this.form.id = 0
this.form.img_url = ''
this.form.content = ''
this.form.title = ''
this.form.hour = ''
this.fileList = []
this.dialogTableVisible = true
},
handleRemove(file, fileList) {
this.form.img_url = ''
this.fileList = []
},
handleSuccess(response, file, fileList) {
this.form.img_url = response.data.url
const params = this.form.img_url.split('/')
this.fileList[0] = { name: params.pop(), url: this.form.img_url }
},
checkBefore(file) {
const availableType = this.types.indexOf(file.type) >= 0
if (!availableType) {
this.$message.error('上传图片格式不正确!')
}
return
},
importGroupGood() {
this.$prompt('请输入优惠券地址', '提示', {
confirmButtonText: '确定',
cancelButtonText: '取消',
inputPattern: /^([hH][tT]{2}[pP]:\/\/|[hH][tT]{2}[pP][sS]:\/\/)(([A-Za-z0-9-~]+)\.)+([A-Za-z0-9-~\/])+$/,
inputErrorMessage: '格式不正确'
}).then(({ value }) => {
importGroupCoupon({ url: value }).then(res => {
this.$message({ this.$message({
type: 'info', type: 'info',
message: '取消输入' message: '更新成功'
}); })
}); this.fetchData()
},
updateGood(obj) {
this.title = '编辑'
this.form.id = obj.id
this.form.img_url = obj.img_url
this.form.content = obj.content
this.form.title = obj.title
this.form.hour = obj.hour
const params = obj.img_url.split('/')
this.fileList[0] = { name: params.pop(), url: obj.img_url }
this.dialogTableVisible = true
},
fetchData() {
this.listLoading = false
getGroupList(this.listQuery).then(response => {
this.list = response.data.data
this.total = response.data.meta.total
// Just to simulate the time of the request
setTimeout(() => {
this.listLoading = false
}, 0.5 * 1000)
}) })
}, }).catch(() => {
handleFilter() { this.$message({
this.listQuery.page = 1 type: 'info',
this.fetchData() message: '取消输入'
} })
})
},
updateGood(obj) {
this.title = '编辑'
this.form.id = obj.id
this.form.img_url = obj.img_url
this.form.content = obj.content
this.form.title = obj.title
this.form.hour = obj.hour
const params = obj.img_url.split('/')
this.fileList = []
this.fileList[0] = { name: params.pop(), url: obj.img_url }
this.dialogTableVisible = true
},
fetchData() {
this.listLoading = false
getGroupList(this.listQuery).then(response => {
this.list = response.data.data
this.total = response.data.meta.total
// Just to simulate the time of the request
setTimeout(() => {
this.listLoading = false
}, 0.5 * 1000)
})
},
handleFilter() {
this.listQuery.page = 1
this.fetchData()
} }
} }
}
</script> </script>
<style scoped> <style scoped>
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or sign in to comment