Procházet zdrojové kódy

for newspring mission

hanjing před 7 roky
rodič
revize
227c8ac827

+ 2 - 1
app/src/main/java/com/sheep/gamegroup/di/modules/NetModule.java

@@ -49,7 +49,8 @@ public class NetModule {
     public Retrofit provideRetrofit(OkHttpClient okhttpClient) {
         Retrofit retrofit = new Retrofit.Builder()
                 .client(okhttpClient)
-                .baseUrl(SheepApp.getInstance().getConnectAddress().getAppUrl()+"v1/")
+//                .baseUrl(SheepApp.getInstance().getConnectAddress().getAppUrl()+"v1/")
+                .baseUrl("http://10.8.240.169:8080/"+"v1/")
                 .addConverterFactory(StringConverterFactory.create())
                 .addConverterFactory(FastJsonConverterFactory.create())
 //                .addConverterFactory(GsonConverterFactory.create(EntityUtils.gson))//

+ 15 - 15
app/src/main/java/com/sheep/gamegroup/greendao/download/DaoMaster.java

@@ -21,26 +21,26 @@ public class DaoMaster extends AbstractDaoMaster {
 
     /** Creates underlying database table using DAOs. */
     public static void createAllTables(Database db, boolean ifNotExists) {
-        AcceptTaskRecordDao.createTable(db, ifNotExists);
-        AccountDao.createTable(db, ifNotExists);
-        AppdownloadBeanDao.createTable(db, ifNotExists);
-        DownLoadInfoDao.createTable(db, ifNotExists);
         ProcessRecordDao.createTable(db, ifNotExists);
-        ScreenShotRecordDao.createTable(db, ifNotExists);
+        AppdownloadBeanDao.createTable(db, ifNotExists);
         SdkLoginUserDao.createTable(db, ifNotExists);
+        ScreenShotRecordDao.createTable(db, ifNotExists);
+        AcceptTaskRecordDao.createTable(db, ifNotExists);
+        AccountDao.createTable(db, ifNotExists);
         SearchRecordDao.createTable(db, ifNotExists);
+        DownLoadInfoDao.createTable(db, ifNotExists);
     }
 
     /** Drops underlying database table using DAOs. */
     public static void dropAllTables(Database db, boolean ifExists) {
-        AcceptTaskRecordDao.dropTable(db, ifExists);
-        AccountDao.dropTable(db, ifExists);
-        AppdownloadBeanDao.dropTable(db, ifExists);
-        DownLoadInfoDao.dropTable(db, ifExists);
         ProcessRecordDao.dropTable(db, ifExists);
-        ScreenShotRecordDao.dropTable(db, ifExists);
+        AppdownloadBeanDao.dropTable(db, ifExists);
         SdkLoginUserDao.dropTable(db, ifExists);
+        ScreenShotRecordDao.dropTable(db, ifExists);
+        AcceptTaskRecordDao.dropTable(db, ifExists);
+        AccountDao.dropTable(db, ifExists);
         SearchRecordDao.dropTable(db, ifExists);
+        DownLoadInfoDao.dropTable(db, ifExists);
     }
 
     /**
@@ -59,14 +59,14 @@ public class DaoMaster extends AbstractDaoMaster {
 
     public DaoMaster(Database db) {
         super(db, SCHEMA_VERSION);
-        registerDaoClass(AcceptTaskRecordDao.class);
-        registerDaoClass(AccountDao.class);
-        registerDaoClass(AppdownloadBeanDao.class);
-        registerDaoClass(DownLoadInfoDao.class);
         registerDaoClass(ProcessRecordDao.class);
-        registerDaoClass(ScreenShotRecordDao.class);
+        registerDaoClass(AppdownloadBeanDao.class);
         registerDaoClass(SdkLoginUserDao.class);
+        registerDaoClass(ScreenShotRecordDao.class);
+        registerDaoClass(AcceptTaskRecordDao.class);
+        registerDaoClass(AccountDao.class);
         registerDaoClass(SearchRecordDao.class);
+        registerDaoClass(DownLoadInfoDao.class);
     }
 
     public DaoSession newSession() {

+ 61 - 61
app/src/main/java/com/sheep/gamegroup/greendao/download/DaoSession.java

@@ -8,23 +8,23 @@ import org.greenrobot.greendao.database.Database;
 import org.greenrobot.greendao.identityscope.IdentityScopeType;
 import org.greenrobot.greendao.internal.DaoConfig;
 
-import com.sheep.gamegroup.greendao.download.AcceptTaskRecord;
-import com.sheep.gamegroup.greendao.download.Account;
-import com.sheep.gamegroup.greendao.download.AppdownloadBean;
-import com.sheep.gamegroup.greendao.download.DownLoadInfo;
 import com.sheep.gamegroup.greendao.download.ProcessRecord;
-import com.sheep.gamegroup.greendao.download.ScreenShotRecord;
+import com.sheep.gamegroup.greendao.download.AppdownloadBean;
 import com.sheep.gamegroup.greendao.download.SdkLoginUser;
+import com.sheep.gamegroup.greendao.download.ScreenShotRecord;
+import com.sheep.gamegroup.greendao.download.AcceptTaskRecord;
+import com.sheep.gamegroup.greendao.download.Account;
 import com.sheep.gamegroup.greendao.download.SearchRecord;
+import com.sheep.gamegroup.greendao.download.DownLoadInfo;
 
-import com.sheep.gamegroup.greendao.download.AcceptTaskRecordDao;
-import com.sheep.gamegroup.greendao.download.AccountDao;
-import com.sheep.gamegroup.greendao.download.AppdownloadBeanDao;
-import com.sheep.gamegroup.greendao.download.DownLoadInfoDao;
 import com.sheep.gamegroup.greendao.download.ProcessRecordDao;
-import com.sheep.gamegroup.greendao.download.ScreenShotRecordDao;
+import com.sheep.gamegroup.greendao.download.AppdownloadBeanDao;
 import com.sheep.gamegroup.greendao.download.SdkLoginUserDao;
+import com.sheep.gamegroup.greendao.download.ScreenShotRecordDao;
+import com.sheep.gamegroup.greendao.download.AcceptTaskRecordDao;
+import com.sheep.gamegroup.greendao.download.AccountDao;
 import com.sheep.gamegroup.greendao.download.SearchRecordDao;
+import com.sheep.gamegroup.greendao.download.DownLoadInfoDao;
 
 // THIS CODE IS GENERATED BY greenDAO, DO NOT EDIT.
 
@@ -35,112 +35,112 @@ import com.sheep.gamegroup.greendao.download.SearchRecordDao;
  */
 public class DaoSession extends AbstractDaoSession {
 
-    private final DaoConfig acceptTaskRecordDaoConfig;
-    private final DaoConfig accountDaoConfig;
-    private final DaoConfig appdownloadBeanDaoConfig;
-    private final DaoConfig downLoadInfoDaoConfig;
     private final DaoConfig processRecordDaoConfig;
-    private final DaoConfig screenShotRecordDaoConfig;
+    private final DaoConfig appdownloadBeanDaoConfig;
     private final DaoConfig sdkLoginUserDaoConfig;
+    private final DaoConfig screenShotRecordDaoConfig;
+    private final DaoConfig acceptTaskRecordDaoConfig;
+    private final DaoConfig accountDaoConfig;
     private final DaoConfig searchRecordDaoConfig;
+    private final DaoConfig downLoadInfoDaoConfig;
 
-    private final AcceptTaskRecordDao acceptTaskRecordDao;
-    private final AccountDao accountDao;
-    private final AppdownloadBeanDao appdownloadBeanDao;
-    private final DownLoadInfoDao downLoadInfoDao;
     private final ProcessRecordDao processRecordDao;
-    private final ScreenShotRecordDao screenShotRecordDao;
+    private final AppdownloadBeanDao appdownloadBeanDao;
     private final SdkLoginUserDao sdkLoginUserDao;
+    private final ScreenShotRecordDao screenShotRecordDao;
+    private final AcceptTaskRecordDao acceptTaskRecordDao;
+    private final AccountDao accountDao;
     private final SearchRecordDao searchRecordDao;
+    private final DownLoadInfoDao downLoadInfoDao;
 
     public DaoSession(Database db, IdentityScopeType type, Map<Class<? extends AbstractDao<?, ?>>, DaoConfig>
             daoConfigMap) {
         super(db);
 
-        acceptTaskRecordDaoConfig = daoConfigMap.get(AcceptTaskRecordDao.class).clone();
-        acceptTaskRecordDaoConfig.initIdentityScope(type);
-
-        accountDaoConfig = daoConfigMap.get(AccountDao.class).clone();
-        accountDaoConfig.initIdentityScope(type);
+        processRecordDaoConfig = daoConfigMap.get(ProcessRecordDao.class).clone();
+        processRecordDaoConfig.initIdentityScope(type);
 
         appdownloadBeanDaoConfig = daoConfigMap.get(AppdownloadBeanDao.class).clone();
         appdownloadBeanDaoConfig.initIdentityScope(type);
 
-        downLoadInfoDaoConfig = daoConfigMap.get(DownLoadInfoDao.class).clone();
-        downLoadInfoDaoConfig.initIdentityScope(type);
-
-        processRecordDaoConfig = daoConfigMap.get(ProcessRecordDao.class).clone();
-        processRecordDaoConfig.initIdentityScope(type);
+        sdkLoginUserDaoConfig = daoConfigMap.get(SdkLoginUserDao.class).clone();
+        sdkLoginUserDaoConfig.initIdentityScope(type);
 
         screenShotRecordDaoConfig = daoConfigMap.get(ScreenShotRecordDao.class).clone();
         screenShotRecordDaoConfig.initIdentityScope(type);
 
-        sdkLoginUserDaoConfig = daoConfigMap.get(SdkLoginUserDao.class).clone();
-        sdkLoginUserDaoConfig.initIdentityScope(type);
+        acceptTaskRecordDaoConfig = daoConfigMap.get(AcceptTaskRecordDao.class).clone();
+        acceptTaskRecordDaoConfig.initIdentityScope(type);
+
+        accountDaoConfig = daoConfigMap.get(AccountDao.class).clone();
+        accountDaoConfig.initIdentityScope(type);
 
         searchRecordDaoConfig = daoConfigMap.get(SearchRecordDao.class).clone();
         searchRecordDaoConfig.initIdentityScope(type);
 
-        acceptTaskRecordDao = new AcceptTaskRecordDao(acceptTaskRecordDaoConfig, this);
-        accountDao = new AccountDao(accountDaoConfig, this);
-        appdownloadBeanDao = new AppdownloadBeanDao(appdownloadBeanDaoConfig, this);
-        downLoadInfoDao = new DownLoadInfoDao(downLoadInfoDaoConfig, this);
+        downLoadInfoDaoConfig = daoConfigMap.get(DownLoadInfoDao.class).clone();
+        downLoadInfoDaoConfig.initIdentityScope(type);
+
         processRecordDao = new ProcessRecordDao(processRecordDaoConfig, this);
-        screenShotRecordDao = new ScreenShotRecordDao(screenShotRecordDaoConfig, this);
+        appdownloadBeanDao = new AppdownloadBeanDao(appdownloadBeanDaoConfig, this);
         sdkLoginUserDao = new SdkLoginUserDao(sdkLoginUserDaoConfig, this);
+        screenShotRecordDao = new ScreenShotRecordDao(screenShotRecordDaoConfig, this);
+        acceptTaskRecordDao = new AcceptTaskRecordDao(acceptTaskRecordDaoConfig, this);
+        accountDao = new AccountDao(accountDaoConfig, this);
         searchRecordDao = new SearchRecordDao(searchRecordDaoConfig, this);
+        downLoadInfoDao = new DownLoadInfoDao(downLoadInfoDaoConfig, this);
 
-        registerDao(AcceptTaskRecord.class, acceptTaskRecordDao);
-        registerDao(Account.class, accountDao);
-        registerDao(AppdownloadBean.class, appdownloadBeanDao);
-        registerDao(DownLoadInfo.class, downLoadInfoDao);
         registerDao(ProcessRecord.class, processRecordDao);
-        registerDao(ScreenShotRecord.class, screenShotRecordDao);
+        registerDao(AppdownloadBean.class, appdownloadBeanDao);
         registerDao(SdkLoginUser.class, sdkLoginUserDao);
+        registerDao(ScreenShotRecord.class, screenShotRecordDao);
+        registerDao(AcceptTaskRecord.class, acceptTaskRecordDao);
+        registerDao(Account.class, accountDao);
         registerDao(SearchRecord.class, searchRecordDao);
+        registerDao(DownLoadInfo.class, downLoadInfoDao);
     }
     
     public void clear() {
-        acceptTaskRecordDaoConfig.clearIdentityScope();
-        accountDaoConfig.clearIdentityScope();
-        appdownloadBeanDaoConfig.clearIdentityScope();
-        downLoadInfoDaoConfig.clearIdentityScope();
         processRecordDaoConfig.clearIdentityScope();
-        screenShotRecordDaoConfig.clearIdentityScope();
+        appdownloadBeanDaoConfig.clearIdentityScope();
         sdkLoginUserDaoConfig.clearIdentityScope();
+        screenShotRecordDaoConfig.clearIdentityScope();
+        acceptTaskRecordDaoConfig.clearIdentityScope();
+        accountDaoConfig.clearIdentityScope();
         searchRecordDaoConfig.clearIdentityScope();
+        downLoadInfoDaoConfig.clearIdentityScope();
     }
 
-    public AcceptTaskRecordDao getAcceptTaskRecordDao() {
-        return acceptTaskRecordDao;
-    }
-
-    public AccountDao getAccountDao() {
-        return accountDao;
+    public ProcessRecordDao getProcessRecordDao() {
+        return processRecordDao;
     }
 
     public AppdownloadBeanDao getAppdownloadBeanDao() {
         return appdownloadBeanDao;
     }
 
-    public DownLoadInfoDao getDownLoadInfoDao() {
-        return downLoadInfoDao;
-    }
-
-    public ProcessRecordDao getProcessRecordDao() {
-        return processRecordDao;
+    public SdkLoginUserDao getSdkLoginUserDao() {
+        return sdkLoginUserDao;
     }
 
     public ScreenShotRecordDao getScreenShotRecordDao() {
         return screenShotRecordDao;
     }
 
-    public SdkLoginUserDao getSdkLoginUserDao() {
-        return sdkLoginUserDao;
+    public AcceptTaskRecordDao getAcceptTaskRecordDao() {
+        return acceptTaskRecordDao;
+    }
+
+    public AccountDao getAccountDao() {
+        return accountDao;
     }
 
     public SearchRecordDao getSearchRecordDao() {
         return searchRecordDao;
     }
 
+    public DownLoadInfoDao getDownLoadInfoDao() {
+        return downLoadInfoDao;
+    }
+
 }

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

@@ -1713,5 +1713,14 @@ public interface ApiService {
     @GET(ApiKey.getFindUserLike)
     Observable<BaseMessage> getFindUserLike();
 //---------------------------end 小绵羊3.4.10新增 -- app/game_group 游戏组-------------------------------------
+//---------------------------start 小绵羊3.4.10新增 -- app/mission 春节活动-------------------------------------
 
+    /**
+     * 执行活动任务
+     * act 任务标识
+     */
+    @POST("app/mission/newspring/execute")
+    Observable<BaseMessage> missionExecute(@Body JSONObject jsonObject);
+
+//---------------------------end 小绵羊3.4.10新增 -- app/mission 春节活动-------------------------------------
 }

+ 28 - 26
app/src/main/java/com/sheep/gamegroup/statistics/AppStatistics.java

@@ -6,6 +6,7 @@ import com.sheep.gamegroup.model.api.ApiService;
 import com.sheep.gamegroup.model.entity.BaseMessage;
 import com.sheep.gamegroup.model.util.SheepSubscriber;
 import com.sheep.gamegroup.util.DataUtil;
+import com.sheep.jiuyan.samllsheep.BuildConfig;
 import com.sheep.jiuyan.samllsheep.SheepApp;
 
 import io.reactivex.android.schedulers.AndroidSchedulers;
@@ -19,12 +20,13 @@ public class AppStatistics {
     private static AppStatistics instance = null;
 
 
-    private AppStatistics(){}
+    private AppStatistics() {
+    }
 
-    public static AppStatistics getInstance(){
-        if(instance == null){
-            synchronized (AppStatistics.class){
-                if(instance == null){
+    public static AppStatistics getInstance() {
+        if (instance == null) {
+            synchronized (AppStatistics.class) {
+                if (instance == null) {
                     instance = new AppStatistics();
                 }
             }
@@ -36,31 +38,31 @@ public class AppStatistics {
     /**
      * 向服务器发送统计的数据
      *
-     * @param type    大类型 参考 AppStatisticsConfig
-     *
+     * @param type      大类型 参考 AppStatisticsConfig
      * @param subType
-     *
      * @param subString
      */
-    synchronized public void sendDataToServer(int type,int subType,String subString){
-        ApiService apiService =SheepApp.getInstance().getNetComponent().getApiService();
-        JSONObject jsonObject = new JSONObject();
-        jsonObject.put("uid", NumberFormatUtils.parseInteger(DataUtil.getInstance().getUserId()));
-        jsonObject.put("type",type);
-        jsonObject.put("subtype",subType);
-        jsonObject.put("substring",subString);
-        jsonObject.put("invitation_code", DataUtil.getInstance().getUserParentCode());
-        apiService.appEventTracking(jsonObject).subscribeOn(Schedulers.io())
-                .observeOn(AndroidSchedulers.mainThread())
-                .subscribe(new SheepSubscriber<BaseMessage>(SheepApp.getInstance()) {
-                    @Override
-                    public void onError(BaseMessage baseMessage) {
-                    }
+    synchronized public void sendDataToServer(int type, int subType, String subString) {
+        if (!BuildConfig.DEBUG) {
+            ApiService apiService = SheepApp.getInstance().getNetComponent().getApiService();
+            JSONObject jsonObject = new JSONObject();
+            jsonObject.put("uid", NumberFormatUtils.parseInteger(DataUtil.getInstance().getUserId()));
+            jsonObject.put("type", type);
+            jsonObject.put("subtype", subType);
+            jsonObject.put("substring", subString);
+            jsonObject.put("invitation_code", DataUtil.getInstance().getUserParentCode());
+            apiService.appEventTracking(jsonObject).subscribeOn(Schedulers.io())
+                    .observeOn(AndroidSchedulers.mainThread())
+                    .subscribe(new SheepSubscriber<BaseMessage>(SheepApp.getInstance()) {
+                        @Override
+                        public void onError(BaseMessage baseMessage) {
+                        }
 
-                    @Override
-                    public void onNext(BaseMessage baseMessage) {
-                    }
-                });
+                        @Override
+                        public void onNext(BaseMessage baseMessage) {
+                        }
+                    });
+        }
     }
 
 }

+ 26 - 1
app/src/main/java/com/sheep/gamegroup/util/js/KFZSJs.java

@@ -2,6 +2,7 @@ package com.sheep.gamegroup.util.js;
 
 import android.app.Activity;
 import android.content.Intent;
+import android.provider.MediaStore;
 import android.text.TextUtils;
 import android.webkit.JavascriptInterface;
 
@@ -22,6 +23,8 @@ import com.sheep.gamegroup.util.LogUtil;
 import com.sheep.gamegroup.util.QQUtil;
 import com.sheep.gamegroup.util.SysAppUtil;
 import com.sheep.gamegroup.util.share.ShareLinkConfig;
+import com.sheep.gamegroup.view.activity.ActInvitation;
+import com.sheep.gamegroup.view.activity.ActMain;
 import com.sheep.jiuyan.samllsheep.R;
 import com.sheep.jiuyan.samllsheep.SheepApp;
 import com.sheep.jiuyan.samllsheep.utils.G;
@@ -92,6 +95,18 @@ public class KFZSJs {
     }
 
     @JavascriptInterface
+    public void gotoMain(int tab) {
+        Intent mainIntent = new Intent(activity, ActMain.class);
+        mainIntent.putExtra("SWITCH_TAB", tab);
+        activity.startActivity(mainIntent);
+    }
+
+    @JavascriptInterface
+    public void gotoPublicVideo(){
+        Jump2View.getInstance().gotoActPublishArticle(MediaStore.Files.FileColumns.MEDIA_TYPE_VIDEO);
+    }
+
+    @JavascriptInterface
     public void gotoWeb(String url, String title) {
         if (!TextUtils.isEmpty(url)) {
             if (TextUtils.isEmpty(title)) {
@@ -109,7 +124,7 @@ public class KFZSJs {
 
     @JavascriptInterface
     public void gotoRecharge(boolean forResult) {
-        if(forResult){
+        if (forResult) {
             Jump2View.getInstance().goRechargeActForResult(activity, "内部H5");//进入充值绵羊币界面
         } else {
             Jump2View.getInstance().goRechargeAct(activity, "内部H5");//进入充值绵羊币界面
@@ -167,6 +182,16 @@ public class KFZSJs {
     }
 
     @JavascriptInterface
+    public void sharePic(int forMission, String picUrl) {
+        activity.runOnUiThread(() -> {
+            Intent intent = new Intent(activity, ActInvitation.class);
+            intent.putExtra("pic_url", picUrl);
+            intent.putExtra("for_mission", forMission);
+            activity.startActivity(intent);
+        });
+    }
+
+    @JavascriptInterface
     public String getHeader() {
         return SpUtils.getToken(activity);
     }

+ 74 - 2
app/src/main/java/com/sheep/gamegroup/view/activity/ActInvitation.java

@@ -11,6 +11,7 @@ import android.support.constraint.ConstraintLayout;
 import android.support.v4.view.ViewPager;
 import android.support.v7.widget.GridLayoutManager;
 import android.support.v7.widget.RecyclerView;
+import android.text.TextUtils;
 import android.util.SparseArray;
 import android.view.LayoutInflater;
 import android.view.MotionEvent;
@@ -20,6 +21,7 @@ import android.widget.ImageView;
 import android.widget.RelativeLayout;
 import android.widget.TextView;
 
+import com.alibaba.fastjson.JSONObject;
 import com.bumptech.glide.Glide;
 import com.bumptech.glide.load.DataSource;
 import com.bumptech.glide.load.engine.GlideException;
@@ -40,6 +42,7 @@ import com.sheep.gamegroup.util.CommonUtil;
 import com.sheep.gamegroup.util.DataUtil;
 import com.sheep.gamegroup.util.GlideImageLoader;
 import com.sheep.gamegroup.util.ListUtil;
+import com.sheep.gamegroup.util.LogUtil;
 import com.sheep.gamegroup.util.ViewHolder;
 import com.sheep.gamegroup.util.ViewUtil;
 import com.sheep.gamegroup.util.share.ShareLinkConfig;
@@ -52,6 +55,8 @@ import com.sheep.jiuyan.samllsheep.utils.ClassFileHelper;
 import com.sheep.jiuyan.samllsheep.utils.FileUtil;
 import com.sheep.jiuyan.samllsheep.utils.G;
 import com.sheep.jiuyan.samllsheep.utils.TitleBarUtils;
+import com.umeng.socialize.UMShareListener;
+import com.umeng.socialize.bean.SHARE_MEDIA;
 
 import java.io.File;
 import java.util.ArrayList;
@@ -85,10 +90,19 @@ public class ActInvitation extends BaseUMActivity {
     @BindView(R.id.main_layout)
     ConstraintLayout main_layout;
 
+    int forMission=0;
+    String picParamUrl;
+
     @Override
     protected void onCreate(@Nullable Bundle savedInstanceState) {
         StatusBarUtils.setTranslucent(this);
         super.onCreate(savedInstanceState);
+        if (getIntent().hasExtra("pic_url")) {
+            picParamUrl = getIntent().getStringExtra("pic_url");
+        }
+        if (getIntent().hasExtra("for_mission")) {
+            forMission = getIntent().getIntExtra("for_mission", 0);
+        }
     }
 
     @Override
@@ -145,7 +159,13 @@ public class ActInvitation extends BaseUMActivity {
                     @Override
                     public void onNext(BaseMessage baseMessage) {
                         load++;
-                        mPictureList.addAll(baseMessage.getDataList(PictureInvitationEntity.class));
+                        if (TextUtils.isEmpty(picParamUrl)) {
+                            mPictureList.addAll(baseMessage.getDataList(PictureInvitationEntity.class));
+                        } else {
+                            PictureInvitationEntity picEn = baseMessage.getDataList(PictureInvitationEntity.class).get(0);
+                            picEn.setPicture(picParamUrl);
+                            mPictureList.add(picEn);
+                        }
                         loadData();
                         checkLoadFinish();
                     }
@@ -414,7 +434,40 @@ public class ActInvitation extends BaseUMActivity {
                             G.showToast("图片正在加载中,请稍等");
                             return;
                         }
-                        new ShareLinkConfig().setLink(url).setShareType(item).setDes(description).setFile(file).setType(ShareLinkConfig.IMG).toShare(ActInvitation.this);
+                        new ShareLinkConfig()
+                                .setLink(url)
+                                .setShareType(item)
+                                .setDes(description)
+                                .setFile(file)
+                                .setType(ShareLinkConfig.IMG)
+                                .toShare(ActInvitation.this, new UMShareListener() {
+
+                                    @Override
+                                    public void onStart(SHARE_MEDIA share_media) {
+
+                                    }
+
+                                    @Override
+                                    public void onResult(SHARE_MEDIA share_media) {
+                                        if (TextUtils.isEmpty(picParamUrl)) {
+                                            callMissionExecute(2);
+                                        } else {
+                                            if (forMission>0) {
+                                                callMissionExecute(forMission);
+                                            }
+                                        }
+                                    }
+
+                                    @Override
+                                    public void onError(SHARE_MEDIA share_media, Throwable throwable) {
+
+                                    }
+
+                                    @Override
+                                    public void onCancel(SHARE_MEDIA share_media) {
+
+                                    }
+                                });
                     }
                 });
             }
@@ -422,4 +475,23 @@ public class ActInvitation extends BaseUMActivity {
         ask_share_list.setAdapter(adapter);
     }
 
+    private void callMissionExecute(int act) {
+        JSONObject json = new JSONObject();
+        json.put("act", act);
+        SheepApp.getInstance().getNetComponent().getApiService()
+                .missionExecute(json)
+                .subscribeOn(Schedulers.io())
+                .observeOn(AndroidSchedulers.mainThread())
+                .subscribe(new SheepSubscriber<BaseMessage>(SheepApp.getInstance()) {
+                    @Override
+                    public void onError(BaseMessage baseMessage) {
+                        LogUtil.logE(baseMessage.getErrorMsg() + " " + baseMessage.getMsg());
+                    }
+
+                    @Override
+                    public void onNext(BaseMessage baseMessage) {
+                    }
+                });
+    }
+
 }

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

@@ -89,6 +89,8 @@ public class ActMain extends BaseActYmPermissionCheck {
         if ("LOGOUT".equals(intent.getStringExtra("INTENT_ACTION"))) {
             Jump2View.getInstance().goLoginView(this, "");
             finish();
+        } else if (intent.hasExtra("SWITCH_TAB")) {
+            switchFragment(intent.getIntExtra("SWITCH_TAB", 0));
         }
     }
 
@@ -168,7 +170,7 @@ public class ActMain extends BaseActYmPermissionCheck {
     private void initFragments() {
         //小绵羊3.4.10新增 判断用户是否是游戏用户,是的话默认打开游戏界面
         UserEntity userEntity = DataUtil.getInstance().getUserEntity();
-        if(userEntity != null && userEntity.isGameUser()){
+        if (userEntity != null && userEntity.isGameUser()) {
             lastPosition = MainTab.FgtGameCenter.ordinal();
         }
 

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

@@ -8,6 +8,7 @@ import android.view.View;
 import android.widget.EditText;
 import android.widget.ImageView;
 
+import com.alibaba.fastjson.JSONObject;
 import com.bumptech.glide.Glide;
 import com.bumptech.glide.request.RequestOptions;
 import com.chad.library.adapter.base.BaseQuickAdapter;
@@ -40,7 +41,6 @@ import com.sheep.jiuyan.samllsheep.utils.TitleBarUtils;
 
 import org.greenrobot.eventbus.Subscribe;
 import org.json.JSONException;
-import org.json.JSONObject;
 
 import java.io.File;
 import java.util.Locale;
@@ -313,6 +313,22 @@ public class ActPublishArticle extends BaseActivity {
                                 ActPublishArticle.this.finish();
                             }
                         },1);
+                        JSONObject json = new JSONObject();
+                        json.put("act", 6);
+                        SheepApp.getInstance().getNetComponent().getApiService()
+                                .missionExecute(json)
+                                .subscribeOn(Schedulers.io())
+                                .observeOn(AndroidSchedulers.mainThread())
+                                .subscribe(new SheepSubscriber<BaseMessage>(SheepApp.getInstance()) {
+                                    @Override
+                                    public void onError(BaseMessage baseMessage) {
+                                        LogUtil.logE(baseMessage.getErrorMsg() + " " + baseMessage.getMsg());
+                                    }
+
+                                    @Override
+                                    public void onNext(BaseMessage baseMessage) {
+                                    }
+                                });
                     }
 
                     @Override

+ 19 - 0
app/src/main/java/com/sheep/gamegroup/view/activity/RechargeAct.java

@@ -14,6 +14,7 @@ import com.sheep.gamegroup.model.entity.RechargeEntity;
 import com.sheep.gamegroup.model.entity.RechargePriceEntity;
 import com.sheep.gamegroup.model.util.SheepSubscriber;
 import com.sheep.gamegroup.util.Jump2View;
+import com.sheep.gamegroup.util.LogUtil;
 import com.sheep.gamegroup.util.MyGridview;
 import com.sheep.gamegroup.view.adapter.RechargeAdapter;
 import com.sheep.gamegroup.view.adapter.RechargePriceAdapter;
@@ -257,6 +258,24 @@ public class RechargeAct extends BaseActivity {
 //						String resultInfo = payResult.getResult();// 同步返回需要验证的信息
 
                         String resultStatus = payResult.getResultStatus();
+                        if ("9000".equals(resultStatus)) {
+                            JSONObject json = new JSONObject();
+                            json.put("act", 4);
+                            SheepApp.getInstance().getNetComponent().getApiService()
+                                    .missionExecute(json)
+                                    .subscribeOn(Schedulers.io())
+                                    .observeOn(AndroidSchedulers.mainThread())
+                                    .subscribe(new SheepSubscriber<BaseMessage>(SheepApp.getInstance()) {
+                                        @Override
+                                        public void onError(BaseMessage baseMessage) {
+                                            LogUtil.logE(baseMessage.getErrorMsg() + " " + baseMessage.getMsg());
+                                        }
+
+                                        @Override
+                                        public void onNext(BaseMessage baseMessage) {
+                                        }
+                                    });
+                        }
                         if (forResult && "9000".equals(resultStatus)) {
                             Intent intent = new Intent();
                             intent.putExtra("amount", Integer.parseInt(mAmount));

+ 31 - 6
app/src/main/java/com/sheep/gamegroup/view/fragment/FgtArticleComment.java

@@ -15,6 +15,7 @@ import android.widget.ImageView;
 import android.widget.RelativeLayout;
 import android.widget.TextView;
 
+import com.alibaba.fastjson.JSONObject;
 import com.scwang.smartrefresh.layout.SmartRefreshLayout;
 import com.scwang.smartrefresh.layout.api.RefreshLayout;
 import com.scwang.smartrefresh.layout.listener.OnRefreshLoadMoreListener;
@@ -33,6 +34,7 @@ import com.sheep.gamegroup.util.DataUtil;
 import com.sheep.gamegroup.util.DownloadUtil;
 import com.sheep.gamegroup.util.GlideImageLoader;
 import com.sheep.gamegroup.util.Jump2View;
+import com.sheep.gamegroup.util.LogUtil;
 import com.sheep.gamegroup.util.RefreshUtil;
 import com.sheep.gamegroup.util.TestUtil;
 import com.sheep.gamegroup.util.TimeUtil;
@@ -97,7 +99,7 @@ public class FgtArticleComment extends BaseListFragment3<UserComment> implements
                     @Override
                     public void onClick(View view) {
                         FIND_SHARE.onEvent("find_id", article_id);
-                        if(article == null){
+                        if (article == null) {
                             Jump2View.getInstance().tryShare(activity, "find_share_url", "find_id", article_id);
                         } else {
                             Jump2View.getInstance().tryShare(activity, "find_share_url", "find_id", article_id, article.getTitle());
@@ -162,6 +164,22 @@ public class FgtArticleComment extends BaseListFragment3<UserComment> implements
                                 refreshData();
                             }
                         });
+                        JSONObject json = new JSONObject();
+                        json.put("act", 7);
+                        SheepApp.getInstance().getNetComponent().getApiService()
+                                .missionExecute(json)
+                                .subscribeOn(Schedulers.io())
+                                .observeOn(AndroidSchedulers.mainThread())
+                                .subscribe(new SheepSubscriber<BaseMessage>(SheepApp.getInstance()) {
+                                    @Override
+                                    public void onError(BaseMessage baseMessage) {
+                                        LogUtil.logE(baseMessage.getErrorMsg() + " " + baseMessage.getMsg());
+                                    }
+
+                                    @Override
+                                    public void onNext(BaseMessage baseMessage) {
+                                    }
+                                });
                     }
 
                     @Override
@@ -221,6 +239,7 @@ public class FgtArticleComment extends BaseListFragment3<UserComment> implements
 
 
     private WebViewVideoHelper webViewVideoHelper = new WebViewVideoHelper();
+
     private void loadTop(View itemView) {
         TextView find_information_name = (TextView) itemView.findViewById(R.id.find_information_name);
         TextView find_information_time = (TextView) itemView.findViewById(R.id.find_information_time);
@@ -235,6 +254,7 @@ public class FgtArticleComment extends BaseListFragment3<UserComment> implements
 
 
     }
+
     private TaskHelper taskHelper = new TaskHelper(this);
 
     private void loadBottom() {
@@ -250,6 +270,7 @@ public class FgtArticleComment extends BaseListFragment3<UserComment> implements
             find_information_bottom_item_game.setVisibility(View.GONE);
         }
     }
+
     private void loadGame(View itemView) {
         itemView.setVisibility(View.VISIBLE);
         ImageView find_information_game_icon = (ImageView) itemView.findViewById(R.id.find_information_game_icon);
@@ -278,7 +299,7 @@ public class FgtArticleComment extends BaseListFragment3<UserComment> implements
     }
 
     public void initArticle() {
-        if(article == null) {//第一次才调用该方法,之后都是刷新操作
+        if (article == null) {//第一次才调用该方法,之后都是刷新操作
             Article data = DataUtil.getInstance().getCacheResult(ApiKey.articlesItem(article_id), Article.class);
             if (data != null) {
                 loadFindItem(data);
@@ -303,6 +324,7 @@ public class FgtArticleComment extends BaseListFragment3<UserComment> implements
                     }
                 });
     }
+
     private void loadFindItem(Article data) {
         if (data != null) {
             taskHelper.clear();
@@ -320,7 +342,7 @@ public class FgtArticleComment extends BaseListFragment3<UserComment> implements
     private Applications findApp;
 
     private void initFindApp(final int application_id) {
-        if(findApp == null) {
+        if (findApp == null) {
             Applications cacheResult = DataUtil.getInstance().getCacheResult(ApiKey.applications(application_id), Applications.class);
             if (cacheResult != null) {
                 findApp = cacheResult;
@@ -346,6 +368,7 @@ public class FgtArticleComment extends BaseListFragment3<UserComment> implements
                     }
                 });
     }
+
     @Override
     protected Class<UserComment> getTClass() {
         return UserComment.class;
@@ -355,9 +378,9 @@ public class FgtArticleComment extends BaseListFragment3<UserComment> implements
     public void notifyDataSetChanged() {
         super.notifyDataSetChanged();
         int totalCount = list.size();
-        if(lastMessage != null && lastMessage.getTotal() > totalCount)
+        if (lastMessage != null && lastMessage.getTotal() > totalCount)
             totalCount = lastMessage.getTotal();
-        if(totalCount == 0){
+        if (totalCount == 0) {
             ViewUtil.setVisibility(find_article_comment_title_rl, false);
         } else {
             ViewUtil.setVisibility(find_article_comment_title_rl, true);
@@ -526,11 +549,13 @@ public class FgtArticleComment extends BaseListFragment3<UserComment> implements
         taskHelper.onResume();
         webViewVideoHelper.onResume();
     }
+
     @Override
     public void onPause() {
         super.onPause();
         webViewVideoHelper.onPause();
     }
+
     @Override
     public void onDestroy() {
 //        LogUtil.logI("释放资源");
@@ -550,11 +575,11 @@ public class FgtArticleComment extends BaseListFragment3<UserComment> implements
     }
 
 
-
     public boolean onBackUp() {
         webViewVideoHelper.onBackUp();
         return true;
     }
+
     public boolean onBackPressed() {
         return webViewVideoHelper.onBackPressed();
     }