You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
yanzong/public/store/js/user.0e572a46.js

1 lines
15 KiB

(window["webpackJsonp"]=window["webpackJsonp"]||[]).push([["user"],{2271:function(e,a,r){},"2cd3":function(e,a,r){},"644d":function(e,a,r){"use strict";r("2cd3")},"88bc":function(e,a,r){(function(a){var r=1/0,t=9007199254740991,n="[object Arguments]",i="[object Function]",l="[object GeneratorFunction]",o="[object Symbol]",s="object"==typeof a&&a&&a.Object===Object&&a,c="object"==typeof self&&self&&self.Object===Object&&self,u=s||c||Function("return this")();function d(e,a,r){switch(r.length){case 0:return e.call(a);case 1:return e.call(a,r[0]);case 2:return e.call(a,r[0],r[1]);case 3:return e.call(a,r[0],r[1],r[2])}return e.apply(a,r)}function m(e,a){var r=-1,t=e?e.length:0,n=Array(t);while(++r<t)n[r]=a(e[r],r,e);return n}function p(e,a){var r=-1,t=a.length,n=e.length;while(++r<t)e[n+r]=a[r];return e}var f=Object.prototype,h=f.hasOwnProperty,v=f.toString,b=u.Symbol,_=f.propertyIsEnumerable,C=b?b.isConcatSpreadable:void 0,g=Math.max;function w(e,a,r,t,n){var i=-1,l=e.length;r||(r=A),n||(n=[]);while(++i<l){var o=e[i];a>0&&r(o)?a>1?w(o,a-1,r,t,n):p(n,o):t||(n[n.length]=o)}return n}function y(e,a){return e=Object(e),E(e,a,(function(a,r){return r in e}))}function E(e,a,r){var t=-1,n=a.length,i={};while(++t<n){var l=a[t],o=e[l];r(o,l)&&(i[l]=o)}return i}function R(e,a){return a=g(void 0===a?e.length-1:a,0),function(){var r=arguments,t=-1,n=g(r.length-a,0),i=Array(n);while(++t<n)i[t]=r[a+t];t=-1;var l=Array(a+1);while(++t<a)l[t]=r[t];return l[a]=i,d(e,this,l)}}function A(e){return x(e)||T(e)||!!(C&&e&&e[C])}function S(e){if("string"==typeof e||G(e))return e;var a=e+"";return"0"==a&&1/e==-r?"-0":a}function T(e){return P(e)&&h.call(e,"callee")&&(!_.call(e,"callee")||v.call(e)==n)}var x=Array.isArray;function L(e){return null!=e&&k(e.length)&&!N(e)}function P(e){return I(e)&&L(e)}function N(e){var a=F(e)?v.call(e):"";return a==i||a==l}function k(e){return"number"==typeof e&&e>-1&&e%1==0&&e<=t}function F(e){var a=typeof e;return!!e&&("object"==a||"function"==a)}function I(e){return!!e&&"object"==typeof e}function G(e){return"symbol"==typeof e||I(e)&&v.call(e)==o}var O=R((function(e,a){return null==e?{}:y(e,m(w(a,1),S))}));e.exports=O}).call(this,r("c8ba"))},a315:function(e,a,r){"use strict";r("2271")},b192:function(e,a,r){"use strict";r("d22b")},d22b:function(e,a,r){},dab6:function(e,a,r){"use strict";r.r(a);r("b0c0");var t=function(){var e=this,a=e._self._c;return a("a-card",{attrs:{bordered:!1}},[a("div",{staticClass:"card-title"},[e._v(e._s(e.$route.meta.title))]),a("div",{staticClass:"table-operator"},[a("a-row",{staticClass:"row-item-search"},[a("a-form",{staticClass:"search-form",attrs:{form:e.searchForm,layout:"inline"},on:{submit:e.handleSearch}},[a("a-form-item",{attrs:{label:"昵称/手机号"}},[a("a-input",{directives:[{name:"decorator",rawName:"v-decorator",value:["search"],expression:"['search']"}],attrs:{placeholder:"请输入昵称/手机号"}})],1),e.$module("user-grade")?a("a-form-item",{attrs:{label:"会员等级"}},[a("a-select",{directives:[{name:"decorator",rawName:"v-decorator",value:["gradeId",{initialValue:0}],expression:"['gradeId', { initialValue: 0 }]"}]},[a("a-select-option",{attrs:{value:0}},[e._v("全部")]),e._l(e.gradeList,(function(r,t){return a("a-select-option",{key:t,attrs:{value:r.grade_id}},[e._v(e._s(r.name))])}))],2)],1):e._e(),a("a-form-item",{attrs:{label:"注册时间"}},[a("a-range-picker",{directives:[{name:"decorator",rawName:"v-decorator",value:["betweenTime"],expression:"['betweenTime']"}],attrs:{format:"YYYY-MM-DD"}})],1),a("a-form-item",{staticClass:"search-btn"},[a("a-button",{attrs:{type:"primary",icon:"search","html-type":"submit"}},[e._v("搜索")])],1)],1)],1)],1),a("s-table",{ref:"table",attrs:{rowKey:"user_id",loading:e.isLoading,columns:e.columns,data:e.loadData,pageSize:15},scopedSlots:e._u([{key:"avatar_url",fn:function(e){return a("span",{},[a("div",{staticClass:"avatar"},[a("img",e?{attrs:{width:"45",height:"45",src:e,alt:"用户头像"}}:{attrs:{width:"45",height:"45",src:r("889b"),alt:"用户头像"}})])])}},{key:"main_info",fn:function(r){return a("span",{},[a("p",[e._v(e._s(r.nick_name))]),a("p",{staticClass:"c-p"},[e._v(e._s(r.mobile))])])}},{key:"grade",fn:function(r){return a("span",{},[r?a("a-tag",[e._v(e._s(r.name))]):a("span",[e._v("--")])],1)}},{key:"balance",fn:function(r,t){return a("span",{},[a("p",[a("span",[e._v("余额:")]),a("span",{staticClass:"c-p"},[e._v(e._s(r))])]),a("p",[a("span",[e._v("积分:")]),a("span",{staticClass:"c-p"},[e._v(e._s(t.points))])])])}},{key:"expend_money",fn:function(r){return a("span",{},[a("span",{staticClass:"c-p"},[e._v(e._s(r))])])}},{key:"platform",fn:function(e){return a("span",{staticClass:"platform"},[a("platform-icon",{attrs:{name:e,showTips:!0,iconSize:17}})],1)}},{key:"action",fn:function(r){return a("span",{staticClass:"actions"},[e.$module("market-recharge")?a("a",{directives:[{name:"action",rawName:"v-action:recharge",arg:"recharge"}],attrs:{title:"会员充值"},on:{click:function(a){return e.handleRecharge(r)}}},[e._v("充值")]):e._e(),e.$module("user-grade")?a("a",{directives:[{name:"action",rawName:"v-action:grade",arg:"grade"}],attrs:{title:"会员等级"},on:{click:function(a){return e.handleGrade(r)}}},[e._v("等级")]):e._e(),a("a",{directives:[{name:"action",rawName:"v-action:delete",arg:"delete"}],on:{click:function(a){return e.handleDelete(r)}}},[e._v("删除")])])}}])}),a("GradeForm",{ref:"GradeForm",attrs:{gradeList:e.gradeList},on:{handleSubmit:e.handleRefresh}}),a("RechargeForm",{ref:"RechargeForm",on:{handleSubmit:e.handleRefresh}})],1)},n=[],i=r("5530"),l=(r("d3b7"),r("fa04")),o=r("fab29"),s=r("2e1c"),c=r("2af9"),u=r("8d5f"),d=function(){var e=this,a=e._self._c;return a("a-modal",{staticClass:"noborder",attrs:{title:e.title,width:520,visible:e.visible,confirmLoading:e.confirmLoading,maskClosable:!1},on:{ok:e.handleSubmit,cancel:e.handleCancel}},[a("a-spin",{attrs:{spinning:e.confirmLoading}},[a("a-form",{attrs:{form:e.form}},[a("a-form-item",{attrs:{label:"会员ID",labelCol:e.labelCol,wrapperCol:e.wrapperCol}},[a("span",[e._v(e._s(e.record.user_id))])]),a("a-form-item",{attrs:{label:"会员身份",labelCol:e.labelCol,wrapperCol:e.wrapperCol}},[a("a-select",{directives:[{name:"decorator",rawName:"v-decorator",value:["user_type",{rules:[{required:!0}]}],expression:"['user_type', { rules: [{ required: true }] }]"}],attrs:{placeholder:"请选择会员身份"}},[a("a-select-option",{attrs:{value:0}},[e._v("无身份")]),e._l(e.userTypeList,(function(r,t){return a("a-select-option",{key:t,attrs:{value:r.id}},[e._v(e._s(r.name))])}))],2)],1),a("a-form-item",{attrs:{label:"会员等级",labelCol:e.labelCol,wrapperCol:e.wrapperCol}},[a("a-select",{directives:[{name:"decorator",rawName:"v-decorator",value:["grade_id",{rules:[{required:!0}]}],expression:"['grade_id', { rules: [{ required: true }] }]"}],attrs:{placeholder:"请选择会员等级"}},[a("a-select-option",{attrs:{value:0}},[e._v("无等级")]),e._l(e.gradeList,(function(r,t){return a("a-select-option",{key:t,attrs:{value:r.grade_id}},[e._v(e._s(r.name))])}))],2)],1),a("a-form-item",{attrs:{label:"管理员备注",labelCol:e.labelCol,wrapperCol:e.wrapperCol}},[a("a-textarea",{directives:[{name:"decorator",rawName:"v-decorator",value:["remark",{rules:[{required:!0,message:"请输入管理员备注"}]}],expression:"['remark', { rules: [{ required: true, message: '请输入管理员备注' }] }]"}],attrs:{placeholder:"请输入管理员备注",rows:3}})],1)],1)],1)],1)},m=[],p=r("88bc"),f=r.n(p),h={components:{},props:{gradeList:{type:Array,required:!0}},data:function(){return{title:"设置会员等级",labelCol:{span:7},wrapperCol:{span:13},visible:!1,confirmLoading:!1,form:this.$form.createForm(this),record:{},userTypeList:[{id:10,name:"游客"},{id:20,name:"PLUS会员"},{id:30,name:"分销商"},{id:40,name:"店长"}]}},methods:{handle:function(e){this.visible=!0,this.record=e,this.setFieldsValue()},setFieldsValue:function(){var e=this.record,a=this.form.setFieldsValue;this.$nextTick((function(){a(f()(e,["grade_id","user_type"]))}))},handleSubmit:function(e){var a=this;e.preventDefault();var r=this.form.validateFields;r((function(e,r){!e&&a.onFormSubmit(r)}))},handleCancel:function(){this.visible=!1,this.form.resetFields()},onFormSubmit:function(e){var a=this;this.confirmLoading=!0,o["b"]({userId:this.record.user_id,form:e}).then((function(r){a.$message.success(r.message,1.5),a.handleCancel(),a.$emit("handleSubmit",e)})).finally((function(){return a.confirmLoading=!1}))}}},v=h,b=(r("b192"),r("2877")),_=Object(b["a"])(v,d,m,!1,null,null,null),C=_.exports,g=function(){var e=this,a=e._self._c;return a("a-modal",{staticClass:"noborder",attrs:{title:e.title,width:520,visible:e.visible,confirmLoading:e.confirmLoading,maskClosable:!1},on:{ok:e.handleSubmit,cancel:e.handleCancel}},[a("a-spin",{attrs:{spinning:e.confirmLoading}},[a("a-form",{attrs:{form:e.form}},[a("a-tabs",{attrs:{activeKey:e.activeKey},on:{change:e.onChangeTabs}},[a("a-tab-pane",{key:e.RECHARGE_TYPE_BALANCE,attrs:{tab:"充值余额"}},[e.activeKey===e.RECHARGE_TYPE_BALANCE?[a("a-form-item",{staticClass:"mb-5",attrs:{label:"会员ID",labelCol:e.labelCol,wrapperCol:e.wrapperCol}},[a("span",[e._v(e._s(e.record.user_id))])]),a("a-form-item",{staticClass:"mb-5",attrs:{label:"当前余额",labelCol:e.labelCol,wrapperCol:e.wrapperCol}},[a("span",{staticClass:"c-p"},[e._v(e._s(e.record.balance))])]),a("a-form-item",{attrs:{label:"充值方式",labelCol:e.labelCol,wrapperCol:e.wrapperCol}},[a("a-radio-group",{directives:[{name:"decorator",rawName:"v-decorator",value:["".concat(e.RECHARGE_TYPE_BALANCE,".mode"),{initialValue:"inc",rules:[{required:!0}]}],expression:"[`${RECHARGE_TYPE_BALANCE}.mode`, { initialValue: 'inc', rules: [{ required: true }] }]"}]},[a("a-radio",{attrs:{value:"inc"}},[e._v("增加")]),a("a-radio",{attrs:{value:"dec"}},[e._v("减少")]),a("a-radio",{attrs:{value:"final"}},[e._v("最终金额")])],1)],1),a("a-form-item",{attrs:{label:"变更金额",labelCol:e.labelCol,wrapperCol:e.wrapperCol}},[a("a-input-number",{directives:[{name:"decorator",rawName:"v-decorator",value:["".concat(e.RECHARGE_TYPE_BALANCE,".money"),{initialValue:"",rules:[{required:!0,message:"请输入变更的金额"}]}],expression:"[`${RECHARGE_TYPE_BALANCE}.money`, { initialValue: '', rules: [{ required: true, message: '请输入变更的金额' }] }]"}],attrs:{min:.01}})],1),a("a-form-item",{attrs:{label:"管理员备注",labelCol:e.labelCol,wrapperCol:e.wrapperCol}},[a("a-textarea",{directives:[{name:"decorator",rawName:"v-decorator",value:["".concat(e.RECHARGE_TYPE_BALANCE,".remark"),{rules:[{required:!0,message:"请输入管理员备注"}]}],expression:"[`${RECHARGE_TYPE_BALANCE}.remark`, { rules: [{ required: true, message: '请输入管理员备注' }] }]"}],attrs:{placeholder:"请输入管理员备注",rows:3}})],1)]:e._e()],2),a("a-tab-pane",{key:e.RECHARGE_TYPE_POINTS,attrs:{tab:"充值积分"}},[e.activeKey===e.RECHARGE_TYPE_POINTS?[a("a-form-item",{staticClass:"mb-5",attrs:{label:"会员ID",labelCol:e.labelCol,wrapperCol:e.wrapperCol}},[a("span",[e._v(e._s(e.record.user_id))])]),a("a-form-item",{staticClass:"mb-5",attrs:{label:"当前积分",labelCol:e.labelCol,wrapperCol:e.wrapperCol}},[a("span",{staticClass:"c-p"},[e._v(e._s(e.record.points))])]),a("a-form-item",{attrs:{label:"充值方式",labelCol:e.labelCol,wrapperCol:e.wrapperCol}},[a("a-radio-group",{directives:[{name:"decorator",rawName:"v-decorator",value:["".concat(e.RECHARGE_TYPE_POINTS,".mode"),{initialValue:"inc",rules:[{required:!0}]}],expression:"[`${RECHARGE_TYPE_POINTS}.mode`, { initialValue: 'inc', rules: [{ required: true }] }]"}]},[a("a-radio",{attrs:{value:"inc"}},[e._v("增加")]),a("a-radio",{attrs:{value:"dec"}},[e._v("减少")]),a("a-radio",{attrs:{value:"final"}},[e._v("最终积分")])],1)],1),a("a-form-item",{attrs:{label:"变更数量",labelCol:e.labelCol,wrapperCol:e.wrapperCol}},[a("a-input-number",{directives:[{name:"decorator",rawName:"v-decorator",value:["".concat(e.RECHARGE_TYPE_POINTS,".value"),{initialValue:"",rules:[{required:!0,message:"请输入变更的金数量"}]}],expression:"[`${RECHARGE_TYPE_POINTS}.value`, { initialValue: '', rules: [{ required: true, message: '请输入变更的金数量' }] }]"}],attrs:{min:.01}})],1),a("a-form-item",{attrs:{label:"管理员备注",labelCol:e.labelCol,wrapperCol:e.wrapperCol}},[a("a-textarea",{directives:[{name:"decorator",rawName:"v-decorator",value:["".concat(e.RECHARGE_TYPE_POINTS,".remark"),{rules:[{required:!0,message:"请输入管理员备注"}]}],expression:"[`${RECHARGE_TYPE_POINTS}.remark`, { rules: [{ required: true, message: '请输入管理员备注' }] }]"}],attrs:{placeholder:"请输入管理员备注",rows:3}})],1)]:e._e()],2)],1)],1)],1)],1)},w=[],y="balance",E="points",R={components:{},data:function(){return{title:"会员充值",labelCol:{span:7},wrapperCol:{span:13},visible:!1,confirmLoading:!1,form:this.$form.createForm(this),activeKey:y,RECHARGE_TYPE_BALANCE:y,RECHARGE_TYPE_POINTS:E,record:{}}},methods:{handle:function(e){this.visible=!0,this.record=e},onChangeTabs:function(e){this.activeKey=e},handleSubmit:function(e){var a=this;e.preventDefault();var r=this.form.validateFields;r((function(e,r){!e&&a.onFormSubmit(r)}))},handleCancel:function(){this.visible=!1,this.form.resetFields()},onFormSubmit:function(e){var a=this,r=this.record,t=this.activeKey;this.confirmLoading=!0,o["d"]({userId:r.user_id,target:t,form:e}).then((function(r){a.$message.success(r.message,1.5),a.handleCancel(),a.$emit("handleSubmit",e)})).finally((function(){return a.confirmLoading=!1}))}}},A=R,S=(r("644d"),Object(b["a"])(A,g,w,!1,null,"2bace808",null)),T=S.exports,x=Object(l["c"])([{title:"会员ID",dataIndex:"user_id"},{title:"会员头像",dataIndex:"avatar_url",scopedSlots:{customRender:"avatar_url"}},{title:"昵称/手机号",scopedSlots:{customRender:"main_info"}},{title:"会员身份",dataIndex:"user_type_text"},{title:"会员等级",moduleKey:"user-grade",dataIndex:"grade",scopedSlots:{customRender:"grade"}},{title:"余额/积分",dataIndex:"balance",scopedSlots:{customRender:"balance"}},{title:"实际消费金额",dataIndex:"expend_money",scopedSlots:{customRender:"expend_money"}},{title:"注册来源",dataIndex:"platform",scopedSlots:{customRender:"platform"}},{title:"注册时间",dataIndex:"create_time"},{title:"操作",width:"180px",scopedSlots:{customRender:"action"}}]),L={name:"Index",components:{STable:c["d"],GradeForm:C,RechargeForm:T,PlatformIcon:u["a"]},data:function(){var e=this;return{searchForm:this.$form.createForm(this),queryParam:{},isLoading:!1,columns:x,loadData:function(a){return o["c"](Object(i["a"])(Object(i["a"])({},a),e.queryParam)).then((function(e){return e.data.list}))},gradeList:[]}},created:function(){this.getGradeList()},methods:{getGradeList:function(){var e=this;s["a"]().then((function(a){e.gradeList=a.data.list}))},handleGrade:function(e){this.$refs.GradeForm.handle(e)},handleRecharge:function(e){this.$refs.RechargeForm.handle(e)},handleDelete:function(e){var a=this,r=this.$confirm({title:"您确定要删除该记录吗?",content:"删除后不可恢复",onOk:function(){return o["a"]({userId:e.user_id}).then((function(e){a.$message.success(e.message,1.5),a.handleRefresh()})).finally((function(e){return r.destroy()}))}})},handleSearch:function(e){var a=this;e.preventDefault(),this.searchForm.validateFields((function(e,r){e||(a.queryParam=Object(i["a"])(Object(i["a"])({},a.queryParam),r),a.handleRefresh(!0))}))},handleRefresh:function(){var e=arguments.length>0&&void 0!==arguments[0]&&arguments[0];this.$refs.table.refresh(e)}}},P=L,N=(r("a315"),Object(b["a"])(P,t,n,!1,null,"12162ada",null));a["default"]=N.exports}}]);