Commit 6aee296f by wang

update

parent 6ff901e6
<!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 t(t){for(var r,u,a=t[0],i=t[1],f=t[2],d=0,l=[];d<a.length;d++)u=a[d],c[u]&&l.push(c[u][0]),c[u]=0;for(r in i)Object.prototype.hasOwnProperty.call(i,r)&&(e[r]=i[r]);h&&h(t);while(l.length)l.shift()();return o.push.apply(o,f||[]),n()}function n(){for(var e,t=0;t<o.length;t++){for(var n=o[t],r=!0,u=1;u<n.length;u++){var a=n[u];0!==c[a]&&(r=!1)}r&&(o.splice(t--,1),e=i(i.s=n[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":"a2c48de9","chunk-2d2105d3":"7106a610","chunk-2d230fe7":"446e67d8","chunk-556562e8":"04d70197","chunk-667d2d85":"2d4f045d","chunk-bf0cb8b0":"7e5e9a4e"}[e]+".js"}function i(t){if(r[t])return r[t].exports;var n=r[t]={i:t,l:!1,exports:{}};return e[t].call(n.exports,n,n.exports,i),n.l=!0,n.exports}i.e=function(e){var t=[],n={"chunk-0575145a":1,"chunk-05a99c67":1,"chunk-19593038":1,"chunk-2162b876":1,"chunk-556562e8":1,"chunk-667d2d85":1,"chunk-bf0cb8b0":1};u[e]?t.push(u[e]):0!==u[e]&&n[e]&&t.push(u[e]=new Promise((function(t,n){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-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 f=o[a],d=f.getAttribute("data-href")||f.getAttribute("href");if("stylesheet"===f.rel&&(d===r||d===c))return t()}var l=document.getElementsByTagName("style");for(a=0;a<l.length;a++){f=l[a],d=f.getAttribute("data-href");if(d===r||d===c)return t()}var h=document.createElement("link");h.rel="stylesheet",h.type="text/css",h.onload=t,h.onerror=function(t){var r=t&&t.target&&t.target.src||c,o=new Error("Loading CSS chunk "+e+" failed.\n("+r+")");o.request=r,delete u[e],h.parentNode.removeChild(h),n(o)},h.href=c;var s=document.getElementsByTagName("head")[0];s.appendChild(h)})).then((function(){u[e]=0})));var r=c[e];if(0!==r)if(r)t.push(r[2]);else{var o=new Promise((function(t,n){r=c[e]=[t,n]}));t.push(r[2]=o);var f,d=document.createElement("script");d.charset="utf-8",d.timeout=120,i.nc&&d.setAttribute("nonce",i.nc),d.src=a(e),f=function(t){d.onerror=d.onload=null,clearTimeout(l);var n=c[e];if(0!==n){if(n){var r=t&&("load"===t.type?"missing":t.type),u=t&&t.target&&t.target.src,o=new Error("Loading chunk "+e+" failed.\n("+r+": "+u+")");o.type=r,o.request=u,n[1](o)}c[e]=void 0}};var l=setTimeout((function(){f({type:"timeout",target:d})}),12e4);d.onerror=d.onload=f,document.head.appendChild(d)}return Promise.all(t)},i.m=e,i.c=r,i.d=function(e,t,n){i.o(e,t)||Object.defineProperty(e,t,{enumerable:!0,get:n})},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,t){if(1&t&&(e=i(e)),8&t)return e;if(4&t&&"object"===typeof e&&e&&e.__esModule)return e;var n=Object.create(null);if(i.r(n),Object.defineProperty(n,"default",{enumerable:!0,value:e}),2&t&&"string"!=typeof e)for(var r in e)i.d(n,r,function(t){return e[t]}.bind(null,r));return n},i.n=function(e){var t=e&&e.__esModule?function(){return e["default"]}:function(){return e};return i.d(t,"a",t),t},i.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},i.p="/",i.oe=function(e){throw console.error(e),e};var f=window["webpackJsonp"]=window["webpackJsonp"]||[],d=f.push.bind(f);f.push=t,f=f.slice();for(var l=0;l<f.length;l++)t(f[l]);var h=d;n()})([]);</script><script src=/static/js/app.c13168f3.js></script></body></html>
\ No newline at end of file
<!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.850c09c7.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],i=n[1],d=n[2],f=0,l=[];f<a.length;f++)u=a[f],c[u]&&l.push(c[u][0]),c[u]=0;for(r in i)Object.prototype.hasOwnProperty.call(i,r)&&(e[r]=i[r]);h&&h(n);while(l.length)l.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-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-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-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 l=document.getElementsByTagName("style");for(a=0;a<l.length;a++){d=l[a],f=d.getAttribute("data-href");if(f===r||f===c)return n()}var h=document.createElement("link");h.rel="stylesheet",h.type="text/css",h.onload=n,h.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],h.parentNode.removeChild(h),t(o)},h.href=c;var s=document.getElementsByTagName("head")[0];s.appendChild(h)})).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(l);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 l=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 l=0;l<d.length;l++)n(d[l]);var h=f;t()})([]);</script><script src=/static/js/app.4f1a6b2c.js></script></body></html>
\ No newline at end of file
.pagination-container[data-v-6af373ef]{background:#fff;padding:32px 16px}.pagination-container.hidden[data-v-6af373ef]{display:none}
\ 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-2162b876"],{"333d":function(t,e,n){"use strict";var o=function(){var t=this,e=t.$createElement,n=t._self._c||e;return n("div",{staticClass:"pagination-container",class:{hidden:t.hidden}},[n("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)},i=[];n("c5f6");Math.easeInOutQuad=function(t,e,n,o){return t/=o/2,t<1?n/2*t*t+e:(t--,-n/2*(t*(t-2)-1)+e)};var r=function(){return window.requestAnimationFrame||window.webkitRequestAnimationFrame||window.mozRequestAnimationFrame||function(t){window.setTimeout(t,1e3/60)}}();function a(t){document.documentElement.scrollTop=t,document.body.parentNode.scrollTop=t,document.body.scrollTop=t}function l(){return document.documentElement.scrollTop||document.body.parentNode.scrollTop||document.body.scrollTop}function c(t,e,n){var o=l(),i=t-o,c=20,u=0;e="undefined"===typeof e?500:e;var s=function t(){u+=c;var l=Math.easeInOutQuad(u,o,i,e);a(l),u<e?r(t):n&&"function"===typeof n&&n()};s()}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&&c(0,800)},handleCurrentChange:function(t){this.$emit("pagination",{page:t,limit:this.pageSize}),this.autoScroll&&c(0,800)}}},s=u,f=(n("e498"),n("2877")),d=Object(f["a"])(s,o,i,!1,null,"6af373ef",null);e["a"]=d.exports},7456:function(t,e,n){},7732:function(t,e,n){"use strict";n.r(e);var o=function(){var t=this,e=t.$createElement,n=t._self._c||e;return n("div",{staticClass:"app-container"},[n("div",{staticClass:"filter-container"},[n("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.goods_name,callback:function(e){t.$set(t.listQuery,"goods_name",e)},expression:"listQuery.goods_name"}}),t._v(" "),n("el-select",{staticClass:"width-full filter-item",attrs:{placeholder:"请选择分类",filterable:"",clearable:""},model:{value:t.listQuery.cid,callback:function(e){t.$set(t.listQuery,"cid",e)},expression:"listQuery.cid"}},t._l(t.cateList,(function(t){return n("el-option",{key:t.id,attrs:{label:t.name,value:t.id}})})),1),t._v(" "),n("el-button",{staticClass:"filter-item",attrs:{type:"primary",icon:"el-icon-search"},on:{click:t.handleFilter}},[t._v("\n 搜索\n ")]),t._v(" "),n("el-button",{staticClass:"filter-item",staticStyle:{"margin-left":"10px"},attrs:{type:"primary",icon:"el-icon-edit"},on:{click:t.importUrl}},[t._v("\n 导入+\n ")])],1),t._v(" "),n("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":""}},[n("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(" "),n("el-table-column",{attrs:{label:"名称"},scopedSlots:t._u([{key:"default",fn:function(e){return[t._v("\n "+t._s(e.row.goods_name)+"\n ")]}}])}),t._v(" "),n("el-table-column",{attrs:{label:"类别"},scopedSlots:t._u([{key:"default",fn:function(e){return[t._v("\n "+t._s(e.row.cid_name)+"\n ")]}}])}),t._v(" "),n("el-table-column",{attrs:{label:"图片"},scopedSlots:t._u([{key:"default",fn:function(t){return[n("el-image",{staticStyle:{width:"100px",height:"100px"},attrs:{src:t.row.img_url,fit:"fill"}})]}}])}),t._v(" "),n("el-table-column",{attrs:{label:"商品单价"},scopedSlots:t._u([{key:"default",fn:function(e){return[t._v("\n "+t._s(e.row.unit_price)+"\n ")]}}])}),t._v(" "),n("el-table-column",{attrs:{label:"推广开始日期"},scopedSlots:t._u([{key:"default",fn:function(e){return[t._v("\n "+t._s(e.row.start_date)+"\n ")]}}])}),t._v(" "),n("el-table-column",{attrs:{label:"推广结束日期"},scopedSlots:t._u([{key:"default",fn:function(e){return[t._v("\n "+t._s(e.row.end_date)+"\n ")]}}])}),t._v(" "),n("el-table-column",{attrs:{label:"30天引单数量"},scopedSlots:t._u([{key:"default",fn:function(e){return[t._v("\n "+t._s(e.row.in_order_count)+"\n ")]}}])}),t._v(" "),n("el-table-column",{attrs:{label:"无线佣金比例"},scopedSlots:t._u([{key:"default",fn:function(e){return[t._v("\n "+t._s(e.row.commision_ratio_wl)+"\n ")]}}])}),t._v(" "),n("el-table-column",{attrs:{label:"PC佣金比例"},scopedSlots:t._u([{key:"default",fn:function(e){return[t._v("\n "+t._s(e.row.commision_ratio_pc)+"\n ")]}}])}),t._v(" "),n("el-table-column",{attrs:{label:"推广地址"},scopedSlots:t._u([{key:"default",fn:function(e){return[n("el-button",{directives:[{name:"clipboard",rawName:"v-clipboard:copy",value:e.row.click_url,expression:"scope.row.click_url",arg:"copy"},{name:"clipboard",rawName:"v-clipboard:success",value:t.clipboardSuccess,expression:"clipboardSuccess",arg:"success"}],attrs:{type:"primary",icon:"el-icon-document"}},[t._v("\n 复制\n ")])]}}])}),t._v(" "),n("el-table-column",{attrs:{label:"操作",align:"center",width:"230","class-name":"small-padding fixed-width"},scopedSlots:t._u([{key:"default",fn:function(e){return[n("el-button",{attrs:{type:"primary",size:"mini"},on:{click:function(n){return t.deleteGood(e.row.id)}}},[t._v("\n 删除\n ")])]}}])})],1),t._v(" "),n("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(" "),n("el-dialog",{staticClass:"el-dialog-medium",attrs:{title:"导入链接",visible:t.dialogTableVisible,"close-on-click-modal":!1,"close-on-press-escape":!1},on:{"update:visible":function(e){t.dialogTableVisible=e}}},[n("el-form",{ref:"form",attrs:{rules:t.rules,model:t.form,"label-position":"left","label-width":"80px"}},[n("el-form-item",{attrs:{label:"链接地址",prop:"text"}},[n("el-input",{attrs:{placeholder:"请输入链接"},model:{value:t.form.url,callback:function(e){t.$set(t.form,"url",e)},expression:"form.url"}})],1)],1),t._v(" "),n("div",{staticClass:"dialog-footer",attrs:{slot:"footer"},slot:"footer"},[n("el-button",{on:{click:function(e){t.dialogTableVisible=!1}}},[t._v("取 消")]),t._v(" "),n("el-button",{attrs:{type:"primary"},on:{click:function(e){return t.saveGood("form")}}},[t._v("确 定")])],1)],1)],1)},i=[],r=n("b775"),a=n("5f87");function l(t){return t.token=Object(a["a"])(),Object(r["a"])({url:"jingdong/good-list",method:"get",params:t})}function c(t){return t.token=Object(a["a"])(),Object(r["a"])({url:"jingdong/cate-list",method:"get",params:t})}function u(t){return t.token=Object(a["a"])(),Object(r["a"])({url:"jingdong/import-good",method:"post",params:t})}function s(t){return t.token=Object(a["a"])(),Object(r["a"])({url:"jingdong/"+t.id+"/delete-good",method:"delete",params:t})}var f=n("333d"),d=n("b311");if(!d)throw new Error("you should npm install `clipboard` --save at first ");var p={bind:function(t,e){if("success"===e.arg)t._v_clipboard_success=e.value;else if("error"===e.arg)t._v_clipboard_error=e.value;else{var n=new d(t,{text:function(){return e.value},action:function(){return"cut"===e.arg?"cut":"copy"}});n.on("success",(function(e){var n=t._v_clipboard_success;n&&n(e)})),n.on("error",(function(e){var n=t._v_clipboard_error;n&&n(e)})),t._v_clipboard=n}},update:function(t,e){"success"===e.arg?t._v_clipboard_success=e.value:"error"===e.arg?t._v_clipboard_error=e.value:(t._v_clipboard.text=function(){return e.value},t._v_clipboard.action=function(){return"cut"===e.arg?"cut":"copy"})},unbind:function(t,e){"success"===e.arg?delete t._v_clipboard_success:"error"===e.arg?delete t._v_clipboard_error:(t._v_clipboard.destroy(),delete t._v_clipboard)}},h=function(t){t.directive("Clipboard",p)};window.Vue&&(window.clipboard=p,Vue.use(h)),p.install=h;var m=p,y={name:"Accounts",directives:{clipboard:m},components:{Pagination:f["a"]},filters:{typeFilter:function(t){var e={EAccountM:"普通企业号",EAccountS:"认证企业号",EAccountK:"品牌企业号"};return e[t]}},data:function(){return{dialogTableVisible:!1,list:null,listLoading:!0,total:0,listQuery:{page:1,limit:15,goods_name:"",cid:""},timer:null,cateList:[],form:{url:""},rules:{url:[{required:!0,message:"链接必须",trigger:"blur"}]}}},created:function(){this.fetchData(),this.fetchCate()},destroyed:function(){},methods:{deleteGood:function(t){var e=this;this.$confirm("确定删除视频吗?","提示",{confirmButtonText:"确定",cancelButtonText:"取消",type:"warning"}).then((function(){s({id:t}).then((function(t){e.$message({message:"操作成功!",type:"success"}),e.fetchData()}))})).catch((function(){e.$message({type:"error",message:"取消当前操作"})}))},clipboardSuccess:function(){this.$message({message:"复制成功",type:"success",duration:1500})},fetchData:function(){var t=this;this.listLoading=!0,l(this.listQuery).then((function(e){t.list=e.data.data,t.total=e.data.meta.total,setTimeout((function(){t.listLoading=!1}),500)}))},fetchCate:function(){var t=this;c({}).then((function(e){t.cateList=e.data.data}))},handleFilter:function(){this.listQuery.page=1,this.fetchData()},importUrl:function(){this.dialogTableVisible=!0},saveGood:function(t){var e=this;this.$refs[t].validate((function(t){t&&u(e.form).then((function(t){e.$message({message:"导入成功!",type:"success"}),e.dialogTableVisible=!1,e.fetchData()}))}))}}},g=y,v=n("2877"),b=Object(v["a"])(g,o,i,!1,null,null,null);e["default"]=b.exports},b311:function(t,e,n){
(window["webpackJsonp"]=window["webpackJsonp"]||[]).push([["chunk-2162b876"],{"333d":function(t,e,n){"use strict";var o=function(){var t=this,e=t.$createElement,n=t._self._c||e;return n("div",{staticClass:"pagination-container",class:{hidden:t.hidden}},[n("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)},i=[];n("c5f6");Math.easeInOutQuad=function(t,e,n,o){return t/=o/2,t<1?n/2*t*t+e:(t--,-n/2*(t*(t-2)-1)+e)};var r=function(){return window.requestAnimationFrame||window.webkitRequestAnimationFrame||window.mozRequestAnimationFrame||function(t){window.setTimeout(t,1e3/60)}}();function a(t){document.documentElement.scrollTop=t,document.body.parentNode.scrollTop=t,document.body.scrollTop=t}function l(){return document.documentElement.scrollTop||document.body.parentNode.scrollTop||document.body.scrollTop}function c(t,e,n){var o=l(),i=t-o,c=20,u=0;e="undefined"===typeof e?500:e;var s=function t(){u+=c;var l=Math.easeInOutQuad(u,o,i,e);a(l),u<e?r(t):n&&"function"===typeof n&&n()};s()}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&&c(0,800)},handleCurrentChange:function(t){this.$emit("pagination",{page:t,limit:this.pageSize}),this.autoScroll&&c(0,800)}}},s=u,f=(n("e498"),n("2877")),d=Object(f["a"])(s,o,i,!1,null,"6af373ef",null);e["a"]=d.exports},7456:function(t,e,n){},7732:function(t,e,n){"use strict";n.r(e);var o=function(){var t=this,e=t.$createElement,n=t._self._c||e;return n("div",{staticClass:"app-container"},[n("div",{staticClass:"filter-container"},[n("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.goods_name,callback:function(e){t.$set(t.listQuery,"goods_name",e)},expression:"listQuery.goods_name"}}),t._v(" "),n("el-select",{staticClass:"width-full filter-item",attrs:{placeholder:"请选择分类",filterable:"",clearable:""},model:{value:t.listQuery.cid,callback:function(e){t.$set(t.listQuery,"cid",e)},expression:"listQuery.cid"}},t._l(t.cateList,(function(t){return n("el-option",{key:t.id,attrs:{label:t.name,value:t.id}})})),1),t._v(" "),n("el-button",{staticClass:"filter-item",attrs:{type:"primary",icon:"el-icon-search"},on:{click:t.handleFilter}},[t._v("\n 搜索\n ")]),t._v(" "),n("el-button",{staticClass:"filter-item",staticStyle:{"margin-left":"10px"},attrs:{type:"primary",icon:"el-icon-edit"},on:{click:t.importUrl}},[t._v("\n 导入+\n ")])],1),t._v(" "),n("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":""}},[n("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(" "),n("el-table-column",{attrs:{label:"名称"},scopedSlots:t._u([{key:"default",fn:function(e){return[t._v("\n "+t._s(e.row.goods_name)+"\n ")]}}])}),t._v(" "),n("el-table-column",{attrs:{label:"类别"},scopedSlots:t._u([{key:"default",fn:function(e){return[t._v("\n "+t._s(e.row.cid_name)+"\n ")]}}])}),t._v(" "),n("el-table-column",{attrs:{label:"图片"},scopedSlots:t._u([{key:"default",fn:function(t){return[n("el-image",{staticStyle:{width:"100px",height:"100px"},attrs:{src:t.row.img_url,fit:"fill"}})]}}])}),t._v(" "),n("el-table-column",{attrs:{label:"商品单价"},scopedSlots:t._u([{key:"default",fn:function(e){return[t._v("\n "+t._s(e.row.unit_price)+"\n ")]}}])}),t._v(" "),n("el-table-column",{attrs:{label:"推广日期"},scopedSlots:t._u([{key:"default",fn:function(e){return[t._v("\n "+t._s(e.row.start_date+"--"+e.row.end_date)+"\n ")]}}])}),t._v(" "),n("el-table-column",{attrs:{label:"30天引单数量"},scopedSlots:t._u([{key:"default",fn:function(e){return[t._v("\n "+t._s(e.row.in_order_count)+"\n ")]}}])}),t._v(" "),n("el-table-column",{attrs:{label:"无线佣金比例"},scopedSlots:t._u([{key:"default",fn:function(e){return[t._v("\n "+t._s(e.row.commision_ratio_wl)+"\n ")]}}])}),t._v(" "),n("el-table-column",{attrs:{label:"PC佣金比例"},scopedSlots:t._u([{key:"default",fn:function(e){return[t._v("\n "+t._s(e.row.commision_ratio_pc)+"\n ")]}}])}),t._v(" "),n("el-table-column",{attrs:{label:"推广地址"},scopedSlots:t._u([{key:"default",fn:function(e){return[n("el-button",{directives:[{name:"clipboard",rawName:"v-clipboard:copy",value:e.row.click_url,expression:"scope.row.click_url",arg:"copy"},{name:"clipboard",rawName:"v-clipboard:success",value:t.clipboardSuccess,expression:"clipboardSuccess",arg:"success"}],attrs:{size:"mini",type:"primary",icon:"el-icon-document"}},[t._v("\n 复制\n ")])]}}])}),t._v(" "),n("el-table-column",{attrs:{label:"优惠券地址"},scopedSlots:t._u([{key:"default",fn:function(e){return[n("el-tooltip",{staticClass:"item",attrs:{effect:"dark",content:e.row.coupon_text,placement:"top"}},[n("el-button",{attrs:{type:"primary",size:"mini"}},[t._v("悬浮查看")])],1)]}}])}),t._v(" "),n("el-table-column",{attrs:{label:"排序"},scopedSlots:t._u([{key:"default",fn:function(e){return[t._v("\n "+t._s(e.row.sort)+"\n ")]}}])}),t._v(" "),n("el-table-column",{attrs:{label:"操作",align:"center",width:"230","class-name":"small-padding fixed-width"},scopedSlots:t._u([{key:"default",fn:function(e){return[n("el-button",{attrs:{type:"primary",size:"mini"},on:{click:function(n){return t.updateSort(e.row.id)}}},[t._v("\n 修改排序\n ")]),t._v(" "),n("el-button",{attrs:{type:"primary",size:"mini"},on:{click:function(n){return t.importCoupon(e.row.id)}}},[t._v("\n 导入优惠券\n ")]),t._v(" "),n("el-button",{attrs:{type:"primary",size:"mini"},on:{click:function(n){return t.deleteGood(e.row.id)}}},[t._v("\n 删除\n ")])]}}])})],1),t._v(" "),n("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(" "),n("el-dialog",{staticClass:"el-dialog-medium",attrs:{title:"导入链接",visible:t.dialogTableVisible,"close-on-click-modal":!1,"close-on-press-escape":!1},on:{"update:visible":function(e){t.dialogTableVisible=e}}},[n("el-form",{ref:"form",attrs:{rules:t.rules,model:t.form,"label-position":"left","label-width":"80px"}},[n("el-form-item",{attrs:{label:"链接地址",prop:"text"}},[n("el-input",{attrs:{placeholder:"请输入链接"},model:{value:t.form.url,callback:function(e){t.$set(t.form,"url",e)},expression:"form.url"}})],1)],1),t._v(" "),n("div",{staticClass:"dialog-footer",attrs:{slot:"footer"},slot:"footer"},[n("el-button",{on:{click:function(e){t.dialogTableVisible=!1}}},[t._v("取 消")]),t._v(" "),n("el-button",{attrs:{type:"primary"},on:{click:function(e){return t.saveGood("form")}}},[t._v("确 定")])],1)],1)],1)},i=[],r=n("b775"),a=n("5f87");function l(t){return t.token=Object(a["a"])(),Object(r["a"])({url:"jingdong/good-list",method:"get",params:t})}function c(t){return t.token=Object(a["a"])(),Object(r["a"])({url:"jingdong/cate-list",method:"get",params:t})}function u(t){return t.token=Object(a["a"])(),Object(r["a"])({url:"jingdong/import-good-coupon",method:"post",params:t})}function s(t){return t.token=Object(a["a"])(),Object(r["a"])({url:"jingdong/import-good",method:"post",params:t})}function f(t){return t.token=Object(a["a"])(),Object(r["a"])({url:"jingdong/"+t.id+"/delete-good",method:"delete",params:t})}function d(t){return t.token=Object(a["a"])(),Object(r["a"])({url:"jingdong/update-good-sort",method:"post",params:t})}var p=n("333d"),m=n("b311");if(!m)throw new Error("you should npm install `clipboard` --save at first ");var h={bind:function(t,e){if("success"===e.arg)t._v_clipboard_success=e.value;else if("error"===e.arg)t._v_clipboard_error=e.value;else{var n=new m(t,{text:function(){return e.value},action:function(){return"cut"===e.arg?"cut":"copy"}});n.on("success",(function(e){var n=t._v_clipboard_success;n&&n(e)})),n.on("error",(function(e){var n=t._v_clipboard_error;n&&n(e)})),t._v_clipboard=n}},update:function(t,e){"success"===e.arg?t._v_clipboard_success=e.value:"error"===e.arg?t._v_clipboard_error=e.value:(t._v_clipboard.text=function(){return e.value},t._v_clipboard.action=function(){return"cut"===e.arg?"cut":"copy"})},unbind:function(t,e){"success"===e.arg?delete t._v_clipboard_success:"error"===e.arg?delete t._v_clipboard_error:(t._v_clipboard.destroy(),delete t._v_clipboard)}},g=function(t){t.directive("Clipboard",h)};window.Vue&&(window.clipboard=h,Vue.use(g)),h.install=g;var y=h,v={name:"Accounts",directives:{clipboard:y},components:{Pagination:p["a"]},filters:{typeFilter:function(t){var e={EAccountM:"普通企业号",EAccountS:"认证企业号",EAccountK:"品牌企业号"};return e[t]}},data:function(){return{dialogTableVisible:!1,list:null,listLoading:!0,total:0,listQuery:{page:1,limit:15,goods_name:"",cid:""},timer:null,cateList:[],form:{url:""},rules:{url:[{required:!0,message:"链接必须",trigger:"blur"}]}}},created:function(){this.fetchData(),this.fetchCate()},destroyed:function(){},methods:{importCoupon:function(t){var e=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(n){var o=n.value;u({id:t,url:o}).then((function(t){e.$message({type:"info",message:"更新成功"}),e.fetchData()}))})).catch((function(){e.$message({type:"info",message:"取消输入"})}))},updateSort:function(t){var e=this;this.$prompt("请输入排序大小","提示",{confirmButtonText:"确定",cancelButtonText:"取消",inputPattern:/\d+/,inputErrorMessage:"必须是数字"}).then((function(n){var o=n.value;d({id:t,sort:o}).then((function(t){e.$message({type:"info",message:"更新成功"}),e.fetchData()}))})).catch((function(){e.$message({type:"info",message:"取消输入"})}))},deleteGood:function(t){var e=this;this.$confirm("确定删除视频吗?","提示",{confirmButtonText:"确定",cancelButtonText:"取消",type:"warning"}).then((function(){f({id:t}).then((function(t){e.$message({message:"操作成功!",type:"success"}),e.fetchData()}))})).catch((function(){e.$message({type:"error",message:"取消当前操作"})}))},clipboardSuccess:function(){this.$message({message:"复制成功",type:"success",duration:1500})},fetchData:function(){var t=this;this.listLoading=!0,l(this.listQuery).then((function(e){t.list=e.data.data,t.total=e.data.meta.total,setTimeout((function(){t.listLoading=!1}),500)}))},fetchCate:function(){var t=this;c({}).then((function(e){t.cateList=e.data.data}))},handleFilter:function(){this.listQuery.page=1,this.fetchData()},importUrl:function(){this.dialogTableVisible=!0},saveGood:function(t){var e=this;this.$refs[t].validate((function(t){t&&s(e.form).then((function(t){e.$message({message:"导入成功!",type:"success"}),e.dialogTableVisible=!1,e.fetchData()}))}))}}},b=v,_=n("2877"),k=Object(_["a"])(b,o,i,!1,null,null,null);e["default"]=k.exports},b311:function(t,e,n){
/*!
* clipboard.js v2.0.4
* https://zenorocha.github.io/clipboard.js
*
* Licensed MIT © Zeno Rocha
*/
(function(e,n){t.exports=n()})(0,(function(){return function(t){var e={};function n(o){if(e[o])return e[o].exports;var i=e[o]={i:o,l:!1,exports:{}};return t[o].call(i.exports,i,i.exports,n),i.l=!0,i.exports}return n.m=t,n.c=e,n.d=function(t,e,o){n.o(t,e)||Object.defineProperty(t,e,{enumerable:!0,get:o})},n.r=function(t){"undefined"!==typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(t,"__esModule",{value:!0})},n.t=function(t,e){if(1&e&&(t=n(t)),8&e)return t;if(4&e&&"object"===typeof t&&t&&t.__esModule)return t;var o=Object.create(null);if(n.r(o),Object.defineProperty(o,"default",{enumerable:!0,value:t}),2&e&&"string"!=typeof t)for(var i in t)n.d(o,i,function(e){return t[e]}.bind(null,i));return o},n.n=function(t){var e=t&&t.__esModule?function(){return t["default"]}:function(){return t};return n.d(e,"a",e),e},n.o=function(t,e){return Object.prototype.hasOwnProperty.call(t,e)},n.p="",n(n.s=0)}([function(t,e,n){"use strict";var o="function"===typeof Symbol&&"symbol"===typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"===typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},i=function(){function t(t,e){for(var n=0;n<e.length;n++){var o=e[n];o.enumerable=o.enumerable||!1,o.configurable=!0,"value"in o&&(o.writable=!0),Object.defineProperty(t,o.key,o)}}return function(e,n,o){return n&&t(e.prototype,n),o&&t(e,o),e}}(),r=n(1),a=f(r),l=n(3),c=f(l),u=n(4),s=f(u);function f(t){return t&&t.__esModule?t:{default:t}}function d(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function p(t,e){if(!t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!e||"object"!==typeof e&&"function"!==typeof e?t:e}function h(t,e){if("function"!==typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function, not "+typeof e);t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,enumerable:!1,writable:!0,configurable:!0}}),e&&(Object.setPrototypeOf?Object.setPrototypeOf(t,e):t.__proto__=e)}var m=function(t){function e(t,n){d(this,e);var o=p(this,(e.__proto__||Object.getPrototypeOf(e)).call(this));return o.resolveOptions(n),o.listenClick(t),o}return h(e,t),i(e,[{key:"resolveOptions",value:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};this.action="function"===typeof t.action?t.action:this.defaultAction,this.target="function"===typeof t.target?t.target:this.defaultTarget,this.text="function"===typeof t.text?t.text:this.defaultText,this.container="object"===o(t.container)?t.container:document.body}},{key:"listenClick",value:function(t){var e=this;this.listener=(0,s.default)(t,"click",(function(t){return e.onClick(t)}))}},{key:"onClick",value:function(t){var e=t.delegateTarget||t.currentTarget;this.clipboardAction&&(this.clipboardAction=null),this.clipboardAction=new a.default({action:this.action(e),target:this.target(e),text:this.text(e),container:this.container,trigger:e,emitter:this})}},{key:"defaultAction",value:function(t){return y("action",t)}},{key:"defaultTarget",value:function(t){var e=y("target",t);if(e)return document.querySelector(e)}},{key:"defaultText",value:function(t){return y("text",t)}},{key:"destroy",value:function(){this.listener.destroy(),this.clipboardAction&&(this.clipboardAction.destroy(),this.clipboardAction=null)}}],[{key:"isSupported",value:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:["copy","cut"],e="string"===typeof t?[t]:t,n=!!document.queryCommandSupported;return e.forEach((function(t){n=n&&!!document.queryCommandSupported(t)})),n}}]),e}(c.default);function y(t,e){var n="data-clipboard-"+t;if(e.hasAttribute(n))return e.getAttribute(n)}t.exports=m},function(t,e,n){"use strict";var o="function"===typeof Symbol&&"symbol"===typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"===typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},i=function(){function t(t,e){for(var n=0;n<e.length;n++){var o=e[n];o.enumerable=o.enumerable||!1,o.configurable=!0,"value"in o&&(o.writable=!0),Object.defineProperty(t,o.key,o)}}return function(e,n,o){return n&&t(e.prototype,n),o&&t(e,o),e}}(),r=n(2),a=l(r);function l(t){return t&&t.__esModule?t:{default:t}}function c(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}var u=function(){function t(e){c(this,t),this.resolveOptions(e),this.initSelection()}return i(t,[{key:"resolveOptions",value:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};this.action=t.action,this.container=t.container,this.emitter=t.emitter,this.target=t.target,this.text=t.text,this.trigger=t.trigger,this.selectedText=""}},{key:"initSelection",value:function(){this.text?this.selectFake():this.target&&this.selectTarget()}},{key:"selectFake",value:function(){var t=this,e="rtl"==document.documentElement.getAttribute("dir");this.removeFake(),this.fakeHandlerCallback=function(){return t.removeFake()},this.fakeHandler=this.container.addEventListener("click",this.fakeHandlerCallback)||!0,this.fakeElem=document.createElement("textarea"),this.fakeElem.style.fontSize="12pt",this.fakeElem.style.border="0",this.fakeElem.style.padding="0",this.fakeElem.style.margin="0",this.fakeElem.style.position="absolute",this.fakeElem.style[e?"right":"left"]="-9999px";var n=window.pageYOffset||document.documentElement.scrollTop;this.fakeElem.style.top=n+"px",this.fakeElem.setAttribute("readonly",""),this.fakeElem.value=this.text,this.container.appendChild(this.fakeElem),this.selectedText=(0,a.default)(this.fakeElem),this.copyText()}},{key:"removeFake",value:function(){this.fakeHandler&&(this.container.removeEventListener("click",this.fakeHandlerCallback),this.fakeHandler=null,this.fakeHandlerCallback=null),this.fakeElem&&(this.container.removeChild(this.fakeElem),this.fakeElem=null)}},{key:"selectTarget",value:function(){this.selectedText=(0,a.default)(this.target),this.copyText()}},{key:"copyText",value:function(){var t=void 0;try{t=document.execCommand(this.action)}catch(e){t=!1}this.handleResult(t)}},{key:"handleResult",value:function(t){this.emitter.emit(t?"success":"error",{action:this.action,text:this.selectedText,trigger:this.trigger,clearSelection:this.clearSelection.bind(this)})}},{key:"clearSelection",value:function(){this.trigger&&this.trigger.focus(),window.getSelection().removeAllRanges()}},{key:"destroy",value:function(){this.removeFake()}},{key:"action",set:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"copy";if(this._action=t,"copy"!==this._action&&"cut"!==this._action)throw new Error('Invalid "action" value, use either "copy" or "cut"')},get:function(){return this._action}},{key:"target",set:function(t){if(void 0!==t){if(!t||"object"!==("undefined"===typeof t?"undefined":o(t))||1!==t.nodeType)throw new Error('Invalid "target" value, use a valid Element');if("copy"===this.action&&t.hasAttribute("disabled"))throw new Error('Invalid "target" attribute. Please use "readonly" instead of "disabled" attribute');if("cut"===this.action&&(t.hasAttribute("readonly")||t.hasAttribute("disabled")))throw new Error('Invalid "target" attribute. You can\'t cut text from elements with "readonly" or "disabled" attributes');this._target=t}},get:function(){return this._target}}]),t}();t.exports=u},function(t,e){function n(t){var e;if("SELECT"===t.nodeName)t.focus(),e=t.value;else if("INPUT"===t.nodeName||"TEXTAREA"===t.nodeName){var n=t.hasAttribute("readonly");n||t.setAttribute("readonly",""),t.select(),t.setSelectionRange(0,t.value.length),n||t.removeAttribute("readonly"),e=t.value}else{t.hasAttribute("contenteditable")&&t.focus();var o=window.getSelection(),i=document.createRange();i.selectNodeContents(t),o.removeAllRanges(),o.addRange(i),e=o.toString()}return e}t.exports=n},function(t,e){function n(){}n.prototype={on:function(t,e,n){var o=this.e||(this.e={});return(o[t]||(o[t]=[])).push({fn:e,ctx:n}),this},once:function(t,e,n){var o=this;function i(){o.off(t,i),e.apply(n,arguments)}return i._=e,this.on(t,i,n)},emit:function(t){var e=[].slice.call(arguments,1),n=((this.e||(this.e={}))[t]||[]).slice(),o=0,i=n.length;for(o;o<i;o++)n[o].fn.apply(n[o].ctx,e);return this},off:function(t,e){var n=this.e||(this.e={}),o=n[t],i=[];if(o&&e)for(var r=0,a=o.length;r<a;r++)o[r].fn!==e&&o[r].fn._!==e&&i.push(o[r]);return i.length?n[t]=i:delete n[t],this}},t.exports=n},function(t,e,n){var o=n(5),i=n(6);function r(t,e,n){if(!t&&!e&&!n)throw new Error("Missing required arguments");if(!o.string(e))throw new TypeError("Second argument must be a String");if(!o.fn(n))throw new TypeError("Third argument must be a Function");if(o.node(t))return a(t,e,n);if(o.nodeList(t))return l(t,e,n);if(o.string(t))return c(t,e,n);throw new TypeError("First argument must be a String, HTMLElement, HTMLCollection, or NodeList")}function a(t,e,n){return t.addEventListener(e,n),{destroy:function(){t.removeEventListener(e,n)}}}function l(t,e,n){return Array.prototype.forEach.call(t,(function(t){t.addEventListener(e,n)})),{destroy:function(){Array.prototype.forEach.call(t,(function(t){t.removeEventListener(e,n)}))}}}function c(t,e,n){return i(document.body,t,e,n)}t.exports=r},function(t,e){e.node=function(t){return void 0!==t&&t instanceof HTMLElement&&1===t.nodeType},e.nodeList=function(t){var n=Object.prototype.toString.call(t);return void 0!==t&&("[object NodeList]"===n||"[object HTMLCollection]"===n)&&"length"in t&&(0===t.length||e.node(t[0]))},e.string=function(t){return"string"===typeof t||t instanceof String},e.fn=function(t){var e=Object.prototype.toString.call(t);return"[object Function]"===e}},function(t,e,n){var o=n(7);function i(t,e,n,o,i){var r=a.apply(this,arguments);return t.addEventListener(n,r,i),{destroy:function(){t.removeEventListener(n,r,i)}}}function r(t,e,n,o,r){return"function"===typeof t.addEventListener?i.apply(null,arguments):"function"===typeof n?i.bind(null,document).apply(null,arguments):("string"===typeof t&&(t=document.querySelectorAll(t)),Array.prototype.map.call(t,(function(t){return i(t,e,n,o,r)})))}function a(t,e,n,i){return function(n){n.delegateTarget=o(n.target,e),n.delegateTarget&&i.call(t,n)}}t.exports=r},function(t,e){var n=9;if("undefined"!==typeof Element&&!Element.prototype.matches){var o=Element.prototype;o.matches=o.matchesSelector||o.mozMatchesSelector||o.msMatchesSelector||o.oMatchesSelector||o.webkitMatchesSelector}function i(t,e){while(t&&t.nodeType!==n){if("function"===typeof t.matches&&t.matches(e))return t;t=t.parentNode}}t.exports=i}])}))},e498:function(t,e,n){"use strict";var o=n("7456"),i=n.n(o);i.a}}]);
\ No newline at end of file
(function(e,n){t.exports=n()})(0,(function(){return function(t){var e={};function n(o){if(e[o])return e[o].exports;var i=e[o]={i:o,l:!1,exports:{}};return t[o].call(i.exports,i,i.exports,n),i.l=!0,i.exports}return n.m=t,n.c=e,n.d=function(t,e,o){n.o(t,e)||Object.defineProperty(t,e,{enumerable:!0,get:o})},n.r=function(t){"undefined"!==typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(t,"__esModule",{value:!0})},n.t=function(t,e){if(1&e&&(t=n(t)),8&e)return t;if(4&e&&"object"===typeof t&&t&&t.__esModule)return t;var o=Object.create(null);if(n.r(o),Object.defineProperty(o,"default",{enumerable:!0,value:t}),2&e&&"string"!=typeof t)for(var i in t)n.d(o,i,function(e){return t[e]}.bind(null,i));return o},n.n=function(t){var e=t&&t.__esModule?function(){return t["default"]}:function(){return t};return n.d(e,"a",e),e},n.o=function(t,e){return Object.prototype.hasOwnProperty.call(t,e)},n.p="",n(n.s=0)}([function(t,e,n){"use strict";var o="function"===typeof Symbol&&"symbol"===typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"===typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},i=function(){function t(t,e){for(var n=0;n<e.length;n++){var o=e[n];o.enumerable=o.enumerable||!1,o.configurable=!0,"value"in o&&(o.writable=!0),Object.defineProperty(t,o.key,o)}}return function(e,n,o){return n&&t(e.prototype,n),o&&t(e,o),e}}(),r=n(1),a=f(r),l=n(3),c=f(l),u=n(4),s=f(u);function f(t){return t&&t.__esModule?t:{default:t}}function d(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function p(t,e){if(!t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!e||"object"!==typeof e&&"function"!==typeof e?t:e}function m(t,e){if("function"!==typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function, not "+typeof e);t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,enumerable:!1,writable:!0,configurable:!0}}),e&&(Object.setPrototypeOf?Object.setPrototypeOf(t,e):t.__proto__=e)}var h=function(t){function e(t,n){d(this,e);var o=p(this,(e.__proto__||Object.getPrototypeOf(e)).call(this));return o.resolveOptions(n),o.listenClick(t),o}return m(e,t),i(e,[{key:"resolveOptions",value:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};this.action="function"===typeof t.action?t.action:this.defaultAction,this.target="function"===typeof t.target?t.target:this.defaultTarget,this.text="function"===typeof t.text?t.text:this.defaultText,this.container="object"===o(t.container)?t.container:document.body}},{key:"listenClick",value:function(t){var e=this;this.listener=(0,s.default)(t,"click",(function(t){return e.onClick(t)}))}},{key:"onClick",value:function(t){var e=t.delegateTarget||t.currentTarget;this.clipboardAction&&(this.clipboardAction=null),this.clipboardAction=new a.default({action:this.action(e),target:this.target(e),text:this.text(e),container:this.container,trigger:e,emitter:this})}},{key:"defaultAction",value:function(t){return g("action",t)}},{key:"defaultTarget",value:function(t){var e=g("target",t);if(e)return document.querySelector(e)}},{key:"defaultText",value:function(t){return g("text",t)}},{key:"destroy",value:function(){this.listener.destroy(),this.clipboardAction&&(this.clipboardAction.destroy(),this.clipboardAction=null)}}],[{key:"isSupported",value:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:["copy","cut"],e="string"===typeof t?[t]:t,n=!!document.queryCommandSupported;return e.forEach((function(t){n=n&&!!document.queryCommandSupported(t)})),n}}]),e}(c.default);function g(t,e){var n="data-clipboard-"+t;if(e.hasAttribute(n))return e.getAttribute(n)}t.exports=h},function(t,e,n){"use strict";var o="function"===typeof Symbol&&"symbol"===typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"===typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},i=function(){function t(t,e){for(var n=0;n<e.length;n++){var o=e[n];o.enumerable=o.enumerable||!1,o.configurable=!0,"value"in o&&(o.writable=!0),Object.defineProperty(t,o.key,o)}}return function(e,n,o){return n&&t(e.prototype,n),o&&t(e,o),e}}(),r=n(2),a=l(r);function l(t){return t&&t.__esModule?t:{default:t}}function c(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}var u=function(){function t(e){c(this,t),this.resolveOptions(e),this.initSelection()}return i(t,[{key:"resolveOptions",value:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};this.action=t.action,this.container=t.container,this.emitter=t.emitter,this.target=t.target,this.text=t.text,this.trigger=t.trigger,this.selectedText=""}},{key:"initSelection",value:function(){this.text?this.selectFake():this.target&&this.selectTarget()}},{key:"selectFake",value:function(){var t=this,e="rtl"==document.documentElement.getAttribute("dir");this.removeFake(),this.fakeHandlerCallback=function(){return t.removeFake()},this.fakeHandler=this.container.addEventListener("click",this.fakeHandlerCallback)||!0,this.fakeElem=document.createElement("textarea"),this.fakeElem.style.fontSize="12pt",this.fakeElem.style.border="0",this.fakeElem.style.padding="0",this.fakeElem.style.margin="0",this.fakeElem.style.position="absolute",this.fakeElem.style[e?"right":"left"]="-9999px";var n=window.pageYOffset||document.documentElement.scrollTop;this.fakeElem.style.top=n+"px",this.fakeElem.setAttribute("readonly",""),this.fakeElem.value=this.text,this.container.appendChild(this.fakeElem),this.selectedText=(0,a.default)(this.fakeElem),this.copyText()}},{key:"removeFake",value:function(){this.fakeHandler&&(this.container.removeEventListener("click",this.fakeHandlerCallback),this.fakeHandler=null,this.fakeHandlerCallback=null),this.fakeElem&&(this.container.removeChild(this.fakeElem),this.fakeElem=null)}},{key:"selectTarget",value:function(){this.selectedText=(0,a.default)(this.target),this.copyText()}},{key:"copyText",value:function(){var t=void 0;try{t=document.execCommand(this.action)}catch(e){t=!1}this.handleResult(t)}},{key:"handleResult",value:function(t){this.emitter.emit(t?"success":"error",{action:this.action,text:this.selectedText,trigger:this.trigger,clearSelection:this.clearSelection.bind(this)})}},{key:"clearSelection",value:function(){this.trigger&&this.trigger.focus(),window.getSelection().removeAllRanges()}},{key:"destroy",value:function(){this.removeFake()}},{key:"action",set:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"copy";if(this._action=t,"copy"!==this._action&&"cut"!==this._action)throw new Error('Invalid "action" value, use either "copy" or "cut"')},get:function(){return this._action}},{key:"target",set:function(t){if(void 0!==t){if(!t||"object"!==("undefined"===typeof t?"undefined":o(t))||1!==t.nodeType)throw new Error('Invalid "target" value, use a valid Element');if("copy"===this.action&&t.hasAttribute("disabled"))throw new Error('Invalid "target" attribute. Please use "readonly" instead of "disabled" attribute');if("cut"===this.action&&(t.hasAttribute("readonly")||t.hasAttribute("disabled")))throw new Error('Invalid "target" attribute. You can\'t cut text from elements with "readonly" or "disabled" attributes');this._target=t}},get:function(){return this._target}}]),t}();t.exports=u},function(t,e){function n(t){var e;if("SELECT"===t.nodeName)t.focus(),e=t.value;else if("INPUT"===t.nodeName||"TEXTAREA"===t.nodeName){var n=t.hasAttribute("readonly");n||t.setAttribute("readonly",""),t.select(),t.setSelectionRange(0,t.value.length),n||t.removeAttribute("readonly"),e=t.value}else{t.hasAttribute("contenteditable")&&t.focus();var o=window.getSelection(),i=document.createRange();i.selectNodeContents(t),o.removeAllRanges(),o.addRange(i),e=o.toString()}return e}t.exports=n},function(t,e){function n(){}n.prototype={on:function(t,e,n){var o=this.e||(this.e={});return(o[t]||(o[t]=[])).push({fn:e,ctx:n}),this},once:function(t,e,n){var o=this;function i(){o.off(t,i),e.apply(n,arguments)}return i._=e,this.on(t,i,n)},emit:function(t){var e=[].slice.call(arguments,1),n=((this.e||(this.e={}))[t]||[]).slice(),o=0,i=n.length;for(o;o<i;o++)n[o].fn.apply(n[o].ctx,e);return this},off:function(t,e){var n=this.e||(this.e={}),o=n[t],i=[];if(o&&e)for(var r=0,a=o.length;r<a;r++)o[r].fn!==e&&o[r].fn._!==e&&i.push(o[r]);return i.length?n[t]=i:delete n[t],this}},t.exports=n},function(t,e,n){var o=n(5),i=n(6);function r(t,e,n){if(!t&&!e&&!n)throw new Error("Missing required arguments");if(!o.string(e))throw new TypeError("Second argument must be a String");if(!o.fn(n))throw new TypeError("Third argument must be a Function");if(o.node(t))return a(t,e,n);if(o.nodeList(t))return l(t,e,n);if(o.string(t))return c(t,e,n);throw new TypeError("First argument must be a String, HTMLElement, HTMLCollection, or NodeList")}function a(t,e,n){return t.addEventListener(e,n),{destroy:function(){t.removeEventListener(e,n)}}}function l(t,e,n){return Array.prototype.forEach.call(t,(function(t){t.addEventListener(e,n)})),{destroy:function(){Array.prototype.forEach.call(t,(function(t){t.removeEventListener(e,n)}))}}}function c(t,e,n){return i(document.body,t,e,n)}t.exports=r},function(t,e){e.node=function(t){return void 0!==t&&t instanceof HTMLElement&&1===t.nodeType},e.nodeList=function(t){var n=Object.prototype.toString.call(t);return void 0!==t&&("[object NodeList]"===n||"[object HTMLCollection]"===n)&&"length"in t&&(0===t.length||e.node(t[0]))},e.string=function(t){return"string"===typeof t||t instanceof String},e.fn=function(t){var e=Object.prototype.toString.call(t);return"[object Function]"===e}},function(t,e,n){var o=n(7);function i(t,e,n,o,i){var r=a.apply(this,arguments);return t.addEventListener(n,r,i),{destroy:function(){t.removeEventListener(n,r,i)}}}function r(t,e,n,o,r){return"function"===typeof t.addEventListener?i.apply(null,arguments):"function"===typeof n?i.bind(null,document).apply(null,arguments):("string"===typeof t&&(t=document.querySelectorAll(t)),Array.prototype.map.call(t,(function(t){return i(t,e,n,o,r)})))}function a(t,e,n,i){return function(n){n.delegateTarget=o(n.target,e),n.delegateTarget&&i.call(t,n)}}t.exports=r},function(t,e){var n=9;if("undefined"!==typeof Element&&!Element.prototype.matches){var o=Element.prototype;o.matches=o.matchesSelector||o.mozMatchesSelector||o.msMatchesSelector||o.oMatchesSelector||o.webkitMatchesSelector}function i(t,e){while(t&&t.nodeType!==n){if("function"===typeof t.matches&&t.matches(e))return t;t=t.parentNode}}t.exports=i}])}))},e498:function(t,e,n){"use strict";var o=n("7456"),i=n.n(o);i.a}}]);
\ No newline at end of file
(window["webpackJsonp"]=window["webpackJsonp"]||[]).push([["chunk-4ed577de"],{"0f14":function(t,e,n){"use strict";n.r(e);var a=function(){var t=this,e=t.$createElement,n=t._self._c||e;return n("div",{staticClass:"app-container"},[n("div",{staticClass:"filter-container"},[n("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.name,callback:function(e){t.$set(t.listQuery,"name",e)},expression:"listQuery.name"}}),t._v(" "),n("el-button",{staticClass:"filter-item",attrs:{type:"primary",icon:"el-icon-search"},on:{click:t.handleFilter}},[t._v("\n 搜索\n ")])],1),t._v(" "),n("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":""}},[n("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(" "),n("el-table-column",{attrs:{label:"名称"},scopedSlots:t._u([{key:"default",fn:function(e){return[t._v("\n "+t._s(e.row.name)+"\n ")]}}])}),t._v(" "),n("el-table-column",{attrs:{label:"排序"},scopedSlots:t._u([{key:"default",fn:function(e){return[t._v("\n "+t._s(e.row.sort)+"\n ")]}}])}),t._v(" "),n("el-table-column",{attrs:{label:"操作",align:"center",width:"230","class-name":"small-padding fixed-width"},scopedSlots:t._u([{key:"default",fn:function(e){return[n("el-button",{attrs:{type:"primary",size:"mini"},on:{click:function(n){return t.updateSort(e.row.id)}}},[t._v("\n 修改排序\n ")])]}}])})],1),t._v(" "),n("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}})],1)},i=[],o=n("b775"),r=n("5f87");function u(t){return t.token=Object(r["a"])(),Object(o["a"])({url:"jingdong/cate-list",method:"get",params:t})}function l(t){return t.token=Object(r["a"])(),Object(o["a"])({url:"jingdong/update-cate-sort",method:"post",params:t})}var s=n("333d"),c={name:"Cates",components:{Pagination:s["a"]},data:function(){return{dialogTableVisible:!1,list:null,listLoading:!0,total:0,listQuery:{page:1,limit:15,name:""}}},created:function(){this.fetchData()},methods:{updateSort:function(t){var e=this;this.$prompt("请输入排序大小","提示",{confirmButtonText:"确定",cancelButtonText:"取消",inputPattern:/\d+/,inputErrorMessage:"必须是数字"}).then((function(n){var a=n.value;l({id:t,sort:a}).then((function(t){e.$message({type:"info",message:"更新成功"}),e.fetchData()}))})).catch((function(){e.$message({type:"info",message:"取消输入"})}))},fetchData:function(){var t=this;this.listLoading=!0,u(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()}}},d=c,p=n("2877"),f=Object(p["a"])(d,a,i,!1,null,null,null);e["default"]=f.exports},"333d":function(t,e,n){"use strict";var a=function(){var t=this,e=t.$createElement,n=t._self._c||e;return n("div",{staticClass:"pagination-container",class:{hidden:t.hidden}},[n("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)},i=[];n("c5f6");Math.easeInOutQuad=function(t,e,n,a){return t/=a/2,t<1?n/2*t*t+e:(t--,-n/2*(t*(t-2)-1)+e)};var o=function(){return window.requestAnimationFrame||window.webkitRequestAnimationFrame||window.mozRequestAnimationFrame||function(t){window.setTimeout(t,1e3/60)}}();function r(t){document.documentElement.scrollTop=t,document.body.parentNode.scrollTop=t,document.body.scrollTop=t}function u(){return document.documentElement.scrollTop||document.body.parentNode.scrollTop||document.body.scrollTop}function l(t,e,n){var a=u(),i=t-a,l=20,s=0;e="undefined"===typeof e?500:e;var c=function t(){s+=l;var u=Math.easeInOutQuad(s,a,i,e);r(u),s<e?o(t):n&&"function"===typeof n&&n()};c()}var s={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&&l(0,800)},handleCurrentChange:function(t){this.$emit("pagination",{page:t,limit:this.pageSize}),this.autoScroll&&l(0,800)}}},c=s,d=(n("e498"),n("2877")),p=Object(d["a"])(c,a,i,!1,null,"6af373ef",null);e["a"]=p.exports},7456:function(t,e,n){},e498:function(t,e,n){"use strict";var a=n("7456"),i=n.n(a);i.a}}]);
\ No newline at end of file
import request from '@/utils/request'
import { getToken } from '@/utils/auth'
export function getCateList(params) {
params.token = getToken()
return request({
url: 'jingdong/cate-list',
method: 'get',
params
})
}
export function updateCateSort(params) {
params.token = getToken()
return request({
url: 'jingdong/update-cate-sort',
method: 'post',
params
})
}
......@@ -19,6 +19,15 @@ export function getCateList(params) {
})
}
export function importGoodCoupon(params) {
params.token = getToken()
return request({
url: 'jingdong/import-good-coupon',
method: 'post',
params
})
}
export function importUrl(params) {
params.token = getToken()
return request({
......@@ -36,3 +45,12 @@ export function deleteGood(params) {
params
})
}
export function updateGoodSort(params) {
params.token = getToken()
return request({
url: 'jingdong/update-good-sort',
method: 'post',
params
})
}
......@@ -8,7 +8,8 @@ import Layout from '@/layout'
/* Router Modules */
import accountsRouter from './modules/accounts'
import goodsRouter from "./modules/goods";
import goodsRouter from "./modules/goods"
import catesRouter from "./modules/cates"
/**
* Note: sub-menu only appear when route children.length >= 1
......@@ -83,6 +84,7 @@ export const asyncRoutes = [
/** when your routing map is too long, you can split it into small modules **/
//accountsRouter,
goodsRouter,
catesRouter,
// 404 page must be placed at the end !!!
{ path: '*', redirect: '/404', hidden: true }
]
......
/** When your routing table is too long, you can split it into small modules**/
import Layout from '@/layout'
const catesRouter = {
path: '/cates',
component: Layout,
redirect: '/cates/index1',
name: 'Cates',
meta: {
title: '商品目录管理',
icon: 'shopping'
},
alwaysShow: true,
children: [
{
path: 'index',
name: '一级目录列表',
component: () => import('@/views/cates/index'),
meta: { title: '一级目录列表', icon: 'shopping' }
},
]
}
export default catesRouter
<template>
<div class="app-container">
<div class="filter-container">
<el-input v-model="listQuery.name" placeholder="名称" style="width: 200px;" class="filter-item" @keyup.enter.native="handleFilter" />
<el-button class="filter-item" type="primary" icon="el-icon-search" @click="handleFilter">
搜索
</el-button>
</div>
<el-table
v-loading="listLoading"
:data="list"
element-loading-text="Loading"
border
fit
highlight-current-row
>
<el-table-column align="center" label="ID" width="95">
<template slot-scope="scope">
{{ scope.$index }}
</template>
</el-table-column>
<el-table-column label="名称">
<template slot-scope="scope">
{{ scope.row.name }}
</template>
</el-table-column>
<el-table-column label="排序">
<template slot-scope="scope">
{{ scope.row.sort }}
</template>
</el-table-column>
<el-table-column label="操作" align="center" width="230" class-name="small-padding fixed-width">
<template slot-scope="scope">
<el-button type="primary" size="mini" @click="updateSort(scope.row.id)">
修改排序
</el-button>
</template>
</el-table-column>
</el-table>
<pagination v-show="total > 0" :total="total" :page.sync="listQuery.page" :limit.sync="listQuery.limit" @pagination="fetchData" />
</div>
</template>
<script>
import { getCateList, updateCateSort } from '@/api/cates'
import Pagination from '@/components/Pagination'
export default {
name: 'Cates',
components: { Pagination },
data() {
return {
dialogTableVisible: false,
list: null,
listLoading: true,
total: 0,
listQuery: {
page: 1,
limit: 15,
name: '',
},
}
},
created() {
this.fetchData()
},
methods: {
updateSort(id) {
this.$prompt('请输入排序大小', '提示', {
confirmButtonText: '确定',
cancelButtonText: '取消',
inputPattern: /\d+/,
inputErrorMessage: '必须是数字'
}).then(({ value }) => {
updateCateSort({id, sort: value}).then(res => {
this.$message({
type: 'info',
message: '更新成功'
});
this.fetchData()
})
}).catch(() => {
this.$message({
type: 'info',
message: '取消输入'
});
});
},
fetchData() {
this.listLoading = true
getCateList(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>
......@@ -61,14 +61,9 @@
{{ scope.row.unit_price }}
</template>
</el-table-column>
<el-table-column label="推广开始日期">
<el-table-column label="推广日期">
<template slot-scope="scope">
{{ scope.row.start_date }}
</template>
</el-table-column>
<el-table-column label="推广结束日期">
<template slot-scope="scope">
{{ scope.row.end_date }}
{{ scope.row.start_date + '--' + scope.row.end_date }}
</template>
</el-table-column>
<el-table-column label="30天引单数量">
......@@ -88,13 +83,31 @@
</el-table-column>
<el-table-column label="推广地址">
<template slot-scope="scope">
<el-button v-clipboard:copy="scope.row.click_url" v-clipboard:success="clipboardSuccess" type="primary" icon="el-icon-document">
<el-button size="mini" v-clipboard:copy="scope.row.click_url" v-clipboard:success="clipboardSuccess" type="primary" icon="el-icon-document">
复制
</el-button>
</template>
</el-table-column>
<el-table-column label="优惠券地址">
<template slot-scope="scope">
<el-tooltip class="item" effect="dark" :content="scope.row.coupon_text" placement="top">
<el-button type="primary" size="mini">悬浮查看</el-button>
</el-tooltip>
</template>
</el-table-column>
<el-table-column label="排序">
<template slot-scope="scope">
{{ scope.row.sort }}
</template>
</el-table-column>
<el-table-column label="操作" align="center" width="230" class-name="small-padding fixed-width">
<template slot-scope="scope">
<el-button type="primary" size="mini" @click="updateSort(scope.row.id)">
修改排序
</el-button>
<el-button type="primary" size="mini" @click="importCoupon(scope.row.id)">
导入优惠券
</el-button>
<el-button type="primary" size="mini" @click="deleteGood(scope.row.id)">
删除
</el-button>
......@@ -124,7 +137,7 @@
</template>
<script>
import { getGoodList, getCateList, importUrl, deleteGood } from '@/api/goods'
import { getGoodList, getCateList, importUrl, deleteGood, updateGoodSort, importGoodCoupon } from '@/api/goods'
import Pagination from '@/components/Pagination'
import clipboard from '@/directive/clipboard/index.js'
......@@ -173,6 +186,48 @@
destroyed() {
},
methods: {
importCoupon(id) {
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 }) => {
importGoodCoupon({id, url: value}).then(res => {
this.$message({
type: 'info',
message: '更新成功'
});
this.fetchData()
})
}).catch(() => {
this.$message({
type: 'info',
message: '取消输入'
});
});
},
updateSort(id) {
this.$prompt('请输入排序大小', '提示', {
confirmButtonText: '确定',
cancelButtonText: '取消',
inputPattern: /\d+/,
inputErrorMessage: '必须是数字'
}).then(({ value }) => {
updateGoodSort({id, sort: value}).then(res => {
this.$message({
type: 'info',
message: '更新成功'
});
this.fetchData()
})
}).catch(() => {
this.$message({
type: 'info',
message: '取消输入'
});
});
},
deleteGood(id) {
this.$confirm('确定删除视频吗?', '提示', {
confirmButtonText: '确定',
......
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