Procházet zdrojové kódy

优化布局并添加订单取消与支付的打点

zengjiebin před 7 roky
rodič
revize
abe5f9a048

+ 2 - 2
app/src/main/java/com/sheep/gamegroup/heler/TaskHelper.java

@@ -124,8 +124,8 @@ public class TaskHelper {
         TextView find_information_game_surplus = (TextView)itemView.findViewById(R.id.find_information_game_surplus);
         TextView find_information_game_time = (TextView)itemView.findViewById(R.id.find_information_game_time);
         TextView find_information_game_yuan = (TextView)itemView.findViewById(R.id.find_information_game_yuan);
-        TextView find_information_game_task0 = (TextView)itemView.findViewById(R.id.find_information_game_task0);
-        TextView find_information_game_task = (TextView)itemView.findViewById(R.id.find_information_game_task);
+        TextView find_information_game_task0 = (TextView)itemView.findViewById(R.id.find_information_game_task_top);
+        TextView find_information_game_task = (TextView)itemView.findViewById(R.id.find_information_game_task_bottom);
         final TextView find_information_game_task_end_time = (TextView)itemView.findViewById(R.id.find_information_game_task_end_time);
         if(orienteeringDetail != null){//已经完成的游戏任务
             find_information_game_task.setVisibility(View.VISIBLE);

+ 43 - 0
app/src/main/java/com/sheep/gamegroup/model/entity/GameAccountEntity.java

@@ -18,6 +18,8 @@ public class GameAccountEntity implements Serializable {
     private String account;
     private int game_type;
     private int id;
+    private int tencent_platform;//腾讯平台账号类型 1:QQ 2:微信
+    private int platform_receive;//是否平台领取 1是 2不是
     private String password;
 
     public String getAccount() {
@@ -76,6 +78,32 @@ public class GameAccountEntity implements Serializable {
         this.task_type = task_type;
     }
 
+    public int getTencent_platform() {
+        return tencent_platform;
+    }
+
+    public void setTencent_platform(int tencent_platform) {
+        this.tencent_platform = tencent_platform;
+    }
+
+    public int getPlatform_receive() {
+        return platform_receive;
+    }
+
+    public void setPlatform_receive(int platform_receive) {
+        this.platform_receive = platform_receive;
+    }
+
+
+
+
+
+
+
+
+
+
+
     public String getTypeName(){
         switch (task_id){
             case 0:
@@ -121,4 +149,19 @@ public class GameAccountEntity implements Serializable {
                 return "小米游戏";
         }
     }
+
+    /**
+     * 是否是平台账号
+     * @return
+     */
+    public boolean isPlatformAccount(){
+        return platform_receive == 1;
+    }
+    /**
+     * 平台账号不能删除
+     * @return
+     */
+    public boolean cantDeleteAccount(){
+        return isPlatformAccount();
+    }
 }

+ 2 - 0
app/src/main/java/com/sheep/gamegroup/util/UMConfigUtils.java

@@ -149,6 +149,8 @@ public class UMConfigUtils {
         USER_GAME_ACCOUNT_DEL_COMMIT("个人中心 -> 游戏账号 -> 点击游戏账号中的删除 -> 确认删除"),//5115
         NEWBIE_TASK_ITEM("小绵羊模块 -> 新手任务图标 -> 点击一个新手任务中的去完成 需要传新手任务id与name,如:{\"id\":1,\"name\":\"了解小绵羊|完成首次提现|成功邀请好友|完成首次任务|加入官方QQ群\"}"),//5116
         SHEEP_NEWBIE_TASK_UNDERSTAND_SHEEP_COMMIT("新手任务 -> 一分钟了解小绵羊界面 -> 点击我知道了"),//5117
+        ORDER_MANAGER_CANCEL("订单管理 -> 取消支付"),//5118
+        ORDER_MANAGER_PAY("订单管理 -> 立即支付"),//5119
         ;
         private String tag;
 

+ 5 - 2
app/src/main/java/com/sheep/gamegroup/view/activity/ActFindInformation.java

@@ -170,7 +170,8 @@ public class ActFindInformation extends BaseActivity implements Action1<Integer>
         TextView find_information_game_surplus = (TextView)itemView.findViewById(R.id.find_information_game_surplus);
         TextView find_information_game_time = (TextView)itemView.findViewById(R.id.find_information_game_time);
         TextView find_information_game_yuan = (TextView)itemView.findViewById(R.id.find_information_game_yuan);
-        TextView find_information_game_task = (TextView)itemView.findViewById(R.id.find_information_game_task);
+        TextView find_information_game_task_bottom = (TextView)itemView.findViewById(R.id.find_information_game_task_bottom);
+        TextView find_information_game_task_center = (TextView)itemView.findViewById(R.id.find_information_game_task_center);
         ViewUtil.setImage(find_information_game_icon, findApp.getIcon());
         ViewUtil.setText(find_information_game_name, findApp.getName());
         final boolean isNeedReservation = !findApp.isCanDonload();//这里认为只有两种状态:可下载与预约下载
@@ -180,8 +181,10 @@ public class ActFindInformation extends BaseActivity implements Action1<Integer>
         else
             ViewUtil.setText(find_information_game_time, String.format(Locale.CHINA, "厂商:%s\u0020包体大小:%sM", findApp.getManufacturer(),findApp.getPackage_size()));
         find_information_game_yuan.setVisibility(View.GONE);
+        find_information_game_task_bottom.setVisibility(View.GONE);
+        find_information_game_task_center.setVisibility(View.VISIBLE);
 
-        updateView(this,findApp, find_information_game_task);
+        updateView(this,findApp, find_information_game_task_center);
 
         itemView.setOnClickListener(new View.OnClickListener() {
             @Override

+ 7 - 7
app/src/main/java/com/sheep/gamegroup/view/activity/ActSearchGame.java

@@ -137,23 +137,23 @@ public class ActSearchGame extends BaseActivity {
                 TextView find_information_game_surplus = (TextView) itemView.findViewById(R.id.find_information_game_surplus);
                 TextView find_information_game_time = (TextView) itemView.findViewById(R.id.find_information_game_time);
                 TextView find_information_game_yuan = (TextView) itemView.findViewById(R.id.find_information_game_yuan);
-                TextView find_information_game_task = (TextView) itemView.findViewById(R.id.find_information_game_task);
-                TextView find_information_game_task0 = (TextView) itemView.findViewById(R.id.find_information_game_task0);
+                TextView find_information_game_task_bottom = (TextView) itemView.findViewById(R.id.find_information_game_task_bottom);
+                TextView find_information_game_task_top = (TextView) itemView.findViewById(R.id.find_information_game_task_top);
                 ViewUtil.centerImage(find_information_game_icon, taskEty.getIcon());
                 ViewUtil.setText(find_information_game_name, item.getName());
                 ViewUtil.setText(find_information_game_surplus);
                 ViewUtil.setText(find_information_game_time, taskEty.getDetailShow());
                 find_information_game_yuan.setVisibility(View.INVISIBLE);//这里必须为INVISIBLE,因为要显示两个按钮,下面的按钮位置不动
-                find_information_game_task0.setVisibility(View.VISIBLE);
-                find_information_game_task0.setText("立即充值");
-                find_information_game_task0.setOnClickListener(new View.OnClickListener() {
+                find_information_game_task_top.setVisibility(View.VISIBLE);
+                find_information_game_task_top.setText("立即充值");
+                find_information_game_task_top.setOnClickListener(new View.OnClickListener() {
                     @Override
                     public void onClick(View view) {
                         ViewUtil.showGamePayAccount(activity, taskEty.getThird_task_id(), item.getName());
                     }
                 });
-                item.getDownloadHelper().updateDownloadTaskView(activity, taskEty, find_information_game_task);
-                find_information_game_task.setTag("PUBLIC_TAG_PREFIX_TEXTVIEW_LIST" + taskEty.getDownload_link());
+                item.getDownloadHelper().updateDownloadTaskView(activity, taskEty, find_information_game_task_bottom);
+                find_information_game_task_bottom.setTag("PUBLIC_TAG_PREFIX_TEXTVIEW_LIST" + taskEty.getDownload_link());
             }
         };
         search_game_list.setAdapter(adapter);

+ 28 - 23
app/src/main/java/com/sheep/gamegroup/view/adapter/AdpGameAccount.java

@@ -116,30 +116,35 @@ public class AdpGameAccount extends AdpCommonRecy<RecyleObj> {
                         ViewUtil.newInstance().showGameAccountDetail((Activity) context, item.getId());
                     }
                 });
-                delete_layout.setOnClickListener(new View.OnClickListener() {
-                    @Override
-                    public void onClick(View v) {
-                        USER_GAME_ACCOUNT_DEL.onEvent();
-                        ViewUtil.showMsgDialog(context, new DialogConfig().setTitle("删除确认").setMsg("确定删除吗?").setBtnRightText("取消")
-                                .setBtnLeftText("确定").setBtnLeftOnClickListener(new View.OnClickListener() {
-                                    @Override
-                                    public void onClick(View view) {
-                                        USER_GAME_ACCOUNT_DEL_COMMIT.onEvent();
-                                        CommonUtil.getInstance().deleteGameAccount(context, item.getId(), new Action1<Integer>() {
-                                            @Override
-                                            public void call(Integer integer) {
-                                                if (integer == 1){
-                                                    G.showToast("删除成功!");
-                                                    EventBus.getDefault().post(new BigEvent().setEventTypes(EventTypes.DELETE_GAME_ACCOUNT_REFRESH));
-                                                }else {
-                                                    G.showToast("删除失败!");
+                if(item.cantDeleteAccount()){
+                    delete_layout.setVisibility(View.INVISIBLE);
+                } else {
+                    delete_layout.setVisibility(View.VISIBLE);
+                    delete_layout.setOnClickListener(new View.OnClickListener() {
+                        @Override
+                        public void onClick(View v) {
+                            USER_GAME_ACCOUNT_DEL.onEvent();
+                            ViewUtil.showMsgDialog(context, new DialogConfig().setTitle("删除确认").setMsg("确定删除吗?").setBtnRightText("取消")
+                                    .setBtnLeftText("确定").setBtnLeftOnClickListener(new View.OnClickListener() {
+                                        @Override
+                                        public void onClick(View view) {
+                                            USER_GAME_ACCOUNT_DEL_COMMIT.onEvent();
+                                            CommonUtil.getInstance().deleteGameAccount(context, item.getId(), new Action1<Integer>() {
+                                                @Override
+                                                public void call(Integer integer) {
+                                                    if (integer == 1) {
+                                                        G.showToast("删除成功!");
+                                                        EventBus.getDefault().post(new BigEvent().setEventTypes(EventTypes.DELETE_GAME_ACCOUNT_REFRESH));
+                                                    } else {
+                                                        G.showToast("删除失败!");
+                                                    }
                                                 }
-                                            }
-                                        });
-                                    }
-                                }));
-                    }
-                });
+                                            });
+                                        }
+                                    }));
+                        }
+                    });
+                }
             }
         });
     }

+ 5 - 2
app/src/main/java/com/sheep/gamegroup/view/adapter/AdpGameTaskOrderList.java

@@ -19,6 +19,9 @@ import com.sheep.jiuyan.samllsheep.R;
 
 import java.util.List;
 
+import static com.sheep.gamegroup.util.UMConfigUtils.Event.ORDER_MANAGER_CANCEL;
+import static com.sheep.gamegroup.util.UMConfigUtils.Event.ORDER_MANAGER_PAY;
+
 /**
  * Created by ljy on 2018/6/15.
  */
@@ -143,7 +146,7 @@ public class AdpGameTaskOrderList extends BaseAdapter {
         holder.pay_cancel_tv.setOnClickListener(new View.OnClickListener() {
             @Override
             public void onClick(View v) {
-
+                ORDER_MANAGER_CANCEL.onEvent();
                 CommonUtil.getInstance()
                         .gameTaskPayOrGiveUp(
                                 (Activity) context,
@@ -155,7 +158,7 @@ public class AdpGameTaskOrderList extends BaseAdapter {
         holder.pay_tv.setOnClickListener(new View.OnClickListener() {
             @Override
             public void onClick(View v) {
-
+                ORDER_MANAGER_PAY.onEvent();
                 CommonUtil.getInstance()
                         .gameTaskPayOrGiveUp(
                                 (Activity) context,

+ 5 - 2
app/src/main/java/com/sheep/gamegroup/view/adapter/TryMakeMoneyAdp.java

@@ -386,6 +386,9 @@ public class TryMakeMoneyAdp extends AdpCommonRecy<RecyleObj> {
                     return;
                 }
                 TextView detail_task_tv = viewHolder.itemView.findViewById(R.id.detail_task_tv);
+                detail_task_tv.setVisibility(View.GONE);
+                TextView detail_task_tv_center = viewHolder.itemView.findViewById(R.id.detail_task_tv_center);
+                detail_task_tv_center.setVisibility(View.VISIBLE);
                 viewHolder.itemView.findViewById(R.id.item_title_tv).setVisibility(View.GONE);
                 viewHolder.itemView.findViewById(R.id.item_title_iv).setVisibility(View.GONE);
 
@@ -394,7 +397,7 @@ public class TryMakeMoneyAdp extends AdpCommonRecy<RecyleObj> {
                 }else {
                     viewHolder.itemView.findViewById(R.id.line_tv).setVisibility(View.VISIBLE);
                 }
-                detail_task_tv.setText("充值");
+                detail_task_tv_center.setText("充值");
                 ((TextView)viewHolder.itemView.findViewById(R.id.item_date_tv)).setVisibility(View.INVISIBLE);
                 viewHolder.itemView.findViewById(R.id.item_date_question_img).setVisibility(View.INVISIBLE);
                 viewHolder.itemView.findViewById(R.id.cancel_task_tv).setVisibility(View.GONE);
@@ -415,7 +418,7 @@ public class TryMakeMoneyAdp extends AdpCommonRecy<RecyleObj> {
 
 
                 //去充值
-                detail_task_tv.setOnClickListener(new View.OnClickListener() {
+                detail_task_tv_center.setOnClickListener(new View.OnClickListener() {
                     @Override
                     public void onClick(View v) {
                         GAME_INSTEAD_OF_RECHARGE_PLATFORM.onEvent("task_type", item.getTask_type(), "name", item.getName());

+ 25 - 25
app/src/main/java/com/sheep/gamegroup/view/dialog/DialogPayGame.java

@@ -75,7 +75,8 @@ public class DialogPayGame {
     private MyGridview myGridview;
     private List<WithdrawalList> wlLists = new ArrayList<>();
     private WithdrawalAdapter adapter;
-    private int select;
+    private int select = -1;//默认不选中
+    private int lastSelect = -1;
     private String amount;
 
     private GamePayList gameVoucherAndRatio;
@@ -399,16 +400,16 @@ public class DialogPayGame {
         myGridview.setOnItemClickListener(new AdapterView.OnItemClickListener() {
             @Override
             public void onItemClick(AdapterView<?> parent, View view, int position, long id) {
-                select = position;
-                for(int i=0;i<wlLists.size();i++){
-                    if(position == i){
-                        wlLists.get(i).getGridViewEntity().setSelectState(true);
-                    }else {
-                        wlLists.get(i).getGridViewEntity().setSelectState(false);
-
-                    }
-                    adapter.notifyDataSetChanged();
+                wlLists.get(position).getGridViewEntity().setSelectState(true);
+                if(ListUtil.hasIndex(wlLists, select) && select != position){
+                    wlLists.get(select).getGridViewEntity().setSelectState(false);
+                }
+                if(ListUtil.hasIndex(wlLists, lastSelect) && lastSelect != position){
+                    wlLists.get(lastSelect).getGridViewEntity().setSelectState(false);
+                    lastSelect = -1;
                 }
+                select = position;
+                adapter.notifyDataSetChanged();
                 makePriceShow(wlLists.get(position).getGridViewEntity().getValue());
                 money_et.setText("");
             }
@@ -422,15 +423,18 @@ public class DialogPayGame {
 
             @Override
             public void onTextChanged(CharSequence s, int start, int before, int count) {
-                if (!TextUtils.isEmpty(s) && s.length() > 0 && CommonUtil.getInstance().clickTime(500)) {
-                    cleanClick();
-                    makePriceShow(s.toString());
-                }
             }
 
             @Override
             public void afterTextChanged(Editable s) {
-
+                if (!TextUtils.isEmpty(s)) {//输入有金额,清除上面选中的金额,并重新一份计价
+                    cleanClick();
+                    makePriceShow(s.toString());
+                } else if(ListUtil.hasIndex(wlLists, lastSelect)) {//没有输入金额,默认选中之前的金额
+                    wlLists.get(lastSelect).getGridViewEntity().setSelectState(true);
+                    adapter.notifyDataSetChanged();
+                    select = lastSelect;
+                }
             }
         });
     }
@@ -459,7 +463,7 @@ public class DialogPayGame {
     private void makePriceShow(String price){
         if(ListUtil.isEmpty(list) || gameVoucherAndRatio == null || TextUtils.isEmpty(price))
             return;
-        double showPrice = gameVoucherAndRatio.getGift_ratio() * Integer.valueOf(price) /100;
+        double showPrice = gameVoucherAndRatio.getGift_ratio() * Long.valueOf(price) /100;
         double priceDouble = NumberFormatUtils.decimal(showPrice > gameVoucherAndRatio.getVoucher() ? gameVoucherAndRatio.getVoucher() + gameVoucherAndRatio.getUser_balance(): showPrice + gameVoucherAndRatio.getUser_balance(), 2);
         String p = "绵羊币 (可用"+ priceDouble +") 指非定向货币+定向货币";
         TextView textView = pay_listview.getChildAt(0).findViewById(R.id.pay_game_dialog_item_tv);
@@ -472,14 +476,10 @@ public class DialogPayGame {
      * 清除gridview 选中
      */
     private void cleanClick(){
-        new Handler().postDelayed(new Runnable() {
-            @Override
-            public void run() {
-                for(int i=0;i<wlLists.size();i++){
-                    wlLists.get(i).getGridViewEntity().setSelectState(false);
-                }
-                adapter.notifyDataSetChanged();
-            }
-        },10);
+        if(ListUtil.hasIndex(wlLists, select)) {
+            wlLists.get(select).getGridViewEntity().setSelectState(false);
+            adapter.notifyDataSetChanged();
+            lastSelect = select;
+        }
     }
 }

+ 4 - 1
app/src/main/java/com/sheep/jiuyan/samllsheep/SheepApp.java

@@ -20,6 +20,7 @@ import com.sheep.gamegroup.util.Jump2View;
 import com.sheep.gamegroup.util.LogUtil;
 import com.sheep.gamegroup.util.SysAppUtil;
 import com.sheep.gamegroup.util.UMConfigUtils;
+import com.sheep.gamegroup.view.activity.ActWeb;
 import com.sheep.gamegroup.view.activity.LoginAct;
 import com.sheep.gamegroup.view.activity.PhoneAct;
 import com.sheep.gamegroup.view.activity.SplashAct;
@@ -119,7 +120,9 @@ public class SheepApp extends BaseApplication {
     ActivityLifecycleCallbacks activityLifecycleCallbacks = new ActivityLifecycleCallbacks() {
         @Override
         public void onActivityCreated(final Activity activity, Bundle savedInstanceState) {
-            Appsee.start();
+            if(!(activity instanceof ActWeb || activity instanceof com.kfzs.duanduan.ActWeb)){//非h5界面才使用触摸热力图sdk,因为webview中的输入框有问题,会在弹出输入法后不停的闪烁
+                Appsee.start();
+            }
             ActivityManager.getInstance().pushActivity(activity);
             if(activity instanceof SplashAct || activity instanceof LoginAct || activity instanceof PhoneAct){
                 SysAppUtil.showVersionInfo(activity, SpUtils.getIgnoreMd5());

+ 1 - 0
app/src/main/res/layout/dialog_pa_game_center.xml

@@ -43,6 +43,7 @@
         android:hint="输入其他金额"
         android:text=""
         android:inputType="number"
+        android:maxLength="11"
         android:textSize="@dimen/text_size_13"
         android:padding="@dimen/content_padding_small"
         android:layout_marginBottom="@dimen/common_margin_10"/>

+ 11 - 3
app/src/main/res/layout/find_information_bottom_item.xml

@@ -21,7 +21,7 @@
         android:textColor="#020202"
         android:textSize="15sp"
         app:layout_constraintBottom_toTopOf="@+id/find_information_game_surplus"
-        app:layout_constraintEnd_toStartOf="@+id/find_information_game_task"
+        app:layout_constraintEnd_toStartOf="@+id/find_information_game_task_bottom"
         app:layout_constraintStart_toEndOf="@+id/find_information_game_icon"
         app:layout_constraintTop_toTopOf="@+id/find_information_game_icon" />
 
@@ -59,14 +59,22 @@
         app:layout_constraintTop_toTopOf="parent" />
 
     <TextView
-        android:id="@+id/find_information_game_task0"
+        android:id="@+id/find_information_game_task_top"
         style="@style/style_button_find"
         android:text="接受任务"
         android:visibility="gone"
         app:layout_constraintEnd_toEndOf="parent"
         app:layout_constraintTop_toTopOf="parent" />
     <TextView
-        android:id="@+id/find_information_game_task"
+        android:id="@+id/find_information_game_task_center"
+        style="@style/style_button_find"
+        android:text="接受任务"
+        android:visibility="gone"
+        app:layout_constraintEnd_toEndOf="parent"
+        app:layout_constraintTop_toTopOf="parent"
+        app:layout_constraintBottom_toBottomOf="parent"/>
+    <TextView
+        android:id="@+id/find_information_game_task_bottom"
         style="@style/style_button_find"
         android:text="接受任务"
         app:layout_constraintBottom_toBottomOf="parent"

+ 25 - 3
app/src/main/res/layout/list_has_empty.xml

@@ -3,15 +3,37 @@
     android:layout_width="match_parent"
     android:layout_height="wrap_content">
 
-    <include
+    <RelativeLayout
         android:id="@+id/empty_view"
-        layout="@layout/empty_view_bottom"
         android:layout_width="match_parent"
         android:layout_height="match_parent"
+        android:background="@color/white"
         android:layout_marginStart="@dimen/dp_10"
         android:layout_marginEnd="@dimen/dp_10"
-        android:layout_marginBottom="@dimen/dp_10"/>
+        android:layout_marginBottom="@dimen/dp_10">
+
+        <ImageView
+            android:id="@+id/img_list_empty"
+            android:layout_width="wrap_content"
+            android:layout_height="wrap_content"
+            android:layout_centerHorizontal="true"
+            android:layout_marginTop="40dp"
+            android:background="@color/white"
+            android:gravity="center"
+            android:scaleType="centerInside"
+            android:src="@drawable/wushuju"
+            android:visibility="visible" />
 
+        <TextView
+            android:id="@+id/txt_list_empty"
+            style="@style/G3"
+            android:layout_width="wrap_content"
+            android:layout_height="wrap_content"
+            android:layout_below="@id/img_list_empty"
+            android:layout_centerHorizontal="true"
+            android:layout_marginTop="@dimen/content_padding_big"
+            android:text="暂无数据,稍后再试。" />
+    </RelativeLayout>
     <com.sheep.gamegroup.view.customview.RefreshLayout
         android:id="@+id/swipe_container"
         android:layout_width="match_parent"

+ 9 - 0
app/src/main/res/layout/try_makemoney_item_recommend.xml

@@ -163,6 +163,15 @@
                 android:visibility="gone"/>
 
         </RelativeLayout>
+        <TextView
+            android:id="@+id/detail_task_tv_center"
+            android:text="取消任务"
+            app:layout_constraintTop_toTopOf="parent"
+            app:layout_constraintBottom_toBottomOf="parent"
+            app:layout_constraintEnd_toEndOf="parent"
+            style="@style/style_button_find"
+            android:layout_centerInParent="true"
+            android:visibility="gone"/>
     </android.support.constraint.ConstraintLayout>
 
     <TextView