Browse Source

bussiness ui refact

billyyoyo 6 years ago
parent
commit
d8273160a0

+ 1 - 1
app/src/main/java/com/sheep/gamegroup/model/entity/Release_task.java

@@ -620,7 +620,7 @@ public class Release_task implements Serializable, MultiItemEntity {
     //获取福利的价值
     public CharSequence getWelfareValue() {
         if (isShop()) {
-            return String.format(Locale.CHINA, "+%s经验值", shop_amount * 10000);
+            return String.format(Locale.CHINA, "+%s经验值", NumberFormatUtils.retainMost2W(getShop_amount() * 10000));
         } else {
             return String.format(Locale.CHINA, "+%s元", bonus);
         }

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

@@ -100,6 +100,7 @@ public class ActMyMoney extends BaseActivity {
         super.onCreate(savedInstanceState);
         if (getIntent().hasExtra("token")) {
             foreignToken = getIntent().getStringExtra("token");
+            foreignToken = SpUtils.exchangeToken(foreignToken);
         } else {
             foreignToken = SpUtils.getToken(this);
         }

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

@@ -14,6 +14,7 @@ import com.sheep.gamegroup.view.fragment.FgtMyGift;
 import com.sheep.gamegroup.view.fragment.FgtWelfareUseRecord;
 import com.sheep.jiuyan.samllsheep.R;
 import com.sheep.jiuyan.samllsheep.SheepApp;
+import com.sheep.jiuyan.samllsheep.utils.SpUtils;
 import com.sheep.jiuyan.samllsheep.utils.TitleBarUtils;
 
 import butterknife.BindView;
@@ -57,8 +58,10 @@ public class ActMyWelfare extends BaseActivity {
         mAdapter = new TitleFragmentListAdapter(getSupportFragmentManager());
 //        mAdapter.add(new FgtMyDownloadWelfareList(), "下载奖励");
         FgtMyGift fgt = new FgtMyGift();
-        if(getIntent().hasExtra("token")){
-            fgt.setToken(getIntent().getStringExtra("token"));
+        if (getIntent().hasExtra("token")) {
+            String token = getIntent().getStringExtra("token");
+            token = SpUtils.exchangeToken(token);
+            fgt.setToken(token);
         }
         mAdapter.add(fgt, "我的礼包");
 //        mAdapter.add(new FgtWelfareUseRecord(), "使用记录");

+ 12 - 2
app/src/main/java/com/sheep/gamegroup/view/activity/ActWebX5.java

@@ -3,6 +3,7 @@ package com.sheep.gamegroup.view.activity;
 import android.content.Intent;
 import android.content.pm.ActivityInfo;
 import android.support.v4.app.Fragment;
+import android.text.TextUtils;
 import android.util.Log;
 
 import com.sheep.gamegroup.absBase.BaseContainerActivity;
@@ -12,6 +13,7 @@ import com.sheep.gamegroup.module.webview.fragment.FgtWeb;
 import com.sheep.gamegroup.module.webview.fragment.FgtWebX5;
 import com.sheep.jiuyan.samllsheep.Config;
 import com.sheep.jiuyan.samllsheep.base.BaseFragment;
+import com.sheep.jiuyan.samllsheep.utils.SpUtils;
 import com.snail.antifake.jni.EmulatorDetectUtil;
 import com.umeng.socialize.UMShareAPI;
 import com.umeng.socialize.UMShareListener;
@@ -48,8 +50,16 @@ public class ActWebX5 extends BaseContainerActivity implements UMShareListener {
     public void initWebParams() {
         Intent intent = getIntent();
         if (intent.hasExtra("exurl")) {
-            webParams = new WebParams(intent.getStringExtra("exurl"),
-                    intent.getStringExtra("extitle"));
+            String token = intent.getStringExtra("extoken");
+            if (TextUtils.isEmpty(token)) {
+                finish();
+                return;
+            }
+            token = SpUtils.exchangeToken(token);
+            String url = intent.getStringExtra("exurl");
+            url += url.contains("?") ? "&" : "?";
+            url += "authorization=" + token;
+            webParams = new WebParams(url, intent.getStringExtra("extitle"));
         } else {
             webParams = (WebParams) intent.getSerializableExtra(WebParams.class.getSimpleName());
             orientPara = intent.getIntExtra("extra_orient", -1);

+ 2 - 1
app/src/main/java/com/sheep/gamegroup/view/activity/ChangeTelAct.java

@@ -130,6 +130,7 @@ public class ChangeTelAct extends BaseActivity implements PhoneContract.View {
         where_from = getIntent().getIntExtra("where_from", 0);
         if (getIntent().hasExtra("token")) {
             foreignToken = getIntent().getStringExtra("token");
+            foreignToken = SpUtils.exchangeToken(foreignToken);
             ViewUtil.setVisibility(game_account_layout, true);
             SdkLoginUser gameUser = DDProviderHelper.getInstance().getSdkLoginUser(foreignToken);
             ViewUtil.setText(nickname_view, gameUser.getNickname());
@@ -189,7 +190,7 @@ public class ChangeTelAct extends BaseActivity implements PhoneContract.View {
             default:
                 break;
         }
-        CommonUtil.getInstance().getUserInfo(TextUtils.isEmpty(foreignToken)?SpUtils.getToken(this): foreignToken, entity->{
+        CommonUtil.getInstance().getUserInfo(TextUtils.isEmpty(foreignToken) ? SpUtils.getToken(this) : foreignToken, entity -> {
             if (!TextUtils.isEmpty(entity.getMobile())) {//提示
                 oldOrNew = 1;
                 showChangeLayout.setVisibility(View.VISIBLE);

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

@@ -97,6 +97,7 @@ public class RealNameAuthenAct extends BaseActivity implements RealNameAutherCon
     public void initView() {
         if (getIntent().hasExtra("token")) {
             foreignToken = getIntent().getStringExtra("token");
+            foreignToken = SpUtils.exchangeToken(foreignToken);
             ViewUtil.setVisibility(game_account_layout, true);
             SdkLoginUser gameUser = DDProviderHelper.getInstance().getSdkLoginUser(foreignToken);
             ViewUtil.setText(nickname_view, gameUser.getNickname());

+ 7 - 0
app/src/main/java/com/sheep/jiuyan/samllsheep/utils/SpUtils.java

@@ -4,6 +4,8 @@ import android.content.Context;
 import android.content.SharedPreferences;
 import android.text.TextUtils;
 
+import com.sheep.gamegroup.greendao.DDProviderHelper;
+import com.sheep.gamegroup.greendao.download.SdkLoginUser;
 import com.sheep.jiuyan.samllsheep.SheepApp;
 
 import go.kfzssafe.Kfzssafe;
@@ -28,6 +30,11 @@ public class SpUtils {
         editor.apply();
     }
 
+    public static String exchangeToken(String token) {
+        SdkLoginUser user = DDProviderHelper.getInstance().getSdkLoginUser(token);
+        return user != null ? user.getToken() : token;
+    }
+
     /**
      * 存入一些小型的用户数据
      *