Commit f031befa authored by 419948809@qq.com's avatar 419948809@qq.com

首页改版的首次提交代码

parent d2f1ce7a
...@@ -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
flavorDimensions "default" flavorDimensions "default"
versionCode 157 versionCode 158
versionName "1.5.7" versionName "1.5.8"
multiDexEnabled true multiDexEnabled true
......
...@@ -2,6 +2,7 @@ package com.ruiwenliu.wrapper.base; ...@@ -2,6 +2,7 @@ package com.ruiwenliu.wrapper.base;
import android.content.Context; import android.content.Context;
import android.support.v7.widget.RecyclerView; import android.support.v7.widget.RecyclerView;
import android.text.TextUtils;
import android.view.LayoutInflater; import android.view.LayoutInflater;
import android.view.View; import android.view.View;
import android.view.ViewGroup; import android.view.ViewGroup;
...@@ -10,6 +11,7 @@ import com.ruiwenliu.wrapper.R; ...@@ -10,6 +11,7 @@ import com.ruiwenliu.wrapper.R;
import com.ruiwenliu.wrapper.inter.OnViewHolder; import com.ruiwenliu.wrapper.inter.OnViewHolder;
import com.ruiwenliu.wrapper.presenter.MvpPresenter; import com.ruiwenliu.wrapper.presenter.MvpPresenter;
import com.ruiwenliu.wrapper.util.ViewHolder; import com.ruiwenliu.wrapper.util.ViewHolder;
import com.yuyife.okgo.OkGoUtil;
/** /**
......
...@@ -3,7 +3,7 @@ ...@@ -3,7 +3,7 @@
package="com.rv.home"> package="com.rv.home">
<application> <application>
<activity android:name=".rv.module.ui.main.home.CarVRActivity"></activity> <activity android:name=".rv.module.ui.main.home.CarVRActivity" />
<activity <activity
android:name=".rv.module.ui.main.home.order.ChargeDetailsActivity" android:name=".rv.module.ui.main.home.order.ChargeDetailsActivity"
android:screenOrientation="portrait" /> android:screenOrientation="portrait" />
...@@ -19,6 +19,8 @@ ...@@ -19,6 +19,8 @@
<activity <activity
android:name=".rv.module.ui.main.home.SalesroomActivity" android:name=".rv.module.ui.main.home.SalesroomActivity"
android:screenOrientation="portrait" /> android:screenOrientation="portrait" />
<activity android:name=".rv.module.ui.main.home.CarRentActivity"
android:screenOrientation="portrait" />
</application> </application>
</manifest> </manifest>
\ No newline at end of file
...@@ -83,8 +83,6 @@ public class CarRentalListActivity extends BaseStatusActivity<CommonPresenter> i ...@@ -83,8 +83,6 @@ public class CarRentalListActivity extends BaseStatusActivity<CommonPresenter> i
private int mPage; private int mPage;
private double mLat; private double mLat;
private double mLon; private double mLon;
private double outLongitude;
private double outLatitude;
private boolean mBool; private boolean mBool;
private int selectType; private int selectType;
private CarAttributePw mCarPw; private CarAttributePw mCarPw;
...@@ -96,12 +94,10 @@ public class CarRentalListActivity extends BaseStatusActivity<CommonPresenter> i ...@@ -96,12 +94,10 @@ public class CarRentalListActivity extends BaseStatusActivity<CommonPresenter> i
private long copyDay;//租车天数 private long copyDay;//租车天数
private CheckPriceDialog checkPriceDialog; private CheckPriceDialog checkPriceDialog;
public static Intent getIntent(Context context, double lat, double lon, double outLatitude, double outLongitude, boolean bool, OrderDataBean bean, String startTime, String endTime) { public static Intent getIntent(Context context, double lat, double lon, boolean bool, OrderDataBean bean, String startTime, String endTime) {
return new Intent(context, CarRentalListActivity.class) return new Intent(context, CarRentalListActivity.class)
.putExtra("lat", lat) .putExtra("lat", lat)
.putExtra("lon", lon) .putExtra("lon", lon)
.putExtra("outLatitude", outLatitude)
.putExtra("outLongitude", outLongitude)
.putExtra("bean", bean) .putExtra("bean", bean)
.putExtra("bool", bool) .putExtra("bool", bool)
.putExtra("startTime", startTime) .putExtra("startTime", startTime)
...@@ -125,8 +121,6 @@ public class CarRentalListActivity extends BaseStatusActivity<CommonPresenter> i ...@@ -125,8 +121,6 @@ public class CarRentalListActivity extends BaseStatusActivity<CommonPresenter> i
listScreeningId = new ArrayList<>(); listScreeningId = new ArrayList<>();
mLat = intent.getDoubleExtra("lat", 0); mLat = intent.getDoubleExtra("lat", 0);
mLon = intent.getDoubleExtra("lon", 0); mLon = intent.getDoubleExtra("lon", 0);
outLatitude = intent.getDoubleExtra("outLatitude", 0);
outLongitude = intent.getDoubleExtra("outLongitude", 0);
mBool = intent.getBooleanExtra("bool", false); mBool = intent.getBooleanExtra("bool", false);
titleView.setImageResource(R.id.iv_title_right, R.drawable.rv_rentingcar_icon_plat); titleView.setImageResource(R.id.iv_title_right, R.drawable.rv_rentingcar_icon_plat);
titleView.setChildClickListener(R.id.iv_title_right, new View.OnClickListener() { titleView.setChildClickListener(R.id.iv_title_right, new View.OnClickListener() {
......
package com.rv.home.rv.module.ui.main.home.presenter;
import android.text.TextUtils;
import com.google.gson.Gson;
import com.ruiwenliu.wrapper.base.presenter.CommonPresenter;
import com.ruiwenliu.wrapper.util.UtilsManager;
import com.rv.component.utils.DateUtils;
import com.rv.home.rv.module.ui.main.home.CarRentalListActivity;
import com.rv.home.rv.module.ui.main.home.bean.CityPickerBean;
import com.rv.home.rv.module.ui.main.home.bean.ListsBean;
import com.rv.home.rv.module.ui.main.home.bean.OrderDataBean;
public class CarRentPresenter extends CommonPresenter {
/**
* 传参
*
* @param starCity
* @param starAddress
* @param endCity
* @param endAddress
* @param getTime
* @param outTime
* @param day
* @param startTime
* @param endTime
*/
public void sendData(int getCityId,int outCityId,int getCompanyId ,int outCompanyId,
double latLatitude,double lonLongitude,
String starCity, String starAddress, String endCity, String endAddress,
String getTime, String outTime, long day, String startTime, String endTime) {
OrderDataBean dataBean = new OrderDataBean();
if (getCityId > 0) {
dataBean.setStartCity(getCityId);
}
if (outCityId > 0) {
dataBean.setEndCity(outCityId);
} else {
String json = UtilsManager.getInstance().getJson(getPresenterContext(), "city.json");
CityPickerBean bean = new Gson().fromJson(json, CityPickerBean.class);
for (CityPickerBean.CityBean cityBean : bean.getCity()) {
for (ListsBean lsBean : cityBean.getLists()) {
if (!TextUtils.isEmpty(starCity) && starCity.equals(lsBean.getName())) {
dataBean.setStartCity(lsBean.getId());
}
if (!TextUtils.isEmpty(endCity) && endCity.equals(lsBean.getName())) {
dataBean.setEndCity(lsBean.getId());
}
}
}
}
dataBean.setDayNum(Integer.valueOf(day + ""));
dataBean.setStartCityName(starCity);
dataBean.setStartAddr(starAddress);
dataBean.setStartTime(DateUtils.StringToTimeMillis2(getTime));
dataBean.setEndTime(DateUtils.StringToTimeMillis2(outTime));
dataBean.setEndCityName(endCity);
dataBean.setEndCompanyId(outCompanyId);
dataBean.setEndAddr(endAddress);
dataBean.setDriverType(2);
dataBean.setStartCompanyId(getCompanyId);
getPresenterContext().startActivity(CarRentalListActivity.getIntent(getPresenterContext(), latLatitude, lonLongitude, false, dataBean, startTime, endTime));
}
}
...@@ -64,7 +64,7 @@ public class HomePresenter extends CommonPresenter { ...@@ -64,7 +64,7 @@ public class HomePresenter extends CommonPresenter {
* *
* @return * @return
*/ */
private boolean isLogin(Context context) { public boolean isLogin(Context context) {
if (TextUtils.isEmpty(OkGoUtil.getToken())) { if (TextUtils.isEmpty(OkGoUtil.getToken())) {
context.startActivity(LoginRvActivity.getIntent(context, 0)); context.startActivity(LoginRvActivity.getIntent(context, 0));
return false; return false;
......
<?xml version="1.0" encoding="utf-8"?> <?xml version="1.0" encoding="utf-8"?>
<shape xmlns:android="http://schemas.android.com/apk/res/android"> <shape xmlns:android="http://schemas.android.com/apk/res/android">
<corners android:radius="@dimen/size_50"/> <corners android:radius="@dimen/size_50"/>
<solid android:color="@color/gray_50ffffff" /> <solid android:color="@color/white" />
</shape> </shape>
\ No newline at end of file
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:layout_height="match_parent"
tools:context=".rv.module.ui.main.home.CarRentActivity">
<LinearLayout
android:background="@color/white"
android:paddingLeft="@dimen/size_15"
android:paddingRight="@dimen/size_15"
android:id="@+id/ll_layout_home_renting_a_car"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:orientation="vertical">
<LinearLayout
android:id="@+id/ll_rent"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginTop="@dimen/size_10"
android:layout_marginBottom="@dimen/size_10"
android:orientation="vertical">
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="@string/rv_get_car_address"
android:textColor="@color/textLightGrey"
android:textSize="@dimen/text_12" />
<TextView
android:id="@+id/tv_home_get_address"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_gravity="bottom"
android:layout_marginTop="@dimen/size_5"
android:layout_weight="1"
android:gravity="left|center_vertical"
android:hint="@string/rv_get_car_hint"
android:textColorHint="@color/textMain"
android:textSize="@dimen/text_16" />
</LinearLayout>
<include layout="@layout/common_line" />
<LinearLayout
android:id="@+id/ll_return"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginTop="@dimen/size_15"
android:layout_marginBottom="@dimen/size_10"
android:orientation="vertical">
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="@string/rv_get_out_address"
android:textColor="@color/textLightGrey"
android:textSize="@dimen/text_12" />
<TextView
android:id="@+id/tv_home_out_address"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_gravity="bottom"
android:layout_marginTop="@dimen/size_5"
android:layout_weight="1"
android:gravity="left|center_vertical"
android:hint="@string/rv_get_out_hint"
android:textColorHint="@color/textMain"
android:textSize="@dimen/text_16" />
</LinearLayout>
<include layout="@layout/common_line" />
<LinearLayout
android:id="@+id/ll_home_item_select_data"
android:layout_width="match_parent"
android:layout_height="@dimen/size_60"
android:gravity="center_vertical"
android:orientation="horizontal">
<LinearLayout
android:id="@+id/ll_item_get_time"
android:layout_width="0dp"
android:layout_height="match_parent"
android:layout_weight="1"
android:gravity="center_vertical"
android:orientation="horizontal">
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="center_vertical"
android:background="@drawable/shape_rv_bg_yellow_small"
android:paddingLeft="@dimen/size_3"
android:paddingTop="@dimen/size_1"
android:paddingRight="@dimen/size_3"
android:paddingBottom="@dimen/size_1"
android:text="@string/rv_get"
android:textColor="@color/colorWrite"
android:textSize="@dimen/text_10" />
<LinearLayout
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginLeft="@dimen/size_5"
android:gravity="center"
android:orientation="vertical">
<TextView
android:id="@+id/tv_home_get_time"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:gravity="center_vertical"
android:text=""
android:textColor="@color/colorMain"
android:textSize="@dimen/text_12" />
<TextView
android:id="@+id/tv_home_get_week"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text=""
android:textColor="@color/textGray"
android:textSize="@dimen/text_12" />
</LinearLayout>
</LinearLayout>
<RelativeLayout
android:layout_width="wrap_content"
android:layout_height="wrap_content">
<TextView
android:id="@+id/tv_home_day"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_centerHorizontal="true"
android:drawableBottom="@drawable/icon_day_times"
android:gravity="center"
android:text=""
android:textSize="@dimen/text_14" />
</RelativeLayout>
<LinearLayout
android:id="@+id/ll_item_alsotime"
android:layout_width="0dp"
android:layout_height="match_parent"
android:layout_weight="1"
android:gravity="center_vertical|right"
android:orientation="horizontal">
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="center_vertical"
android:background="@drawable/shape_rv_main_small"
android:paddingLeft="@dimen/size_3"
android:paddingTop="@dimen/size_1"
android:paddingRight="@dimen/size_3"
android:paddingBottom="@dimen/size_1"
android:text="@string/rv_out"
android:textColor="@color/colorWrite"
android:textSize="@dimen/text_10" />
<LinearLayout
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginLeft="@dimen/size_5"
android:gravity="center"
android:orientation="vertical">
<TextView
android:id="@+id/tv_home_out_time"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:gravity="center_vertical"
android:text=""
android:textColor="@color/colorMain"
android:textSize="@dimen/text_12" />
<TextView
android:id="@+id/tv_home_out_week"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text=""
android:textColor="@color/textGray"
android:textSize="@dimen/text_12" />
</LinearLayout>
</LinearLayout>
</LinearLayout>
<Button
android:id="@+id/tv_home_select_car"
android:layout_width="match_parent"
android:layout_height="@dimen/size_50"
android:background="@drawable/shape_rv_bg_shallow_dark_yellow_circle"
android:gravity="center"
android:text="立即选车"
android:textColor="@color/colorWrite"
android:textSize="@dimen/text_16" />
</LinearLayout>
</LinearLayout>
\ No newline at end of file
...@@ -47,10 +47,10 @@ ...@@ -47,10 +47,10 @@
<string name="rv_ok">确定</string> <string name="rv_ok">确定</string>
<string name="rv_rental_car">租房车</string> <string name="rv_rental_car">租房车</string>
<string name="rv_rental_car_content">开启生活新旅程</string> <string name="rv_rental_car_content">开启生活新旅程</string>
<string name="rv_get_car_address">取车公司</string> <string name="rv_get_car_address">您在哪取车</string>
<string name="rv_get_car_address_">取车地址:</string> <string name="rv_get_car_address_">取车地址:</string>
<string name="rv_get_car_hint">请选择取车分公司</string> <string name="rv_get_car_hint">请选择取车分公司</string>
<string name="rv_get_out_address">还车公司</string> <string name="rv_get_out_address">您在哪还车</string>
<string name="rv_get_out_address_">还车地址:</string> <string name="rv_get_out_address_">还车地址:</string>
<string name="rv_get_out_hint">请选择还车分公司</string> <string name="rv_get_out_hint">请选择还车分公司</string>
<string name="rv_full_time_driver">欣新专职司机(600/天)</string> <string name="rv_full_time_driver">欣新专职司机(600/天)</string>
...@@ -175,5 +175,15 @@ ...@@ -175,5 +175,15 @@
<string name="tv_boarding">立即上车</string> <string name="tv_boarding">立即上车</string>
<string name="tv_cancelled">已取消</string> <string name="tv_cancelled">已取消</string>
<string name="rv_collection_data_null">您还没有收藏的信息哦</string> <string name="rv_collection_data_null">您还没有收藏的信息哦</string>
<string name="rv_home_car_recent">房车租赁</string>
<string name="rv_home_car_travel">房车旅行</string>
<string name="rv_home_car_camp">房车营地</string>
<string name="rv_home_discovery">发现</string>
<string name="rv_home_buy_car">购房车</string>
<string name="rv_home_title_hot_travle">热门旅行</string>
<string name="rv_home_title_camp">娱乐营地</string>
<string name="rv_home_title_recent_info">租车信息</string>
<!--=================================================房车结束========================================--> <!--=================================================房车结束========================================-->
</resources> </resources>
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