From 44dc9b070669f7f3608142e2d04f527a9d844943 Mon Sep 17 00:00:00 2001 From: zhengyiming <540361168@qq.com> Date: 星期一, 09 六月 2025 16:41:33 +0800 Subject: [PATCH] fix: v1.4 --- packages/core/src/lifeRechargeAccountModel.ts | 25 ++++++++++++++++++------- 1 files changed, 18 insertions(+), 7 deletions(-) diff --git a/packages/core/src/lifeRechargeAccountModel.ts b/packages/core/src/lifeRechargeAccountModel.ts index 42a4afc..001eebc 100644 --- a/packages/core/src/lifeRechargeAccountModel.ts +++ b/packages/core/src/lifeRechargeAccountModel.ts @@ -8,6 +8,11 @@ userId = ''; phoneNumber = ''; channlesNum = ''; + promoterIdNumber = ''; + + /**鐢ㄦ埛鎵�鏈夌殑娓犻亾 */ + userChannles = [] as ChannelOutput[]; + isBackClientUser: boolean; constructor( ctx: BlLifeRecharge<TResponse, TRequestOptions>, @@ -23,22 +28,23 @@ 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; + this.promoterIdNumber = res.promoterIdNumber; if (res && res.isBackClientUser) { this.setUserChannles(res.channlesNum ?? []); } @@ -57,7 +63,12 @@ this.ctx.listener.fireEvent('update', this.ctx); } setUserChannles(userChannles: ChannelOutput[]) { - this.ctx.userChannles = userChannles; + this.userChannles = userChannles; + this.ctx.listener.fireEvent('update', this.ctx); + } + + setUserPromoterIdNumber(promoterIdNumber: string) { + this.promoterIdNumber = promoterIdNumber; this.ctx.listener.fireEvent('update', this.ctx); } } -- Gitblit v1.9.1