chendeben 1 год назад
Родитель
Сommit
b8521122b5
1 измененных файлов с 3 добавлено и 96 удалено
  1. 3 96
      entry/src/main/ets/pages/UserCenter.ets

+ 3 - 96
entry/src/main/ets/pages/UserCenter.ets

@@ -264,7 +264,7 @@ export struct UserCenter {
     let fromSyncNoble = params && params['fromSyncNoble'] === true;
     if (fromSyncNoble) {
       // 自动弹出登录框
-      this.showLoginDialog();
+      this.huaweiQuickLogin();
     } else if (!this.isLogin && Utility.isNobleForOld()) {
       DialogHelper.showCustomContentDialog({
         dialogId: 'syncNobleDialog',
@@ -277,7 +277,7 @@ export struct UserCenter {
           {
             value: '去登录',
             action: () => {
-              this.showLoginDialog();
+              this.huaweiQuickLogin();
             }
           }
         ]
@@ -451,7 +451,7 @@ export struct UserCenter {
       }
       .onClick(() => {
         if (!this.isLogin) {
-          this.showLoginDialog();
+          this.huaweiQuickLogin();
         }
       })
       .width('100%')
@@ -468,99 +468,6 @@ export struct UserCenter {
     })
   }
 
-  // 登录方式选择弹窗内容
-  @Builder
-  loginDialogContentBuilder(): void {
-    Column() {
-      Row() {
-        // 微信登录图标按钮
-        Column() {
-          Button({ type: ButtonType.Normal, stateEffect: true }) {
-            Column() {
-              Image($r('app.media.wx_logo'))
-                .width(56)
-                .height(56)
-                .margin({ bottom: 8 })
-              Text('微信登录')
-                .fontSize(15)
-                .fontWeight(FontWeight.Bold)
-                .fontColor('#333')
-            }
-            .alignItems(HorizontalAlign.Center)
-          }
-          .width(100)
-          .height(100)
-          .visibility(PreferencesUtil.getBooleanSync('isShowWX',false)?Visibility.Visible:Visibility.None)
-          .backgroundColor(Color.White)
-          // .border({ color: this.themeColor, width: 2 })
-          .borderRadius(20)
-          .onClick(async () => {
-            this.payType = 0;
-            // 微信登录
-            let req = new wxopensdk.SendAuthReq
-            req.isOption1 = false
-            req.nonAutomatic = true
-            req.scope = 'snsapi_userinfo,snsapi_friend,snsapi_message,snsapi_contact'
-            req.state = 'none'
-            req.transaction = 'test123'
-            let finished = await this.wxApi.sendReq(getContext(this) as common.UIAbilityContext, req)
-            console.log('send request finished: ', finished)
-            DialogHelper.closeDialog('loginDialog');
-          })
-        }
-        .margin({ right: 24 })
-
-        // 华为账号登录图标按钮
-        Column() {
-          Button({ type: ButtonType.Normal, stateEffect: true }) {
-            Column() {
-              Image($r('app.media.huawei'))
-                .width(56)
-                .height(56)
-                .margin({ bottom: 8 })
-              Text('华为登录')
-                .fontSize(15)
-                .fontWeight(FontWeight.Bold)
-                .fontColor('#333')
-            }
-            .alignItems(HorizontalAlign.Center)
-          }
-          .width(100)
-          .height(100)
-          .backgroundColor(Color.White)
-          // .border({ color: this.themeColor, width: 2 })
-          .borderRadius(20)
-          .onClick(() => {
-            this.payType = 1;
-            this.huaweiQuickLogin();
-            DialogHelper.closeDialog('loginDialog');
-          })
-        }
-      }
-      .justifyContent(FlexAlign.Center)
-      .width('100%')
-    }
-    .padding({
-      left: 24,
-      right: 24,
-      top: 8,
-      bottom: 24
-    })
-    .width('100%')
-  }
-
-  showLoginDialog() {
-    DialogHelper.showCustomContentDialog({
-      dialogId: 'loginDialog',
-      title: '',
-      autoCancel: true,
-      contentBuilder: () => {
-        this.loginDialogContentBuilder();
-      },
-      buttons: []
-    });
-  }
-
   // 会员权益展示
   @Builder
   buildVipFeatures(): void {