chunk-e31e9a48.da7fe4a9.js 13 KB

12
  1. (window["webpackJsonp"]=window["webpackJsonp"]||[]).push([["chunk-e31e9a48"],{"0137":function(e,t,n){"use strict";n.d(t,"b",function(){return a}),n.d(t,"c",function(){return i}),n.d(t,"a",function(){return o}),n.d(t,"e",function(){return s}),n.d(t,"d",function(){return u}),n.d(t,"f",function(){return c});var r=n("bf9a");function a(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return r["b"].get("coupon",{params:e})}function i(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return r["b"].get("coupon_user_bags",{params:e})}function o(e){return r["b"].get("coupon/".concat(e,"/edit"))}function s(e){return r["b"].post("coupon",e)}function u(e){return r["b"].post("coupon/giveCouponToUser",e)}function c(e,t){return r["b"].put("coupon/".concat(e),t)}},"0fb6":function(e,t,n){},"323a":function(e,t,n){"use strict";n.d(t,"e",function(){return a}),n.d(t,"f",function(){return i}),n.d(t,"a",function(){return o}),n.d(t,"c",function(){return s}),n.d(t,"d",function(){return u}),n.d(t,"b",function(){return c});var r=n("bf9a");function a(e){return r["b"].post("admin_merchants",e)}function i(e,t){return r["b"].put("admin_merchants/".concat(e),t)}function o(e){return r["b"].get("admin_merchants/".concat(e,"/edit"))}function s(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return r["b"].get("admin_merchants",{params:e})}function u(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return r["b"].get("admin_merchant_config/get",{params:e})}function c(e){return r["b"].post("admin_merchant_config/edit",e)}},"386d":function(e,t,n){"use strict";var r=n("cb7c"),a=n("83a1"),i=n("5f1b");n("214f")("search",1,function(e,t,n,o){return[function(n){var r=e(this),a=void 0==n?void 0:n[t];return void 0!==a?a.call(n,r):new RegExp(n)[t](String(r))},function(e){var t=o(n,e,this);if(t.done)return t.value;var s=r(e),u=String(this),c=s.lastIndex;a(c,0)||(s.lastIndex=0);var l=i(s,u);return a(s.lastIndex,c)||(s.lastIndex=c),null===l?-1:l.index}]})},"469f":function(e,t,n){n("6c1c"),n("1654"),e.exports=n("7d7b")},"5d73":function(e,t,n){e.exports=n("469f")},"69d9":function(e,t,n){"use strict";n("8e6e"),n("456d"),n("7f7f"),n("ac6a");var r=n("bd86");function a(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),n.push.apply(n,r)}return n}function i(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?a(n,!0).forEach(function(t){Object(r["a"])(e,t,n[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):a(n).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))})}return e}var o,s,u={name:"SearchForm",data:function(){return{form:{},show:!0}},props:{fields:Array,resetCurrentPage:{type:Boolean,default:!0}},created:function(){this.initFormShow()},methods:{onSubmit:function(){var e=this,t=i({},this.$route.query);this.resetCurrentPage&&delete t.page,this.fields.forEach(function(n){var r=n.field,a=e.form[r];"string"===typeof a&&(a=a.trim()),""===a||void 0===a?delete t[r]:(t[r]=a,"time_between"===r&&(t[r]=null==a?a:[a[0],a[1]]))}),this.$router.push({path:this.$route.path,query:t})},dateFormat:function(e){var t=e.getFullYear()+"-"+this.p(e.getMonth()+1)+"-"+this.p(e.getDate()),n=this.p(e.getHours())+":"+this.p(e.getMinutes())+":"+this.p(e.getSeconds());return t+n},p:function(e){return e<10?"0"+e:e},onReset:function(){this.form={},this.onSubmit()},initFormShow:function(){var e=this;this.fields.some(function(t){if(e.$route.query[t.field])return e.show=!0,!0})},setFormValueFromQuery:function(){var e=this,t=this.$route.query;this.fields.forEach(function(n){var r=n.field,a=t[r];e.$set(e.form,r,a)})},toggleShow:function(){this.show=!this.show},getOffsetHeight:function(){var e=document.getElementById("div-searchForm"),t=e.clientWidth||e.offsetWidth;this.formHeight=t}},watch:{$route:{handler:function(){this.setFormValueFromQuery()},immediate:!0}},render:function(e){var t=this;return e("el-collapse-transition",[e("div",{directives:[{name:"show",value:this.show}]},[e("el-form",{attrs:{inline:!0},nativeOn:{keydown:function(e){return"button"in e||!t._k(e.keyCode,"enter",13,e.key,"Enter")?(e.preventDefault(),t.onSubmit(e)):null}}},[this.fields.map(function(n){var r;switch(n.type){case"el-select":r=e("el-select",{style:"width:150px;",attrs:{placeholder:n.label,filterable:!0,clearable:!0},model:{value:t.form[n.field],callback:function(e){t.$set(t.form,n.field,e)}}},[n.options.map(function(t){return e("el-option",{key:t.value||t.id,attrs:{label:t.label||t.name,value:String(t.value||t.id)}})})]);break;case"time-between":r=e("el-date-picker",{attrs:{type:"datetimerange","value-format":"yyyy-MM-dd HH:mm:ss","start-placeholder":n.label1,"end-placeholder":n.label2},model:{value:t.form[n.field],callback:function(e){t.$set(t.form,n.field,e)}}});break;case"super-input":r=e("el-input",{attrs:{placeholder:n.label,clearable:!0},model:{value:t.form[n.field],callback:function(e){t.$set(t.form,n.field,e)}}});break;default:r=e("el-input",{attrs:{placeholder:n.label,clearable:!0},model:{value:t.form[n.field],callback:function(e){t.$set(t.form,n.field,e)}}})}return e("el-form-item",{key:n.field},[r])}),e("el-form-item",{class:"actions"},[e("el-button",{attrs:{type:"primary"},on:{click:this.onSubmit}},["查询"]),e("el-button",{on:{click:this.onReset}},["重置"])])])])])}},c=u,l=(n("cafd"),n("2877")),f=Object(l["a"])(c,o,s,!1,null,"6dd66826",null);t["a"]=f.exports},"768b":function(e,t,n){"use strict";var r=n("a745"),a=n.n(r);function i(e){if(a()(e))return e}var o=n("5d73"),s=n.n(o);function u(e,t){var n=[],r=!0,a=!1,i=void 0;try{for(var o,u=s()(e);!(r=(o=u.next()).done);r=!0)if(n.push(o.value),t&&n.length===t)break}catch(c){a=!0,i=c}finally{try{r||null==u["return"]||u["return"]()}finally{if(a)throw i}}return n}function c(){throw new TypeError("Invalid attempt to destructure non-iterable instance")}function l(e,t){return i(e)||u(e,t)||c()}n.d(t,"a",function(){return l})},"7d7b":function(e,t,n){var r=n("e4ae"),a=n("7cd6");e.exports=n("584a").getIterator=function(e){var t=a(e);if("function"!=typeof t)throw TypeError(e+" is not iterable!");return r(t.call(e))}},"81df":function(e,t,n){"use strict";var r=function(){var e=this,t=e.$createElement,n=e._self._c||t;return e.page?n("el-pagination",e._b({ref:"page",attrs:{"page-sizes":e.pageSizes,"current-page":e.currentPage,"page-size":e.perPage,total:e.page.total,layout:e.layout,background:""},on:{"size-change":e.onSizeChange,"current-change":e.onChange,"update:currentPage":function(t){e.currentPage=t},"update:current-page":function(t){e.currentPage=t},"update:pageSize":function(t){e.perPage=t},"update:page-size":function(t){e.perPage=t}}},"el-pagination",e.$attrs,!1)):e._e()},a=[],i={name:"Pagination",data:function(){return{currentPage:1,perPage:10}},props:{page:Object,layout:{type:String,default:"total, prev, pager, next, sizes, jumper"},autoPush:{type:Boolean,default:!0}},computed:{pageSizes:function(){var e=[10,30,50,100,200],t=this.page.per_page;return-1===e.indexOf(t)?[this.page.per_page].concat(e):e}},methods:{push:function(){var e=Object.assign({},this.$route.query,{page:this.currentPage,per_page:this.perPage});this.$router.push({path:this.$route.path,query:e})},onSizeChange:function(e){this.$emit("size-change",e),this.autoPush&&(this.currentPage=1,this.push())},onChange:function(e){this.$emit("current-change",e),this.autoPush&&this.push()}},watch:{page:{handler:function(e){var t=this;e&&(this.currentPage=e.current_page,this.perPage=e.per_page,this.$nextTick(function(){t.$refs.page.internalCurrentPage=e.current_page}))},immediate:!0}}},o=i,s=n("2877"),u=Object(s["a"])(o,r,a,!1,null,"f691fd2e",null);t["a"]=u.exports},"83a1":function(e,t){e.exports=Object.is||function(e,t){return e===t?0!==e||1/e===1/t:e!=e&&t!=t}},"9f7e":function(e,t,n){"use strict";var r=n("dfd2"),a=n.n(r);a.a},cafd:function(e,t,n){"use strict";var r=n("0fb6"),a=n.n(r);a.a},d535:function(e,t,n){"use strict";n.r(t);var r=function(){var e=this,t=e.$createElement,n=e._self._c||t;return n("el-card",{scopedSlots:e._u([{key:"header",fn:function(){return[n("content-header")]},proxy:!0}])},[n("search-form",{ref:"searchForm",attrs:{fields:e.search}}),n("el-table",{attrs:{data:e.datas,resource:"admin-users"}},[n("el-table-column",{attrs:{prop:"id",label:"ID",align:"center","show-overflow-tooltip":"","min-width":"2%"}}),n("el-table-column",{attrs:{prop:"user_name",label:"姓名",align:"center","show-overflow-tooltip":"","min-width":"8%"}}),n("el-table-column",{attrs:{prop:"type_name",label:"获取途径",align:"center","show-overflow-tooltip":"","min-width":"5%"}}),n("el-table-column",{attrs:{prop:"coupons_title",label:"优惠券名",align:"center","show-overflow-tooltip":"","min-width":"6%"},scopedSlots:e._u([{key:"default",fn:function(t){return[e._v("\n "+e._s(t.row.coupons.title)+"\n ")]}}])}),n("el-table-column",{attrs:{label:"状态",align:"center","show-overflow-tooltip":"","min-width":"4%"},scopedSlots:e._u([{key:"default",fn:function(t){return[1==t.row.status?n("el-tag",{attrs:{type:"success"}},[e._v("正常")]):2==t.row.status?n("el-tag",{attrs:{type:"warning"}},[e._v("已使用")]):n("el-tag",{attrs:{type:"danger"}},[e._v("失效")])]}}])}),n("el-table-column",{attrs:{prop:"created_at",label:"获取时间",align:"center","show-overflow-tooltip":"","min-width":"5%"}}),n("el-table-column",{attrs:{label:"操作",align:"center","show-overflow-tooltip":"",width:"150"},scopedSlots:e._u([{key:"default",fn:function(t){var r=t.row;t.$index;return[n("el-button-group",[n("el-button",{attrs:{type:"warning",size:"small"},on:{click:function(t){return e.dialogVisibleClick(r)}}},[e._v("详情")])],1)]}}])})],1),n("el-dialog",{attrs:{title:"详情",visible:e.dialogVisible,width:"20%"},on:{"update:visible":function(t){e.dialogVisible=t}}},[n("div",{staticClass:"info-wrp"},[n("div",{staticClass:"title"},[e._v("优惠券详情")]),n("div",{staticClass:"info-item"},[n("span",[e._v("优惠券名称:")]),n("span",[e._v(e._s(e.rows.title))])]),n("div",{staticClass:"info-item"},[n("span",[e._v("优惠券类型:")]),n("span",[e._v(e._s(e.rows.type_name))])]),n("div",{directives:[{name:"show",rawName:"v-show",value:1==e.rows.type,expression:"rows.type==1"}],staticClass:"info-item"},[n("span",[e._v("满多少金额:")]),n("span",[e._v(e._s(e.rows.with_amount))])]),n("div",{staticClass:"info-item"},[n("span",[e._v("可减少金额:")]),n("span",[e._v(e._s(e.rows.used_amount))])]),n("div",{staticClass:"info-item"},[n("span",[e._v("时效类型:")]),n("span",{staticStyle:{width:"60%"}},[e._v(e._s(e.rows.valid_type_name))])]),n("div",{directives:[{name:"show",rawName:"v-show",value:2==e.rows.valid_type,expression:"rows.valid_type==2"}],staticClass:"info-item"},[n("span",[e._v("自领取起有效天数:")]),n("span",{staticStyle:{width:"60%"}},[e._v(e._s(e.rows.valid_days))])]),n("div",{directives:[{name:"show",rawName:"v-show",value:1==e.rows.valid_type,expression:"rows.valid_type==1"}],staticClass:"info-item"},[n("span",[e._v("生效日期:")]),n("span",{staticStyle:{width:"60%"}},[e._v(e._s(e.rows.valid_start_time))])]),n("div",{directives:[{name:"show",rawName:"v-show",value:1==e.rows.valid_type,expression:"rows.valid_type==1"}],staticClass:"info-item"},[n("span",[e._v("失效日期:")]),n("span",{staticStyle:{width:"60%"}},[e._v(e._s(e.rows.valid_end_time))])])])]),n("div",{staticClass:"card-footer"},[n("pagination",{attrs:{page:e.page}})],1)],1)},a=[],i=(n("386d"),n("ac6a"),n("5df3"),n("768b")),o=(n("96cf"),n("3b8d")),s=n("69d9"),u=n("81df"),c=n("0137"),l=n("873a"),f=n("323a"),d={name:"Index",components:{SearchForm:s["a"],Pagination:u["a"]},data:function(){return{search:[{type:"super-input",field:"mobile_nickname",label:"用户昵称 / 用户手机号"},{type:"el-select",field:"status",label:"状态",options:[{id:"",name:"全部"},{id:1,name:"正常"},{id:0,name:"失效"}]},{type:"el-select",field:"merchant_id",label:"商户",options:[{id:"",name:"全部"}]}],datas:[],page:null,first_blood:!0,dialogVisible:!1,rows:{}}},mixins:[l["m"]],created:function(){var e=Object(o["a"])(regeneratorRuntime.mark(function e(){var t,n,r;return regeneratorRuntime.wrap(function(e){while(1)switch(e.prev=e.next){case 0:if("administrator"!==this.$store.state.users.user.roles[0]){e.next=9;break}return e.next=3,Promise.all([Object(f["c"])({all:1})]);case 3:t=e.sent,n=Object(i["a"])(t,1),r=n[0].data,this.search[2].options.push.apply(this.search[2].options,r.data),e.next=10;break;case 9:this.search.splice(2,1);case 10:case"end":return e.stop()}},e,this)}));function t(){return e.apply(this,arguments)}return t}(),watch:{$route:{handler:function(){var e=Object(o["a"])(regeneratorRuntime.mark(function e(t){var n,r,a,i;return regeneratorRuntime.wrap(function(e){while(1)switch(e.prev=e.next){case 0:return e.next=2,this.autoPageSize(53,t);case 2:return e.next=4,Object(c["c"])(t.query);case 4:n=e.sent,r=n.data,a=r.data,i=r.meta,this.datas=a,this.page=i;case 10:case"end":return e.stop()}},e,this)}));function t(t){return e.apply(this,arguments)}return t}(),immediate:!0}},methods:{dialogVisibleClick:function(e){this.rows=e.coupon_resource,this.dialogVisible=!0}}},p=d,h=(n("9f7e"),n("2877")),m=Object(h["a"])(p,r,a,!1,null,"08bd9377",null);t["default"]=m.exports},dfd2:function(e,t,n){}}]);
  2. //# sourceMappingURL=chunk-e31e9a48.da7fe4a9.js.map