Commit 77a520cc authored by jianglx's avatar jianglx

添加网页拉起功能;修改禅道上的bug;修改city_json中北京、上海、重庆、天津等四个直辖市的城市id;

parent 436c2c63
...@@ -8,8 +8,8 @@ android { ...@@ -8,8 +8,8 @@ android {
minSdkVersion rootProject.ext.minSdkVersion minSdkVersion rootProject.ext.minSdkVersion
targetSdkVersion rootProject.ext.targetSdkVersion targetSdkVersion rootProject.ext.targetSdkVersion
versionCode 114 versionCode 118
versionName "1.1.4" versionName "1.1.8"
multiDexEnabled true multiDexEnabled true
//新版Gradle 是 implementation 为了兼容compile,写上这句话 //新版Gradle 是 implementation 为了兼容compile,写上这句话
......
...@@ -2,6 +2,7 @@ ...@@ -2,6 +2,7 @@
<manifest xmlns:android="http://schemas.android.com/apk/res/android" <manifest xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools" xmlns:tools="http://schemas.android.com/tools"
package="com.xxfc.rv"> package="com.xxfc.rv">
<!-- ===================标准 =================== --> <!-- ===================标准 =================== -->
<uses-permission android:name="android.permission.VIBRATE" /> <!-- 震动 --> <uses-permission android:name="android.permission.VIBRATE" /> <!-- 震动 -->
<uses-permission android:name="android.permission.INTERNET" /> <!-- 联网 --> <uses-permission android:name="android.permission.INTERNET" /> <!-- 联网 -->
...@@ -30,8 +31,6 @@ ...@@ -30,8 +31,6 @@
<uses-permission android:name="android.permission.ACCESS_LOCATION_EXTRA_COMMANDS" /> <!-- 用于申请获取蓝牙信息进行室内定位 --> <uses-permission android:name="android.permission.ACCESS_LOCATION_EXTRA_COMMANDS" /> <!-- 用于申请获取蓝牙信息进行室内定位 -->
<uses-permission android:name="android.permission.DOWNLOAD_WITHOUT_NOTIFICATION" /> <uses-permission android:name="android.permission.DOWNLOAD_WITHOUT_NOTIFICATION" />
<uses-permission android:name="android.permission.FLASHLIGHT" /> <uses-permission android:name="android.permission.FLASHLIGHT" />
<uses-feature android:name="android.hardware.camera" /> <uses-feature android:name="android.hardware.camera" />
...@@ -100,7 +99,7 @@ ...@@ -100,7 +99,7 @@
<uses-permission android:name="android.permission.READ_EXTERNAL_STORAGE" /> <uses-permission android:name="android.permission.READ_EXTERNAL_STORAGE" />
<application <application
android:name="com.xxfc.rv.RvClientApplication" android:name=".RvClientApplication"
android:allowBackup="true" android:allowBackup="true"
android:icon="@mipmap/logo" android:icon="@mipmap/logo"
android:label="@string/app_name" android:label="@string/app_name"
...@@ -109,7 +108,6 @@ ...@@ -109,7 +108,6 @@
android:supportsRtl="true" android:supportsRtl="true"
android:theme="@style/AppTheme.NoActionBar.SwipeBack" android:theme="@style/AppTheme.NoActionBar.SwipeBack"
tools:ignore="GoogleAppIndexingWarning"> tools:ignore="GoogleAppIndexingWarning">
<activity <activity
android:name=".WelcomeActivity" android:name=".WelcomeActivity"
android:launchMode="singleTask" android:launchMode="singleTask"
...@@ -117,9 +115,9 @@ ...@@ -117,9 +115,9 @@
android:theme="@style/SplashTheme"> android:theme="@style/SplashTheme">
<intent-filter> <intent-filter>
<action android:name="android.intent.action.MAIN" /> <action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER" /> <category android:name="android.intent.category.LAUNCHER" />
</intent-filter> </intent-filter>
</activity> <!-- 百度地图相关 --> </activity> <!-- 百度地图相关 -->
<!-- 声明service组件 --> <!-- 声明service组件 -->
<service <service
...@@ -127,11 +125,9 @@ ...@@ -127,11 +125,9 @@
android:enabled="true" android:enabled="true"
android:process=":remote" /> android:process=":remote" />
<meta-data <meta-data
android:name="com.shareinstall.APP_KEY" android:name="com.shareinstall.APP_KEY"
android:value="B7BK2A6722BAH6" /> android:value="B7BK2A6722BAH6" />
<meta-data <meta-data
android:name="com.baidu.lbsapi.API_KEY" android:name="com.baidu.lbsapi.API_KEY"
android:value="QaN98C5rV8hawNLVix0FAPLSsz7uh2q1" /> <!-- <meta-data --> android:value="QaN98C5rV8hawNLVix0FAPLSsz7uh2q1" /> <!-- <meta-data -->
...@@ -149,7 +145,7 @@ ...@@ -149,7 +145,7 @@
<meta-data <meta-data
android:name="UMENG_APPKEY" android:name="UMENG_APPKEY"
android:value="5d242bf24ca357797e000922"></meta-data> android:value="5d242bf24ca357797e000922" />
<activity <activity
android:name=".wxapi.WXEntryActivity" android:name=".wxapi.WXEntryActivity"
...@@ -160,7 +156,7 @@ ...@@ -160,7 +156,7 @@
<activity <activity
android:name=".wxapi.WXPayEntryActivity" android:name=".wxapi.WXPayEntryActivity"
android:exported="true" android:exported="true"
android:launchMode="singleTop"></activity> <!-- QQ callback --> android:launchMode="singleTop" /> <!-- QQ callback -->
<activity <activity
android:name="com.tencent.tauth.AuthActivity" android:name="com.tencent.tauth.AuthActivity"
android:launchMode="singleTask" android:launchMode="singleTask"
...@@ -181,15 +177,12 @@ ...@@ -181,15 +177,12 @@
android:theme="@android:style/Theme.Translucent.NoTitleBar" /> <!-- umShare 相关 end --> android:theme="@android:style/Theme.Translucent.NoTitleBar" /> <!-- umShare 相关 end -->
<activity <activity
android:name="com.xxfc.rv.MainActivity" android:name=".MainActivity"
android:launchMode="singleTask" android:launchMode="singleTask"
android:screenOrientation="portrait" /> android:screenOrientation="portrait"></activity>
<activity <activity
android:name="com.rv.home.rv.module.ui.login.LoginRvActivity" android:name="com.rv.home.rv.module.ui.login.LoginRvActivity"
android:screenOrientation="portrait"> android:screenOrientation="portrait" />
</activity>
<activity <activity
android:name="com.rv.home.rv.module.ui.login.RegisteredActivity" android:name="com.rv.home.rv.module.ui.login.RegisteredActivity"
android:screenOrientation="portrait" /> android:screenOrientation="portrait" />
...@@ -385,6 +378,16 @@ ...@@ -385,6 +378,16 @@
android:launchMode="singleTask" android:launchMode="singleTask"
android:screenOrientation="portrait" /> <!-- ============================旅游========================================== --> android:screenOrientation="portrait" /> <!-- ============================旅游========================================== -->
<activity android:name=".WakeUpActivity">
<intent-filter>
<action android:name="android.intent.action.VIEW" />
<category android:name="android.intent.category.DEFAULT" />
<category android:name="android.intent.category.BROWSABLE" />
<data android:scheme="pdfd6612" />
</intent-filter>
</activity>
</application> </application>
</manifest> </manifest>
\ No newline at end of file
package com.xxfc.rv; package com.xxfc.rv;
import android.content.ComponentName;
import android.content.Context; import android.content.Context;
import android.content.Intent; import android.content.Intent;
import android.content.pm.PackageManager; import android.content.pm.PackageManager;
import android.os.Bundle;
import android.support.annotation.NonNull; import android.support.annotation.NonNull;
import android.support.annotation.Nullable; import android.support.annotation.Nullable;
import android.support.v4.content.ContextCompat; import android.support.v4.content.ContextCompat;
import android.os.Bundle;
import android.text.TextUtils; import android.text.TextUtils;
import android.view.KeyEvent; import android.view.KeyEvent;
import android.view.View; import android.view.View;
...@@ -17,6 +18,7 @@ import android.widget.Toast; ...@@ -17,6 +18,7 @@ import android.widget.Toast;
import com.alibaba.android.arouter.launcher.ARouter; import com.alibaba.android.arouter.launcher.ARouter;
import com.frame.base.url.Constance; import com.frame.base.url.Constance;
import com.frame.rv.config.RvFrameConfig; import com.frame.rv.config.RvFrameConfig;
import com.ruiwenliu.wrapper.adapter.TabAdapter;
import com.ruiwenliu.wrapper.base.BaseActivity; import com.ruiwenliu.wrapper.base.BaseActivity;
import com.ruiwenliu.wrapper.base.BaseBean; import com.ruiwenliu.wrapper.base.BaseBean;
import com.ruiwenliu.wrapper.base.BaseWrapperFragment; import com.ruiwenliu.wrapper.base.BaseWrapperFragment;
...@@ -28,7 +30,6 @@ import com.rv.camp.CampFragment; ...@@ -28,7 +30,6 @@ import com.rv.camp.CampFragment;
import com.rv.component.utils.Cooker; import com.rv.component.utils.Cooker;
import com.rv.home.rv.module.ApiConfig; import com.rv.home.rv.module.ApiConfig;
import com.rv.home.rv.module.basic.presenter.CommonPresenter; import com.rv.home.rv.module.basic.presenter.CommonPresenter;
import com.ruiwenliu.wrapper.adapter.TabAdapter;
import com.rv.home.rv.module.ui.main.home.HomeFragment; import com.rv.home.rv.module.ui.main.home.HomeFragment;
import com.rv.home.rv.module.ui.main.home.bean.EffectiveTimeBean; import com.rv.home.rv.module.ui.main.home.bean.EffectiveTimeBean;
import com.rv.rvmine.MineFragment; import com.rv.rvmine.MineFragment;
...@@ -98,7 +99,6 @@ public class MainActivity extends BaseActivity<CommonPresenter> { ...@@ -98,7 +99,6 @@ public class MainActivity extends BaseActivity<CommonPresenter> {
@Override @Override
protected void initView(Bundle savedInstanceState, TitleView titleView, Intent intent) { protected void initView(Bundle savedInstanceState, TitleView titleView, Intent intent) {
ShareInstall.getInstance().reportRegister();
updateAppUtils = UpdateAppUtils.from(MainActivity.this); updateAppUtils = UpdateAppUtils.from(MainActivity.this);
viewPager = findViewById(R.id.pager_view_fragment); viewPager = findViewById(R.id.pager_view_fragment);
showTitle(false); showTitle(false);
...@@ -117,6 +117,7 @@ public class MainActivity extends BaseActivity<CommonPresenter> { ...@@ -117,6 +117,7 @@ public class MainActivity extends BaseActivity<CommonPresenter> {
@Override @Override
protected void loadData(Bundle savedInstanceState, Intent intent) { protected void loadData(Bundle savedInstanceState, Intent intent) {
wakeUp(intent);
getEffectiveTime(); getEffectiveTime();
getActivityPopup(); getActivityPopup();
checkVersion(); checkVersion();
...@@ -274,18 +275,17 @@ public class MainActivity extends BaseActivity<CommonPresenter> { ...@@ -274,18 +275,17 @@ public class MainActivity extends BaseActivity<CommonPresenter> {
super.onNewIntent(intent); super.onNewIntent(intent);
if (intent != null && "home".equals(intent.getStringExtra("to"))) { if (intent != null && "home".equals(intent.getStringExtra("to"))) {
setCurrent(TYPE_HOME_PAGE); setCurrent(TYPE_HOME_PAGE);
} } else if (intent != null && "travel".equals(intent.getStringExtra("to"))) {
if (intent != null && "travel".equals(intent.getStringExtra("to"))) {
setCurrent(TYPE_TRAVEL); setCurrent(TYPE_TRAVEL);
} } else if (intent != null && "discovery".equals(intent.getStringExtra("to"))) {
if (intent != null && "discovery".equals(intent.getStringExtra("to"))) {
setCurrent(TYPE_FOUND); setCurrent(TYPE_FOUND);
} } else if (intent != null && "mine_coupons".equals(intent.getStringExtra("to"))) {
if (intent != null && "mine_coupons".equals(intent.getStringExtra("to"))) {
setCurrent(TYPE_MINE); setCurrent(TYPE_MINE);
ARouter.getInstance() ARouter.getInstance()
.build(Constance.ACTIVITY_URL_COUPONALL) .build(Constance.ACTIVITY_URL_COUPONALL)
.navigation(); .navigation();
} else {
wakeUp(intent);
} }
} }
...@@ -297,6 +297,7 @@ public class MainActivity extends BaseActivity<CommonPresenter> { ...@@ -297,6 +297,7 @@ public class MainActivity extends BaseActivity<CommonPresenter> {
String versionName = updateAppUtils.getAppVersionName(this); String versionName = updateAppUtils.getAppVersionName(this);
if (!TextUtils.isEmpty(versionName)) { if (!TextUtils.isEmpty(versionName)) {
mPresenter.getData(0, String.format(ApiConfig.HTTP_URL_VERSION_CHECK, versionName), VersionCheckBean.class, headMap, false); mPresenter.getData(0, String.format(ApiConfig.HTTP_URL_VERSION_CHECK, versionName), VersionCheckBean.class, headMap, false);
} }
} }
...@@ -327,4 +328,30 @@ public class MainActivity extends BaseActivity<CommonPresenter> { ...@@ -327,4 +328,30 @@ public class MainActivity extends BaseActivity<CommonPresenter> {
} }
return true; return true;
} }
/******
* 唤醒Apk,跳转到webView页面
* @param intent
*/
private void wakeUp(Intent intent) {
if ("webView".equals(intent.getStringExtra("to"))) {
if (!TextUtils.isEmpty(OkGoUtil.getToken())) {
Map<String, Object> header = new HashMap<>();
header.put("Authorization", OkGoUtil.getToken());
Map<String, Object> body = new HashMap<>();
body.put("code", Cooker.getStringValue(getApplicationContext(), "code"));
mPresenter.postData(RvFrameConfig.HOST, 10000, ApiConfig.HTTP_URL_RELATION_BIND, null, body, header, false);
}
ComponentName componentName = new ComponentName(this, "com.rv.share.WebViewActivity");
Intent in = new Intent();
in.setComponent(componentName);
in.putExtra("url", intent.getStringExtra("url"));
in.putExtra("title", intent.getStringExtra("title"));
startActivity(in);
}
}
} }
...@@ -5,6 +5,7 @@ import android.app.Activity; ...@@ -5,6 +5,7 @@ import android.app.Activity;
import android.app.ActivityManager; import android.app.ActivityManager;
import android.content.Context; import android.content.Context;
import android.os.StrictMode; import android.os.StrictMode;
import android.util.Log;
import com.alibaba.android.arouter.launcher.ARouter; import com.alibaba.android.arouter.launcher.ARouter;
import com.baidu.mapapi.CoordType; import com.baidu.mapapi.CoordType;
...@@ -47,11 +48,13 @@ public class RvClientApplication extends FrameApp { ...@@ -47,11 +48,13 @@ public class RvClientApplication extends FrameApp {
@Override @Override
public void onCreate() { public void onCreate() {
super.onCreate(); super.onCreate();
Log.e("xxxxxxxxxxxxxxxxxxxxx", "RvClientApplication_onCreate");
StrictMode.VmPolicy.Builder builder = new StrictMode.VmPolicy.Builder(); StrictMode.VmPolicy.Builder builder = new StrictMode.VmPolicy.Builder();
StrictMode.setVmPolicy(builder.build()); StrictMode.setVmPolicy(builder.build());
builder.detectFileUriExposure(); builder.detectFileUriExposure();
if (isMainProcess()) { if (isMainProcess()) {
ShareInstall.getInstance().init(this); ShareInstall.getInstance().init(this);
ShareInstall.getInstance().reportRegister();
} }
LogUtil.setLogEnable(true, getApplicationContext()); LogUtil.setLogEnable(true, getApplicationContext());
CrashHandler.getInstance().init(this); CrashHandler.getInstance().init(this);
......
package com.xxfc.rv;
import android.content.Intent;
import android.support.v7.app.AppCompatActivity;
import android.os.Bundle;
import android.text.TextUtils;
import com.rv.component.utils.Cooker;
import com.rv.component.utils.LogUtil;
import com.sh.sdk.shareinstall.ShareInstall;
import com.sh.sdk.shareinstall.listener.AppGetInfoListener;
import org.json.JSONException;
import org.json.JSONObject;
/********
* shareInstall 唤醒界面
*/
public class WakeUpActivity extends AppCompatActivity {
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.rv_act_weclome);
ShareInstall.getInstance().getInfo(getIntent(), listener);
}
@Override
protected void onNewIntent(Intent intent) {
super.onNewIntent(intent);
// 此处要调用,否则app在后台运行时,会无法截获
ShareInstall.getInstance().getInfo(intent, listener);
}
private AppGetInfoListener listener = new AppGetInfoListener() {
@Override
public void onGetInfoFinish(String info) {
LogUtil.d("ShareInstall", "info = " + info);
if (info.contains("code"))
try {
JSONObject object = new JSONObject(info);
String inviteCode = object.optString("code");
if (!TextUtils.isEmpty(inviteCode)) {
Cooker.save(getApplicationContext(), "code", inviteCode);
}
String url = object.optString("url");
LogUtil.d("唤醒传过来的url=" + url);
String title = object.optString("title");
LogUtil.d("唤醒传过来的tile=" + title);
if (!TextUtils.isEmpty(url) && !TextUtils.isEmpty(title)) {
Intent intent = new Intent(getApplicationContext(), MainActivity.class);
intent.putExtra("to", "webView");
intent.putExtra("url", url);
intent.putExtra("title", title);
startActivity(intent);
finish();
}
} catch (JSONException e) {
e.printStackTrace();
}
}
};
}
...@@ -72,13 +72,18 @@ public class WelcomeActivity extends BaseActivity<CommonPresenter> { ...@@ -72,13 +72,18 @@ public class WelcomeActivity extends BaseActivity<CommonPresenter> {
.observeOn(AndroidSchedulers.mainThread()) .observeOn(AndroidSchedulers.mainThread())
.subscribe(new Consumer<Long>() { .subscribe(new Consumer<Long>() {
@Override @Override
public void accept(@NonNull Long aLong) throws Exception { public void accept(@NonNull Long aLong) {
try {
if (!TextUtils.isEmpty(UtilsManager.getInstance(mActivity).getSPInstance("city_json").getString("token", ""))) { if (!TextUtils.isEmpty(UtilsManager.getInstance(mActivity).getSPInstance("city_json").getString("token", ""))) {
OkGoUtil.setToken( OkGoUtil.setToken(
UtilsManager.getInstance(mActivity) UtilsManager.getInstance(mActivity)
.getSPInstance("city_json") .getSPInstance("city_json")
.getString("token", "")); .getString("token", ""));
} }
} catch (Exception e) {
e.printStackTrace();
}
startActivity(MainActivity.getIntent(mActivity)); startActivity(MainActivity.getIntent(mActivity));
mDisposable.dispose(); mDisposable.dispose();
finish(); finish();
......
...@@ -33,7 +33,6 @@ android { ...@@ -33,7 +33,6 @@ android {
dependencies { dependencies {
api fileTree(include: ['*.jar'], dir: 'libs') api fileTree(include: ['*.jar'], dir: 'libs')
/*系统*/ /*系统*/
api 'com.jakewharton:butterknife:9.0.0-rc1' api 'com.jakewharton:butterknife:9.0.0-rc1'
annotationProcessor 'com.jakewharton:butterknife-compiler:9.0.0-rc1' annotationProcessor 'com.jakewharton:butterknife-compiler:9.0.0-rc1'
/*fragment*/ /*fragment*/
...@@ -51,16 +50,13 @@ dependencies { ...@@ -51,16 +50,13 @@ dependencies {
api "com.squareup.okhttp3:logging-interceptor:$rootProject.ext.okHttpVersion" api "com.squareup.okhttp3:logging-interceptor:$rootProject.ext.okHttpVersion"
//转换器,请求结果转换成Model //转换器,请求结果转换成Model
api 'com.squareup.retrofit2:adapter-rxjava2:2.3.0' api 'com.squareup.retrofit2:adapter-rxjava2:2.3.0'
api 'com.davemorrissey.labs:subsampling-scale-image-view:3.9.0' api 'com.davemorrissey.labs:subsampling-scale-image-view:3.9.0'
api project(path: ':RvFrame') api project(path: ':RvFrame')
// glide相关 // glide相关
api 'com.github.bumptech.glide:glide:4.7.1' api 'com.github.bumptech.glide:glide:4.7.1'
annotationProcessor 'com.github.bumptech.glide:compiler:4.7.1' annotationProcessor 'com.github.bumptech.glide:compiler:4.7.1'
api 'com.github.bumptech.glide:okhttp3-integration:4.3.1' api 'com.github.bumptech.glide:okhttp3-integration:4.3.1'
api 'com.davemorrissey.labs:subsampling-scale-image-view:3.9.0' api 'com.davemorrissey.labs:subsampling-scale-image-view:3.9.0'
implementation 'com.alibaba:fastjson:1.2.21' implementation 'com.alibaba:fastjson:1.2.21'
implementation project(':component_utils')
} }
package com.ruiwenliu.wrapper.http; package com.ruiwenliu.wrapper.http;
import android.os.Build;
import android.os.Environment; import android.os.Environment;
import com.ruiwenliu.wrapper.BuildConfig;
import com.ruiwenliu.wrapper.util.LogUtils; import com.ruiwenliu.wrapper.util.LogUtils;
import java.io.File; import java.io.File;
...@@ -119,6 +121,8 @@ public class OkHttpCreate { ...@@ -119,6 +121,8 @@ public class OkHttpCreate {
}); });
loggingInterceptor.setLevel(HttpLoggingInterceptor.Level.BODY); loggingInterceptor.setLevel(HttpLoggingInterceptor.Level.BODY);
this.mHttpBuilder.addInterceptor(loggingInterceptor); this.mHttpBuilder.addInterceptor(loggingInterceptor);
// if (BuildConfig.DEBUG)
// this.mHttpBuilder.addInterceptor(new RvLogInterceptor());
} }
/** /**
......
package com.ruiwenliu.wrapper.http;
import android.text.TextUtils;
import com.ruiwenliu.wrapper.util.LogUtils;
import com.rv.component.utils.LogUtil;
import java.io.IOException;
import java.nio.charset.Charset;
import java.util.Set;
import okhttp3.Headers;
import okhttp3.Interceptor;
import okhttp3.Request;
import okhttp3.Response;
import okio.Buffer;
import okio.BufferedSink;
import okio.BufferedSource;
public class RvLogInterceptor implements Interceptor {
private final String TAG = "http";
@Override
public Response intercept(Chain chain) throws IOException {
Request request = chain.request();
LogUtil.d("http:url=", request.url().toString());
LogUtil.d("http:请求方法=", request.method());
LogUtil.d("http:headers=", " ");
Headers headers = request.headers();
if (headers != null) {
Set<String> names = headers.names();
if (names != null) {
for (String s : names) {
LogUtil.d("http:headers=", s + "=" + headers.get(s));
}
}
}
Response response = chain.proceed(chain.request());
BufferedSource source = response.body().source();
Buffer buffer = source.buffer();
Charset UTF8 = Charset.forName("UTF-8");
String bodyStr = buffer.clone().readString(UTF8);
LogUtil.d("http:response=", bodyStr);
return response;
}
}
...@@ -32,7 +32,7 @@ ...@@ -32,7 +32,7 @@
}, { }, {
"lists": [{ "lists": [{
"name": "北京", "name": "北京",
"id": 110000 "id": 110100
}, { }, {
"name": "白银市", "name": "白银市",
"id": 620400 "id": 620400
...@@ -77,7 +77,7 @@ ...@@ -77,7 +77,7 @@
}, { }, {
"lists": [{ "lists": [{
"name": "重庆", "name": "重庆",
"id": 500000 "id": 500100
}, { }, {
"name": "成都市", "name": "成都市",
"id": 510100 "id": 510100
...@@ -641,7 +641,7 @@ ...@@ -641,7 +641,7 @@
}, { }, {
"lists": [{ "lists": [{
"name": "上海", "name": "上海",
"id": 310000 "id": 310100
}, { }, {
"name": "深圳市", "name": "深圳市",
"id": 440300 "id": 440300
...@@ -719,7 +719,7 @@ ...@@ -719,7 +719,7 @@
}, { }, {
"lists": [{ "lists": [{
"name": "天津", "name": "天津",
"id": 120000 "id": 120100
}, { }, {
"name": "太原市", "name": "太原市",
"id": 140100 "id": 140100
......
...@@ -94,4 +94,6 @@ public class ApiConfig { ...@@ -94,4 +94,6 @@ public class ApiConfig {
public static String HTTP_URL_CONSUME_LIST = RvFrameConfig.HOST + "/api/admin/walletDetail/page"; public static String HTTP_URL_CONSUME_LIST = RvFrameConfig.HOST + "/api/admin/walletDetail/page";
public static String HTTP_URL_SELECTED_ACTIVITIES = RvFrameConfig.HOST + "/api/activity/homeActivities/app/unauth/activity/findAll"; // 精选活动 public static String HTTP_URL_SELECTED_ACTIVITIES = RvFrameConfig.HOST + "/api/activity/homeActivities/app/unauth/activity/findAll"; // 精选活动
public static String HTTP_URL_RELATION_BIND = RvFrameConfig.HOST + "/api/admin/relation/bind";
} }
...@@ -16,6 +16,7 @@ import com.ruiwenliu.wrapper.SPConstance; ...@@ -16,6 +16,7 @@ import com.ruiwenliu.wrapper.SPConstance;
import com.ruiwenliu.wrapper.presenter.MvpPresenter; import com.ruiwenliu.wrapper.presenter.MvpPresenter;
import com.ruiwenliu.wrapper.util.UtilsManager; import com.ruiwenliu.wrapper.util.UtilsManager;
import com.ruiwenliu.wrapper.weight.TitleView; import com.ruiwenliu.wrapper.weight.TitleView;
import com.rv.component.utils.LogUtil;
import com.rv.home.R; import com.rv.home.R;
import com.rv.home.rv.module.ApiConfig; import com.rv.home.rv.module.ApiConfig;
import com.ruiwenliu.wrapper.bean.BeanUserInfo; import com.ruiwenliu.wrapper.bean.BeanUserInfo;
...@@ -118,6 +119,7 @@ public abstract class BaseLoginActivity<P extends MvpPresenter> extends BaseStat ...@@ -118,6 +119,7 @@ public abstract class BaseLoginActivity<P extends MvpPresenter> extends BaseStat
public void processLoginData(RegisteredBean bean) { public void processLoginData(RegisteredBean bean) {
LogUtil.d("登录返回的code为" + bean.getData().getCode());
RegisteredBean registeredBean = bean; RegisteredBean registeredBean = bean;
UtilsManager.getInstance(OkGoUtil.application).setSharePreferencesSave(SPConstance.USER_JSON).putString(SPConstance.USER_JSON_CODE, registeredBean.getData().getCode()).commit(); UtilsManager.getInstance(OkGoUtil.application).setSharePreferencesSave(SPConstance.USER_JSON).putString(SPConstance.USER_JSON_CODE, registeredBean.getData().getCode()).commit();
UtilsManager.getInstance(OkGoUtil.application).setSharePreferencesSave(SPConstance.USER_JSON).putString(SPConstance.USER_JSON_NAME, registeredBean.getData().getUsername()).commit(); UtilsManager.getInstance(OkGoUtil.application).setSharePreferencesSave(SPConstance.USER_JSON).putString(SPConstance.USER_JSON_NAME, registeredBean.getData().getUsername()).commit();
......
...@@ -54,7 +54,7 @@ import butterknife.OnClick; ...@@ -54,7 +54,7 @@ import butterknife.OnClick;
* Date: 2019/5/16. * Date: 2019/5/16.
* Desc:租车列表 * Desc:租车列表
*/ */
public class CarRentalListActivity extends BaseStatusActivity<CommonPresenter> implements BaseQuickAdapter.RequestLoadMoreListener, SimpleRefreshLayout.OnSimpleRefreshListener{ public class CarRentalListActivity extends BaseStatusActivity<CommonPresenter> implements BaseQuickAdapter.RequestLoadMoreListener, SimpleRefreshLayout.OnSimpleRefreshListener {
@BindView(R2.id.recyclerView) @BindView(R2.id.recyclerView)
RecyclerView recyclerView; RecyclerView recyclerView;
@BindView(R2.id.ll_head_menu) @BindView(R2.id.ll_head_menu)
...@@ -257,6 +257,7 @@ public class CarRentalListActivity extends BaseStatusActivity<CommonPresenter> i ...@@ -257,6 +257,7 @@ public class CarRentalListActivity extends BaseStatusActivity<CommonPresenter> i
map.put("limit", 10); map.put("limit", 10);
map.put("lat", mLat); map.put("lat", mLat);
map.put("lon", mLon); map.put("lon", mLon);
map.put("parkBranchCompanyId", dataBean.getStartCompanyId());
try { try {
map.put("startDateTamp", TimeManager.dateToStamp(begDate)); map.put("startDateTamp", TimeManager.dateToStamp(begDate));
map.put("endDateTamp", TimeManager.dateToStamp(endDate)); map.put("endDateTamp", TimeManager.dateToStamp(endDate));
......
...@@ -209,6 +209,9 @@ public class HomeFragment extends BaseFragment<CommonPresenter> implements Obser ...@@ -209,6 +209,9 @@ public class HomeFragment extends BaseFragment<CommonPresenter> implements Obser
private double lonLongitude; private double lonLongitude;
private LatLng mLatLng;//当前城市经纬度 private LatLng mLatLng;//当前城市经纬度
private int getCompanyId; // 取车公司id
private double getLatitude;
private double getLongitude;
private double outLatitude = 0; private double outLatitude = 0;
private double outLongitude; private double outLongitude;
private int getCityId;//取车城市ID private int getCityId;//取车城市ID
...@@ -549,7 +552,7 @@ public class HomeFragment extends BaseFragment<CommonPresenter> implements Obser ...@@ -549,7 +552,7 @@ public class HomeFragment extends BaseFragment<CommonPresenter> implements Obser
R2.id.tv_out_city, R2.id.tv_get_address, R2.id.tv_out_address, R2.id.ll_item_select_data, R2.id.tv_select_car, R2.id.tv_out_city, R2.id.tv_get_address, R2.id.tv_out_address, R2.id.ll_item_select_data, R2.id.tv_select_car,
R2.id.ll_item_rv_city, R2.id.tv_book_now, R2.id.ll_item_rv_hot_label1, R2.id.ll_item_rv_hot_label2, R2.id.ll_item_rv_hot_label3, R2.id.ll_item_rv_city, R2.id.tv_book_now, R2.id.ll_item_rv_hot_label1, R2.id.ll_item_rv_hot_label2, R2.id.ll_item_rv_hot_label3,
R2.id.ll_item_hot_rvtour, R2.id.ll_item_hot_entertainment_camp, R2.id.ll_item_hot_car_rental, R2.id.tv_see_more_popular, R2.id.ll_item_hot_rvtour, R2.id.ll_item_hot_entertainment_camp, R2.id.ll_item_hot_car_rental, R2.id.tv_see_more_popular,
R2.id.ll_item_top, R2.id.travel_server_image, R2.id.tv_car_rental_guide, R2.id.ll_item_activity_all, R2.id.ll_rent, R2.id.ll_return}) R2.id.ll_item_top, R2.id.travel_server_image, R2.id.tv_car_rental_guide, R2.id.ll_item_activity_all, R2.id.ll_rent, R2.id.ll_return, R2.id.cardview})
public void onViewClicked(View view) { public void onViewClicked(View view) {
int id = view.getId(); int id = view.getId();
if (id == R.id.travel_city_layout) { if (id == R.id.travel_city_layout) {
...@@ -756,6 +759,8 @@ public class HomeFragment extends BaseFragment<CommonPresenter> implements Obser ...@@ -756,6 +759,8 @@ public class HomeFragment extends BaseFragment<CommonPresenter> implements Obser
} else if (id == R.id.ll_item_activity_all) { } else if (id == R.id.ll_item_activity_all) {
showToast("亲,该功能还在开发中。。。"); showToast("亲,该功能还在开发中。。。");
} else if (id == R.id.cardview) {
return;
} }
} }
...@@ -770,20 +775,21 @@ public class HomeFragment extends BaseFragment<CommonPresenter> implements Obser ...@@ -770,20 +775,21 @@ public class HomeFragment extends BaseFragment<CommonPresenter> implements Obser
case TYPE_REQUEST_CITY://城市列表 case TYPE_REQUEST_CITY://城市列表
if (type == 1) { if (type == 1) {
String companyName = data.getStringExtra("company"); String companyName = data.getStringExtra("company");
getCompanyId = data.getIntExtra("company_id", 1);
getCityName = requestData; getCityName = requestData;
headTvGetShop.setText(companyName); headTvGetShop.setText(companyName);
getCityId = data.getIntExtra("id", 0); getCityId = data.getIntExtra("id", 0);
double lat = data.getDoubleExtra("latitude", 0); getLatitude = data.getDoubleExtra("latitude", 0);
double lon = data.getDoubleExtra("longitude", 0); getLongitude = data.getDoubleExtra("longitude", 0);
setRequestData(type, requestData, headTvGetCity, headTvOutCity, lat, lon); setRequestData(type, requestData, headTvGetCity, headTvOutCity, getLatitude, getLongitude);
} else if (type == 2) { } else if (type == 2) {
outCityName = requestData; outCityName = requestData;
String companyName = data.getStringExtra("company"); String companyName = data.getStringExtra("company");
headTvOutShop.setText(companyName); headTvOutShop.setText(companyName);
outCityId = data.getIntExtra("id", 0); outCityId = data.getIntExtra("id", 0);
double lat = data.getDoubleExtra("latitude", 0); outLatitude = data.getDoubleExtra("latitude", 0);
double lon = data.getDoubleExtra("longitude", 0); outLongitude = data.getDoubleExtra("longitude", 0);
setRequestData(type, requestData, headTvGetCity, headTvOutCity, lat, lon); setRequestData(type, requestData, headTvGetCity, headTvOutCity, outLatitude, outLongitude);
} else if (type == 3) { } else if (type == 3) {
tvRvCity.setText(""); tvRvCity.setText("");
vVTourCityId = data.getIntExtra("id", 0); vVTourCityId = data.getIntExtra("id", 0);
...@@ -845,13 +851,9 @@ public class HomeFragment extends BaseFragment<CommonPresenter> implements Obser ...@@ -845,13 +851,9 @@ public class HomeFragment extends BaseFragment<CommonPresenter> implements Obser
} }
switch (type) { switch (type) {
case 1: case 1:
latLatitude = lat;
lonLongitude = lon;
tvGet.setText(data); tvGet.setText(data);
break; break;
case 2: case 2:
outLatitude = lat;
outLongitude = lon;
tvOut.setText(data); tvOut.setText(data);
break; break;
case 3: case 3:
...@@ -943,6 +945,7 @@ public class HomeFragment extends BaseFragment<CommonPresenter> implements Obser ...@@ -943,6 +945,7 @@ public class HomeFragment extends BaseFragment<CommonPresenter> implements Obser
headTvGetShop.setTextColor(_mActivity.getResources().getColor(R.color.colorMain)); headTvGetShop.setTextColor(_mActivity.getResources().getColor(R.color.colorMain));
latLatitude = bean.getData().getData().get(0).getLatitude(); latLatitude = bean.getData().getData().get(0).getLatitude();
lonLongitude = bean.getData().getData().get(0).getLongitude(); lonLongitude = bean.getData().getData().get(0).getLongitude();
getCompanyId = bean.getData().getData().get(0).getId();
} }
if (headTvOutShop != null) { if (headTvOutShop != null) {
...@@ -1032,6 +1035,7 @@ public class HomeFragment extends BaseFragment<CommonPresenter> implements Obser ...@@ -1032,6 +1035,7 @@ public class HomeFragment extends BaseFragment<CommonPresenter> implements Obser
dataBean.setEndCityName(endCity); dataBean.setEndCityName(endCity);
dataBean.setEndAddr(endAddress); dataBean.setEndAddr(endAddress);
dataBean.setDriverType(2); dataBean.setDriverType(2);
dataBean.setStartCompanyId(getCompanyId);
startActivity(CarRentalListActivity.getIntent(getContext(), latLatitude, lonLongitude, outLatitude, outLongitude, false, dataBean, startTime, endTime)); startActivity(CarRentalListActivity.getIntent(getContext(), latLatitude, lonLongitude, outLatitude, outLongitude, false, dataBean, startTime, endTime));
} }
...@@ -1107,6 +1111,8 @@ public class HomeFragment extends BaseFragment<CommonPresenter> implements Obser ...@@ -1107,6 +1111,8 @@ public class HomeFragment extends BaseFragment<CommonPresenter> implements Obser
} else { } else {
latLatitude = result.getLocation().latitude; latLatitude = result.getLocation().latitude;
lonLongitude = result.getLocation().longitude; lonLongitude = result.getLocation().longitude;
getLatitude = result.getLocation().latitude;
getLongitude = result.getLocation().latitude;
outLatitude = result.getLocation().latitude; outLatitude = result.getLocation().latitude;
outLongitude = result.getLocation().longitude; outLongitude = result.getLocation().longitude;
rvTourLatitude = result.getLocation().latitude; rvTourLatitude = result.getLocation().latitude;
...@@ -1123,10 +1129,13 @@ public class HomeFragment extends BaseFragment<CommonPresenter> implements Obser ...@@ -1123,10 +1129,13 @@ public class HomeFragment extends BaseFragment<CommonPresenter> implements Obser
} else { } else {
latLatitude = result.getLocation().latitude; latLatitude = result.getLocation().latitude;
lonLongitude = result.getLocation().longitude; lonLongitude = result.getLocation().longitude;
getLatitude = result.getLocation().latitude;
getLongitude = result.getLocation().latitude;
outLatitude = result.getLocation().latitude; outLatitude = result.getLocation().latitude;
outLongitude = result.getLocation().longitude; outLongitude = result.getLocation().longitude;
rvTourLatitude = result.getLocation().latitude; rvTourLatitude = result.getLocation().latitude;
rvTourLongitude = result.getLocation().longitude; rvTourLongitude = result.getLocation().longitude;
getShopList(latLatitude, lonLongitude, false);
} }
} }
}); });
......
...@@ -112,8 +112,9 @@ public class SelectShopActivity extends BaseStatusActivity<CommonPresenter> impl ...@@ -112,8 +112,9 @@ public class SelectShopActivity extends BaseStatusActivity<CommonPresenter> impl
Intent intent = new Intent(); Intent intent = new Intent();
intent.putExtra("location", cityName); intent.putExtra("location", cityName);
intent.putExtra("type", shopType); intent.putExtra("type", shopType);
intent.putExtra("id", mCityId); intent.putExtra("id", mAdapter.getItem(position).getAddrCity());
intent.putExtra("company", mAdapter.getData().get(position).getName()); intent.putExtra("company", mAdapter.getItem(position).getName());
intent.putExtra("company_id", mAdapter.getItem(position).getId());
intent.putExtra("latitude", latLatitude); intent.putExtra("latitude", latLatitude);
intent.putExtra("longitude", lonLongitude); intent.putExtra("longitude", lonLongitude);
setResult(RESULT_OK, intent); setResult(RESULT_OK, intent);
...@@ -238,10 +239,10 @@ public class SelectShopActivity extends BaseStatusActivity<CommonPresenter> impl ...@@ -238,10 +239,10 @@ public class SelectShopActivity extends BaseStatusActivity<CommonPresenter> impl
} else { } else {
map.put("addrCity", mCityId); map.put("addrCity", mCityId);
} }
if (mLat > 0) { // if (mLat > 0) {
map.put("lat", mLat); // map.put("lat", mLat);
map.put("lon", mLon); // map.put("lon", mLon);
} // }
mPresenter.getData(RvFrameConfig.VEHICLE_POST, 0, ApiConfig.HTTP_URL_SHOP_LIST, ShopListBean.class, map, page == 1 ? true : false); mPresenter.getData(RvFrameConfig.VEHICLE_POST, 0, ApiConfig.HTTP_URL_SHOP_LIST, ShopListBean.class, map, page == 1 ? true : false);
} }
......
...@@ -5,8 +5,10 @@ import android.net.Uri; ...@@ -5,8 +5,10 @@ import android.net.Uri;
import android.text.TextUtils; import android.text.TextUtils;
import android.view.View; import android.view.View;
import com.alibaba.android.arouter.launcher.ARouter;
import com.chad.library.adapter.base.BaseQuickAdapter; import com.chad.library.adapter.base.BaseQuickAdapter;
import com.chad.library.adapter.base.BaseViewHolder; import com.chad.library.adapter.base.BaseViewHolder;
import com.frame.base.url.Constance;
import com.rv.component.utils.LocationUtils; import com.rv.component.utils.LocationUtils;
import com.rv.home.R; import com.rv.home.R;
import com.rv.home.R2; import com.rv.home.R2;
...@@ -38,6 +40,7 @@ public class SelectShopAdapter extends BaseQuickAdapter<ShopListBean.DataBeanX.D ...@@ -38,6 +40,7 @@ public class SelectShopAdapter extends BaseQuickAdapter<ShopListBean.DataBeanX.D
helper.setText(R.id.tv_position, "地址:" + item.getAddrDetail()); helper.setText(R.id.tv_position, "地址:" + item.getAddrDetail());
helper.setText(R.id.tv_contacts, "联系人: " + item.getLeader() + " " + item.getLeaderContactInfo()); helper.setText(R.id.tv_contacts, "联系人: " + item.getLeader() + " " + item.getLeaderContactInfo());
helper.setOnClickListener(R.id.tv_call, new View.OnClickListener() { helper.setOnClickListener(R.id.tv_call, new View.OnClickListener() {
@Override @Override
public void onClick(View v) { public void onClick(View v) {
...@@ -52,7 +55,27 @@ public class SelectShopAdapter extends BaseQuickAdapter<ShopListBean.DataBeanX.D ...@@ -52,7 +55,27 @@ public class SelectShopAdapter extends BaseQuickAdapter<ShopListBean.DataBeanX.D
}); });
double distance = LocationUtils.getDistance(latitude, longitude, item.getLatitude(), item.getLongitude()); double distance = LocationUtils.getDistance(latitude, longitude, item.getLatitude(), item.getLongitude());
int distanceKm = (int)(distance / 1000); int distanceKm = (int) (distance / 1000);
helper.setText(R.id.tv_distance, "距您" + distanceKm + "km"); helper.setText(R.id.tv_distance, "距您" + distanceKm + "km");
helper.setOnClickListener(R.id.tv_distance, new View.OnClickListener() {
@Override
public void onClick(View v) {
showMap(item);
}
});
}
private void showMap(ShopListBean.DataBeanX.DataBean bean) {
if (bean != null) {
ARouter.getInstance()
.build(Constance.ACTIVITY_URL_CARDETAILMAP)
.withString("addrDetail", bean.getAddrDetail())
.withString("phone", bean.getLeaderContactInfo())
.withString("name", bean.getName())
.withDouble("latitude", bean.getLatitude())
.withDouble("longitude", bean.getLongitude())
.navigation();
}
} }
} }
\ No newline at end of file
...@@ -41,6 +41,7 @@ ...@@ -41,6 +41,7 @@
<android.support.v7.widget.CardView <android.support.v7.widget.CardView
android:id="@+id/cardview"
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="match_parent" android:layout_height="match_parent"
android:layout_marginLeft="@dimen/size_15" android:layout_marginLeft="@dimen/size_15"
...@@ -124,7 +125,6 @@ ...@@ -124,7 +125,6 @@
android:layout_width="wrap_content" android:layout_width="wrap_content"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:layout_marginTop="@dimen/size_10" android:layout_marginTop="@dimen/size_10"
android:drawableRight="@drawable/rv_common_icon_up_arrow"
android:drawablePadding="@dimen/size_3" android:drawablePadding="@dimen/size_3"
android:gravity="center" android:gravity="center"
android:hint="@string/rv_city_list" android:hint="@string/rv_city_list"
...@@ -174,7 +174,6 @@ ...@@ -174,7 +174,6 @@
android:layout_width="wrap_content" android:layout_width="wrap_content"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:layout_marginTop="@dimen/size_10" android:layout_marginTop="@dimen/size_10"
android:drawableRight="@drawable/rv_common_icon_up_arrow"
android:drawablePadding="@dimen/size_3" android:drawablePadding="@dimen/size_3"
android:gravity="center" android:gravity="center"
android:hint="@string/rv_city_list" android:hint="@string/rv_city_list"
......
...@@ -5,7 +5,7 @@ ...@@ -5,7 +5,7 @@
<application> <application>
<activity android:name=".ShareActivity" /> <activity android:name=".ShareActivity" />
<activity android:name=".BillActivity" /> <activity android:name=".BillActivity" />
<activity android:name=".WebViewActivity" > <activity android:name=".WebViewActivity">
<!--<intent-filter>--> <!--<intent-filter>-->
<!--<data android:scheme="rv" android:host="xxfc" android:path="/activity" />--> <!--<data android:scheme="rv" android:host="xxfc" android:path="/activity" />-->
<!--&lt;!&ndash;下面这几行也必须得设置&ndash;&gt;--> <!--&lt;!&ndash;下面这几行也必须得设置&ndash;&gt;-->
...@@ -13,16 +13,6 @@ ...@@ -13,16 +13,6 @@
<!--<action android:name="android.intent.action.VIEW"/>--> <!--<action android:name="android.intent.action.VIEW"/>-->
<!--<category android:name="android.intent.category.BROWSABLE"/>--> <!--<category android:name="android.intent.category.BROWSABLE"/>-->
<!--</intent-filter>--> <!--</intent-filter>-->
<intent-filter>
<action android:name="android.intent.action.VIEW" />
<category android:name="android.intent.category.DEFAULT" />
<category android:name="android.intent.category.BROWSABLE" />
<data android:scheme="pdfd6612" />
</intent-filter>
</activity> </activity>
<activity android:name=".ReativeBillActivity" /> <activity android:name=".ReativeBillActivity" />
<activity android:name=".PopularizeActivity"></activity> <activity android:name=".PopularizeActivity"></activity>
......
...@@ -115,7 +115,7 @@ public class ShareActivity extends BaseStatusActivity<SharePresenter> { ...@@ -115,7 +115,7 @@ public class ShareActivity extends BaseStatusActivity<SharePresenter> {
int id = view.getId(); int id = view.getId();
if (TextUtils.isEmpty(shareUrl)) { if (TextUtils.isEmpty(shareUrl)) {
String code = UtilsManager.getInstance(OkGoUtil.application).getSPInstance(SPConstance.USER_JSON).getString(SPConstance.USER_JSON_CODE, ""); String code = UtilsManager.getInstance(OkGoUtil.application).getSPInstance(SPConstance.USER_JSON).getString(SPConstance.USER_JSON_CODE, "");
shareUrl = RvFrameConfig.HOST + "/h5/appHtml/view/download.html?code=" + code + "_P0101"; shareUrl = RvFrameConfig.HOST + "/h5/appHtml/view/invitationCourtesyShare.html?code=" + code + "_P0101";
} }
if (id == R.id.tv_weixin) { if (id == R.id.tv_weixin) {
mPresenter.shareWx(shareUrl, "【滴房车】", "新人专享大礼包,快去领!"); mPresenter.shareWx(shareUrl, "【滴房车】", "新人专享大礼包,快去领!");
......
...@@ -46,7 +46,6 @@ public class WebViewActivity extends BaseStatusActivity<WebViewPresenter> { ...@@ -46,7 +46,6 @@ public class WebViewActivity extends BaseStatusActivity<WebViewPresenter> {
@Override @Override
protected void initView(Bundle savedInstanceState, TitleView titleView, Intent intent) { protected void initView(Bundle savedInstanceState, TitleView titleView, Intent intent) {
// 获取唤醒参数 // 获取唤醒参数
ShareInstall.getInstance().getInfo(intent, openListener);
url = intent.getStringExtra("url"); url = intent.getStringExtra("url");
title = intent.getStringExtra("title"); title = intent.getStringExtra("title");
if (!TextUtils.isEmpty(title)) { if (!TextUtils.isEmpty(title)) {
...@@ -76,13 +75,6 @@ public class WebViewActivity extends BaseStatusActivity<WebViewPresenter> { ...@@ -76,13 +75,6 @@ public class WebViewActivity extends BaseStatusActivity<WebViewPresenter> {
} }
@Override
protected void onNewIntent(Intent intent) {
super.onNewIntent(intent);
// 此处要调用,否则app在后台运行时,会无法截获
ShareInstall.getInstance().getInfo(intent, openListener);
}
@Override @Override
public void onDestroy() { public void onDestroy() {
if (rvWebView != null) { if (rvWebView != null) {
...@@ -113,23 +105,4 @@ public class WebViewActivity extends BaseStatusActivity<WebViewPresenter> { ...@@ -113,23 +105,4 @@ public class WebViewActivity extends BaseStatusActivity<WebViewPresenter> {
} }
}; };
private AppGetInfoListener openListener = new AppGetInfoListener() {
@Override
public void onGetInfoFinish(String info) {
// 客户端获取到的参数是json字符串格式
Log.d("ShareInstall", "info = " + info);
if (info.contains("code"))
try {
JSONObject object = new JSONObject(info);
String inviteCode = object.optString("code");
if (!TextUtils.isEmpty(inviteCode)) {
Cooker.save(getApplicationContext(), "code", inviteCode);
}
} catch (JSONException e) {
e.printStackTrace();
}
}
};
} }
...@@ -35,7 +35,7 @@ public class ReativeBillPresenter extends CommonPresenter { ...@@ -35,7 +35,7 @@ public class ReativeBillPresenter extends CommonPresenter {
file = saveBitmapFile(bitmap); file = saveBitmapFile(bitmap);
} }
if (file != null) { if (file != null) {
Toast.makeText(getPresenterContext(), "海报保存在" + file.getAbsolutePath(), Toast.LENGTH_SHORT).show(); Toast.makeText(getPresenterContext(), "海报保存在" + file.getAbsolutePath(), Toast.LENGTH_LONG).show();
} }
} }
} }
......
...@@ -139,13 +139,13 @@ public class RvWebView extends WebView { ...@@ -139,13 +139,13 @@ public class RvWebView extends WebView {
@JavascriptInterface @JavascriptInterface
public String getUserName() { public String getUserName() {
String name = UtilsManager.getInstance(OkGoUtil.application).getSPInstance(SPConstance.USER_JSON).getString(SPConstance.USER_JSON_NAME, ""); String name = UtilsManager.getInstance(getContext()).getSPInstance(SPConstance.USER_JSON).getString(SPConstance.USER_JSON_NAME, "");
return name; return name;
} }
@JavascriptInterface @JavascriptInterface
public String getHeadUrl() { public String getHeadUrl() {
String url = UtilsManager.getInstance(OkGoUtil.application).getSPInstance(SPConstance.USER_JSON).getString(SPConstance.USER_JSON_HEADERURL, ""); String url = UtilsManager.getInstance(getContext()).getSPInstance(SPConstance.USER_JSON).getString(SPConstance.USER_JSON_HEADERURL, "");
return url; return url;
} }
...@@ -163,7 +163,7 @@ public class RvWebView extends WebView { ...@@ -163,7 +163,7 @@ public class RvWebView extends WebView {
@JavascriptInterface @JavascriptInterface
public String getCode() { public String getCode() {
String code = UtilsManager.getInstance(OkGoUtil.application).getSPInstance(SPConstance.USER_JSON).getString(SPConstance.USER_JSON_CODE, ""); String code = UtilsManager.getInstance(getContext()).getSPInstance(SPConstance.USER_JSON).getString(SPConstance.USER_JSON_CODE, "");
return code; return code;
} }
......
...@@ -217,7 +217,7 @@ ...@@ -217,7 +217,7 @@
android:layout_width="wrap_content" android:layout_width="wrap_content"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:layout_marginTop="@dimen/dp_10" android:layout_marginTop="@dimen/dp_10"
android:text="已邀请" android:text="待激活"
android:textColor="@color/gray_707070" /> android:textColor="@color/gray_707070" />
</LinearLayout> </LinearLayout>
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment