Przeglądaj źródła

withdraw to ali

billyyoyo 5 lat temu
rodzic
commit
e83f97f78d

+ 1 - 1
app/src/main/java/com/sheep/gamegroup/view/activity/ActMyMoney.java

@@ -276,7 +276,7 @@ public class ActMyMoney extends BaseActivity {
                 TextView help2 = helpView.findViewById(R.id.help2);
                 TextView help3 = helpView.findViewById(R.id.help3);
                 TextView help4 = helpView.findViewById(R.id.help4);
-                help1.setText(Html.fromHtml("<strong>记账绵羊币:</strong>用户通过在平台做任务,获得奖励的绵羊币为记账绵羊币,该类型的绵羊币可提现到微信,也可以直接在平台消费。"));
+                help1.setText(Html.fromHtml("<strong>记账绵羊币:</strong>用户通过在平台做任务,获得奖励的绵羊币为记账绵羊币,该类型的绵羊币可提现,也可以直接在平台消费。"));
                 help2.setText(Html.fromHtml("<strong>虚拟绵羊币:</strong>用户通过在平台直接充值或是活动获得的绵羊币,为虚拟币充值比例1:1,<font color='#2ebff3'>根据国家法律虚拟币不可提现</font>,虚拟绵羊币仅用于平台消费。"));
                 help3.setText(Html.fromHtml("<strong>活动币:</strong>该货币是由游戏活动获得,使用范围和时间有限,需要在指定的游戏或商品消费。"));
                 help4.setText(Html.fromHtml("<strong>定向福利币:</strong>该货币是由平台活动获得,使用范围和时间有限,需要在指定的游戏或商品消费。"));

+ 47 - 14
app/src/main/java/com/sheep/gamegroup/view/activity/WithdrawalAct.java

@@ -54,8 +54,12 @@ public class WithdrawalAct extends BaseActivity implements WithdrawalContract.Vi
     GridView withdrawalGreidview;
     @BindView(R.id.withdrawal_sure)
     TextView withdrawalSure;
-    @BindView(R.id.weixin_name_tv)
-    TextView weixin_name_tv;
+    @BindView(R.id.withdraw_tip_tv)
+    TextView withdraw_tip_tv;
+    @BindView(R.id.cash_account_tv)
+    TextView cash_account_tv;
+    @BindView(R.id.cash_realname_tv)
+    TextView cash_realname_tv;
     @BindView(R.id.withdrawal_click_bindname_tv)
     TextView withdrawal_click_bindname_tv;
     @BindView(R.id.withdrawal_service_charge_tv)
@@ -72,6 +76,7 @@ public class WithdrawalAct extends BaseActivity implements WithdrawalContract.Vi
     private String amount;
     private int withdrawCount;
     private float balanceAmount;//余额
+    private String account, realname;
 
     private String fromToken;
 
@@ -88,14 +93,13 @@ public class WithdrawalAct extends BaseActivity implements WithdrawalContract.Vi
     @Override
     public void initView() {
         fromToken = getIntent().getStringExtra("fromToken");
-        if(TextUtils.isEmpty(fromToken)){
+        if (TextUtils.isEmpty(fromToken)) {
             fromToken = SpUtils.getToken(this);
         }
         activity = this;
         TitleBarUtils
                 .getInstance()
                 .setShowOrHide(this, true)
-                .setTitleBackgroud(this, R.color.bg_color)
                 .setTitle(activity, "提现")
                 .setTitleFinish(activity);
         DaggerWithdrawalComponent.builder()
@@ -152,10 +156,7 @@ public class WithdrawalAct extends BaseActivity implements WithdrawalContract.Vi
     }
 
     public void mInitData() {
-        CommonUtil.getInstance().getUserInfo(fromToken, entity->{
-            if (entity != null) {
-                ViewUtil.setText(weixin_name_tv, entity.getWx_nickname());
-            }
+        CommonUtil.getInstance().getUserInfo(fromToken, entity -> {
             setBalanceAmount();
         });
     }
@@ -164,10 +165,10 @@ public class WithdrawalAct extends BaseActivity implements WithdrawalContract.Vi
     public void onViewClicked(View view) {
         switch (view.getId()) {
             case R.id.withdrawal_sure:
-                ActPayPassword.verifyPwd(this, fromToken, "",(ret)->{
-                   if(!ret){
-                       doWithdrawal();
-                   }
+                ActPayPassword.verifyPwd(this, fromToken, "", (ret) -> {
+                    if (!ret) {
+                        doWithdrawal();
+                    }
                 });
                 break;
         }
@@ -175,6 +176,16 @@ public class WithdrawalAct extends BaseActivity implements WithdrawalContract.Vi
 
     //执行充值
     private void doWithdrawal() {
+        account = cash_account_tv.getText().toString();
+        realname = cash_realname_tv.getText().toString();
+        if (TextUtils.isEmpty(account)) {
+            G.showToast("请输入支付宝账号");
+            return;
+        }
+        if (TextUtils.isEmpty(account)) {
+            G.showToast("请输入支付宝真实姓名");
+            return;
+        }
         UMConfigUtils.Event.SHEEP_TIXIAN_COMMIT.onEvent();
         if (ListUtil.hasIndex(wlLists, select)) {
             amount = wlLists.get(select).getGridViewEntity().getValue();
@@ -182,10 +193,11 @@ public class WithdrawalAct extends BaseActivity implements WithdrawalContract.Vi
                 G.showToast("请选择金额");
                 return;
             }
-
             JSONObject jsonObject = new JSONObject();
             jsonObject.put("amount", Float.valueOf(amount));
-            jsonObject.put("type", 1);
+            jsonObject.put("type", 2);
+            jsonObject.put("account", account);
+//            jsonObject.put("realname", realname);
             showProgress();
             presenter.goWithdrawal(fromToken, jsonObject);
         } else {
@@ -229,6 +241,8 @@ public class WithdrawalAct extends BaseActivity implements WithdrawalContract.Vi
         JSONObject json = JSONObject.parseObject(baseMessage.getData().toString());
         balanceAmount = json.getFloat("amount");
         withdrawCount = json.getInteger("count");
+        account = json.getString("account");
+        realname = json.getString("real_name");
         setBalanceAmount();
         showWithdrawServiceCharge();
     }
@@ -254,6 +268,25 @@ public class WithdrawalAct extends BaseActivity implements WithdrawalContract.Vi
     private void setBalanceAmount() {
         String sr = "可提现金额 <font color='#ff2d4b'><big>" + NumberFormatUtils.retainMost2(balanceAmount) + "</big></font> 元";
         ViewUtil.setText(withdrawal_click_bindname_tv, Html.fromHtml(sr));
+        if (!TextUtils.isEmpty(account)) {
+            ViewUtil.setText(cash_account_tv, account);
+            ViewUtil.setEnabled(cash_account_tv, false);
+            ViewUtil.setText(withdraw_tip_tv, "已绑定支付宝账号");
+        } else {
+            ViewUtil.setText(withdraw_tip_tv, "注意:提现将绑定支付宝账号,一旦绑定将不能修改");
+        }
+        if (!TextUtils.isEmpty(realname)) {
+            ViewUtil.setEnabled(cash_realname_tv, false);
+            ViewUtil.setText(cash_realname_tv, realname);
+        } else {
+            ViewUtil.showConfirmDialog(this, "温馨提示", "提现需要先进行实名认证!", "取消", "去实名",
+                    (d) -> {
+                    },
+                    (d) -> {
+                        Jump2View.getInstance().goRealNameAuther(this, DataUtil.getInstance().getUserEntity(), RealNameAuthenAct.GO_WITHDRAWAL);
+                        finish();
+                    });
+        }
     }
 
     @Override

+ 6 - 0
app/src/main/res/drawable/shape_main_solid_rectangle.xml

@@ -0,0 +1,6 @@
+<?xml version="1.0" encoding="utf-8"?>
+<shape xmlns:android="http://schemas.android.com/apk/res/android"
+    android:shape="rectangle">
+    <corners android:radius="30dp" />
+    <solid android:color="#2ebef2" />
+</shape>

+ 76 - 50
app/src/main/res/layout/withdrawal_layout.xml

@@ -1,113 +1,139 @@
 <?xml version="1.0" encoding="utf-8"?>
 <LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
+    xmlns:app="http://schemas.android.com/apk/res-auto"
     android:layout_width="match_parent"
     android:layout_height="match_parent"
-    xmlns:app="http://schemas.android.com/apk/res-auto"
+    android:background="@color/bg_gray"
     android:fitsSystemWindows="true"
-    android:orientation="vertical"
-    android:background="@color/bg_gray">
+    android:orientation="vertical">
 
     <ScrollView
         android:layout_width="match_parent"
-        android:layout_height="wrap_content"
+        android:layout_height="match_parent"
         android:scrollbars="none">
+
         <LinearLayout
             android:layout_width="match_parent"
             android:layout_height="wrap_content"
             android:gravity="center_horizontal"
             android:orientation="vertical">
+
             <LinearLayout
                 android:layout_width="match_parent"
                 android:layout_height="wrap_content"
-                android:background="@drawable/x_shap_shadow_bg_rectgangle_white"
-                android:orientation="vertical"
+                android:layout_marginTop="@dimen/content_padding_15"
+                android:layout_marginBottom="@dimen/content_padding_15"
                 android:gravity="center_horizontal"
-                android:padding="@dimen/content_padding_20"
-                android:layout_margin="@dimen/content_padding_15">
-                <TextView
-                    android:layout_width="wrap_content"
-                    android:layout_height="wrap_content"
-                    android:text="当前的提现绑定微信号为"
-                    android:textColor="@color/txt_gray_929292"
-                    android:textSize="@dimen/text_size_12" />
+                android:orientation="vertical"
+                android:paddingTop="@dimen/content_padding_20"
+                android:paddingBottom="@dimen/content_padding_20">
+
                 <TextView
-                    android:id="@+id/weixin_name_tv"
-                    android:layout_width="wrap_content"
+                    android:id="@+id/withdraw_tip_tv"
+                    android:layout_width="match_parent"
                     android:layout_height="wrap_content"
-                    android:text="xuan"
-                    android:layout_marginTop="6dp"
-                    android:textSize="@dimen/text_size_3"
-                    android:textColor="@color/txt_black_404040"
-                    android:lines="1"
-                    android:ellipsize="end"
-                    android:maxWidth="@dimen/content_padding_120"/>
-                <TextView
-                    android:layout_width="0dp"
-                    android:layout_height="0.5dp"
-                    android:background="@color/white_bg_line"
-                    android:layout_marginTop="17dp"/>
+                    android:layout_marginBottom="15dp"
+                    android:layout_marginLeft="20dp"
+                    android:layout_marginRight="20dp"
+                    android:gravity="center"
+                    android:text="注意:若不绑定提现支付宝,可提现绵羊币无法转出。"
+                    android:textColor="#ff333333"
+                    android:textSize="13sp" />
+
+                <EditText
+                    android:id="@+id/cash_account_tv"
+                    android:layout_width="match_parent"
+                    android:layout_height="50dp"
+                    android:background="@color/white"
+                    android:hint="请输入支付宝账号"
+                    android:paddingLeft="20dp"
+                    android:paddingRight="20dp"
+                    android:textColor="@color/black_333333"
+                    android:textColorHint="@color/gray_CCCCCC"
+                    android:textSize="@dimen/text_size_15" />
+
+                <EditText
+                    android:id="@+id/cash_realname_tv"
+                    android:layout_width="match_parent"
+                    android:layout_height="50dp"
+                    android:layout_marginTop="1dp"
+                    android:background="@color/white"
+                    android:hint="请输入支付宝真实姓名"
+                    android:paddingLeft="20dp"
+                    android:paddingRight="20dp"
+                    android:enabled="false"
+                    android:textColor="@color/black_333333"
+                    android:textColorHint="@color/gray_CCCCCC"
+                    android:textSize="@dimen/text_size_15" />
 
                 <TextView
                     android:id="@+id/withdrawal_click_bindname_tv"
                     android:layout_width="wrap_content"
                     android:layout_height="wrap_content"
+                    android:layout_marginTop="37dp"
                     android:text="可提现金额20元"
                     android:textColor="@color/txt_gray_929292"
                     android:textSize="@dimen/text_size_12"
-                    android:layout_marginTop="@dimen/content_padding_20"
-                    android:visibility="visible"/>
+                    android:visibility="visible" />
+
                 <com.sheep.gamegroup.util.MyGridview
                     android:id="@+id/withdrawal_greidview"
-                    android:layout_height="wrap_content"
                     android:layout_width="wrap_content"
-                    android:gravity="center_horizontal"
-                    android:scrollbars="none"
-                    android:numColumns="3"
+                    android:layout_height="wrap_content"
+                    android:layout_marginLeft="20dp"
                     android:layout_marginTop="@dimen/content_padding_20"
-                    android:horizontalSpacing="@dimen/content_padding_13"
-                    android:visibility="visible"
+                    android:layout_marginRight="20dp"
                     android:background="@color/white"
-                    android:listSelector="@color/transparent"/>
+                    android:gravity="center_horizontal"
+                    android:horizontalSpacing="@dimen/content_padding_13"
+                    android:listSelector="@color/transparent"
+                    android:numColumns="3"
+                    android:scrollbars="none"
+                    android:visibility="visible" />
+
                 <TextView
                     android:id="@+id/withdrawal_service_charge_tv"
                     android:layout_width="match_parent"
                     android:layout_height="wrap_content"
+                    android:layout_marginLeft="20dp"
+                    android:layout_marginTop="@dimen/content_padding_20"
+                    android:layout_marginRight="20dp"
                     android:textColor="@color/txt_gray_929292"
                     android:textSize="@dimen/text_size_12"
-                    android:layout_marginTop="@dimen/content_padding_20"
-                    android:visibility="visible"/>
+                    android:visibility="visible" />
             </LinearLayout>
+
             <TextView
                 android:id="@+id/withdrawal_sure"
+                style="@style/txt_big_btn_style"
                 android:layout_width="match_parent"
                 android:layout_height="wrap_content"
-                style="@style/txt_big_btn_style"
-                android:text="确 定"
-                android:background="@drawable/selector_button_full_main"/>
+                android:background="@drawable/shape_main_solid_rectangle"
+                android:text="确 定" />
+
             <TextView
                 android:layout_width="wrap_content"
                 android:layout_height="wrap_content"
+                android:layout_gravity="center_horizontal"
                 android:text="正常工作时间2小时内到账"
-                app:layout_constraintRight_toRightOf="parent"
-                app:layout_constraintLeft_toLeftOf="parent"
                 android:textColor="@color/txt_gray_929292"
                 android:textSize="@dimen/text_size_1"
-                android:layout_gravity="center_horizontal"/>
+                app:layout_constraintLeft_toLeftOf="parent"
+                app:layout_constraintRight_toRightOf="parent" />
 
             <TextView
-                android:layout_marginTop="@dimen/content_padding_20"
                 android:layout_width="match_parent"
                 android:layout_height="wrap_content"
+                android:layout_gravity="center_horizontal"
                 android:layout_marginLeft="@dimen/content_padding"
+                android:layout_marginTop="@dimen/content_padding_20"
                 android:layout_marginRight="@dimen/content_padding"
                 android:lineSpacingExtra="8dp"
-                android:text="注意:\n1. 新用户提现,提现不超过50元,可免提现手续费2次\n2. 由于微信升级,提现将不再免费,每次提现收取1.5%微信提现手续费\n3. 提现所产生的税费由个人承担,且由个人自行向税务部门申报和缴纳"
+                android:text="注意:\n1. 新用户提现,提现不超过50元,可免提现手续费2次\n2. 提现每次提现收取1.5%提现手续费\n3. 提现所产生的税费由个人承担,且由个人自行向税务部门申报和缴纳"
                 android:textColor="@color/txt_gray_929292"
-                android:textSize="@dimen/text_size_1"
-                android:layout_gravity="center_horizontal"/>
+                android:textSize="@dimen/text_size_1" />
         </LinearLayout>
     </ScrollView>
 
 
-
 </LinearLayout>