| | |
| | | phoneNumber = ''; |
| | | channlesNum = ''; |
| | | |
| | | /**用户所有的渠道 */ |
| | | userChannles = [] as ChannelOutput[]; |
| | | isBackClientUser: boolean; |
| | | |
| | | constructor( |
| | | ctx: BlLifeRecharge<TResponse, TRequestOptions>, |
| | | options: BlLifeRechargeAccountModelOptions = {} |
| | |
| | | setUserId(userId: string) { |
| | | this.userId = userId; |
| | | this.ctx.listener.fireEvent('update', this.ctx); |
| | | if (userId) { |
| | | this.getUserInfo(userId); |
| | | } |
| | | // if (userId) { |
| | | // this.getUserInfo(userId); |
| | | // } |
| | | } |
| | | |
| | | async getUserInfo(userId: string) { |
| | | async getUserInfo(userId?: string) { |
| | | try { |
| | | let res = await this.ctx.services.lifePayUserMesssageByIduser( |
| | | { |
| | | id: userId, |
| | | id: userId || this.userId, |
| | | }, |
| | | { |
| | | showLoading: false, |
| | | } |
| | | ); |
| | | this.ctx.isBackClientUser = res.isBackClientUser; |
| | | this.isBackClientUser = res.isBackClientUser; |
| | | if (res && res.isBackClientUser) { |
| | | this.setUserChannles(res.channlesNum ?? []); |
| | | } |
| | |
| | | this.ctx.listener.fireEvent('update', this.ctx); |
| | | } |
| | | setUserChannles(userChannles: ChannelOutput[]) { |
| | | this.ctx.userChannles = userChannles; |
| | | this.userChannles = userChannles; |
| | | this.ctx.listener.fireEvent('update', this.ctx); |
| | | } |
| | | } |