zengjiebin лет назад: 8
Родитель
Сommit
e23e7692c8

+ 6 - 0
app/src/main/java/com/kfzs/duanduan/utils/NumberFormatUtils.java

@@ -36,4 +36,10 @@ public class NumberFormatUtils {
 
         return result.floatValue();
     }
+
+    public static double decimal(double val, int newScale){
+        BigDecimal   b   =   new   BigDecimal(val);
+        double   f1   =   b.setScale(newScale,   BigDecimal.ROUND_HALF_UP).doubleValue();
+        return f1;
+    }
 }

+ 3 - 3
app/src/main/java/com/sheep/gamegroup/model/entity/WXOnHookAccount.java

@@ -14,7 +14,7 @@ public class WXOnHookAccount {
     private String verification_code;
     private int status;
     private String customer_service;
-    private int money;
+    private double money;
     private String remarks;
     private int normal_time;
     private long create_time;
@@ -127,11 +127,11 @@ public class WXOnHookAccount {
         return device_info;
     }
 
-    public void setMoney(int money) {
+    public void setMoney(double money) {
         this.money = money;
     }
 
-    public int getMoney() {
+    public double getMoney() {
         return money;
     }
 

+ 35 - 17
app/src/main/java/com/sheep/gamegroup/view/adapter/LieMakeMoneyAdp.java

@@ -13,12 +13,14 @@ import com.sheep.gamegroup.model.entity.WXOnHookAccount;
 import com.sheep.gamegroup.util.Jump2View;
 import com.sheep.gamegroup.util.ViewHolder;
 import com.sheep.gamegroup.view.activity.CommitWxCodeAct;
+import com.sheep.gamegroup.view.activity.LieMakeMoneyAct;
 import com.sheep.gamegroup.view.dialog.DialogAccountAbnormal;
 import com.sheep.jiuyan.samllsheep.BuildConfig;
 import com.sheep.jiuyan.samllsheep.R;
 import com.sheep.jiuyan.samllsheep.utils.G;
 
 import java.util.List;
+import java.util.Locale;
 
 import static com.sheep.gamegroup.view.activity.LieMakeMoneyAct.STATE_ON_HOOK_ABNORMAL;
 import static com.sheep.gamegroup.view.activity.LieMakeMoneyAct.STATE_ON_HOOK_BLOCKED;
@@ -97,7 +99,7 @@ public class LieMakeMoneyAdp extends AdbCommonRecycler<RecyleObj> {
         TextView weixin_name_tv = holder.getView(R.id.weixin_name_tv);
         TextView earnings_money_tv = holder.getView(R.id.earnings_money_tv);
         weixin_name_tv.setText(dataObjT.getAccount());
-        earnings_money_tv.setText(dataObjT.getMoney());
+        earnings_money_tv.setText(String.format(Locale.CHINA,"%.2f",dataObjT.getMoney()));
     }
 
     private void bindAbnormalOnHook(ViewHolder holder, WXOnHookAccount dataObjT) {
@@ -105,35 +107,42 @@ public class LieMakeMoneyAdp extends AdbCommonRecycler<RecyleObj> {
         TextView wx_is_open_tv = holder.getView(R.id.wx_is_open_tv);
         TextView earnings_name_tv = holder.getView(R.id.earnings_name_tv);
         weixin_name_tv.setText(dataObjT.getAccount());
-        if(TextUtils.isEmpty(dataObjT.getRemarks())){
-            wx_is_open_tv.setText("账号异常,请联系客服");
-        } else {
-            wx_is_open_tv.setText(dataObjT.getRemarks());
-        }
+//        if(TextUtils.isEmpty(dataObjT.getRemarks())){
+//            wx_is_open_tv.setText("账号异常,请联系客服");
+//        } else {
+//            wx_is_open_tv.setText(dataObjT.getRemarks());
+//        }
         switch (dataObjT.getStatus()) {
             case STATE_ON_HOOK_NEED_VC://需要用户验证码
-                earnings_name_tv.setText("需要用户验证码");
+                earnings_name_tv.setText("需要验证码");
+                wx_is_open_tv.setText("提交验证码");
                 break;
             case STATE_ON_HOOK_BLOCKED://被封
-                earnings_name_tv.setText("账号被封");
+                earnings_name_tv.setText("账号封禁");
+                wx_is_open_tv.setText("了解解封");
                 break;
             case STATE_ON_HOOK_DEBLOCKED://用户已经解封等待脚本验证
-                earnings_name_tv.setText("等待服务器验证");
+                earnings_name_tv.setText("等待验证");
+                wx_is_open_tv.setText("刷新看看");
                 break;
             case STATE_ON_HOOK_ABNORMAL://账号异常
                 earnings_name_tv.setText("账号异常");
+                wx_is_open_tv.setText("修改账号");
                 break;
             case STATE_ON_HOOK_VC_OVERTIME://验证码超时请重新上传
                 earnings_name_tv.setText("验证码超时");
+                wx_is_open_tv.setText("提交验证码");
                 break;
             case STATE_ON_HOOK_VERIFIED://用户已经验证等待脚本验证
-                earnings_name_tv.setText("等待服务器验证");
+                earnings_name_tv.setText("等待验证");
+                wx_is_open_tv.setText("刷新看看");
                 break;
             default:
-                earnings_name_tv.setText("账号异常");
+                earnings_name_tv.setText("账号异常,请联系客服");
+                wx_is_open_tv.setText("修改账号");
                 break;
         }
-        //TODO 各种状态用户可以进行不同的操作
+        // 各种状态用户可以进行不同的操作
         wx_is_open_tv.setOnClickListener(view -> {
             switch (dataObjT.getStatus()) {
                 case STATE_ON_HOOK_NEED_VC://需要用户验证码
@@ -141,10 +150,6 @@ public class LieMakeMoneyAdp extends AdbCommonRecycler<RecyleObj> {
                     //修改验证码
                     Jump2View.getInstance().goCommitWxCodeOnHookView(this.context, dataObjT, CommitWxCodeAct.ALTER_CODE);
                     break;
-                case STATE_ON_HOOK_ABNORMAL://账号异常
-                    //修改用户信息
-                    Jump2View.getInstance().goCommitWxCodeOnHookView(this.context, dataObjT, CommitWxCodeAct.ALTER_INFO);
-                    break;
                 case STATE_ON_HOOK_BLOCKED://被封
                     if (context instanceof Activity){
                         DialogAccountAbnormal.showDialog((Activity) context);
@@ -154,11 +159,24 @@ public class LieMakeMoneyAdp extends AdbCommonRecycler<RecyleObj> {
                     break;
                 case STATE_ON_HOOK_DEBLOCKED://用户已经解封等待脚本验证
                 case STATE_ON_HOOK_VERIFIED://用户已经验证等待脚本验证
+                    if(this.context instanceof LieMakeMoneyAct) {
+                        clear();
+                        notifyDataSetChanged();
+                        ((LieMakeMoneyAct) this.context).initData();
+                    }else
+                        G.showToast("请等待或者联系客服:"+dataObjT.getCustomer_service());
+                    break;
+                case STATE_ON_HOOK_ABNORMAL://账号异常
                 default:
-                    G.showToast("请等待或者联系客服:"+dataObjT.getCustomer_service());
+                    //修改用户信息
+                    Jump2View.getInstance().goCommitWxCodeOnHookView(this.context, dataObjT, CommitWxCodeAct.ALTER_INFO);
                     break;
             }
         });
+        //测试
+        if(BuildConfig.DEBUG){
+            earnings_name_tv.setOnClickListener(view -> G.showToast("备注:"+dataObjT.getRemarks()));
+        }
     }
 
     @Override

+ 25 - 22
app/src/main/res/layout/lie_make_money_abnormal_item.xml

@@ -33,30 +33,33 @@
         app:layout_constraintTop_toBottomOf="@+id/weixin_number_tv"
         app:layout_constraintLeft_toLeftOf="@+id/weixin_number_tv"
         android:layout_marginTop="@dimen/content_padding_10" />
-
-    <TextView
-        android:id="@+id/wx_is_open_tv"
-        android:layout_width="wrap_content"
-        android:layout_height="wrap_content"
-        android:background="@drawable/shape_btn_wx_is_open"
-        android:paddingTop="5dp"
-        android:paddingBottom="5dp"
-        android:paddingLeft="8dp"
-        android:paddingRight="8dp"
-        android:text="已解封,继续赚钱"
-        android:textColor="@color/txt_black_cc444444"
-        android:textSize="@dimen/text_size_2"
-        app:layout_constraintBaseline_toBaselineOf="@+id/weixin_name_tv"
-        app:layout_constraintRight_toRightOf="parent" />
-    <TextView
-        android:id="@+id/earnings_name_tv"
-        style="@style/nomal_txt_style"
+    <LinearLayout
         android:layout_width="wrap_content"
         android:layout_height="wrap_content"
-        android:text="账号封禁"
-        app:layout_constraintBaseline_toBaselineOf="@+id/weixin_number_tv"
-        app:layout_constraintStart_toStartOf="@id/wx_is_open_tv"
-        app:layout_constraintEnd_toEndOf="@id/wx_is_open_tv" />
+        android:orientation="vertical"
+        android:gravity="center"
+        app:layout_constraintBottom_toBottomOf="parent"
+        app:layout_constraintRight_toRightOf="parent">
+        <TextView
+            android:id="@+id/earnings_name_tv"
+            style="@style/nomal_txt_style"
+            android:layout_width="wrap_content"
+            android:layout_height="wrap_content"
+            android:text="账号封禁" />
+        <TextView
+            android:id="@+id/wx_is_open_tv"
+            android:layout_width="wrap_content"
+            android:layout_height="wrap_content"
+            android:background="@drawable/shape_btn_wx_is_open"
+            android:paddingTop="5dp"
+            android:paddingBottom="5dp"
+            android:paddingLeft="8dp"
+            android:paddingRight="8dp"
+            android:layout_marginTop="@dimen/content_padding_10"
+            android:text="已解封,继续赚钱"
+            android:textColor="@color/txt_black_cc444444"
+            android:textSize="@dimen/text_size_2"/>
 
 
+    </LinearLayout>
 </android.support.constraint.ConstraintLayout>

+ 9 - 10
app/src/main/res/layout/lie_make_money_normal_item.xml

@@ -46,24 +46,23 @@
         />
 
     <TextView
-        android:id="@+id/earnings_name_tv"
+        android:id="@+id/earnings_money_tv"
         android:layout_width="wrap_content"
         android:layout_height="wrap_content"
         style="@style/nomal_txt_style"
-        android:text="收益"
-        android:layout_marginRight="@dimen/content_padding"
-        app:layout_constraintBaseline_toBaselineOf="@+id/weixin_number_tv"
+        android:textSize="@dimen/text_size_20"
+        android:textColor="@color/txt_red_ff4a5f"
+        android:text="0.61221213"
+        app:layout_constraintBaseline_toBaselineOf="@+id/weixin_name_tv"
         app:layout_constraintEnd_toStartOf="@id/yuan_tv"/>
     <TextView
-        android:id="@+id/earnings_money_tv"
+        android:id="@+id/earnings_name_tv"
         android:layout_width="wrap_content"
         android:layout_height="wrap_content"
         style="@style/nomal_txt_style"
-        android:textSize="@dimen/text_size_20"
-        android:textColor="@color/txt_red_ff4a5f"
-        android:text="0.63"
-        app:layout_constraintBaseline_toBaselineOf="@+id/weixin_name_tv"
-        app:layout_constraintStart_toStartOf="@id/earnings_name_tv"/>
+        android:text="收益"
+        app:layout_constraintBaseline_toBaselineOf="@+id/weixin_number_tv"
+        app:layout_constraintEnd_toStartOf="@id/yuan_tv"/>
 
 
 </android.support.constraint.ConstraintLayout>