|
|
@@ -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);
|
|
|
+ }
|
|
|
+ });
|
|
|
+ }
|
|
|
}
|