1 |
- (global["webpackJsonp"]=global["webpackJsonp"]||[]).push([["pages/app_admin/user/user"],{"846e":function(t,e,r){"use strict";(function(t){r("8748");i(r("66fd"));var e=i(r("fcfd"));function i(t){return t&&t.__esModule?t:{default:t}}t(e.default)}).call(this,r("543d")["createPage"])},a4e0:function(t,e,r){"use strict";var i=r("e8b0"),s=r.n(i);s.a},aeeb:function(t,e,r){"use strict";var i,s=function(){var t=this,e=t.$createElement;t._self._c;t._isMounted||(t.e0=function(e){t.getFocus=!0},t.e1=function(e){e.stopPropagation(),t.modifyStoreBool=!1},t.e2=function(e){t.modifyStoreBool=!1})},a=[];r.d(e,"b",(function(){return s})),r.d(e,"c",(function(){return a})),r.d(e,"a",(function(){return i}))},b2ad:function(t,e,r){"use strict";r.r(e);var i=r("b62e"),s=r.n(i);for(var a in i)"default"!==a&&function(t){r.d(e,t,(function(){return i[t]}))}(a);e["default"]=s.a},b62e:function(t,e,r){"use strict";(function(t){Object.defineProperty(e,"__esModule",{value:!0}),e.default=void 0;var i=s(r("4795"));function s(t){return t&&t.__esModule?t:{default:t}}function a(t){return u(t)||h(t)||n(t)||o()}function o(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}function n(t,e){if(t){if("string"===typeof t)return c(t,e);var r=Object.prototype.toString.call(t).slice(8,-1);return"Object"===r&&t.constructor&&(r=t.constructor.name),"Map"===r||"Set"===r?Array.from(r):"Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r)?c(t,e):void 0}}function h(t){if("undefined"!==typeof Symbol&&Symbol.iterator in Object(t))return Array.from(t)}function u(t){if(Array.isArray(t))return c(t)}function c(t,e){(null==e||e>t.length)&&(e=t.length);for(var r=0,i=new Array(e);r<e;r++)i[r]=t[r];return i}function l(t,e,r,i,s,a,o){try{var n=t[a](o),h=n.value}catch(u){return void r(u)}n.done?e(h):Promise.resolve(h).then(i,s)}function d(t){return function(){var e=this,r=arguments;return new Promise((function(i,s){var a=t.apply(e,r);function o(t){l(a,i,s,o,n,"next",t)}function n(t){l(a,i,s,o,n,"throw",t)}o(void 0)}))}}var m={name:"user-admin",data:function(){return{getFocus:!1,active:0,search:!0,error:!1,keyword:"",status:"",page:1,over:!1,list:[],memberLevel:null,storeList:[],rechargeBool:!1,placeholder:"积分",rechargeStatus:0,num:null,remark_name:null,remark:null,rechargeItem:{},rechargeDeduction:0,modifyStoreBool:!1,storeItem:{},storeIndex:-1,storeUser:{},sort:0,dialog:!1,dialogChoose:!0,changeRemark:!1,changeMember:!1,releaseBool:!1,member:[],deleteObject:{}}},onLoad:function(){var t=this;this.$request({url:this.$api.app_admin.user,data:{page:this.page,status:this.status,keyword:this.keyword}}).then((function(e){0===e.code&&(t.list=e.data.list,t.member=e.data.mall_members)}))},onReachBottom:function(){this.over||(this.page++,this.threeRequest(this.active))},methods:{request:function(t){var e=this;return d(i.default.mark((function r(){var s,a,o;return i.default.wrap((function(r){while(1)switch(r.prev=r.next){case 0:return s=t.url,a=t.data,r.next=3,e.$request({url:s,data:a});case 3:if(o=r.sent,0!==o.code){r.next=11;break}if(!(o.data.list.length>0)){r.next=9;break}return r.abrupt("return",o.data);case 9:return e.over=!0,r.abrupt("return",!1);case 11:case"end":return r.stop()}}),r)})))()},clearSearch:function(){console.log(2),this.keyword="",this.keywordSearch()},chooseMember:function(t){this.memberLevel=t},toChangeInfo:function(t){this.dialog=!this.dialog,this.changeRemark=!1,this.dialogChoose=!0,this.changeMember=!1,this.remark_name=null,this.rechargeItem=t||{}},toChangeRemark:function(){this.dialogChoose=!1,this.changeRemark=!0,this.remark_name=this.rechargeItem.remark_name},toChangeMember:function(){this.dialogChoose=!1,this.member.length>0?(this.changeMember=!0,this.memberLevel=this.rechargeItem.member_level):this.error=!0},close:function(){this.error=!1,this.dialog=!1},toLevel:function(){var e=this;this.$request({url:this.$api.app_admin.level,method:"post",data:{id:this.rechargeItem.user_id,member_level:this.memberLevel}}).then((function(r){0==r.code?(e.toChangeInfo(),e.setActive(0)):t.showToast({title:r.msg,icon:"none",duration:1e3})}))},toRemark:function(){var e=this;this.$request({url:this.$api.app_admin.remarkName,method:"post",data:{id:this.rechargeItem.user_id,remark_name:this.remark_name}}).then((function(r){0==r.code?(e.rechargeItem.remark_name=e.remark_name,e.toChangeInfo()):t.showToast({title:r.msg,icon:"none",duration:1e3})}))},setSearch:function(){this.search=!1},setActive:function(t){console.log(t),this.list=[],this.page=1,this.over=!1,this.keyword="",this.sort=0,this.threeRequest(t),this.active=t,this.search=!0},threeRequest:function(t){var e=this;0===t?this.request({url:this.$api.app_admin.user,data:{page:this.page,status:"",keyword:this.keyword}}).then((function(t){!1!==t&&(e.list=[].concat(a(e.list),a(t.list)))})):1===t?this.request({url:this.$api.app_admin.share,data:{page:this.page,status:1,keyword:this.keyword,sort:this.sort}}).then((function(t){!1!==t&&(e.list=[].concat(a(e.list),a(t.list)))})):2===t&&this.request({url:this.$api.app_admin.clerk,data:{page:this.page,status:"",keyword:this.keyword,sort:this.sort}}).then((function(t){!1!==t&&(e.list=[].concat(a(e.list),a(t.list)),e.storeList=t.store_list)}))},inputBlur:function(){var t=this;setTimeout((function(e){t.getFocus=!1,""===t.keyword&&(t.search=!0)}),300)},setRechargeDeduction:function(t,e){this.rechargeItem=t,this.rechargeBool=!0,this.rechargeDeduction=e},activeRecharge:function(t){this.rechargeStatus=t,this.placeholder=0===t?"积分":"余额"},clearStatus:function(){this.rechargeStatus=0,this.rechargeItem={},this.rechargeBool=!1,this.rechargeDeduction=0,this.num=null,this.remark=null},cancelRecharge:function(){this.rechargeBool=!1,this.clearStatus()},intergral:function(e,r){var i=this;this.$request({url:this.$api.app_admin.integral,method:"post",data:{user_id:this.rechargeItem.user_id,num:e,remark:this.remark,type:r}}).then((function(r){0===r.code?(1===i.rechargeDeduction?i.setList("integral",e,1):i.setList("integral",e,0),i.clearStatus()):1===r.code&&t.showToast({title:r.msg,image:"../image/mark.png"})}))},balance:function(e,r){var i=this;this.$request({url:this.$api.app_admin.balance,method:"post",data:{user_id:this.rechargeItem.user_id,price:e,remark:this.remark,type:r}}).then((function(r){0===r.code?(1===i.rechargeDeduction?i.setList("balance",e,1):i.setList("balance",e,0),i.clearStatus()):1===r.code&&t.showToast({title:r.msg,image:"../image/mark.png"})}))},setList:function(t,e,r){var i=this;this.list.map((function(s){s.user_id===i.rechargeItem.user_id&&(s[t]=0===r?Number(s[t])-e:Number(s[t])+e)}))},confirmRecharge:function(){isNaN(this.num)||(1===this.rechargeDeduction&&0===this.rechargeStatus?this.intergral(Number(this.num),1):1===this.rechargeDeduction&&1===this.rechargeStatus?this.balance(Number(this.num),1):0===this.rechargeDeduction&&0===this.rechargeStatus?this.intergral(Number(this.num),0):0===this.rechargeDeduction&&1===this.rechargeStatus&&this.balance(Number(this.num),0))},modifyStore:function(t){this.storeUser=t,this.storeItem=t.store[0];for(var e=0;e<this.storeList.length;e++)this.storeItem.id===this.storeList[e].id&&(this.storeIndex=e);this.modifyStoreBool=!0},pickerChange:function(t){this.storeIndex=t.detail.value[0],console.log(t)},dismissal:function(t){this.deleteObject=t,this.releaseBool=!0},determineStore:function(){var t=this;this.$request({url:this.$api.app_admin.clerk_edit,method:"post",data:{user_id:this.storeUser.user_id,store_id:this.storeList[this.storeIndex].id,id:this.storeUser.id}}).then((function(e){0===e.code&&t.$nextTick().then((function(){for(var e=0;e<t.list.length;e++)t.list[e].user.id===t.storeUser.user_id&&(t.list[e].store[0]=t.storeList[t.storeIndex],t.storeIndex=-1,t.storeUser={},t.modifyStoreBool=!1,t.storeItem={})}))}))},allSort:function(e){var r,i=this;this.over=!1,this.page=1,t.pageScrollTo({scrollTop:0}),0===e?1===this.sort?this.sort=2:this.sort=1:1===e&&(3===this.sort?this.sort=4:this.sort=3),2==this.sort?r="price_count_desc":1==this.sort?r="price_count_asc":4==this.sort?r="order_count_desc":3==this.sort&&(r="order_count_asc"),this.$request({url:this.$api.app_admin.user,data:{page:1,keyword:this.keyword,status:"",sort:r}}).then((function(t){0===t.code&&(i.list=t.data.list)}))},setSort:function(e){var r=this;this.over=!1,this.page=1,t.pageScrollTo({scrollTop:0}),0===e?1===this.sort?this.sort=2:this.sort=1:1===e?3===this.sort?this.sort=4:this.sort=3:2===e&&(5===this.sort?this.sort=6:this.sort=5),this.$request({url:this.$api.app_admin.clerk,data:{page:1,keyword:this.keyword,status:"",sort:this.sort}}).then((function(t){0===t.code&&(r.list=t.data.list)}))},cancelUndelete:function(){this.releaseBool=!1,this.deleteObject={}},sureDeletion:function(){var t=this;this.$request({url:this.$api.app_admin.clerk_destroy,method:"post",data:{id:this.deleteObject.id}}).then((function(e){0===e.code&&(t.list.map((function(e,r){e.id===t.deleteObject.id&&t.$delete(t.list,r)})),t.deleteObject={},t.releaseBool=!1)}))},keywordSearch:function(){var t=this;this.page=1,this.over=!1,0===this.active?this.request({url:this.$api.app_admin.user,data:{page:this.page,status:"",keyword:this.keyword}}).then((function(e){if(!1===e)return t.list=[];t.list=e.list})):1===this.active?this.request({url:this.$api.app_admin.share,data:{page:this.page,status:1,keyword:this.keyword}}).then((function(e){if(!1===e)return t.list=[];t.list=e.list})):2===this.active&&this.request({url:this.$api.app_admin.clerk,data:{page:this.page,status:"",keyword:this.keyword,sort:this.sort}}).then((function(e){if(!1===e)return t.list=[];t.list=e.list}))},distributorSort:function(e){var r=this;this.over=!1,this.page=1,t.pageScrollTo({scrollTop:0}),0===e?1===this.sort?this.sort=2:this.sort=1:3===this.sort?this.sort=4:this.sort=3,this.$request({url:this.$api.app_admin.share,data:{page:1,keyword:this.keyword,status:1,sort:this.sort}}).then((function(t){0===t.code&&(r.list=t.data.list)}))}}};e.default=m}).call(this,r("543d")["default"])},e8b0:function(t,e,r){},fcfd:function(t,e,r){"use strict";r.r(e);var i=r("aeeb"),s=r("b2ad");for(var a in s)"default"!==a&&function(t){r.d(e,t,(function(){return s[t]}))}(a);r("a4e0");var o,n=r("f0c5"),h=Object(n["a"])(s["default"],i["b"],i["c"],!1,null,"f5eb9ea0",null,!1,i["a"],o);e["default"]=h.exports}},[["846e","common/runtime","common/vendor"]]]);
|