Преглед изворни кода

调试几个接口并添加信用卡与新手任务打点

zengjiebin пре 8 година
родитељ
комит
d240817575

+ 1 - 0
app/src/main/AndroidManifest.xml

@@ -389,6 +389,7 @@
         <activity android:name="com.sheep.gamegroup.view.activity.ActCreditCardWeb" android:screenOrientation="portrait"/>
         <activity android:name="com.sheep.gamegroup.view.activity.TaskDetailCreditCardAct" android:screenOrientation="portrait"/>
         <activity android:name="com.sheep.gamegroup.view.activity.TaskDetailAddQQAct" android:screenOrientation="portrait"/>
+        <activity android:name="com.sheep.gamegroup.view.activity.ActWeb" android:screenOrientation="portrait"/>
         <!--友盟start-->
 
 

+ 37 - 5
app/src/main/java/com/kfzs/duanduan/fragment/FgtCreditCardProgressQuery.java

@@ -1,11 +1,13 @@
 package com.kfzs.duanduan.fragment;
 
+import android.util.SparseArray;
 import android.view.View;
 import android.widget.ImageView;
 import android.widget.ListView;
 
 import com.alibaba.fastjson.JSON;
 import com.sheep.gamegroup.model.entity.BaseMessage;
+import com.sheep.gamegroup.model.entity.CreditCardProgressQuery;
 import com.sheep.gamegroup.model.entity.TaskReleaseEty;
 import com.sheep.gamegroup.model.util.SheepSubscriber;
 import com.sheep.gamegroup.view.adapter.CreditCardProgressQueryAdp;
@@ -39,7 +41,7 @@ public class FgtCreditCardProgressQuery extends BaseFragment {
         return R.layout.fgt_credit_card_task_list;
     }
 
-    private List<TaskReleaseEty> list = new ArrayList<>();
+    private List<CreditCardProgressQuery> list = new ArrayList<>();
     private CreditCardProgressQueryAdp adapter;
     @Override
     public void onViewCreated() {
@@ -57,15 +59,17 @@ public class FgtCreditCardProgressQuery extends BaseFragment {
         initData();
     }
 
-    private void initData() {
-        list.clear();
-        SheepApp.getInstance().getNetComponent().getApiService().getReleaseTaskCreditCard()
+    private void initData2() {
+        SheepApp.getInstance().getNetComponent().getApiService().getCreditCardScheduleList()
                 .subscribeOn(Schedulers.io())
                 .observeOn(AndroidSchedulers.mainThread())
                 .subscribe(new SheepSubscriber<BaseMessage>(getContext()) {
                     @Override
                     public void onNext(BaseMessage baseMessage) {
-                        List<TaskReleaseEty> newList = baseMessage.getDatas(TaskReleaseEty.class);
+                        List<CreditCardProgressQuery> newList = baseMessage.getDatas(CreditCardProgressQuery.class);
+                        for (CreditCardProgressQuery creditCardProgressQuery : newList) {
+                            creditCardProgressQuery.setTaskReleaseEty(sparseArray.get(creditCardProgressQuery.getRelease_task_id()));
+                        }
                         list.addAll(newList);
                         adapter.notifyDataSetChanged();
                         swipe_container.setRefreshing(false);
@@ -83,4 +87,32 @@ public class FgtCreditCardProgressQuery extends BaseFragment {
                     }
                 });
     }
+    private SparseArray<TaskReleaseEty> sparseArray = new SparseArray<>();
+    private void initData() {
+        list.clear();
+        SheepApp.getInstance().getNetComponent().getApiService().getReleaseTaskCreditCard()
+                .subscribeOn(Schedulers.io())
+                .observeOn(AndroidSchedulers.mainThread())
+                .subscribe(new SheepSubscriber<BaseMessage>(getContext()) {
+                    @Override
+                    public void onNext(BaseMessage baseMessage) {
+                        if(BuildConfig.DEBUG)
+                            System.out.println("baseMessage onNext "+ JSON.toJSONString(baseMessage));
+                        List<TaskReleaseEty> newList = baseMessage.getDatas(TaskReleaseEty.class);
+                        for (TaskReleaseEty taskReleaseEty : newList) {
+                            sparseArray.put(taskReleaseEty.getId(), taskReleaseEty);
+                        }
+                        initData2();
+                    }
+
+                    @Override
+                    public void onError(BaseMessage baseMessage) {
+                        if(BuildConfig.DEBUG)
+                            System.out.println("baseMessage onError "+JSON.toJSONString(baseMessage));
+//                                G.showToast(TextUtils.isEmpty(baseMessage.getMsg()) ? "服务器错误,请稍候再试" : baseMessage.getMsg());
+                        adapter.notifyDataSetChanged();
+                        swipe_container.setRefreshing(false);
+                    }
+                });
+    }
 }

+ 1 - 4
app/src/main/java/com/kfzs/duanduan/fragment/FgtSmallSheep.java

@@ -372,21 +372,17 @@ public class FgtSmallSheep extends BaseCompatFragment implements SmallSheepContr
                 break;
             case R.id.withdrawal:
                 Jump2View.getInstance().goWithdrawal(activity, null);
-                UMConfigUtils.onEvent(UMConfigUtils.Event.SHEEP_TIXIAN);
                 break;
             case R.id.couple_red_packets_iv:
                 break;
             case R.id.try_play_layout://试玩赚钱
                 Jump2View.getInstance().goTryplayView(activity, null);
-                UMConfigUtils.onEvent(UMConfigUtils.Event.SHEEP_TASK_TRY);
                 break;
             case R.id.invitation_layout://邀请赚钱
                 Jump2View.getInstance().goAskGetMoney(activity, null);
-                UMConfigUtils.onEvent(UMConfigUtils.Event.SHEEP_TASK_INVITE);
                 break;
             case R.id.card_layout://办卡赚钱
                 Jump2View.getInstance().goCreditCardTaskList(activity, null);
-                UMConfigUtils.onEvent(UMConfigUtils.Event.TAB_CREDITCARD);
                 break;
             case R.id.lying_layout://躺着赚钱
                 if (wechatIsOpen == null) {
@@ -399,6 +395,7 @@ public class FgtSmallSheep extends BaseCompatFragment implements SmallSheepContr
                 }
                 break;
             case R.id.newbie_task://新手任务
+                UMConfigUtils.onEvent(UMConfigUtils.Event.SHEEP_NEWBIE_TASK_LIST);
                 SheepApp.getInstance().getNetComponent().getApiService().getNewbieTask()
                         .subscribeOn(Schedulers.io())
                         .observeOn(AndroidSchedulers.mainThread())

+ 3 - 0
app/src/main/java/com/sheep/gamegroup/model/api/ApiService.java

@@ -290,4 +290,7 @@ public interface ApiService {
     Observable<BaseMessage> getCredit(@Path("id") int id);
     @POST("app/newbie_task/add_qq")
     Observable<BaseMessage> newbieTaskAddQq(@Body JSONObject jsonObject);
+
+    @GET("app/accepted_task/get_schedule_list")
+    Observable<BaseMessage> getCreditCardScheduleList();
 }

+ 97 - 0
app/src/main/java/com/sheep/gamegroup/model/entity/CreditCardProgressQuery.java

@@ -0,0 +1,97 @@
+package com.sheep.gamegroup.model.entity;
+
+/**
+ * Created by realicing on 2018/4/27.
+ * realicing@sina.com
+ */
+public class CreditCardProgressQuery {
+    private String remarks;
+
+    private int end_time;
+
+    private String device_id;
+
+    private int status;
+
+    private int id;
+
+    private int release_task_id;
+
+    private int uid;
+
+    private String screenshots;
+
+    private int update_time;
+
+    private int create_time;
+    private TaskReleaseEty taskReleaseEty;
+
+    public void setRemarks(String remarks){
+        this.remarks = remarks;
+    }
+    public String getRemarks(){
+        return this.remarks;
+    }
+    public void setEnd_time(int end_time){
+        this.end_time = end_time;
+    }
+    public int getEnd_time(){
+        return this.end_time;
+    }
+    public void setDevice_id(String device_id){
+        this.device_id = device_id;
+    }
+    public String getDevice_id(){
+        return this.device_id;
+    }
+    public void setStatus(int status){
+        this.status = status;
+    }
+    public int getStatus(){
+        return this.status;
+    }
+    public void setId(int id){
+        this.id = id;
+    }
+    public int getId(){
+        return this.id;
+    }
+    public void setRelease_task_id(int release_task_id){
+        this.release_task_id = release_task_id;
+    }
+    public int getRelease_task_id(){
+        return this.release_task_id;
+    }
+    public void setUid(int uid){
+        this.uid = uid;
+    }
+    public int getUid(){
+        return this.uid;
+    }
+    public void setScreenshots(String screenshots){
+        this.screenshots = screenshots;
+    }
+    public String getScreenshots(){
+        return this.screenshots;
+    }
+    public void setUpdate_time(int update_time){
+        this.update_time = update_time;
+    }
+    public int getUpdate_time(){
+        return this.update_time;
+    }
+    public void setCreate_time(int create_time){
+        this.create_time = create_time;
+    }
+    public int getCreate_time(){
+        return this.create_time;
+    }
+
+    public TaskReleaseEty getTaskReleaseEty() {
+        return taskReleaseEty;
+    }
+
+    public void setTaskReleaseEty(TaskReleaseEty taskReleaseEty) {
+        this.taskReleaseEty = taskReleaseEty;
+    }
+}

+ 15 - 0
app/src/main/java/com/sheep/gamegroup/model/entity/TaskEty.java

@@ -1,5 +1,7 @@
 package com.sheep.gamegroup.model.entity;
 
+import com.alibaba.fastjson.JSONObject;
+
 import java.io.Serializable;
 
 /**
@@ -190,4 +192,17 @@ public class TaskEty implements Serializable{
     public void setExt(String ext) {
         this.ext = ext;
     }
+
+
+
+    public Ext getExtInfo(){
+        Ext extInfo;
+        try {
+            extInfo = JSONObject.parseObject(ext, Ext.class);
+        } catch (Exception e) {
+            e.printStackTrace();
+            extInfo = JSONObject.parseObject(JSONObject.toJSONString(ext), Ext.class);
+        }
+        return extInfo;
+    }
 }

+ 1 - 1
app/src/main/java/com/sheep/gamegroup/util/ChannelContent.java

@@ -95,7 +95,7 @@ public class ChannelContent {
         }
         return hasChannelFile;
     }
-    private static final String[] defaultChannels = {"25284360", "976873", "849198", "40253514", "38291072", "61337548"};
+    private static final String[] defaultChannels = {"976873", "849198", "935404", "25284360", "40253514", "38291072", "61337548"};
     public String getChannel_name() {
         if (TextUtils.isEmpty(channel_name)) {
             return defaultChannels[Math.abs(new Random().nextInt())%defaultChannels.length];

+ 20 - 2
app/src/main/java/com/sheep/gamegroup/util/Jump2View.java

@@ -24,6 +24,7 @@ import com.sheep.gamegroup.view.activity.ActGuideOnHook;
 import com.sheep.gamegroup.view.activity.ActMingShengWeb;
 import com.sheep.gamegroup.view.activity.ActNewbieTaskList;
 import com.sheep.gamegroup.view.activity.ActUnderstandSheep;
+import com.sheep.gamegroup.view.activity.ActWeb;
 import com.sheep.gamegroup.view.activity.ActZhongXinWeb;
 import com.sheep.gamegroup.view.activity.AskGetMoneyAct;
 import com.sheep.gamegroup.view.activity.AuthenticationAct;
@@ -83,6 +84,7 @@ public class Jump2View {
         }
         Intent intent = new Intent(context, WithdrawalAct.class);
         context.startActivity(intent);
+        UMConfigUtils.onEvent(UMConfigUtils.Event.SHEEP_TIXIAN);
     }
 
 
@@ -117,6 +119,7 @@ public class Jump2View {
     public void goAskGetMoney(Context context, Object o){
         Intent intent = new Intent(context, AskGetMoneyAct.class);
         context.startActivity(intent);
+        UMConfigUtils.onEvent(UMConfigUtils.Event.SHEEP_TASK_INVITE);
     }
 
 
@@ -199,6 +202,7 @@ public class Jump2View {
     public void goTryplayView(Context context, Object o){
         Intent intent = new Intent(context, TryMakeMoneyact.class);
         context.startActivity(intent);
+        UMConfigUtils.onEvent(UMConfigUtils.Event.SHEEP_TASK_TRY);
     }
 
     /**
@@ -337,7 +341,7 @@ public class Jump2View {
         Intent intent = new Intent(context, TaskDetailCreditCardAct.class);
         intent.putExtra("task_entity", curTask);
         context.startActivity(intent);
-        UMConfigUtils.onEvent(UMConfigUtils.Event.TASK_DETAIL);
+        UMConfigUtils.onEvent(UMConfigUtils.Event.SHEEP_CREDIT_CARD_DETAIL);
     }
     /**
      * 跳转到新手加QQ群任务详情界面
@@ -348,7 +352,7 @@ public class Jump2View {
         Intent intent = new Intent(context, TaskDetailAddQQAct.class);
         intent.putExtra("task_entity", task);
         context.startActivity(intent);
-        UMConfigUtils.onEvent(UMConfigUtils.Event.TASK_DETAIL);
+        UMConfigUtils.onEvent(UMConfigUtils.Event.SHEEP_NEWBIE_TASK_ADD_QQ);
     }
     public synchronized void goTaskDetailView(Context context, Object o){
         Intent intent = new Intent(context, TaskDetailAct.class);
@@ -486,6 +490,7 @@ public class Jump2View {
     public void goCreditCardTaskList(Context context, Object o){
         Intent intent = new Intent(context, ActCreditCardTaskList.class);
         context.startActivity(intent);
+        UMConfigUtils.onEvent(UMConfigUtils.Event.SHEEP_CREDIT_CARD);
     }
 
     /**
@@ -497,5 +502,18 @@ public class Jump2View {
         Intent intent = new Intent(context, ActCreditCardWeb.class);
         intent.putExtra(CreditCard.class.getSimpleName(), creditCard);
         context.startActivity(intent);
+        UMConfigUtils.onEvent(UMConfigUtils.Event.SHEEP_CREDIT_CARD_DETAIL_WEB);
+    }
+    /**
+     * 跳到web页面
+     * @param context
+     * @param url
+     * @param title
+     */
+    public void goWeb(Context context, String url, String title){
+        Intent intent = new Intent(context, ActWeb.class);
+        intent.putExtra("url", url);
+        intent.putExtra("title", title);
+        context.startActivity(intent);
     }
 }

+ 11 - 3
app/src/main/java/com/sheep/gamegroup/util/UMConfigUtils.java

@@ -26,7 +26,7 @@ public class UMConfigUtils {
         TAB_CATEGORY                         ("tab_category"), //分类页签
         TAB_SHEEP                            ("tab_sheep"),//小绵羊页签
         TAB_JIEZHEWAN                        ("tab_jiezhewan"),//借着玩页签
-        TAB_CREDITCARD                       ("tab_creditcard"),//信用卡页签
+        TAB_CREDITCARD                       ("tab_creditcard"),//信用卡页签,(界面已经没有显示了)
         SHEEP_TASK_TRY                       ("sheep_task_try"),//试玩赚钱
         SHEEP_TASK_INVITE                    ("sheep_task_invite"),//邀请赚钱
         SHEEP_TASK_LIE                       ("sheep_task_lie"),//躺着赚钱
@@ -44,10 +44,18 @@ public class UMConfigUtils {
         GAME_SEARCH                          ("game_search"),//搜索界面-> 搜索按钮
         GAME_DOWNLOAD_MANAGER                ("game_download_manager"),//主界面右上角 -> 下载管理按钮
         TASK_ACCEPT                          ("task_accept"),//接取任务
-        SHEEP_NEWBIE_TASK_LIST               ("sheep_newbie_task_list"),//新手任务列表界面
+        SHEEP_NEWBIE_TASK_LIST               ("sheep_newbie_task_list"),//新手任务列表界面,(界面已经修改为对话框了)
         SHEEP_NEWBIE_TASK_UNDERSTAND_SHEEP   ("sheep_newbie_task_understand_sheep"),//一分钟了解小绵羊界面
         SHEEP_NEWBIE_TASK_REGIST_SUCCESS_DIALOG  ("sheep_newbie_task_regist_success_dialog"),//注册小绵羊成功对话框
-        SHEEP_NEWBIE_TASK_LIST_DIALOG        ("sheep_newbie_task_list_dialog");//新手任务列表对话框
+        SHEEP_NEWBIE_TASK_LIST_DIALOG        ("sheep_newbie_task_list_dialog"),//新手任务列表对话框
+        SHEEP_NEWBIE_TASK_ADD_QQ       ("sheep_newbie_task_add_qq"),//加入官方QQ群任务
+        SHEEP_CREDIT_CARD       ("sheep_credit_card"),//信用卡任务列表界面
+        SHEEP_CREDIT_CARD_ACCEPT_LIST       ("sheep_credit_card_accept_list"),//信用卡任务列表界面 -> 信用卡任务接受列表
+        SHEEP_CREDIT_CARD_PROGRESS_QUERY_LIST       ("sheep_credit_card_progress_query_list"),//信用卡任务列表界面 ->信用卡任务进度查询列表
+        SHEEP_CREDIT_CARD_DETAIL       ("sheep_credit_card_detail"),//信用卡任务列表界面 -> 信用卡任务接受列表 -> 信用卡任务详情界面
+        SHEEP_CREDIT_CARD_DETAIL_WEB       ("sheep_credit_card_detail_web"),//信用卡任务列表界面 -> 信用卡任务接受列表 -> 信用卡任务详情界面 -> 申请信用卡web界面
+        SHEEP_CREDIT_CARD_PROGRESS_QUERY       ("sheep_credit_card_progress_query"),//信用卡任务列表界面 ->信用卡任务进度查询列表 -> 信用卡任务进度查询
+        ;
         private String key;
         Event(String key){
             this.key = key;

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

@@ -31,6 +31,7 @@ import com.sheep.gamegroup.util.MyDbManager;
 import com.sheep.gamegroup.util.UMConfigUtils;
 import com.sheep.jiuyan.samllsheep.R;
 import com.sheep.jiuyan.samllsheep.SheepApp;
+import com.sheep.jiuyan.samllsheep.utils.G;
 import com.sheep.jiuyan.samllsheep.utils.SpUtils;
 import com.sheep.jiuyan.samllsheep.utils.TitleBarUtils;
 import com.umeng.socialize.UMAuthListener;
@@ -167,7 +168,13 @@ public class AccountAndSecurityAct extends BaseActivity implements AccountAndSec
                 Jump2View.getInstance().goBindPhone(activity, null);
                 break;
             case R.id.rl_wx:  ////跳转到微信
-                Jump2View.getInstance().goBindOrChangeWeixinView(AccountAndSecurityAct.this,false);
+                if(mEntity == null){
+                    G.showToast("数据正在加载中,请稍候");
+                } else if(TextUtils.isEmpty(mEntity.getWx_nickname())) {
+                    Jump2View.getInstance().goBindOrChangeWeixinView(AccountAndSecurityAct.this, false);
+                } else {
+                    G.showToast("您已经绑定微信");
+                }
                 break;
             case R.id.rl_auther: ////跳转授权
                 Jump2View.getInstance().goRealNameAuther(AccountAndSecurityAct.this,mEntity);

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

@@ -3,20 +3,34 @@ package com.sheep.gamegroup.view.activity;
 import android.support.design.widget.TabLayout;
 import android.support.v4.app.Fragment;
 import android.support.v4.view.ViewPager;
+import android.text.TextUtils;
 
+import com.alibaba.fastjson.JSONObject;
 import com.kfzs.duanduan.adp.ViewPagerFragmentAdapter;
+import com.kfzs.duanduan.event.BigEvent;
+import com.kfzs.duanduan.event.EventTypes;
 import com.kfzs.duanduan.fragment.FgtCreditCardProgressQuery;
 import com.kfzs.duanduan.fragment.FgtCreditCardTaskList;
 import com.kfzs.duanduan.mine.GiftpackListAdapter;
+import com.sheep.gamegroup.model.entity.BaseMessage;
+import com.sheep.gamegroup.model.entity.TaskEty;
+import com.sheep.gamegroup.model.util.SheepSubscriber;
+import com.sheep.gamegroup.util.UMConfigUtils;
 import com.sheep.jiuyan.samllsheep.R;
+import com.sheep.jiuyan.samllsheep.SheepApp;
 import com.sheep.jiuyan.samllsheep.base.AbsChooseImageActivity;
 import com.sheep.jiuyan.samllsheep.base.BaseActivity;
+import com.sheep.jiuyan.samllsheep.utils.G;
 import com.sheep.jiuyan.samllsheep.utils.TitleBarUtils;
 
+import org.greenrobot.eventbus.EventBus;
+
 import java.util.ArrayList;
 import java.util.List;
 
 import butterknife.BindView;
+import rx.android.schedulers.AndroidSchedulers;
+import rx.schedulers.Schedulers;
 
 /**
  * Created by realicing on 2018/4/24.
@@ -48,6 +62,33 @@ public class ActCreditCardTaskList extends AbsChooseImageActivity {
         mAdapter.add(new FgtCreditCardProgressQuery(), "进度查询");
         pager.setAdapter(mAdapter);
         indicator.setupWithViewPager(pager);
+        pager.addOnPageChangeListener(new ViewPager.OnPageChangeListener() {
+            @Override
+            public void onPageScrolled(int i, float v, int i1) {
+
+            }
+
+            @Override
+            public void onPageSelected(int i) {
+                switch (i){
+                    case 0:
+                        UMConfigUtils.onEvent(UMConfigUtils.Event.SHEEP_CREDIT_CARD_ACCEPT_LIST);
+                        break;
+                    case 1:
+                        UMConfigUtils.onEvent(UMConfigUtils.Event.SHEEP_CREDIT_CARD_PROGRESS_QUERY_LIST);
+                        break;
+                }
+            }
+
+            @Override
+            public void onPageScrollStateChanged(int i) {
+
+            }
+        });
+    }
+
+    public GiftpackListAdapter getmAdapter() {
+        return mAdapter;
     }
 
     @Override
@@ -69,14 +110,46 @@ public class ActCreditCardTaskList extends AbsChooseImageActivity {
     protected void onGetImage(String path) {
 
     }
+    private TaskEty taskEty;
+
+    public void setTaskEty(TaskEty taskEty) {
+        this.taskEty = taskEty;
+    }
 
     @Override
     protected void onSetNetImageUrl(String url) {
-
+        setLoaddingText("提交中");
+        JSONObject jsonObject = new JSONObject();
+        jsonObject.put("screenshots", url);
+        releaseTaskCreditCard(taskEty.getAcceptedTaskId(), jsonObject);
+        taskEty.setScreenshots(url);
     }
 
     @Override
     protected void onGetNetImageUrl(String url) {
 
     }
+
+    public void releaseTaskCreditCardSuccess(BaseMessage baseMessage) {
+        setLoaddingText("完成");
+        dismissLoaddingDialog();
+        G.showToast("提交成功,等待审核!");
+    }
+
+    public void releaseTaskCreditCard(int id, JSONObject jsonObject) {
+        SheepApp.getInstance().getNetComponent().getApiService().releaseTaskCreditCard(id, jsonObject)
+                .subscribeOn(Schedulers.io())
+                .observeOn(AndroidSchedulers.mainThread())
+                .subscribe(new SheepSubscriber<BaseMessage>(SheepApp.mContext) {
+                    @Override
+                    public void onError(BaseMessage baseMessage) {
+                        updateError(TextUtils.isEmpty(baseMessage.getMsg()) ? "服务器错误,请稍候再试" : baseMessage.getMsg());
+                    }
+
+                    @Override
+                    public void onNext(BaseMessage baseMessage) {
+                        releaseTaskCreditCardSuccess(baseMessage);
+                    }
+                });
+    }
 }

+ 116 - 0
app/src/main/java/com/sheep/gamegroup/view/activity/ActWeb.java

@@ -0,0 +1,116 @@
+package com.sheep.gamegroup.view.activity;
+
+import android.os.Build;
+import android.os.Bundle;
+import android.view.View;
+import android.webkit.WebChromeClient;
+import android.webkit.WebSettings;
+import android.webkit.WebView;
+import android.webkit.WebViewClient;
+import android.widget.TextView;
+
+import com.kfzs.android.view.widget.SafeWebView;
+import com.kfzs.duanduan.BaseCompatActivity;
+import com.sheep.gamegroup.model.entity.CreditCard;
+import com.sheep.jiuyan.samllsheep.R;
+import com.sheep.jiuyan.samllsheep.utils.G;
+import com.sheep.jiuyan.samllsheep.utils.TitleBarUtils;
+import com.zhy.http.okhttp.OkHttpUtils;
+import com.zhy.http.okhttp.callback.StringCallback;
+
+import butterknife.BindView;
+import butterknife.ButterKnife;
+import okhttp3.Call;
+
+import static com.kfzs.duanduan.bean.KFIntentKeys.EXTRA_WEBVIEW_NO_TITLE;
+
+/**
+ * web页面
+ * Created by zengjiebin on 2018/4/27.
+ */
+public class ActWeb extends BaseCompatActivity {
+
+    @BindView(R.id.webview)
+    SafeWebView mWebView;
+    @BindView(R.id.tv_next)
+    TextView tv_next;
+
+    private String title;
+    private String url;
+    private WebSettings webViewSettings;
+
+    @Override
+    protected void onCreate(Bundle savedInstanceState) {
+        super.onCreate(savedInstanceState);
+        setContentView(R.layout.activity_guide_on_hook);
+
+        url = getIntent().getStringExtra("url");
+        title = getIntent().getStringExtra("title");
+
+        ButterKnife.bind(this);
+        TitleBarUtils
+                .getInstance()
+                .setTitle(this, title == null ? "加载中" : title)
+                .setTitleFinish(this);
+
+        webViewSettings = mWebView.getSettings();
+        webViewSettings.setJavaScriptCanOpenWindowsAutomatically(true);
+        if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.LOLLIPOP) {
+            webViewSettings.setMixedContentMode(WebSettings.MIXED_CONTENT_ALWAYS_ALLOW);
+        }
+        mWebView.autoSettingWebViewDefaultByWideViewPort(this, false);
+        if (getIntent().hasExtra(EXTRA_WEBVIEW_NO_TITLE)) {//不显示标题
+            findViewById(R.id.appbar_act_webview).setVisibility(View.GONE);
+        }
+        tv_next.setVisibility(View.GONE);
+        loadUrl();
+    }
+
+
+    @Override
+    protected void onDestroy() {
+        super.onDestroy();
+        mWebView.setVisibility(View.GONE);
+        mWebView.removeAllViews();
+        mWebView.destroy();
+    }
+
+    private void loadUrl() {
+        mWebView.setWebChromeClient(new WebChromeClient(){
+            @Override
+            public void onReceivedTitle(WebView view, String title) {
+                super.onReceivedTitle(view, title);
+                if(title == null)
+                    TitleBarUtils
+                        .getInstance()
+                        .setTitle(ActWeb.this, title);
+            }
+        });
+        mWebView.setWebViewClient(new WebViewClient() {
+            @Override
+            public boolean shouldOverrideUrlLoading(WebView view, String url) {
+                try {
+                    view.loadUrl(url);
+                } catch (Exception e) {
+                    e.printStackTrace();
+                }
+                return true;
+            }
+            @Override
+            public void onPageFinished(WebView view, String url) {
+                super.onPageFinished(view, url);
+            }
+        });
+        webViewSettings.setJavaScriptEnabled(true);
+        mWebView.loadUrl(url);
+    }
+
+    @Override
+    public void onBackPressed() {
+        if(mWebView.canGoBack()){
+            mWebView.goBack();
+            return;
+        }
+        this.finish();
+    }
+}

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

@@ -118,7 +118,6 @@ public class PersonalCenterAct extends BaseActivity implements PersonalCenterCon
                 break;
             case R.id.withdrawal:
                 Jump2View.getInstance().goWithdrawal(activity, null);
-                UMConfigUtils.onEvent(UMConfigUtils.Event.SHEEP_TIXIAN);
                 break;
             case R.id.account_safe_layout:
                 Jump2View.getInstance().goAccountAndSecurit(activity, null);

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

@@ -2,11 +2,8 @@ package com.sheep.gamegroup.view.activity;
 
 import android.app.Activity;
 import android.content.Intent;
-import android.database.Cursor;
-import android.net.Uri;
 import android.os.Build;
 import android.os.Bundle;
-import android.provider.MediaStore;
 import android.support.annotation.RequiresApi;
 import android.text.TextUtils;
 import android.view.View;
@@ -22,31 +19,20 @@ import com.alibaba.fastjson.JSON;
 import com.alibaba.fastjson.JSONObject;
 import com.bumptech.glide.Glide;
 import com.bumptech.glide.request.RequestOptions;
-import com.kfzs.appstore.utils.string.HexUtils;
 import com.kfzs.duanduan.datashare.DDProviderHelper;
 import com.kfzs.duanduan.datashare.provider.download.DownLoadInfo;
 import com.kfzs.duanduan.event.BigEvent;
 import com.kfzs.duanduan.event.EventTypes;
-import com.kfzs.duanduan.react.upfile.UpFileListener;
-import com.kfzs.duanduan.react.upfile.UpFileUtils;
-import com.sheep.gamegroup.absBase.BaseActivity;
-import com.sheep.gamegroup.di.components.DaggerTaskDetailComponent;
-import com.sheep.gamegroup.di.modules.TaskDetailModule;
 import com.sheep.gamegroup.model.entity.BaseMessage;
 import com.sheep.gamegroup.model.entity.CreditCard;
 import com.sheep.gamegroup.model.entity.Ext;
-import com.sheep.gamegroup.model.entity.TaskAcceptedEty;
 import com.sheep.gamegroup.model.entity.TaskEty;
 import com.sheep.gamegroup.model.entity.TaskReleaseEty;
-import com.sheep.gamegroup.model.entity.UploadResult;
 import com.sheep.gamegroup.model.util.SheepSubscriber;
-import com.sheep.gamegroup.presenter.TaskDetailContract;
-import com.sheep.gamegroup.presenter.TaskDetailPresenter;
 import com.sheep.gamegroup.util.DeviceUtil;
 import com.sheep.gamegroup.util.Jump2View;
 import com.sheep.gamegroup.util.TimeUtil;
 import com.sheep.gamegroup.util.UMConfigUtils;
-import com.sheep.gamegroup.view.dialog.DialogShowLoading;
 import com.sheep.jiuyan.samllsheep.BuildConfig;
 import com.sheep.jiuyan.samllsheep.R;
 import com.sheep.jiuyan.samllsheep.SheepApp;
@@ -58,15 +44,9 @@ import com.sheep.jiuyan.samllsheep.utils.TitleBarUtils;
 
 import org.greenrobot.eventbus.EventBus;
 
-import java.io.File;
-
-import javax.inject.Inject;
-
 import butterknife.BindView;
 import butterknife.ButterKnife;
 import butterknife.OnClick;
-import go.kfzssafe.Kfzssafe;
-import me.iwf.photopicker.PhotoPicker;
 import rx.android.schedulers.AndroidSchedulers;
 import rx.schedulers.Schedulers;
 
@@ -289,8 +269,7 @@ public class TaskDetailCreditCardAct extends AbsChooseImageActivity {
     }
 
     private void goWeb() {
-        Ext ext = JSONObject.parseObject(JSONObject.toJSONString(taskEty.getExt()), Ext.class);
-        SheepApp.getInstance().getNetComponent().getApiService().getCredit(ext.getId())
+        SheepApp.getInstance().getNetComponent().getApiService().getCredit(taskEty.getExtInfo().getId())
                 .subscribeOn(Schedulers.io())
                 .observeOn(AndroidSchedulers.mainThread())
                 .subscribe(new SheepSubscriber<BaseMessage>(activity) {
@@ -363,8 +342,6 @@ public class TaskDetailCreditCardAct extends AbsChooseImageActivity {
         setLoaddingText("完成");
         dismissLoaddingDialog();
         G.showToast("提交成功,等待审核!");
-        EventBus.getDefault().post(new BigEvent().setEventTypes(EventTypes.ONFRESH_TRYMAKEMANY_PAGE));
-        UMConfigUtils.finishTask();
         finish();
     }
 

+ 26 - 4
app/src/main/java/com/sheep/gamegroup/view/adapter/CreditCardProgressQueryAdp.java

@@ -9,8 +9,12 @@ import android.widget.ImageView;
 import android.widget.TextView;
 
 import com.bumptech.glide.Glide;
+import com.sheep.gamegroup.model.entity.CreditCardProgressQuery;
 import com.sheep.gamegroup.model.entity.TaskReleaseEty;
+import com.sheep.gamegroup.util.Jump2View;
+import com.sheep.gamegroup.view.activity.ActCreditCardTaskList;
 import com.sheep.jiuyan.samllsheep.R;
+import com.sheep.jiuyan.samllsheep.base.AbsChooseImageActivity;
 
 import java.util.List;
 
@@ -20,9 +24,9 @@ import java.util.List;
 
 public class CreditCardProgressQueryAdp extends BaseAdapter {
     private Context context;
-    private List<TaskReleaseEty> etyList;
+    private List<CreditCardProgressQuery> etyList;
 
-    public CreditCardProgressQueryAdp(Context context, List<TaskReleaseEty> etyList) {
+    public CreditCardProgressQueryAdp(Context context, List<CreditCardProgressQuery> etyList) {
         this.context = context;
         this.etyList = etyList;
     }
@@ -41,7 +45,6 @@ public class CreditCardProgressQueryAdp extends BaseAdapter {
     public long getItemId(int position) {
         return 0;
     }
-    private final static int[] ids = {R.drawable.ic_gold_credit_card_2, R.drawable.ic_ms_card};
     @Override
     public View getView(final int position, View convertView, ViewGroup parent) {
         Object tag = convertView == null ? null : convertView.getTag();
@@ -53,24 +56,43 @@ public class CreditCardProgressQueryAdp extends BaseAdapter {
             convertView = LayoutInflater.from(context).inflate(R.layout.credit_card_progress_query, null);
             holder.credit_card_task_iv = convertView.findViewById(R.id.credit_card_task_iv);
             holder.credit_card_task_name_tv = convertView.findViewById(R.id.credit_card_task_name_tv);
+            holder.credit_card_task_find_tv = convertView.findViewById(R.id.credit_card_task_find_tv);
+            holder.credit_card_task_upload_tv = convertView.findViewById(R.id.credit_card_task_upload_tv);
             holder.credit_card_task_tip1_tv = convertView.findViewById(R.id.credit_card_task_tip1_tv);
             holder.credit_card_task_tip2_tv = convertView.findViewById(R.id.credit_card_task_tip2_tv);
             convertView.setTag(holder);
         }
 
-        final TaskReleaseEty ety = (TaskReleaseEty) getItem(position);
+        final CreditCardProgressQuery creditCardProgressQuery = (CreditCardProgressQuery) getItem(position);
+        final TaskReleaseEty ety = creditCardProgressQuery.getTaskReleaseEty();
         Glide.with(context).load(ety.getTask().getIcon())
                 .into(holder.credit_card_task_iv);
         holder.credit_card_task_name_tv.setText(ety.getName());
         String[] remarks = ety.getTask().getRemarks().split(";");
         holder.credit_card_task_tip1_tv.setText(remarks.length > 0 ? remarks[0] : "");
         holder.credit_card_task_tip2_tv.setText("¥"+ety.getBonus());
+        holder.credit_card_task_find_tv.setOnClickListener(new View.OnClickListener() {
+            @Override
+            public void onClick(View view) {
+                Jump2View.getInstance().goWeb(context, ety.getTask().getExtInfo().getQuery_url(), "进度查询");
+            }
+        });
+        holder.credit_card_task_upload_tv.setOnClickListener(new View.OnClickListener() {
+            @Override
+            public void onClick(View view) {
+                if(context instanceof ActCreditCardTaskList){
+                    ((ActCreditCardTaskList) context).setTaskEty(ety.getTask());
+                    ((ActCreditCardTaskList) context).showChooseDialog(false, true, AbsChooseImageActivity.DEFAULT_MAX_COUNT);
+                }
+            }
+        });
         return convertView;
     }
 
     class ViewHolder{
         ImageView credit_card_task_iv;
         TextView credit_card_task_name_tv;
+        TextView credit_card_task_find_tv, credit_card_task_upload_tv;
         TextView credit_card_task_tip1_tv, credit_card_task_tip2_tv;
     }
 

+ 0 - 3
app/src/main/java/com/sheep/gamegroup/view/adapter/NewbieTaskAdp.java

@@ -112,15 +112,12 @@ public class NewbieTaskAdp extends BaseAdapter {
                     break;
                 case 2://完成首次提现
                     Jump2View.getInstance().goWithdrawal(context, null);
-                    UMConfigUtils.onEvent(UMConfigUtils.Event.SHEEP_TIXIAN);
                     break;
                 case 3://成功邀请好友
                     Jump2View.getInstance().goAskGetMoney(context, null);
-                    UMConfigUtils.onEvent(UMConfigUtils.Event.SHEEP_TASK_INVITE);
                     break;
                 case 4://首次完成任务
                     Jump2View.getInstance().goTryplayView(context, null);
-                    UMConfigUtils.onEvent(UMConfigUtils.Event.SHEEP_TASK_TRY);
                     break;
                 case 5://注册账号并登录
                     if(BuildConfig.DEBUG){

+ 1 - 1
app/src/main/res/layout/credit_card_progress_query.xml

@@ -41,7 +41,7 @@
                 android:text="进度查询" />
             <TextView
                 android:id="@+id/credit_card_task_upload_tv"
-                style="@style/style_button_small"
+                style="@style/style_button_small_yellow"
                 android:layout_marginTop="@dimen/content_padding_15"
                 android:layout_width="90dp"
                 android:layout_height="26dp"

+ 8 - 0
app/src/main/res/values/dd_styles.xml

@@ -81,6 +81,14 @@
         <item name="android:textColor">@color/btn_color_main</item>
         <item name="android:textSize">@dimen/text_size_15</item>
     </style>
+    <style name="style_button_small_yellow" parent="button">
+        <item name="android:layout_width">70dp</item>
+        <item name="android:layout_height">30dp</item>
+        <item name="android:gravity">center</item>
+        <item name="android:background">@drawable/sp_bg_gradient_rectangle_yellow</item>
+        <item name="android:textColor">@color/btn_color_main</item>
+        <item name="android:textSize">@dimen/text_size_15</item>
+    </style>
     <style name="full.button_main" parent="button">
         <item name="android:background">@drawable/selector_button_full_main</item>
         <item name="android:textColor">@color/btn_color_main</item>