Browse Source

修复绑定银行UI错误

Pq 3 years ago
parent
commit
e72f60578a

+ 16 - 10
BaseLibrary/src/main/res/layout/common_popu.xml

@@ -7,10 +7,9 @@
     android:orientation="vertical">
 
     <androidx.constraintlayout.widget.ConstraintLayout
+        android:paddingBottom="14dp"
         android:layout_width="match_parent"
         android:layout_height="wrap_content"
-        android:layout_marginStart="@dimen/dp_32"
-        android:layout_marginEnd="@dimen/dp_32"
         android:background="@drawable/bg_white_5dp">
 
 
@@ -28,10 +27,10 @@
             android:id="@+id/tv_title"
             android:layout_width="0dp"
             android:layout_height="wrap_content"
-            android:layout_marginStart="@dimen/dp_16"
+            android:layout_marginStart="@dimen/dp_7"
             android:layout_marginEnd="@dimen/dp_16"
             android:text="确定退课吗?"
-            android:textColor="@color/black_444"
+            android:textColor="@color/color_333333"
             android:textSize="@dimen/dp_18"
             android:textStyle="bold"
             app:layout_constraintBottom_toBottomOf="@id/iv_icon"
@@ -44,10 +43,13 @@
             android:layout_width="0dp"
             android:layout_height="wrap_content"
             android:layout_marginTop="@dimen/dp_22"
+            android:layout_marginEnd="14dp"
+            android:layout_marginStart="14dp"
             android:lineSpacingExtra="10dp"
             android:text=""
-            android:textColor="@color/black_444"
-            android:textSize="@dimen/dp_16"
+            tools:text="哈哈哈哈哈哈"
+            android:textColor="@color/color_666666"
+            android:textSize="@dimen/dp_14"
             app:layout_constraintEnd_toEndOf="@+id/tv_title"
             app:layout_constraintStart_toStartOf="@+id/iv_icon"
             app:layout_constraintTop_toBottomOf="@+id/iv_icon" />
@@ -79,8 +81,10 @@
         <TextView
             android:id="@+id/btn_cancel"
             android:layout_width="0dp"
-            android:layout_height="@dimen/dp_50"
-            android:background="@drawable/btn_gray_start_bottom_shape"
+            android:layout_height="@dimen/dp_44"
+            android:layout_marginStart="14dp"
+            android:layout_marginEnd="6dp"
+            android:background="@drawable/cancel_btn_bg"
             android:gravity="center"
             android:text="取消"
             android:textColor="@color/colorPrimaryStudent"
@@ -106,8 +110,10 @@
         <TextView
             android:id="@+id/btn_commit"
             android:layout_width="0dp"
-            android:layout_height="@dimen/dp_50"
-            android:background="@drawable/btn_green_end_bottom_shape"
+            android:layout_height="@dimen/dp_44"
+            android:layout_marginStart="6dp"
+            android:layout_marginEnd="14dp"
+            android:background="@drawable/sure_btn_bg"
             android:gravity="center"
             android:text="确定"
             android:textColor="@color/white"

+ 44 - 1
teacher/src/main/java/com/cooleshow/teacher/ui/income/WithdrawalActivity.java

@@ -13,6 +13,7 @@ import com.alibaba.android.arouter.launcher.ARouter;
 import com.cooleshow.base.router.RouterPath;
 import com.cooleshow.base.ui.activity.BaseMVPActivity;
 import com.cooleshow.base.utils.ToastUtils;
+import com.cooleshow.base.widgets.dialog.CommonDialog;
 import com.cooleshow.teacher.R;
 import com.cooleshow.teacher.bean.WithdrawalInfoBean;
 import com.cooleshow.teacher.contract.WithdrawalContract;
@@ -31,6 +32,9 @@ import io.rong.imkit.utils.StatusBarUtil;
  */
 @Route(path = RouterPath.IncomeCenter.TEACHER_MINE_WITHDRAWAL)
 public class WithdrawalActivity extends BaseMVPActivity<ActivityWithdrawalBinding, WithdrawalPresenter> implements WithdrawalContract.WithdrawalView, View.OnClickListener {
+
+    private CommonDialog mCommonDialog;
+
     @Override
     public void onClick(View view) {
         switch (view.getId()) {
@@ -117,7 +121,15 @@ public class WithdrawalActivity extends BaseMVPActivity<ActivityWithdrawalBindin
     @Override
     public void initData() {
         super.initData();
-        presenter.getWithdrawalInfo();
+
+    }
+
+    @Override
+    protected void onResume() {
+        super.onResume();
+        if (presenter != null) {
+            presenter.getWithdrawalInfo();
+        }
     }
 
     private WithdrawalInfoBean mWithdrawalInfo;
@@ -129,7 +141,38 @@ public class WithdrawalActivity extends BaseMVPActivity<ActivityWithdrawalBindin
         viewBinding.tvServiceFee.setText("单次收入结算时,平台将收取" + getTwoDecimal(data.withdrawalServiceFee) + "元手续费");
         if (null != data.userBankCard) {
             viewBinding.tvBankName.setText(data.userBankCard.bankName);
+            viewBinding.tvTip.setVisibility(View.VISIBLE);
+        } else {
+            viewBinding.tvBankName.setText("您未绑定银行卡");
+            viewBinding.tvTip.setVisibility(View.INVISIBLE);
+            showNotBindBankCardTip();
+        }
+    }
+
+    private void showNotBindBankCardTip() {
+        if (mCommonDialog == null) {
+            mCommonDialog = new CommonDialog(this);
         }
+        if (!mCommonDialog.isShowing()) {
+            mCommonDialog.show();
+        }
+        mCommonDialog.setTitle("绑定银行卡");
+        mCommonDialog.setContent("您需要先绑定银行卡后才能结算");
+        mCommonDialog.setOnConfirmClickListener(new View.OnClickListener() {
+            @Override
+            public void onClick(View v) {
+                ARouter.getInstance().build(RouterPath.MineCenter.MINE_MY_BANKCARD)
+                        .navigation();
+            }
+        });
+        mCommonDialog.setOnCancelClickListener(new View.OnClickListener() {
+            @Override
+            public void onClick(View v) {
+                if (mCommonDialog != null) {
+                    mCommonDialog.dismiss();
+                }
+            }
+        });
     }
 
     private String getTwoDecimal(double num) {

+ 7 - 1
teacher/src/main/java/com/cooleshow/teacher/ui/main/MineFragment.java

@@ -75,7 +75,7 @@ public class MineFragment extends BaseMVPFragment<FragmentMineLayoutBinding, Min
             mViewBinding.ratingBar.setVisibility(View.VISIBLE);
             mViewBinding.ratingBar.setRating(teacherUserInfo.starGrade);
             mViewBinding.tvNoScore.setVisibility(View.GONE);
-        } else if(TextUtils.equals(teacherUserInfo.entryStatus, TeacherInfoConstants.ENTRY_STATUS_PASS)){
+        } else if (TextUtils.equals(teacherUserInfo.entryStatus, TeacherInfoConstants.ENTRY_STATUS_PASS)) {
             mViewBinding.ratingBar.setVisibility(View.GONE);
             mViewBinding.tvNoScore.setVisibility(View.VISIBLE);
         }
@@ -123,6 +123,12 @@ public class MineFragment extends BaseMVPFragment<FragmentMineLayoutBinding, Min
             mViewBinding.ivTeacherMusicPersonTag.setVisibility(View.GONE);
             mViewBinding.tvMusicStatusTip.setText("审核未通过");
         }
+        //银行卡绑定状态
+        if (teacherUserInfo.isBank == 0) {
+            mViewBinding.tvBankCardBindTip.setText("未绑定");
+        } else {
+            mViewBinding.tvBankCardBindTip.setText("已绑定");
+        }
     }
 
     private void hintCertificationOtherView() {

+ 8 - 0
teacher/src/main/java/com/cooleshow/teacher/ui/mine/BindBankCardActivity.java

@@ -1,6 +1,7 @@
 package com.cooleshow.teacher.ui.mine;
 
 import android.content.Intent;
+import android.os.Bundle;
 import android.text.TextUtils;
 import android.view.View;
 import android.widget.TextView;
@@ -16,6 +17,7 @@ import com.bigkoo.pickerview.view.OptionsPickerView;
 import com.cooleshow.base.router.RouterPath;
 import com.cooleshow.base.ui.activity.BaseMVPActivity;
 import com.cooleshow.base.utils.ToastUtils;
+import com.cooleshow.base.utils.helper.QMUIStatusBarHelper;
 import com.cooleshow.teacher.R;
 import com.cooleshow.teacher.bean.ResponseBindCardBean;
 import com.cooleshow.teacher.bean.ResponseUserBankCardBean;
@@ -39,6 +41,12 @@ import java.util.List;
 public class BindBankCardActivity extends BaseMVPActivity<ActivityBindBankcardBinding, BindBankCardPresenter> implements BindBankCardContract.BindBankCardView, View.OnClickListener {
 
     @Override
+    protected void onCreate(@Nullable Bundle savedInstanceState) {
+        super.onCreate(savedInstanceState);
+        QMUIStatusBarHelper.setStatusBarLightMode(this);
+    }
+
+    @Override
     public void onClick(View view) {
         switch (view.getId()) {
             case R.id.tv_bind:

+ 11 - 1
teacher/src/main/java/com/cooleshow/teacher/ui/mine/BindCardSuccessActivity.java

@@ -1,15 +1,19 @@
 package com.cooleshow.teacher.ui.mine;
 
+import android.os.Bundle;
 import android.view.View;
 
 import com.alibaba.android.arouter.facade.annotation.Route;
 import com.cooleshow.base.router.RouterPath;
 import com.cooleshow.base.ui.activity.BaseMVPActivity;
+import com.cooleshow.base.utils.helper.QMUIStatusBarHelper;
 import com.cooleshow.teacher.R;
 import com.cooleshow.teacher.contract.BindCardSuccessContract;
 import com.cooleshow.teacher.databinding.ActivityBindCardSuccessBinding;
 import com.cooleshow.teacher.presenter.mine.BindCardSuccessPresenter;
 
+import androidx.annotation.Nullable;
+
 /**
  * 创建日期:2022/5/19 14:35
  *
@@ -20,8 +24,14 @@ import com.cooleshow.teacher.presenter.mine.BindCardSuccessPresenter;
 public class BindCardSuccessActivity extends BaseMVPActivity<ActivityBindCardSuccessBinding, BindCardSuccessPresenter> implements BindCardSuccessContract.BindCardSuccessView, View.OnClickListener {
 
     @Override
+    protected void onCreate(@Nullable Bundle savedInstanceState) {
+        super.onCreate(savedInstanceState);
+        QMUIStatusBarHelper.setStatusBarLightMode(this);
+    }
+
+    @Override
     public void onClick(View view) {
-        switch (view.getId()){
+        switch (view.getId()) {
             case R.id.tv_i_know:
                 finish();
                 break;

+ 1 - 0
teacher/src/main/res/layout/activity_withdrawal.xml

@@ -51,6 +51,7 @@
             app:layout_constraintTop_toTopOf="parent" />
 
         <TextView
+            android:id="@+id/tv_tip"
             android:layout_width="wrap_content"
             android:layout_height="wrap_content"
             android:layout_marginTop="2dp"

+ 12 - 0
teacher/src/main/res/layout/fragment_mine_layout.xml

@@ -442,6 +442,18 @@
 
 
             <TextView
+                android:id="@+id/tv_bank_card_bind_tip"
+                android:layout_width="wrap_content"
+                android:layout_height="18dp"
+                android:layout_marginEnd="25dp"
+                android:text="@string/no_bind_bank_card_tip"
+                android:textColor="@color/color_999999"
+                android:textSize="@dimen/sp_13"
+                app:layout_constraintBottom_toBottomOf="@+id/tv_authentication"
+                app:layout_constraintRight_toRightOf="@+id/tv_authentication"
+                app:layout_constraintTop_toTopOf="@+id/tv_authentication" />
+
+            <TextView
                 android:id="@+id/tv_network_monitoring"
                 style="@style/me_btn_style"
                 android:drawableLeft="@drawable/icon_net_check"

+ 1 - 0
teacher/src/main/res/values/strings.xml

@@ -47,4 +47,5 @@
     <string name="goto_create">去创建</string>
     <string name="confirm_unbind">确认解绑</string>
     <string name="search">搜索</string>
+    <string name="no_bind_bank_card_tip">未绑定</string>
 </resources>