Commit c44025eb authored by jianglx's avatar jianglx

预售卡和小米,oppo,vivo权限处理

parent b3f549c2
......@@ -63,6 +63,7 @@ import com.rv.component.utils.CacheEnum;
import com.rv.component.utils.Cookie;
import com.rv.component.utils.DateUtils;
import com.rv.component.utils.LogUtil;
import com.rv.component.utils.MachineAuthorityHelper;
import com.rv.component.utils.RvCache;
import com.rv.home.rv.module.ApiConfig;
import com.rv.home.rv.module.ui.main.home.HomeFragment;
......@@ -195,6 +196,7 @@ public class MainActivity extends BaseActivity<CommonPresenter> implements DownL
// AppUtils.setBadger(ImSetting.getContext(), ChatMessageServiceImp.getInstance(ImSetting.getContext()).getUnReadMsg());
GpsManager.getInstance(this).rigister();
MachineAuthorityHelper.checkMachineAuthority(this);
}
@Override
......@@ -510,39 +512,39 @@ public class MainActivity extends BaseActivity<CommonPresenter> implements DownL
*/
private void setViewStyle(ImageView imageView, TextView textView, boolean isTrue) {
// imageView.setSelected(isTrue);
if (imageView ==ivHome){
if (isTrue){
GlideManager.getInstance(mActivity).loadGifImage(R.drawable.home_icon_motion_home, imageView,1);
if (imageView == ivHome) {
if (isTrue) {
GlideManager.getInstance(mActivity).loadGifImage(R.drawable.home_icon_motion_home, imageView, 1);
return;
}else {
} else {
GlideManager.getInstance(mActivity).loadImage2(R.drawable.home_icon_home_unselected, imageView);
}
}else if (imageView ==ivTravel){
if (isTrue){
GlideManager.getInstance(mActivity).loadGifImage(R.drawable.home_icon_motion_travel, imageView,1);
} else if (imageView == ivTravel) {
if (isTrue) {
GlideManager.getInstance(mActivity).loadGifImage(R.drawable.home_icon_motion_travel, imageView, 1);
return;
}else {
} else {
GlideManager.getInstance(mActivity).loadImage2(R.drawable.home_icon_travel_unselected, imageView);
}
}else if (imageView ==ivCamp){
if (isTrue){
GlideManager.getInstance(mActivity).loadGifImage(R.drawable.home_icon_motion_campsite, imageView,1);
} else if (imageView == ivCamp) {
if (isTrue) {
GlideManager.getInstance(mActivity).loadGifImage(R.drawable.home_icon_motion_campsite, imageView, 1);
return;
}else {
} else {
GlideManager.getInstance(mActivity).loadImage2(R.drawable.home_icon_campsite_unselected, imageView);
}
}else if (imageView ==ivFound){
if (isTrue){
GlideManager.getInstance(mActivity).loadGifImage(R.drawable.home_icon_motion_discover, imageView,1);
} else if (imageView == ivFound) {
if (isTrue) {
GlideManager.getInstance(mActivity).loadGifImage(R.drawable.home_icon_motion_discover, imageView, 1);
return;
}else {
} else {
GlideManager.getInstance(mActivity).loadImage2(R.drawable.home_icon_discover_unselected, imageView);
}
}else if (imageView == ivMine){
if (isTrue){
GlideManager.getInstance(mActivity).loadGifImage(R.drawable.home_icon_motion_mine, imageView,1);
} else if (imageView == ivMine) {
if (isTrue) {
GlideManager.getInstance(mActivity).loadGifImage(R.drawable.home_icon_motion_mine, imageView, 1);
return;
}else {
} else {
GlideManager.getInstance(mActivity).loadImage2(R.drawable.home_icon_mine_unselected, imageView);
}
}
......
......@@ -3,6 +3,7 @@
buildscript {
ext.kotlin_version = '1.2.51'
repositories {
maven{ url 'http://maven.aliyun.com/nexus/content/groups/public/'}
google()
jcenter()
maven {
......@@ -15,7 +16,6 @@ buildscript {
maven {
url "https://jitpack.io"
}
mavenCentral()
}
dependencies {
classpath 'com.android.tools.build:gradle:3.2.1'
......@@ -29,9 +29,13 @@ buildscript {
allprojects {
repositories {
mavenCentral()
maven { url 'http://maven.aliyun.com/nexus/content/groups/public/' }
maven { url 'http://maven.aliyun.com/nexus/content/repositories/jcenter' }
maven { url 'http://maven.aliyun.com/nexus/content/repositories/google' }
maven { url 'http://maven.aliyun.com/nexus/content/repositories/gradle-plugin' }
google()
jcenter()
// 支付宝 SDK AAR 包所需的配置
flatDir {
dirs 'libs'
......
......@@ -69,7 +69,7 @@ dependencies {
implementation fileTree(dir: 'libs', include: ['*.jar'])
implementation 'com.android.support:appcompat-v7:28.0.0'
testImplementation 'junit:junit:4.12'
androidTestImplementation 'com.android.support.test:runner:1.0.2'
androidTestImplementation 'com.android.support.test.espresso:espresso-core:3.0.2'
// testImplementation 'junit:junit:4.12'
// androidTestImplementation 'com.android.support.test:runner:1.0.2'
// androidTestImplementation 'com.android.support.test.espresso:espresso-core:3.0.2'
}
......@@ -25,7 +25,10 @@
android:layout_height="@dimen/size_30"
android:layout_alignParentRight="true"
android:layout_centerVertical="true"
android:padding="@dimen/size_5"
android:paddingLeft="11dp"
android:paddingTop="@dimen/size_8"
android:paddingBottom="@dimen/size_8"
android:paddingRight="@dimen/size_5"
android:src="@drawable/common_btn_close" />
</RelativeLayout>
......@@ -174,7 +177,7 @@
android:layout_marginTop="@dimen/size_20"
android:layout_marginRight="@dimen/size_15"
android:layout_marginBottom="@dimen/size_15"
android:background="@drawable/shape_rv_bg_yellow"
android:background="@drawable/shape_rv_bg_shallow_dark_yellow_circle"
android:gravity="center"
android:text="立即支付"
android:textColor="@color/colorWrite"
......
......@@ -61,6 +61,10 @@ android {
wandoujia {
}
}
compileOptions {
sourceCompatibility = '1.8'
targetCompatibility = '1.8'
}
}
......
package com.rv.component.utils;
import android.annotation.SuppressLint;
import android.app.Activity;
import android.app.AlertDialog;
import android.app.AppOpsManager;
import android.content.ComponentName;
import android.content.Context;
import android.content.Intent;
import android.net.Uri;
import android.os.Build;
import android.os.Process;
import android.text.TextUtils;
import com.example.component_utils.BuildConfig;
import java.lang.reflect.Method;
public class MachineAuthorityHelper {
@SuppressLint("NewApi")
public static void checkMachineAuthority(Activity activity) {
String machine = getMachine();
if (TextUtils.isEmpty(machine)) return;
boolean b = AppCookie.getBooleanValue("machine_authority", false);
if ("xiaomi".equalsIgnoreCase(machine) && hasOneWeek()) {
String finalMachine = machine;
if (!isAllowed(activity)) {
new AlertDialog.Builder(activity).setTitle("提示")
.setMessage("为了实时掌握房车出行优惠资讯,建议去开启“后台弹出界面”的权限")
.setNegativeButton("下次再说", (dialogInterface, i) -> {
dialogInterface.dismiss();
})
.setPositiveButton("好的", (dialogInterface, i) -> {
AppCookie.save("machine_authority", true);
gotoSetting(activity, finalMachine);
}).setCancelable(false).show();
}
} else if ( !b && ("vivo".equalsIgnoreCase(machine) || "oppo".equalsIgnoreCase(machine))) {
String finalMachine = machine;
new AlertDialog.Builder(activity).setTitle("提示")
.setMessage("为了实时掌握房车出行优惠资讯,建议去开启“后台弹出界面”的权限")
.setNegativeButton("下次再说", (dialogInterface, i) -> {
dialogInterface.dismiss();
})
.setPositiveButton("好的", (dialogInterface, i) -> {
AppCookie.save("machine_authority", true);
gotoSetting(activity, finalMachine);
}).setCancelable(false).show();
}
}
/***
* 判断上一次显示距现在是否有七天了
* @return
*/
public static boolean hasOneWeek() {
long lastShowTime = AppCookie.getLongValue("last_show_time");
long distance = System.currentTimeMillis() - lastShowTime;
if (distance > 1000 * 60 * 60 * 24 * 7) {
AppCookie.save("last_show_time", System.currentTimeMillis());
return true;
}
return false;
}
public static String getMachine() {
String machine = null;
if (Build.MANUFACTURER != null && Build.MANUFACTURER.length() > 0) {
machine = Build.MANUFACTURER.toLowerCase();
}
return machine;
}
private static void gotoSetting(Activity activity, String machine) {
switch (machine) {
case "vivo":
goVivoManager(activity);
break;
case "xiaomi":
goXiaoMiManager(activity);
break;
case "oppo":
goOppoManager(activity);
break;
}
}
private static void goVivoManager(Activity activity) {
Intent intent = new Intent();
intent.putExtra("packagename", activity.getPackageName());
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.N_MR1) {
intent.setComponent(new ComponentName("com.vivo.permissionmanager", "com.vivo.permissionmanager.activity.SoftPermissionDetailActivity"));
} else {
intent.setComponent(new ComponentName("com.iqoo.secure", "com.iqoo.secure.safeguard.SoftPermissionDetailActivity"));
}
start(activity, intent);
}
private static void goXiaoMiManager(Activity activity) {
Intent localIntent = new Intent("miui.intent.action.APP_PERM_EDITOR");
localIntent.setClassName("com.miui.securitycenter", "com.miui.permcenter.permissions.PermissionsEditorActivity");
localIntent.putExtra("extra_pkgname", activity.getPackageName());
start(activity, localIntent);
}
private static void goOppoManager(Activity activity) {
Intent intent = new Intent("android.settings.APPLICATION_DETAILS_SETTINGS");
intent.setFlags(Intent.FLAG_ACTIVITY_NEW_TASK);
intent.putExtra("packageName", BuildConfig.APPLICATION_ID);
ComponentName comp = new ComponentName("com.coloros.securitypermission", "com.coloros.securitypermission.permission.PermissionAppAllPermissionActivity");//R11t 7.1.1 os-v3.2
intent.setComponent(comp);
start(activity, intent);
}
private static void start(Activity activity, Intent intent) {
try {
activity.startActivity(intent);
} catch (Exception e) {
goAppDetailSetting(activity);
}
}
private static boolean isAllowed(Activity activity) {
@SuppressLint({"NewApi", "LocalSuppress"}) AppOpsManager ops = (AppOpsManager) activity.getSystemService(Context.APP_OPS_SERVICE);
try {
int op = 10021;
Method method = ops.getClass().getMethod("checkOpNoThrow", new Class[]{int.class, int.class, String.class});
Integer result = (Integer) method.invoke(ops, op, Process.myUid(), activity.getPackageName());
return result == AppOpsManager.MODE_ALLOWED;
} catch (Exception e) {
}
return false;
}
private static void goAppDetailSetting(Context context) {
Intent localIntent = new Intent();
localIntent.addFlags(Intent.FLAG_ACTIVITY_NEW_TASK);
if (Build.VERSION.SDK_INT >= 9) {
localIntent.setAction("android.settings.APPLICATION_DETAILS_SETTINGS");
localIntent.setData(Uri.fromParts("package", BuildConfig.APPLICATION_ID, null));
} else if (Build.VERSION.SDK_INT <= 8) {
localIntent.setAction(Intent.ACTION_VIEW);
localIntent.setClassName("com.android.settings", "com.android.settings.InstalledAppDetails");
localIntent.putExtra("com.android.settings.ApplicationPkgName", BuildConfig.APPLICATION_ID);
}
try {
context.startActivity(localIntent);
} catch (Exception e) {
e.printStackTrace();
}
}
}
......@@ -21,6 +21,10 @@
android:screenOrientation="portrait" />
<activity android:name=".rv.module.ui.main.home.CarRentActivity"
android:screenOrientation="portrait" />
<activity android:name=".rv.module.ui.main.home.order.PreCardOrderDetailsActivity"
android:screenOrientation="portrait"
/>
</application>
</manifest>
\ No newline at end of file
......@@ -40,6 +40,7 @@ public class ApiConfig {
public static String HTTP_URL_CAR_TYPE_DETAIL = RvFrameConfig.HOST_H5_DETAIL + "/h5/appHtml/view/detail.html";//租车类型详情页
public static String HTTP_URL_CAR_TYPE_ORDERDETAIL = RvFrameConfig.HOST_H5_DETAIL + "/h5/appHtml/view/orderDetail.html";//订单详情页
public static String HTTP_URL_VIP_ORDERDETAIL = RvFrameConfig.HOST_H5_DETAIL + "/h5/appHtml/view/vipOrderDetail.html?no=%s";
public static String HTTP_URL_PRECARD_ORDERDETAIL = RvFrameConfig.HOST_H5_DETAIL + "/h5/appHtml/view/preCardOrderDetail.html?orderId=%s";
public static String HTTP_URL_BASEORDER_CANCEL = RvFrameConfig.VEHICLE_ORDER + "baseOrder/cancel/";//重置密码
public static String HTTP_URL_CAR_TYPE_TRAVELORDERDETAIL = RvFrameConfig.HOST_H5_DETAIL + "/h5/appHtml/view/travelOrderDetail.html";//旅游订单详情页
public static String HTTP_URL_CAR_TYPE_COSTDETAIL = RvFrameConfig.HOST_H5_DETAIL + "/h5/appHtml/view/costDetail.html";//费用明细
......@@ -204,4 +205,8 @@ public class ApiConfig {
* 校验图形验证码
*/
public static String HTTP_URL_CLICK_VERIFY = RvFrameConfig.HOST + "/api/universal/captcha/app/unauth/verify?phone=%s&pointList=%s" ;
public static String HTTP_URL_ACTIVITY_ALL_GOODS = RvFrameConfig.HOST + "/api/activity/activity/product/app/unauth/getAll" ;
public static String HTTP_URL_ACTIVITY_ADD = RvFrameConfig.HOST + "/api/order/order/activity/add" ;
}
......@@ -97,6 +97,8 @@ public class AllOrderFragment extends BaseFragment<CommonPresenter> implements B
startActivityForResult(TravelOrderDetailsActivity.getIntent(_mActivity, dataBean.getNo()), 2);
} else if (3 == dataBean.getType()) {
startActivityForResult(MemberOrderDetailsActivity.getIntent(_mActivity, dataBean.getNo()), 3);
} else if(4 == dataBean.getType()){
startActivityForResult(PreCardOrderDetailsActivity.getIntent(_mActivity, dataBean.getNo()),4);
}
}
});
......@@ -116,6 +118,8 @@ public class AllOrderFragment extends BaseFragment<CommonPresenter> implements B
payShowSelect(dataBean.getNo(), dataBean.getRealAmount());
} else if (id == R.id.tv_member_pay) {
payShowSelect(dataBean.getNo(), dataBean.getRealAmount());
} else if(id == R.id.tv_remain_time){
payShowSelect(dataBean.getNo(), dataBean.getRealAmount());
}
break;
case 4:
......
......@@ -93,7 +93,9 @@ public class CompletedFragment extends BaseFragment<CommonPresenter> implements
} else if (2 == dataBean.getType()) {
startActivityForResult(TravelOrderDetailsActivity.getIntent(_mActivity, dataBean.getNo()), 2);
} else if (3 == dataBean.getType()) {
startActivity(MemberOrderDetailsActivity.getIntent(_mActivity, dataBean.getNo()));
startActivityForResult(MemberOrderDetailsActivity.getIntent(_mActivity, dataBean.getNo()),3);
} else if(4 == dataBean.getType()){
startActivityForResult(PreCardOrderDetailsActivity.getIntent(_mActivity, dataBean.getNo()),4);
}
}
});
......
......@@ -49,7 +49,6 @@ import butterknife.BindView;
import io.reactivex.android.schedulers.AndroidSchedulers;
import io.reactivex.disposables.Disposable;
import io.reactivex.functions.Consumer;
import io.reactivex.schedulers.Schedulers;
/**
* Created :Auser
......@@ -115,6 +114,8 @@ public class ForPaymentFragment extends BaseFragment<CommonPresenter> implements
startActivityForResult(TravelOrderDetailsActivity.getIntent(_mActivity, dataBean.getNo()), 2);
} else if (3 == dataBean.getType()) {
startActivityForResult(MemberOrderDetailsActivity.getIntent(_mActivity, dataBean.getNo()), 3);
} else if (4 == dataBean.getType()) {
startActivityForResult(PreCardOrderDetailsActivity.getIntent(_mActivity, dataBean.getNo()), 4);
}
}
});
......@@ -125,7 +126,7 @@ public class ForPaymentFragment extends BaseFragment<CommonPresenter> implements
public void onItemChildClick(BaseQuickAdapter adapter, View view, int position) {
payPosition = position;
int id = view.getId();
if (id == R.id.tv_process || id == R.id.tv_camp_process || id == R.id.tv_member_pay) {
if (id == R.id.tv_process || id == R.id.tv_camp_process || id == R.id.tv_member_pay || id == R.id.tv_remain_time) {
payBean = (OrderListBean.DataBeanX.DataBean) adapter.getItem(position);
payShowSelect(payBean.getNo(), payBean.getRealAmount());
}
......
......@@ -7,12 +7,15 @@ import com.chad.library.adapter.base.BaseMultiItemQuickAdapter;
import com.chad.library.adapter.base.entity.MultiItemEntity;
import com.ruiwenliu.wrapper.util.BaseGlideHolder;
import com.ruiwenliu.wrapper.util.TimeManager;
import com.rv.component.utils.AppCookie;
import com.rv.component.utils.DateUtils;
import com.rv.home.R;
import com.rv.home.R2;
import com.rv.home.rv.module.ui.main.home.order.bean.OrderListBean;
import com.rv.home.rv.module.ui.main.home.order.bean.ToTravelBean;
import org.json.JSONObject;
import java.util.List;
/**
......@@ -25,12 +28,14 @@ public class CompletedAdapter extends BaseMultiItemQuickAdapter<MultiItemEntity,
public static final int TYPE_FOR_PAYMENT = 1;
public static final int TYPE_TO_TRAVEL = 2;
public static final int TYPE_TO_MEMBER = 3;
public static final int TYPE_TO_PRECARD = 4;
public CompletedAdapter(List<MultiItemEntity> data) {
super(data);
addItemType(TYPE_FOR_PAYMENT, R.layout.rv_item_order_for_payment);
addItemType(TYPE_TO_TRAVEL, R.layout.rv_item_order_to_travel);
addItemType(TYPE_TO_MEMBER, R.layout.rv_item_order_to_member);
addItemType(TYPE_TO_PRECARD, R.layout.rv_item_order_to_precard);
}
@Override
......@@ -112,6 +117,30 @@ public class CompletedAdapter extends BaseMultiItemQuickAdapter<MultiItemEntity,
// helper.setText(R.id.tv_member_pay, mContext.getString(R.string.rv_to_pay_for));
// helper.addOnClickListener(R.id.tv_member_pay);
break;
case TYPE_TO_PRECARD:
OrderListBean.DataBeanX.DataBean dataBean4 = (OrderListBean.DataBeanX.DataBean) item;
if (dataBean4 == null) {
return;
}
if (dataBean4.getOrderActiveDetail() == null) {
return;
}
helper.setText(R.id.tv_order_time, String.format("%1$s%2$s", mContext.getString(R.string.rv_order_time), dataBean4.getCrtTime()));
helper.loadRoundImage(mContext, dataBean4.getPicture(), helper.getView(R.id.iv_goods), 8);
helper.setText(R.id.tv_name, dataBean4.getOrderActiveDetail().getProductName());
helper.setText(R.id.tv_price, String.format("¥%1$s", dataBean4.getRealAmount()));
helper.addOnClickListener(R.id.tv_remain_time);
try {
JSONObject jsonObject = new JSONObject(dataBean4.getOrderActiveDetail().getProductSpecs());
helper.setText(R.id.tv_goods_specs, "面值:" + jsonObject.getString("price"));
} catch (Exception e) {
e.printStackTrace();
}
helper.setText(R.id.tv_goods_number, "数量:" + dataBean4.getOrderActiveDetail().getNumber()) ;
helper.setText(R.id.tv_order_state, mContext.getString(R.string.rv_order_completed));
break;
}
}
......
......@@ -14,6 +14,9 @@ import com.rv.component.utils.DateUtils;
import com.rv.home.R;
import com.rv.home.rv.module.ui.main.home.order.bean.OrderListBean;
import com.rv.home.rv.module.ui.main.home.order.view.MyTimerView;
import com.rv.home.rv.module.ui.main.home.order.view.PreCardTimerView;
import org.json.JSONObject;
import java.text.ParseException;
import java.text.SimpleDateFormat;
......@@ -31,12 +34,14 @@ public class ForPaymentAdapter extends BaseMultiItemQuickAdapter<MultiItemEntity
public static final int TYPE_FOR_PAYMENT = 1; //1--租车;2--旅游
public static final int TYPE_TO_TRAVEL = 2;
public static final int TYPE_TO_MEMBER = 3;
public static final int TYPE_TO_PRECARD = 4;
public ForPaymentAdapter(List<MultiItemEntity> data) {
super(data);
addItemType(TYPE_FOR_PAYMENT, R.layout.rv_item_order_for_payment);
addItemType(TYPE_TO_TRAVEL, R.layout.rv_item_order_to_travel);
addItemType(TYPE_TO_MEMBER, R.layout.rv_item_order_to_member);
addItemType(TYPE_TO_PRECARD, R.layout.rv_item_order_to_precard);
}
@Override
......@@ -117,6 +122,29 @@ public class ForPaymentAdapter extends BaseMultiItemQuickAdapter<MultiItemEntity
helper.addOnClickListener(R.id.tv_member_pay);
helper.setText(R.id.tv_order_state, mContext.getString(R.string.rv_order_for_payment));
break;
case TYPE_TO_PRECARD:
dataBean = (OrderListBean.DataBeanX.DataBean) item;
if (dataBean == null) {
return;
}
if (dataBean.getOrderActiveDetail() == null) {
return;
}
setTimes(AppCookie.getLongValue("actMember"), helper, (OrderListBean.DataBeanX.DataBean) item);
helper.setText(R.id.tv_order_time, String.format("%1$s%2$s", mContext.getString(R.string.rv_order_time), dataBean.getCrtTime()));
helper.loadRoundImage(mContext, dataBean.getPicture(), helper.getView(R.id.iv_goods), 8);
helper.setText(R.id.tv_name, dataBean.getOrderActiveDetail().getProductName());
helper.setText(R.id.tv_price, String.format("¥%1$s", dataBean.getRealAmount()));
helper.addOnClickListener(R.id.tv_remain_time);
try {
JSONObject jsonObject = new JSONObject(dataBean.getOrderActiveDetail().getProductSpecs());
helper.setText(R.id.tv_goods_specs, "面值:" + jsonObject.getString("price"));
} catch (Exception e) {
e.printStackTrace();
}
helper.setText(R.id.tv_goods_number, "数量:" + dataBean.getOrderActiveDetail().getNumber());
break;
}
}
......@@ -127,7 +155,10 @@ public class ForPaymentAdapter extends BaseMultiItemQuickAdapter<MultiItemEntity
SimpleDateFormat format = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
try {
Date date = format.parse(crtStr);
long remain = effTime - (System.currentTimeMillis() - date.getTime());
long sc = System.currentTimeMillis();
long gt = date.getTime();
long remain = effTime - (sc - gt);
if (remain <= 0) {
helper.setText(R.id.tv_order_state, mContext.getString(R.string.tv_order_cancel));
switch (bean.getType()) {
......@@ -140,10 +171,19 @@ public class ForPaymentAdapter extends BaseMultiItemQuickAdapter<MultiItemEntity
case TYPE_TO_MEMBER:
helper.itemView.findViewById(R.id.tv_member_pay).setVisibility(View.GONE);
break;
case TYPE_TO_PRECARD:
helper.itemView.findViewById(R.id.tv_remain_time).setVisibility(View.GONE);
break;
}
} else {
helper.setText(R.id.tv_order_state, mContext.getString(R.string.rv_order_for_payment));
((MyTimerView) helper.itemView.findViewById(R.id.tv_remain_time)).setTime(effTime, date.getTime(), helper, timerListener);
if (TYPE_TO_PRECARD == bean.getType()) {
((PreCardTimerView) helper.itemView.findViewById(R.id.tv_remain_time)).setTime(effTime, date.getTime(), helper, timerListener);
} else {
((MyTimerView) helper.itemView.findViewById(R.id.tv_remain_time)).setTime(effTime, date.getTime(), helper, timerListener);
}
}
} catch (ParseException e) {
e.printStackTrace();
......@@ -158,17 +198,14 @@ public class ForPaymentAdapter extends BaseMultiItemQuickAdapter<MultiItemEntity
notifyDataSetChanged();
}
public MyTimerView.TimerListener timerListener = new MyTimerView.TimerListener() {
@Override
public void onTimeFinish(RecyclerView.ViewHolder holder) {
if (holder != null) {
if (getData().size() == 1) {
getData().remove(holder.getAdapterPosition());
notifyDataSetChanged();
} else {
getData().remove(holder.getAdapterPosition());
notifyItemRemoved(holder.getAdapterPosition());
}
public MyTimerView.TimerListener timerListener = holder -> {
if (holder != null) {
if (getData().size() == 1) {
getData().remove(holder.getAdapterPosition());
notifyDataSetChanged();
} else {
getData().remove(holder.getAdapterPosition());
notifyItemRemoved(holder.getAdapterPosition());
}
}
};
......
......@@ -14,6 +14,9 @@ import com.rv.component.utils.DateUtils;
import com.rv.home.R;
import com.rv.home.rv.module.ui.main.home.order.bean.OrderListBean;
import com.rv.home.rv.module.ui.main.home.order.view.MyTimerView;
import com.rv.home.rv.module.ui.main.home.order.view.PreCardTimerView;
import org.json.JSONObject;
import java.text.ParseException;
import java.text.SimpleDateFormat;
......@@ -30,12 +33,14 @@ public class OrderListAdapter extends BaseMultiItemQuickAdapter<MultiItemEntity,
public static final int TYPE_FOR_PAYMENT = 1;
public static final int TYPE_TO_TRAVEL = 2;
public static final int TYPE_TO_MEMBER = 3;
public static final int TYPE_TO_PRECARD = 4;
public OrderListAdapter(List<MultiItemEntity> data) {
super(data);
addItemType(TYPE_FOR_PAYMENT, R.layout.rv_item_order_for_payment);
addItemType(TYPE_TO_TRAVEL, R.layout.rv_item_order_to_travel);
addItemType(TYPE_TO_MEMBER, R.layout.rv_item_order_to_member);
addItemType(TYPE_TO_PRECARD, R.layout.rv_item_order_to_precard);
}
@Override
......@@ -241,6 +246,70 @@ public class OrderListAdapter extends BaseMultiItemQuickAdapter<MultiItemEntity,
}
helper.addOnClickListener(R.id.tv_member_pay);
break;
case TYPE_TO_PRECARD:
OrderListBean.DataBeanX.DataBean dataBean4 = (OrderListBean.DataBeanX.DataBean) item;
if (dataBean4 == null) {
return;
}
if (dataBean4.getOrderActiveDetail() == null) {
return;
}
helper.setText(R.id.tv_order_time, String.format("%1$s%2$s", mContext.getString(R.string.rv_order_time), dataBean4.getCrtTime()));
helper.loadRoundImage(mContext, dataBean4.getPicture(), helper.getView(R.id.iv_goods), 8);
helper.setText(R.id.tv_name, dataBean4.getOrderActiveDetail().getProductName());
helper.setText(R.id.tv_price, String.format("¥%1$s", dataBean4.getRealAmount()));
helper.addOnClickListener(R.id.tv_remain_time);
try {
JSONObject jsonObject = new JSONObject(dataBean4.getOrderActiveDetail().getProductSpecs());
helper.setText(R.id.tv_goods_specs, "面值:" + jsonObject.getString("price"));
} catch (Exception e) {
e.printStackTrace();
}
helper.setText(R.id.tv_goods_number, "数量:" + dataBean4.getOrderActiveDetail().getNumber());
/**
*
(query)
订单状态
0–删除
1–创建订单
2–取消
3–待付款
4–待出行
5–出行中(进行中)
6–已完成
*/
switch (dataBean4.getStatusX()) {
case 0:
helper.setText(R.id.tv_order_state, "删除");
helper.setVisible(R.id.tv_remain_time, false);
break;
case 2:
helper.setText(R.id.tv_order_state, mContext.getString(R.string.tv_cancelled));
helper.setVisible(R.id.tv_remain_time, false);
break;
case 3:
helper.setText(R.id.tv_order_state, mContext.getString(R.string.rv_order_for_payment));
helper.setVisible(R.id.tv_remain_time, true);
setTimes(AppCookie.getLongValue("actMember"), helper, dataBean4);
break;
case 6:
helper.setText(R.id.tv_order_state, mContext.getString(R.string.rv_order_completed));
helper.setVisible(R.id.tv_remain_time, false);
break;
default:
break;
}
helper.addOnClickListener(R.id.tv_remain_time);
break;
}
}
......@@ -271,10 +340,18 @@ public class OrderListAdapter extends BaseMultiItemQuickAdapter<MultiItemEntity,
case TYPE_TO_MEMBER:
helper.itemView.findViewById(R.id.tv_member_pay).setVisibility(View.GONE);
break;
case TYPE_TO_PRECARD:
helper.itemView.findViewById(R.id.tv_remain_time).setVisibility(View.GONE);
break;
}
} else {
helper.setText(R.id.tv_order_state, mContext.getString(R.string.rv_order_for_payment));
((MyTimerView) helper.itemView.findViewById(R.id.tv_remain_time)).setTime(effTime, date.getTime(), helper, timerListener);
if (TYPE_TO_PRECARD == bean.getType()) {
((PreCardTimerView) helper.itemView.findViewById(R.id.tv_remain_time)).setTime(effTime, date.getTime(), helper, timerListener);
} else {
((MyTimerView) helper.itemView.findViewById(R.id.tv_remain_time)).setTime(effTime, date.getTime(), helper, timerListener);
}
}
} catch (ParseException e) {
e.printStackTrace();
......@@ -283,17 +360,14 @@ public class OrderListAdapter extends BaseMultiItemQuickAdapter<MultiItemEntity,
}
}
public MyTimerView.TimerListener timerListener = new MyTimerView.TimerListener() {
@Override
public void onTimeFinish(RecyclerView.ViewHolder holder) {
if (holder != null) {
if (getData().size() == 1) {
getData().remove(holder.getAdapterPosition());
notifyDataSetChanged();
} else {
getData().remove(holder.getAdapterPosition());
notifyItemRemoved(holder.getAdapterPosition());
}
public MyTimerView.TimerListener timerListener = holder -> {
if (holder != null) {
if (getData().size() == 1) {
getData().remove(holder.getAdapterPosition());
notifyDataSetChanged();
} else {
getData().remove(holder.getAdapterPosition());
notifyItemRemoved(holder.getAdapterPosition());
}
}
};
......
......@@ -142,6 +142,7 @@ public class OrderListBean extends BaseBean implements Serializable {
private OrderRentVehicleDetail orderRentVehicleDetail;
private OrderTourDetail orderTourDetail;
private OrderMemberDetail orderMemberDetail;
private OrderPreCardDetail orderActiveDetail ;
private int detailId;
private String name;
private String coverPic;
......@@ -252,6 +253,14 @@ public class OrderListBean extends BaseBean implements Serializable {
return icon;
}
public OrderPreCardDetail getOrderActiveDetail() {
return orderActiveDetail;
}
public void setOrderActiveDetail(OrderPreCardDetail orderActiveDetail) {
this.orderActiveDetail = orderActiveDetail;
}
public void setPicture(String picture) {
this.picture = picture;
}
......@@ -848,6 +857,99 @@ public class OrderListBean extends BaseBean implements Serializable {
}
}
public static class OrderPreCardDetail implements Serializable{
private int id ;
private String crtTime ;
private String updTime ;
private long orderId ;
private long productId;
private String productSpecs ;
private int number ;
private long specsId ;
private String productName ;
private int type;
public int getId() {
return id;
}
public void setId(int id) {
this.id = id;
}
public String getCrtTime() {
return crtTime;
}
public void setCrtTime(String crtTime) {
this.crtTime = crtTime;
}
public String getUpdTime() {
return updTime;
}
public void setUpdTime(String updTime) {
this.updTime = updTime;
}
public long getOrderId() {
return orderId;
}
public void setOrderId(long orderId) {
this.orderId = orderId;
}
public long getProductId() {
return productId;
}
public void setProductId(long productId) {
this.productId = productId;
}
public String getProductSpecs() {
return productSpecs;
}
public void setProductSpecs(String productSpecs) {
this.productSpecs = productSpecs;
}
public int getNumber() {
return number;
}
public void setNumber(int number) {
this.number = number;
}
public long getSpecsId() {
return specsId;
}
public void setSpecsId(long specsId) {
this.specsId = specsId;
}
public String getProductName() {
return productName;
}
public void setProductName(String productName) {
this.productName = productName;
}
public int getType() {
return type;
}
public void setType(int type) {
this.type = type;
}
}
public static class OrderMemberDetail implements Serializable {
private String id;//主键
......
......@@ -125,9 +125,6 @@ public class MyTimerView extends TextView {
}
}
;
private Handler handler = new Handler(Looper.getMainLooper()) {
@Override
public void handleMessage(Message msg) {
......
package com.rv.home.rv.module.ui.main.home.order.view;
import android.content.Context;
import android.os.Handler;
import android.os.Looper;
import android.os.Message;
import android.support.v7.widget.RecyclerView;
import android.util.AttributeSet;
import android.widget.TextView;
import java.util.Timer;
import java.util.TimerTask;
public class PreCardTimerView extends TextView {
private long efftiveTime;
private long crTime;
private Timer timer;
private MyTimerView.TimerListener mListener;
private RecyclerView.ViewHolder holder;
private MyTimerTask task;
public PreCardTimerView(Context context, AttributeSet attrs) {
super(context, attrs);
}
/********
* @param efftiveTime
* 失效时间
* @param crTime
* 创建时间
* @param listener
*/
public void setTime(long efftiveTime, long crTime, RecyclerView.ViewHolder holder, MyTimerView.TimerListener listener) {
if (task != null) {
task.cancel();
}
task = new MyTimerTask();
this.efftiveTime = efftiveTime;
this.crTime = crTime;
this.mListener = listener;
this.holder = holder;
showEffTime();
startTimer();
}
private void showEffTime() {
long mTime = efftiveTime - (System.currentTimeMillis() - crTime);
if (mTime > 0) {
int min = 0;
int seconds = (int) (mTime / 1000);
if (seconds > 60) {
min = seconds / 60;
seconds = seconds % 60;
if (min > 60) {
min = min % 60;
}
}
StringBuilder builder = new StringBuilder();
builder.append("立即支付(");
dealTime(false, min, builder);
dealTime(true, seconds, builder);
builder.append(")");
setText(builder.toString());
setVisibility(VISIBLE);
} else {
if (mListener != null) {
mListener.onTimeFinish(this.holder);
}
setVisibility(GONE);
if (timer != null) {
timer.cancel();
timer = null;
}
}
}
private void dealTime(boolean isSecond, int hms, StringBuilder builder) {
if (hms < 10) {
builder.append("0");
}
builder.append(hms);
if (!isSecond) {
builder.append(":");
}
}
@Override
protected void onDetachedFromWindow() {
super.onDetachedFromWindow();
if (timer != null) {
timer.cancel();
}
if (handler != null) {
handler.removeCallbacksAndMessages(null);
}
}
/*****
* 开始计时
*/
public void startTimer() {
timer = new Timer();
timer.schedule(task, 0, 1000);
}
private class MyTimerTask extends TimerTask {
@Override
public void run() {
handler.sendEmptyMessage(0);
}
}
private Handler handler = new Handler(Looper.getMainLooper()) {
@Override
public void handleMessage(Message msg) {
showEffTime();
}
};
}
......@@ -25,7 +25,16 @@ public class HomePresenter extends CommonPresenter {
}
}
if (url.startsWith("http")) {
ComponentName componentName = new ComponentName(context, "com.rv.share.WebViewActivity");
ComponentName componentName = null;
if(url.contains("type=2")){
componentName = new ComponentName(context, "com.rv.share.PreCardWebViewActivity");
}else{
componentName = new ComponentName(context, "com.rv.share.WebViewActivity");
}
Intent intent = new Intent();
intent.setComponent(componentName);
intent.putExtra("url", url);
......
<?xml version="1.0" encoding="utf-8"?>
<shape xmlns:android="http://schemas.android.com/apk/res/android"
android:shape="rectangle">
<!--空心框 圆角 少量红-->
<corners android:radius="50dp" />
<stroke
android:width="1dp"
android:color="#FFB74B" />
</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"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:orientation="vertical">
<WebView
android:id="@+id/webView"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:layout_weight="1" />
<include layout="@layout/common_line" />
<LinearLayout
android:id="@+id/ll_item_bottom"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginTop="7.5dp"
android:layout_marginBottom="7.5dp"
android:gravity="center_vertical"
android:orientation="horizontal"
android:paddingLeft="@dimen/size_15"
android:paddingRight="@dimen/size_15">
<TextView
android:id="@+id/tv_cancel_order"
android:layout_width="match_parent"
android:layout_height="44dp"
android:layout_marginRight="@dimen/size_5"
android:layout_weight="1"
android:background="@drawable/shape_rv_bg_talk_yellow_circle2"
android:gravity="center"
android:text="@string/rv_cancel_order"
android:textColor="@color/gray_FFB74B"
android:textSize="17sp"
android:visibility="gone" />
<com.rv.home.rv.module.ui.main.home.order.view.PreCardTimerView
android:id="@+id/tv_pay_immediately"
android:layout_width="match_parent"
android:layout_height="44dp"
android:layout_marginLeft="@dimen/size_5"
android:layout_weight="1"
android:background="@drawable/shape_rv_bg_dark_yellow"
android:gravity="center"
android:text="@string/rv_to_pay_for"
android:textColor="@color/white"
android:textSize="17sp"
android:visibility="gone" />
</LinearLayout>
</LinearLayout>
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="vertical">
<LinearLayout
android:layout_width="match_parent"
android:layout_height="121dp"
android:orientation="vertical"
android:paddingLeft="@dimen/dp_10"
android:paddingRight="@dimen/size_15">
<RelativeLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginTop="@dimen/dp_10">
<TextView
android:id="@+id/tv_order_time"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignParentLeft="true"
android:text="下单时间:2019-05-12 10:00"
android:textSize="@dimen/text_12" />
<TextView
android:id="@+id/tv_order_state"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignParentRight="true"
android:textColor="@color/textMain"
android:textSize="@dimen/text_12" />
</RelativeLayout>
<LinearLayout
android:layout_width="match_parent"
android:layout_height="match_parent"
android:orientation="horizontal">
<ImageView
android:layout_marginTop="8dp"
android:id="@+id/iv_goods"
android:layout_width="@dimen/size_90"
android:layout_height="@dimen/size_70"
android:scaleType="centerCrop" />
<LinearLayout
android:layout_marginTop="6dp"
android:layout_width="@dimen/size_120"
android:gravity="top"
android:layout_height="wrap_content"
android:layout_marginLeft="@dimen/size_8"
android:orientation="vertical">
<TextView
android:id="@+id/tv_name"
android:gravity="top"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:ellipsize="end"
android:maxLines="1"
android:text="超值预售卡"
android:textColor="@color/textMain"
android:textSize="@dimen/text_15" />
<TextView
android:id="@+id/tv_goods_specs"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_below="@id/tv_car_type"
android:layout_marginTop="3dp"
android:text="面值:800"
android:textColor="@color/textGray"
android:textSize="@dimen/text_12" />
<TextView
android:id="@+id/tv_goods_number"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_below="@id/tv_car_type"
android:text="数量:3"
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_weight="1"
android:textColor="@color/colorMain"
android:textSize="@dimen/text_15" />
</LinearLayout>
<LinearLayout
android:layout_width="match_parent"
android:layout_height="match_parent"
android:gravity="bottom|right">
<com.rv.home.rv.module.ui.main.home.order.view.PreCardTimerView
android:id="@+id/tv_remain_time"
android:layout_width="@dimen/size_100"
android:layout_marginTop="@dimen/dp_10"
android:layout_height="27dp"
android:gravity="center
"
android:text="xxx"
android:background="@drawable/shape_rv_bg_dark_yellow"
android:textColor="@color/white"
android:textSize="@dimen/text_12"
android:visibility="gone" />
</LinearLayout>
</LinearLayout>
</LinearLayout>
<View
android:layout_width="match_parent"
android:layout_height="@dimen/dp_10"
android:background="@color/gray_f5f5f5" />
</LinearLayout>
......@@ -8,6 +8,7 @@ import android.os.Environment;
import android.support.annotation.NonNull;
import android.text.TextUtils;
import android.view.View;
import android.widget.RelativeLayout;
import android.widget.TextView;
import android.widget.Toast;
......@@ -20,6 +21,7 @@ import com.ruiwenliu.wrapper.base.presenter.CommonPresenter;
import com.ruiwenliu.wrapper.other.TagAliasOperatorHelper;
import com.ruiwenliu.wrapper.util.AppUtils;
import com.ruiwenliu.wrapper.weight.TitleView;
import com.rv.component.utils.MachineAuthorityHelper;
import com.rv.home.rv.module.ApiConfig;
import com.rv.home.rv.module.ui.login.LoginRvActivity;
import com.rv.home.rv.module.ui.login.RegisteredActivity;
......@@ -53,6 +55,8 @@ public class SettingActivity extends BaseStatusActivity<CommonPresenter> impleme
TextView tvVersion;
@BindView(R2.id.tv_out_sign)
TextView tvOutSign;
// @BindView(R2.id.rl_item_receive_msg)
// RelativeLayout rlItemReceiveMsg;
private UpdateAppUtils updateAppUtils;
private VersionCheckBean versionCheckBean = null;
......@@ -90,6 +94,10 @@ public class SettingActivity extends BaseStatusActivity<CommonPresenter> impleme
} else {
tvVersion.setText("当前版本 V" + versionName);
}
// String machine = MachineAuthorityHelper.getMachine();
// if ("xiaomi".equals(machine) || "oppo".equals(machine) || "vivo".equals(machine)) {
// rlItemReceiveMsg.setVisibility(View.VISIBLE);
// }
}
private void initRxBus() {
......@@ -143,7 +151,8 @@ public class SettingActivity extends BaseStatusActivity<CommonPresenter> impleme
}
@OnClick({R2.id.rl_item_account_safe, R2.id.ll_item_app_push, R2.id.rl_item_clear_cache, R2.id.rl_item_check_for_updates, R2.id.rl_item_about_us, R2.id.tv_out_sign})
@OnClick({R2.id.rl_item_account_safe, R2.id.ll_item_app_push, R2.id.rl_item_clear_cache, R2.id.rl_item_check_for_updates, R2.id.rl_item_about_us, R2.id.tv_out_sign,
R2.id.rl_item_receive_msg})
public void onViewClicked(View view) {
int id = view.getId();
......@@ -217,6 +226,8 @@ public class SettingActivity extends BaseStatusActivity<CommonPresenter> impleme
setResult(201);
showToast("退出成功!");
finish();
} else if (id == R.id.rl_item_receive_msg) {
// MachineAuthorityHelper.checkMachineAuthority(SettingActivity.this, true);
}
}
......
......@@ -148,6 +148,32 @@
android:src="@drawable/common_icon_rig_black_gray" />
</RelativeLayout>
<include layout="@layout/common_line" />
<RelativeLayout
android:visibility="gone"
android:id="@+id/rl_item_receive_msg"
android:layout_width="match_parent"
android:layout_height="@dimen/size_50">
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_centerVertical="true"
android:text="后台接收消息"
android:textColor="@color/colorMain"
android:textSize="@dimen/text_16" />
<ImageView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignParentRight="true"
android:layout_centerVertical="true"
android:src="@drawable/common_icon_rig_black_gray" />
</RelativeLayout>
</LinearLayout>
<TextView
......
......@@ -37,6 +37,7 @@ import com.rv.im.xmpp.listener.ChatMessageListener;
import java.util.ArrayList;
import java.util.Collections;
import java.util.HashMap;
import java.util.LinkedList;
import java.util.List;
import java.util.Map;
import java.util.Timer;
......@@ -45,7 +46,7 @@ public class CustomerListActivity extends BaseStatusActivity<CommonPresenter> im
private SimpleRefreshLayout refreshLayout;
private RecyclerView recyclerView;
private List<Customer> customers = new ArrayList<>();
private LinkedList<Customer> customers = new LinkedList<>();
private CustomerListAdapter adapter = null;
private Timer timer;
private RvImTimerTask timerTask;
......
......@@ -3,7 +3,6 @@
package="com.rv.share">
<application>
<activity
android:name=".ShareActivity"
android:screenOrientation="portrait" />
......@@ -28,6 +27,7 @@
<activity
android:name=".PopularizeActivity"
android:screenOrientation="portrait" />
<activity android:name=".PreCardWebViewActivity" />
</application>
</manifest>
\ No newline at end of file
......@@ -15,7 +15,6 @@ import com.base.utils.tools.android.NetworkUtil;
import com.frame.base.bus.LoginSuccessfulEvent;
import com.frame.base.bus.Observer;
import com.frame.base.bus.RxBus;
import com.frame.rv.config.RvFrameConfig;
import com.ruiwenliu.wrapper.base.BaseBean;
import com.ruiwenliu.wrapper.base.BaseStatusActivity;
import com.ruiwenliu.wrapper.weight.TitleView;
......
package com.rv.share.adapter;
import android.graphics.Color;
import android.support.annotation.Nullable;
import com.chad.library.adapter.base.BaseQuickAdapter;
import com.chad.library.adapter.base.BaseViewHolder;
import com.rv.share.R;
import com.rv.share.bean.AllGoodsListBean;
import org.json.JSONException;
import org.json.JSONObject;
import java.util.List;
import java.util.Set;
public class AllGoodsListAdapter extends BaseQuickAdapter<AllGoodsListBean.DetailList, BaseViewHolder> {
private int lastSelelcted;
private int selected;
public AllGoodsListAdapter(@Nullable List<AllGoodsListBean.DetailList> data) {
super(R.layout.goods_item, data);
for (int i = 0; i < data.size(); i++) {
if (data.get(i).stock > 0) {
lastSelelcted = selected = 0;
break;
}
}
}
public int getSelected() {
return selected;
}
public void setSelected(int position) {
lastSelelcted = selected;
selected = position;
notifyItemChanged(lastSelelcted);
notifyItemChanged(selected);
}
@Override
protected void convert(BaseViewHolder helper, AllGoodsListBean.DetailList item) {
if (getData().indexOf(item) == selected) {
helper.setBackgroundRes(R.id.ll_content, R.drawable.shaper_bg_good_item_select);
helper.setTextColor(R.id.tv_price, Color.parseColor("#FFB74B"));
helper.setTextColor(R.id.tv_real_price, Color.parseColor("#FFB74B"));
} else {
helper.setBackgroundRes(R.id.ll_content, R.drawable.shaper_bg_good_item_unselect);
helper.setTextColor(R.id.tv_price, Color.parseColor("#666666"));
helper.setTextColor(R.id.tv_real_price, Color.parseColor("#666666"));
}
helper.setText(R.id.tv_real_price, "实付" + item.goodsPrice);
try {
JSONObject object = new JSONObject(item.goodsSpecs);
helper.setText(R.id.tv_price, "¥ " + object.getDouble("price"));
} catch (JSONException e) {
e.printStackTrace();
}
}
}
package com.rv.share.bean;
import com.ruiwenliu.wrapper.base.BaseBean;
import java.io.Serializable;
import java.math.BigDecimal;
import java.util.List;
public class AllGoodsListBean extends BaseBean {
private List<GoodsItem> data;
private boolean rel;
public void setData(List<GoodsItem> data) {
this.data = data;
}
public List<GoodsItem> getData() {
return data;
}
public boolean isRel() {
return rel;
}
public void setRel(boolean rel) {
this.rel = rel;
}
public static class GoodsItem {
public int id;
public long crtTime;
public long updTime;
public String name;
public long startTime;
public long endTime;
public int numLimit;
public int hasJoinNum;
public boolean status;
public boolean sort;
public String picture;
public boolean type;
public boolean timeType;
public boolean isDel;
public int sales;
public int stock;
public String detail;
public String explainInfo;
public List<DetailList> list;
}
public static class DetailList implements Serializable {
public String name;
public int id;
public int goodsId;
public String code;
public String specsImg;
public int specsSeq;
public BigDecimal goodsPrice;
public BigDecimal specsCostPrice;
public int crtUser;
public long crtTime;
public int updUser;
public long updTime;
public boolean isDel;
public int sales;
public int stock;
public String goodsSpecs;
}
}
package com.rv.share.bean;
import com.ruiwenliu.wrapper.base.BaseBean;
/**
* 支付宝订单支付
*/
public class BeanTourOrderAliPay extends BaseBean{
private String data;
public String getData() {
return data;
}
public void setData(String data) {
this.data = data;
}
}
package com.rv.share.bean;
import com.google.gson.annotations.SerializedName;
import com.ruiwenliu.wrapper.base.BaseBean;
/**
* Created :Auser
* Date: 2019/6/1.
* Desc:订单支付
*/
public class BeanTourOrderPay extends BaseBean{
/**
* data : {"package":"Sign=WXPay","appid":"wx9c9d978e5698d00f","sign":"180F1140BB832B9AFD2F3A004009C675","partnerid":"1514583081","prepayid":"wx291947357815824dbfc896009915601400","noncestr":"78bf2cc2743032339a08797b0776c78e","timestamp":"1559130404"}
*/
private DataBean data;
public DataBean getData() {
return data;
}
public void setData(DataBean data) {
this.data = data;
}
public class DataBean {
/**
* package : Sign=WXPay
* appid : wx9c9d978e5698d00f
* sign : 180F1140BB832B9AFD2F3A004009C675
* partnerid : 1514583081
* prepayid : wx291947357815824dbfc896009915601400
* noncestr : 78bf2cc2743032339a08797b0776c78e
* timestamp : 1559130404
*/
@SerializedName("package")
private String packageX;
private String appid;
private String sign;
private String partnerid;
private String prepayid;
private String noncestr;
private String timestamp;
public String getPackageX() {
return packageX;
}
public void setPackageX(String packageX) {
this.packageX = packageX;
}
public String getAppid() {
return appid;
}
public void setAppid(String appid) {
this.appid = appid;
}
public String getSign() {
return sign;
}
public void setSign(String sign) {
this.sign = sign;
}
public String getPartnerid() {
return partnerid;
}
public void setPartnerid(String partnerid) {
this.partnerid = partnerid;
}
public String getPrepayid() {
return prepayid;
}
public void setPrepayid(String prepayid) {
this.prepayid = prepayid;
}
public String getNoncestr() {
return noncestr;
}
public void setNoncestr(String noncestr) {
this.noncestr = noncestr;
}
public String getTimestamp() {
return timestamp;
}
public void setTimestamp(String timestamp) {
this.timestamp = timestamp;
}
}
}
package com.rv.share.bean;
import com.ruiwenliu.wrapper.base.BaseBean;
import java.io.Serializable;
import java.math.BigDecimal;
public class OrderGoodsBean extends BaseBean {
private OrderGoodsData data ;
public OrderGoodsData getData() {
return data;
}
public void setData(OrderGoodsData data) {
this.data = data;
}
private boolean rel ;
public boolean isRel() {
return rel;
}
public void setRel(boolean rel) {
this.rel = rel;
}
public static class OrderGoodsData implements Serializable {
public int id ;
public String no ;
public String name;
public int type ;
public int status;
public BigDecimal goodsAmount;
public BigDecimal orderAmount;
public BigDecimal realAmount;
public String picture ;
public String crtTime ;
public long userId;
public String updTime;
public String crtHost;
public int refundStatus ;
public int hasDiscount ;
public int hasMemberRight ;
public int hasPay ;
public int version;
public int orderOrigin;
public int payOrigin;
public BigDecimal couponAmount;
public int memberLevel;
public BigDecimal damagesAmount;
public BigDecimal extraAmount;
public long parentUserId;
public long invoiceStatus;
public BigDecimal violateAmount;
}
}
package com.rv.share.bean;
public class PayBodyBean {
private String orderNo;
private int payWay;
private int type;
public PayBodyBean(String orderNo, int payWay, int type) {
this.orderNo = orderNo;
this.payWay = payWay;
this.type = type;
}
public String getOrderNo() {
return orderNo;
}
public void setOrderNo(String orderNo) {
this.orderNo = orderNo;
}
public int getPayWay() {
return payWay;
}
public void setPayWay(int payWay) {
this.payWay = payWay;
}
public int getType() {
return type;
}
public void setType(int type) {
this.type = type;
}
}
package com.rv.share.presenter;
import android.annotation.SuppressLint;
import android.app.Activity;
import android.content.Context;
import android.os.Handler;
import android.os.Message;
import android.text.TextUtils;
import android.util.Log;
import android.widget.Toast;
import com.alipay.sdk.app.PayTask;
import com.frame.base.bus.PaymentFailedEvent;
import com.frame.base.bus.PaymentSuccessfulEvent;
import com.frame.base.bus.RxBus;
import com.frame.rv.config.RvFrameConfig;
import com.frame.rv.widget.PayResult;
import com.ruiwenliu.wrapper.weight.ToastView;
import com.rv.home.rv.module.ApiConfig;
import com.rv.share.bean.AllGoodsListBean;
import com.rv.share.bean.BeanTourOrderAliPay;
import com.rv.share.bean.BeanTourOrderPay;
import com.rv.share.bean.OrderGoodsBean;
import com.rv.share.bean.PayBodyBean;
import com.rv.share.view.ShareChoiceDialog;
import com.tencent.mm.opensdk.modelpay.PayReq;
import com.tencent.mm.opensdk.openapi.IWXAPI;
import com.tencent.mm.opensdk.openapi.WXAPIFactory;
import com.yuyife.okgo.OkGoUtil;
import java.util.HashMap;
import java.util.LinkedHashMap;
import java.util.Map;
public class PreCardWebviewPresenter extends WebViewPresenter {
public void showShareDialog(String url, String iconUrl, String title, String circleTitle, String descript, String imgUrl) {
this.mUrl = url;
this.iconUrl = iconUrl;
this.mCircleTitle = circleTitle;
this.mTitle = title;
this.mDescript = descript;
this.imgUrl = imgUrl;
if (dialog == null) {
dialog = new ShareChoiceDialog.Builder(getPresenterContext())
.setShareListener(myListener)
.setCopyVisiable(true)
.setWxVisiable(true)
.setWxCVisiable(true)
.setQQVisiable(true)
.setBillVisiable(false)
.create();
}
dialog.show();
}
private static final int SDK_ALI_PAY_FLAG = 11;
private Context context;
/******
* 创建订单
* @param title
* @param detailList
* @param number
*/
public void createOrder(String title,AllGoodsListBean.DetailList detailList,int number) {
if (detailList != null) {
OrderBody orderBody = new OrderBody();
orderBody.name = title;
orderBody.picture = detailList.specsImg;
orderBody.productId = detailList.goodsId;
orderBody.specsId = detailList.id;
orderBody.productSpecs = detailList.goodsSpecs;
orderBody.productName = detailList.name;
orderBody.number = number;
Map<String, String> header = new HashMap<>(2);
header.put("Authorization", OkGoUtil.getToken());
postBodyData(1, ApiConfig.HTTP_URL_ACTIVITY_ADD, OrderGoodsBean.class, orderBody, header, true);
}
}
class OrderBody {
public String name;
public String picture;
public int type = 1;
public long productId;
public long specsId;
public String productSpecs;
public String productName;
public int number;
}
/**
* 订单支付
*/
public void orderPay(String orderNo, int payWay, int type) {
Map<String, Object> headMap = new LinkedHashMap<>();
if (OkGoUtil.getToken() != null)
headMap.put("Authorization", OkGoUtil.getToken());
if (payWay == 1) {
postBodyData(RvFrameConfig.VEHICLE_ORDER, 3, ApiConfig.COMMIT_ORDER_PAY, BeanTourOrderPay.class, new PayBodyBean(orderNo, payWay, type), headMap, true);
} else {
postBodyData(RvFrameConfig.VEHICLE_ORDER, 4, ApiConfig.COMMIT_ORDER_PAY, BeanTourOrderAliPay.class, new PayBodyBean(orderNo, payWay, type), headMap, true);
}
}
public void pay(Context context, BeanTourOrderPay data) {
try {
IWXAPI api = WXAPIFactory.createWXAPI(context, RvFrameConfig.APP_ID);
PayReq req = new PayReq();
req.appId = data.getData().getAppid();
req.partnerId = data.getData().getPartnerid();
req.prepayId = data.getData().getPrepayid();
req.nonceStr = data.getData().getNoncestr();
req.timeStamp = data.getData().getTimestamp();
req.packageValue = data.getData().getPackageX();
req.sign = data.getData().getSign();
req.extData = "app data"; // optional
api.sendReq(req);
} catch (Exception e) {
ToastView.getInstance(context).showToastContent("异常", Toast.LENGTH_SHORT);
}
}
public void aliPay(final Activity activity, final BeanTourOrderAliPay bean) {
context = activity;
Runnable payRunnable = new Runnable() {
@Override
public void run() {
PayTask alipay = new PayTask(activity);
Map<String, String> result = alipay.payV2(bean.getData(), true);
Log.i("msp", result.toString());
Message msg = new Message();
msg.what = SDK_ALI_PAY_FLAG;
msg.obj = result;
mHandler.sendMessage(msg);
}
};
Thread payThread = new Thread(payRunnable);
payThread.start();
}
/**
* 支付宝返回数据handler
*/
@SuppressLint("HandlerLeak")
private Handler mHandler = new Handler() {
public void handleMessage(Message msg) {
switch (msg.what) {
case SDK_ALI_PAY_FLAG: {
@SuppressWarnings("unchecked")
PayResult payResult = new PayResult((Map<String, String>) msg.obj);
String resultStatus = payResult.getResultStatus();
// 判断resultStatus 为9000则代表支付成功
if (TextUtils.equals(resultStatus, "9000")) {
ToastView.getInstance(context).showToastContent("支付成功!", Toast.LENGTH_SHORT);
RxBus.post(new PaymentSuccessfulEvent());
} else if ("6001".equals(resultStatus)) {
ToastView.getInstance(context).showToastContent("支付取消!", Toast.LENGTH_SHORT);
RxBus.post(new PaymentFailedEvent());
} else {
// 该笔订单真实的支付结果,需要依赖服务端的异步通知。
// showToast(payResult.toString());
}
break;
}
}
}
};
}
......@@ -23,15 +23,15 @@ import com.umeng.socialize.media.UMImage;
import com.umeng.socialize.media.UMWeb;
public class WebViewPresenter extends CommonPresenter {
private ShareChoiceDialog dialog = null;
private ShareAction shareAction = null;
private String mUrl = null;
private String mTitle = null;
private String mDescript = null;
private String iconUrl;
private String imgUrl;
private String mCircleTitle;
private RvWebView webView;
protected ShareChoiceDialog dialog = null;
protected ShareAction shareAction = null;
protected String mUrl = null;
protected String mTitle = null;
protected String mDescript = null;
protected String iconUrl;
protected String imgUrl;
protected String mCircleTitle;
protected RvWebView webView;
public void setWebView(RvWebView webView) {
this.webView = webView;
......@@ -73,7 +73,7 @@ public class WebViewPresenter extends CommonPresenter {
UMWeb web = new UMWeb(mUrl);
web.setTitle(mTitle);//标题
web.setThumb(image); //缩略图
web.setDescription(mDescript);//描述
web.setDescription(!TextUtils.isEmpty(mDescript)?mDescript:mCircleTitle);//描述
shareAction.setPlatform(SHARE_MEDIA.WEIXIN)//传入平台
.withMedia(web);
......@@ -134,7 +134,7 @@ public class WebViewPresenter extends CommonPresenter {
UMWeb web = new UMWeb(mUrl);
web.setTitle(mTitle);//标题
web.setThumb(image); //缩略图
web.setDescription(mDescript);//描述
web.setDescription(!TextUtils.isEmpty(mDescript)?mDescript:mCircleTitle);//描述
shareAction.setPlatform(SHARE_MEDIA.QQ)//传入平台
.withMedia(web);
......@@ -180,7 +180,7 @@ public class WebViewPresenter extends CommonPresenter {
}
};
private ShareChoiceDialog.ShareListener myListener = new ShareChoiceDialog.ShareListener() {
protected ShareChoiceDialog.ShareListener myListener = new ShareChoiceDialog.ShareListener() {
@Override
public void copyShare() {
if (!TextUtils.isEmpty(mUrl)) {
......
package com.rv.share.view;
import android.content.Context;
import android.support.annotation.NonNull;
import android.support.v7.widget.GridLayoutManager;
import android.support.v7.widget.LinearLayoutManager;
import android.support.v7.widget.RecyclerView;
import android.view.Gravity;
import android.view.View;
import android.view.ViewGroup;
import android.widget.Button;
import android.widget.ImageView;
import android.widget.LinearLayout;
import android.widget.TextView;
import android.widget.Toast;
import com.chad.library.adapter.base.BaseQuickAdapter;
import com.ruiwenliu.wrapper.dialog.BaseDialog;
import com.ruiwenliu.wrapper.weight.ToastView;
import com.rv.share.R;
import com.rv.share.adapter.AllGoodsListAdapter;
import com.rv.share.bean.AllGoodsListBean;
import java.util.LinkedList;
public class AllPreCardDialog extends BaseDialog {
private RecyclerView recyclerview;
private TextView tv_add, tv_number;
private LinearLayout ll_subtract;
private Button btn_pay;
private ImageView img_close;
private int count = 1;
private AllGoodsListAdapter listAdapter;
private LinkedList<AllGoodsListBean.DetailList> datas = new LinkedList<>();
private PayListener listener;
public AllPreCardDialog(@NonNull Context context, AllGoodsListBean bean, PayListener listener) {
super(context);
setDialogParams(ViewGroup.LayoutParams.MATCH_PARENT, ViewGroup.LayoutParams.WRAP_CONTENT, Gravity.BOTTOM);
this.listener = listener;
initData(bean);
initView();
}
private void initData(AllGoodsListBean bean) {
datas.clear();
if (bean != null && bean.getData() != null && bean.getData().size() > 0) {
for (AllGoodsListBean.GoodsItem item : bean.getData()) {
String name = item.name;
if (item.list != null && item.list.size() > 0) {
for (AllGoodsListBean.DetailList detailList : item.list) {
detailList.name = name;
datas.add(detailList);
}
}
}
}
}
private void initView() {
recyclerview = findViewById(R.id.recyclerview);
ll_subtract = findViewById(R.id.ll_subtract);
tv_add = findViewById(R.id.tv_add);
tv_number = findViewById(R.id.tv_number);
btn_pay = findViewById(R.id.btn_pay);
img_close = findViewById(R.id.img_close);
listAdapter = new AllGoodsListAdapter(datas);
recyclerview.setLayoutManager(new GridLayoutManager(getContext(), 3));
recyclerview.setNestedScrollingEnabled(false);
recyclerview.setAdapter(listAdapter);
ll_subtract.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
if (count == 1) {
Toast.makeText(getContext(),"数量已为1",Toast.LENGTH_SHORT).show();
// ToastView.getInstance(getContext()).showToastContent("数量已为1");
return;
}
count -= 1;
tv_number.setText(String.valueOf(count));
}
});
listAdapter.setOnItemClickListener(new BaseQuickAdapter.OnItemClickListener() {
@Override
public void onItemClick(BaseQuickAdapter adapter, View view, int p) {
AllGoodsListBean.DetailList item = (AllGoodsListBean.DetailList) adapter.getItem(p);
if (item.stock <= 0) {
Toast.makeText(getContext(),"该预售卡已售罄!",Toast.LENGTH_SHORT).show();
// ToastView.getInstance(getContext()).showToastContent("该预售卡已售罄!");
return;
}
listAdapter.setSelected(p);
}
});
tv_add.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
AllGoodsListBean.DetailList item = listAdapter.getItem(listAdapter.getSelected());
if (item.stock <= count) {
// ToastView.getInstance(getContext()).showToastContent("库存不足!");
Toast.makeText(getContext(),"库存不足",Toast.LENGTH_SHORT).show();
return;
}
count += 1;
tv_number.setText(String.valueOf(count));
}
});
btn_pay.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
listener.pay(listAdapter.getItem(listAdapter.getSelected()), count);
dismiss();
}
});
img_close.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
dismiss();
}
});
setCancelable(false);
}
@Override
public int getViewLayout() {
return R.layout.dialog_all_pre_card;
}
public interface PayListener {
void pay(AllGoodsListBean.DetailList detailList, int number);
}
}
......@@ -213,6 +213,19 @@ public class RvWebView extends WebView {
}
}
/*****
*
* @param url
* @param iconUrl
* 分享出去时的icon
* @param title
* 标题
* @param titleCircle
* 分享到朋友圈时的标题
* @param desc
* 描述
* @param imgUrl
*/
@JavascriptInterface
public void showShareIcon(String url, String iconUrl, String title, String titleCircle, String desc, String imgUrl) {
if (listener != null) {
......
<?xml version="1.0" encoding="utf-8"?>
<shape xmlns:android="http://schemas.android.com/apk/res/android">
<corners android:radius="5dp"
/>
<stroke android:color="#cccccc" android:width="0.5dp" />
<solid android:color="@color/white" />
</shape>
\ No newline at end of file
<?xml version="1.0" encoding="utf-8"?>
<shape xmlns:android="http://schemas.android.com/apk/res/android"
android:shape="rectangle">
<solid android:color="#ffeeeeee" />
<corners android:topLeftRadius="40dp" android:topRightRadius="40dp" android:bottomLeftRadius="40dp" android:bottomRightRadius="40dp" />
</shape>
\ No newline at end of file
<?xml version="1.0" encoding="utf-8"?>
<selector xmlns:android="http://schemas.android.com/apk/res/android">
<item android:state_selected="true" android:drawable="@drawable/shaper_bg_good_item_select" />
<item android:state_selected="false" android:drawable="@drawable/shaper_bg_good_item_select" />
</selector>
\ No newline at end of file
<?xml version="1.0" encoding="utf-8"?>
<shape xmlns:android="http://schemas.android.com/apk/res/android"
android:shape="rectangle">
<solid android:color="@color/gray_EEEEEE" />
<corners android:radius="@dimen/dp_4" />
</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"
android:background="@color/white"
android:orientation="vertical"
tools:context=".OrderConfirmActivity">
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginLeft="@dimen/size_15"
android:layout_marginTop="14.5dp"
android:layout_marginRight="@dimen/size_15"
android:orientation="horizontal">
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="订单编号:"
android:textColor="@color/colorMain"
android:textSize="13sp"
android:textStyle="bold" />
<TextView
android:id="@+id/tv_no"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginLeft="6dp"
android:textColor="@color/textGray"
android:textSize="13sp" />
<TextView
android:layout_marginLeft="7dp"
android:id="@+id/tv_copy"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:background="@drawable/shaper_bg_copy_icon"
android:paddingLeft="@dimen/size_5"
android:paddingTop="@dimen/size_2"
android:paddingRight="5dp"
android:paddingBottom="@dimen/size_2"
android:text="复制"
android:textColor="@color/textGray"
android:textSize="11sp" />
<TextView
android:id="@+id/tv_contact_customer"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:gravity="right"
android:text="联系客服"
android:textColor="@color/colorMain"
android:textSize="13sp" />
</LinearLayout>
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginLeft="@dimen/size_15"
android:layout_marginTop="5dp"
android:layout_marginRight="@dimen/size_15"
android:orientation="horizontal">
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="创建时间:"
android:textColor="@color/colorMain"
android:textSize="13sp"
android:textStyle="bold" />
<TextView
android:id="@+id/tv_time"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginLeft="6dp"
android:textColor="@color/textGray"
android:textSize="13sp" />
</LinearLayout>
<View
android:layout_width="match_parent"
android:layout_height="0.5dp"
android:layout_marginTop="@dimen/size_15"
android:background="@color/gray_EEEEEE" />
<LinearLayout
android:layout_width="match_parent"
android:layout_height="96.5dp"
android:layout_marginLeft="@dimen/size_15"
android:layout_marginRight="@dimen/size_15"
android:gravity="center_vertical"
android:orientation="horizontal">
<ImageView
android:id="@+id/img_icon"
android:layout_width="@dimen/size_90"
android:layout_height="@dimen/size_70"
android:scaleType="centerCrop" />
<LinearLayout
android:layout_width="wrap_content"
android:layout_height="match_parent"
android:layout_marginLeft="8dp"
android:layout_marginTop="@dimen/sp_14"
android:layout_marginBottom="@dimen/sp_14"
android:orientation="vertical">
<TextView
android:id="@+id/tv_name"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="超值预售卡"
android:textColor="@color/text_Main"
android:textSize="17sp"
android:textStyle="bold" />
<TextView
android:id="@+id/tv_value"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginTop="4.5dp"
android:text="面值800元"
android:textColor="@color/textGray"
android:textSize="12sp" />
<TextView
android:id="@+id/tv_number"
android:layout_width="wrap_content"
android:layout_height="match_parent"
android:layout_marginTop="4.5dp"
android:gravity="bottom"
android:text="x3"
android:textColor="@color/textGray"
android:textSize="12sp" />
</LinearLayout>
<TextView
android:id="@+id/tv_price"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:layout_marginTop="@dimen/sp_14"
android:layout_marginBottom="@dimen/sp_14"
android:gravity="right|bottom"
android:text="¥1500"
android:textColor="@color/colorMain"
android:textSize="15sp" />
</LinearLayout>
<View
android:layout_width="match_parent"
android:layout_height="15dp"
android:background="@color/gray_f5f5f5" />
<View
android:layout_width="match_parent"
android:layout_height="0dp"
android:layout_weight="1"
android:background="@color/white" />
<LinearLayout
android:layout_width="match_parent"
android:layout_height="49dp"
android:orientation="horizontal">
<LinearLayout
android:layout_width="0dp"
android:layout_height="match_parent"
android:layout_weight="14"
android:background="@color/white"
android:gravity="center_vertical">
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginLeft="@dimen/size_15"
android:text="待支付:"
android:textColor="@color/colorMain"
android:textSize="17sp" />
<TextView
android:id="@+id/tv_price_total"
android:textStyle="bold"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="¥1500"
android:textColor="#F57474"
android:textSize="17sp" />
</LinearLayout>
<TextView
android:id="@+id/tv_buy"
android:layout_width="0dp"
android:layout_height="match_parent"
android:layout_weight="11"
android:background="@color/gray_FFB74B"
android:gravity="center"
android:text="立即购买"
android:textColor="@color/white"
android:textSize="17sp"
android:textStyle="bold" />
</LinearLayout>
</LinearLayout>
\ No newline at end of file
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:orientation="vertical"
tools:context=".WebViewActivity">
<RelativeLayout
android:layout_width="match_parent"
android:layout_height="@dimen/size_55"
android:background="@color/colorWrite">
<ImageView
android:id="@+id/img_left"
android:layout_width="@dimen/size_32"
android:layout_height="@dimen/size_32"
android:layout_centerVertical="true"
android:layout_marginLeft="@dimen/size_5"
android:padding="@dimen/size_8"
android:src="@drawable/rv_common_icon_back_dark" />
<TextView
android:id="@+id/tv_left"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_centerVertical="true"
android:gravity="center"
android:padding="@dimen/size_10"
android:textColor="@color/textMain"
android:textSize="@dimen/text_16"
android:visibility="gone" />
<TextView
android:id="@+id/tv_center"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_centerInParent="true"
android:ellipsize="end"
android:gravity="center"
android:maxWidth="320dp"
android:maxLines="1"
android:textColor="@color/textMain"
android:textSize="@dimen/text_18" />
<LinearLayout
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignParentRight="true"
android:layout_centerVertical="true"
android:gravity="center_vertical"
android:orientation="horizontal">
<TextView
android:id="@+id/tv_right"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginRight="15dp"
android:paddingLeft="@dimen/size_8"
android:paddingTop="@dimen/size_5"
android:paddingRight="@dimen/size_8"
android:paddingBottom="@dimen/size_5"
android:textColor="@color/textMain"
android:textSize="@dimen/text_16"
android:visibility="gone" />
<ImageView
android:id="@+id/img_right"
android:layout_width="@dimen/size_32"
android:layout_height="@dimen/size_32"
android:layout_centerVertical="true"
android:layout_marginRight="@dimen/size_5"
android:padding="@dimen/size_8"
android:src="@drawable/tourism_rv_rentingcar_icon_share"
android:visibility="gone" />
</LinearLayout>
</RelativeLayout>
<LinearLayout
android:id="@+id/ll_content"
android:layout_width="match_parent"
android:layout_height="0dp"
android:layout_weight="1"
android:orientation="vertical" />
<LinearLayout
android:layout_width="match_parent"
android:layout_height="@dimen/size_50"
android:orientation="horizontal">
<LinearLayout
android:id="@+id/ll_contact"
android:layout_width="0dp"
android:layout_height="match_parent"
android:layout_weight="1"
android:background="@color/colorWrite"
android:gravity="center"
android:orientation="horizontal">
<ImageView
android:layout_width="@dimen/size_25"
android:layout_height="@dimen/size_25"
android:src="@drawable/common_journey_service_gray" />
<TextView
android:layout_marginLeft="@dimen/size_8"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:gravity="center"
android:text="联系客服"
android:textColor="@color/textGray"
android:textSize="@dimen/sp_16" />
</LinearLayout>
<TextView
android:id="@+id/tv_buy"
android:layout_width="0dp"
android:layout_height="match_parent"
android:layout_weight="1"
android:background="#FFBC56"
android:gravity="center"
android:text="立即购买"
android:textColor="@color/colorWrite"
android:textSize="@dimen/sp_16" />
</LinearLayout>
</LinearLayout>
\ No newline at end of file
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:background="@color/colorWrite"
android:orientation="vertical">
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginLeft="@dimen/size_15"
android:layout_marginTop="14dp"
android:layout_marginRight="@dimen/size_15"
android:orientation="horizontal">
<TextView
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_weight="1"
android:text="超值优惠券类型"
android:textColor="@color/colorMain"
android:textSize="17sp"
/>
<ImageView
android:id="@+id/img_close"
android:layout_width="@dimen/size_20"
android:layout_height="@dimen/size_20"
android:src="@drawable/ic_pay_close" />
</LinearLayout>
<android.support.v7.widget.RecyclerView
android:id="@+id/recyclerview"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginLeft="@dimen/dp_10"
android:layout_marginTop="28.5dp"
android:layout_marginRight="@dimen/dp_10" />
<View
android:layout_width="match_parent"
android:layout_height="0.5dp"
android:layout_marginTop="12.5dp"
android:background="@color/gray_EEEEEE" />
<RelativeLayout
android:layout_width="match_parent"
android:layout_height="54dp"
android:layout_marginLeft="@dimen/size_15"
android:layout_marginRight="@dimen/size_15">
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignParentLeft="true"
android:layout_centerVertical="true"
android:gravity="center"
android:text="数量"
android:textColor="@color/textGray"
android:textSize="@dimen/text_15" />
<LinearLayout
android:layout_width="wrap_content"
android:layout_height="22.5dp"
android:layout_alignParentRight="true"
android:layout_centerVertical="true"
android:background="@drawable/shape_rv_white_gray_line_bg"
android:gravity="center_vertical"
android:orientation="horizontal">
<LinearLayout
android:id="@+id/ll_subtract"
android:layout_width="wrap_content"
android:layout_height="match_parent"
android:gravity="center"
android:padding="6dp">
<View
android:layout_width="11dp"
android:layout_height="1dp"
android:background="@color/textGray"
android:padding="@dimen/dp_10" />
</LinearLayout>
<View
android:layout_width="0.5dp"
android:layout_height="match_parent"
android:background="@color/colorGray" />
<TextView
android:id="@+id/tv_number"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:paddingLeft="@dimen/size_10"
android:paddingRight="@dimen/dp_10"
android:text="1"
android:textColor="@color/colorMain"
android:textSize="@dimen/sp_14"
android:textStyle="bold" />
<View
android:layout_width="0.5dp"
android:layout_height="match_parent"
android:background="@color/colorGray" />
<TextView
android:id="@+id/tv_add"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:paddingLeft="6dp"
android:paddingRight="6dp"
android:text="十"
android:textColor="@color/gray_FBB336"
android:textSize="11sp" />
</LinearLayout>
</RelativeLayout>
<View
android:layout_width="match_parent"
android:layout_height="0.5dp"
android:layout_marginTop="12.5dp"
android:background="@color/gray_EEEEEE" />
<Button
android:layout_marginTop="@dimen/size_8"
android:layout_marginBottom="@dimen/size_8"
android:layout_marginLeft="@dimen/size_15"
android:layout_marginRight="@dimen/size_15"
android:id="@+id/btn_pay"
android:layout_width="match_parent"
android:layout_height="44dp"
android:background="@drawable/shape_rv_bg_shallow_dark_yellow_circle"
android:text="立即支付"
android:textColor="@color/colorWrite"
android:textSize="17sp" />
</LinearLayout>
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent"
android:id="@+id/ll_content"
android:background="@drawable/shaper_bg_good_item"
android:layout_marginLeft="@dimen/size_5"
android:layout_marginRight="@dimen/size_5"
android:layout_marginBottom="@dimen/dp_10"
android:orientation="vertical"
android:layout_height="@dimen/size_60"
android:gravity="center">
<TextView
android:id="@+id/tv_price"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:textColor="#FFB74B"
android:textSize="13sp" />
<TextView
android:layout_marginTop="@dimen/size_1"
android:id="@+id/tv_real_price"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:textColor="#FFB74B"
android:textSize="@dimen/text_10" />
</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