Commit 6f4a53d9 by wang

update

parent fa5552a8
<!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.e18388bc.js></script><script src=/static/js/chunk-libs.a49098e1.js></script><script>(function(e){function n(n){for(var r,u,a=n[0],d=n[1],i=n[2],f=0,h=[];f<a.length;f++)u=a[f],c[u]&&h.push(c[u][0]),c[u]=0;for(r in d)Object.prototype.hasOwnProperty.call(d,r)&&(e[r]=d[r]);l&&l(n);while(h.length)h.shift()();return o.push.apply(o,i||[]),t()}function t(){for(var e,n=0;n<o.length;n++){for(var t=o[n],r=!0,u=1;u<t.length;u++){var a=t[u];0!==c[a]&&(r=!1)}r&&(o.splice(n--,1),e=d(d.s=t[0]))}return e}var r={},u={runtime:0},c={runtime:0},o=[];function a(e){return d.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-5e0ed96e":"e8f125e1","chunk-667d2d85":"2d4f045d","chunk-bf0cb8b0":"7e5e9a4e"}[e]+".js"}function d(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,d),t.l=!0,t.exports}d.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-5e0ed96e":1,"chunk-667d2d85":1,"chunk-bf0cb8b0":1};u[e]?n.push(u[e]):0!==u[e]&&t[e]&&n.push(u[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-5e0ed96e":"b2d67768","chunk-667d2d85":"d1c64e6f","chunk-bf0cb8b0":"40f76b5c"}[e]+".css",c=d.p+r,o=document.getElementsByTagName("link"),a=0;a<o.length;a++){var i=o[a],f=i.getAttribute("data-href")||i.getAttribute("href");if("stylesheet"===i.rel&&(f===r||f===c))return n()}var h=document.getElementsByTagName("style");for(a=0;a<h.length;a++){i=h[a],f=i.getAttribute("data-href");if(f===r||f===c)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||c,o=new Error("Loading CSS chunk "+e+" failed.\n("+r+")");o.request=r,delete u[e],l.parentNode.removeChild(l),t(o)},l.href=c;var s=document.getElementsByTagName("head")[0];s.appendChild(l)})).then((function(){u[e]=0})));var r=c[e];if(0!==r)if(r)n.push(r[2]);else{var o=new Promise((function(n,t){r=c[e]=[n,t]}));n.push(r[2]=o);var i,f=document.createElement("script");f.charset="utf-8",f.timeout=120,d.nc&&f.setAttribute("nonce",d.nc),f.src=a(e),i=function(n){f.onerror=f.onload=null,clearTimeout(h);var t=c[e];if(0!==t){if(t){var r=n&&("load"===n.type?"missing":n.type),u=n&&n.target&&n.target.src,o=new Error("Loading chunk "+e+" failed.\n("+r+": "+u+")");o.type=r,o.request=u,t[1](o)}c[e]=void 0}};var h=setTimeout((function(){i({type:"timeout",target:f})}),12e4);f.onerror=f.onload=i,document.head.appendChild(f)}return Promise.all(n)},d.m=e,d.c=r,d.d=function(e,n,t){d.o(e,n)||Object.defineProperty(e,n,{enumerable:!0,get:t})},d.r=function(e){"undefined"!==typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},d.t=function(e,n){if(1&n&&(e=d(e)),8&n)return e;if(4&n&&"object"===typeof e&&e&&e.__esModule)return e;var t=Object.create(null);if(d.r(t),Object.defineProperty(t,"default",{enumerable:!0,value:e}),2&n&&"string"!=typeof e)for(var r in e)d.d(t,r,function(n){return e[n]}.bind(null,r));return t},d.n=function(e){var n=e&&e.__esModule?function(){return e["default"]}:function(){return e};return d.d(n,"a",n),n},d.o=function(e,n){return Object.prototype.hasOwnProperty.call(e,n)},d.p="/",d.oe=function(e){throw console.error(e),e};var i=window["webpackJsonp"]=window["webpackJsonp"]||[],f=i.push.bind(i);i.push=n,i=i.slice();for(var h=0;h<i.length;h++)n(i[h]);var l=f;t()})([]);</script><script src=/static/js/app.3af643f7.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,u,a=n[0],i=n[1],d=n[2],f=0,h=[];f<a.length;f++)u=a[f],c[u]&&h.push(c[u][0]),c[u]=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,u=1;u<t.length;u++){var a=t[u];0!==c[a]&&(r=!1)}r&&(o.splice(n--,1),e=i(i.s=t[0]))}return e}var r={},u={runtime:0},c={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-528e0a1e":"37cd2daa","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-2162b876":1,"chunk-4ed577de":1,"chunk-528e0a1e":1,"chunk-556562e8":1,"chunk-667d2d85":1,"chunk-bf0cb8b0":1};u[e]?n.push(u[e]):0!==u[e]&&t[e]&&n.push(u[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-528e0a1e":"79d7eb9b","chunk-556562e8":"b043920c","chunk-667d2d85":"d1c64e6f","chunk-bf0cb8b0":"40f76b5c"}[e]+".css",c=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===c))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===c)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||c,o=new Error("Loading CSS chunk "+e+" failed.\n("+r+")");o.request=r,delete u[e],l.parentNode.removeChild(l),t(o)},l.href=c;var s=document.getElementsByTagName("head")[0];s.appendChild(l)})).then((function(){u[e]=0})));var r=c[e];if(0!==r)if(r)n.push(r[2]);else{var o=new Promise((function(n,t){r=c[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=c[e];if(0!==t){if(t){var r=n&&("load"===n.type?"missing":n.type),u=n&&n.target&&n.target.src,o=new Error("Loading chunk "+e+" failed.\n("+r+": "+u+")");o.type=r,o.request=u,t[1](o)}c[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.7369510f.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-af4594b0]{min-height:200px} .pagination-container[data-v-6af373ef]{background:#fff;padding:32px 16px}.pagination-container.hidden[data-v-6af373ef]{display:none}.contentInput[data-v-94252b40]{min-height:200px}
\ No newline at end of file \ No newline at end of file
This source diff could not be displayed because it is too large. You can view the blob instead.
This source diff could not be displayed because it is too large. You can view the blob instead.
(window["webpackJsonp"]=window["webpackJsonp"]||[]).push([["chunk-528e0a1e"],{"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:hh:mm"},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/update-group-good",method:"post",params:t})}function c(t){return t.token=Object(l["a"])(),Object(o["a"])({url:"jingdong/"+t.id+"/delete-good",method:"delete",params:t})}var p=i("333d"),d={name:"Accounts",components:{Pagination:p["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(){c({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?console.log(this.form):u(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 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[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()}}},m=d,f=(i("5295"),i("2877")),g=Object(f["a"])(m,n,a,!1,null,"94252b40",null);e["default"]=g.exports},5295:function(t,e,i){"use strict";var n=i("db88"),a=i.n(n);a.a},7456:function(t,e,i){},db88:function(t,e,i){},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-5e0ed96e"],{"18c8":function(t,e,i){"use strict";var a=i("6a23"),n=i.n(a);n.a},"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 l=function(){return window.requestAnimationFrame||window.webkitRequestAnimationFrame||window.mozRequestAnimationFrame||function(t){window.setTimeout(t,1e3/60)}}();function o(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);o(r),u<e?l(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-select",{staticClass:"width-full filter-item",attrs:{placeholder:"请选择时段",filterable:"",clearable:""},model:{value:t.listQuery.hour,callback:function(e){t.$set(t.listQuery,"hour",e)},expression:"listQuery.hour"}},t._l(t.hourList,(function(t){return i("el-option",{key:t.value,attrs:{label:t.value,value:t.value}})})),1),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)+"\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-select",{staticClass:"width-full filter-item",attrs:{placeholder:"请选择时段",filterable:"",clearable:""},model:{value:t.form.hour,callback:function(e){t.$set(t.form,"hour",e)},expression:"form.hour"}},t._l(t.hourList,(function(t){return i("el-option",{key:t.value,attrs:{label:t.value,value:t.value}})})),1)],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=[],l=(i("28a5"),i("b775")),o=i("5f87");function r(t){return t.token=Object(o["a"])(),Object(l["a"])({url:"jingdong/group-good-list",method:"get",params:t})}function s(t){return t.token=Object(o["a"])(),Object(l["a"])({url:"jingdong/import-group-good-coupon",method:"post",params:t})}function u(t){return t.token=Object(o["a"])(),Object(l["a"])({url:"jingdong/create-group-good",method:"post",params:t})}function c(t){return t.token=Object(o["a"])(),Object(l["a"])({url:"jingdong/update-group-good",method:"post",params:t})}function p(t){return t.token=Object(o["a"])(),Object(l["a"])({url:"jingdong/"+t.id+"/delete-good",method:"delete",params:t})}var d=i("333d"),f={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:0,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()}}},m=f,g=(i("18c8"),i("2877")),h=Object(g["a"])(m,a,n,!1,null,"af4594b0",null);e["default"]=h.exports},"6a23":function(t,e,i){},7456:function(t,e,i){},e498:function(t,e,i){"use strict";var a=i("7456"),n=i.n(a);n.a}}]);
\ No newline at end of file
...@@ -35,7 +35,6 @@ if (process.env.NODE_ENV === 'production') { ...@@ -35,7 +35,6 @@ if (process.env.NODE_ENV === 'production') {
Vue.use(Element, { Vue.use(Element, {
size: Cookies.get('size') || 'medium', // set element-ui default size size: Cookies.get('size') || 'medium', // set element-ui default size
locale: enLang // 如果使用中文,无需设置,请删除
}) })
// register global utility filters // register global utility filters
......
...@@ -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>
...@@ -47,7 +47,7 @@ ...@@ -47,7 +47,7 @@
</el-table-column> </el-table-column>
<el-table-column label="时段"> <el-table-column label="时段">
<template slot-scope="scope"> <template slot-scope="scope">
{{ scope.row.hour }} {{ scope.row.hour[0] + '---' + scope.row.hour[1] }}
</template> </template>
</el-table-column> </el-table-column>
<el-table-column label="图片"> <el-table-column label="图片">
...@@ -106,20 +106,14 @@ ...@@ -106,20 +106,14 @@
<el-input type="textarea" :rows="8" v-model="form.content" placeholder="请输入内容" class="contentInput"></el-input> <el-input type="textarea" :rows="8" v-model="form.content" placeholder="请输入内容" class="contentInput"></el-input>
</el-form-item> </el-form-item>
<el-form-item label="时段" prop="hour"> <el-form-item label="时段" prop="hour">
<el-select <el-date-picker
v-model="form.hour" v-model="form.hour"
placeholder="请选择时段" type="datetimerange"
class="width-full filter-item" range-separator="至"
filterable start-placeholder="开始日期"
clearable end-placeholder="结束日期"
> value-format="yyyy-MM-dd HH:hh:mm">
<el-option </el-date-picker>
v-for="item in hourList"
:key="item.value"
:label="item.value"
:value="item.value"
/>
</el-select>
</el-form-item> </el-form-item>
</el-form> </el-form>
<div slot="footer" class="dialog-footer"> <div slot="footer" class="dialog-footer">
...@@ -150,7 +144,7 @@ ...@@ -150,7 +144,7 @@
page: 1, page: 1,
limit: 15, limit: 15,
title: '', title: '',
hour: '', hour: [],
}, },
hourList: [ hourList: [
{ value: 0 }, { value: 0 },
...@@ -181,7 +175,7 @@ ...@@ -181,7 +175,7 @@
id: 0, id: 0,
img_url: '', img_url: '',
content: '', content: '',
hour: 0, hour: '',
title: '' title: ''
}, },
rules: { rules: {
...@@ -224,14 +218,15 @@ ...@@ -224,14 +218,15 @@
}, },
updateConfirm() { updateConfirm() {
if (this.title == '新建') { if (this.title == '新建') {
createGroup(this.form).then(res => { console.log(this.form)
this.$message({ // createGroup(this.form).then(res => {
type: 'success', // this.$message({
message: '新建成功' // type: 'success',
}); // message: '新建成功'
this.dialogTableVisible = false // });
this.fetchData() // this.dialogTableVisible = false
}) // this.fetchData()
// })
} else { } else {
updateGroup(this.form).then(res => { updateGroup(this.form).then(res => {
this.$message({ this.$message({
......
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