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.6273baff.js

1 lines
15 KiB

(window["webpackJsonp"]=window["webpackJsonp"]||[]).push([["user"],{"0f0d":function(e,a,t){},"57af":function(e,a,t){"use strict";t("96e1")},"88bc":function(e,a,t){(function(a){var t=1/0,r=9007199254740991,n="[object Arguments]",i="[object Function]",o="[object GeneratorFunction]",l="[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,t){switch(t.length){case 0:return e.call(a);case 1:return e.call(a,t[0]);case 2:return e.call(a,t[0],t[1]);case 3:return e.call(a,t[0],t[1],t[2])}return e.apply(a,t)}function m(e,a){var t=-1,r=e?e.length:0,n=Array(r);while(++t<r)n[t]=a(e[t],t,e);return n}function f(e,a){var t=-1,r=a.length,n=e.length;while(++t<r)e[n+t]=a[t];return e}var p=Object.prototype,h=p.hasOwnProperty,v=p.toString,b=u.Symbol,_=p.propertyIsEnumerable,C=b?b.isConcatSpreadable:void 0,g=Math.max;function w(e,a,t,r,n){var i=-1,o=e.length;t||(t=A),n||(n=[]);while(++i<o){var l=e[i];a>0&&t(l)?a>1?w(l,a-1,t,r,n):f(n,l):r||(n[n.length]=l)}return n}function E(e,a){return e=Object(e),y(e,a,(function(a,t){return t in e}))}function y(e,a,t){var r=-1,n=a.length,i={};while(++r<n){var o=a[r],l=e[o];t(l,o)&&(i[o]=l)}return i}function R(e,a){return a=g(void 0===a?e.length-1:a,0),function(){var t=arguments,r=-1,n=g(t.length-a,0),i=Array(n);while(++r<n)i[r]=t[a+r];r=-1;var o=Array(a+1);while(++r<a)o[r]=t[r];return o[a]=i,d(e,this,o)}}function A(e){return L(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==-t?"-0":a}function T(e){return x(e)&&h.call(e,"callee")&&(!_.call(e,"callee")||v.call(e)==n)}var L=Array.isArray;function P(e){return null!=e&&k(e.length)&&!N(e)}function x(e){return I(e)&&P(e)}function N(e){var a=F(e)?v.call(e):"";return a==i||a==o}function k(e){return"number"==typeof e&&e>-1&&e%1==0&&e<=r}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)==l}var O=R((function(e,a){return null==e?{}:E(e,m(w(a,1),S))}));e.exports=O}).call(this,t("c8ba"))},"96e1":function(e,a,t){},dab6:function(e,a,t){"use strict";t.r(a);t("b0c0");var r=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(t,r){return a("a-select-option",{key:r,attrs:{value:t.grade_id}},[e._v(e._s(t.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,pagination:e.pagination},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:t("889b"),alt:"用户头像"}})])])}},{key:"main_info",fn:function(t){return a("span",{},[a("p",[e._v(e._s(t.nick_name))]),a("p",{staticClass:"c-p"},[e._v(e._s(t.mobile))])])}},{key:"grade",fn:function(t){return a("span",{},[t?a("a-tag",[e._v(e._s(t.name))]):a("span",[e._v("--")])],1)}},{key:"balance",fn:function(t,r){return a("span",{},[a("p",[a("span",[e._v("余额:")]),a("span",{staticClass:"c-p"},[e._v(e._s(t))])]),a("p",[a("span",[e._v("积分:")]),a("span",{staticClass:"c-p"},[e._v(e._s(r.points))])])])}},{key:"expend_money",fn:function(t){return a("span",{},[a("span",{staticClass:"c-p"},[e._v(e._s(t))])])}},{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(t){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(t)}}},[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(t)}}},[e._v("等级")]):e._e(),a("a",{directives:[{name:"action",rawName:"v-action:delete",arg:"delete"}],on:{click:function(a){return e.handleDelete(t)}}},[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=t("5530"),o=(t("d3b7"),t("fa04")),l=t("fab29"),s=t("2e1c"),c=t("2af9"),u=t("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(t,r){return a("a-select-option",{key:r,attrs:{value:t.id}},[e._v(e._s(t.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=[],f=t("88bc"),p=t.n(f),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(p()(e,["user_type"]))})),this.form.getFieldDecorator("grade_id",{initialValue:0,preserve:!0})},handleSubmit:function(e){var a=this;e.preventDefault();var t=this.form.validateFields;t((function(e,t){!e&&a.onFormSubmit(t)}))},handleCancel:function(){this.visible=!1,this.form.resetFields()},onFormSubmit:function(e){var a=this;this.confirmLoading=!0,l["b"]({userId:this.record.user_id,form:e}).then((function(t){a.$message.success(t.message,1.5),a.handleCancel(),a.$emit("handleSubmit",e)})).finally((function(){return a.confirmLoading=!1}))}}},v=h,b=(t("e007"),t("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=[],E="balance",y="points",R={components:{},data:function(){return{title:"会员充值",labelCol:{span:7},wrapperCol:{span:13},visible:!1,confirmLoading:!1,form:this.$form.createForm(this),activeKey:E,RECHARGE_TYPE_BALANCE:E,RECHARGE_TYPE_POINTS:y,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 t=this.form.validateFields;t((function(e,t){!e&&a.onFormSubmit(t)}))},handleCancel:function(){this.visible=!1,this.form.resetFields()},onFormSubmit:function(e){var a=this,t=this.record,r=this.activeKey;this.confirmLoading=!0,l["d"]({userId:t.user_id,target:r,form:e}).then((function(t){a.$message.success(t.message,1.5),a.handleCancel(),a.$emit("handleSubmit",e)})).finally((function(){return a.confirmLoading=!1}))}}},A=R,S=(t("57af"),Object(b["a"])(A,g,w,!1,null,"2bace808",null)),T=S.exports,L=Object(o["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:"余额/积分",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"}}]),P={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:L,loadData:function(a){return l["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,t=this.$confirm({title:"您确定要删除该记录吗?",content:"删除后不可恢复",onOk:function(){return l["a"]({userId:e.user_id}).then((function(e){a.$message.success(e.message,1.5),a.handleRefresh()})).finally((function(e){return t.destroy()}))}})},handleSearch:function(e){var a=this;e.preventDefault(),this.searchForm.validateFields((function(e,t){e||(a.queryParam=Object(i["a"])(Object(i["a"])({},a.queryParam),t),a.handleRefresh(!0))}))},handleRefresh:function(){var e=arguments.length>0&&void 0!==arguments[0]&&arguments[0];this.$refs.table.refresh(e)}}},x=P,N=(t("e232"),Object(b["a"])(x,r,n,!1,null,"0479cb85",null));a["default"]=N.exports},e007:function(e,a,t){"use strict";t("0f0d")},e232:function(e,a,t){"use strict";t("ecd2")},ecd2:function(e,a,t){}}]);