Commit 436c2c63 authored by jianglx's avatar jianglx

修改禅道上的bug

parent 9f5c007d
...@@ -188,15 +188,6 @@ ...@@ -188,15 +188,6 @@
<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">
<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 <activity
......
...@@ -8,6 +8,7 @@ import android.support.v4.content.ContextCompat; ...@@ -8,6 +8,7 @@ import android.support.v4.content.ContextCompat;
import android.support.v7.widget.GridLayoutManager; import android.support.v7.widget.GridLayoutManager;
import android.support.v7.widget.LinearLayoutManager; import android.support.v7.widget.LinearLayoutManager;
import android.support.v7.widget.RecyclerView; import android.support.v7.widget.RecyclerView;
import android.text.TextUtils;
import android.view.View; import android.view.View;
import android.widget.ImageView; import android.widget.ImageView;
import android.widget.LinearLayout; import android.widget.LinearLayout;
...@@ -206,12 +207,16 @@ public class CarRentalListActivity extends BaseStatusActivity<CommonPresenter> i ...@@ -206,12 +207,16 @@ public class CarRentalListActivity extends BaseStatusActivity<CommonPresenter> i
.navigation(mActivity, 109); .navigation(mActivity, 109);
} else if (id == R.id.ll_item_get_address) { } else if (id == R.id.ll_item_get_address) {
//取车地址
startActivityForResult(SelectLocationActivity.getIntent(mActivity, 1, dataBean.getStartCityName(), dataBean.getStartCity(),mLat, mLon, "", 1), 110); startActivityForResult(SelectShopActivity.getIntent(mActivity, 1, "", dataBean.getStartCityName(), mLat, mLon), 110);
// //取车地址
// startActivityForResult(SelectLocationActivity.getIntent(mActivity, 1, dataBean.getStartCityName(), dataBean.getStartCity(),mLat, mLon, "", 1), 110);
} else if (id == R.id.ll_item_out_address) { } else if (id == R.id.ll_item_out_address) {
//还车地址 //还车地址
startActivityForResult(SelectLocationActivity.getIntent(mActivity, 2, dataBean.getStartCityName(),dataBean.getEndCity(), outLatitude, outLongitude, "", 1), 110); startActivityForResult(SelectShopActivity.getIntent(mActivity, 2, "", dataBean.getEndCityName(), outLatitude, outLongitude), 110);
// startActivityForResult(SelectLocationActivity.getIntent(mActivity, 2, dataBean.getStartCityName(),dataBean.getEndCity(), outLatitude, outLongitude, "", 1), 110);
} else if (id == R.id.ll_item_filter) { } else if (id == R.id.ll_item_filter) {
if (attributeListBean == null) { if (attributeListBean == null) {
return; return;
...@@ -423,30 +428,31 @@ public class CarRentalListActivity extends BaseStatusActivity<CommonPresenter> i ...@@ -423,30 +428,31 @@ public class CarRentalListActivity extends BaseStatusActivity<CommonPresenter> i
onFresh(); onFresh();
} else if (requestCode == 110 && resultCode == RESULT_OK) { } else if (requestCode == 110 && resultCode == RESULT_OK) {
double lat = data.getDoubleExtra("latitude", 0); double lat = data.getDoubleExtra("latitude", 0);
double lon = data.getDoubleExtra("longitude", 0); double lon = data.getDoubleExtra("longitude", 0);
int type = data.getIntExtra("type", 1); int type = data.getIntExtra("type", 1);
String requestData = data.getStringExtra("location"); String requestData = data.getStringExtra("location");
String city = data.getStringExtra("city"); String company = data.getStringExtra("company");
int cityId = data.getIntExtra("cityId", 0); int cityId = data.getIntExtra("id", 0);
setRequestData(type, requestData, lat, lon, city, cityId); setRequestData(type, requestData, lat, lon, company, cityId);
} }
} }
private void setRequestData(int type, String requestData, double lat, double lon, String city, int cityId) { private void setRequestData(int type, String requestData, double lat, double lon, String compangy, int cityId) {
if (type == 1) { if (type == 1) {
tvGetAddress.setText(requestData); tvGetAddress.setText(compangy);
dataBean.setStartAddr(requestData); dataBean.setStartAddr(requestData);
dataBean.setStartCity(cityId); dataBean.setStartCity(cityId);
dataBean.setStartCityName(city); dataBean.setStartCityName(compangy);
mLat = lat; mLat = lat;
mLon = lon; mLon = lon;
} else if (type == 2) { } else if (type == 2) {
tvOutAddress.setText(requestData); tvOutAddress.setText(compangy);
dataBean.setEndAddr(requestData); dataBean.setEndAddr(requestData);
dataBean.setEndCity(cityId); dataBean.setEndCity(cityId);
dataBean.setEndCityName(city); dataBean.setEndCityName(compangy);
outLatitude = lat; outLatitude = lat;
outLongitude = lon; outLongitude = lon;
} }
......
...@@ -46,11 +46,7 @@ public class PointAdapter extends BaseQuickAdapter<PointBean.RvPointItem, BaseVi ...@@ -46,11 +46,7 @@ public class PointAdapter extends BaseQuickAdapter<PointBean.RvPointItem, BaseVi
helper.setText(R.id.btn_state, item.getBtnWord()); helper.setText(R.id.btn_state, item.getBtnWord());
} }
helper.setBackgroundRes(R.id.btn_state, item.isIntegralStatus() ? R.drawable.shape_rv_bg_member_top_grap : R.drawable.shape_rv_bg_dark_yellow); helper.setBackgroundRes(R.id.btn_state, item.isIntegralStatus() ? R.drawable.shape_rv_bg_member_top_grap : R.drawable.shape_rv_bg_dark_yellow);
if (item.isIntegralStatus()) { helper.itemView.findViewById(R.id.btn_state).setEnabled(!item.isIntegralStatus());
helper.itemView.findViewById(R.id.btn_state).setEnabled(false);
} else {
helper.itemView.findViewById(R.id.btn_state).setEnabled(true);
}
helper.addOnClickListener(R.id.btn_state); helper.addOnClickListener(R.id.btn_state);
} }
} }
...@@ -5,7 +5,25 @@ ...@@ -5,7 +5,25 @@
<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>-->
<!--<data android:scheme="rv" android:host="xxfc" android:path="/activity" />-->
<!--&lt;!&ndash;下面这几行也必须得设置&ndash;&gt;-->
<!--<category android:name="android.intent.category.DEFAULT"/>-->
<!--<action android:name="android.intent.action.VIEW"/>-->
<!--<category android:name="android.intent.category.BROWSABLE"/>-->
<!--</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 android:name=".ReativeBillActivity" /> <activity android:name=".ReativeBillActivity" />
<activity android:name=".PopularizeActivity"></activity> <activity android:name=".PopularizeActivity"></activity>
</application> </application>
......
...@@ -5,15 +5,22 @@ import android.content.Intent; ...@@ -5,15 +5,22 @@ import android.content.Intent;
import android.os.Build; import android.os.Build;
import android.os.Bundle; import android.os.Bundle;
import android.text.TextUtils; import android.text.TextUtils;
import android.util.Log;
import android.widget.LinearLayout; import android.widget.LinearLayout;
import android.widget.Toast; import android.widget.Toast;
import com.base.utils.tools.android.NetworkUtil; import com.base.utils.tools.android.NetworkUtil;
import com.ruiwenliu.wrapper.base.BaseBean; import com.ruiwenliu.wrapper.base.BaseBean;
import com.ruiwenliu.wrapper.weight.TitleView; import com.ruiwenliu.wrapper.weight.TitleView;
import com.rv.component.utils.Cooker;
import com.rv.home.rv.module.basic.BaseStatusActivity; import com.rv.home.rv.module.basic.BaseStatusActivity;
import com.rv.share.presenter.WebViewPresenter; import com.rv.share.presenter.WebViewPresenter;
import com.rv.share.view.RvWebView; import com.rv.share.view.RvWebView;
import com.sh.sdk.shareinstall.ShareInstall;
import com.sh.sdk.shareinstall.listener.AppGetInfoListener;
import org.json.JSONException;
import org.json.JSONObject;
import butterknife.BindView; import butterknife.BindView;
...@@ -38,6 +45,8 @@ public class WebViewActivity extends BaseStatusActivity<WebViewPresenter> { ...@@ -38,6 +45,8 @@ 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)) {
...@@ -67,9 +76,16 @@ public class WebViewActivity extends BaseStatusActivity<WebViewPresenter> { ...@@ -67,9 +76,16 @@ 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) {
llContent.removeAllViews(); llContent.removeAllViews();
rvWebView.stopLoading();// 停止当前加载 rvWebView.stopLoading();// 停止当前加载
rvWebView.clearMatches();// 清除网页查找的高亮匹配字符。 rvWebView.clearMatches();// 清除网页查找的高亮匹配字符。
...@@ -97,4 +113,23 @@ public class WebViewActivity extends BaseStatusActivity<WebViewPresenter> { ...@@ -97,4 +113,23 @@ 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();
}
}
};
} }
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