收货地址管理

This commit is contained in:
itgaojian163 2022-12-26 17:56:22 +08:00
parent a10de2e4b2
commit c471f447ea
68 changed files with 3158 additions and 1665 deletions

View File

@ -0,0 +1,5 @@
<component name="ProjectCodeStyleConfiguration">
<state>
<option name="PREFERRED_PROJECT_CODE_STYLE" value="Default" />
</state>
</component>

View File

@ -91,17 +91,15 @@ ext {
gXRecyclerViewVersion = '1.5.9'
//rxview
gRxjavaBindingVersion = '2.1.1'
gPickerViewVersion = '4.1.6'
wheelVersion = '4.1.0'
gBoomMenu = '2.1.1'
gFilePicker = '1.8.0'
pickerViewVersion = '4.1.9'
gPickerViewVersion = '4.1.9'
//bottomNavBar
supportBottomNavBar = '2.0.5'
eventButsVersion = '3.1.1'
bannerVersion = '2.0.8'
plugVersion = '27.1.1'
pickerViewVersion = '4.1.6'
xRecyclerViewVersion = '1.5.9'
lfilepickerlibraryVersion = '1.8.0'
mIndicatorVersion = '1.5.0'

View File

@ -64,8 +64,8 @@ dependencies {
//butterknife
api "com.jakewharton:butterknife:$rootProject.ext.gButterKnifeVersion"
////
implementation "com.contrarywind:Android-PickerView:${rootProject.ext.pickerViewVersion}"
implementation "com.contrarywind:wheelview:${rootProject.ext.wheelVersion}"
api "com.contrarywind:Android-PickerView:${rootProject.ext.gPickerViewVersion}"
api "com.contrarywind:wheelview:${rootProject.ext.wheelVersion}"
//recyclerview
implementation 'androidx.recyclerview:recyclerview:1.2.1'
//

View File

@ -117,8 +117,7 @@ public class PathConfig {
public static final String PATH_MODULE_PLACE_ACTIVITY_PLACEDETAIL = "/moduleplace/activity/placedetail";//场馆详情
public static final String PATH_MODULE_PLACE_ACTIVITY_PLACELIST = "/moduleplace/activity/placelist";//场馆列表
public static final String PATH_MODULE_PLACE_FRAGMENT_MAIN = "/moduleplace/fragment/main";//场馆fragment
public static final String PATH_MODULE_PLACE_ACTIVITY_PLACE_SUBJECT_DETAIL = "/moduleplace/activity/subjectdetail"
;//场馆详情
public static final String PATH_MODULE_PLACE_ACTIVITY_PLACE_SUBJECT_DETAIL = "/moduleplace/activity/subjectdetail";//场馆详情
public static final String PATH_MODULE_PLACE_TICKET_DISTINE = "/moduleplace/activity/distineticket";//门票预定
public static final String PATH_MODULE_PLACE_DISTINE_BOOKING = "/moduleplace/activity/distinebooking";//场次预定
@ -140,8 +139,7 @@ public class PathConfig {
public static final String PATH_MODULE_CULTURAL_VOUNTEER_MANAGE = "/modulecultural/activity/vounteermanage";//志愿团队
public static final String PATH_MODULE_CULTURAL_VOUNTEER_MANAGE_LIST = "/modulecultural/activity" +
"/vounteermanagelsit";//我创建的自愿者团队
public static final String PATH_MODULE_CULTURAL_VOUNTEER_ACTIVITY_TEAM = "/modulecultural/activity/vounteermember"
;//志愿者列表
public static final String PATH_MODULE_CULTURAL_VOUNTEER_ACTIVITY_TEAM = "/modulecultural/activity/vounteermember";//志愿者列表
public static final String PATH_MODULE_CULTURAL_VOUNTEER_MEMBER_DETAIL = "/modulecultural/activity" +
"/vounteermemberdetail";//志愿者详情
public static final String PATH_MODULE_CULTURAL_VOUNTEER_MANAGE_MEMBER = "/modulecultural/activity" +
@ -153,8 +151,7 @@ public class PathConfig {
public static final String PATH_MODULE_CULTURAL_LIVE_LIST = "/modulecultural/activity/livelookbacklist";//直播回看播放列表
public static final String PATH_MODULE_CULTURAL_VOUNTEER_MINE_TEAM_DETAIL = "/modulecultural/activity/vounteer" +
"/detail";//我创建的团队详情
public static final String PATH_MODULE_CULTURAL_VOUNTEER_MINE_TEAM_EDIT = "/modulecultural/activity/vounteer/edit"
;//编辑我创建的团队
public static final String PATH_MODULE_CULTURAL_VOUNTEER_MINE_TEAM_EDIT = "/modulecultural/activity/vounteer/edit";//编辑我创建的团队
public static final String PATH_MODULE_CULTURAL_VOUNTEER_ACTIVITY_LIST = "/modulecultural/activity/vounteer" +
"/activitylist";//志愿者活动列表
@ -265,4 +262,10 @@ public class PathConfig {
public static final String PATH_MODULE_SHOP_ACTIVITY_GOODS_LIST = "/moduleshop/activity/shopGoodsList";//商品列表
public static final String PATH_MODULE_SHOP_ACTIVITY_GOODS_DETAIL = "/moduleshop/activity/shopGoodsDetail";//商品详情
public static final String PATH_MODULE_SHOP_ACTIVITY_SHOP_CAR = "/moduleshop/activity/shopGoodsCar";//购物车
public static final String PATH_MODULE_SHOP_ACTIVITY_SHOP_ORDER_CONFIRM =
"/moduleshop/activity/shopOrderConfirm";//订单确认
public static final String PATH_MODULE_SHOP_ACTIVITY_SHOP_ADDRESS = "/moduleshop/activity/shopGoodsAddress";//收货地址
public static final String PATH_MODULE_SHOP_ACTIVITY_SHOP_MINE_ORDER = "/moduleshop/activity/shopOrderList";//我的订单
public static final String PATH_MODULE_SHOP_ACTIVITY_SHOP_MINE_ORDER_DETAIL = "/moduleshop/activity/shopOrderDetail";//我的订单
public static final String PATH_MODULE_SHOP_ACTIVITY_SHOP_ADD_ADDRESS = "/moduleshop/activity/shopAddAddress";//新增收货地
}

View File

@ -1,5 +1,7 @@
package com.sucstepsoft.cm_utils.core.beans;
import com.contrarywind.interfaces.IPickerViewData;
import java.util.List;
/**
@ -8,7 +10,7 @@ import java.util.List;
* 邮箱: itgaojian@163.com
* 描述:
*/
public class AreaBean {
public class AreaBean implements IPickerViewData {
/**
* areaCityCode : string
@ -174,6 +176,11 @@ public class AreaBean {
this.subArea = subArea;
}
@Override
public String getPickerViewText() {
return areaName;
}
public static class SubAreaBean {
}
}

View File

@ -290,4 +290,20 @@ public interface BaseApiService {
Call<ResponseBody> downloadApk(@Url String url);
/**
* 统一用户-根据pId获取下级
*
* @param pId
* @return
*/
@Headers({"Content-Type:application/json", "Accept:application/json"})
@GET("app/area/listbyparentidrelease/{areaParentId}")
Observable<List<AreaBean>> getArea(@Path("areaParentId") String pId);
/**
* 统一用户-区域-根据Id获取详情
*/
@Headers({"Content-Type:application/json", "Accept:application/json"})
@GET("app/area/getrelease/{areaId}")
Observable<AreaBean> getAreaDetail(@Path("areaId") String pId);
}

View File

@ -1,354 +0,0 @@
package com.sucstepsoft.cm_utils.core.widget.views;
import android.annotation.SuppressLint;
import android.app.Activity;
import android.app.Dialog;
import android.content.Context;
import android.graphics.Color;
import android.graphics.drawable.ColorDrawable;
import android.view.Display;
import android.view.Gravity;
import android.view.KeyEvent;
import android.view.LayoutInflater;
import android.view.MotionEvent;
import android.view.View;
import android.view.ViewGroup;
import android.view.Window;
import android.view.WindowManager;
import android.view.animation.Animation;
import android.view.animation.AnimationUtils;
import android.widget.FrameLayout;
import com.bigkoo.pickerview.configure.PickerOptions;
import com.bigkoo.pickerview.listener.OnDismissListener;
import com.bigkoo.pickerview.utils.PickerViewAnimateUtil;
import com.sucstepsoft.cm_utils.R;
public class BaseCustomHPickerView {
private Context context;
protected ViewGroup contentContainer;
private ViewGroup rootView;//附加View 根View
private ViewGroup dialogView;//附加Dialog 根View
protected PickerOptions mPickerOptions;
private OnDismissListener onDismissListener;
private boolean dismissing;
private Animation outAnim;
private Animation inAnim;
private boolean isShowing;
protected int animGravity = Gravity.BOTTOM;
private Dialog mDialog;
protected View clickView;//是通过哪个View弹出的
private boolean isAnim = true;
public BaseCustomHPickerView(Context context) {
this.context = context;
}
protected void initViews() {
FrameLayout.LayoutParams params = new FrameLayout.LayoutParams(
ViewGroup.LayoutParams.MATCH_PARENT, ViewGroup.LayoutParams.WRAP_CONTENT, Gravity.BOTTOM);
LayoutInflater layoutInflater = LayoutInflater.from(context);
if (isDialog()) {
//如果是对话框模式
dialogView = (ViewGroup) layoutInflater.inflate(R.layout.layout_basepickerview, null, false);
//设置界面的背景为透明
dialogView.setBackgroundColor(Color.TRANSPARENT);
//这个是真正要加载选择器的父布局
contentContainer = (ViewGroup) dialogView.findViewById(R.id.content_container);
//设置对话框 默认左右间距屏幕30
// params.leftMargin = 10;
// params.rightMargin = 10;
contentContainer.setLayoutParams(params);
//创建对话框
createDialog();
//给背景设置点击事件,这样当点击内容以外的地方会关闭界面
dialogView.setOnClickListener(view -> dismiss());
} else {
//如果只是要显示在屏幕的下方
//decorView是activity的根View,包含 contentView titleView
if (mPickerOptions.decorView == null) {
mPickerOptions.decorView = (ViewGroup) ((Activity) context).getWindow().getDecorView();
}
//将控件添加到decorView中
rootView = (ViewGroup) layoutInflater.inflate(R.layout.layout_basepickerview, mPickerOptions.decorView, false);
rootView.setLayoutParams(new FrameLayout.LayoutParams(ViewGroup.LayoutParams.MATCH_PARENT, ViewGroup.LayoutParams.MATCH_PARENT));
if (mPickerOptions.backgroundId != -1) {
rootView.setBackgroundColor(mPickerOptions.backgroundId);
}
//这个是真正要加载时间选取器的父布局
contentContainer = (ViewGroup) rootView.findViewById(R.id.content_container);
contentContainer.setLayoutParams(params);
}
setKeyBackCancelable(true);
}
protected void initAnim() {
inAnim = getInAnimation();
outAnim = getOutAnimation();
}
protected void initEvents() {
}
/**
* @param v (是通过哪个View弹出的)
* @param isAnim 是否显示动画效果
*/
public void show(View v, boolean isAnim) {
this.clickView = v;
this.isAnim = isAnim;
show();
}
public void show(boolean isAnim) {
this.isAnim = isAnim;
show();
}
public void show(View v) {
this.clickView = v;
show();
}
/**
* 添加View到根视图
*/
public void show() {
if (isDialog()) {
showDialog();
} else {
if (isShowing()) {
return;
}
isShowing = true;
onAttached(rootView);
rootView.requestFocus();
}
}
/**
* show的时候调用
*
* @param view 这个View
*/
private void onAttached(View view) {
mPickerOptions.decorView.addView(view);
if (isAnim) {
contentContainer.startAnimation(inAnim);
}
}
/**
* 检测该View是不是已经添加到根视图
*
* @return 如果视图已经存在该View返回true
*/
public boolean isShowing() {
if (isDialog()) {
return false;
} else {
return rootView.getParent() != null || isShowing;
}
}
public void dismiss() {
if (isDialog()) {
dismissDialog();
} else {
if (dismissing) {
return;
}
if (isAnim) {
//消失动画
outAnim.setAnimationListener(new Animation.AnimationListener() {
@Override
public void onAnimationStart(Animation animation) {
}
@Override
public void onAnimationEnd(Animation animation) {
dismissImmediately();
}
@Override
public void onAnimationRepeat(Animation animation) {
}
});
contentContainer.startAnimation(outAnim);
} else {
dismissImmediately();
}
dismissing = true;
}
}
public void dismissImmediately() {
mPickerOptions.decorView.post(new Runnable() {
@Override
public void run() {
//从根视图移除
mPickerOptions.decorView.removeView(rootView);
isShowing = false;
dismissing = false;
if (onDismissListener != null) {
onDismissListener.onDismiss(BaseCustomHPickerView.this);
}
}
});
}
private Animation getInAnimation() {
int res = PickerViewAnimateUtil.getAnimationResource(this.animGravity, true);
return AnimationUtils.loadAnimation(context, res);
}
private Animation getOutAnimation() {
int res = PickerViewAnimateUtil.getAnimationResource(this.animGravity, false);
return AnimationUtils.loadAnimation(context, res);
}
public BaseCustomHPickerView setOnDismissListener(OnDismissListener onDismissListener) {
this.onDismissListener = onDismissListener;
return this;
}
public void setKeyBackCancelable(boolean isCancelable) {
ViewGroup View;
if (isDialog()) {
View = dialogView;
} else {
View = rootView;
}
View.setFocusable(isCancelable);
View.setFocusableInTouchMode(isCancelable);
if (isCancelable) {
View.setOnKeyListener(onKeyBackListener);
} else {
View.setOnKeyListener(null);
}
}
private View.OnKeyListener onKeyBackListener = (v, keyCode, event) -> {
if (keyCode == KeyEvent.KEYCODE_BACK && event.getAction() == MotionEvent.ACTION_DOWN && isShowing()) {
dismiss();
return true;
}
return false;
};
protected BaseCustomHPickerView setOutSideCancelable(boolean isCancelable) {
if (rootView != null) {
View view = rootView.findViewById(R.id.outmost_container);
if (isCancelable) {
view.setOnTouchListener(onCancelableTouchListener);
} else {
view.setOnTouchListener(null);
}
}
return this;
}
/**
* 设置对话框模式是否可以点击外部取消
*/
public void setDialogOutSideCancelable() {
if (mDialog != null) {
mDialog.setCancelable(mPickerOptions.cancelable);
}
}
/**
* Called when the user touch on black overlay, in order to dismiss the dialog.
*/
@SuppressLint("ClickableViewAccessibility")
private final View.OnTouchListener onCancelableTouchListener = (v, event) -> {
if (event.getAction() == MotionEvent.ACTION_DOWN) {
dismiss();
}
return false;
};
public View findViewById(int id) {
return contentContainer.findViewById(id);
}
public void createDialog() {
if (dialogView != null) {
mDialog = new Dialog(context, R.style.custom_dialog2);
mDialog.setCancelable(mPickerOptions.cancelable);//不能点外面取消,也不能点back取消
mDialog.setContentView(dialogView);
Window dialogWindow = mDialog.getWindow();
WindowManager m = ((Activity) context).getWindowManager();
Display d = m.getDefaultDisplay();
WindowManager.LayoutParams p = dialogWindow.getAttributes();
p.height = (int) (d.getHeight() * 0.9);
p.width = (int) (d.getWidth() * 0.3);
dialogWindow.setBackgroundDrawable(new ColorDrawable(Color.TRANSPARENT));
dialogWindow.setAttributes(p);
if (dialogWindow != null) {
dialogWindow.setWindowAnimations(R.style.picker_view_scale_anim);
dialogWindow.setGravity(Gravity.CENTER);//可以改成Bottom
}
mDialog.setOnDismissListener(dialog -> {
if (onDismissListener != null) {
onDismissListener.onDismiss(BaseCustomHPickerView.this);
}
});
}
}
private void showDialog() {
if (mDialog != null) {
mDialog.show();
}
}
private void dismissDialog() {
if (mDialog != null) {
mDialog.dismiss();
}
}
public ViewGroup getDialogContainerLayout() {
return contentContainer;
}
public Dialog getDialog() {
return mDialog;
}
public boolean isDialog() {
return false;
}
}

View File

@ -1,354 +0,0 @@
package com.sucstepsoft.cm_utils.core.widget.views;
import android.annotation.SuppressLint;
import android.app.Activity;
import android.app.Dialog;
import android.content.Context;
import android.graphics.Color;
import android.graphics.drawable.ColorDrawable;
import android.view.Display;
import android.view.Gravity;
import android.view.KeyEvent;
import android.view.LayoutInflater;
import android.view.MotionEvent;
import android.view.View;
import android.view.ViewGroup;
import android.view.Window;
import android.view.WindowManager;
import android.view.animation.Animation;
import android.view.animation.AnimationUtils;
import android.widget.FrameLayout;
import com.bigkoo.pickerview.configure.PickerOptions;
import com.bigkoo.pickerview.listener.OnDismissListener;
import com.bigkoo.pickerview.utils.PickerViewAnimateUtil;
import com.sucstepsoft.cm_utils.R;
public class BaseCustomPickerView {
private Context context;
protected ViewGroup contentContainer;
private ViewGroup rootView;//附加View 根View
private ViewGroup dialogView;//附加Dialog 根View
protected PickerOptions mPickerOptions;
private OnDismissListener onDismissListener;
private boolean dismissing;
private Animation outAnim;
private Animation inAnim;
private boolean isShowing;
protected int animGravity = Gravity.BOTTOM;
private Dialog mDialog;
protected View clickView;//是通过哪个View弹出的
private boolean isAnim = true;
public BaseCustomPickerView(Context context) {
this.context = context;
}
protected void initViews() {
FrameLayout.LayoutParams params = new FrameLayout.LayoutParams(
ViewGroup.LayoutParams.MATCH_PARENT, ViewGroup.LayoutParams.WRAP_CONTENT, Gravity.BOTTOM);
LayoutInflater layoutInflater = LayoutInflater.from(context);
if (isDialog()) {
//如果是对话框模式
dialogView = (ViewGroup) layoutInflater.inflate(R.layout.layout_basepickerview, null, false);
//设置界面的背景为透明
dialogView.setBackgroundColor(Color.TRANSPARENT);
//这个是真正要加载选择器的父布局
contentContainer = (ViewGroup) dialogView.findViewById(R.id.content_container);
//设置对话框 默认左右间距屏幕30
// params.leftMargin = 10;
// params.rightMargin = 10;
contentContainer.setLayoutParams(params);
//创建对话框
createDialog();
//给背景设置点击事件,这样当点击内容以外的地方会关闭界面
dialogView.setOnClickListener(view -> dismiss());
} else {
//如果只是要显示在屏幕的下方
//decorView是activity的根View,包含 contentView titleView
if (mPickerOptions.decorView == null) {
mPickerOptions.decorView = (ViewGroup) ((Activity) context).getWindow().getDecorView();
}
//将控件添加到decorView中
rootView = (ViewGroup) layoutInflater.inflate(R.layout.layout_basepickerview, mPickerOptions.decorView, false);
rootView.setLayoutParams(new FrameLayout.LayoutParams(ViewGroup.LayoutParams.MATCH_PARENT, ViewGroup.LayoutParams.MATCH_PARENT));
if (mPickerOptions.backgroundId != -1) {
rootView.setBackgroundColor(mPickerOptions.backgroundId);
}
//这个是真正要加载时间选取器的父布局
contentContainer = (ViewGroup) rootView.findViewById(R.id.content_container);
contentContainer.setLayoutParams(params);
}
setKeyBackCancelable(true);
}
protected void initAnim() {
inAnim = getInAnimation();
outAnim = getOutAnimation();
}
protected void initEvents() {
}
/**
* @param v (是通过哪个View弹出的)
* @param isAnim 是否显示动画效果
*/
public void show(View v, boolean isAnim) {
this.clickView = v;
this.isAnim = isAnim;
show();
}
public void show(boolean isAnim) {
this.isAnim = isAnim;
show();
}
public void show(View v) {
this.clickView = v;
show();
}
/**
* 添加View到根视图
*/
public void show() {
if (isDialog()) {
showDialog();
} else {
if (isShowing()) {
return;
}
isShowing = true;
onAttached(rootView);
rootView.requestFocus();
}
}
/**
* show的时候调用
*
* @param view 这个View
*/
private void onAttached(View view) {
mPickerOptions.decorView.addView(view);
if (isAnim) {
contentContainer.startAnimation(inAnim);
}
}
/**
* 检测该View是不是已经添加到根视图
*
* @return 如果视图已经存在该View返回true
*/
public boolean isShowing() {
if (isDialog()) {
return false;
} else {
return rootView.getParent() != null || isShowing;
}
}
public void dismiss() {
if (isDialog()) {
dismissDialog();
} else {
if (dismissing) {
return;
}
if (isAnim) {
//消失动画
outAnim.setAnimationListener(new Animation.AnimationListener() {
@Override
public void onAnimationStart(Animation animation) {
}
@Override
public void onAnimationEnd(Animation animation) {
dismissImmediately();
}
@Override
public void onAnimationRepeat(Animation animation) {
}
});
contentContainer.startAnimation(outAnim);
} else {
dismissImmediately();
}
dismissing = true;
}
}
public void dismissImmediately() {
mPickerOptions.decorView.post(new Runnable() {
@Override
public void run() {
//从根视图移除
mPickerOptions.decorView.removeView(rootView);
isShowing = false;
dismissing = false;
if (onDismissListener != null) {
onDismissListener.onDismiss(BaseCustomPickerView.this);
}
}
});
}
private Animation getInAnimation() {
int res = PickerViewAnimateUtil.getAnimationResource(this.animGravity, true);
return AnimationUtils.loadAnimation(context, res);
}
private Animation getOutAnimation() {
int res = PickerViewAnimateUtil.getAnimationResource(this.animGravity, false);
return AnimationUtils.loadAnimation(context, res);
}
public BaseCustomPickerView setOnDismissListener(OnDismissListener onDismissListener) {
this.onDismissListener = onDismissListener;
return this;
}
public void setKeyBackCancelable(boolean isCancelable) {
ViewGroup View;
if (isDialog()) {
View = dialogView;
} else {
View = rootView;
}
View.setFocusable(isCancelable);
View.setFocusableInTouchMode(isCancelable);
if (isCancelable) {
View.setOnKeyListener(onKeyBackListener);
} else {
View.setOnKeyListener(null);
}
}
private View.OnKeyListener onKeyBackListener = (v, keyCode, event) -> {
if (keyCode == KeyEvent.KEYCODE_BACK && event.getAction() == MotionEvent.ACTION_DOWN && isShowing()) {
dismiss();
return true;
}
return false;
};
protected BaseCustomPickerView setOutSideCancelable(boolean isCancelable) {
if (rootView != null) {
View view = rootView.findViewById(R.id.outmost_container);
if (isCancelable) {
view.setOnTouchListener(onCancelableTouchListener);
} else {
view.setOnTouchListener(null);
}
}
return this;
}
/**
* 设置对话框模式是否可以点击外部取消
*/
public void setDialogOutSideCancelable() {
if (mDialog != null) {
mDialog.setCancelable(mPickerOptions.cancelable);
}
}
/**
* Called when the user touch on black overlay, in order to dismiss the dialog.
*/
@SuppressLint("ClickableViewAccessibility")
private final View.OnTouchListener onCancelableTouchListener = (v, event) -> {
if (event.getAction() == MotionEvent.ACTION_DOWN) {
dismiss();
}
return false;
};
public View findViewById(int id) {
return contentContainer.findViewById(id);
}
public void createDialog() {
if (dialogView != null) {
mDialog = new Dialog(context, R.style.custom_dialog2);
mDialog.setCancelable(mPickerOptions.cancelable);//不能点外面取消,也不能点back取消
mDialog.setContentView(dialogView);
Window dialogWindow = mDialog.getWindow();
WindowManager m = ((Activity) context).getWindowManager();
Display d = m.getDefaultDisplay();
WindowManager.LayoutParams p = dialogWindow.getAttributes();
p.height = (int) (d.getHeight() * 0.5);
p.width = (int) (d.getWidth() * 0.9);
dialogWindow.setBackgroundDrawable(new ColorDrawable(Color.TRANSPARENT));
dialogWindow.setAttributes(p);
if (dialogWindow != null) {
dialogWindow.setWindowAnimations(R.style.picker_view_scale_anim);
dialogWindow.setGravity(Gravity.CENTER);//可以改成Bottom
}
mDialog.setOnDismissListener(dialog -> {
if (onDismissListener != null) {
onDismissListener.onDismiss(BaseCustomPickerView.this);
}
});
}
}
private void showDialog() {
if (mDialog != null) {
mDialog.show();
}
}
private void dismissDialog() {
if (mDialog != null) {
mDialog.dismiss();
}
}
public ViewGroup getDialogContainerLayout() {
return contentContainer;
}
public Dialog getDialog() {
return mDialog;
}
public boolean isDialog() {
return false;
}
}

View File

@ -1,247 +0,0 @@
package com.sucstepsoft.cm_utils.core.widget.views;
import android.content.Context;
import android.graphics.Typeface;
import android.view.ViewGroup;
import com.bigkoo.pickerview.configure.PickerOptions;
import com.bigkoo.pickerview.listener.CustomListener;
import com.bigkoo.pickerview.listener.OnOptionsSelectChangeListener;
import com.bigkoo.pickerview.listener.OnOptionsSelectListener;
public class CustomPickerBuilder {
//配置类
private PickerOptions mPickerOptions;
//Required
public CustomPickerBuilder(Context context, OnOptionsSelectListener listener) {
mPickerOptions = new PickerOptions(PickerOptions.TYPE_PICKER_OPTIONS);
mPickerOptions.context = context;
mPickerOptions.optionsSelectListener = listener;
}
//Option
public CustomPickerBuilder setSubmitText(String textContentConfirm) {
mPickerOptions.textContentConfirm = textContentConfirm;
return this;
}
public CustomPickerBuilder setCancelText(String textContentCancel) {
mPickerOptions.textContentCancel = textContentCancel;
return this;
}
public CustomPickerBuilder setTitleText(String textContentTitle) {
mPickerOptions.textContentTitle = textContentTitle;
return this;
}
public CustomPickerBuilder isDialog(boolean isDialog) {
mPickerOptions.isDialog = isDialog;
return this;
}
public CustomPickerBuilder setSubmitColor(int textColorConfirm) {
mPickerOptions.textColorConfirm = textColorConfirm;
return this;
}
public CustomPickerBuilder setCancelColor(int textColorCancel) {
mPickerOptions.textColorCancel = textColorCancel;
return this;
}
/**
* 显示时的外部背景色颜色,默认是灰色
*
* @param backgroundId color resId.
* @return
*/
public CustomPickerBuilder setBackgroundId(int backgroundId) {
mPickerOptions.backgroundId = backgroundId;
return this;
}
/**
* ViewGroup 类型
* 设置PickerView的显示容器
*
* @param decorView Parent View.
* @return
*/
public CustomPickerBuilder setDecorView(ViewGroup decorView) {
mPickerOptions.decorView = decorView;
return this;
}
public CustomPickerBuilder setLayoutRes(int res, CustomListener listener) {
mPickerOptions.layoutRes = res;
mPickerOptions.customListener = listener;
return this;
}
public CustomPickerBuilder setBgColor(int bgColorWheel) {
mPickerOptions.bgColorWheel = bgColorWheel;
return this;
}
public CustomPickerBuilder setTitleBgColor(int bgColorTitle) {
mPickerOptions.bgColorTitle = bgColorTitle;
return this;
}
public CustomPickerBuilder setTitleColor(int textColorTitle) {
mPickerOptions.textColorTitle = textColorTitle;
return this;
}
public CustomPickerBuilder setSubCalSize(int textSizeSubmitCancel) {
mPickerOptions.textSizeSubmitCancel = textSizeSubmitCancel;
return this;
}
public CustomPickerBuilder setTitleSize(int textSizeTitle) {
mPickerOptions.textSizeTitle = textSizeTitle;
return this;
}
public CustomPickerBuilder setContentTextSize(int textSizeContent) {
mPickerOptions.textSizeContent = textSizeContent;
return this;
}
public CustomPickerBuilder setOutSideCancelable(boolean cancelable) {
mPickerOptions.cancelable = cancelable;
return this;
}
public CustomPickerBuilder setLabels(String label1, String label2, String label3) {
mPickerOptions.label1 = label1;
mPickerOptions.label2 = label2;
mPickerOptions.label3 = label3;
return this;
}
/**
* 设置Item 的间距倍数用于控制 Item 高度间隔
*
* @param lineSpacingMultiplier 浮点型1.0-4.0f 之间有效,超过则取极值
*/
public CustomPickerBuilder setLineSpacingMultiplier(float lineSpacingMultiplier) {
mPickerOptions.lineSpacingMultiplier = lineSpacingMultiplier;
return this;
}
/**
* Set item divider line type color.
*
* @param dividerColor color resId.
*/
public CustomPickerBuilder setDividerColor(int dividerColor) {
mPickerOptions.dividerColor = dividerColor;
return this;
}
// /**
// * Set item divider line type.
// *
// * @param dividerType enum Type {@link WheelView.DividerType}
// */
// public CustomPickerBuilder setDividerType(WheelView.DividerType dividerType) {
// mPickerOptions.dividerType = dividerType;
// return this;
// }
/**
* Set the textColor of selected item.
*
* @param textColorCenter color res.
*/
public CustomPickerBuilder setTextColorCenter(int textColorCenter) {
mPickerOptions.textColorCenter = textColorCenter;
return this;
}
/**
* Set the textColor of outside item.
*
* @param textColorOut color resId.
*/
public CustomPickerBuilder setTextColorOut(int textColorOut) {
mPickerOptions.textColorOut = textColorOut;
return this;
}
public CustomPickerBuilder setTypeface(Typeface font) {
mPickerOptions.font = font;
return this;
}
public CustomPickerBuilder setCyclic(boolean cyclic1, boolean cyclic2, boolean cyclic3) {
mPickerOptions.cyclic1 = cyclic1;
mPickerOptions.cyclic2 = cyclic2;
mPickerOptions.cyclic3 = cyclic3;
return this;
}
public CustomPickerBuilder setSelectOptions(int option1) {
mPickerOptions.option1 = option1;
return this;
}
public CustomPickerBuilder setSelectOptions(int option1, int option2) {
mPickerOptions.option1 = option1;
mPickerOptions.option2 = option2;
return this;
}
public CustomPickerBuilder setSelectOptions(int option1, int option2, int option3) {
mPickerOptions.option1 = option1;
mPickerOptions.option2 = option2;
mPickerOptions.option3 = option3;
return this;
}
public CustomPickerBuilder setTextXOffset(int xoffset_one, int xoffset_two, int xoffset_three) {
mPickerOptions.x_offset_one = xoffset_one;
mPickerOptions.x_offset_two = xoffset_two;
mPickerOptions.x_offset_three = xoffset_three;
return this;
}
public CustomPickerBuilder isCenterLabel(boolean isCenterLabel) {
mPickerOptions.isCenterLabel = isCenterLabel;
return this;
}
/**
* 切换选项时是否还原第一项
*
* @param isRestoreItem true还原 false: 保持上一个选项
* @return TimePickerBuilder
*/
public CustomPickerBuilder isRestoreItem(boolean isRestoreItem) {
mPickerOptions.isRestoreItem = isRestoreItem;
return this;
}
/**
* @param listener 切换item项滚动停止时实时回调监听
* @return
*/
public CustomPickerBuilder setOptionsSelectChangeListener(OnOptionsSelectChangeListener listener) {
mPickerOptions.optionsSelectChangeListener = listener;
return this;
}
public <T> CustomPickerView<T> build() {
return new CustomPickerView<>(mPickerOptions);
}
public CustomPickerBuilder setDialog(int i, int i1) {
return null;
}
}

View File

@ -1,187 +0,0 @@
package com.sucstepsoft.cm_utils.core.widget.views;
import android.content.Context;
import android.text.TextUtils;
import android.view.LayoutInflater;
import android.view.View;
import android.widget.Button;
import android.widget.LinearLayout;
import android.widget.RelativeLayout;
import android.widget.TextView;
import com.bigkoo.pickerview.configure.PickerOptions;
import com.bigkoo.pickerview.view.WheelOptions;
import com.sucstepsoft.cm_utils.R;
import java.util.List;
public class CustomPickerView<T> extends BaseCustomPickerView implements View.OnClickListener {
private WheelOptions wheelOptions;
private static final String TAG_SUBMIT = "submit";
private static final String TAG_CANCEL = "cancel";
public CustomPickerView(PickerOptions pickerOptions) {
super(pickerOptions.context);
mPickerOptions = pickerOptions;
initView(pickerOptions.context);
}
private void initView(Context context) {
setDialogOutSideCancelable();
initViews();
initAnim();
initEvents();
if (mPickerOptions.customListener == null) {
LayoutInflater.from(context).inflate(mPickerOptions.layoutRes, contentContainer);
//顶部标题
TextView tvTitle = (TextView) findViewById(R.id.tvTitle);
RelativeLayout rv_top_bar = (RelativeLayout) findViewById(R.id.rv_topbar);
//确定和取消按钮
Button btnSubmit = (Button) findViewById(R.id.btnSubmit);
Button btnCancel = (Button) findViewById(R.id.btnCancel);
btnSubmit.setTag(TAG_SUBMIT);
btnCancel.setTag(TAG_CANCEL);
btnSubmit.setOnClickListener(this);
btnCancel.setOnClickListener(this);
//设置文字
btnSubmit.setText(TextUtils.isEmpty(mPickerOptions.textContentConfirm) ? context.getResources().getString(R.string.pickerview_submit) : mPickerOptions.textContentConfirm);
btnCancel.setText(TextUtils.isEmpty(mPickerOptions.textContentCancel) ? context.getResources().getString(R.string.pickerview_cancel) : mPickerOptions.textContentCancel);
tvTitle.setText(TextUtils.isEmpty(mPickerOptions.textContentTitle) ? "" : mPickerOptions.textContentTitle);//默认为空
//设置color
btnSubmit.setTextColor(mPickerOptions.textColorConfirm);
btnCancel.setTextColor(mPickerOptions.textColorCancel);
tvTitle.setTextColor(mPickerOptions.textColorTitle);
rv_top_bar.setBackgroundColor(mPickerOptions.bgColorTitle);
//设置文字大小
btnSubmit.setTextSize(mPickerOptions.textSizeSubmitCancel);
btnCancel.setTextSize(mPickerOptions.textSizeSubmitCancel);
tvTitle.setTextSize(mPickerOptions.textSizeTitle);
} else {
mPickerOptions.customListener.customLayout(LayoutInflater.from(context).inflate(mPickerOptions.layoutRes, contentContainer));
}
// ----滚轮布局
final LinearLayout optionsPicker = (LinearLayout) findViewById(R.id.optionspicker);
optionsPicker.setBackgroundColor(mPickerOptions.bgColorWheel);
wheelOptions = new WheelOptions(optionsPicker, mPickerOptions.isRestoreItem);
if (mPickerOptions.optionsSelectChangeListener != null) {
wheelOptions.setOptionsSelectChangeListener(mPickerOptions.optionsSelectChangeListener);
}
wheelOptions.setTextContentSize(mPickerOptions.textSizeContent);
wheelOptions.setLabels(mPickerOptions.label1, mPickerOptions.label2, mPickerOptions.label3);
wheelOptions.setTextXOffset(mPickerOptions.x_offset_one, mPickerOptions.x_offset_two, mPickerOptions.x_offset_three);
wheelOptions.setCyclic(mPickerOptions.cyclic1, mPickerOptions.cyclic2, mPickerOptions.cyclic3);
wheelOptions.setTypeface(mPickerOptions.font);
setOutSideCancelable(mPickerOptions.cancelable);
wheelOptions.setDividerColor(mPickerOptions.dividerColor);
// wheelOptions.setDividerType(mPickerOptions.dividerType);
wheelOptions.setLineSpacingMultiplier(mPickerOptions.lineSpacingMultiplier);
wheelOptions.setTextColorOut(mPickerOptions.textColorOut);
wheelOptions.setTextColorCenter(mPickerOptions.textColorCenter);
wheelOptions.isCenterLabel(mPickerOptions.isCenterLabel);
}
/**
* 动态设置标题
*
* @param text 标题文本内容
*/
public void setTitleText(String text) {
TextView tvTitle = (TextView) findViewById(R.id.tvTitle);
if (tvTitle != null) {
tvTitle.setText(text);
}
}
/**
* 设置默认选中项
*
* @param option1
*/
public void setSelectOptions(int option1) {
mPickerOptions.option1 = option1;
reSetCurrentItems();
}
public void setSelectOptions(int option1, int option2) {
mPickerOptions.option1 = option1;
mPickerOptions.option2 = option2;
reSetCurrentItems();
}
public void setSelectOptions(int option1, int option2, int option3) {
mPickerOptions.option1 = option1;
mPickerOptions.option2 = option2;
mPickerOptions.option3 = option3;
reSetCurrentItems();
}
private void reSetCurrentItems() {
if (wheelOptions != null) {
wheelOptions.setCurrentItems(mPickerOptions.option1, mPickerOptions.option2, mPickerOptions.option3);
}
}
public void setPicker(List<T> optionsItems) {
this.setPicker(optionsItems, null, null);
}
public void setPicker(List<T> options1Items, List<List<T>> options2Items) {
this.setPicker(options1Items, options2Items, null);
}
public void setPicker(List<T> options1Items,
List<List<T>> options2Items,
List<List<List<T>>> options3Items) {
wheelOptions.setPicker(options1Items, options2Items, options3Items);
reSetCurrentItems();
}
//不联动情况下调用
public void setNPicker(List<T> options1Items,
List<T> options2Items,
List<T> options3Items) {
wheelOptions.setLinkage(false);
wheelOptions.setNPicker(options1Items, options2Items, options3Items);
reSetCurrentItems();
}
@Override
public void onClick(View v) {
String tag = (String) v.getTag();
if (tag.equals(TAG_SUBMIT)) {
returnData();
}
dismiss();
}
//抽离接口回调的方法
public void returnData() {
if (mPickerOptions.optionsSelectListener != null) {
int[] optionsCurrentItems = wheelOptions.getCurrentItems();
mPickerOptions.optionsSelectListener.onOptionsSelect(optionsCurrentItems[0], optionsCurrentItems[1], optionsCurrentItems[2], clickView);
}
}
@Override
public boolean isDialog() {
return mPickerOptions.isDialog;
}
}

View File

@ -1,247 +0,0 @@
package com.sucstepsoft.cm_utils.core.widget.views;
import android.content.Context;
import android.graphics.Typeface;
import android.view.ViewGroup;
import com.bigkoo.pickerview.configure.PickerOptions;
import com.bigkoo.pickerview.listener.CustomListener;
import com.bigkoo.pickerview.listener.OnOptionsSelectChangeListener;
import com.bigkoo.pickerview.listener.OnOptionsSelectListener;
public class HCustomPickerBuilder {
//配置类
private PickerOptions mPickerOptions;
//Required
public HCustomPickerBuilder(Context context, OnOptionsSelectListener listener) {
mPickerOptions = new PickerOptions(PickerOptions.TYPE_PICKER_OPTIONS);
mPickerOptions.context = context;
mPickerOptions.optionsSelectListener = listener;
}
//Option
public HCustomPickerBuilder setSubmitText(String textContentConfirm) {
mPickerOptions.textContentConfirm = textContentConfirm;
return this;
}
public HCustomPickerBuilder setCancelText(String textContentCancel) {
mPickerOptions.textContentCancel = textContentCancel;
return this;
}
public HCustomPickerBuilder setTitleText(String textContentTitle) {
mPickerOptions.textContentTitle = textContentTitle;
return this;
}
public HCustomPickerBuilder isDialog(boolean isDialog) {
mPickerOptions.isDialog = isDialog;
return this;
}
public HCustomPickerBuilder setSubmitColor(int textColorConfirm) {
mPickerOptions.textColorConfirm = textColorConfirm;
return this;
}
public HCustomPickerBuilder setCancelColor(int textColorCancel) {
mPickerOptions.textColorCancel = textColorCancel;
return this;
}
/**
* 显示时的外部背景色颜色,默认是灰色
*
* @param backgroundId color resId.
* @return
*/
public HCustomPickerBuilder setBackgroundId(int backgroundId) {
mPickerOptions.backgroundId = backgroundId;
return this;
}
/**
* ViewGroup 类型
* 设置PickerView的显示容器
*
* @param decorView Parent View.
* @return
*/
public HCustomPickerBuilder setDecorView(ViewGroup decorView) {
mPickerOptions.decorView = decorView;
return this;
}
public HCustomPickerBuilder setLayoutRes(int res, CustomListener listener) {
mPickerOptions.layoutRes = res;
mPickerOptions.customListener = listener;
return this;
}
public HCustomPickerBuilder setBgColor(int bgColorWheel) {
mPickerOptions.bgColorWheel = bgColorWheel;
return this;
}
public HCustomPickerBuilder setTitleBgColor(int bgColorTitle) {
mPickerOptions.bgColorTitle = bgColorTitle;
return this;
}
public HCustomPickerBuilder setTitleColor(int textColorTitle) {
mPickerOptions.textColorTitle = textColorTitle;
return this;
}
public HCustomPickerBuilder setSubCalSize(int textSizeSubmitCancel) {
mPickerOptions.textSizeSubmitCancel = textSizeSubmitCancel;
return this;
}
public HCustomPickerBuilder setTitleSize(int textSizeTitle) {
mPickerOptions.textSizeTitle = textSizeTitle;
return this;
}
public HCustomPickerBuilder setContentTextSize(int textSizeContent) {
mPickerOptions.textSizeContent = textSizeContent;
return this;
}
public HCustomPickerBuilder setOutSideCancelable(boolean cancelable) {
mPickerOptions.cancelable = cancelable;
return this;
}
public HCustomPickerBuilder setLabels(String label1, String label2, String label3) {
mPickerOptions.label1 = label1;
mPickerOptions.label2 = label2;
mPickerOptions.label3 = label3;
return this;
}
/**
* 设置Item 的间距倍数用于控制 Item 高度间隔
*
* @param lineSpacingMultiplier 浮点型1.0-4.0f 之间有效,超过则取极值
*/
public HCustomPickerBuilder setLineSpacingMultiplier(float lineSpacingMultiplier) {
mPickerOptions.lineSpacingMultiplier = lineSpacingMultiplier;
return this;
}
/**
* Set item divider line type color.
*
* @param dividerColor color resId.
*/
public HCustomPickerBuilder setDividerColor(int dividerColor) {
mPickerOptions.dividerColor = dividerColor;
return this;
}
// /**
// * Set item divider line type.
// *
// * @param dividerType enum Type {@link WheelView.DividerType}
// */
// public HCustomPickerBuilder setDividerType(WheelView.DividerType dividerType) {
// mPickerOptions.dividerType = dividerType;
// return this;
// }
/**
* Set the textColor of selected item.
*
* @param textColorCenter color res.
*/
public HCustomPickerBuilder setTextColorCenter(int textColorCenter) {
mPickerOptions.textColorCenter = textColorCenter;
return this;
}
/**
* Set the textColor of outside item.
*
* @param textColorOut color resId.
*/
public HCustomPickerBuilder setTextColorOut(int textColorOut) {
mPickerOptions.textColorOut = textColorOut;
return this;
}
public HCustomPickerBuilder setTypeface(Typeface font) {
mPickerOptions.font = font;
return this;
}
public HCustomPickerBuilder setCyclic(boolean cyclic1, boolean cyclic2, boolean cyclic3) {
mPickerOptions.cyclic1 = cyclic1;
mPickerOptions.cyclic2 = cyclic2;
mPickerOptions.cyclic3 = cyclic3;
return this;
}
public HCustomPickerBuilder setSelectOptions(int option1) {
mPickerOptions.option1 = option1;
return this;
}
public HCustomPickerBuilder setSelectOptions(int option1, int option2) {
mPickerOptions.option1 = option1;
mPickerOptions.option2 = option2;
return this;
}
public HCustomPickerBuilder setSelectOptions(int option1, int option2, int option3) {
mPickerOptions.option1 = option1;
mPickerOptions.option2 = option2;
mPickerOptions.option3 = option3;
return this;
}
public HCustomPickerBuilder setTextXOffset(int xoffset_one, int xoffset_two, int xoffset_three) {
mPickerOptions.x_offset_one = xoffset_one;
mPickerOptions.x_offset_two = xoffset_two;
mPickerOptions.x_offset_three = xoffset_three;
return this;
}
public HCustomPickerBuilder isCenterLabel(boolean isCenterLabel) {
mPickerOptions.isCenterLabel = isCenterLabel;
return this;
}
/**
* 切换选项时是否还原第一项
*
* @param isRestoreItem true还原 false: 保持上一个选项
* @return TimePickerBuilder
*/
public HCustomPickerBuilder isRestoreItem(boolean isRestoreItem) {
mPickerOptions.isRestoreItem = isRestoreItem;
return this;
}
/**
* @param listener 切换item项滚动停止时实时回调监听
* @return
*/
public HCustomPickerBuilder setOptionsSelectChangeListener(OnOptionsSelectChangeListener listener) {
mPickerOptions.optionsSelectChangeListener = listener;
return this;
}
public <T> HCustomPickerView<T> build() {
return new HCustomPickerView<>(mPickerOptions);
}
public HCustomPickerBuilder setDialog(int i, int i1) {
return null;
}
}

View File

@ -1,187 +0,0 @@
package com.sucstepsoft.cm_utils.core.widget.views;
import android.content.Context;
import android.text.TextUtils;
import android.view.LayoutInflater;
import android.view.View;
import android.widget.Button;
import android.widget.LinearLayout;
import android.widget.RelativeLayout;
import android.widget.TextView;
import com.bigkoo.pickerview.configure.PickerOptions;
import com.bigkoo.pickerview.view.WheelOptions;
import com.sucstepsoft.cm_utils.R;
import java.util.List;
public class HCustomPickerView<T> extends BaseCustomHPickerView implements View.OnClickListener {
private WheelOptions wheelOptions;
private static final String TAG_SUBMIT = "submit";
private static final String TAG_CANCEL = "cancel";
public HCustomPickerView(PickerOptions pickerOptions) {
super(pickerOptions.context);
mPickerOptions = pickerOptions;
initView(pickerOptions.context);
}
private void initView(Context context) {
setDialogOutSideCancelable();
initViews();
initAnim();
initEvents();
if (mPickerOptions.customListener == null) {
LayoutInflater.from(context).inflate(mPickerOptions.layoutRes, contentContainer);
//顶部标题
TextView tvTitle = (TextView) findViewById(R.id.tvTitle);
RelativeLayout rv_top_bar = (RelativeLayout) findViewById(R.id.rv_topbar);
//确定和取消按钮
Button btnSubmit = (Button) findViewById(R.id.btnSubmit);
Button btnCancel = (Button) findViewById(R.id.btnCancel);
btnSubmit.setTag(TAG_SUBMIT);
btnCancel.setTag(TAG_CANCEL);
btnSubmit.setOnClickListener(this);
btnCancel.setOnClickListener(this);
//设置文字
btnSubmit.setText(TextUtils.isEmpty(mPickerOptions.textContentConfirm) ? context.getResources().getString(R.string.pickerview_submit) : mPickerOptions.textContentConfirm);
btnCancel.setText(TextUtils.isEmpty(mPickerOptions.textContentCancel) ? context.getResources().getString(R.string.pickerview_cancel) : mPickerOptions.textContentCancel);
tvTitle.setText(TextUtils.isEmpty(mPickerOptions.textContentTitle) ? "" : mPickerOptions.textContentTitle);//默认为空
//设置color
btnSubmit.setTextColor(mPickerOptions.textColorConfirm);
btnCancel.setTextColor(mPickerOptions.textColorCancel);
tvTitle.setTextColor(mPickerOptions.textColorTitle);
rv_top_bar.setBackgroundColor(mPickerOptions.bgColorTitle);
//设置文字大小
btnSubmit.setTextSize(mPickerOptions.textSizeSubmitCancel);
btnCancel.setTextSize(mPickerOptions.textSizeSubmitCancel);
tvTitle.setTextSize(mPickerOptions.textSizeTitle);
} else {
mPickerOptions.customListener.customLayout(LayoutInflater.from(context).inflate(mPickerOptions.layoutRes, contentContainer));
}
// ----滚轮布局
final LinearLayout optionsPicker = (LinearLayout) findViewById(R.id.optionspicker);
optionsPicker.setBackgroundColor(mPickerOptions.bgColorWheel);
wheelOptions = new WheelOptions(optionsPicker, mPickerOptions.isRestoreItem);
if (mPickerOptions.optionsSelectChangeListener != null) {
wheelOptions.setOptionsSelectChangeListener(mPickerOptions.optionsSelectChangeListener);
}
wheelOptions.setTextContentSize(mPickerOptions.textSizeContent);
wheelOptions.setLabels(mPickerOptions.label1, mPickerOptions.label2, mPickerOptions.label3);
wheelOptions.setTextXOffset(mPickerOptions.x_offset_one, mPickerOptions.x_offset_two, mPickerOptions.x_offset_three);
wheelOptions.setCyclic(mPickerOptions.cyclic1, mPickerOptions.cyclic2, mPickerOptions.cyclic3);
wheelOptions.setTypeface(mPickerOptions.font);
setOutSideCancelable(mPickerOptions.cancelable);
wheelOptions.setDividerColor(mPickerOptions.dividerColor);
// wheelOptions.setDividerType(mPickerOptions.dividerType);
wheelOptions.setLineSpacingMultiplier(mPickerOptions.lineSpacingMultiplier);
wheelOptions.setTextColorOut(mPickerOptions.textColorOut);
wheelOptions.setTextColorCenter(mPickerOptions.textColorCenter);
wheelOptions.isCenterLabel(mPickerOptions.isCenterLabel);
}
/**
* 动态设置标题
*
* @param text 标题文本内容
*/
public void setTitleText(String text) {
TextView tvTitle = (TextView) findViewById(R.id.tvTitle);
if (tvTitle != null) {
tvTitle.setText(text);
}
}
/**
* 设置默认选中项
*
* @param option1
*/
public void setSelectOptions(int option1) {
mPickerOptions.option1 = option1;
reSetCurrentItems();
}
public void setSelectOptions(int option1, int option2) {
mPickerOptions.option1 = option1;
mPickerOptions.option2 = option2;
reSetCurrentItems();
}
public void setSelectOptions(int option1, int option2, int option3) {
mPickerOptions.option1 = option1;
mPickerOptions.option2 = option2;
mPickerOptions.option3 = option3;
reSetCurrentItems();
}
private void reSetCurrentItems() {
if (wheelOptions != null) {
wheelOptions.setCurrentItems(mPickerOptions.option1, mPickerOptions.option2, mPickerOptions.option3);
}
}
public void setPicker(List<T> optionsItems) {
this.setPicker(optionsItems, null, null);
}
public void setPicker(List<T> options1Items, List<List<T>> options2Items) {
this.setPicker(options1Items, options2Items, null);
}
public void setPicker(List<T> options1Items,
List<List<T>> options2Items,
List<List<List<T>>> options3Items) {
wheelOptions.setPicker(options1Items, options2Items, options3Items);
reSetCurrentItems();
}
//不联动情况下调用
public void setNPicker(List<T> options1Items,
List<T> options2Items,
List<T> options3Items) {
wheelOptions.setLinkage(false);
wheelOptions.setNPicker(options1Items, options2Items, options3Items);
reSetCurrentItems();
}
@Override
public void onClick(View v) {
String tag = (String) v.getTag();
if (tag.equals(TAG_SUBMIT)) {
returnData();
}
dismiss();
}
//抽离接口回调的方法
public void returnData() {
if (mPickerOptions.optionsSelectListener != null) {
int[] optionsCurrentItems = wheelOptions.getCurrentItems();
mPickerOptions.optionsSelectListener.onOptionsSelect(optionsCurrentItems[0], optionsCurrentItems[1], optionsCurrentItems[2], clickView);
}
}
@Override
public boolean isDialog() {
return mPickerOptions.isDialog;
}
}

Binary file not shown.

After

Width:  |  Height:  |  Size: 869 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 900 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 198 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 425 B

View File

@ -0,0 +1,5 @@
<?xml version="1.0" encoding="utf-8"?>
<selector xmlns:android="http://schemas.android.com/apk/res/android">
<item android:drawable="@drawable/ic_cb_unchecked" android:state_checked="false" />
<item android:drawable="@drawable/ic_cb_checked" android:state_checked="true" />
</selector>

View File

@ -19,8 +19,8 @@
<ProgressBar
android:id="@+id/pb_load"
android:layout_width="65dp"
android:layout_height="65dp"
android:layout_width="40dp"
android:layout_height="40dp"
android:layout_centerInParent="true"
android:indeterminateBehavior="repeat"
android:indeterminateDrawable="@drawable/anim_loading" />
@ -32,7 +32,7 @@
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="center_horizontal"
android:layout_marginTop="5dp"
android:layout_marginTop="10dp"
android:layout_marginBottom="5dp"
android:textColor="@color/white"
android:textSize="15sp"

View File

@ -62,7 +62,7 @@ dependencies {
//butterknife
annotationProcessor "com.jakewharton:butterknife-compiler:${rootProject.ext.gButterKnifeVersion}"
//
implementation "com.contrarywind:Android-PickerView:${rootProject.ext.pickerViewVersion}"
implementation "com.contrarywind:Android-PickerView:${rootProject.ext.gPickerViewVersion}"
implementation "com.contrarywind:wheelview:${rootProject.ext.wheelVersion}"
//gson
implementation "com.google.code.gson:gson:${rootProject.ext.supportGson}"

View File

@ -66,7 +66,7 @@ dependencies {
//butterknife
annotationProcessor "com.jakewharton:butterknife-compiler:${rootProject.ext.gButterKnifeVersion}"
//
implementation "com.contrarywind:Android-PickerView:${rootProject.ext.pickerViewVersion}"
implementation "com.contrarywind:Android-PickerView:${rootProject.ext.gPickerViewVersion}"
implementation "com.contrarywind:wheelview:${rootProject.ext.wheelVersion}"
//gson
implementation "com.google.code.gson:gson:${rootProject.ext.supportGson}"

View File

@ -72,7 +72,7 @@ dependencies {
//butterknife
annotationProcessor "com.jakewharton:butterknife-compiler:${rootProject.ext.gButterKnifeVersion}"
//
implementation "com.contrarywind:Android-PickerView:${rootProject.ext.pickerViewVersion}"
implementation "com.contrarywind:Android-PickerView:${rootProject.ext.gPickerViewVersion}"
//gson
implementation "com.google.code.gson:gson:${rootProject.ext.supportGson}"
//glide

View File

@ -63,7 +63,7 @@ dependencies {
//butterknife
annotationProcessor "com.jakewharton:butterknife-compiler:${rootProject.ext.gButterKnifeVersion}"
//
implementation "com.contrarywind:Android-PickerView:${rootProject.ext.pickerViewVersion}"
implementation "com.contrarywind:Android-PickerView:${rootProject.ext.gPickerViewVersion}"
//gson
implementation "com.google.code.gson:gson:${rootProject.ext.supportGson}"
//glide

View File

@ -58,7 +58,7 @@ dependencies {
//butterknife
annotationProcessor "com.jakewharton:butterknife-compiler:${rootProject.ext.gButterKnifeVersion}"
//
implementation "com.contrarywind:Android-PickerView:${rootProject.ext.pickerViewVersion}"
implementation "com.contrarywind:Android-PickerView:${rootProject.ext.gPickerViewVersion}"
implementation "com.contrarywind:wheelview:${rootProject.ext.wheelVersion}"
//gson
implementation "com.google.code.gson:gson:${rootProject.ext.supportGson}"

View File

@ -78,8 +78,18 @@ public class MineMainFragment extends BaseFragment {
TypeFaceTextView mTvNickName;
private Unbinder mBind;
private List<FuncBean> mFuncBeans = new ArrayList<>();
private String[] mTitles = new String[]{"我的分享", "我的活动", "我的志愿团队", "我的志愿活动", "我的订单", "我的收藏", "设置"};
private int[] mIcons = new int[]{R.drawable.ic_mine_activity, R.drawable.ic_mine_activity, R.drawable.ic_mine_team, R.drawable.ic_mine_order_icon, R.drawable.ic_mine_order, R.drawable.ic_mine_collect_icon, R.drawable.ic_mine_setting_icon};
private String[] mTitles = new String[]{"我的分享", "我的活动", "我的志愿团队", "我的志愿活动", "我的场馆订单", "我的收藏", "收货地址", "购物车",
"我的商城订单", "设置"};
private int[] mIcons = new int[]{R.drawable.ic_mine_activity,
R.drawable.ic_mine_activity,
R.drawable.ic_mine_team,
R.drawable.ic_mine_order_icon,
R.drawable.ic_mine_order,
R.drawable.ic_mine_collect_icon,
R.drawable.ic_mine_shop_address,
R.drawable.ic_mine_shipping_car,
R.drawable.ic_mine_order_list,
R.drawable.ic_mine_setting_icon};
@Override
protected void setDataToView(View dataView) {
@ -163,6 +173,15 @@ public class MineMainFragment extends BaseFragment {
case "我的分享":
pagePath = PathConfig.PATH_MODULE_CULTURAL_ACTIVITY_SHARE_MINE_LIST;
break;
case "收货地址":
pagePath= PathConfig.PATH_MODULE_SHOP_ACTIVITY_SHOP_ADDRESS;
break;
case "购物车":
pagePath=PathConfig.PATH_MODULE_SHOP_ACTIVITY_SHOP_CAR;
break;
case "我的商城订单":
pagePath=PathConfig.PATH_MODULE_SHOP_ACTIVITY_SHOP_MINE_ORDER;
break;
}
ARouter.getInstance()
.build(pagePath).navigation();
@ -176,7 +195,8 @@ public class MineMainFragment extends BaseFragment {
private String mPhotoPath;
private void checkPhotoPermission() {
PermissionUtils.permission(PermissionConstants.CAMERA, PermissionConstants.STORAGE, PermissionConstants.MICROPHONE)
PermissionUtils.permission(PermissionConstants.CAMERA, PermissionConstants.STORAGE,
PermissionConstants.MICROPHONE)
.callback(new PermissionUtils.SimpleCallback() {
@Override
public void onGranted() {
@ -285,7 +305,8 @@ public class MineMainFragment extends BaseFragment {
@Override
public void onSuccess(File file) {
RequestBody requestFile = RequestBody.create(MediaType.parse("multipart/form-data"), file);
MultipartBody.Part body = MultipartBody.Part.createFormData("image", file.getName(), requestFile);
MultipartBody.Part body = MultipartBody.Part.createFormData("image", file.getName(),
requestFile);
RetrofitManager.getInstance()
.create(BaseApiService.class)
.uploadImgToUserCenter(body, UserLgUtils.getToken())

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.1 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.5 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.3 KiB

View File

@ -55,7 +55,7 @@ dependencies {
//butterknife
annotationProcessor "com.jakewharton:butterknife-compiler:${rootProject.ext.gButterKnifeVersion}"
//
implementation "com.contrarywind:Android-PickerView:${rootProject.ext.pickerViewVersion}"
implementation "com.contrarywind:Android-PickerView:${rootProject.ext.gPickerViewVersion}"
//gson
implementation "com.google.code.gson:gson:${rootProject.ext.supportGson}"
//glide

View File

@ -60,7 +60,7 @@ dependencies {
//butterknife
annotationProcessor "com.jakewharton:butterknife-compiler:${rootProject.ext.gButterKnifeVersion}"
//
implementation "com.contrarywind:Android-PickerView:${rootProject.ext.pickerViewVersion}"
implementation "com.contrarywind:Android-PickerView:${rootProject.ext.gPickerViewVersion}"
//gson
implementation "com.google.code.gson:gson:${rootProject.ext.supportGson}"
//glide

View File

@ -1,24 +1,45 @@
<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="com.tengshisoft.moduleshop">
package="com.tenlionsoft.moduleshop">
<application>
<activity
android:name="com.tenlionsoft.moduleshop.activitys.ShopCarActivity"
android:name=".activitys.ShopAddAddressActivity"
android:exported="false">
<meta-data
android:name="android.app.lib_name"
android:value="" />
</activity>
<activity
android:name="com.tenlionsoft.moduleshop.activitys.GoodsListActivity"
android:name=".activitys.ShippingAddressActivity"
android:exported="false">
<meta-data
android:name="android.app.lib_name"
android:value="" />
</activity>
<activity
android:name="com.tenlionsoft.moduleshop.activitys.GoodsDetailActivity"
android:name=".activitys.OrderConfirmActivity"
android:exported="false">
<meta-data
android:name="android.app.lib_name"
android:value="" />
</activity>
<activity
android:name=".activitys.ShopCarActivity"
android:exported="false">
<meta-data
android:name="android.app.lib_name"
android:value="" />
</activity>
<activity
android:name=".activitys.GoodsListActivity"
android:exported="false">
<meta-data
android:name="android.app.lib_name"
android:value="" />
</activity>
<activity
android:name=".activitys.GoodsDetailActivity"
android:configChanges="keyboardHidden|orientation|screenSize|screenLayout"
android:exported="false"
android:screenOrientation="portrait"

View File

@ -50,8 +50,8 @@ import com.tengshisoft.moduleijkplayer.controller.TitleView;
import com.tengshisoft.moduleijkplayer.controller.VodControlView;
import com.tengshisoft.moduleijkplayer.player.VideoView;
import com.tengshisoft.moduleijkplayer.util.L;
import com.tengshisoft.moduleshop.R;
import com.tengshisoft.moduleshop.R2;
import com.tenlionsoft.moduleshop.R;
import com.tenlionsoft.moduleshop.R2;
import com.tenlionsoft.moduleshop.adapter.GoodsStandardAdapter;
import com.tenlionsoft.moduleshop.beans.GoodsStandardBean;
import com.tenlionsoft.moduleshop.beans.ShopGoodsDetailBean;

View File

@ -19,8 +19,8 @@ import com.sucstepsoft.cm_utils.core.retrofit_net.RetrofitManager;
import com.sucstepsoft.cm_utils.core.widget.base.BaseActivity;
import com.sucstepsoft.cm_utils.core.widget.views.TypeFaceTextView;
import com.sucstepsoft.cm_utils.utils.ExceptionHandler;
import com.tengshisoft.moduleshop.R;
import com.tengshisoft.moduleshop.R2;
import com.tenlionsoft.moduleshop.R;
import com.tenlionsoft.moduleshop.R2;
import com.tenlionsoft.moduleshop.adapter.ShopGoodsAdapter;
import com.tenlionsoft.moduleshop.beans.GoodsListBean;
import com.tenlionsoft.moduleshop.net.ShopApi;

View File

@ -0,0 +1,179 @@
package com.tenlionsoft.moduleshop.activitys;
import android.content.Intent;
import android.text.TextUtils;
import android.widget.LinearLayout;
import androidx.annotation.Nullable;
import androidx.recyclerview.widget.LinearLayoutManager;
import androidx.recyclerview.widget.RecyclerView;
import com.alibaba.android.arouter.facade.annotation.Route;
import com.alibaba.android.arouter.launcher.ARouter;
import com.google.gson.Gson;
import com.google.gson.reflect.TypeToken;
import com.sucstepsoft.cm_utils.constant.PathConfig;
import com.sucstepsoft.cm_utils.core.retrofit_net.RetrofitManager;
import com.sucstepsoft.cm_utils.core.widget.base.BaseActivity;
import com.sucstepsoft.cm_utils.core.widget.views.TypeFaceTextView;
import com.sucstepsoft.cm_utils.utils.ExceptionHandler;
import com.sucstepsoft.cm_utils.utils.LogUtils;
import com.sucstepsoft.cm_utils.utils.UserLgUtils;
import com.tenlionsoft.moduleshop.R;
import com.tenlionsoft.moduleshop.R2;
import com.tenlionsoft.moduleshop.adapter.OrderConfirmGoodsAdapter;
import com.tenlionsoft.moduleshop.beans.ShippingAddressBean;
import com.tenlionsoft.moduleshop.beans.ShopGoodsDetailBean;
import com.tenlionsoft.moduleshop.net.ShopApi;
import java.lang.reflect.Type;
import java.util.ArrayList;
import java.util.List;
import butterknife.BindView;
import butterknife.ButterKnife;
import io.reactivex.Observer;
import io.reactivex.android.schedulers.AndroidSchedulers;
import io.reactivex.disposables.Disposable;
import io.reactivex.schedulers.Schedulers;
/**
* 结算页面
*/
@Route(path = PathConfig.PATH_MODULE_SHOP_ACTIVITY_SHOP_ORDER_CONFIRM)
public class OrderConfirmActivity extends BaseActivity {
@BindView(R2.id.tv_address_area)
TypeFaceTextView mTvAddressArea;
@BindView(R2.id.tv_address_content)
TypeFaceTextView mTvAddressContent;
@BindView(R2.id.tv_name)
TypeFaceTextView mTvName;
@BindView(R2.id.rlv_goods)
RecyclerView mRlvGoods;
@BindView(R2.id.tv_price)
TypeFaceTextView mTvPrice;
@BindView(R2.id.tv_confirm)
TypeFaceTextView mTvConfirm;
@BindView(R2.id.ll_choose_address)
LinearLayout mLlChooseAddress;
private List<ShopGoodsDetailBean> mCarDatas = new ArrayList<>();
private List<ShopGoodsDetailBean> mDatas = new ArrayList<>();
private OrderConfirmGoodsAdapter mAdapter;
private ShippingAddressBean mAddressBean;
@Override
protected int setLayoutId() {
return R.layout.activity_order_confirm;
}
@Override
public void initData() {
ButterKnife.bind(this);
mTvBaseTitle.setText("订单确认");
mAdapter = new OrderConfirmGoodsAdapter(mActivity, mDatas);
mRlvGoods.setLayoutManager(new LinearLayoutManager(mActivity));
mRlvGoods.setAdapter(mAdapter);
mLlChooseAddress.setOnClickListener(v -> ARouter.getInstance()
.build(PathConfig.PATH_MODULE_SHOP_ACTIVITY_SHOP_ADDRESS)
.withInt("type", 1)//选择地址
.navigation(mActivity, 13));
getDefaultAddress();
parserShopCar();
}
/**
* 获取默认地址
*/
private void getDefaultAddress() {
RetrofitManager.getInstance()
.create(ShopApi.class)
.getDefaultAddress(UserLgUtils.getToken())
.subscribeOn(Schedulers.io())
.observeOn(AndroidSchedulers.mainThread())
.subscribe(new Observer<ShippingAddressBean>() {
@Override
public void onSubscribe(Disposable d) {
}
@Override
public void onNext(ShippingAddressBean shippingAddressBean) {
setAddress(shippingAddressBean);
}
@Override
public void onError(Throwable e) {
ExceptionHandler.handleException(e);
e.printStackTrace();
refreshView(STATE_LOAD_ERROR);
}
@Override
public void onComplete() {
}
});
}
private void setAddress(ShippingAddressBean b) {
refreshView(STATE_LOAD_SUCCESS);
mAddressBean = b;
mTvAddressArea.setText(b.getAreaName());
mTvAddressContent.setText(b.getShopAddressContent());
mTvName.setText(b.getShopAddressName() + " " + b.getShopAddressPhone());
}
private void parserShopCar() {
try {
String shopCar = UserLgUtils.getShopCar();
if (!TextUtils.isEmpty(shopCar)) {
Gson gson = new Gson();
Type type = new TypeToken<List<ShopGoodsDetailBean>>() {
}.getType();
mCarDatas = gson.fromJson(shopCar, type);
LogUtils.e("购物车数据===" + mCarDatas);
if (mCarDatas != null && mCarDatas.size() > 0) {
for (int i = 0; i < mCarDatas.size(); i++) {
ShopGoodsDetailBean bean = mCarDatas.get(i);
if (bean.isCheck()) {
mDatas.add(bean);
}
}
countPrice();
mAdapter.setData(mDatas);
} else {
refreshView(STATE_LOAD_ERROR);
mTvErrorHint.setText("系统错误,请重新提交");
}
} else {
refreshView(STATE_LOAD_ERROR);
mTvErrorHint.setText("系统错误,请重新提交");
}
} catch (Exception e) {
e.printStackTrace();
}
}
/**
* 计算总价
*/
private void countPrice() {
double price = 0.0;
for (int i = 0; i < mDatas.size(); i++) {
price += (mDatas.get(i).getCarAmount() * mDatas.get(i).getGoodsPrice());
}
mTvPrice.setText(price + "");
}
@Override
protected void onActivityResult(int requestCode, int resultCode, @Nullable Intent data) {
super.onActivityResult(requestCode, resultCode, data);
if (requestCode == 13) {
if (resultCode == RESULT_OK) {
ShippingAddressBean addressBean = (ShippingAddressBean) data.getSerializableExtra("bean");
LogUtils.e(addressBean);
setAddress(addressBean);
}
}
}
}

View File

@ -0,0 +1,193 @@
package com.tenlionsoft.moduleshop.activitys;
import android.app.ProgressDialog;
import android.content.Intent;
import android.view.View;
import android.widget.LinearLayout;
import androidx.annotation.Nullable;
import androidx.recyclerview.widget.LinearLayoutManager;
import androidx.recyclerview.widget.RecyclerView;
import com.alibaba.android.arouter.facade.annotation.Route;
import com.alibaba.android.arouter.launcher.ARouter;
import com.sucstepsoft.cm_utils.constant.PathConfig;
import com.sucstepsoft.cm_utils.core.beans.BaseSuccessBean;
import com.sucstepsoft.cm_utils.core.retrofit_net.RetrofitManager;
import com.sucstepsoft.cm_utils.core.widget.base.BaseActivity;
import com.sucstepsoft.cm_utils.utils.ExceptionHandler;
import com.sucstepsoft.cm_utils.utils.UIUtil;
import com.sucstepsoft.cm_utils.utils.UserLgUtils;
import com.sucstepsoft.cm_utils.utils.toast.ToastUtils;
import com.tenlionsoft.moduleshop.R;
import com.tenlionsoft.moduleshop.R2;
import com.tenlionsoft.moduleshop.adapter.ShippingAddressAdapter;
import com.tenlionsoft.moduleshop.beans.ShippingAddressBean;
import com.tenlionsoft.moduleshop.net.ShopApi;
import java.util.ArrayList;
import java.util.List;
import butterknife.BindView;
import butterknife.ButterKnife;
import io.reactivex.Observer;
import io.reactivex.android.schedulers.AndroidSchedulers;
import io.reactivex.disposables.Disposable;
import io.reactivex.schedulers.Schedulers;
/**
* 收货地址
*/
@Route(path = PathConfig.PATH_MODULE_SHOP_ACTIVITY_SHOP_ADDRESS)
public class ShippingAddressActivity extends BaseActivity {
@BindView(R2.id.ll_empty_h)
LinearLayout mLlEmptyH;
@BindView(R2.id.rlv_address)
RecyclerView mRlvAddress;
@BindView(R2.id.ll_add_address)
LinearLayout mLlAddAddress;
private int mType;//1选择 2查看
private List<ShippingAddressBean> mDatas = new ArrayList<>();
private ShippingAddressAdapter mAdapter;
private ShippingAddressBean mCurrentBean;
@Override
protected int setLayoutId() {
return R.layout.activity_shipping_address;
}
@Override
public void initData() {
ButterKnife.bind(this);
mTvBaseTitle.setText("收货地址");
refreshView(STATE_LOAD_SUCCESS);
mType = getIntent().getIntExtra("type", 2);
mAdapter = new ShippingAddressAdapter(mActivity, mDatas);
mRlvAddress.setLayoutManager(new LinearLayoutManager(mActivity));
mRlvAddress.setAdapter(mAdapter);
mLlAddAddress.setOnClickListener(v -> ARouter.getInstance()
.build(PathConfig.PATH_MODULE_SHOP_ACTIVITY_SHOP_ADD_ADDRESS)
.navigation(mActivity, 12));
if (mType == 1) {
mTvPublish.setVisibility(View.VISIBLE);
mTvPublish.setText("确定");
mTvPublish.setOnClickListener(v -> {
Intent intent = new Intent();
intent.putExtra("bean", mCurrentBean);
setResult(RESULT_OK, intent);
finish();
});
} else {
mTvPublish.setVisibility(View.GONE);
}
//选择
mAdapter.addOnItemSelectListener((b, i) -> setAddressDefault(b));
//
mAdapter.addOnEditListener((b, i) -> ARouter.getInstance()
.build(PathConfig.PATH_MODULE_SHOP_ACTIVITY_SHOP_ADD_ADDRESS)
.withSerializable("bean", mCurrentBean)
.withInt("type", 3)
.navigation(mActivity, 12));
getAddressList();
}
/**
* 设置默认地址
*/
private void setAddressDefault(ShippingAddressBean b) {
ProgressDialog dialog = UIUtil.initDialog(mActivity, "设置中...");
dialog.show();
RetrofitManager.getInstance()
.create(ShopApi.class)
.doSetDefaultAddress(b.getShopAddressId(), UserLgUtils.getToken())
.subscribeOn(Schedulers.io())
.observeOn(AndroidSchedulers.mainThread())
.subscribe(new Observer<BaseSuccessBean>() {
@Override
public void onSubscribe(Disposable d) {
}
@Override
public void onNext(BaseSuccessBean baseSuccessBean) {
dialog.dismiss();
ToastUtils.show("设置成功");
getAddressList();
}
@Override
public void onError(Throwable e) {
dialog.dismiss();
ExceptionHandler.handleException(e);
}
@Override
public void onComplete() {
}
});
}
/**
* 获取地址列表
*/
private void getAddressList() {
ProgressDialog dialog = UIUtil.initDialog(mActivity, "加载中...");
dialog.show();
RetrofitManager.getInstance()
.create(ShopApi.class)
.getShippingAddressList(UserLgUtils.getToken())
.subscribeOn(Schedulers.io())
.observeOn(AndroidSchedulers.mainThread())
.subscribe(new Observer<List<ShippingAddressBean>>() {
@Override
public void onSubscribe(Disposable d) {
}
@Override
public void onNext(List<ShippingAddressBean> shippingAddressBeans) {
dialog.dismiss();
if (shippingAddressBeans.size() > 0) {
mDatas = shippingAddressBeans;
mLlEmptyH.setVisibility(View.GONE);
mRlvAddress.setVisibility(View.VISIBLE);
for (int i = 0; i < mDatas.size(); i++) {
ShippingAddressBean bean = mDatas.get(i);
if ("1".equals(bean.getShopAddressDefault())) {
mCurrentBean = bean;
break;
}
}
mAdapter.setData(mDatas);
} else {
mLlEmptyH.setVisibility(View.VISIBLE);
mRlvAddress.setVisibility(View.GONE);
}
}
@Override
public void onError(Throwable e) {
dialog.dismiss();
ExceptionHandler.handleException(e);
refreshView(STATE_LOAD_ERROR);
}
@Override
public void onComplete() {
}
});
}
@Override
protected void onActivityResult(int requestCode, int resultCode, @Nullable Intent data) {
super.onActivityResult(requestCode, resultCode, data);
if (requestCode == 12) {
if (resultCode == RESULT_OK) {
getAddressList();
}
}
}
}

View File

@ -0,0 +1,578 @@
package com.tenlionsoft.moduleshop.activitys;
import android.app.ProgressDialog;
import android.graphics.Color;
import android.text.TextUtils;
import android.widget.EditText;
import android.widget.LinearLayout;
import com.alibaba.android.arouter.facade.annotation.Route;
import com.bigkoo.pickerview.builder.OptionsPickerBuilder;
import com.bigkoo.pickerview.view.OptionsPickerView;
import com.google.gson.Gson;
import com.sucstepsoft.cm_utils.constant.PathConfig;
import com.sucstepsoft.cm_utils.core.beans.AreaBean;
import com.sucstepsoft.cm_utils.core.beans.BaseSuccessBean;
import com.sucstepsoft.cm_utils.core.retrofit_net.RetrofitManager;
import com.sucstepsoft.cm_utils.core.retrofit_net.api.BaseApiService;
import com.sucstepsoft.cm_utils.core.widget.base.BaseActivity;
import com.sucstepsoft.cm_utils.core.widget.views.TypeFaceTextView;
import com.sucstepsoft.cm_utils.utils.ExceptionHandler;
import com.sucstepsoft.cm_utils.utils.UIUtil;
import com.sucstepsoft.cm_utils.utils.UserLgUtils;
import com.sucstepsoft.cm_utils.utils.toast.ToastUtils;
import com.tenlionsoft.moduleshop.R;
import com.tenlionsoft.moduleshop.R2;
import com.tenlionsoft.moduleshop.beans.SaveAddressBean;
import com.tenlionsoft.moduleshop.beans.ShippingAddressBean;
import com.tenlionsoft.moduleshop.net.ShopApi;
import java.util.List;
import butterknife.BindView;
import butterknife.ButterKnife;
import io.reactivex.Observer;
import io.reactivex.android.schedulers.AndroidSchedulers;
import io.reactivex.disposables.Disposable;
import io.reactivex.schedulers.Schedulers;
import okhttp3.MediaType;
import okhttp3.RequestBody;
/**
* 添加或编辑收货地址
*/
@Route(path = PathConfig.PATH_MODULE_SHOP_ACTIVITY_SHOP_ADD_ADDRESS)
public class ShopAddAddressActivity extends BaseActivity {
@BindView(R2.id.tv_area1)
TypeFaceTextView mTvArea1;
@BindView(R2.id.tv_area2)
TypeFaceTextView mTvArea2;
@BindView(R2.id.tv_area3)
TypeFaceTextView mTvArea3;
@BindView(R2.id.tv_area4)
TypeFaceTextView mTvArea4;
@BindView(R2.id.et_detail)
EditText mEtDetail;
@BindView(R2.id.et_name)
EditText mEtName;
@BindView(R2.id.et_phone)
EditText mEtPhone;
@BindView(R2.id.et_zipcode)
EditText mEtZipCode;
@BindView(R2.id.ll_confirm)
LinearLayout mLlConfirm;
private int mType;
private ShippingAddressBean mBean;
private AreaBean mSelArea1;
private AreaBean mSelArea2;
private AreaBean mSelArea3;
private AreaBean mSelArea4;
private List<AreaBean> mArea1;
private List<AreaBean> mArea2;
private List<AreaBean> mArea3;
private List<AreaBean> mArea4;
private OptionsPickerView<AreaBean> mArea1Picker;
private OptionsPickerView<AreaBean> mArea2Picker;
private OptionsPickerView<AreaBean> mArea3Picker;
private OptionsPickerView<AreaBean> mArea4Picker;
@Override
protected int setLayoutId() {
return R.layout.activity_shop_add_address;
}
@Override
public void initData() {
ButterKnife.bind(this);
mTvBaseTitle.setText("收货地址");
refreshView(STATE_LOAD_SUCCESS);
mType = getIntent().getIntExtra("type", 2);
if (2 == mType) {
//新增
mLlConfirm.setOnClickListener(v -> doSaveAddress());
} else {
//编辑
mBean = (ShippingAddressBean) getIntent().getSerializableExtra("bean");
setDetailBean();
mLlConfirm.setOnClickListener(v -> doUpdateAddress());
}
mTvArea1.setOnClickListener(v -> onShowArea1());
mTvArea2.setOnClickListener(v -> onShowArea2());
mTvArea3.setOnClickListener(v -> onShowArea3());
mTvArea4.setOnClickListener(v -> onShowArea4());
}
private void setDetailBean() {
String[] s = mBean.getAreaName().split(" ");
mTvArea1.setText(s[0]);
mTvArea2.setText(s[1]);
mTvArea3.setText(s[2]);
mTvArea4.setText(s[3]);
mSelArea4 = new AreaBean();
mSelArea4.setAreaId(mBean.getAreaId());
mSelArea4.setAreaCode(mBean.getAreaCode());
mSelArea4.setAreaName(mBean.getAreaName());
mEtName.setText(mBean.getShopAddressName());
mEtPhone.setText(mBean.getShopAddressPhone());
mEtZipCode.setText(mBean.getShopAddressZipcode());
mEtDetail.setText(mBean.getShopAddressContent());
getArea4Detail();
}
private void getAreaList(String areaId, int type) {
ProgressDialog dialog = UIUtil.initDialog(mActivity, "加载中...");
dialog.show();
RetrofitManager.getInstance()
.create(BaseApiService.class)
.getArea(areaId)
.subscribeOn(Schedulers.io())
.observeOn(AndroidSchedulers.mainThread())
.subscribe(new Observer<List<AreaBean>>() {
@Override
public void onSubscribe(Disposable d) {
}
@Override
public void onNext(List<AreaBean> areaBeans) {
dialog.dismiss();
switch (type) {
case 1:
mArea1 = areaBeans;
onShowArea1();
break;
case 2:
mArea2 = areaBeans;
onShowArea2();
break;
case 3:
mArea3 = areaBeans;
onShowArea3();
break;
case 4:
mArea4 = areaBeans;
onShowArea4();
break;
}
}
@Override
public void onError(Throwable e) {
dialog.dismiss();
ExceptionHandler.handleException(e);
e.printStackTrace();
}
@Override
public void onComplete() {
}
});
}
private void onShowArea1() {
if (mArea1 != null && mArea1.size() > 0) {
mArea1Picker = new OptionsPickerBuilder(mActivity, (options1, options2, options3, v) -> {
mSelArea1 = mArea1.get(options1);
mTvArea1.setText(mSelArea1.getAreaName());
mArea2 = null;
mSelArea2 = null;
mTvArea2.setText("");
mArea3 = null;
mSelArea3 = null;
mTvArea3.setText("");
mArea4 = null;
mSelArea4 = null;
mTvArea4.setText("");
}).setTitleText("请选择")
.setCancelColor(Color.parseColor("#1189FF"))
.setSubmitColor(Color.parseColor("#1189FF"))
.setTitleColor(Color.parseColor("#1189FF"))
.build();
mArea1Picker.setPicker(mArea1);
mArea1Picker.show();
} else {
if (mArea1 == null) {
getAreaList("0", 1);
} else {
ToastUtils.showShort("暂无数据");
}
}
}
private void onShowArea2() {
if (mArea2 != null && mArea2.size() > 0) {
mArea2Picker = new OptionsPickerBuilder(mActivity, (options1, options2, options3, v) -> {
mSelArea2 = mArea2.get(options1);
mTvArea2.setText(mSelArea2.getAreaName());
mArea3 = null;
mSelArea3 = null;
mTvArea3.setText("");
mArea4 = null;
mSelArea4 = null;
mTvArea4.setText("");
}).setTitleText("请选择")
.setCancelColor(Color.parseColor("#1189FF"))
.setSubmitColor(Color.parseColor("#1189FF"))
.setTitleColor(Color.parseColor("#1189FF"))
.build();
mArea2Picker.setPicker(mArea2);
mArea2Picker.show();
} else {
if (mArea2 == null) {
if (mSelArea1 == null) {
ToastUtils.show("请选省份");
} else {
getAreaList(mSelArea1.getAreaId(), 2);
}
} else {
ToastUtils.showShort("暂无数据");
}
}
}
private void onShowArea3() {
if (mArea3 != null && mArea3.size() > 0) {
mArea3Picker = new OptionsPickerBuilder(mActivity, (options1, options2, options3, v) -> {
mSelArea3 = mArea3.get(options1);
mTvArea3.setText(mSelArea3.getAreaName());
mArea4 = null;
mSelArea4 = null;
mTvArea4.setText("");
}).setTitleText("请选择")
.setCancelColor(Color.parseColor("#1189FF"))
.setSubmitColor(Color.parseColor("#1189FF"))
.setTitleColor(Color.parseColor("#1189FF"))
.build();
mArea3Picker.setPicker(mArea3);
mArea3Picker.show();
} else {
if (mArea3 == null) {
if (mSelArea2 == null) {
ToastUtils.show("请选择市");
} else {
getAreaList(mSelArea2.getAreaId(), 3);
}
} else {
ToastUtils.showShort("暂无数据");
}
}
}
private void onShowArea4() {
if (mArea4 != null && mArea4.size() > 0) {
mArea4Picker = new OptionsPickerBuilder(mActivity, (options1, options2, options3, v) -> {
mSelArea4 = mArea4.get(options1);
mTvArea4.setText(mSelArea4.getAreaName());
}).setTitleText("请选择")
.setCancelColor(Color.parseColor("#1189FF"))
.setSubmitColor(Color.parseColor("#1189FF"))
.setTitleColor(Color.parseColor("#1189FF"))
.build();
mArea4Picker.setPicker(mArea4);
mArea4Picker.show();
} else {
if (mArea4 == null) {
if (mSelArea3 != null) {
getAreaList(mSelArea3.getAreaId(), 4);
} else {
ToastUtils.show("请选择县区");
}
} else {
ToastUtils.showShort("暂无数据");
}
}
}
private boolean checkParams() {
if (mSelArea1 == null) {
ToastUtils.show("请选择省份");
return false;
}
if (mSelArea2 == null) {
ToastUtils.show("请选择市");
return false;
}
if (mSelArea3 == null) {
ToastUtils.show("请选择区县");
return false;
}
if (mSelArea4 == null) {
ToastUtils.show("请选择乡镇、街道");
return false;
}
String detail = mEtDetail.getText().toString().trim();
if (TextUtils.isEmpty(detail)) {
ToastUtils.show("请输入详细地址");
return false;
}
String name = mEtName.getText().toString().trim();
if (TextUtils.isEmpty(name)) {
ToastUtils.show("请输入收货人姓名");
return false;
}
String phone = mEtPhone.getText().toString().trim();
if (TextUtils.isEmpty(phone)) {
ToastUtils.show("请输入联系方式");
return false;
}
return true;
}
private RequestBody buildParams() {
SaveAddressBean bean = new SaveAddressBean();
bean.setAreaCode(mSelArea4.getAreaCode());
bean.setAreaId(mSelArea4.getAreaId());
StringBuilder sb = new StringBuilder();
sb.append(mSelArea1.getAreaName());
sb.append(" ");
sb.append(mSelArea2.getAreaName());
sb.append(" ");
sb.append(mSelArea3.getAreaName());
sb.append(" ");
sb.append(mSelArea4.getAreaName());
bean.setAreaName(sb.toString());
String detail = mEtDetail.getText().toString().trim();
String name = mEtName.getText().toString().trim();
String phone = mEtPhone.getText().toString().trim();
bean.setShopAddressContent(detail);
bean.setShopAddressName(name);
bean.setShopAddressPhone(phone);
String zipcode = mEtZipCode.getText().toString().trim();
bean.setShopAddressZipcode(zipcode);
Gson gson = new Gson();
String obj = gson.toJson(bean);
RequestBody body = RequestBody.create(MediaType.parse("application/json; charset=utf-8"), obj);
return body;
}
/**
* 更新地址
*/
private void doUpdateAddress() {
if (checkParams()) {
ProgressDialog dialog = UIUtil.initDialog(mActivity, "保存中...");
dialog.show();
RequestBody body = buildParams();
RetrofitManager.getInstance()
.create(ShopApi.class)
.doEditAddress(body, mBean.getShopAddressId(), UserLgUtils.getToken())
.subscribeOn(Schedulers.io())
.observeOn(AndroidSchedulers.mainThread())
.subscribe(new Observer<BaseSuccessBean>() {
@Override
public void onSubscribe(Disposable d) {
}
@Override
public void onNext(BaseSuccessBean baseSuccessBean) {
dialog.dismiss();
ToastUtils.show("更新成功");
setResult(RESULT_OK);
finish();
}
@Override
public void onError(Throwable e) {
dialog.dismiss();
ExceptionHandler.handleException(e);
e.printStackTrace();
}
@Override
public void onComplete() {
}
});
}
}
/**
* 新增地址
*/
private void doSaveAddress() {
if (checkParams()) {
ProgressDialog dialog = UIUtil.initDialog(mActivity, "保存中...");
dialog.show();
RequestBody body = buildParams();
RetrofitManager.getInstance()
.create(ShopApi.class)
.doSaveAddress(body, UserLgUtils.getToken())
.subscribeOn(Schedulers.io())
.observeOn(AndroidSchedulers.mainThread())
.subscribe(new Observer<BaseSuccessBean>() {
@Override
public void onSubscribe(Disposable d) {
}
@Override
public void onNext(BaseSuccessBean baseSuccessBean) {
dialog.dismiss();
ToastUtils.show("新增成功");
setResult(RESULT_OK);
finish();
}
@Override
public void onError(Throwable e) {
dialog.dismiss();
ExceptionHandler.handleException(e);
e.printStackTrace();
}
@Override
public void onComplete() {
}
});
}
}
private void getArea1Detail(ProgressDialog dialog) {
RetrofitManager.getInstance()
.create(BaseApiService.class)
.getAreaDetail(mSelArea2.getAreaParentId())
.subscribeOn(Schedulers.io())
.observeOn(AndroidSchedulers.mainThread())
.subscribe(new Observer<AreaBean>() {
@Override
public void onSubscribe(Disposable d) {
}
@Override
public void onNext(AreaBean areaBeans) {
mSelArea1 = areaBeans;
dialog.dismiss();
}
@Override
public void onError(Throwable e) {
refreshView(STATE_LOAD_ERROR);
dialog.dismiss();
ExceptionHandler.handleException(e);
}
@Override
public void onComplete() {
}
});
}
private void getArea2Detail(ProgressDialog dialog) {
RetrofitManager.getInstance()
.create(BaseApiService.class)
.getAreaDetail(mSelArea3.getAreaParentId())
.subscribeOn(Schedulers.io())
.observeOn(AndroidSchedulers.mainThread())
.subscribe(new Observer<AreaBean>() {
@Override
public void onSubscribe(Disposable d) {
}
@Override
public void onNext(AreaBean areaBeans) {
mSelArea2 = areaBeans;
getArea1Detail(dialog);
}
@Override
public void onError(Throwable e) {
refreshView(STATE_LOAD_ERROR);
dialog.dismiss();
ExceptionHandler.handleException(e);
}
@Override
public void onComplete() {
}
});
}
private void getArea3Detail(ProgressDialog dialog) {
RetrofitManager.getInstance()
.create(BaseApiService.class)
.getAreaDetail(mSelArea4.getAreaParentId())
.subscribeOn(Schedulers.io())
.observeOn(AndroidSchedulers.mainThread())
.subscribe(new Observer<AreaBean>() {
@Override
public void onSubscribe(Disposable d) {
}
@Override
public void onNext(AreaBean areaBeans) {
mSelArea3 = areaBeans;
getArea2Detail(dialog);
}
@Override
public void onError(Throwable e) {
refreshView(STATE_LOAD_ERROR);
dialog.dismiss();
ExceptionHandler.handleException(e);
}
@Override
public void onComplete() {
}
});
}
private void getArea4Detail() {
ProgressDialog dialog = UIUtil.initDialog(mActivity, "加载中...");
dialog.show();
RetrofitManager.getInstance()
.create(BaseApiService.class)
.getAreaDetail(mSelArea4.getAreaId())
.subscribeOn(Schedulers.io())
.observeOn(AndroidSchedulers.mainThread())
.subscribe(new Observer<AreaBean>() {
@Override
public void onSubscribe(Disposable d) {
}
@Override
public void onNext(AreaBean areaBeans) {
mSelArea4 = areaBeans;
getArea3Detail(dialog);
}
@Override
public void onError(Throwable e) {
refreshView(STATE_LOAD_ERROR);
dialog.dismiss();
ExceptionHandler.handleException(e);
}
@Override
public void onComplete() {
}
});
}
}

View File

@ -11,6 +11,7 @@ import androidx.recyclerview.widget.LinearLayoutManager;
import androidx.recyclerview.widget.RecyclerView;
import com.alibaba.android.arouter.facade.annotation.Route;
import com.alibaba.android.arouter.launcher.ARouter;
import com.google.gson.Gson;
import com.google.gson.reflect.TypeToken;
import com.sucstepsoft.cm_utils.constant.PathConfig;
@ -18,10 +19,10 @@ import com.sucstepsoft.cm_utils.core.widget.base.BaseActivity;
import com.sucstepsoft.cm_utils.core.widget.views.TypeFaceTextView;
import com.sucstepsoft.cm_utils.utils.LogUtils;
import com.sucstepsoft.cm_utils.utils.UserLgUtils;
import com.tengshisoft.moduleshop.R;
import com.tengshisoft.moduleshop.R2;
import com.sucstepsoft.cm_utils.utils.toast.ToastUtils;
import com.tenlionsoft.moduleshop.R;
import com.tenlionsoft.moduleshop.R2;
import com.tenlionsoft.moduleshop.adapter.CarGoodsAdapter;
import com.tenlionsoft.moduleshop.beans.CustomCarBean;
import com.tenlionsoft.moduleshop.beans.ShopGoodsDetailBean;
import java.lang.reflect.Type;
@ -45,7 +46,6 @@ public class ShopCarActivity extends BaseActivity {
@BindView(R2.id.tv_confirm)
TypeFaceTextView mTvConfirm;
private List<ShopGoodsDetailBean> mCarDatas = new ArrayList<>();
private List<CustomCarBean> mDatas;
private CarGoodsAdapter mAdapter;
@Override
@ -57,7 +57,6 @@ public class ShopCarActivity extends BaseActivity {
public void initData() {
ButterKnife.bind(this);
mTvBaseTitle.setText("购物车");
mDatas = new ArrayList<>();
mAdapter = new CarGoodsAdapter(mActivity, mCarDatas);
mRlvCar.setLayoutManager(new LinearLayoutManager(mActivity));
mRlvCar.setAdapter(mAdapter);
@ -119,7 +118,23 @@ public class ShopCarActivity extends BaseActivity {
* 提交订单
*/
private void doSaveOrder() {
boolean flag = false;
for (int i = 0; i < mCarDatas.size(); i++) {
ShopGoodsDetailBean bean = mCarDatas.get(i);
if (bean.isCheck()) {
flag = true;
break;
}
}
if (flag) {
toSaveLocalData();
finish();
ARouter.getInstance()
.build(PathConfig.PATH_MODULE_SHOP_ACTIVITY_SHOP_ORDER_CONFIRM)
.navigation();
} else {
ToastUtils.show("请选择要购买的商品");
}
}

View File

@ -11,7 +11,7 @@ import com.bumptech.glide.request.RequestOptions;
import com.sucstepsoft.cm_utils.core.retrofit_net.BaseUrlApi;
import com.sucstepsoft.cm_utils.core.widget.base.BaseRecyclerAdapter;
import com.sucstepsoft.cm_utils.core.widget.views.AddOrDelView;
import com.tengshisoft.moduleshop.R;
import com.tenlionsoft.moduleshop.R;
import com.tenlionsoft.moduleshop.beans.ShopGoodsDetailBean;
import com.tenlionsoft.moduleshop.holder.CarGoodsHolder;

View File

@ -8,7 +8,7 @@ import android.view.ViewGroup;
import androidx.recyclerview.widget.LinearLayoutManager;
import com.sucstepsoft.cm_utils.core.widget.base.BaseRecyclerAdapter;
import com.tengshisoft.moduleshop.R;
import com.tenlionsoft.moduleshop.R;
import com.tenlionsoft.moduleshop.beans.CustomCarBean;
import com.tenlionsoft.moduleshop.beans.ShopGoodsDetailBean;
import com.tenlionsoft.moduleshop.holder.GoodsCarHolder;

View File

@ -10,7 +10,7 @@ import com.bumptech.glide.Glide;
import com.bumptech.glide.request.RequestOptions;
import com.sucstepsoft.cm_utils.core.retrofit_net.BaseUrlApi;
import com.sucstepsoft.cm_utils.core.widget.base.BaseRecyclerAdapter;
import com.tengshisoft.moduleshop.R;
import com.tenlionsoft.moduleshop.R;
import com.tenlionsoft.moduleshop.beans.GoodsStandardBean;
import com.tenlionsoft.moduleshop.holder.GoodsStandardHolder;

View File

@ -0,0 +1,84 @@
package com.tenlionsoft.moduleshop.adapter;
import android.content.Context;
import android.text.Html;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import com.bumptech.glide.Glide;
import com.bumptech.glide.request.RequestOptions;
import com.sucstepsoft.cm_utils.core.retrofit_net.BaseUrlApi;
import com.sucstepsoft.cm_utils.core.widget.base.BaseRecyclerAdapter;
import com.tenlionsoft.moduleshop.R;
import com.tenlionsoft.moduleshop.beans.ShopGoodsDetailBean;
import com.tenlionsoft.moduleshop.holder.OrderConfirmGoodsHolder;
import java.util.List;
/**
* 确认订单商品适配器
*/
public class OrderConfirmGoodsAdapter extends BaseRecyclerAdapter<ShopGoodsDetailBean, OrderConfirmGoodsHolder> {
public OrderConfirmGoodsAdapter(Context ctx, List<ShopGoodsDetailBean> list) {
super(ctx, list);
}
@Override
public OrderConfirmGoodsHolder createHolder(ViewGroup parent, int viewType) {
View view = LayoutInflater.from(mContext).inflate(R.layout.item_order_confirm_goods, parent, false);
return new OrderConfirmGoodsHolder(view);
}
@Override
public void bindHolder(OrderConfirmGoodsHolder h, int i) {
ShopGoodsDetailBean bean = mData.get(i);
h.mTvName.setText(Html.fromHtml(bean.getGoodsName()));
Glide.with(mContext)
.load(BaseUrlApi.BASE_SHOP_IMG_URL + bean.getGoodsIcon())
.apply(new RequestOptions()
.placeholder(R.drawable.ic_img_default)
.error(R.drawable.ic_img_default))
.into(h.mIvIcon);
h.mTvPrice.setText("¥ " + bean.getGoodsPrice());
h.mTvSales.setText("销量:" + bean.getGoodsSalesVolume() + "");
h.mTvFreight.setText("1".equals(bean.getGoodsNotFreight()) ? "不包邮" : "包邮");
h.mTvEvaluate.setText("评分:" + bean.getGoodStar() + "");
h.mTvGoodsStandard.setText(bean.getGoodsStandarName());
h.mTvCount.setText("数量:" + bean.getCarAmount());
}
public OnItemC mOnItemC;
public void addItemC(OnItemC c) {
this.mOnItemC = c;
}
public interface OnItemC {
void onItemC(ShopGoodsDetailBean bean, int i);
}
protected OnCheckListener mOnCheckListener;
public void addCheckListener(OnCheckListener clickLis) {
this.mOnCheckListener = clickLis;
}
public interface OnCheckListener {
void onClick(ShopGoodsDetailBean b, int i, boolean check);
}
protected OnClickLis mOnClickLis;
public void addClick(OnClickLis clickLis) {
this.mOnClickLis = clickLis;
}
public interface OnClickLis {
void onClick(ShopGoodsDetailBean b, int i);
}
}

View File

@ -0,0 +1,67 @@
package com.tenlionsoft.moduleshop.adapter;
import android.content.Context;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import com.sucstepsoft.cm_utils.core.widget.base.BaseRecyclerAdapter;
import com.tenlionsoft.moduleshop.R;
import com.tenlionsoft.moduleshop.beans.ShippingAddressBean;
import com.tenlionsoft.moduleshop.holder.ShippingAddressHolder;
import java.util.List;
/**
* 收货地址
*/
public class ShippingAddressAdapter extends BaseRecyclerAdapter<ShippingAddressBean, ShippingAddressHolder> {
public ShippingAddressAdapter(Context ctx, List<ShippingAddressBean> list) {
super(ctx, list);
}
@Override
public ShippingAddressHolder createHolder(ViewGroup parent, int viewType) {
View view = LayoutInflater.from(mContext).inflate(R.layout.item_shipping_address, parent, false);
return new ShippingAddressHolder(view);
}
@Override
public void bindHolder(ShippingAddressHolder h, int i) {
ShippingAddressBean b = mData.get(i);
h.mTvAddressArea.setText(b.getAreaName());
h.mTvAddressContent.setText(b.getShopAddressContent());
h.mTvName.setText(b.getShopAddressName() + " " + b.getShopAddressPhone());
if ("1".equals(b.getShopAddressDefault())) {
h.mIvDefault.setVisibility(View.VISIBLE);
} else {
h.mIvDefault.setVisibility(View.GONE);
}
h.mIvEdit.setOnClickListener(v -> mEditListener.onEdit(b, i));
h.mLlContent.setOnClickListener(v -> mItemSelectListener.onSelect(b, i));
}
private OnEditListener mEditListener;
public void addOnEditListener(OnEditListener listener) {
this.mEditListener = listener;
}
public interface OnEditListener {
void onEdit(ShippingAddressBean b, int i);
}
private OnItemSelectListener mItemSelectListener;
public void addOnItemSelectListener(OnItemSelectListener listener) {
this.mItemSelectListener = listener;
}
public interface OnItemSelectListener {
void onSelect(ShippingAddressBean b, int i);
}
}

View File

@ -10,7 +10,7 @@ import com.bumptech.glide.Glide;
import com.bumptech.glide.request.RequestOptions;
import com.sucstepsoft.cm_utils.core.retrofit_net.BaseUrlApi;
import com.sucstepsoft.cm_utils.core.widget.base.BaseRecyclerAdapter;
import com.tengshisoft.moduleshop.R;
import com.tenlionsoft.moduleshop.R;
import com.tenlionsoft.moduleshop.beans.GoodsListBean;
import com.tenlionsoft.moduleshop.holder.GoodsHolder;

View File

@ -9,7 +9,7 @@ import com.bumptech.glide.Glide;
import com.bumptech.glide.request.RequestOptions;
import com.sucstepsoft.cm_utils.core.retrofit_net.BaseUrlApi;
import com.sucstepsoft.cm_utils.core.widget.base.BaseRecyclerAdapter;
import com.tengshisoft.moduleshop.R;
import com.tenlionsoft.moduleshop.R;
import com.tenlionsoft.moduleshop.beans.ShopSortListBean;
import com.tenlionsoft.moduleshop.holder.ShopSortHolder;

View File

@ -8,7 +8,7 @@ import android.view.ViewGroup;
import android.widget.BaseExpandableListAdapter;
import android.widget.TextView;
import com.tengshisoft.moduleshop.R;
import com.tenlionsoft.moduleshop.R;
import com.tenlionsoft.moduleshop.beans.ShopSortListBean;
import java.util.List;

View File

@ -7,7 +7,7 @@ import android.view.View;
import android.view.ViewGroup;
import com.sucstepsoft.cm_utils.core.widget.base.BaseRecyclerAdapter;
import com.tengshisoft.moduleshop.R;
import com.tenlionsoft.moduleshop.R;
import com.tenlionsoft.moduleshop.beans.ShopSortListBean;
import com.tenlionsoft.moduleshop.holder.ShopSortOneHolder;

View File

@ -7,12 +7,8 @@ import android.view.ViewGroup;
import androidx.recyclerview.widget.GridLayoutManager;
import com.bumptech.glide.Glide;
import com.bumptech.glide.RequestBuilder;
import com.bumptech.glide.request.RequestOptions;
import com.sucstepsoft.cm_utils.core.retrofit_net.BaseUrlApi;
import com.sucstepsoft.cm_utils.core.widget.base.BaseRecyclerAdapter;
import com.tengshisoft.moduleshop.R;
import com.tenlionsoft.moduleshop.R;
import com.tenlionsoft.moduleshop.beans.ShopSortListBean;
import com.tenlionsoft.moduleshop.holder.ShopSortSecondHolder;

View File

@ -0,0 +1,790 @@
package com.tenlionsoft.moduleshop.beans;
import java.util.List;
public class OrderListBean {
private int page;
private List<RowsBean> rows;
private int total;
public int getPage() {
return page;
}
public void setPage(int page) {
this.page = page;
}
public List<RowsBean> getRows() {
return rows;
}
public void setRows(List<RowsBean> rows) {
this.rows = rows;
}
public int getTotal() {
return total;
}
public void setTotal(int total) {
this.total = total;
}
public static class RowsBean {
private int amountFinalMoney;
private int amountFinalTotalMoney;
private int amountMoney;
private String cancelData;
private String cancelDataTitle;
private String cancelRemark;
private String cancelTime;
private String cancelType;
private String chargeOrderStatus;
private String chargeOrderTime;
private String creator;
private String evaluateExpress;
private String evaluateService;
private String evaluateTime;
private String expressAddress;
private String expressAreaCode;
private String expressCompany;
private String expressCompanyName;
private int expressFinalMoney;
private int expressMoney;
private String expressName;
private String expressNo;
private String expressPhone;
private String gmtCreate;
private String gmtModified;
private int isCancel;
private int isDelete;
private String modifier;
private List<OrderDetailListBean> orderDetailList;
private String orderFinalTime;
private String orderId;
private String orderNo;
private String orderNumber;
private String orderQrcode;
private int orderStatus;
private String orderStatusMsg;
private String orderTimeStatus;
private String orderType;
private String shopId;
private String shopLogo;
private String shopName;
private String shopWords;
private String words;
public int getAmountFinalMoney() {
return amountFinalMoney;
}
public void setAmountFinalMoney(int amountFinalMoney) {
this.amountFinalMoney = amountFinalMoney;
}
public int getAmountFinalTotalMoney() {
return amountFinalTotalMoney;
}
public void setAmountFinalTotalMoney(int amountFinalTotalMoney) {
this.amountFinalTotalMoney = amountFinalTotalMoney;
}
public int getAmountMoney() {
return amountMoney;
}
public void setAmountMoney(int amountMoney) {
this.amountMoney = amountMoney;
}
public String getCancelData() {
return cancelData;
}
public void setCancelData(String cancelData) {
this.cancelData = cancelData;
}
public String getCancelDataTitle() {
return cancelDataTitle;
}
public void setCancelDataTitle(String cancelDataTitle) {
this.cancelDataTitle = cancelDataTitle;
}
public String getCancelRemark() {
return cancelRemark;
}
public void setCancelRemark(String cancelRemark) {
this.cancelRemark = cancelRemark;
}
public String getCancelTime() {
return cancelTime;
}
public void setCancelTime(String cancelTime) {
this.cancelTime = cancelTime;
}
public String getCancelType() {
return cancelType;
}
public void setCancelType(String cancelType) {
this.cancelType = cancelType;
}
public String getChargeOrderStatus() {
return chargeOrderStatus;
}
public void setChargeOrderStatus(String chargeOrderStatus) {
this.chargeOrderStatus = chargeOrderStatus;
}
public String getChargeOrderTime() {
return chargeOrderTime;
}
public void setChargeOrderTime(String chargeOrderTime) {
this.chargeOrderTime = chargeOrderTime;
}
public String getCreator() {
return creator;
}
public void setCreator(String creator) {
this.creator = creator;
}
public String getEvaluateExpress() {
return evaluateExpress;
}
public void setEvaluateExpress(String evaluateExpress) {
this.evaluateExpress = evaluateExpress;
}
public String getEvaluateService() {
return evaluateService;
}
public void setEvaluateService(String evaluateService) {
this.evaluateService = evaluateService;
}
public String getEvaluateTime() {
return evaluateTime;
}
public void setEvaluateTime(String evaluateTime) {
this.evaluateTime = evaluateTime;
}
public String getExpressAddress() {
return expressAddress;
}
public void setExpressAddress(String expressAddress) {
this.expressAddress = expressAddress;
}
public String getExpressAreaCode() {
return expressAreaCode;
}
public void setExpressAreaCode(String expressAreaCode) {
this.expressAreaCode = expressAreaCode;
}
public String getExpressCompany() {
return expressCompany;
}
public void setExpressCompany(String expressCompany) {
this.expressCompany = expressCompany;
}
public String getExpressCompanyName() {
return expressCompanyName;
}
public void setExpressCompanyName(String expressCompanyName) {
this.expressCompanyName = expressCompanyName;
}
public int getExpressFinalMoney() {
return expressFinalMoney;
}
public void setExpressFinalMoney(int expressFinalMoney) {
this.expressFinalMoney = expressFinalMoney;
}
public int getExpressMoney() {
return expressMoney;
}
public void setExpressMoney(int expressMoney) {
this.expressMoney = expressMoney;
}
public String getExpressName() {
return expressName;
}
public void setExpressName(String expressName) {
this.expressName = expressName;
}
public String getExpressNo() {
return expressNo;
}
public void setExpressNo(String expressNo) {
this.expressNo = expressNo;
}
public String getExpressPhone() {
return expressPhone;
}
public void setExpressPhone(String expressPhone) {
this.expressPhone = expressPhone;
}
public String getGmtCreate() {
return gmtCreate;
}
public void setGmtCreate(String gmtCreate) {
this.gmtCreate = gmtCreate;
}
public String getGmtModified() {
return gmtModified;
}
public void setGmtModified(String gmtModified) {
this.gmtModified = gmtModified;
}
public int getIsCancel() {
return isCancel;
}
public void setIsCancel(int isCancel) {
this.isCancel = isCancel;
}
public int getIsDelete() {
return isDelete;
}
public void setIsDelete(int isDelete) {
this.isDelete = isDelete;
}
public String getOdifier() {
return modifier;
}
public void setOdifier(String odifier) {
modifier = odifier;
}
public List<OrderDetailListBean> getOrderDetailList() {
return orderDetailList;
}
public void setOrderDetailList(List<OrderDetailListBean> orderDetailList) {
this.orderDetailList = orderDetailList;
}
public String getOrderFinalTime() {
return orderFinalTime;
}
public void setOrderFinalTime(String orderFinalTime) {
this.orderFinalTime = orderFinalTime;
}
public String getOrderId() {
return orderId;
}
public void setOrderId(String orderId) {
this.orderId = orderId;
}
public String getOrderNo() {
return orderNo;
}
public void setOrderNo(String orderNo) {
this.orderNo = orderNo;
}
public String getOrderNumber() {
return orderNumber;
}
public void setOrderNumber(String orderNumber) {
this.orderNumber = orderNumber;
}
public String getOrderQrcode() {
return orderQrcode;
}
public void setOrderQrcode(String orderQrcode) {
this.orderQrcode = orderQrcode;
}
public int getOrderStatus() {
return orderStatus;
}
public void setOrderStatus(int orderStatus) {
this.orderStatus = orderStatus;
}
public String getOrderStatusMsg() {
return orderStatusMsg;
}
public void setOrderStatusMsg(String orderStatusMsg) {
this.orderStatusMsg = orderStatusMsg;
}
public String getOrderTimeStatus() {
return orderTimeStatus;
}
public void setOrderTimeStatus(String orderTimeStatus) {
this.orderTimeStatus = orderTimeStatus;
}
public String getOrderType() {
return orderType;
}
public void setOrderType(String orderType) {
this.orderType = orderType;
}
public String getShopId() {
return shopId;
}
public void setShopId(String shopId) {
this.shopId = shopId;
}
public String getShopLogo() {
return shopLogo;
}
public void setShopLogo(String shopLogo) {
this.shopLogo = shopLogo;
}
public String getShopName() {
return shopName;
}
public void setShopName(String shopName) {
this.shopName = shopName;
}
public String getShopWords() {
return shopWords;
}
public void setShopWords(String shopWords) {
this.shopWords = shopWords;
}
public String getWords() {
return words;
}
public void setWords(String words) {
this.words = words;
}
public static class OrderDetailListBean {
private String creator;
private String gmtCreate;
private String gmtModified;
private String goodsId;
private int goodsItemCount;
private String goodsItemId;
private String goodsItemName;
private int goodsItemPrice;
private String goodsItemUnit;
private String goodsLogo;
private String goodsName;
private int isDelete;
private String isService;
private String modifier;
private String orderDetailComment;
private String orderDetailEvaluate;
private String orderDetailEvaluateTime;
private String orderDetailId;
private String orderDetailImage;
private String orderId;
private String serviceId;
private List<ServiceListBean> serviceList;
private String serviceType;
private int totalFinalPrice;
private int totalPrice;
public String getCreator() {
return creator;
}
public void setCreator(String creator) {
this.creator = creator;
}
public String getGmtCreate() {
return gmtCreate;
}
public void setGmtCreate(String gmtCreate) {
this.gmtCreate = gmtCreate;
}
public String getGmtModified() {
return gmtModified;
}
public void setGmtModified(String gmtModified) {
this.gmtModified = gmtModified;
}
public String getGoodsId() {
return goodsId;
}
public void setGoodsId(String goodsId) {
this.goodsId = goodsId;
}
public int getGoodsItemCount() {
return goodsItemCount;
}
public void setGoodsItemCount(int goodsItemCount) {
this.goodsItemCount = goodsItemCount;
}
public String getGoodsItemId() {
return goodsItemId;
}
public void setGoodsItemId(String goodsItemId) {
this.goodsItemId = goodsItemId;
}
public String getGoodsItemName() {
return goodsItemName;
}
public void setGoodsItemName(String goodsItemName) {
this.goodsItemName = goodsItemName;
}
public int getGoodsItemPrice() {
return goodsItemPrice;
}
public void setGoodsItemPrice(int goodsItemPrice) {
this.goodsItemPrice = goodsItemPrice;
}
public String getGoodsItemUnit() {
return goodsItemUnit;
}
public void setGoodsItemUnit(String goodsItemUnit) {
this.goodsItemUnit = goodsItemUnit;
}
public String getGoodsLogo() {
return goodsLogo;
}
public void setGoodsLogo(String goodsLogo) {
this.goodsLogo = goodsLogo;
}
public String getGoodsName() {
return goodsName;
}
public void setGoodsName(String goodsName) {
this.goodsName = goodsName;
}
public int getIsDelete() {
return isDelete;
}
public void setIsDelete(int isDelete) {
this.isDelete = isDelete;
}
public String getIsService() {
return isService;
}
public void setIsService(String isService) {
this.isService = isService;
}
public String getOdifier() {
return modifier;
}
public void setOdifier(String odifier) {
modifier = odifier;
}
public String getOrderDetailComment() {
return orderDetailComment;
}
public void setOrderDetailComment(String orderDetailComment) {
this.orderDetailComment = orderDetailComment;
}
public String getOrderDetailEvaluate() {
return orderDetailEvaluate;
}
public void setOrderDetailEvaluate(String orderDetailEvaluate) {
this.orderDetailEvaluate = orderDetailEvaluate;
}
public String getOrderDetailEvaluateTime() {
return orderDetailEvaluateTime;
}
public void setOrderDetailEvaluateTime(String orderDetailEvaluateTime) {
this.orderDetailEvaluateTime = orderDetailEvaluateTime;
}
public String getOrderDetailId() {
return orderDetailId;
}
public void setOrderDetailId(String orderDetailId) {
this.orderDetailId = orderDetailId;
}
public String getOrderDetailImage() {
return orderDetailImage;
}
public void setOrderDetailImage(String orderDetailImage) {
this.orderDetailImage = orderDetailImage;
}
public String getOrderId() {
return orderId;
}
public void setOrderId(String orderId) {
this.orderId = orderId;
}
public String getServiceId() {
return serviceId;
}
public void setServiceId(String serviceId) {
this.serviceId = serviceId;
}
public List<ServiceListBean> getServiceList() {
return serviceList;
}
public void setServiceList(List<ServiceListBean> serviceList) {
this.serviceList = serviceList;
}
public String getServiceType() {
return serviceType;
}
public void setServiceType(String serviceType) {
this.serviceType = serviceType;
}
public int getTotalFinalPrice() {
return totalFinalPrice;
}
public void setTotalFinalPrice(int totalFinalPrice) {
this.totalFinalPrice = totalFinalPrice;
}
public int getTotalPrice() {
return totalPrice;
}
public void setTotalPrice(int totalPrice) {
this.totalPrice = totalPrice;
}
public static class ServiceListBean {
private String checkRemark;
private String checkTime;
private String createTime;
private String orderServiceFinalTime;
private String orderServiceId;
private String orderServiceStatus;
private int price;
private String serviceType;
private String serviceTypeName;
private String statusRemark;
private String step;
private String type0Status;
private String type1Status;
private String type2Status;
private String type3Status;
public String getCheckRemark() {
return checkRemark;
}
public void setCheckRemark(String checkRemark) {
this.checkRemark = checkRemark;
}
public String getCheckTime() {
return checkTime;
}
public void setCheckTime(String checkTime) {
this.checkTime = checkTime;
}
public String getCreateTime() {
return createTime;
}
public void setCreateTime(String createTime) {
this.createTime = createTime;
}
public String getOrderServiceFinalTime() {
return orderServiceFinalTime;
}
public void setOrderServiceFinalTime(String orderServiceFinalTime) {
this.orderServiceFinalTime = orderServiceFinalTime;
}
public String getOrderServiceId() {
return orderServiceId;
}
public void setOrderServiceId(String orderServiceId) {
this.orderServiceId = orderServiceId;
}
public String getOrderServiceStatus() {
return orderServiceStatus;
}
public void setOrderServiceStatus(String orderServiceStatus) {
this.orderServiceStatus = orderServiceStatus;
}
public int getPrice() {
return price;
}
public void setPrice(int price) {
this.price = price;
}
public String getServiceType() {
return serviceType;
}
public void setServiceType(String serviceType) {
this.serviceType = serviceType;
}
public String getServiceTypeName() {
return serviceTypeName;
}
public void setServiceTypeName(String serviceTypeName) {
this.serviceTypeName = serviceTypeName;
}
public String getStatusRemark() {
return statusRemark;
}
public void setStatusRemark(String statusRemark) {
this.statusRemark = statusRemark;
}
public String getStep() {
return step;
}
public void setStep(String step) {
this.step = step;
}
public String getType0Status() {
return type0Status;
}
public void setType0Status(String type0Status) {
this.type0Status = type0Status;
}
public String getType1Status() {
return type1Status;
}
public void setType1Status(String type1Status) {
this.type1Status = type1Status;
}
public String getType2Status() {
return type2Status;
}
public void setType2Status(String type2Status) {
this.type2Status = type2Status;
}
public String getType3Status() {
return type3Status;
}
public void setType3Status(String type3Status) {
this.type3Status = type3Status;
}
}
}
}
}

View File

@ -0,0 +1,77 @@
package com.tenlionsoft.moduleshop.beans;
public class SaveAddressBean {
private String areaCode;
private String areaId;
private String areaName;
private String shopAddressContent; //地址详情
private String shopAddressDefault;//是否默认 1默认 0非默认
private String shopAddressName;//收货人姓名
private String shopAddressPhone;//收货人手机号码
private String shopAddressZipcode;//邮编
public String getAreaCode() {
return areaCode;
}
public void setAreaCode(String areaCode) {
this.areaCode = areaCode;
}
public String getAreaId() {
return areaId;
}
public void setAreaId(String areaId) {
this.areaId = areaId;
}
public String getAreaName() {
return areaName;
}
public void setAreaName(String areaName) {
this.areaName = areaName;
}
public String getShopAddressContent() {
return shopAddressContent;
}
public void setShopAddressContent(String shopAddressContent) {
this.shopAddressContent = shopAddressContent;
}
public String getShopAddressDefault() {
return shopAddressDefault;
}
public void setShopAddressDefault(String shopAddressDefault) {
this.shopAddressDefault = shopAddressDefault;
}
public String getShopAddressName() {
return shopAddressName;
}
public void setShopAddressName(String shopAddressName) {
this.shopAddressName = shopAddressName;
}
public String getShopAddressPhone() {
return shopAddressPhone;
}
public void setShopAddressPhone(String shopAddressPhone) {
this.shopAddressPhone = shopAddressPhone;
}
public String getShopAddressZipcode() {
return shopAddressZipcode;
}
public void setShopAddressZipcode(String shopAddressZipcode) {
this.shopAddressZipcode = shopAddressZipcode;
}
}

View File

@ -0,0 +1,73 @@
package com.tenlionsoft.moduleshop.beans;
import java.util.List;
public class SaveOrderBean {
private List<GoodsItemListBean> goodsItemList;
private String shopAddressId;
private String words;
public List<GoodsItemListBean> getGoodsItemList() {
return goodsItemList;
}
public void setGoodsItemList(List<GoodsItemListBean> goodsItemList) {
this.goodsItemList = goodsItemList;
}
public String getShopAddressId() {
return shopAddressId;
}
public void setShopAddressId(String shopAddressId) {
this.shopAddressId = shopAddressId;
}
public String getWords() {
return words;
}
public void setWords(String words) {
this.words = words;
}
public static class GoodsItemListBean {
private int count;
private String goodsId;
private String goodsItemId;
private int weight;
public int getCount() {
return count;
}
public void setCount(int count) {
this.count = count;
}
public String getGoodsId() {
return goodsId;
}
public void setGoodsId(String goodsId) {
this.goodsId = goodsId;
}
public String getGoodsItemId() {
return goodsItemId;
}
public void setGoodsItemId(String goodsItemId) {
this.goodsItemId = goodsItemId;
}
public int getWeight() {
return weight;
}
public void setWeight(int weight) {
this.weight = weight;
}
}
}

View File

@ -0,0 +1,133 @@
package com.tenlionsoft.moduleshop.beans;
import java.io.Serializable;
public class ShippingAddressBean implements Serializable {
private String areaCode;
private String areaId;
private String areaName;
private String creator;
private String gmtCreate;
private String gmtModified;
private int isDelete;
private String modifier;
private String shopAddressContent;
private String shopAddressDefault;
private String shopAddressId;
private String shopAddressName;
private String shopAddressPhone;
private String shopAddressZipcode;
public String getAreaCode() {
return areaCode;
}
public void setAreaCode(String areaCode) {
this.areaCode = areaCode;
}
public String getAreaId() {
return areaId;
}
public void setAreaId(String areaId) {
this.areaId = areaId;
}
public String getAreaName() {
return areaName;
}
public void setAreaName(String areaName) {
this.areaName = areaName;
}
public String getCreator() {
return creator;
}
public void setCreator(String creator) {
this.creator = creator;
}
public String getGmtCreate() {
return gmtCreate;
}
public void setGmtCreate(String gmtCreate) {
this.gmtCreate = gmtCreate;
}
public String getGmtModified() {
return gmtModified;
}
public void setGmtModified(String gmtModified) {
this.gmtModified = gmtModified;
}
public int getIsDelete() {
return isDelete;
}
public void setIsDelete(int isDelete) {
this.isDelete = isDelete;
}
public String getOdifier() {
return modifier;
}
public void setOdifier(String odifier) {
modifier = odifier;
}
public String getShopAddressContent() {
return shopAddressContent;
}
public void setShopAddressContent(String shopAddressContent) {
this.shopAddressContent = shopAddressContent;
}
public String getShopAddressDefault() {
return shopAddressDefault;
}
public void setShopAddressDefault(String shopAddressDefault) {
this.shopAddressDefault = shopAddressDefault;
}
public String getShopAddressId() {
return shopAddressId;
}
public void setShopAddressId(String shopAddressId) {
this.shopAddressId = shopAddressId;
}
public String getShopAddressName() {
return shopAddressName;
}
public void setShopAddressName(String shopAddressName) {
this.shopAddressName = shopAddressName;
}
public String getShopAddressPhone() {
return shopAddressPhone;
}
public void setShopAddressPhone(String shopAddressPhone) {
this.shopAddressPhone = shopAddressPhone;
}
public String getShopAddressZipcode() {
return shopAddressZipcode;
}
public void setShopAddressZipcode(String shopAddressZipcode) {
this.shopAddressZipcode = shopAddressZipcode;
}
}

View File

@ -12,8 +12,8 @@ import com.sucstepsoft.cm_utils.constant.PathConfig;
import com.sucstepsoft.cm_utils.core.retrofit_net.RetrofitManager;
import com.sucstepsoft.cm_utils.core.widget.base.BaseFragment;
import com.sucstepsoft.cm_utils.utils.ExceptionHandler;
import com.tengshisoft.moduleshop.R;
import com.tengshisoft.moduleshop.R2;
import com.tenlionsoft.moduleshop.R;
import com.tenlionsoft.moduleshop.R2;
import com.tenlionsoft.moduleshop.adapter.ShopSortOneAdapter;
import com.tenlionsoft.moduleshop.adapter.ShopSortSecondAdapter;
import com.tenlionsoft.moduleshop.beans.ShopSortListBean;

View File

@ -10,7 +10,7 @@ import androidx.recyclerview.widget.RecyclerView;
import com.sucstepsoft.cm_utils.core.widget.views.AddOrDelView;
import com.sucstepsoft.cm_utils.core.widget.views.TypeFaceTextView;
import com.tengshisoft.moduleshop.R;
import com.tenlionsoft.moduleshop.R;
/**
* 购物车中商品

View File

@ -6,7 +6,7 @@ import androidx.annotation.NonNull;
import androidx.recyclerview.widget.RecyclerView;
import com.sucstepsoft.cm_utils.core.widget.views.TypeFaceTextView;
import com.tengshisoft.moduleshop.R;
import com.tenlionsoft.moduleshop.R;
/**
* 购物车列表

View File

@ -7,7 +7,7 @@ import androidx.annotation.NonNull;
import androidx.recyclerview.widget.RecyclerView;
import com.sucstepsoft.cm_utils.core.widget.views.TypeFaceTextView;
import com.tengshisoft.moduleshop.R;
import com.tenlionsoft.moduleshop.R;
public class GoodsHolder extends RecyclerView.ViewHolder {
public ImageView mIvIcon;

View File

@ -8,7 +8,7 @@ import androidx.annotation.NonNull;
import androidx.recyclerview.widget.RecyclerView;
import com.sucstepsoft.cm_utils.core.widget.views.TypeFaceTextView;
import com.tengshisoft.moduleshop.R;
import com.tenlionsoft.moduleshop.R;
public class GoodsStandardHolder extends RecyclerView.ViewHolder {
public ImageView mIvIcon;

View File

@ -0,0 +1,39 @@
package com.tenlionsoft.moduleshop.holder;
import android.view.View;
import android.widget.ImageView;
import android.widget.LinearLayout;
import androidx.annotation.NonNull;
import androidx.recyclerview.widget.RecyclerView;
import com.sucstepsoft.cm_utils.core.widget.views.TypeFaceTextView;
import com.tenlionsoft.moduleshop.R;
/**
* 确认订单中的商品
*/
public class OrderConfirmGoodsHolder extends RecyclerView.ViewHolder {
public ImageView mIvIcon;
public TypeFaceTextView mTvName;
public TypeFaceTextView mTvPrice;
public TypeFaceTextView mTvSales;
public TypeFaceTextView mTvEvaluate;
public TypeFaceTextView mTvFreight;
public TypeFaceTextView mTvGoodsStandard;
public LinearLayout mLlItem;
public TypeFaceTextView mTvCount;
public OrderConfirmGoodsHolder(@NonNull View itemView) {
super(itemView);
mIvIcon = itemView.findViewById(R.id.iv_goods_icon);
mTvName = itemView.findViewById(R.id.tv_goods_name);
mTvPrice = itemView.findViewById(R.id.tv_goods_price);
mTvSales = itemView.findViewById(R.id.tv_goods_sales);
mTvEvaluate = itemView.findViewById(R.id.tv_goods_evaluate);
mTvFreight = itemView.findViewById(R.id.tv_goods_freight);
mTvGoodsStandard = itemView.findViewById(R.id.tv_goods_standard);
mLlItem = itemView.findViewById(R.id.ll_item);
mTvCount = itemView.findViewById(R.id.tv_count);
}
}

View File

@ -0,0 +1,33 @@
package com.tenlionsoft.moduleshop.holder;
import android.view.View;
import android.widget.ImageView;
import android.widget.LinearLayout;
import androidx.annotation.NonNull;
import androidx.recyclerview.widget.RecyclerView;
import com.sucstepsoft.cm_utils.core.widget.views.TypeFaceTextView;
import com.tenlionsoft.moduleshop.R;
/**
* 收货地址
*/
public class ShippingAddressHolder extends RecyclerView.ViewHolder {
public ImageView mIvDefault;
public TypeFaceTextView mTvAddressArea;
public TypeFaceTextView mTvAddressContent;
public TypeFaceTextView mTvName;
public ImageView mIvEdit;
public LinearLayout mLlContent;
public ShippingAddressHolder(@NonNull View itemView) {
super(itemView);
mIvDefault = itemView.findViewById(R.id.iv_default);
mTvAddressArea = itemView.findViewById(R.id.tv_address_area);
mTvAddressContent = itemView.findViewById(R.id.tv_address_content);
mIvEdit = itemView.findViewById(R.id.iv_edit);
mLlContent = itemView.findViewById(R.id.ll_content);
mTvName = itemView.findViewById(R.id.tv_name);
}
}

View File

@ -7,7 +7,8 @@ import android.widget.TextView;
import androidx.annotation.NonNull;
import androidx.recyclerview.widget.RecyclerView;
import com.tengshisoft.moduleshop.R;
import com.tenlionsoft.moduleshop.R;
public class ShopSortHolder extends RecyclerView.ViewHolder {
public TextView mTvName;

View File

@ -7,7 +7,8 @@ import android.widget.TextView;
import androidx.annotation.NonNull;
import androidx.recyclerview.widget.RecyclerView;
import com.tengshisoft.moduleshop.R;
import com.tenlionsoft.moduleshop.R;
public class ShopSortOneHolder extends RecyclerView.ViewHolder {
public TextView mTvName;

View File

@ -8,7 +8,8 @@ import android.widget.TextView;
import androidx.annotation.NonNull;
import androidx.recyclerview.widget.RecyclerView;
import com.tengshisoft.moduleshop.R;
import com.tenlionsoft.moduleshop.R;
/**
* 二级分类

View File

@ -3,6 +3,7 @@ package com.tenlionsoft.moduleshop.net;
import com.sucstepsoft.cm_utils.core.beans.BaseSuccessBean;
import com.tenlionsoft.moduleshop.beans.GoodsListBean;
import com.tenlionsoft.moduleshop.beans.GoodsStandardBean;
import com.tenlionsoft.moduleshop.beans.ShippingAddressBean;
import com.tenlionsoft.moduleshop.beans.ShopGoodsDetailBean;
import com.tenlionsoft.moduleshop.beans.ShopSortListBean;
@ -15,6 +16,7 @@ import retrofit2.http.GET;
import retrofit2.http.Header;
import retrofit2.http.Headers;
import retrofit2.http.POST;
import retrofit2.http.PUT;
import retrofit2.http.Path;
import retrofit2.http.Query;
@ -75,4 +77,47 @@ public interface ShopApi {
@Headers({"base_url_name:shop", "Content-Type:application/json", "Accept:application/json"})
@POST("app/order/savebycart")
Observable<BaseSuccessBean> doSaveOrder(@Body RequestBody goods, @Header("token") String token);
/**
* 新增收货地址
*/
@Headers({"base_url_name:shop", "Content-Type:application/json", "Accept:application/json"})
@POST("app/shopaddress/save")
Observable<BaseSuccessBean> doSaveAddress(@Body RequestBody goods, @Header("token") String token);
/**
* 修改收货地址
*/
@Headers({"base_url_name:shop", "Content-Type:application/json", "Accept:application/json"})
@PUT("app/shopaddress/update/{shopAddressId}")
Observable<BaseSuccessBean> doEditAddress(@Body RequestBody goods,
@Path("shopAddressId") String addressId,
@Header("token") String token);
/**
* 设置默认收货地址
*/
@Headers({"base_url_name:shop", "Content-Type:application/json", "Accept:application/json"})
@PUT("app/shopaddress/updatedefault/{shopAddressId}")
Observable<BaseSuccessBean> doSetDefaultAddress(@Path("shopAddressId") String id, @Header("token") String token);
/**
* 获取默认地址
*/
@Headers({"base_url_name:shop", "Content-Type:application/json", "Accept:application/json"})
@GET("app/shopaddress/getdefault")
Observable<ShippingAddressBean> getDefaultAddress(@Header("token") String token);
/**
* 收货地址列表
*/
@Headers({"base_url_name:shop", "Content-Type:application/json", "Accept:application/json"})
@GET("app/shopaddress/list")
Observable<List<ShippingAddressBean>> getShippingAddressList(@Header("token") String token);
/**
* 我的订单
* app/order/listpage
*/
}

View File

@ -0,0 +1,150 @@
<?xml version="1.0" encoding="utf-8"?>
<RelativeLayout 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/gray_bg"
android:orientation="vertical"
tools:context="com.tenlionsoft.moduleshop.activitys.OrderConfirmActivity">
<androidx.cardview.widget.CardView
android:id="@+id/cv_address"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_margin="10dp"
android:background="@color/white"
app:cardCornerRadius="5dp"
app:cardElevation="2dp">
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="vertical">
<com.sucstepsoft.cm_utils.core.widget.views.TypeFaceTextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:padding="5dp"
android:text="收货地址"
android:textColor="@color/black" />
<LinearLayout
android:id="@+id/ll_choose_address"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_margin="5dp"
android:gravity="center_vertical"
android:orientation="horizontal"
android:padding="5dp">
<LinearLayout
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_weight="1"
android:orientation="vertical">
<com.sucstepsoft.cm_utils.core.widget.views.TypeFaceTextView
android:id="@+id/tv_address_area"
android:layout_width="match_parent"
android:layout_height="wrap_content"
tools:text="内蒙古呼和浩特市新城区海拉尔东街" />
<com.sucstepsoft.cm_utils.core.widget.views.TypeFaceTextView
android:id="@+id/tv_address_content"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginTop="5dp"
android:textColor="@color/black"
android:textSize="18sp"
tools:text="海东一号二号楼2522" />
<com.sucstepsoft.cm_utils.core.widget.views.TypeFaceTextView
android:id="@+id/tv_name"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginTop="5dp"
tools:text="高 15555555555" />
</LinearLayout>
<ImageView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:src="@drawable/ic_arrow_right" />
</LinearLayout>
<ImageView
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:src="@drawable/ic_divid_line_bottom" />
</LinearLayout>
</androidx.cardview.widget.CardView>
<androidx.cardview.widget.CardView
android:id="@+id/cv_goods"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_below="@id/cv_address"
android:layout_marginLeft="10dp"
android:layout_marginRight="10dp"
app:cardCornerRadius="5dp"
app:cardElevation="2dp">
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_margin="10dp"
android:orientation="vertical">
<com.sucstepsoft.cm_utils.core.widget.views.TypeFaceTextView
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:text="确认商品"
android:textColor="@color/black" />
<androidx.recyclerview.widget.RecyclerView
android:id="@+id/rlv_goods"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginTop="10dp" />
</LinearLayout>
</androidx.cardview.widget.CardView>
<RelativeLayout
android:layout_width="match_parent"
android:layout_height="50dp"
android:layout_alignParentBottom="true"
android:background="@color/white"
android:paddingLeft="10dp"
android:paddingRight="10dp">
<com.sucstepsoft.cm_utils.core.widget.views.TypeFaceTextView
android:id="@+id/tv_price"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_centerVertical="true"
android:layout_marginLeft="20dp"
android:layout_toRightOf="@id/cb_all"
android:textColor="@color/app_title_9f_no"
android:textSize="25sp"
android:textStyle="bold"
tools:text="¥ 37666" />
<com.sucstepsoft.cm_utils.core.widget.views.TypeFaceTextView
android:id="@+id/tv_confirm"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignParentRight="true"
android:layout_centerVertical="true"
android:background="@drawable/sel_btn_red_grad"
android:clickable="true"
android:focusable="true"
android:paddingLeft="15dp"
android:paddingTop="8dp"
android:paddingRight="15dp"
android:paddingBottom="8dp"
android:text="提交订单"
android:textColor="@color/white" />
</RelativeLayout>
</RelativeLayout>

View File

@ -0,0 +1,70 @@
<?xml version="1.0" encoding="utf-8"?>
<RelativeLayout 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/gray_bg"
android:orientation="vertical"
tools:context="com.tenlionsoft.moduleshop.activitys.ShippingAddressActivity">
<androidx.cardview.widget.CardView
android:layout_width="match_parent"
android:layout_height="match_parent"
android:layout_marginLeft="10dp"
android:layout_marginTop="5dp"
android:layout_marginRight="10dp"
android:layout_marginBottom="55dp"
app:cardCornerRadius="5dp"
app:cardElevation="2dp">
<RelativeLayout
android:layout_width="match_parent"
android:layout_height="match_parent"
android:padding="10dp">
<androidx.recyclerview.widget.RecyclerView
android:id="@+id/rlv_address"
android:layout_width="match_parent"
android:layout_height="wrap_content" />
<LinearLayout
android:id="@+id/ll_empty_h"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_centerInParent="true"
android:gravity="center"
android:orientation="vertical">
<ImageView
android:layout_width="70dp"
android:layout_height="70dp"
android:src="@drawable/ic_empty_data" />
<com.sucstepsoft.cm_utils.core.widget.views.TypeFaceTextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginTop="10dp"
android:text="暂无收货地址" />
</LinearLayout>
</RelativeLayout>
</androidx.cardview.widget.CardView>
<LinearLayout
android:id="@+id/ll_add_address"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_alignParentBottom="true"
android:background="@color/white">
<com.sucstepsoft.cm_utils.core.widget.views.TypeFaceTextView
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_margin="5dp"
android:background="@drawable/shape_btn_red_no_ra"
android:gravity="center"
android:padding="10dp"
android:text="新增收货地址"
android:textColor="@color/white" />
</LinearLayout>
</RelativeLayout>

View File

@ -0,0 +1,286 @@
<?xml version="1.0" encoding="utf-8"?>
<RelativeLayout 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=".activitys.ShopAddAddressActivity">
<androidx.cardview.widget.CardView
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_margin="5dp"
app:cardCornerRadius="5dp"
app:cardElevation="2dp">
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="vertical"
android:padding="10dp">
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:gravity="center_vertical"
android:orientation="horizontal"
android:padding="5dp">
<com.sucstepsoft.cm_utils.core.widget.views.TypeFaceTextView
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_weight="0.2"
android:text="省份" />
<ImageView
android:layout_width="wrap_content"
android:layout_height="12dp"
android:scaleType="fitXY"
android:src="@drawable/ic_catelog_indic_line" />
<com.sucstepsoft.cm_utils.core.widget.views.TypeFaceTextView
android:id="@+id/tv_area1"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_weight=".8"
android:drawableRight="@drawable/ic_arrow_cir"
android:hint="请选择省份"
android:paddingLeft="5dp" />
</LinearLayout>
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:gravity="center_vertical"
android:orientation="horizontal"
android:padding="5dp">
<com.sucstepsoft.cm_utils.core.widget.views.TypeFaceTextView
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_weight="0.2"
android:text="市" />
<ImageView
android:layout_width="wrap_content"
android:layout_height="12dp"
android:scaleType="fitXY"
android:src="@drawable/ic_catelog_indic_line" />
<com.sucstepsoft.cm_utils.core.widget.views.TypeFaceTextView
android:id="@+id/tv_area2"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_weight=".8"
android:drawableRight="@drawable/ic_arrow_cir"
android:hint="请选择市"
android:paddingLeft="5dp" />
</LinearLayout>
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:gravity="center_vertical"
android:orientation="horizontal"
android:padding="5dp">
<com.sucstepsoft.cm_utils.core.widget.views.TypeFaceTextView
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_weight="0.2"
android:text="县区" />
<ImageView
android:layout_width="wrap_content"
android:layout_height="12dp"
android:scaleType="fitXY"
android:src="@drawable/ic_catelog_indic_line" />
<com.sucstepsoft.cm_utils.core.widget.views.TypeFaceTextView
android:id="@+id/tv_area3"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_weight=".8"
android:drawableRight="@drawable/ic_arrow_cir"
android:hint="请选择县区"
android:paddingLeft="5dp" />
</LinearLayout>
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:gravity="center_vertical"
android:orientation="horizontal"
android:padding="5dp">
<com.sucstepsoft.cm_utils.core.widget.views.TypeFaceTextView
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_weight="0.2"
android:text="街道、社区" />
<ImageView
android:layout_width="wrap_content"
android:layout_height="12dp"
android:scaleType="fitXY"
android:src="@drawable/ic_catelog_indic_line" />
<com.sucstepsoft.cm_utils.core.widget.views.TypeFaceTextView
android:id="@+id/tv_area4"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_marginLeft="5dp"
android:layout_weight=".8"
android:drawableRight="@drawable/ic_arrow_cir"
android:hint="请选择街道社区"
android:paddingLeft="5dp" />
</LinearLayout>
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:gravity="center_vertical"
android:orientation="horizontal"
android:padding="5dp">
<com.sucstepsoft.cm_utils.core.widget.views.TypeFaceTextView
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_weight="0.2"
android:text="详细地址" />
<ImageView
android:layout_width="wrap_content"
android:layout_height="12dp"
android:scaleType="fitXY"
android:src="@drawable/ic_catelog_indic_line" />
<EditText
android:id="@+id/et_detail"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_marginLeft="5dp"
android:layout_weight="0.8"
android:background="@null"
android:gravity="left"
android:hint="请输入详细地址"
android:padding="5dp"
android:textSize="14sp" />
</LinearLayout>
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:gravity="center_vertical"
android:orientation="horizontal"
android:padding="5dp">
<com.sucstepsoft.cm_utils.core.widget.views.TypeFaceTextView
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_weight="0.2"
android:text="收货人姓名" />
<ImageView
android:layout_width="wrap_content"
android:layout_height="12dp"
android:scaleType="fitXY"
android:src="@drawable/ic_catelog_indic_line" />
<EditText
android:id="@+id/et_name"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_marginLeft="5dp"
android:layout_weight="0.8"
android:background="@null"
android:gravity="left"
android:hint="请输入收货人姓名"
android:padding="5dp"
android:textSize="14sp" />
</LinearLayout>
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:gravity="center_vertical"
android:orientation="horizontal"
android:padding="5dp">
<com.sucstepsoft.cm_utils.core.widget.views.TypeFaceTextView
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_weight="0.2"
android:text="联系方式" />
<ImageView
android:layout_width="wrap_content"
android:layout_height="12dp"
android:scaleType="fitXY"
android:src="@drawable/ic_catelog_indic_line" />
<EditText
android:id="@+id/et_phone"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_marginLeft="5dp"
android:layout_weight="0.8"
android:background="@null"
android:gravity="left"
android:hint="请输入收货人联系方式"
android:padding="5dp"
android:textSize="14sp" />
</LinearLayout>
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:gravity="center_vertical"
android:orientation="horizontal"
android:padding="5dp">
<com.sucstepsoft.cm_utils.core.widget.views.TypeFaceTextView
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_weight="0.2"
android:text="邮政编码" />
<ImageView
android:layout_width="wrap_content"
android:layout_height="12dp"
android:scaleType="fitXY"
android:src="@drawable/ic_catelog_indic_line" />
<EditText
android:id="@+id/et_zipcode"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_marginLeft="5dp"
android:layout_weight="0.8"
android:background="@null"
android:gravity="left"
android:hint="请输入邮政编码"
android:padding="5dp"
android:textSize="14sp" />
</LinearLayout>
</LinearLayout>
</androidx.cardview.widget.CardView>
<LinearLayout
android:id="@+id/ll_confirm"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_alignParentBottom="true"
android:background="@color/white">
<com.sucstepsoft.cm_utils.core.widget.views.TypeFaceTextView
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_margin="5dp"
android:background="@drawable/shape_btn_red_no_ra"
android:gravity="center"
android:padding="10dp"
android:text="保存"
android:textColor="@color/white" />
</LinearLayout>
</RelativeLayout>

View File

@ -11,7 +11,7 @@
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:background="@null"
android:button="@drawable/sel_checkbox_red"
android:button="@drawable/sel_radio_checkbox"
android:enabled="false" />
<ImageView

View File

@ -0,0 +1,127 @@
<?xml version="1.0" encoding="utf-8"?>
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:background="@color/white"
android:padding="8dp">
<ImageView
android:id="@+id/iv_goods_icon"
android:layout_width="90dp"
android:layout_height="90dp"
android:layout_marginLeft="5dp"
android:scaleType="fitXY"
tools:src="@drawable/ic_img_default" />
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_toRightOf="@id/iv_goods_icon"
android:orientation="vertical"
android:paddingLeft="10dp">
<LinearLayout
android:id="@+id/ll_item"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="vertical">
<com.sucstepsoft.cm_utils.core.widget.views.TypeFaceTextView
android:id="@+id/tv_goods_name"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:ellipsize="end"
android:maxLines="2"
tools:text="Redmi Note 12 %G 120Hz OLED屏幕 晓龙4移动平台 5000mAh 长续航 6GbOLED屏幕 晓龙4移动平台 5000mAh 长续航 6GbOLED屏幕 晓龙4移动平台 5000mAh 长续航 6Gb" />
<com.sucstepsoft.cm_utils.core.widget.views.TypeFaceTextView
android:id="@+id/tv_goods_price"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginTop="10dp"
android:textColor="@color/app_title_9f_no"
android:textSize="16sp"
tools:text="¥1299" />
<com.sucstepsoft.cm_utils.core.widget.views.TypeFaceTextView
android:id="@+id/tv_goods_standard"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginTop="5dp"
android:background="@drawable/shp_sel_red_border"
android:paddingLeft="5dp"
android:paddingTop="2dp"
android:paddingRight="5dp"
android:paddingBottom="2dp"
android:textColor="@color/app_title_9f_no"
android:textSize="14sp"
tools:text="¥1299" />
</LinearLayout>
<RelativeLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginTop="5dp"
android:orientation="horizontal">
<com.sucstepsoft.cm_utils.core.widget.views.TypeFaceTextView
android:id="@+id/tv_goods_sales"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_centerVertical="true"
android:background="@drawable/shp_rectangle_gray"
android:paddingLeft="8dp"
android:paddingTop="2dp"
android:paddingRight="8dp"
android:paddingBottom="2dp"
android:textColor="@color/app_title_9f_no"
android:textSize="10sp"
tools:text="销量" />
<com.sucstepsoft.cm_utils.core.widget.views.TypeFaceTextView
android:id="@+id/tv_goods_evaluate"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_centerVertical="true"
android:layout_marginLeft="8dp"
android:layout_toRightOf="@id/tv_goods_sales"
android:background="@drawable/shp_rectangle_gray"
android:paddingLeft="8dp"
android:paddingTop="2dp"
android:paddingRight="8dp"
android:paddingBottom="2dp"
android:textColor="@color/app_title_9f_no"
android:textSize="10sp"
android:visibility="gone"
tools:text="评分" />
<com.sucstepsoft.cm_utils.core.widget.views.TypeFaceTextView
android:id="@+id/tv_goods_freight"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_centerVertical="true"
android:layout_marginLeft="8dp"
android:layout_toRightOf="@id/tv_goods_evaluate"
android:background="@drawable/shp_rectangle_gray"
android:paddingLeft="8dp"
android:paddingTop="2dp"
android:paddingRight="8dp"
android:paddingBottom="2dp"
android:textColor="@color/app_title_9f_no"
android:textSize="10sp"
tools:text="包邮" />
<com.sucstepsoft.cm_utils.core.widget.views.TypeFaceTextView
android:id="@+id/tv_count"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignParentRight="true"
android:textColor="@color/app_title_9f_no"
android:textSize="16sp"
tools:text="数量:12" />
</RelativeLayout>
</LinearLayout>
</RelativeLayout>

View File

@ -7,32 +7,6 @@
android:background="@color/white"
android:orientation="vertical">
<RelativeLayout
android:id="@+id/rl_second"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:padding="8dp">
<TextView
android:id="@+id/tv_second"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginTop="10dp"
android:layout_marginBottom="10dp"
android:textColor="@color/black"
android:textSize="15sp"
android:textStyle="bold"
tools:text="二级分类" />
<ImageView
android:layout_width="12dp"
android:layout_height="12dp"
android:layout_alignParentRight="true"
android:layout_centerVertical="true"
android:layout_marginRight="5dp"
android:src="@drawable/ic_arrow_right" />
</RelativeLayout>
<androidx.cardview.widget.CardView
android:layout_width="match_parent"
@ -49,14 +23,40 @@
android:layout_height="match_parent"
android:layout_margin="10dp">
<RelativeLayout
android:id="@+id/rl_second"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:paddingTop="5dp"
android:paddingBottom="5dp">
<TextView
android:id="@+id/tv_second"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:textColor="@color/black"
android:textSize="15sp"
android:textStyle="bold"
tools:text="二级分类" />
<ImageView
android:layout_width="12dp"
android:layout_height="12dp"
android:layout_alignParentRight="true"
android:layout_centerVertical="true"
android:layout_marginRight="5dp"
android:src="@drawable/ic_arrow_right" />
</RelativeLayout>
<androidx.recyclerview.widget.RecyclerView
android:id="@+id/rlv_third_sort"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_below="@id/rl_second"
android:layout_marginStart="5dp"
android:layout_marginLeft="5dp"
android:layout_marginTop="5dp"
android:layout_marginTop="10dp"
android:layout_marginEnd="5dp"
android:layout_marginRight="5dp"
android:layout_marginBottom="5dp" />

View File

@ -0,0 +1,55 @@
<?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="wrap_content"
android:background="@color/white"
android:gravity="center_vertical"
android:orientation="horizontal"
android:padding="5dp">
<ImageView
android:id="@+id/iv_default"
android:layout_width="20dp"
android:layout_height="20dp"
android:scaleType="fitXY"
android:src="@drawable/ic_cb_checked" />
<LinearLayout
android:id="@+id/ll_content"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_weight="1"
android:orientation="vertical"
android:padding="10dp">
<com.sucstepsoft.cm_utils.core.widget.views.TypeFaceTextView
android:id="@+id/tv_address_area"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:textSize="13sp"
tools:text="内蒙古呼和浩特市赛罕区" />
<com.sucstepsoft.cm_utils.core.widget.views.TypeFaceTextView
android:id="@+id/tv_address_content"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:textColor="@color/black"
android:textSize="16sp"
tools:text="内蒙古大学生创业园" />
<com.sucstepsoft.cm_utils.core.widget.views.TypeFaceTextView
android:id="@+id/tv_name"
android:layout_width="match_parent"
android:layout_height="wrap_content"
tools:text="高 11111111" />
</LinearLayout>
<ImageView
android:id="@+id/iv_edit"
android:layout_width="35dp"
android:layout_height="35dp"
android:padding="10dp"
android:scaleType="fitXY"
android:src="@drawable/ic_edit_icon" />
</LinearLayout>