Commit 99b371e8 authored by linfeng's avatar linfeng

bug修复

parent a48f4280
...@@ -7,8 +7,8 @@ android { ...@@ -7,8 +7,8 @@ android {
applicationId "com.xxfc.rv" applicationId "com.xxfc.rv"
minSdkVersion rootProject.ext.minSdkVersion minSdkVersion rootProject.ext.minSdkVersion
targetSdkVersion rootProject.ext.targetSdkVersion targetSdkVersion rootProject.ext.targetSdkVersion
versionCode 112 versionCode 113
versionName "1.1.2" versionName "1.1.3"
multiDexEnabled true multiDexEnabled true
//新版Gradle 是 implementation 为了兼容compile,写上这句话 //新版Gradle 是 implementation 为了兼容compile,写上这句话
......
...@@ -34,6 +34,8 @@ public class CampDetailsBean extends BaseBean { ...@@ -34,6 +34,8 @@ public class CampDetailsBean extends BaseBean {
private String name;// ":"asdf",---->店铺名 private String name;// ":"asdf",---->店铺名
private String address;//":"广东省广州市aasdfasdf", private String address;//":"广东省广州市aasdfasdf",
private String phone; private String phone;
private double longitude;//": 118.773832,
private double latitude;//": 32.031698,
public String getName() { public String getName() {
return name; return name;
...@@ -58,5 +60,21 @@ public class CampDetailsBean extends BaseBean { ...@@ -58,5 +60,21 @@ public class CampDetailsBean extends BaseBean {
public void setPhone(String phone) { public void setPhone(String phone) {
this.phone = phone; this.phone = phone;
} }
public double getLongitude() {
return longitude;
}
public void setLongitude(double longitude) {
this.longitude = longitude;
}
public double getLatitude() {
return latitude;
}
public void setLatitude(double latitude) {
this.latitude = latitude;
}
} }
} }
...@@ -193,8 +193,8 @@ public class CampDetailActivity extends BaseStatusActivity<CampPresenter> { ...@@ -193,8 +193,8 @@ public class CampDetailActivity extends BaseStatusActivity<CampPresenter> {
.withString("addrDetail", data.getData().getAddress()) .withString("addrDetail", data.getData().getAddress())
.withString("phone", data.getData().getPhone()) .withString("phone", data.getData().getPhone())
.withString("name", data.getData().getName()) .withString("name", data.getData().getName())
.withDouble("latitude", latitude) .withDouble("latitude", data.getData().getLatitude())
.withDouble("longitude", longitude) .withDouble("longitude", data.getData().getLongitude())
.navigation(); .navigation();
} }
} }
......
...@@ -300,7 +300,9 @@ public class CarDetailActivity extends BaseStatusActivity<CommonPresenter> { ...@@ -300,7 +300,9 @@ public class CarDetailActivity extends BaseStatusActivity<CommonPresenter> {
.withString("icon", mCarBean.getVehicleModel().getIcon()) .withString("icon", mCarBean.getVehicleModel().getIcon())
.withString("name", mCarBean.getVehicleModel().getName()) .withString("name", mCarBean.getVehicleModel().getName())
.withString("keyword", mCarBean.getVehicleModel().getKeyword()) .withString("keyword", mCarBean.getVehicleModel().getKeyword())
.withDouble("price", mCarBean.getVehicleModel().getPrice()).navigation(); .withDouble("price", mCarBean.getVehicleModel().getPrice())
.withString("url",url)
.navigation();
} else if (snsPlatform.mShowWord.equals("复制链接")) { } else if (snsPlatform.mShowWord.equals("复制链接")) {
copyText(); copyText();
......
...@@ -410,13 +410,8 @@ public class CarRentalListActivity extends BaseStatusActivity<CommonPresenter> i ...@@ -410,13 +410,8 @@ public class CarRentalListActivity extends BaseStatusActivity<CommonPresenter> i
tvGetDate.setText("取" + DateUtils.formatDate66(begDate)); tvGetDate.setText("取" + DateUtils.formatDate66(begDate));
tvOutDate.setText("还" + DateUtils.formatDate66(endDate)); tvOutDate.setText("还" + DateUtils.formatDate66(endDate));
dataBean.setDayNum(Integer.valueOf(copyDay + "")); dataBean.setDayNum(Integer.valueOf(copyDay + ""));
try { dataBean.setStartTime(DateUtils.StringToTimeMillis2(begDate));
dataBean.setStartTime(TimeManager.dateToStamp(begDate)); dataBean.setEndTime(DateUtils.StringToTimeMillis2(endDate));
dataBean.setEndTime(TimeManager.dateToStamp(endDate));
} catch (ParseException e) {
e.printStackTrace();
}
onFresh(); onFresh();
} else if (requestCode == 110 && resultCode == RESULT_OK) { } else if (requestCode == 110 && resultCode == RESULT_OK) {
......
...@@ -331,6 +331,7 @@ public class HomeFragment extends BaseFragment<CommonPresenter> implements Obser ...@@ -331,6 +331,7 @@ public class HomeFragment extends BaseFragment<CommonPresenter> implements Obser
.withString("name", data.getName()) .withString("name", data.getName())
.withString("content", data.getName1()) .withString("content", data.getName1())
.withString("url", data.getImgUrl()) .withString("url", data.getImgUrl())
.withDouble("price", Double.valueOf(data.getPrice()))
.navigation(); .navigation();
} else if ("3".equals(hotType)) { } else if ("3".equals(hotType)) {
//娱乐营地 //娱乐营地
...@@ -518,7 +519,7 @@ public class HomeFragment extends BaseFragment<CommonPresenter> implements Obser ...@@ -518,7 +519,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.tv_car_rental_guide}) R2.id.ll_item_top, R2.id.travel_server_image, R2.id.tv_car_rental_guide, R2.id.ll_item_activity_all})
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) {
...@@ -590,6 +591,7 @@ public class HomeFragment extends BaseFragment<CommonPresenter> implements Obser ...@@ -590,6 +591,7 @@ public class HomeFragment extends BaseFragment<CommonPresenter> implements Obser
.navigation(_mActivity, 108); .navigation(_mActivity, 108);
} else if (id == R.id.tv_select_car) { } else if (id == R.id.tv_select_car) {
//租房车 立即选车
if (copyDay < 1) { if (copyDay < 1) {
showToast(getContext().getString(R.string.rv_day_toast)); showToast(getContext().getString(R.string.rv_day_toast));
return; return;
...@@ -619,7 +621,7 @@ public class HomeFragment extends BaseFragment<CommonPresenter> implements Obser ...@@ -619,7 +621,7 @@ public class HomeFragment extends BaseFragment<CommonPresenter> implements Obser
} else if (id == R.id.tv_book_now) { } else if (id == R.id.tv_book_now) {
//立即预定 //房车游 立即预定
geoCoder.geocode(new GeoCodeOption() geoCoder.geocode(new GeoCodeOption()
.city(tvRvCity.getText().toString()) .city(tvRvCity.getText().toString())
...@@ -627,8 +629,8 @@ public class HomeFragment extends BaseFragment<CommonPresenter> implements Obser ...@@ -627,8 +629,8 @@ public class HomeFragment extends BaseFragment<CommonPresenter> implements Obser
ARouter.getInstance() ARouter.getInstance()
.build(Constance.ACTIVITY_URL_TRAVELSEARCH) .build(Constance.ACTIVITY_URL_TRAVELSEARCH)
.withDouble("latLatitude", latLatitude) .withDouble("latLatitude", rvTourLatitude)
.withDouble("lonLongitude", lonLongitude) .withDouble("lonLongitude", rvTourLongitude)
.withString("city", tvRvCity.getText().toString()) .withString("city", tvRvCity.getText().toString())
.navigation(); .navigation();
...@@ -749,6 +751,8 @@ public class HomeFragment extends BaseFragment<CommonPresenter> implements Obser ...@@ -749,6 +751,8 @@ public class HomeFragment extends BaseFragment<CommonPresenter> implements Obser
.withInt("type", 1) .withInt("type", 1)
.navigation(); .navigation();
} else if (id == R.id.ll_item_activity_all) {
showToast("亲,该功能还在开发中。。。");
} }
} }
...@@ -773,6 +777,9 @@ public class HomeFragment extends BaseFragment<CommonPresenter> implements Obser ...@@ -773,6 +777,9 @@ public class HomeFragment extends BaseFragment<CommonPresenter> implements Obser
} else if (type == 4) { } else if (type == 4) {
travelCityText.setText(""); travelCityText.setText("");
mTravelCityId = data.getIntExtra("id", 0); mTravelCityId = data.getIntExtra("id", 0);
getCityId = mTravelCityId;
outCityId = mTravelCityId;
vVTourCityId = mTravelCityId;
} }
setRequestData(type, requestData, headTvGetCity, headTvOutCity, 0, 0); setRequestData(type, requestData, headTvGetCity, headTvOutCity, 0, 0);
...@@ -790,11 +797,21 @@ public class HomeFragment extends BaseFragment<CommonPresenter> implements Obser ...@@ -790,11 +797,21 @@ public class HomeFragment extends BaseFragment<CommonPresenter> implements Obser
begDate = data.getStringExtra("begDate"); begDate = data.getStringExtra("begDate");
endDate = data.getStringExtra("endDate"); endDate = data.getStringExtra("endDate");
copyDay = DateUtils.compareDateDay(endDate, begDate) + 1; copyDay = DateUtils.compareDateDay(endDate, begDate) + 1;
tvGetTime.setText(begDate); if (tvGetTime != null) {
tvOutTime.setText(endDate); tvGetTime.setText(begDate);
tvGetWeek.setText("周" + MyUtils.getWeek(begDate)); }
tvOutWeek.setText("周" + MyUtils.getWeek(endDate)); if (tvOutTime != null) {
tvDay.setText(String.format("%1$s%2$s", copyDay, getContext().getString(R.string.rv_days))); tvOutTime.setText(endDate);
}
if (tvGetWeek != null) {
tvGetWeek.setText("周" + MyUtils.getWeek(begDate));
}
if (tvOutWeek != null) {
tvOutWeek.setText("周" + MyUtils.getWeek(endDate));
}
if (tvDay != null) {
tvDay.setText(String.format("%1$s%2$s", copyDay, getContext().getString(R.string.rv_days)));
}
} }
} }
...@@ -831,6 +848,9 @@ public class HomeFragment extends BaseFragment<CommonPresenter> implements Obser ...@@ -831,6 +848,9 @@ public class HomeFragment extends BaseFragment<CommonPresenter> implements Obser
break; break;
case 4: case 4:
travelCityText.setText(data); travelCityText.setText(data);
headTvGetCity.setText(data);
headTvOutCity.setText(data);
tvRvCity.setText(data);
geoCoder.geocode(new GeoCodeOption() geoCoder.geocode(new GeoCodeOption()
.city(data) .city(data)
...@@ -885,20 +905,27 @@ public class HomeFragment extends BaseFragment<CommonPresenter> implements Obser ...@@ -885,20 +905,27 @@ public class HomeFragment extends BaseFragment<CommonPresenter> implements Obser
* @param bean * @param bean
*/ */
private void processData(ShopListBean bean) { private void processData(ShopListBean bean) {
if (bean.getData().getTotalCount() > 0) { if (bean.getData()!=null && bean.getData().getTotalCount() > 0) {
if (headTvGetShop != null && TextUtils.isEmpty(headTvGetShop.getText().toString().trim())) { if (headTvGetShop != null) {
headTvGetShop.setText(bean.getData().getData().get(0).getName()); headTvGetShop.setText(bean.getData().getData().get(0).getName());
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();
} }
if (headTvOutShop != null && TextUtils.isEmpty(headTvOutShop.getText().toString().trim())) { if (headTvOutShop != null) {
headTvOutShop.setText(bean.getData().getData().get(0).getName()); headTvOutShop.setText(bean.getData().getData().get(0).getName());
headTvOutShop.setTextColor(_mActivity.getResources().getColor(R.color.colorMain)); headTvOutShop.setTextColor(_mActivity.getResources().getColor(R.color.colorMain));
outLatitude = bean.getData().getData().get(0).getLatitude(); outLatitude = bean.getData().getData().get(0).getLatitude();
outLongitude = bean.getData().getData().get(0).getLongitude(); outLongitude = bean.getData().getData().get(0).getLongitude();
} }
}else{
headTvGetShop.setText("");
latLatitude = 0;
lonLongitude = 0;
headTvOutShop.setText("");
outLatitude = 0;
outLongitude = 0;
} }
} }
...@@ -906,16 +933,20 @@ public class HomeFragment extends BaseFragment<CommonPresenter> implements Obser ...@@ -906,16 +933,20 @@ public class HomeFragment extends BaseFragment<CommonPresenter> implements Obser
/** /**
* 获取门店列表 * 获取门店列表
*/ */
private void getShopList(double lat, double lon) { private void getShopList(double lat, double lon, boolean type) {
int addrCity = 0; int addrCity = 0;
String json = UtilsManager.getInstance().getJson(getContext(), "city.json"); if (type) {
CityPickerBean bean = new Gson().fromJson(json, CityPickerBean.class); String json = UtilsManager.getInstance().getJson(getContext(), "city.json");
for (CityPickerBean.CityBean cityBean : bean.getCity()) { CityPickerBean bean = new Gson().fromJson(json, CityPickerBean.class);
for (ListsBean lsBean : cityBean.getLists()) { for (CityPickerBean.CityBean cityBean : bean.getCity()) {
if (nowCity.equals(lsBean.getName())) { for (ListsBean lsBean : cityBean.getLists()) {
addrCity = lsBean.getId(); if (nowCity.equals(lsBean.getName())) {
addrCity = lsBean.getId();
}
} }
} }
} else {
addrCity = mTravelCityId;
} }
Map<String, Object> map = new LinkedHashMap<>(); Map<String, Object> map = new LinkedHashMap<>();
map.put("page", 1); map.put("page", 1);
...@@ -1038,6 +1069,11 @@ public class HomeFragment extends BaseFragment<CommonPresenter> implements Obser ...@@ -1038,6 +1069,11 @@ 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;
outLatitude = result.getLocation().latitude;
outLongitude = result.getLocation().longitude;
rvTourLatitude = result.getLocation().latitude;
rvTourLongitude = result.getLocation().longitude;
getShopList(latLatitude, lonLongitude, false);
} }
//获取地理编码结果 //获取地理编码结果
} }
...@@ -1049,6 +1085,10 @@ public class HomeFragment extends BaseFragment<CommonPresenter> implements Obser ...@@ -1049,6 +1085,10 @@ 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;
outLatitude = result.getLocation().latitude;
outLongitude = result.getLocation().longitude;
rvTourLatitude = result.getLocation().latitude;
rvTourLongitude = result.getLocation().longitude;
} }
} }
}); });
...@@ -1084,9 +1124,12 @@ public class HomeFragment extends BaseFragment<CommonPresenter> implements Obser ...@@ -1084,9 +1124,12 @@ public class HomeFragment extends BaseFragment<CommonPresenter> implements Obser
headTvGetCity.setText(location.getCity()); headTvGetCity.setText(location.getCity());
headTvOutCity.setText(location.getCity()); headTvOutCity.setText(location.getCity());
tvRvCity.setText(location.getCity()); tvRvCity.setText(location.getCity());
travelCityText.setText(location.getCity());
rvTourLatitude = latLatitude;
rvTourLongitude = lonLongitude;
nowCity = location.getCity(); nowCity = location.getCity();
locationManager.stopLocation(); locationManager.stopLocation();
getShopList(mLatLng.latitude, mLatLng.longitude); getShopList(mLatLng.latitude, mLatLng.longitude, true);
} }
}); });
} }
...@@ -1094,6 +1137,8 @@ public class HomeFragment extends BaseFragment<CommonPresenter> implements Obser ...@@ -1094,6 +1137,8 @@ public class HomeFragment extends BaseFragment<CommonPresenter> implements Obser
@Override @Override
public void onDestroy() { public void onDestroy() {
super.onDestroy(); super.onDestroy();
geoCoder.destroy(); if (geoCoder != null) {
geoCoder.destroy();
}
} }
} }
...@@ -4,6 +4,7 @@ import android.content.Context; ...@@ -4,6 +4,7 @@ import android.content.Context;
import android.content.Intent; import android.content.Intent;
import android.content.res.Configuration; import android.content.res.Configuration;
import android.graphics.Bitmap; import android.graphics.Bitmap;
import android.graphics.BitmapFactory;
import android.graphics.Canvas; import android.graphics.Canvas;
import android.graphics.Color; import android.graphics.Color;
import android.os.Bundle; import android.os.Bundle;
...@@ -15,6 +16,12 @@ import android.widget.TextView; ...@@ -15,6 +16,12 @@ import android.widget.TextView;
import com.alibaba.android.arouter.facade.annotation.Autowired; import com.alibaba.android.arouter.facade.annotation.Autowired;
import com.alibaba.android.arouter.facade.annotation.Route; import com.alibaba.android.arouter.facade.annotation.Route;
import com.frame.base.url.Constance; import com.frame.base.url.Constance;
import com.google.zxing.BarcodeFormat;
import com.google.zxing.EncodeHintType;
import com.google.zxing.WriterException;
import com.google.zxing.common.BitMatrix;
import com.google.zxing.qrcode.QRCodeWriter;
import com.google.zxing.qrcode.decoder.ErrorCorrectionLevel;
import com.ruiwenliu.wrapper.base.BaseBean; import com.ruiwenliu.wrapper.base.BaseBean;
import com.ruiwenliu.wrapper.base.swipe.SwipeBackActivity; import com.ruiwenliu.wrapper.base.swipe.SwipeBackActivity;
import com.ruiwenliu.wrapper.util.glide.GlideManager; import com.ruiwenliu.wrapper.util.glide.GlideManager;
...@@ -30,6 +37,9 @@ import com.umeng.socialize.bean.SHARE_MEDIA; ...@@ -30,6 +37,9 @@ import com.umeng.socialize.bean.SHARE_MEDIA;
import com.umeng.socialize.shareboard.SnsPlatform; import com.umeng.socialize.shareboard.SnsPlatform;
import com.umeng.socialize.utils.ShareBoardlistener; import com.umeng.socialize.utils.ShareBoardlistener;
import java.util.HashMap;
import java.util.Map;
import butterknife.BindView; import butterknife.BindView;
import butterknife.OnClick; import butterknife.OnClick;
...@@ -58,6 +68,8 @@ public class ShareImageActivity extends SwipeBackActivity<CommonPresenter> { ...@@ -58,6 +68,8 @@ public class ShareImageActivity extends SwipeBackActivity<CommonPresenter> {
String keyword; String keyword;
@Autowired() @Autowired()
double price; double price;
@Autowired()
String url;
@Override @Override
protected void loadData(Bundle savedInstanceState, Intent intent) { protected void loadData(Bundle savedInstanceState, Intent intent) {
...@@ -76,6 +88,11 @@ public class ShareImageActivity extends SwipeBackActivity<CommonPresenter> { ...@@ -76,6 +88,11 @@ public class ShareImageActivity extends SwipeBackActivity<CommonPresenter> {
tvName.setText(name); tvName.setText(name);
tvContent.setText(keyword); tvContent.setText(keyword);
tvPrice.setText(String.format("%1$s%2$s", price, this.getString(R.string.rv_day))); tvPrice.setText(String.format("%1$s%2$s", price, this.getString(R.string.rv_day)));
//生成带中间图标的二维码
Bitmap success = createQRImage(url, 300, 300,
BitmapFactory.decodeResource(getResources(), R.mipmap.ic_launcher));
ivCode.setImageBitmap(success);
} }
@Override @Override
...@@ -182,4 +199,99 @@ public class ShareImageActivity extends SwipeBackActivity<CommonPresenter> { ...@@ -182,4 +199,99 @@ public class ShareImageActivity extends SwipeBackActivity<CommonPresenter> {
} }
public static Bitmap createQRImage(String content, int widthPix, int heightPix,
Bitmap logoBm) {
try {
//配置参数
Map<EncodeHintType, Object> hints = new HashMap<>();
hints.put(EncodeHintType.CHARACTER_SET, "utf-8");
//容错级别
hints.put(EncodeHintType.ERROR_CORRECTION, ErrorCorrectionLevel.H);
//设置空白边距的宽度
hints.put(EncodeHintType.MARGIN, 1); //default is 4
// 图像数据转换,使用了矩阵转换
BitMatrix bitMatrix = null;
try {
bitMatrix = new QRCodeWriter().encode(content, BarcodeFormat.QR_CODE, widthPix,
heightPix, hints);
} catch (WriterException e) {
e.printStackTrace();
}
int[] pixels = new int[widthPix * heightPix];
// 下面这里按照二维码的算法,逐个生成二维码的图片,
// 两个for循环是图片横列扫描的结果
for (int y = 0; y < heightPix; y++) {
for (int x = 0; x < widthPix; x++) {
if (bitMatrix.get(x, y)) {
pixels[y * widthPix + x] = 0xff000000;
} else {
pixels[y * widthPix + x] = 0xffffffff;
}
}
}
// 生成二维码图片的格式,使用ARGB_8888
Bitmap bitmap = Bitmap.createBitmap(widthPix, heightPix, Bitmap.Config.ARGB_8888);
bitmap.setPixels(pixels, 0, widthPix, 0, 0, widthPix, heightPix);
if (logoBm != null) {
bitmap = Logo(bitmap, logoBm);
}
//必须使用compress方法将bitmap保存到文件中再进行读取。直接返回的bitmap是没有任何压缩的,
// 内存消耗巨大!
return bitmap;
// return bitmap != null && bitmap.compress(Bitmap.CompressFormat.JPEG, 100);
} catch (Exception e) {
e.printStackTrace();
}
return null;
}
private static Bitmap Logo(Bitmap src, Bitmap logo) {
if (src == null) {
return null;
}
if (logo == null) {
return src;
}
//获取图片的宽高
int srcWidth = src.getWidth();
int srcHeight = src.getHeight();
int logoWidth = logo.getWidth();
int logoHeight = logo.getHeight();
if (srcWidth == 0 || srcHeight == 0) {
return null;
}
if (logoWidth == 0 || logoHeight == 0) {
return src;
}
//logo大小为二维码整体大小的1/5
float scaleFactor = srcWidth * 1.0f / 5 / logoWidth;
Bitmap bitmap = Bitmap.createBitmap(srcWidth, srcHeight, Bitmap.Config.ARGB_8888);
try {
Canvas canvas = new Canvas(bitmap);
canvas.drawBitmap(src, 0, 0, null);
canvas.scale(scaleFactor, scaleFactor, srcWidth / 2, srcHeight / 2);
canvas.drawBitmap(logo, (srcWidth - logoWidth) / 2, (srcHeight - logoHeight) / 2, null);
canvas.save();
canvas.restore();
} catch (Exception e) {
bitmap = null;
e.getStackTrace();
}
return bitmap;
}
} }
...@@ -99,13 +99,6 @@ public class GetOnTheCarQRCodeActivity extends BaseStatusActivity<PickerPresente ...@@ -99,13 +99,6 @@ public class GetOnTheCarQRCodeActivity extends BaseStatusActivity<PickerPresente
} }
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
// TODO: add setContentView(...) invocation
ButterKnife.bind(this);
}
@OnClick({R2.id.iv_back, R2.id.iv_customer_service}) @OnClick({R2.id.iv_back, R2.id.iv_customer_service})
public void onViewClicked(View view) { public void onViewClicked(View view) {
int id = view.getId(); int id = view.getId();
......
...@@ -31,6 +31,7 @@ import com.rv.component.dialog.PaymentTypeSelection; ...@@ -31,6 +31,7 @@ import com.rv.component.dialog.PaymentTypeSelection;
import com.rv.home.R; import com.rv.home.R;
import com.rv.home.R2; import com.rv.home.R2;
import com.rv.home.rv.module.ApiConfig; import com.rv.home.rv.module.ApiConfig;
import com.rv.home.rv.module.basic.WebActivity;
import com.rv.home.rv.module.basic.presenter.PickerPresenter; import com.rv.home.rv.module.basic.presenter.PickerPresenter;
import com.rv.home.rv.module.ui.main.home.bean.OrderPayBean; import com.rv.home.rv.module.ui.main.home.bean.OrderPayBean;
import com.rv.home.rv.module.ui.main.home.order.bean.OrderListBean; import com.rv.home.rv.module.ui.main.home.order.bean.OrderListBean;
...@@ -51,7 +52,7 @@ import io.reactivex.schedulers.Schedulers; ...@@ -51,7 +52,7 @@ import io.reactivex.schedulers.Schedulers;
import static com.ruiwenliu.wrapper.weight.webview.SafeWebView.hasKitkat; import static com.ruiwenliu.wrapper.weight.webview.SafeWebView.hasKitkat;
/** /**
* 旅游详情页面 * 旅游订单详情页面
*/ */
public class TravelOrderDetailsActivity extends BaseStatusActivity<PickerPresenter> { public class TravelOrderDetailsActivity extends BaseStatusActivity<PickerPresenter> {
...@@ -435,6 +436,11 @@ public class TravelOrderDetailsActivity extends BaseStatusActivity<PickerPresent ...@@ -435,6 +436,11 @@ public class TravelOrderDetailsActivity extends BaseStatusActivity<PickerPresent
} }
@JavascriptInterface
public void onClick() {
startActivity(WebActivity.getIntent(mActivity, mActivity.getString(R.string.rv_charge_details), ApiConfig.HTTP_URL_CAR_TYPE_COSTDETAIL));
}
@JavascriptInterface @JavascriptInterface
public void showMore() { public void showMore() {
......
...@@ -649,6 +649,7 @@ ...@@ -649,6 +649,7 @@
android:textSize="@dimen/text_18" /> android:textSize="@dimen/text_18" />
<LinearLayout <LinearLayout
android:id="@+id/ll_item_activity_all"
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="@dimen/size_30" android:layout_height="@dimen/size_30"
android:gravity="center_vertical" android:gravity="center_vertical"
......
...@@ -34,136 +34,141 @@ ...@@ -34,136 +34,141 @@
<View <View
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="@dimen/size_30"/> android:layout_height="@dimen/size_30" />
<android.support.v4.widget.NestedScrollView <android.support.v4.widget.NestedScrollView
android:background="@color/colorYellow" android:id="@+id/nested_scrollview"
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:layout_marginRight="@dimen/size_40"
android:layout_marginLeft="@dimen/size_40" android:layout_marginLeft="@dimen/size_40"
android:id="@+id/nested_scrollview" android:layout_marginRight="@dimen/size_40"
android:background="@color/colorYellow"
android:orientation="vertical"> android:orientation="vertical">
<RelativeLayout <RelativeLayout
android:id="@+id/rl_body" android:id="@+id/rl_body"
android:background="@color/colorWrite"
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="match_parent"> android:layout_height="match_parent"
<ImageView android:background="@color/colorWrite">
android:id="@+id/iv_goods"
android:scaleType="centerCrop" <ImageView
android:layout_width="match_parent" android:id="@+id/iv_goods"
android:layout_height="300dp" /> android:layout_width="match_parent"
android:layout_height="300dp"
android:scaleType="centerCrop" />
<LinearLayout <LinearLayout
android:background="@color/colorWrite"
android:layout_below="@id/iv_goods"
android:orientation="vertical"
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="match_parent"> android:layout_height="match_parent"
android:layout_below="@id/iv_goods"
android:background="@color/colorWrite"
android:orientation="vertical">
<TextView
android:id="@+id/tv_name"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:ellipsize="end"
android:maxLines="1"
android:paddingLeft="@dimen/size_10"
android:paddingTop="@dimen/size_10"
android:paddingRight="@dimen/size_10"
android:text="大通自行式C型房车(旅居版)"
android:textColor="@color/textMain"
android:textSize="@dimen/text_16" />
<TextView
android:id="@+id/tv_content"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginTop="@dimen/size_3"
android:ellipsize="end"
android:maxLines="1"
android:paddingLeft="@dimen/size_10"
android:paddingRight="@dimen/size_10"
android:text="大通自行式C型房车(旅居版)"
android:textColor="@color/textGray"
android:textSize="@dimen/text_12" />
<TextView
android:id="@+id/tv_price"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginTop="@dimen/size_5"
android:ellipsize="end"
android:maxLines="1"
android:paddingLeft="@dimen/size_10"
android:paddingRight="@dimen/size_10"
android:text="¥3500天"
android:textColor="@color/colorAuxiliaryRed"
android:textSize="@dimen/text_16" />
<TextView
android:id="@+id/tv_name"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:paddingLeft="@dimen/size_10"
android:paddingRight="@dimen/size_10"
android:paddingTop="@dimen/size_10"
android:ellipsize="end"
android:maxLines="1"
android:text="大通自行式C型房车(旅居版)"
android:textColor="@color/textMain"
android:textSize="@dimen/text_16" />
<TextView
android:paddingLeft="@dimen/size_10"
android:paddingRight="@dimen/size_10"
android:id="@+id/tv_content"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:ellipsize="end"
android:layout_marginTop="@dimen/size_3"
android:maxLines="1"
android:text="大通自行式C型房车(旅居版)"
android:textColor="@color/textGray"
android:textSize="@dimen/text_12" />
<TextView
android:id="@+id/tv_price"
android:paddingLeft="@dimen/size_10"
android:paddingRight="@dimen/size_10"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginTop="@dimen/size_5"
android:ellipsize="end"
android:maxLines="1"
android:text="¥3500天"
android:textColor="@color/colorAuxiliaryRed"
android:textSize="@dimen/text_16" />
<LinearLayout <LinearLayout
android:orientation="horizontal"
android:layout_marginTop="@dimen/size_15"
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginTop="@dimen/size_15"
android:gravity="center_vertical" android:gravity="center_vertical"
android:layout_height="wrap_content"> android:orientation="horizontal">
<ImageView
android:layout_width="@dimen/size_15" <ImageView
android:layout_height="@dimen/size_30" android:layout_width="@dimen/size_15"
android:background="@drawable/rv_half_left" android:layout_height="@dimen/size_30"
/> android:background="@drawable/rv_half_left" />
<RelativeLayout <RelativeLayout
android:layout_weight="1"
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="wrap_content"> android:layout_height="wrap_content"
<include layout="@layout/common_line"/> android:layout_weight="1">
<include layout="@layout/common_line" />
</RelativeLayout> </RelativeLayout>
<ImageView <ImageView
android:layout_width="@dimen/size_15" android:layout_width="@dimen/size_15"
android:layout_height="@dimen/size_30" android:layout_height="@dimen/size_30"
android:background="@drawable/rv_half_right" android:background="@drawable/rv_half_right" />
/>
</LinearLayout> </LinearLayout>
<RelativeLayout <RelativeLayout
android:padding="@dimen/size_15"
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="wrap_content"> android:layout_height="wrap_content"
<ImageView android:padding="@dimen/size_15">
android:layout_marginLeft="@dimen/size_30"
android:layout_width="@dimen/size_60" <ImageView
android:layout_height="@dimen/size_60" android:id="@+id/iv_code"
android:scaleType="fitXY" android:layout_width="@dimen/size_60"
android:src="@drawable/rv_test_code" android:layout_height="@dimen/size_60"
android:id="@+id/iv_code" android:layout_marginLeft="@dimen/size_30"
/> android:scaleType="centerCrop" />
<LinearLayout
android:layout_marginRight="@dimen/size_30" <LinearLayout
android:layout_toRightOf="@id/iv_code" android:layout_width="match_parent"
android:orientation="vertical" android:layout_height="wrap_content"
android:layout_centerVertical="true" android:layout_centerVertical="true"
android:layout_marginLeft="@dimen/size_10" android:layout_marginLeft="@dimen/size_10"
android:layout_width="match_parent" android:layout_marginRight="@dimen/size_30"
android:layout_height="wrap_content"> android:layout_toRightOf="@id/iv_code"
android:orientation="vertical">
<TextView <TextView
android:layout_width="wrap_content" android:layout_width="wrap_content"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:text="欣新房车" android:text="滴房车"
android:textSize="@dimen/text_16"
android:textColor="@color/textMain" android:textColor="@color/textMain"
/> android:textSize="@dimen/text_16" />
<TextView
android:layout_width="wrap_content" <TextView
android:layout_height="wrap_content" android:layout_width="wrap_content"
android:text="长按二维码查看详情" android:layout_height="wrap_content"
android:textSize="@dimen/text_16" android:text="长按二维码查看详情"
android:textColor="@color/textLightGrey" android:textColor="@color/textLightGrey"
/> android:textSize="@dimen/text_16" />
</LinearLayout> </LinearLayout>
</RelativeLayout> </RelativeLayout>
</LinearLayout> </LinearLayout>
</RelativeLayout> </RelativeLayout>
</android.support.v4.widget.NestedScrollView> </android.support.v4.widget.NestedScrollView>
......
...@@ -191,7 +191,7 @@ public class MineFragment extends BaseFragment<CommonPresenter> implements Simpl ...@@ -191,7 +191,7 @@ public class MineFragment extends BaseFragment<CommonPresenter> implements Simpl
@OnClick({R2.id.iv_notification, R2.id.iv_avatar, R2.id.tv_login, R2.id.tv_verified, R2.id.rl_item_to_be_paid, R2.id.rl_item_staying, @OnClick({R2.id.iv_notification, R2.id.iv_avatar, R2.id.tv_login, R2.id.tv_verified, R2.id.rl_item_to_be_paid, R2.id.rl_item_staying,
R2.id.rl_item_traveling, R2.id.rl_item_completed, R2.id.rl_item_all, R2.id.rl_item_collection, R2.id.rl_item_personal_information, R2.id.rl_item_traveling, R2.id.rl_item_completed, R2.id.rl_item_all, R2.id.rl_item_collection, R2.id.rl_item_personal_information,
R2.id.rl_item_setting, R2.id.rl_item_driver, R2.id.rl_item_traveler, R2.id.rl_item_my_pat, R2.id.tv_view_privileges}) R2.id.rl_item_setting, R2.id.rl_item_driver, R2.id.rl_item_traveler, R2.id.rl_item_my_pat, R2.id.tv_view_privileges, R2.id.rl_item_my_release})
public void onViewClicked(View view) { public void onViewClicked(View view) {
int id = view.getId(); int id = view.getId();
if (id == R.id.iv_notification){ if (id == R.id.iv_notification){
......
...@@ -74,6 +74,7 @@ public class CollectionActivity extends BaseStatusActivity<CommonPresenter> impl ...@@ -74,6 +74,7 @@ public class CollectionActivity extends BaseStatusActivity<CommonPresenter> impl
.withString("name", dataBean.getName()) .withString("name", dataBean.getName())
.withString("content", dataBean.getUnit()) .withString("content", dataBean.getUnit())
.withString("url", dataBean.getCover()) .withString("url", dataBean.getCover())
.withDouble("price",dataBean.getPrice())
.navigation(); .navigation();
}else if (1 == dataBean.getType()){ }else if (1 == dataBean.getType()){
......
...@@ -170,6 +170,7 @@ public class TourismFragment extends BaseFragment<TourismPresenter> implements B ...@@ -170,6 +170,7 @@ public class TourismFragment extends BaseFragment<TourismPresenter> implements B
.withString("name", dataBean.getName()) .withString("name", dataBean.getName())
.withString("content", dataBean.getContent()) .withString("content", dataBean.getContent())
.withString("url", dataBean.getCover()) .withString("url", dataBean.getCover())
.withDouble("price",Double.valueOf(dataBean.getPrice()))
.navigation(); .navigation();
} }
}); });
......
...@@ -134,6 +134,7 @@ public class PopularTourListActivity extends BaseStatusActivity<TourismPresenter ...@@ -134,6 +134,7 @@ public class PopularTourListActivity extends BaseStatusActivity<TourismPresenter
.withString("name",item.getName()) .withString("name",item.getName())
.withString("content",item.getContent()) .withString("content",item.getContent())
.withString("url",item.getCover()) .withString("url",item.getCover())
.withDouble("price",Double.valueOf(item.getPrice()))
.navigation(); .navigation();
} }
}); });
......
...@@ -104,6 +104,9 @@ public class TravelDetailsActivity extends BaseStatusActivity<TourismPresenter> ...@@ -104,6 +104,9 @@ public class TravelDetailsActivity extends BaseStatusActivity<TourismPresenter>
@Autowired() @Autowired()
String url; String url;
@Autowired()
double price;
// public static Intent getIntent(Context context, BeanTourAround.DataBeanX.DataBean dataBean) { // public static Intent getIntent(Context context, BeanTourAround.DataBeanX.DataBean dataBean) {
// return new Intent(context, TravelDetailsActivity.class) // return new Intent(context, TravelDetailsActivity.class)
...@@ -334,7 +337,9 @@ public class TravelDetailsActivity extends BaseStatusActivity<TourismPresenter> ...@@ -334,7 +337,9 @@ public class TravelDetailsActivity extends BaseStatusActivity<TourismPresenter>
.withString("icon",url) .withString("icon",url)
.withString("name",name) .withString("name",name)
.withString("keyword",content) .withString("keyword",content)
.withDouble("price",0).navigation(); .withDouble("price",price)
.withString("url",webUrl)
.navigation();
} else if (snsPlatform.mShowWord.equals("复制链接")) { } else if (snsPlatform.mShowWord.equals("复制链接")) {
copyText(); copyText();
} }
......
...@@ -77,6 +77,7 @@ public class TravelSearchActivity extends BaseStatusActivity<SearchPresenter> { ...@@ -77,6 +77,7 @@ public class TravelSearchActivity extends BaseStatusActivity<SearchPresenter> {
.withString("name", dataBean.getName()) .withString("name", dataBean.getName())
.withString("content", dataBean.getContent()) .withString("content", dataBean.getContent())
.withString("url", dataBean.getCover()) .withString("url", dataBean.getCover())
.withDouble("price",Double.valueOf(dataBean.getPrice()))
.navigation(); .navigation();
finish(); finish();
} }
...@@ -147,6 +148,7 @@ public class TravelSearchActivity extends BaseStatusActivity<SearchPresenter> { ...@@ -147,6 +148,7 @@ public class TravelSearchActivity extends BaseStatusActivity<SearchPresenter> {
map.put("query", search); map.put("query", search);
map.put("page", page); map.put("page", page);
map.put("limit", "10"); map.put("limit", "10");
map.put("distance", 10.0);
map.put("latitudel", latLatitude); map.put("latitudel", latLatitude);
map.put("longitude", lonLongitude); map.put("longitude", lonLongitude);
mPresenter.getData(0, SearchApi.QUERY_RIM_LIST, BeanTravelSearch.class, map, true); mPresenter.getData(0, SearchApi.QUERY_RIM_LIST, BeanTravelSearch.class, map, true);
......
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