出库
@@ -146,6 +146,10 @@
|
|||||||
android:name=".product.ProductInboundActivity"
|
android:name=".product.ProductInboundActivity"
|
||||||
android:screenOrientation="portrait"
|
android:screenOrientation="portrait"
|
||||||
android:windowSoftInputMode="adjustResize" />
|
android:windowSoftInputMode="adjustResize" />
|
||||||
|
<activity
|
||||||
|
android:name=".product.ProductOutboundActivity"
|
||||||
|
android:screenOrientation="portrait"
|
||||||
|
android:windowSoftInputMode="adjustResize" />
|
||||||
<activity
|
<activity
|
||||||
android:name=".product.ProductScanActivity"
|
android:name=".product.ProductScanActivity"
|
||||||
android:exported="false"
|
android:exported="false"
|
||||||
|
|||||||
@@ -19,7 +19,7 @@ public class AppConfig {
|
|||||||
|
|
||||||
/**************************本地*******************************/
|
/**************************本地*******************************/
|
||||||
// public static String BASE_URL = "https://ragged-parting-unrushed.ngrok-free.dev/";//测试
|
// public static String BASE_URL = "https://ragged-parting-unrushed.ngrok-free.dev/";//测试
|
||||||
public static String BASE_URL = "http://192.168.111.127:8080/";//测试
|
public static String BASE_URL = "http://192.168.115.122:8080/";//测试
|
||||||
public static String BASE_URL_TWO = BASE_URL;//测试
|
public static String BASE_URL_TWO = BASE_URL;//测试
|
||||||
public static String BASE_URL_THREE = BASE_URL;//测试
|
public static String BASE_URL_THREE = BASE_URL;//测试
|
||||||
public static boolean IS_TEST_REQUEST = true;
|
public static boolean IS_TEST_REQUEST = true;
|
||||||
|
|||||||
@@ -32,6 +32,7 @@ import com.ckkj.griddlebiz.network.BaseBean;
|
|||||||
import com.ckkj.griddlebiz.pickup.PickupVerifyActivity;
|
import com.ckkj.griddlebiz.pickup.PickupVerifyActivity;
|
||||||
import com.ckkj.griddlebiz.product.DeviceManageActivity;
|
import com.ckkj.griddlebiz.product.DeviceManageActivity;
|
||||||
import com.ckkj.griddlebiz.product.ProductInboundActivity;
|
import com.ckkj.griddlebiz.product.ProductInboundActivity;
|
||||||
|
import com.ckkj.griddlebiz.product.ProductOutboundActivity;
|
||||||
import com.ckkj.griddlebiz.statistics.StatisticsActivity;
|
import com.ckkj.griddlebiz.statistics.StatisticsActivity;
|
||||||
import com.ckkj.griddlebiz.user.UserManageActivity;
|
import com.ckkj.griddlebiz.user.UserManageActivity;
|
||||||
import com.ckkj.griddlebiz.utils.AppInfoUtil;
|
import com.ckkj.griddlebiz.utils.AppInfoUtil;
|
||||||
@@ -113,9 +114,9 @@ public class MainActivity extends BaseActivity<MainActivityLayoutBinding, MainPr
|
|||||||
* 首页各功能入口点击事件。
|
* 首页各功能入口点击事件。
|
||||||
*/
|
*/
|
||||||
@OnClick({R.id.fl_notifications, R.id.iv_company_profile, R.id.action_product_inbound,
|
@OnClick({R.id.fl_notifications, R.id.iv_company_profile, R.id.action_product_inbound,
|
||||||
R.id.action_product_management, R.id.action_statistics,
|
R.id.action_product_outbound, R.id.action_product_management,
|
||||||
R.id.action_pickup_verification, R.id.feature_user_management,
|
R.id.action_statistics, R.id.action_pickup_verification,
|
||||||
R.id.feature_user_guide})
|
R.id.feature_user_management, R.id.feature_user_guide})
|
||||||
public void onClick(View v) {
|
public void onClick(View v) {
|
||||||
switch (v.getId()) {
|
switch (v.getId()) {
|
||||||
case R.id.fl_notifications:
|
case R.id.fl_notifications:
|
||||||
@@ -133,6 +134,11 @@ public class MainActivity extends BaseActivity<MainActivityLayoutBinding, MainPr
|
|||||||
startActivity(new Intent(mContext, ProductInboundActivity.class));
|
startActivity(new Intent(mContext, ProductInboundActivity.class));
|
||||||
break;
|
break;
|
||||||
|
|
||||||
|
case R.id.action_product_outbound:
|
||||||
|
// 进入商品出库扫码页
|
||||||
|
startActivity(new Intent(mContext, ProductOutboundActivity.class));
|
||||||
|
break;
|
||||||
|
|
||||||
case R.id.action_product_management:
|
case R.id.action_product_management:
|
||||||
// 进入设备管理页
|
// 进入设备管理页
|
||||||
startActivity(new Intent(mContext, DeviceManageActivity.class));
|
startActivity(new Intent(mContext, DeviceManageActivity.class));
|
||||||
|
|||||||
@@ -1,22 +1,53 @@
|
|||||||
package com.ckkj.griddlebiz.mine;
|
package com.ckkj.griddlebiz.mine;
|
||||||
|
|
||||||
import android.os.Bundle;
|
import android.os.Bundle;
|
||||||
|
import android.text.TextUtils;
|
||||||
import android.view.View;
|
import android.view.View;
|
||||||
|
|
||||||
|
import androidx.recyclerview.widget.LinearLayoutManager;
|
||||||
|
|
||||||
import com.ckkj.griddlebiz.R;
|
import com.ckkj.griddlebiz.R;
|
||||||
import com.ckkj.griddlebiz.base.BaseActivityNoP;
|
import com.ckkj.griddlebiz.base.BaseActivity;
|
||||||
|
import com.ckkj.griddlebiz.custom.view.CustomRefreshHeader;
|
||||||
import com.ckkj.griddlebiz.databinding.MessageCenterLayoutBinding;
|
import com.ckkj.griddlebiz.databinding.MessageCenterLayoutBinding;
|
||||||
|
import com.ckkj.griddlebiz.mine.adapter.MessageAdapter;
|
||||||
|
import com.ckkj.griddlebiz.mine.entity.MessageItemEntity;
|
||||||
|
import com.ckkj.griddlebiz.mine.mvp.MessageContract;
|
||||||
|
import com.ckkj.griddlebiz.mine.mvp.MessageImpl;
|
||||||
|
import com.ckkj.griddlebiz.mine.mvp.MessagePresenter;
|
||||||
import com.ckkj.griddlebiz.network.BaseBean;
|
import com.ckkj.griddlebiz.network.BaseBean;
|
||||||
|
import com.ckkj.griddlebiz.network.PageResult;
|
||||||
import com.ckkj.griddlebiz.utils.show.ToastUtil;
|
import com.ckkj.griddlebiz.utils.show.ToastUtil;
|
||||||
import com.gyf.immersionbar.ImmersionBar;
|
import com.gyf.immersionbar.ImmersionBar;
|
||||||
|
import com.scwang.smart.refresh.footer.ClassicsFooter;
|
||||||
|
|
||||||
|
import java.util.ArrayList;
|
||||||
|
import java.util.LinkedHashMap;
|
||||||
|
import java.util.Map;
|
||||||
|
|
||||||
import butterknife.OnClick;
|
import butterknife.OnClick;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 消息中心:展示系统通知列表,右上角提供清空入口。
|
* 消息中心:分页展示消息列表,支持下拉刷新与上拉加载更多。
|
||||||
* 消息数据目前使用设计稿示例,后续接入消息接口时替换。
|
|
||||||
*/
|
*/
|
||||||
public class MessageCenterActivity extends BaseActivityNoP<MessageCenterLayoutBinding> {
|
public class MessageCenterActivity extends BaseActivity<MessageCenterLayoutBinding, MessagePresenter>
|
||||||
|
implements MessageContract.MessageView {
|
||||||
|
|
||||||
|
/** 每页条数,与接口 size 参数一致 */
|
||||||
|
private static final int PAGE_SIZE = 20;
|
||||||
|
|
||||||
|
private MessageAdapter mAdapter;
|
||||||
|
/** 已成功加载到的页码,0 表示尚未加载 */
|
||||||
|
private int mLoadedPage;
|
||||||
|
/** 是否有分页请求正在执行 */
|
||||||
|
private boolean mLoading;
|
||||||
|
/** 是否已没有更多数据 */
|
||||||
|
private boolean mNoMore;
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public MessagePresenter createPresenter() {
|
||||||
|
return new MessagePresenter(new MessageImpl());
|
||||||
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public int getLayoutResId(Bundle savedInstanceState) {
|
public int getLayoutResId(Bundle savedInstanceState) {
|
||||||
@@ -30,6 +61,14 @@ public class MessageCenterActivity extends BaseActivityNoP<MessageCenterLayoutBi
|
|||||||
.statusBarColor(R.color.white)
|
.statusBarColor(R.color.white)
|
||||||
.statusBarDarkFont(true)
|
.statusBarDarkFont(true)
|
||||||
.init();
|
.init();
|
||||||
|
|
||||||
|
mAdapter = new MessageAdapter();
|
||||||
|
viewBinding.rvMessages.setLayoutManager(new LinearLayoutManager(this));
|
||||||
|
viewBinding.rvMessages.setItemAnimator(null);
|
||||||
|
viewBinding.rvMessages.setAdapter(mAdapter);
|
||||||
|
|
||||||
|
initRefresh();
|
||||||
|
requestPage(1);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -53,15 +92,116 @@ public class MessageCenterActivity extends BaseActivityNoP<MessageCenterLayoutBi
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 初始化下拉刷新与上拉加载:首屏未加载完成前不允许上拉。
|
||||||
|
*/
|
||||||
|
private void initRefresh() {
|
||||||
|
viewBinding.refreshMessages.setRefreshHeader(new CustomRefreshHeader(mContext));
|
||||||
|
viewBinding.refreshMessages.setRefreshFooter(new ClassicsFooter(mContext));
|
||||||
|
viewBinding.refreshMessages.setEnableLoadMore(false);
|
||||||
|
viewBinding.refreshMessages.setEnableLoadMoreWhenContentNotFull(true);
|
||||||
|
viewBinding.refreshMessages.setOnRefreshListener(refresh -> requestPage(1));
|
||||||
|
viewBinding.refreshMessages.setOnLoadMoreListener(refresh -> {
|
||||||
|
if (!mLoading && !mNoMore && mLoadedPage > 0) {
|
||||||
|
requestPage(mLoadedPage + 1);
|
||||||
|
} else {
|
||||||
|
refresh.finishLoadMore();
|
||||||
|
}
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 分页请求入口:刷新失败时保留当前记录和已成功加载的页码
|
||||||
|
*/
|
||||||
|
private void requestPage(int page) {
|
||||||
|
if (page > 1 && mLoading) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
mLoading = true;
|
||||||
|
if (page == 1) {
|
||||||
|
viewBinding.refreshMessages.finishLoadMore();
|
||||||
|
viewBinding.refreshMessages.setNoMoreData(false);
|
||||||
|
viewBinding.refreshMessages.setEnableLoadMore(false);
|
||||||
|
}
|
||||||
|
// 首屏还没有数据时展示加载提示
|
||||||
|
if (mAdapter.getData().isEmpty()) {
|
||||||
|
viewBinding.tvMessageState.setText(R.string.message_loading);
|
||||||
|
viewBinding.tvMessageState.setVisibility(View.VISIBLE);
|
||||||
|
}
|
||||||
|
mPresenter.getMessages(page, PAGE_SIZE);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void showMessages(PageResult<MessageItemEntity> page, int pageNum) {
|
||||||
|
int oldCount = mAdapter.getData().size();
|
||||||
|
// 按消息 ID 去重合并,避免翻页期间数据变动导致重复条目
|
||||||
|
Map<Long, MessageItemEntity> merged = new LinkedHashMap<>();
|
||||||
|
if (pageNum > 1) {
|
||||||
|
for (MessageItemEntity item : mAdapter.getData()) {
|
||||||
|
merged.put(item.getMessageId(), item);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
if (page.getRows() != null) {
|
||||||
|
for (MessageItemEntity item : page.getRows()) {
|
||||||
|
merged.put(item.getMessageId(), item);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
mAdapter.setNewData(new ArrayList<>(merged.values()));
|
||||||
|
mLoadedPage = pageNum;
|
||||||
|
|
||||||
|
// 本页不满一页或已达到总数,说明没有更多数据
|
||||||
|
boolean fullPage = page.getRows() != null && page.getRows().size() >= PAGE_SIZE;
|
||||||
|
boolean reachTotal = page.getTotal() > 0 && merged.size() >= page.getTotal();
|
||||||
|
mNoMore = !fullPage || reachTotal;
|
||||||
|
if (pageNum > 1 && merged.size() == oldCount) {
|
||||||
|
mNoMore = true;
|
||||||
|
}
|
||||||
|
|
||||||
|
viewBinding.tvMessageState.setText(R.string.message_empty);
|
||||||
|
viewBinding.tvMessageState.setVisibility(merged.isEmpty() ? View.VISIBLE : View.GONE);
|
||||||
|
finishPage(pageNum, true);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void showMessagesError(String message, int pageNum) {
|
||||||
|
finishPage(pageNum, false);
|
||||||
|
showError(message);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 结束本次分页加载:刷新与加载更多的失败态由框架分别展示
|
||||||
|
*/
|
||||||
|
private void finishPage(int page, boolean success) {
|
||||||
|
mLoading = false;
|
||||||
|
if (page == 1) {
|
||||||
|
viewBinding.refreshMessages.finishRefresh(success);
|
||||||
|
} else {
|
||||||
|
viewBinding.refreshMessages.finishLoadMore(success);
|
||||||
|
}
|
||||||
|
viewBinding.refreshMessages.setEnableLoadMore(!mAdapter.getData().isEmpty());
|
||||||
|
viewBinding.refreshMessages.setNoMoreData(mNoMore);
|
||||||
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void showError(String message) {
|
public void showError(String message) {
|
||||||
hideLoading();
|
String error = TextUtils.isEmpty(message)
|
||||||
if (message != null && !message.isEmpty()) {
|
? getString(R.string.message_load_failed) : message;
|
||||||
ToastUtil.showShort(mContext, message);
|
// 列表为空时用空态文案兜底,避免只弹一次 Toast 后页面空白
|
||||||
|
if (mAdapter != null && mAdapter.getData().isEmpty()) {
|
||||||
|
viewBinding.tvMessageState.setText(error);
|
||||||
|
viewBinding.tvMessageState.setVisibility(View.VISIBLE);
|
||||||
}
|
}
|
||||||
|
ToastUtil.showShort(mContext, error);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void logOut(BaseBean bean) {
|
public void logOut(BaseBean bean) {
|
||||||
|
// 登录失效沿用父类统一处理。
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
protected void onDestroy() {
|
||||||
|
viewBinding.rvMessages.setAdapter(null);
|
||||||
|
super.onDestroy();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -0,0 +1,57 @@
|
|||||||
|
package com.ckkj.griddlebiz.mine.adapter;
|
||||||
|
|
||||||
|
import android.text.TextUtils;
|
||||||
|
|
||||||
|
import com.chad.library.adapter.base.BaseQuickAdapter;
|
||||||
|
import com.chad.library.adapter.base.BaseViewHolder;
|
||||||
|
import com.ckkj.griddlebiz.R;
|
||||||
|
import com.ckkj.griddlebiz.mine.entity.MessageItemEntity;
|
||||||
|
|
||||||
|
import java.util.ArrayList;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 消息列表适配器:公告类消息使用气泡图标,其余业务消息使用占位头像。
|
||||||
|
*/
|
||||||
|
public class MessageAdapter extends BaseQuickAdapter<MessageItemEntity, BaseViewHolder> {
|
||||||
|
|
||||||
|
/** 公告分类,接口固定值 */
|
||||||
|
private static final String CATEGORY_ANNOUNCEMENT = "announcement";
|
||||||
|
|
||||||
|
public MessageAdapter() {
|
||||||
|
super(R.layout.item_message, new ArrayList<>());
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
protected void convert(BaseViewHolder holder, MessageItemEntity item) {
|
||||||
|
holder.setText(R.id.tv_message_title, safeText(item.getTitle()));
|
||||||
|
holder.setText(R.id.tv_message_time, formatTime(item.getCreateTime()));
|
||||||
|
holder.setText(R.id.tv_message_summary, safeText(item.getSummary()));
|
||||||
|
|
||||||
|
// 公告用橙色气泡头像,其余业务消息用占位头像,与设计稿保持一致
|
||||||
|
boolean announcement = CATEGORY_ANNOUNCEMENT.equals(item.getCategory());
|
||||||
|
holder.setGone(R.id.iv_message_notice, !announcement);
|
||||||
|
holder.setGone(R.id.iv_message_avatar, announcement);
|
||||||
|
holder.setBackgroundRes(R.id.fl_message_avatar, announcement
|
||||||
|
? R.drawable.message_avatar_bg : R.drawable.message_avatar_placeholder_bg);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 接口时间为 ISO-8601 文本,列表只展示到分钟(MM-dd HH:mm)
|
||||||
|
*/
|
||||||
|
private String formatTime(String value) {
|
||||||
|
if (TextUtils.isEmpty(value)) {
|
||||||
|
return "";
|
||||||
|
}
|
||||||
|
String text = value.replace('T', ' ');
|
||||||
|
// 去掉毫秒与时区,保留 yyyy-MM-dd HH:mm
|
||||||
|
if (text.length() > 16) {
|
||||||
|
text = text.substring(0, 16);
|
||||||
|
}
|
||||||
|
// 完整时间去掉年份,纯日期原样展示
|
||||||
|
return text.length() == 16 ? text.substring(5) : text;
|
||||||
|
}
|
||||||
|
|
||||||
|
private String safeText(String value) {
|
||||||
|
return value == null ? "" : value;
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1,70 @@
|
|||||||
|
package com.ckkj.griddlebiz.mine.entity;
|
||||||
|
|
||||||
|
import java.io.Serializable;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 消息列表条目(文档 10.1 MessageItem)。
|
||||||
|
*/
|
||||||
|
public class MessageItemEntity implements Serializable {
|
||||||
|
|
||||||
|
/** 消息 ID */
|
||||||
|
private long messageId;
|
||||||
|
/** 业务分类:announcement / pickupPending / orderCancelled / returnPending */
|
||||||
|
private String category;
|
||||||
|
/** 标题 */
|
||||||
|
private String title;
|
||||||
|
/** 摘要 */
|
||||||
|
private String summary;
|
||||||
|
/** 创建时间(ISO-8601 文本) */
|
||||||
|
private String createTime;
|
||||||
|
/** 是否已读 */
|
||||||
|
private boolean read;
|
||||||
|
|
||||||
|
public long getMessageId() {
|
||||||
|
return messageId;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setMessageId(long messageId) {
|
||||||
|
this.messageId = messageId;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getCategory() {
|
||||||
|
return category;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setCategory(String category) {
|
||||||
|
this.category = category;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getTitle() {
|
||||||
|
return title;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setTitle(String title) {
|
||||||
|
this.title = title;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getSummary() {
|
||||||
|
return summary;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setSummary(String summary) {
|
||||||
|
this.summary = summary;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getCreateTime() {
|
||||||
|
return createTime;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setCreateTime(String createTime) {
|
||||||
|
this.createTime = createTime;
|
||||||
|
}
|
||||||
|
|
||||||
|
public boolean isRead() {
|
||||||
|
return read;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setRead(boolean read) {
|
||||||
|
this.read = read;
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1,36 @@
|
|||||||
|
package com.ckkj.griddlebiz.mine.mvp;
|
||||||
|
|
||||||
|
import com.ckkj.griddlebiz.base.IView;
|
||||||
|
import com.ckkj.griddlebiz.mine.entity.MessageItemEntity;
|
||||||
|
import com.ckkj.griddlebiz.network.PageResult;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 消息中心页面的 MVP 协议。
|
||||||
|
*/
|
||||||
|
public class MessageContract {
|
||||||
|
|
||||||
|
public interface CallBack<T> {
|
||||||
|
void success(T data);
|
||||||
|
|
||||||
|
void fail(String message);
|
||||||
|
}
|
||||||
|
|
||||||
|
public interface DataModel {
|
||||||
|
/**
|
||||||
|
* 消息分页(文档 10.1):按时间倒序返回
|
||||||
|
*
|
||||||
|
* @param page 页码,从 1 开始
|
||||||
|
* @param size 每页条数
|
||||||
|
*/
|
||||||
|
void getMessages(int page, int size,
|
||||||
|
CallBack<PageResult<MessageItemEntity>> callBack);
|
||||||
|
}
|
||||||
|
|
||||||
|
public interface MessageView extends IView {
|
||||||
|
// 分页加载成功,pageNum 为本次请求的页码
|
||||||
|
void showMessages(PageResult<MessageItemEntity> page, int pageNum);
|
||||||
|
|
||||||
|
// 分页加载失败,pageNum 为本次请求的页码
|
||||||
|
void showMessagesError(String message, int pageNum);
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1,65 @@
|
|||||||
|
package com.ckkj.griddlebiz.mine.mvp;
|
||||||
|
|
||||||
|
import com.ckkj.griddlebiz.mine.entity.MessageItemEntity;
|
||||||
|
import com.ckkj.griddlebiz.network.BaseBean;
|
||||||
|
import com.ckkj.griddlebiz.network.NetWorkManager;
|
||||||
|
import com.ckkj.griddlebiz.network.PageResult;
|
||||||
|
|
||||||
|
import java.util.HashMap;
|
||||||
|
import java.util.Map;
|
||||||
|
|
||||||
|
import io.reactivex.Observer;
|
||||||
|
import io.reactivex.android.schedulers.AndroidSchedulers;
|
||||||
|
import io.reactivex.annotations.NonNull;
|
||||||
|
import io.reactivex.disposables.Disposable;
|
||||||
|
import io.reactivex.schedulers.Schedulers;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 消息中心数据层。
|
||||||
|
*/
|
||||||
|
public class MessageImpl implements MessageContract.DataModel {
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 消息分页(文档 10.1)
|
||||||
|
*/
|
||||||
|
@Override
|
||||||
|
public void getMessages(int page, int size,
|
||||||
|
MessageContract.CallBack<PageResult<MessageItemEntity>> callBack) {
|
||||||
|
try {
|
||||||
|
Map<String, Object> params = new HashMap<>();
|
||||||
|
params.put("page", page);
|
||||||
|
params.put("size", size);
|
||||||
|
NetWorkManager.getRequest()
|
||||||
|
.getAgentMessages(NetWorkManager.getToken(), params)
|
||||||
|
.subscribeOn(Schedulers.io())
|
||||||
|
.unsubscribeOn(Schedulers.io())
|
||||||
|
.observeOn(AndroidSchedulers.mainThread())
|
||||||
|
.subscribe(new Observer<BaseBean<PageResult<MessageItemEntity>>>() {
|
||||||
|
@Override
|
||||||
|
public void onSubscribe(@NonNull Disposable d) {
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void onNext(@NonNull BaseBean<PageResult<MessageItemEntity>> bean) {
|
||||||
|
if (bean.getCode() == 200 && bean.getData() != null) {
|
||||||
|
callBack.success(bean.getData());
|
||||||
|
} else {
|
||||||
|
callBack.fail(bean.getMessage());
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void onError(@NonNull Throwable e) {
|
||||||
|
callBack.fail(e.getMessage());
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void onComplete() {
|
||||||
|
}
|
||||||
|
});
|
||||||
|
} catch (Exception e) {
|
||||||
|
e.printStackTrace();
|
||||||
|
callBack.fail(e.getMessage());
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1,42 @@
|
|||||||
|
package com.ckkj.griddlebiz.mine.mvp;
|
||||||
|
|
||||||
|
import com.ckkj.griddlebiz.base.BasePresenter;
|
||||||
|
import com.ckkj.griddlebiz.mine.entity.MessageItemEntity;
|
||||||
|
import com.ckkj.griddlebiz.network.PageResult;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 消息中心业务处理。
|
||||||
|
*/
|
||||||
|
public class MessagePresenter extends BasePresenter<MessageContract.MessageView> {
|
||||||
|
|
||||||
|
private final MessageImpl mImpl;
|
||||||
|
|
||||||
|
public MessagePresenter(MessageImpl impl) {
|
||||||
|
this.mImpl = impl;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 消息分页(文档 10.1)
|
||||||
|
*
|
||||||
|
* @param page 页码,从 1 开始
|
||||||
|
* @param size 每页条数
|
||||||
|
*/
|
||||||
|
public void getMessages(int page, int size) {
|
||||||
|
mImpl.getMessages(page, size,
|
||||||
|
new MessageContract.CallBack<PageResult<MessageItemEntity>>() {
|
||||||
|
@Override
|
||||||
|
public void success(PageResult<MessageItemEntity> data) {
|
||||||
|
if (getView() != null) {
|
||||||
|
getView().showMessages(data, page);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void fail(String message) {
|
||||||
|
if (getView() != null) {
|
||||||
|
getView().showMessagesError(message, page);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
});
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -16,12 +16,18 @@ import com.ckkj.griddlebiz.main.entity.ProfileEntity;
|
|||||||
import com.ckkj.griddlebiz.main.entity.SummaryEntity;
|
import com.ckkj.griddlebiz.main.entity.SummaryEntity;
|
||||||
import com.ckkj.griddlebiz.main.entity.CheckVersionEntity;
|
import com.ckkj.griddlebiz.main.entity.CheckVersionEntity;
|
||||||
import com.ckkj.griddlebiz.main.entity.DeviceEntity;
|
import com.ckkj.griddlebiz.main.entity.DeviceEntity;
|
||||||
|
import com.ckkj.griddlebiz.mine.entity.MessageItemEntity;
|
||||||
import com.ckkj.griddlebiz.mine.entity.ProfileBo;
|
import com.ckkj.griddlebiz.mine.entity.ProfileBo;
|
||||||
import com.ckkj.griddlebiz.plate.entity.BaziResultBean;
|
import com.ckkj.griddlebiz.plate.entity.BaziResultBean;
|
||||||
import com.ckkj.griddlebiz.plate.entity.BaziSaveSuccessEntity;
|
import com.ckkj.griddlebiz.plate.entity.BaziSaveSuccessEntity;
|
||||||
import com.ckkj.griddlebiz.plate.entity.PaipanHistoryEntity;
|
import com.ckkj.griddlebiz.plate.entity.PaipanHistoryEntity;
|
||||||
|
import com.ckkj.griddlebiz.pickup.entity.PickupOrderEntity;
|
||||||
import com.ckkj.griddlebiz.pickup.entity.PickupPreviewEntity;
|
import com.ckkj.griddlebiz.pickup.entity.PickupPreviewEntity;
|
||||||
|
import com.ckkj.griddlebiz.pickup.entity.PickupStockOutResultEntity;
|
||||||
|
import com.ckkj.griddlebiz.pickup.entity.PickupVerifyResultEntity;
|
||||||
import com.ckkj.griddlebiz.product.entity.ScanPreviewEntity;
|
import com.ckkj.griddlebiz.product.entity.ScanPreviewEntity;
|
||||||
|
import com.ckkj.griddlebiz.user.entity.CustomerDetailEntity;
|
||||||
|
import com.ckkj.griddlebiz.user.entity.CustomerEntity;
|
||||||
|
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
import java.util.Map;
|
import java.util.Map;
|
||||||
@@ -135,14 +141,34 @@ public interface Request {
|
|||||||
@POST("app/agent/products/stock-in")
|
@POST("app/agent/products/stock-in")
|
||||||
Observable<BaseBean> stockInProducts(@HeaderMap Map<String, String> headMap,
|
Observable<BaseBean> stockInProducts(@HeaderMap Map<String, String> headMap,
|
||||||
@Body RequestBody body);
|
@Body RequestBody body);
|
||||||
// 扫提货码预览(文档 6.3)
|
// 提货订单分页(文档 7.1)
|
||||||
|
@GET("app/agent/orders")
|
||||||
|
Observable<BaseBean<PageResult<PickupOrderEntity>>> getAgentOrders(
|
||||||
|
@HeaderMap Map<String, String> headMap, @QueryMap Map<String, Object> params);
|
||||||
|
// 扫提货码预览(文档 7.3)
|
||||||
@POST("app/agent/orders/preview")
|
@POST("app/agent/orders/preview")
|
||||||
Observable<BaseBean<PickupPreviewEntity>> previewPickupOrder(
|
Observable<BaseBean<PickupPreviewEntity>> previewPickupOrder(
|
||||||
@HeaderMap Map<String, String> headMap, @Body RequestBody body);
|
@HeaderMap Map<String, String> headMap, @Body RequestBody body);
|
||||||
// 整单核销(文档 6.4)
|
// 提货码核销(文档 7.4)
|
||||||
@POST("app/agent/orders/verify")
|
@POST("app/agent/orders/verify")
|
||||||
Observable<BaseBean> verifyPickupOrder(@HeaderMap Map<String, String> headMap,
|
Observable<BaseBean<PickupVerifyResultEntity>> verifyPickupOrder(
|
||||||
@Body RequestBody body);
|
@HeaderMap Map<String, String> headMap, @Body RequestBody body);
|
||||||
|
// 扫设备 SN 出库售出(文档 7.5)
|
||||||
|
@POST("app/agent/orders/stock-out")
|
||||||
|
Observable<BaseBean<PickupStockOutResultEntity>> stockOutPickupOrder(
|
||||||
|
@HeaderMap Map<String, String> headMap, @Body RequestBody body);
|
||||||
|
// 消息分页(文档 10.1)
|
||||||
|
@GET("app/agent/messages")
|
||||||
|
Observable<BaseBean<PageResult<MessageItemEntity>>> getAgentMessages(
|
||||||
|
@HeaderMap Map<String, String> headMap, @QueryMap Map<String, Object> params);
|
||||||
|
// 客户分页(文档 9.1)
|
||||||
|
@GET("app/agent/customers")
|
||||||
|
Observable<BaseBean<PageResult<CustomerEntity>>> getAgentCustomers(
|
||||||
|
@HeaderMap Map<String, String> headMap, @QueryMap Map<String, Object> params);
|
||||||
|
// 客户详情(文档 9.2)
|
||||||
|
@GET("app/agent/customers/{userId}")
|
||||||
|
Observable<BaseBean<CustomerDetailEntity>> getAgentCustomerDetail(
|
||||||
|
@HeaderMap Map<String, String> headMap, @Path("userId") long userId);
|
||||||
// 手机号注册,邀请码临时使用 visCode 字段
|
// 手机号注册,邀请码临时使用 visCode 字段
|
||||||
@POST("app/auth/register")
|
@POST("app/auth/register")
|
||||||
Observable<BaseBean> registerByPhone(@Body RequestBody requestBody);
|
Observable<BaseBean> registerByPhone(@Body RequestBody requestBody);
|
||||||
|
|||||||
@@ -5,20 +5,54 @@ import android.os.Bundle;
|
|||||||
import android.view.View;
|
import android.view.View;
|
||||||
import android.widget.TextView;
|
import android.widget.TextView;
|
||||||
|
|
||||||
|
import androidx.recyclerview.widget.LinearLayoutManager;
|
||||||
|
|
||||||
import com.ckkj.griddlebiz.R;
|
import com.ckkj.griddlebiz.R;
|
||||||
import com.ckkj.griddlebiz.base.BaseActivityNoP;
|
import com.ckkj.griddlebiz.base.BaseActivity;
|
||||||
|
import com.ckkj.griddlebiz.custom.view.CustomRefreshHeader;
|
||||||
|
import com.ckkj.griddlebiz.databinding.PickupOrderStatsHeaderBinding;
|
||||||
import com.ckkj.griddlebiz.databinding.PickupOrderStatsLayoutBinding;
|
import com.ckkj.griddlebiz.databinding.PickupOrderStatsLayoutBinding;
|
||||||
import com.ckkj.griddlebiz.network.BaseBean;
|
import com.ckkj.griddlebiz.network.BaseBean;
|
||||||
|
import com.ckkj.griddlebiz.network.PageResult;
|
||||||
|
import com.ckkj.griddlebiz.pickup.adapter.PickupOrderAdapter;
|
||||||
|
import com.ckkj.griddlebiz.pickup.entity.PickupOrderEntity;
|
||||||
|
import com.ckkj.griddlebiz.pickup.mvp.PickupOrderStatsContract;
|
||||||
|
import com.ckkj.griddlebiz.pickup.mvp.PickupOrderStatsImpl;
|
||||||
|
import com.ckkj.griddlebiz.pickup.mvp.PickupOrderStatsPresenter;
|
||||||
import com.ckkj.griddlebiz.utils.show.ToastUtil;
|
import com.ckkj.griddlebiz.utils.show.ToastUtil;
|
||||||
import com.gyf.immersionbar.ImmersionBar;
|
import com.gyf.immersionbar.ImmersionBar;
|
||||||
|
import com.scwang.smart.refresh.footer.ClassicsFooter;
|
||||||
|
|
||||||
|
import java.util.ArrayList;
|
||||||
|
import java.util.LinkedHashMap;
|
||||||
|
import java.util.Map;
|
||||||
|
|
||||||
import butterknife.OnClick;
|
import butterknife.OnClick;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 提货订单统计:展示累计提货数据、时间维度筛选与核销记录列表。
|
* 提货订单统计:展示累计数据与已核销记录,支持下拉刷新与上拉加载更多。
|
||||||
* 页面数据目前使用设计稿示例,后续接入统计接口时替换。
|
|
||||||
*/
|
*/
|
||||||
public class PickupOrderStatsActivity extends BaseActivityNoP<PickupOrderStatsLayoutBinding> {
|
public class PickupOrderStatsActivity
|
||||||
|
extends BaseActivity<PickupOrderStatsLayoutBinding, PickupOrderStatsPresenter>
|
||||||
|
implements PickupOrderStatsContract.StatsView {
|
||||||
|
|
||||||
|
/** 每页条数,与接口 size 参数一致 */
|
||||||
|
private static final int PAGE_SIZE = 20;
|
||||||
|
|
||||||
|
/** 统计头部作为列表 header 复用,不占用独立滚动容器 */
|
||||||
|
private PickupOrderStatsHeaderBinding mHeader;
|
||||||
|
private PickupOrderAdapter mAdapter;
|
||||||
|
/** 已成功加载到的页码,0 表示尚未加载 */
|
||||||
|
private int mLoadedPage;
|
||||||
|
/** 是否有分页请求正在执行 */
|
||||||
|
private boolean mLoading;
|
||||||
|
/** 是否已没有更多数据 */
|
||||||
|
private boolean mNoMore;
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public PickupOrderStatsPresenter createPresenter() {
|
||||||
|
return new PickupOrderStatsPresenter(new PickupOrderStatsImpl());
|
||||||
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public int getLayoutResId(Bundle savedInstanceState) {
|
public int getLayoutResId(Bundle savedInstanceState) {
|
||||||
@@ -33,22 +67,46 @@ public class PickupOrderStatsActivity extends BaseActivityNoP<PickupOrderStatsLa
|
|||||||
.statusBarDarkFont(true)
|
.statusBarDarkFont(true)
|
||||||
.init();
|
.init();
|
||||||
|
|
||||||
// 累计兑换积分与核销记录数
|
mAdapter = new PickupOrderAdapter(this);
|
||||||
viewBinding.tvTotalPoints.setText(
|
initHeader();
|
||||||
getString(R.string.pickup_stats_total_points, "128,000"));
|
mAdapter.addHeaderView(mHeader.getRoot());
|
||||||
viewBinding.tvRecordsCount.setText(
|
viewBinding.rvOrders.setLayoutManager(new LinearLayoutManager(this));
|
||||||
getString(R.string.pickup_stats_records_count, "1,280"));
|
viewBinding.rvOrders.setItemAnimator(null);
|
||||||
|
viewBinding.rvOrders.setAdapter(mAdapter);
|
||||||
|
|
||||||
// 默认选中"全部"时间维度
|
initRefresh();
|
||||||
updateChipGroup(R.id.chip_all, viewBinding.chipAll, viewBinding.chipToday,
|
requestPage(1);
|
||||||
viewBinding.chipWeek, viewBinding.chipMonth);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 提货订单统计页点击事件。
|
* 初始化统计头部:时间筛选与导出按钮都挂在 header 上
|
||||||
*/
|
*/
|
||||||
@OnClick({R.id.iv_back, R.id.btn_download, R.id.chip_all, R.id.chip_today,
|
private void initHeader() {
|
||||||
R.id.chip_week, R.id.chip_month})
|
mHeader = PickupOrderStatsHeaderBinding.inflate(getLayoutInflater());
|
||||||
|
// 接口没有时间维度参数,筛选仅保留选中状态
|
||||||
|
updateChipGroup(R.id.chip_all, mHeader.chipAll, mHeader.chipToday,
|
||||||
|
mHeader.chipWeek, mHeader.chipMonth);
|
||||||
|
mHeader.chipAll.setOnClickListener(v -> updateChipGroup(R.id.chip_all,
|
||||||
|
mHeader.chipAll, mHeader.chipToday, mHeader.chipWeek, mHeader.chipMonth));
|
||||||
|
mHeader.chipToday.setOnClickListener(v -> updateChipGroup(R.id.chip_today,
|
||||||
|
mHeader.chipAll, mHeader.chipToday, mHeader.chipWeek, mHeader.chipMonth));
|
||||||
|
mHeader.chipWeek.setOnClickListener(v -> updateChipGroup(R.id.chip_week,
|
||||||
|
mHeader.chipAll, mHeader.chipToday, mHeader.chipWeek, mHeader.chipMonth));
|
||||||
|
mHeader.chipMonth.setOnClickListener(v -> updateChipGroup(R.id.chip_month,
|
||||||
|
mHeader.chipAll, mHeader.chipToday, mHeader.chipWeek, mHeader.chipMonth));
|
||||||
|
|
||||||
|
// 导出接口暂未提供
|
||||||
|
mHeader.btnDownload.setOnClickListener(v -> ToastUtil.showShort(mContext,
|
||||||
|
R.string.pickup_stats_export_unavailable));
|
||||||
|
|
||||||
|
// 累计积分为汇总数据,接口未提供聚合字段
|
||||||
|
mHeader.tvTotalPoints.setText(getString(R.string.pickup_stats_total_points, "--"));
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 提货统计页点击事件。
|
||||||
|
*/
|
||||||
|
@OnClick(R.id.iv_back)
|
||||||
public void onClick(View v) {
|
public void onClick(View v) {
|
||||||
switch (v.getId()) {
|
switch (v.getId()) {
|
||||||
case R.id.iv_back:
|
case R.id.iv_back:
|
||||||
@@ -56,27 +114,13 @@ public class PickupOrderStatsActivity extends BaseActivityNoP<PickupOrderStatsLa
|
|||||||
finish();
|
finish();
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case R.id.btn_download:
|
|
||||||
// 导出核销记录,接口待接入
|
|
||||||
ToastUtil.showShort(mContext, R.string.pickup_stats_export_unavailable);
|
|
||||||
break;
|
|
||||||
|
|
||||||
case R.id.chip_all:
|
|
||||||
case R.id.chip_today:
|
|
||||||
case R.id.chip_week:
|
|
||||||
case R.id.chip_month:
|
|
||||||
// 切换时间维度,同一时间只能选中一个
|
|
||||||
updateChipGroup(v.getId(), viewBinding.chipAll, viewBinding.chipToday,
|
|
||||||
viewBinding.chipWeek, viewBinding.chipMonth);
|
|
||||||
break;
|
|
||||||
|
|
||||||
default:
|
default:
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 更新筛选项选中状态,选中项使用白色文字与主色背景。
|
* 更新筛选项选中状态,同一时间只能选中一个
|
||||||
*/
|
*/
|
||||||
private void updateChipGroup(int selectedId, View... chips) {
|
private void updateChipGroup(int selectedId, View... chips) {
|
||||||
for (View chip : chips) {
|
for (View chip : chips) {
|
||||||
@@ -91,15 +135,122 @@ public class PickupOrderStatsActivity extends BaseActivityNoP<PickupOrderStatsLa
|
|||||||
selected ? "sans-serif-medium" : "sans-serif", Typeface.NORMAL));
|
selected ? "sans-serif-medium" : "sans-serif", Typeface.NORMAL));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 初始化下拉刷新与上拉加载:首屏未加载完成前不允许上拉。
|
||||||
|
*/
|
||||||
|
private void initRefresh() {
|
||||||
|
viewBinding.refreshOrders.setRefreshHeader(new CustomRefreshHeader(mContext));
|
||||||
|
viewBinding.refreshOrders.setRefreshFooter(new ClassicsFooter(mContext));
|
||||||
|
viewBinding.refreshOrders.setEnableLoadMore(false);
|
||||||
|
viewBinding.refreshOrders.setEnableLoadMoreWhenContentNotFull(true);
|
||||||
|
viewBinding.refreshOrders.setOnRefreshListener(refresh -> requestPage(1));
|
||||||
|
viewBinding.refreshOrders.setOnLoadMoreListener(refresh -> {
|
||||||
|
if (!mLoading && !mNoMore && mLoadedPage > 0) {
|
||||||
|
requestPage(mLoadedPage + 1);
|
||||||
|
} else {
|
||||||
|
refresh.finishLoadMore();
|
||||||
|
}
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 分页请求入口:刷新失败时保留当前记录和已成功加载的页码
|
||||||
|
*/
|
||||||
|
private void requestPage(int page) {
|
||||||
|
if (page > 1 && mLoading) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
mLoading = true;
|
||||||
|
if (page == 1) {
|
||||||
|
viewBinding.refreshOrders.finishLoadMore();
|
||||||
|
viewBinding.refreshOrders.setNoMoreData(false);
|
||||||
|
viewBinding.refreshOrders.setEnableLoadMore(false);
|
||||||
|
}
|
||||||
|
// 首屏还没有数据时展示加载提示
|
||||||
|
if (mAdapter.getData().isEmpty()) {
|
||||||
|
viewBinding.tvOrderState.setText(R.string.pickup_stats_loading);
|
||||||
|
viewBinding.tvOrderState.setVisibility(View.VISIBLE);
|
||||||
|
}
|
||||||
|
mPresenter.getOrders(page, PAGE_SIZE);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void showOrders(PageResult<PickupOrderEntity> page, int pageNum) {
|
||||||
|
int oldCount = mAdapter.getData().size();
|
||||||
|
// 按订单 ID 去重合并,避免翻页期间数据变动导致重复条目
|
||||||
|
Map<Long, PickupOrderEntity> merged = new LinkedHashMap<>();
|
||||||
|
if (pageNum > 1) {
|
||||||
|
for (PickupOrderEntity item : mAdapter.getData()) {
|
||||||
|
merged.put(item.getOrderId(), item);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
if (page.getRows() != null) {
|
||||||
|
for (PickupOrderEntity item : page.getRows()) {
|
||||||
|
merged.put(item.getOrderId(), item);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
mAdapter.setNewData(new ArrayList<>(merged.values()));
|
||||||
|
mLoadedPage = pageNum;
|
||||||
|
|
||||||
|
// 本页不满一页或已达到总数,说明没有更多数据
|
||||||
|
boolean fullPage = page.getRows() != null && page.getRows().size() >= PAGE_SIZE;
|
||||||
|
boolean reachTotal = page.getTotal() > 0 && merged.size() >= page.getTotal();
|
||||||
|
mNoMore = !fullPage || reachTotal;
|
||||||
|
if (pageNum > 1 && merged.size() == oldCount) {
|
||||||
|
mNoMore = true;
|
||||||
|
}
|
||||||
|
|
||||||
|
// 头部总单数与核销记录数使用接口返回的总条数
|
||||||
|
long total = page.getTotal() > 0 ? page.getTotal() : merged.size();
|
||||||
|
mHeader.tvTotalOrders.setText(String.valueOf(total));
|
||||||
|
mHeader.tvRecordsCount.setText(getString(R.string.pickup_stats_records_count,
|
||||||
|
String.valueOf(total)));
|
||||||
|
|
||||||
|
viewBinding.tvOrderState.setText(R.string.pickup_stats_empty);
|
||||||
|
viewBinding.tvOrderState.setVisibility(merged.isEmpty() ? View.VISIBLE : View.GONE);
|
||||||
|
finishPage(pageNum, true);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void showOrdersError(String message, int pageNum) {
|
||||||
|
finishPage(pageNum, false);
|
||||||
|
showError(message);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 结束本次分页加载:刷新与加载更多的失败态由框架分别展示
|
||||||
|
*/
|
||||||
|
private void finishPage(int page, boolean success) {
|
||||||
|
mLoading = false;
|
||||||
|
if (page == 1) {
|
||||||
|
viewBinding.refreshOrders.finishRefresh(success);
|
||||||
|
} else {
|
||||||
|
viewBinding.refreshOrders.finishLoadMore(success);
|
||||||
|
}
|
||||||
|
viewBinding.refreshOrders.setEnableLoadMore(!mAdapter.getData().isEmpty());
|
||||||
|
viewBinding.refreshOrders.setNoMoreData(mNoMore);
|
||||||
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void showError(String message) {
|
public void showError(String message) {
|
||||||
hideLoading();
|
String error = message == null || message.isEmpty()
|
||||||
if (message != null && !message.isEmpty()) {
|
? getString(R.string.pickup_stats_load_failed) : message;
|
||||||
ToastUtil.showShort(mContext, message);
|
// 列表为空时用空态文案兜底,避免只弹一次 Toast 后页面空白
|
||||||
|
if (mAdapter != null && mAdapter.getData().isEmpty()) {
|
||||||
|
viewBinding.tvOrderState.setText(error);
|
||||||
|
viewBinding.tvOrderState.setVisibility(View.VISIBLE);
|
||||||
}
|
}
|
||||||
|
ToastUtil.showShort(mContext, error);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void logOut(BaseBean bean) {
|
public void logOut(BaseBean bean) {
|
||||||
|
// 登录失效沿用父类统一处理。
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
protected void onDestroy() {
|
||||||
|
viewBinding.rvOrders.setAdapter(null);
|
||||||
|
super.onDestroy();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -11,28 +11,24 @@ import android.view.inputmethod.EditorInfo;
|
|||||||
import android.view.inputmethod.InputMethodManager;
|
import android.view.inputmethod.InputMethodManager;
|
||||||
import android.widget.EditText;
|
import android.widget.EditText;
|
||||||
|
|
||||||
import androidx.activity.result.ActivityResultLauncher;
|
|
||||||
import androidx.activity.result.contract.ActivityResultContracts;
|
|
||||||
|
|
||||||
import com.ckkj.griddlebiz.R;
|
import com.ckkj.griddlebiz.R;
|
||||||
import com.ckkj.griddlebiz.base.BaseActivity;
|
import com.ckkj.griddlebiz.base.BaseActivity;
|
||||||
import com.ckkj.griddlebiz.databinding.PickupVerifyLayoutBinding;
|
import com.ckkj.griddlebiz.databinding.PickupVerifyLayoutBinding;
|
||||||
import com.ckkj.griddlebiz.network.BaseBean;
|
import com.ckkj.griddlebiz.network.BaseBean;
|
||||||
import com.ckkj.griddlebiz.pickup.entity.PickupPreviewEntity;
|
import com.ckkj.griddlebiz.pickup.entity.PickupPreviewEntity;
|
||||||
|
import com.ckkj.griddlebiz.pickup.entity.PickupVerifyResultEntity;
|
||||||
import com.ckkj.griddlebiz.pickup.mvp.PickupVerifyContract;
|
import com.ckkj.griddlebiz.pickup.mvp.PickupVerifyContract;
|
||||||
import com.ckkj.griddlebiz.pickup.mvp.PickupVerifyImpl;
|
import com.ckkj.griddlebiz.pickup.mvp.PickupVerifyImpl;
|
||||||
import com.ckkj.griddlebiz.pickup.mvp.PickupVerifyPresenter;
|
import com.ckkj.griddlebiz.pickup.mvp.PickupVerifyPresenter;
|
||||||
import com.ckkj.griddlebiz.product.ProductScanActivity;
|
|
||||||
import com.ckkj.griddlebiz.utils.show.ToastUtil;
|
import com.ckkj.griddlebiz.utils.show.ToastUtil;
|
||||||
import com.gyf.immersionbar.ImmersionBar;
|
import com.gyf.immersionbar.ImmersionBar;
|
||||||
import com.king.camera.scan.CameraScan;
|
|
||||||
|
|
||||||
import java.util.Collections;
|
|
||||||
|
|
||||||
import butterknife.OnClick;
|
import butterknife.OnClick;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 提货核销:输入 6 位提货码查询订单(文档 6.3),确认后整单核销(文档 6.4)。
|
* 提货核销:输入 6 位提货码查询订单(文档 7.3),确认后核销提货码(文档 7.4)。
|
||||||
|
* <p>
|
||||||
|
* 核销只把订单状态改为已提货;设备出库由 stock-out 接口单独处理。
|
||||||
*/
|
*/
|
||||||
public class PickupVerifyActivity
|
public class PickupVerifyActivity
|
||||||
extends BaseActivity<PickupVerifyLayoutBinding, PickupVerifyPresenter>
|
extends BaseActivity<PickupVerifyLayoutBinding, PickupVerifyPresenter>
|
||||||
@@ -46,22 +42,6 @@ public class PickupVerifyActivity
|
|||||||
private PickupPreviewEntity mPreview;
|
private PickupPreviewEntity mPreview;
|
||||||
private String mPickupCode = "";
|
private String mPickupCode = "";
|
||||||
|
|
||||||
/** 扫码入口:复用商品入库的扫码页,从扫码结果中提取 6 位数字。 */
|
|
||||||
private final ActivityResultLauncher<Intent> mScanLauncher = registerForActivityResult(
|
|
||||||
new ActivityResultContracts.StartActivityForResult(), result -> {
|
|
||||||
if (result.getResultCode() != RESULT_OK || result.getData() == null) {
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
String raw = result.getData().getStringExtra(CameraScan.SCAN_RESULT);
|
|
||||||
String digits = raw == null ? "" : raw.replaceAll("[^0-9]", "");
|
|
||||||
if (digits.length() < CODE_LENGTH) {
|
|
||||||
ToastUtil.showShort(mContext, R.string.pickup_scan_invalid);
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
fillCode(digits.substring(0, CODE_LENGTH));
|
|
||||||
queryOrder();
|
|
||||||
});
|
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public PickupVerifyPresenter createPresenter() {
|
public PickupVerifyPresenter createPresenter() {
|
||||||
return new PickupVerifyPresenter(new PickupVerifyImpl());
|
return new PickupVerifyPresenter(new PickupVerifyImpl());
|
||||||
@@ -100,8 +80,8 @@ public class PickupVerifyActivity
|
|||||||
break;
|
break;
|
||||||
|
|
||||||
case R.id.iv_scan:
|
case R.id.iv_scan:
|
||||||
// 打开扫码页,扫描用户提货码
|
// 跳转提货订单统计
|
||||||
mScanLauncher.launch(new Intent(this, ProductScanActivity.class));
|
startActivity(new Intent(mContext, PickupOrderStatsActivity.class));
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case R.id.btn_query:
|
case R.id.btn_query:
|
||||||
@@ -110,7 +90,7 @@ public class PickupVerifyActivity
|
|||||||
break;
|
break;
|
||||||
|
|
||||||
case R.id.btn_confirm:
|
case R.id.btn_confirm:
|
||||||
// 确认核销并发货
|
// 确认核销提货码
|
||||||
confirmVerify();
|
confirmVerify();
|
||||||
break;
|
break;
|
||||||
|
|
||||||
@@ -167,7 +147,7 @@ public class PickupVerifyActivity
|
|||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 查询订单(文档 6.3):校验 6 位提货码后请求预览接口
|
* 查询订单(文档 7.3):校验 6 位提货码后请求预览接口
|
||||||
*/
|
*/
|
||||||
private void queryOrder() {
|
private void queryOrder() {
|
||||||
String code = getCode();
|
String code = getCode();
|
||||||
@@ -217,7 +197,7 @@ public class PickupVerifyActivity
|
|||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 确认核销(文档 6.4)
|
* 确认核销(文档 7.4):只提交提货码,不再传设备 SN
|
||||||
*/
|
*/
|
||||||
private void confirmVerify() {
|
private void confirmVerify() {
|
||||||
if (mPreview == null || TextUtils.isEmpty(mPickupCode)) {
|
if (mPreview == null || TextUtils.isEmpty(mPickupCode)) {
|
||||||
@@ -227,13 +207,12 @@ public class PickupVerifyActivity
|
|||||||
ToastUtil.showShort(mContext, R.string.pickup_not_pickupable);
|
ToastUtil.showShort(mContext, R.string.pickup_not_pickupable);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
// TODO 6.4 需要与订单数量一致的设备 SN,当前页面暂无扫码采集入口,先传空列表
|
|
||||||
showLoadingDialog();
|
showLoadingDialog();
|
||||||
mPresenter.verifyOrder(mPickupCode, Collections.emptyList());
|
mPresenter.verifyOrder(mPickupCode);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void onVerifySuccess() {
|
public void onVerifySuccess(PickupVerifyResultEntity result) {
|
||||||
hideDialogLoading();
|
hideDialogLoading();
|
||||||
ToastUtil.showShort(mContext, R.string.pickup_verify_success);
|
ToastUtil.showShort(mContext, R.string.pickup_verify_success);
|
||||||
finish();
|
finish();
|
||||||
@@ -250,16 +229,6 @@ public class PickupVerifyActivity
|
|||||||
return builder.toString();
|
return builder.toString();
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
|
||||||
* 将扫码结果填入 6 个输入框。
|
|
||||||
*/
|
|
||||||
private void fillCode(String code) {
|
|
||||||
for (int i = 0; i < mCodeInputs.length && i < code.length(); i++) {
|
|
||||||
mCodeInputs[i].setText(String.valueOf(code.charAt(i)));
|
|
||||||
}
|
|
||||||
mCodeInputs[mCodeInputs.length - 1].requestFocus();
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 提货码按 3+3 分组展示。
|
* 提货码按 3+3 分组展示。
|
||||||
*/
|
*/
|
||||||
|
|||||||
@@ -0,0 +1,50 @@
|
|||||||
|
package com.ckkj.griddlebiz.pickup.adapter;
|
||||||
|
|
||||||
|
import android.content.Context;
|
||||||
|
import android.text.TextUtils;
|
||||||
|
|
||||||
|
import com.chad.library.adapter.base.BaseQuickAdapter;
|
||||||
|
import com.chad.library.adapter.base.BaseViewHolder;
|
||||||
|
import com.ckkj.griddlebiz.R;
|
||||||
|
import com.ckkj.griddlebiz.pickup.entity.PickupOrderEntity;
|
||||||
|
|
||||||
|
import java.util.ArrayList;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 核销记录适配器:展示消费者、商品、核销时间、消耗积分与订单号。
|
||||||
|
*/
|
||||||
|
public class PickupOrderAdapter extends BaseQuickAdapter<PickupOrderEntity, BaseViewHolder> {
|
||||||
|
|
||||||
|
private final Context mContext;
|
||||||
|
|
||||||
|
public PickupOrderAdapter(Context context) {
|
||||||
|
super(R.layout.item_pickup_order, new ArrayList<>());
|
||||||
|
this.mContext = context;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
protected void convert(BaseViewHolder holder, PickupOrderEntity item) {
|
||||||
|
holder.setText(R.id.tv_order_customer, safeText(item.getCustomerName()));
|
||||||
|
holder.setText(R.id.tv_order_goods, mContext.getString(R.string.pickup_stats_goods,
|
||||||
|
safeText(item.getGoodsName()), item.getNum()));
|
||||||
|
holder.setText(R.id.tv_order_time, formatTime(item.getOrderTime()));
|
||||||
|
holder.setText(R.id.tv_order_points, mContext.getString(
|
||||||
|
R.string.pickup_stats_order_points, item.getConsumePoints()));
|
||||||
|
holder.setText(R.id.tv_order_no, safeText(item.getOrderNo()));
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 接口时间为 ISO-8601 文本,展示到秒
|
||||||
|
*/
|
||||||
|
private String formatTime(String value) {
|
||||||
|
if (TextUtils.isEmpty(value)) {
|
||||||
|
return "--";
|
||||||
|
}
|
||||||
|
String text = value.replace('T', ' ');
|
||||||
|
return text.length() > 19 ? text.substring(0, 19) : text;
|
||||||
|
}
|
||||||
|
|
||||||
|
private String safeText(String value) {
|
||||||
|
return TextUtils.isEmpty(value) ? "--" : value;
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1,121 @@
|
|||||||
|
package com.ckkj.griddlebiz.pickup.entity;
|
||||||
|
|
||||||
|
import java.io.Serializable;
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 提货订单(文档 7.1 IntegralOrder)。
|
||||||
|
*/
|
||||||
|
public class PickupOrderEntity implements Serializable {
|
||||||
|
|
||||||
|
/** 订单 ID */
|
||||||
|
private long orderId;
|
||||||
|
/** 订单号 */
|
||||||
|
private String orderNo;
|
||||||
|
/** 商品名称 */
|
||||||
|
private String goodsName;
|
||||||
|
/** 数量 */
|
||||||
|
private int num;
|
||||||
|
/** 消耗积分 */
|
||||||
|
private int consumePoints;
|
||||||
|
/** 消费者姓名 */
|
||||||
|
private String customerName;
|
||||||
|
/** 消费者手机号 */
|
||||||
|
private String customerPhone;
|
||||||
|
/** 状态:0 待提货 / 1 已提货 / 2 已取消 / 3 已发货 */
|
||||||
|
private int status;
|
||||||
|
/** 下单时间(ISO-8601 文本) */
|
||||||
|
private String orderTime;
|
||||||
|
/** 收货地址 */
|
||||||
|
private String receiveAddress;
|
||||||
|
/** 交付 SN,仅详情回填,列表为空 */
|
||||||
|
private List<String> deviceCodes;
|
||||||
|
|
||||||
|
public long getOrderId() {
|
||||||
|
return orderId;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setOrderId(long orderId) {
|
||||||
|
this.orderId = orderId;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getOrderNo() {
|
||||||
|
return orderNo;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setOrderNo(String orderNo) {
|
||||||
|
this.orderNo = orderNo;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getGoodsName() {
|
||||||
|
return goodsName;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setGoodsName(String goodsName) {
|
||||||
|
this.goodsName = goodsName;
|
||||||
|
}
|
||||||
|
|
||||||
|
public int getNum() {
|
||||||
|
return num;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setNum(int num) {
|
||||||
|
this.num = num;
|
||||||
|
}
|
||||||
|
|
||||||
|
public int getConsumePoints() {
|
||||||
|
return consumePoints;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setConsumePoints(int consumePoints) {
|
||||||
|
this.consumePoints = consumePoints;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getCustomerName() {
|
||||||
|
return customerName;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setCustomerName(String customerName) {
|
||||||
|
this.customerName = customerName;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getCustomerPhone() {
|
||||||
|
return customerPhone;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setCustomerPhone(String customerPhone) {
|
||||||
|
this.customerPhone = customerPhone;
|
||||||
|
}
|
||||||
|
|
||||||
|
public int getStatus() {
|
||||||
|
return status;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setStatus(int status) {
|
||||||
|
this.status = status;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getOrderTime() {
|
||||||
|
return orderTime;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setOrderTime(String orderTime) {
|
||||||
|
this.orderTime = orderTime;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getReceiveAddress() {
|
||||||
|
return receiveAddress;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setReceiveAddress(String receiveAddress) {
|
||||||
|
this.receiveAddress = receiveAddress;
|
||||||
|
}
|
||||||
|
|
||||||
|
public List<String> getDeviceCodes() {
|
||||||
|
return deviceCodes;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setDeviceCodes(List<String> deviceCodes) {
|
||||||
|
this.deviceCodes = deviceCodes;
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1,52 @@
|
|||||||
|
package com.ckkj.griddlebiz.pickup.entity;
|
||||||
|
|
||||||
|
import java.io.Serializable;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 扫设备 SN 出库售出结果(文档 7.5 Verification)。
|
||||||
|
* <p>
|
||||||
|
* 只保留页面用到的订单级字段,逐台交付明细 devices 暂不展示。
|
||||||
|
*/
|
||||||
|
public class PickupStockOutResultEntity implements Serializable {
|
||||||
|
|
||||||
|
/** 订单 ID */
|
||||||
|
private Long orderId;
|
||||||
|
/** 商城订单号 */
|
||||||
|
private String externalOrderNo;
|
||||||
|
/** 订单状态 */
|
||||||
|
private String status;
|
||||||
|
/** 出库时间 */
|
||||||
|
private String pickedAt;
|
||||||
|
|
||||||
|
public Long getOrderId() {
|
||||||
|
return orderId;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setOrderId(Long orderId) {
|
||||||
|
this.orderId = orderId;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getExternalOrderNo() {
|
||||||
|
return externalOrderNo;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setExternalOrderNo(String externalOrderNo) {
|
||||||
|
this.externalOrderNo = externalOrderNo;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getStatus() {
|
||||||
|
return status;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setStatus(String status) {
|
||||||
|
this.status = status;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getPickedAt() {
|
||||||
|
return pickedAt;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setPickedAt(String pickedAt) {
|
||||||
|
this.pickedAt = pickedAt;
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1,42 @@
|
|||||||
|
package com.ckkj.griddlebiz.pickup.entity;
|
||||||
|
|
||||||
|
import java.io.Serializable;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 提货码核销结果(文档 7.4 OrderVerification)。
|
||||||
|
* <p>
|
||||||
|
* 核销只把订单状态改为已提货,不包含设备交付信息;设备出库走单独的 stock-out 接口。
|
||||||
|
*/
|
||||||
|
public class PickupVerifyResultEntity implements Serializable {
|
||||||
|
|
||||||
|
/** 订单 ID */
|
||||||
|
private Long orderId;
|
||||||
|
/** 商城订单号 */
|
||||||
|
private String externalOrderNo;
|
||||||
|
/** 核销后状态 */
|
||||||
|
private String status;
|
||||||
|
|
||||||
|
public Long getOrderId() {
|
||||||
|
return orderId;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setOrderId(Long orderId) {
|
||||||
|
this.orderId = orderId;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getExternalOrderNo() {
|
||||||
|
return externalOrderNo;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setExternalOrderNo(String externalOrderNo) {
|
||||||
|
this.externalOrderNo = externalOrderNo;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getStatus() {
|
||||||
|
return status;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setStatus(String status) {
|
||||||
|
this.status = status;
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1,36 @@
|
|||||||
|
package com.ckkj.griddlebiz.pickup.mvp;
|
||||||
|
|
||||||
|
import com.ckkj.griddlebiz.base.IView;
|
||||||
|
import com.ckkj.griddlebiz.network.PageResult;
|
||||||
|
import com.ckkj.griddlebiz.pickup.entity.PickupOrderEntity;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 提货订单统计页面的 MVP 协议。
|
||||||
|
*/
|
||||||
|
public class PickupOrderStatsContract {
|
||||||
|
|
||||||
|
public interface CallBack<T> {
|
||||||
|
void success(T data);
|
||||||
|
|
||||||
|
void fail(String message);
|
||||||
|
}
|
||||||
|
|
||||||
|
public interface DataModel {
|
||||||
|
/**
|
||||||
|
* 提货订单分页(文档 7.1)
|
||||||
|
*
|
||||||
|
* @param page 页码,从 1 开始
|
||||||
|
* @param size 每页条数
|
||||||
|
*/
|
||||||
|
void getOrders(int page, int size,
|
||||||
|
CallBack<PageResult<PickupOrderEntity>> callBack);
|
||||||
|
}
|
||||||
|
|
||||||
|
public interface StatsView extends IView {
|
||||||
|
// 分页加载成功,pageNum 为本次请求的页码
|
||||||
|
void showOrders(PageResult<PickupOrderEntity> page, int pageNum);
|
||||||
|
|
||||||
|
// 分页加载失败,pageNum 为本次请求的页码
|
||||||
|
void showOrdersError(String message, int pageNum);
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1,65 @@
|
|||||||
|
package com.ckkj.griddlebiz.pickup.mvp;
|
||||||
|
|
||||||
|
import com.ckkj.griddlebiz.network.BaseBean;
|
||||||
|
import com.ckkj.griddlebiz.network.NetWorkManager;
|
||||||
|
import com.ckkj.griddlebiz.network.PageResult;
|
||||||
|
import com.ckkj.griddlebiz.pickup.entity.PickupOrderEntity;
|
||||||
|
|
||||||
|
import java.util.HashMap;
|
||||||
|
import java.util.Map;
|
||||||
|
|
||||||
|
import io.reactivex.Observer;
|
||||||
|
import io.reactivex.android.schedulers.AndroidSchedulers;
|
||||||
|
import io.reactivex.annotations.NonNull;
|
||||||
|
import io.reactivex.disposables.Disposable;
|
||||||
|
import io.reactivex.schedulers.Schedulers;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 提货订单统计数据层。
|
||||||
|
*/
|
||||||
|
public class PickupOrderStatsImpl implements PickupOrderStatsContract.DataModel {
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 提货订单分页(文档 7.1):不传 status,返回全部状态的订单
|
||||||
|
*/
|
||||||
|
@Override
|
||||||
|
public void getOrders(int page, int size,
|
||||||
|
PickupOrderStatsContract.CallBack<PageResult<PickupOrderEntity>> callBack) {
|
||||||
|
try {
|
||||||
|
Map<String, Object> params = new HashMap<>();
|
||||||
|
params.put("page", page);
|
||||||
|
params.put("size", size);
|
||||||
|
NetWorkManager.getRequest()
|
||||||
|
.getAgentOrders(NetWorkManager.getToken(), params)
|
||||||
|
.subscribeOn(Schedulers.io())
|
||||||
|
.unsubscribeOn(Schedulers.io())
|
||||||
|
.observeOn(AndroidSchedulers.mainThread())
|
||||||
|
.subscribe(new Observer<BaseBean<PageResult<PickupOrderEntity>>>() {
|
||||||
|
@Override
|
||||||
|
public void onSubscribe(@NonNull Disposable d) {
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void onNext(@NonNull BaseBean<PageResult<PickupOrderEntity>> bean) {
|
||||||
|
if (bean.getCode() == 200 && bean.getData() != null) {
|
||||||
|
callBack.success(bean.getData());
|
||||||
|
} else {
|
||||||
|
callBack.fail(bean.getMessage());
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void onError(@NonNull Throwable e) {
|
||||||
|
callBack.fail(e.getMessage());
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void onComplete() {
|
||||||
|
}
|
||||||
|
});
|
||||||
|
} catch (Exception e) {
|
||||||
|
e.printStackTrace();
|
||||||
|
callBack.fail(e.getMessage());
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1,43 @@
|
|||||||
|
package com.ckkj.griddlebiz.pickup.mvp;
|
||||||
|
|
||||||
|
import com.ckkj.griddlebiz.base.BasePresenter;
|
||||||
|
import com.ckkj.griddlebiz.network.PageResult;
|
||||||
|
import com.ckkj.griddlebiz.pickup.entity.PickupOrderEntity;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 提货订单统计业务处理。
|
||||||
|
*/
|
||||||
|
public class PickupOrderStatsPresenter
|
||||||
|
extends BasePresenter<PickupOrderStatsContract.StatsView> {
|
||||||
|
|
||||||
|
private final PickupOrderStatsImpl mImpl;
|
||||||
|
|
||||||
|
public PickupOrderStatsPresenter(PickupOrderStatsImpl impl) {
|
||||||
|
this.mImpl = impl;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 提货订单分页(文档 7.1)
|
||||||
|
*
|
||||||
|
* @param page 页码,从 1 开始
|
||||||
|
* @param size 每页条数
|
||||||
|
*/
|
||||||
|
public void getOrders(int page, int size) {
|
||||||
|
mImpl.getOrders(page, size,
|
||||||
|
new PickupOrderStatsContract.CallBack<PageResult<PickupOrderEntity>>() {
|
||||||
|
@Override
|
||||||
|
public void success(PageResult<PickupOrderEntity> data) {
|
||||||
|
if (getView() != null) {
|
||||||
|
getView().showOrders(data, page);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void fail(String message) {
|
||||||
|
if (getView() != null) {
|
||||||
|
getView().showOrdersError(message, page);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
});
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -1,13 +1,11 @@
|
|||||||
package com.ckkj.griddlebiz.pickup.mvp;
|
package com.ckkj.griddlebiz.pickup.mvp;
|
||||||
|
|
||||||
import com.ckkj.griddlebiz.base.IView;
|
import com.ckkj.griddlebiz.base.IView;
|
||||||
import com.ckkj.griddlebiz.network.BaseBean;
|
|
||||||
import com.ckkj.griddlebiz.pickup.entity.PickupPreviewEntity;
|
import com.ckkj.griddlebiz.pickup.entity.PickupPreviewEntity;
|
||||||
|
import com.ckkj.griddlebiz.pickup.entity.PickupVerifyResultEntity;
|
||||||
import java.util.List;
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 提货核销(文档 6.3 / 6.4)契约。
|
* 提货核销(文档 7.3 / 7.4)契约。
|
||||||
*/
|
*/
|
||||||
public class PickupVerifyContract {
|
public class PickupVerifyContract {
|
||||||
|
|
||||||
@@ -18,19 +16,18 @@ public class PickupVerifyContract {
|
|||||||
}
|
}
|
||||||
|
|
||||||
public interface DataModel {
|
public interface DataModel {
|
||||||
// 扫提货码预览(文档 6.3)
|
// 扫提货码预览(文档 7.3)
|
||||||
void previewOrder(String pickupCode, CallBack<PickupPreviewEntity> callback);
|
void previewOrder(String pickupCode, CallBack<PickupPreviewEntity> callback);
|
||||||
|
|
||||||
// 整单核销(文档 6.4)
|
// 提货码核销(文档 7.4):只核销订单状态,不再提交设备 SN
|
||||||
void verifyOrder(String pickupCode, List<String> deviceCodes,
|
void verifyOrder(String pickupCode, CallBack<PickupVerifyResultEntity> callback);
|
||||||
CallBack<BaseBean> callback);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public interface PickupVerifyView extends IView {
|
public interface PickupVerifyView extends IView {
|
||||||
// 提货码预览成功
|
// 提货码预览成功
|
||||||
void onPreviewSuccess(PickupPreviewEntity preview);
|
void onPreviewSuccess(PickupPreviewEntity preview);
|
||||||
|
|
||||||
// 整单核销成功
|
// 提货码核销成功
|
||||||
void onVerifySuccess();
|
void onVerifySuccess(PickupVerifyResultEntity result);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -3,12 +3,10 @@ package com.ckkj.griddlebiz.pickup.mvp;
|
|||||||
import com.ckkj.griddlebiz.network.BaseBean;
|
import com.ckkj.griddlebiz.network.BaseBean;
|
||||||
import com.ckkj.griddlebiz.network.NetWorkManager;
|
import com.ckkj.griddlebiz.network.NetWorkManager;
|
||||||
import com.ckkj.griddlebiz.pickup.entity.PickupPreviewEntity;
|
import com.ckkj.griddlebiz.pickup.entity.PickupPreviewEntity;
|
||||||
|
import com.ckkj.griddlebiz.pickup.entity.PickupVerifyResultEntity;
|
||||||
|
|
||||||
import org.json.JSONArray;
|
|
||||||
import org.json.JSONObject;
|
import org.json.JSONObject;
|
||||||
|
|
||||||
import java.util.List;
|
|
||||||
|
|
||||||
import io.reactivex.Observer;
|
import io.reactivex.Observer;
|
||||||
import io.reactivex.android.schedulers.AndroidSchedulers;
|
import io.reactivex.android.schedulers.AndroidSchedulers;
|
||||||
import io.reactivex.annotations.NonNull;
|
import io.reactivex.annotations.NonNull;
|
||||||
@@ -21,7 +19,7 @@ import io.reactivex.schedulers.Schedulers;
|
|||||||
public class PickupVerifyImpl implements PickupVerifyContract.DataModel {
|
public class PickupVerifyImpl implements PickupVerifyContract.DataModel {
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 扫提货码预览(文档 6.3)
|
* 扫提货码预览(文档 7.3):请求体只有 pickupCode
|
||||||
*/
|
*/
|
||||||
@Override
|
@Override
|
||||||
public void previewOrder(String pickupCode,
|
public void previewOrder(String pickupCode,
|
||||||
@@ -65,36 +63,29 @@ public class PickupVerifyImpl implements PickupVerifyContract.DataModel {
|
|||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 整单核销(文档 6.4)
|
* 提货码核销(文档 7.4):只提交 pickupCode,设备出库由 stock-out 接口单独处理
|
||||||
*/
|
*/
|
||||||
@Override
|
@Override
|
||||||
public void verifyOrder(String pickupCode, List<String> deviceCodes,
|
public void verifyOrder(String pickupCode,
|
||||||
PickupVerifyContract.CallBack<BaseBean> callback) {
|
PickupVerifyContract.CallBack<PickupVerifyResultEntity> callback) {
|
||||||
try {
|
try {
|
||||||
JSONArray array = new JSONArray();
|
|
||||||
if (deviceCodes != null) {
|
|
||||||
for (String code : deviceCodes) {
|
|
||||||
array.put(code);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
JSONObject json = new JSONObject();
|
JSONObject json = new JSONObject();
|
||||||
json.put("pickupCode", pickupCode);
|
json.put("pickupCode", pickupCode);
|
||||||
json.put("deviceCodes", array);
|
|
||||||
NetWorkManager.getRequest()
|
NetWorkManager.getRequest()
|
||||||
.verifyPickupOrder(NetWorkManager.getToken(),
|
.verifyPickupOrder(NetWorkManager.getToken(),
|
||||||
NetWorkManager.toRequestBody(json))
|
NetWorkManager.toRequestBody(json))
|
||||||
.subscribeOn(Schedulers.io())
|
.subscribeOn(Schedulers.io())
|
||||||
.unsubscribeOn(Schedulers.io())
|
.unsubscribeOn(Schedulers.io())
|
||||||
.observeOn(AndroidSchedulers.mainThread())
|
.observeOn(AndroidSchedulers.mainThread())
|
||||||
.subscribe(new Observer<BaseBean>() {
|
.subscribe(new Observer<BaseBean<PickupVerifyResultEntity>>() {
|
||||||
@Override
|
@Override
|
||||||
public void onSubscribe(@NonNull Disposable d) {
|
public void onSubscribe(@NonNull Disposable d) {
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void onNext(@NonNull BaseBean bean) {
|
public void onNext(@NonNull BaseBean<PickupVerifyResultEntity> bean) {
|
||||||
if (bean.getCode() == 200) {
|
if (bean.getCode() == 200 && bean.getData() != null) {
|
||||||
callback.success(bean);
|
callback.success(bean.getData());
|
||||||
} else {
|
} else {
|
||||||
callback.fail(bean.getMessage());
|
callback.fail(bean.getMessage());
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,10 +1,8 @@
|
|||||||
package com.ckkj.griddlebiz.pickup.mvp;
|
package com.ckkj.griddlebiz.pickup.mvp;
|
||||||
|
|
||||||
import com.ckkj.griddlebiz.base.BasePresenter;
|
import com.ckkj.griddlebiz.base.BasePresenter;
|
||||||
import com.ckkj.griddlebiz.network.BaseBean;
|
|
||||||
import com.ckkj.griddlebiz.pickup.entity.PickupPreviewEntity;
|
import com.ckkj.griddlebiz.pickup.entity.PickupPreviewEntity;
|
||||||
|
import com.ckkj.griddlebiz.pickup.entity.PickupVerifyResultEntity;
|
||||||
import java.util.List;
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 提货核销业务处理。
|
* 提货核销业务处理。
|
||||||
@@ -18,7 +16,7 @@ public class PickupVerifyPresenter extends BasePresenter<PickupVerifyContract.Pi
|
|||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 查询提货码(文档 6.3)
|
* 扫提货码预览(文档 7.3)
|
||||||
*/
|
*/
|
||||||
public void previewOrder(String pickupCode) {
|
public void previewOrder(String pickupCode) {
|
||||||
mImpl.previewOrder(pickupCode, new PickupVerifyContract.CallBack<PickupPreviewEntity>() {
|
mImpl.previewOrder(pickupCode, new PickupVerifyContract.CallBack<PickupPreviewEntity>() {
|
||||||
@@ -39,14 +37,15 @@ public class PickupVerifyPresenter extends BasePresenter<PickupVerifyContract.Pi
|
|||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 确认核销(文档 6.4)
|
* 提货码核销(文档 7.4)
|
||||||
*/
|
*/
|
||||||
public void verifyOrder(String pickupCode, List<String> deviceCodes) {
|
public void verifyOrder(String pickupCode) {
|
||||||
mImpl.verifyOrder(pickupCode, deviceCodes, new PickupVerifyContract.CallBack<BaseBean>() {
|
mImpl.verifyOrder(pickupCode,
|
||||||
|
new PickupVerifyContract.CallBack<PickupVerifyResultEntity>() {
|
||||||
@Override
|
@Override
|
||||||
public void success(BaseBean data) {
|
public void success(PickupVerifyResultEntity data) {
|
||||||
if (getView() != null) {
|
if (getView() != null) {
|
||||||
getView().onVerifySuccess();
|
getView().onVerifySuccess(data);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -0,0 +1,512 @@
|
|||||||
|
package com.ckkj.griddlebiz.product;
|
||||||
|
|
||||||
|
import android.Manifest;
|
||||||
|
import android.app.Dialog;
|
||||||
|
import android.content.Intent;
|
||||||
|
import android.content.pm.PackageManager;
|
||||||
|
import android.graphics.Color;
|
||||||
|
import android.graphics.drawable.ColorDrawable;
|
||||||
|
import android.os.Bundle;
|
||||||
|
import android.text.TextUtils;
|
||||||
|
import android.view.Gravity;
|
||||||
|
import android.view.View;
|
||||||
|
import android.view.Window;
|
||||||
|
import android.view.WindowManager;
|
||||||
|
import android.view.inputmethod.EditorInfo;
|
||||||
|
|
||||||
|
import androidx.activity.result.ActivityResultLauncher;
|
||||||
|
import androidx.activity.result.contract.ActivityResultContracts;
|
||||||
|
import androidx.annotation.NonNull;
|
||||||
|
import androidx.recyclerview.widget.LinearLayoutManager;
|
||||||
|
|
||||||
|
import com.ckkj.griddlebiz.R;
|
||||||
|
import com.ckkj.griddlebiz.base.BaseActivity;
|
||||||
|
import com.ckkj.griddlebiz.databinding.DialogProductInboundDeleteLayoutBinding;
|
||||||
|
import com.ckkj.griddlebiz.databinding.DialogProductInboundManualLayoutBinding;
|
||||||
|
import com.ckkj.griddlebiz.databinding.ProductOutboundLayoutBinding;
|
||||||
|
import com.ckkj.griddlebiz.network.BaseBean;
|
||||||
|
import com.ckkj.griddlebiz.product.adapter.OutboundPendingAdapter;
|
||||||
|
import com.ckkj.griddlebiz.product.entity.OutboundPendingEntity;
|
||||||
|
import com.ckkj.griddlebiz.product.mvp.ProductOutboundContract;
|
||||||
|
import com.ckkj.griddlebiz.product.mvp.ProductOutboundImpl;
|
||||||
|
import com.ckkj.griddlebiz.product.mvp.ProductOutboundPresenter;
|
||||||
|
import com.ckkj.griddlebiz.pickup.entity.PickupStockOutResultEntity;
|
||||||
|
import com.ckkj.griddlebiz.utils.show.ToastUtil;
|
||||||
|
import com.gyf.immersionbar.ImmersionBar;
|
||||||
|
import com.king.camera.scan.CameraScan;
|
||||||
|
|
||||||
|
import java.util.ArrayList;
|
||||||
|
import java.util.Collections;
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
|
import butterknife.OnClick;
|
||||||
|
import pub.devrel.easypermissions.EasyPermissions;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 商品出库:扫描设备外箱条码或手动输入 SN 码加入待出库列表,
|
||||||
|
* 支持批量勾选、单条/批量删除,提交时调用文档 7.5 的整批出库接口。
|
||||||
|
*/
|
||||||
|
public class ProductOutboundActivity
|
||||||
|
extends BaseActivity<ProductOutboundLayoutBinding, ProductOutboundPresenter>
|
||||||
|
implements ProductOutboundContract.ProductOutboundView,
|
||||||
|
EasyPermissions.PermissionCallbacks {
|
||||||
|
|
||||||
|
private static final int REQUEST_CAMERA_SCAN = 0x150;
|
||||||
|
/** 整批出库单次上限(文档 7.5) */
|
||||||
|
private static final int MAX_OUTBOUND = 200;
|
||||||
|
|
||||||
|
/** 扫码页返回结果;扫码和相册识别都通过 {@link CameraScan#SCAN_RESULT} 回传。 */
|
||||||
|
private final ActivityResultLauncher<Intent> mScanLauncher = registerForActivityResult(
|
||||||
|
new ActivityResultContracts.StartActivityForResult(), result -> {
|
||||||
|
if (result.getResultCode() != RESULT_OK) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
Intent data = result.getData();
|
||||||
|
String code = data == null ? null : data.getStringExtra(CameraScan.SCAN_RESULT);
|
||||||
|
if (TextUtils.isEmpty(code)) {
|
||||||
|
ToastUtil.showShort(mContext, R.string.product_scan_empty);
|
||||||
|
} else {
|
||||||
|
addPendingCode(code);
|
||||||
|
}
|
||||||
|
});
|
||||||
|
|
||||||
|
private Dialog mManualCodeDialog;
|
||||||
|
private DialogProductInboundManualLayoutBinding mManualBinding;
|
||||||
|
|
||||||
|
private Dialog mDeleteDialog;
|
||||||
|
private DialogProductInboundDeleteLayoutBinding mDeleteBinding;
|
||||||
|
|
||||||
|
/** 待出库列表 */
|
||||||
|
private final List<OutboundPendingEntity> mPendingList = new ArrayList<>();
|
||||||
|
/** 当前等待确认删除的商品 */
|
||||||
|
private final List<OutboundPendingEntity> mDeleteTargets = new ArrayList<>();
|
||||||
|
/** 本次提交出库的商品,成功后从列表中移除 */
|
||||||
|
private final List<OutboundPendingEntity> mSubmitTargets = new ArrayList<>();
|
||||||
|
private OutboundPendingAdapter mPendingAdapter;
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public ProductOutboundPresenter createPresenter() {
|
||||||
|
return new ProductOutboundPresenter(new ProductOutboundImpl());
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public int getLayoutResId(Bundle savedInstanceState) {
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
protected void onCreate(Bundle savedInstanceState) {
|
||||||
|
super.onCreate(savedInstanceState);
|
||||||
|
ImmersionBar.with(this)
|
||||||
|
.statusBarColor(R.color.white)
|
||||||
|
.statusBarDarkFont(true)
|
||||||
|
.keyboardEnable(true)
|
||||||
|
.init();
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void initData(Bundle savedInstanceState) {
|
||||||
|
super.initData(savedInstanceState);
|
||||||
|
// 待出库列表
|
||||||
|
mPendingAdapter = new OutboundPendingAdapter(mPendingList,
|
||||||
|
new OutboundPendingAdapter.Listener() {
|
||||||
|
@Override
|
||||||
|
public void onSelectedChanged() {
|
||||||
|
// 勾选变化只刷新顶部数量
|
||||||
|
updatePendingTotal();
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void onDelete(OutboundPendingEntity item) {
|
||||||
|
showDeleteDialog(Collections.singletonList(item));
|
||||||
|
}
|
||||||
|
});
|
||||||
|
viewBinding.rvPending.setLayoutManager(new LinearLayoutManager(this));
|
||||||
|
viewBinding.rvPending.setAdapter(mPendingAdapter);
|
||||||
|
// 适配器与页面共用同一个列表,后续增删直接用条目动画刷新
|
||||||
|
mPendingAdapter.setNewData(mPendingList);
|
||||||
|
updatePendingTotal();
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 商品出库页点击事件。
|
||||||
|
*/
|
||||||
|
@OnClick({R.id.iv_back, R.id.iv_scan, R.id.tv_manual_entry, R.id.iv_delete_selected,
|
||||||
|
R.id.tv_delete_selected, R.id.btn_submit})
|
||||||
|
public void onClick(View v) {
|
||||||
|
switch (v.getId()) {
|
||||||
|
case R.id.iv_back:
|
||||||
|
// 返回上一页
|
||||||
|
finish();
|
||||||
|
break;
|
||||||
|
|
||||||
|
case R.id.iv_scan:
|
||||||
|
// 申请相机权限后进入扫码
|
||||||
|
requestScanPermission();
|
||||||
|
break;
|
||||||
|
|
||||||
|
case R.id.tv_manual_entry:
|
||||||
|
// 扫码失败时,弹出手动输入编码弹窗
|
||||||
|
showManualCodeDialog();
|
||||||
|
break;
|
||||||
|
|
||||||
|
case R.id.iv_delete_selected:
|
||||||
|
case R.id.tv_delete_selected:
|
||||||
|
// 删除已勾选的待出库商品
|
||||||
|
deleteSelected();
|
||||||
|
break;
|
||||||
|
|
||||||
|
case R.id.btn_submit:
|
||||||
|
// 提交勾选的商品整批出库
|
||||||
|
submitOutbound();
|
||||||
|
break;
|
||||||
|
|
||||||
|
default:
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
private void requestScanPermission() {
|
||||||
|
// 相机在清单中声明为非必需硬件,无相机设备仍可安装和使用手动输入。
|
||||||
|
if (!getPackageManager().hasSystemFeature(PackageManager.FEATURE_CAMERA_ANY)) {
|
||||||
|
ToastUtil.showShort(mContext, R.string.product_camera_unavailable);
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
if (hasRecordPermission(Manifest.permission.CAMERA)) {
|
||||||
|
startScan();
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
// 与入库页保持一致:说明弹窗 -> 顶部权限弹窗 -> 系统权限弹窗
|
||||||
|
getPermissionRequst(Manifest.permission.CAMERA,
|
||||||
|
getString(R.string.product_camera_permission_title),
|
||||||
|
getString(R.string.product_outbound_camera_permission_content),
|
||||||
|
REQUEST_CAMERA_SCAN);
|
||||||
|
}
|
||||||
|
|
||||||
|
private void startScan() {
|
||||||
|
Intent intent = new Intent(this, ProductScanActivity.class);
|
||||||
|
// 复用通用扫码页,仅替换标题为“扫码出库”
|
||||||
|
intent.putExtra(ProductScanActivity.EXTRA_TITLE,
|
||||||
|
getString(R.string.product_outbound_scan_title));
|
||||||
|
mScanLauncher.launch(intent);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void onRequestPermissionsResult(int requestCode, @NonNull String[] permissions,
|
||||||
|
@NonNull int[] grantResults) {
|
||||||
|
super.onRequestPermissionsResult(requestCode, permissions, grantResults);
|
||||||
|
EasyPermissions.onRequestPermissionsResult(requestCode, permissions, grantResults, this);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void onPermissionsGranted(int requestCode, @NonNull List<String> perms) {
|
||||||
|
hidePermissionDialog();
|
||||||
|
if (requestCode == REQUEST_CAMERA_SCAN) {
|
||||||
|
startScan();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void onPermissionsDenied(int requestCode, @NonNull List<String> perms) {
|
||||||
|
hidePermissionDialog();
|
||||||
|
if (requestCode == REQUEST_CAMERA_SCAN) {
|
||||||
|
ToastUtil.showShort(mContext, R.string.product_camera_permission_denied);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
private void showManualCodeDialog() {
|
||||||
|
if (mManualCodeDialog != null && mManualCodeDialog.isShowing()) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
mManualBinding = DialogProductInboundManualLayoutBinding.inflate(getLayoutInflater());
|
||||||
|
mManualCodeDialog = new Dialog(this, R.style.ProductManualCodeDialog);
|
||||||
|
mManualCodeDialog.setContentView(mManualBinding.getRoot());
|
||||||
|
mManualCodeDialog.setCanceledOnTouchOutside(true);
|
||||||
|
Window window = mManualCodeDialog.getWindow();
|
||||||
|
if (window != null) {
|
||||||
|
window.setBackgroundDrawable(new ColorDrawable(Color.TRANSPARENT));
|
||||||
|
window.setLayout(WindowManager.LayoutParams.MATCH_PARENT,
|
||||||
|
WindowManager.LayoutParams.MATCH_PARENT);
|
||||||
|
window.setGravity(Gravity.CENTER);
|
||||||
|
}
|
||||||
|
View.OnClickListener dialogClick = this::onManualDialogClick;
|
||||||
|
mManualBinding.dialogRoot.setOnClickListener(dialogClick);
|
||||||
|
mManualBinding.ivClose.setOnClickListener(dialogClick);
|
||||||
|
mManualBinding.tvReset.setOnClickListener(dialogClick);
|
||||||
|
mManualBinding.tvOk.setOnClickListener(dialogClick);
|
||||||
|
mManualBinding.edManualCode.setOnEditorActionListener((v, actionId, event) -> {
|
||||||
|
if (actionId == EditorInfo.IME_ACTION_DONE) {
|
||||||
|
submitManualCode();
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
return false;
|
||||||
|
});
|
||||||
|
mManualCodeDialog.show();
|
||||||
|
// Re-apply after show so full-screen dimming also covers the status-bar area.
|
||||||
|
if (window != null) {
|
||||||
|
window.setLayout(WindowManager.LayoutParams.MATCH_PARENT,
|
||||||
|
WindowManager.LayoutParams.MATCH_PARENT);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 手动输入弹窗点击事件。
|
||||||
|
* <p>
|
||||||
|
* 弹窗不在 Activity 的 contentView 中,无法使用 ButterKnife 的 @OnClick,
|
||||||
|
* 这里统一收敛到一个 switch 中便于阅读。
|
||||||
|
*/
|
||||||
|
private void onManualDialogClick(View v) {
|
||||||
|
switch (v.getId()) {
|
||||||
|
case R.id.dialog_root:
|
||||||
|
case R.id.iv_close:
|
||||||
|
// 点击空白处或关闭按钮,收起弹窗
|
||||||
|
dismissManualCodeDialog();
|
||||||
|
break;
|
||||||
|
|
||||||
|
case R.id.tv_reset:
|
||||||
|
// 清空输入内容
|
||||||
|
mManualBinding.edManualCode.setText("");
|
||||||
|
break;
|
||||||
|
|
||||||
|
case R.id.tv_ok:
|
||||||
|
// 提交手动输入的编码
|
||||||
|
submitManualCode();
|
||||||
|
break;
|
||||||
|
|
||||||
|
default:
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
private void submitManualCode() {
|
||||||
|
if (mManualBinding == null) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
String code = mManualBinding.edManualCode.getText().toString().trim();
|
||||||
|
if (TextUtils.isEmpty(code)) {
|
||||||
|
ToastUtil.showShort(mContext, R.string.product_manual_code_empty);
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
// 手动输入与扫码结果保持一致,直接加入待出库列表
|
||||||
|
dismissManualCodeDialog();
|
||||||
|
addPendingCode(code);
|
||||||
|
}
|
||||||
|
|
||||||
|
private void dismissManualCodeDialog() {
|
||||||
|
if (mManualCodeDialog != null && mManualCodeDialog.isShowing()) {
|
||||||
|
mManualCodeDialog.dismiss();
|
||||||
|
}
|
||||||
|
mManualCodeDialog = null;
|
||||||
|
mManualBinding = null;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 把扫码 / 手动输入的原始内容加入待出库列表
|
||||||
|
*/
|
||||||
|
private void addPendingCode(String content) {
|
||||||
|
if (TextUtils.isEmpty(content)) {
|
||||||
|
ToastUtil.showShort(mContext, R.string.product_scan_empty);
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
appendPendingDevice(content.trim());
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 追加一条待出库设备,已存在时只标记角标,不重复添加
|
||||||
|
*/
|
||||||
|
private void appendPendingDevice(String deviceCode) {
|
||||||
|
for (int i = 0; i < mPendingList.size(); i++) {
|
||||||
|
OutboundPendingEntity item = mPendingList.get(i);
|
||||||
|
if (deviceCode.equals(item.getDeviceCode())) {
|
||||||
|
// 重复扫码标记为已在列表,并保持默认勾选
|
||||||
|
item.setDuplicate(true);
|
||||||
|
item.setSelected(true);
|
||||||
|
mPendingAdapter.notifyItemChanged(i);
|
||||||
|
updatePendingTotal();
|
||||||
|
ToastUtil.showShort(mContext, R.string.product_outbound_duplicate);
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
OutboundPendingEntity item = new OutboundPendingEntity();
|
||||||
|
item.setDeviceCode(deviceCode);
|
||||||
|
// 扫码加入的条目默认勾选,方便直接提交出库
|
||||||
|
item.setSelected(true);
|
||||||
|
mPendingList.add(item);
|
||||||
|
// 使用条目插入动画,避免整表刷新
|
||||||
|
mPendingAdapter.notifyItemInserted(mPendingList.size() - 1);
|
||||||
|
updatePendingTotal();
|
||||||
|
scrollToBottom();
|
||||||
|
ToastUtil.showShort(mContext, getString(R.string.product_outbound_added, deviceCode));
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 新数据加入后滚动到列表底部,保证刚扫到的设备可见
|
||||||
|
*/
|
||||||
|
private void scrollToBottom() {
|
||||||
|
viewBinding.scrollContent.post(() ->
|
||||||
|
viewBinding.scrollContent.fullScroll(View.FOCUS_DOWN));
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 删除指定条目,逐条触发移除动画
|
||||||
|
*/
|
||||||
|
private void removePendingItems(List<OutboundPendingEntity> targets) {
|
||||||
|
if (targets == null || targets.isEmpty()) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
List<Integer> positions = new ArrayList<>();
|
||||||
|
for (int i = 0; i < mPendingList.size(); i++) {
|
||||||
|
if (targets.contains(mPendingList.get(i))) {
|
||||||
|
positions.add(i);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
// 从后往前删,避免前面的下标在删除后发生偏移
|
||||||
|
for (int i = positions.size() - 1; i >= 0; i--) {
|
||||||
|
int position = positions.get(i);
|
||||||
|
mPendingList.remove(position);
|
||||||
|
mPendingAdapter.notifyItemRemoved(position);
|
||||||
|
}
|
||||||
|
updatePendingTotal();
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 顶部数量只统计当前勾选的商品
|
||||||
|
*/
|
||||||
|
private void updatePendingTotal() {
|
||||||
|
int selectedCount = 0;
|
||||||
|
for (OutboundPendingEntity item : mPendingList) {
|
||||||
|
if (item.isSelected()) {
|
||||||
|
selectedCount++;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
viewBinding.tvPendingTotal.setText(
|
||||||
|
getString(R.string.product_outbound_total, selectedCount));
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 删除顶部“删除”按钮对应的已勾选商品
|
||||||
|
*/
|
||||||
|
private void deleteSelected() {
|
||||||
|
List<OutboundPendingEntity> selected = new ArrayList<>();
|
||||||
|
for (OutboundPendingEntity item : mPendingList) {
|
||||||
|
if (item.isSelected()) {
|
||||||
|
selected.add(item);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
if (selected.isEmpty()) {
|
||||||
|
ToastUtil.showShort(mContext, R.string.product_outbound_select_delete);
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
showDeleteDialog(selected);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 删除确认弹窗,复用入库页的通用删除弹窗
|
||||||
|
*/
|
||||||
|
private void showDeleteDialog(List<OutboundPendingEntity> targets) {
|
||||||
|
if (targets == null || targets.isEmpty()) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
if (mDeleteDialog != null && mDeleteDialog.isShowing()) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
mDeleteTargets.clear();
|
||||||
|
mDeleteTargets.addAll(targets);
|
||||||
|
|
||||||
|
mDeleteBinding = DialogProductInboundDeleteLayoutBinding.inflate(getLayoutInflater());
|
||||||
|
mDeleteDialog = new Dialog(this, R.style.ProductManualCodeDialog);
|
||||||
|
mDeleteDialog.setContentView(mDeleteBinding.getRoot());
|
||||||
|
mDeleteDialog.setCanceledOnTouchOutside(true);
|
||||||
|
|
||||||
|
mDeleteBinding.dialogRoot.setOnClickListener(v -> dismissDeleteDialog());
|
||||||
|
mDeleteBinding.tvDeleteCancel.setOnClickListener(v -> dismissDeleteDialog());
|
||||||
|
mDeleteBinding.tvDeleteConfirm.setOnClickListener(v -> confirmDelete());
|
||||||
|
mDeleteDialog.show();
|
||||||
|
|
||||||
|
Window window = mDeleteDialog.getWindow();
|
||||||
|
if (window != null) {
|
||||||
|
window.setBackgroundDrawable(new ColorDrawable(Color.TRANSPARENT));
|
||||||
|
window.setGravity(Gravity.CENTER);
|
||||||
|
window.setLayout(WindowManager.LayoutParams.MATCH_PARENT,
|
||||||
|
WindowManager.LayoutParams.MATCH_PARENT);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
private void confirmDelete() {
|
||||||
|
removePendingItems(mDeleteTargets);
|
||||||
|
dismissDeleteDialog();
|
||||||
|
}
|
||||||
|
|
||||||
|
private void dismissDeleteDialog() {
|
||||||
|
if (mDeleteDialog != null && mDeleteDialog.isShowing()) {
|
||||||
|
mDeleteDialog.dismiss();
|
||||||
|
}
|
||||||
|
mDeleteDialog = null;
|
||||||
|
mDeleteBinding = null;
|
||||||
|
mDeleteTargets.clear();
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 提交勾选的商品整批出库(文档 7.5)
|
||||||
|
*/
|
||||||
|
private void submitOutbound() {
|
||||||
|
String pickupCode = viewBinding.etPickupCode.getText().toString().trim();
|
||||||
|
if (TextUtils.isEmpty(pickupCode)) {
|
||||||
|
ToastUtil.showShort(mContext, R.string.product_outbound_pickup_code_empty);
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
List<OutboundPendingEntity> selected = new ArrayList<>();
|
||||||
|
for (OutboundPendingEntity item : mPendingList) {
|
||||||
|
if (item.isSelected()) {
|
||||||
|
selected.add(item);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
if (selected.isEmpty()) {
|
||||||
|
ToastUtil.showShort(mContext, R.string.product_outbound_select_submit);
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
if (selected.size() > MAX_OUTBOUND) {
|
||||||
|
ToastUtil.showShort(mContext, R.string.product_outbound_limit);
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
List<String> deviceCodes = new ArrayList<>();
|
||||||
|
for (OutboundPendingEntity item : selected) {
|
||||||
|
deviceCodes.add(item.getDeviceCode());
|
||||||
|
}
|
||||||
|
mSubmitTargets.clear();
|
||||||
|
mSubmitTargets.addAll(selected);
|
||||||
|
showLoadingDialog();
|
||||||
|
mPresenter.stockOut(pickupCode, deviceCodes);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 整批出库成功:移除本次提交的条目
|
||||||
|
*/
|
||||||
|
@Override
|
||||||
|
public void onStockOutSuccess(PickupStockOutResultEntity result) {
|
||||||
|
hideDialogLoading();
|
||||||
|
removePendingItems(mSubmitTargets);
|
||||||
|
mSubmitTargets.clear();
|
||||||
|
ToastUtil.showShort(mContext, R.string.product_outbound_submit_success);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void showError(String message) {
|
||||||
|
hideDialogLoading();
|
||||||
|
mSubmitTargets.clear();
|
||||||
|
if (!TextUtils.isEmpty(message)) {
|
||||||
|
ToastUtil.showShort(mContext, message);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void logOut(BaseBean bean) {
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
protected void onDestroy() {
|
||||||
|
dismissManualCodeDialog();
|
||||||
|
dismissDeleteDialog();
|
||||||
|
super.onDestroy();
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -51,6 +51,9 @@ import butterknife.OnClick;
|
|||||||
*/
|
*/
|
||||||
public class ProductScanActivity extends BarcodeCameraScanActivity {
|
public class ProductScanActivity extends BarcodeCameraScanActivity {
|
||||||
|
|
||||||
|
/** 可选标题:入库页不传则使用默认“扫码入库”,出库页传入“扫码出库” */
|
||||||
|
public static final String EXTRA_TITLE = "extra_scan_title";
|
||||||
|
|
||||||
private final Handler mMainHandler = new Handler(Looper.getMainLooper());
|
private final Handler mMainHandler = new Handler(Looper.getMainLooper());
|
||||||
private final ExecutorService mDecodeExecutor = Executors.newSingleThreadExecutor();
|
private final ExecutorService mDecodeExecutor = Executors.newSingleThreadExecutor();
|
||||||
|
|
||||||
@@ -67,9 +70,21 @@ public class ProductScanActivity extends BarcodeCameraScanActivity {
|
|||||||
// 扫码页未继承项目 BaseActivity,需要手动绑定 ButterKnife。
|
// 扫码页未继承项目 BaseActivity,需要手动绑定 ButterKnife。
|
||||||
ButterKnife.bind(this);
|
ButterKnife.bind(this);
|
||||||
applyEdgeToEdge();
|
applyEdgeToEdge();
|
||||||
|
applyCustomTitle();
|
||||||
mTvGallery = findViewById(R.id.tv_gallery);
|
mTvGallery = findViewById(R.id.tv_gallery);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 扫码页按调用方传入的标题展示,未传时使用布局里的默认标题
|
||||||
|
*/
|
||||||
|
private void applyCustomTitle() {
|
||||||
|
TextView title = findViewById(R.id.tv_scan_title);
|
||||||
|
String customTitle = getIntent().getStringExtra(EXTRA_TITLE);
|
||||||
|
if (title != null && !TextUtils.isEmpty(customTitle)) {
|
||||||
|
title.setText(customTitle);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 扫码页点击事件。
|
* 扫码页点击事件。
|
||||||
*/
|
*/
|
||||||
|
|||||||
@@ -0,0 +1,61 @@
|
|||||||
|
package com.ckkj.griddlebiz.product.adapter;
|
||||||
|
|
||||||
|
import com.chad.library.adapter.base.BaseQuickAdapter;
|
||||||
|
import com.chad.library.adapter.base.BaseViewHolder;
|
||||||
|
import com.ckkj.griddlebiz.R;
|
||||||
|
import com.ckkj.griddlebiz.product.entity.OutboundPendingEntity;
|
||||||
|
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 待出库商品列表适配器。
|
||||||
|
*/
|
||||||
|
public class OutboundPendingAdapter
|
||||||
|
extends BaseQuickAdapter<OutboundPendingEntity, BaseViewHolder> {
|
||||||
|
|
||||||
|
public interface Listener {
|
||||||
|
// 勾选状态变化,用于刷新已选数量
|
||||||
|
void onSelectedChanged();
|
||||||
|
|
||||||
|
// 点击单条删除
|
||||||
|
void onDelete(OutboundPendingEntity item);
|
||||||
|
}
|
||||||
|
|
||||||
|
private final Listener mListener;
|
||||||
|
|
||||||
|
public OutboundPendingAdapter(List<OutboundPendingEntity> data, Listener listener) {
|
||||||
|
super(R.layout.item_product_outbound_pending, data);
|
||||||
|
this.mListener = listener;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
protected void convert(BaseViewHolder holder, OutboundPendingEntity item) {
|
||||||
|
holder.setText(R.id.tv_device_sn, item.getDeviceCode());
|
||||||
|
holder.setVisible(R.id.tv_badge, item.isDuplicate());
|
||||||
|
holder.setImageResource(R.id.cb_pending, item.isSelected()
|
||||||
|
? R.mipmap.icon_product_inbound_check_on
|
||||||
|
: R.mipmap.icon_product_inbound_check_off);
|
||||||
|
|
||||||
|
// 点击整行或勾选框都切换选中状态
|
||||||
|
holder.itemView.setOnClickListener(v -> toggle(holder, item));
|
||||||
|
holder.getView(R.id.cb_pending).setOnClickListener(v -> toggle(holder, item));
|
||||||
|
holder.getView(R.id.iv_delete).setOnClickListener(v -> {
|
||||||
|
if (mListener != null) {
|
||||||
|
mListener.onDelete(item);
|
||||||
|
}
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 切换勾选状态并刷新当前行图标
|
||||||
|
*/
|
||||||
|
private void toggle(BaseViewHolder holder, OutboundPendingEntity item) {
|
||||||
|
item.setSelected(!item.isSelected());
|
||||||
|
holder.setImageResource(R.id.cb_pending, item.isSelected()
|
||||||
|
? R.mipmap.icon_product_inbound_check_on
|
||||||
|
: R.mipmap.icon_product_inbound_check_off);
|
||||||
|
if (mListener != null) {
|
||||||
|
mListener.onSelectedChanged();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1,50 @@
|
|||||||
|
package com.ckkj.griddlebiz.product.entity;
|
||||||
|
|
||||||
|
import java.io.Serializable;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 待出库列表项:扫码或手动输入后加入页面列表,勾选后等待整批出库。
|
||||||
|
*/
|
||||||
|
public class OutboundPendingEntity implements Serializable {
|
||||||
|
|
||||||
|
/** 设备 SN */
|
||||||
|
private String deviceCode;
|
||||||
|
/** 设备名称 */
|
||||||
|
private String deviceName;
|
||||||
|
/** 是否勾选 */
|
||||||
|
private boolean selected;
|
||||||
|
/** 是否已在待出库列表中(重复扫码时标记) */
|
||||||
|
private boolean duplicate;
|
||||||
|
|
||||||
|
public String getDeviceCode() {
|
||||||
|
return deviceCode;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setDeviceCode(String deviceCode) {
|
||||||
|
this.deviceCode = deviceCode;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getDeviceName() {
|
||||||
|
return deviceName;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setDeviceName(String deviceName) {
|
||||||
|
this.deviceName = deviceName;
|
||||||
|
}
|
||||||
|
|
||||||
|
public boolean isSelected() {
|
||||||
|
return selected;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setSelected(boolean selected) {
|
||||||
|
this.selected = selected;
|
||||||
|
}
|
||||||
|
|
||||||
|
public boolean isDuplicate() {
|
||||||
|
return duplicate;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setDuplicate(boolean duplicate) {
|
||||||
|
this.duplicate = duplicate;
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -13,9 +13,9 @@ import java.util.List;
|
|||||||
*/
|
*/
|
||||||
public class ProductInboundPresenter extends BasePresenter<ProductInboundContract.ProductInboundView> {
|
public class ProductInboundPresenter extends BasePresenter<ProductInboundContract.ProductInboundView> {
|
||||||
|
|
||||||
private final ProductInboundContract.DataModel mImpl;
|
private final ProductInboundImpl mImpl;
|
||||||
|
|
||||||
public ProductInboundPresenter(ProductInboundContract.DataModel impl) {
|
public ProductInboundPresenter(ProductInboundImpl impl) {
|
||||||
this.mImpl = impl;
|
this.mImpl = impl;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -0,0 +1,34 @@
|
|||||||
|
package com.ckkj.griddlebiz.product.mvp;
|
||||||
|
|
||||||
|
import com.ckkj.griddlebiz.base.IView;
|
||||||
|
import com.ckkj.griddlebiz.pickup.entity.PickupStockOutResultEntity;
|
||||||
|
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 商品出库页面的 MVP 协议。
|
||||||
|
*/
|
||||||
|
public class ProductOutboundContract {
|
||||||
|
|
||||||
|
public interface CallBack<T> {
|
||||||
|
void success(T data);
|
||||||
|
|
||||||
|
void fail(String message);
|
||||||
|
}
|
||||||
|
|
||||||
|
public interface DataModel {
|
||||||
|
/**
|
||||||
|
* 扫设备 SN 出库售出(文档 7.5)
|
||||||
|
*
|
||||||
|
* @param pickupCode 已核销订单的提货码
|
||||||
|
* @param deviceCodes 本次交付的设备 SN,数量须与订单一致
|
||||||
|
*/
|
||||||
|
void stockOut(String pickupCode, List<String> deviceCodes,
|
||||||
|
CallBack<PickupStockOutResultEntity> callback);
|
||||||
|
}
|
||||||
|
|
||||||
|
public interface ProductOutboundView extends IView {
|
||||||
|
// 整批出库成功
|
||||||
|
void onStockOutSuccess(PickupStockOutResultEntity result);
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1,71 @@
|
|||||||
|
package com.ckkj.griddlebiz.product.mvp;
|
||||||
|
|
||||||
|
import com.ckkj.griddlebiz.network.BaseBean;
|
||||||
|
import com.ckkj.griddlebiz.network.NetWorkManager;
|
||||||
|
import com.ckkj.griddlebiz.pickup.entity.PickupStockOutResultEntity;
|
||||||
|
|
||||||
|
import org.json.JSONArray;
|
||||||
|
import org.json.JSONObject;
|
||||||
|
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
|
import io.reactivex.Observer;
|
||||||
|
import io.reactivex.android.schedulers.AndroidSchedulers;
|
||||||
|
import io.reactivex.annotations.NonNull;
|
||||||
|
import io.reactivex.disposables.Disposable;
|
||||||
|
import io.reactivex.schedulers.Schedulers;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 商品出库数据层。
|
||||||
|
*/
|
||||||
|
public class ProductOutboundImpl implements ProductOutboundContract.DataModel {
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 扫设备 SN 出库售出(文档 7.5):任一设备不合格整批失败
|
||||||
|
*/
|
||||||
|
@Override
|
||||||
|
public void stockOut(String pickupCode, List<String> deviceCodes,
|
||||||
|
ProductOutboundContract.CallBack<PickupStockOutResultEntity> callback) {
|
||||||
|
try {
|
||||||
|
JSONArray array = new JSONArray();
|
||||||
|
for (String code : deviceCodes) {
|
||||||
|
array.put(code);
|
||||||
|
}
|
||||||
|
JSONObject json = new JSONObject();
|
||||||
|
json.put("pickupCode", pickupCode);
|
||||||
|
json.put("deviceCodes", array);
|
||||||
|
NetWorkManager.getRequest()
|
||||||
|
.stockOutPickupOrder(NetWorkManager.getToken(),
|
||||||
|
NetWorkManager.toRequestBody(json))
|
||||||
|
.subscribeOn(Schedulers.io())
|
||||||
|
.unsubscribeOn(Schedulers.io())
|
||||||
|
.observeOn(AndroidSchedulers.mainThread())
|
||||||
|
.subscribe(new Observer<BaseBean<PickupStockOutResultEntity>>() {
|
||||||
|
@Override
|
||||||
|
public void onSubscribe(@NonNull Disposable d) {
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void onNext(@NonNull BaseBean<PickupStockOutResultEntity> bean) {
|
||||||
|
if (bean.getCode() == 200 && bean.getData() != null) {
|
||||||
|
callback.success(bean.getData());
|
||||||
|
} else {
|
||||||
|
callback.fail(bean.getMessage());
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void onError(@NonNull Throwable e) {
|
||||||
|
callback.fail(e.getMessage());
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void onComplete() {
|
||||||
|
}
|
||||||
|
});
|
||||||
|
} catch (Exception e) {
|
||||||
|
e.printStackTrace();
|
||||||
|
callback.fail(e.getMessage());
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1,44 @@
|
|||||||
|
package com.ckkj.griddlebiz.product.mvp;
|
||||||
|
|
||||||
|
import com.ckkj.griddlebiz.base.BasePresenter;
|
||||||
|
import com.ckkj.griddlebiz.pickup.entity.PickupStockOutResultEntity;
|
||||||
|
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 商品出库业务处理。
|
||||||
|
*/
|
||||||
|
public class ProductOutboundPresenter
|
||||||
|
extends BasePresenter<ProductOutboundContract.ProductOutboundView> {
|
||||||
|
|
||||||
|
private final ProductOutboundImpl mImpl;
|
||||||
|
|
||||||
|
public ProductOutboundPresenter(ProductOutboundImpl impl) {
|
||||||
|
this.mImpl = impl;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 扫设备 SN 出库售出(文档 7.5)
|
||||||
|
*
|
||||||
|
* @param pickupCode 已核销订单的提货码
|
||||||
|
* @param deviceCodes 本次交付的设备 SN
|
||||||
|
*/
|
||||||
|
public void stockOut(String pickupCode, List<String> deviceCodes) {
|
||||||
|
mImpl.stockOut(pickupCode, deviceCodes,
|
||||||
|
new ProductOutboundContract.CallBack<PickupStockOutResultEntity>() {
|
||||||
|
@Override
|
||||||
|
public void success(PickupStockOutResultEntity data) {
|
||||||
|
if (getView() != null) {
|
||||||
|
getView().onStockOutSuccess(data);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void fail(String message) {
|
||||||
|
if (getView() != null) {
|
||||||
|
getView().showError(message);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
});
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -1,22 +1,48 @@
|
|||||||
package com.ckkj.griddlebiz.user;
|
package com.ckkj.griddlebiz.user;
|
||||||
|
|
||||||
import android.os.Bundle;
|
import android.os.Bundle;
|
||||||
|
import android.text.TextUtils;
|
||||||
import android.view.View;
|
import android.view.View;
|
||||||
|
|
||||||
|
import androidx.recyclerview.widget.LinearLayoutManager;
|
||||||
|
|
||||||
import com.ckkj.griddlebiz.R;
|
import com.ckkj.griddlebiz.R;
|
||||||
import com.ckkj.griddlebiz.base.BaseActivityNoP;
|
import com.ckkj.griddlebiz.base.BaseActivity;
|
||||||
import com.ckkj.griddlebiz.databinding.UserDeviceLayoutBinding;
|
import com.ckkj.griddlebiz.databinding.UserDeviceLayoutBinding;
|
||||||
import com.ckkj.griddlebiz.network.BaseBean;
|
import com.ckkj.griddlebiz.network.BaseBean;
|
||||||
|
import com.ckkj.griddlebiz.user.adapter.CustomerDeviceAdapter;
|
||||||
|
import com.ckkj.griddlebiz.user.entity.CustomerDetailEntity;
|
||||||
|
import com.ckkj.griddlebiz.user.entity.CustomerDeviceEntity;
|
||||||
|
import com.ckkj.griddlebiz.user.entity.CustomerEntity;
|
||||||
|
import com.ckkj.griddlebiz.user.mvp.CustomerContract;
|
||||||
|
import com.ckkj.griddlebiz.user.mvp.CustomerDevicePresenter;
|
||||||
|
import com.ckkj.griddlebiz.user.mvp.CustomerImpl;
|
||||||
import com.ckkj.griddlebiz.utils.show.ToastUtil;
|
import com.ckkj.griddlebiz.utils.show.ToastUtil;
|
||||||
import com.gyf.immersionbar.ImmersionBar;
|
import com.gyf.immersionbar.ImmersionBar;
|
||||||
|
|
||||||
|
import java.util.ArrayList;
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
import butterknife.OnClick;
|
import butterknife.OnClick;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 用户设备列表:展示用户基本信息与其名下设备(在线 / 故障 / 离线三种状态)。
|
* 用户设备详情:展示客户资料及其当前持有、已退回的设备。
|
||||||
* 设备数据目前使用设计稿示例,后续接入用户设备接口时替换。
|
|
||||||
*/
|
*/
|
||||||
public class UserDeviceDetailActivity extends BaseActivityNoP<UserDeviceLayoutBinding> {
|
public class UserDeviceDetailActivity
|
||||||
|
extends BaseActivity<UserDeviceLayoutBinding, CustomerDevicePresenter>
|
||||||
|
implements CustomerContract.CustomerDeviceView {
|
||||||
|
|
||||||
|
/** 上一页传入的购买人系统用户 ID */
|
||||||
|
public static final String EXTRA_USER_ID = "extra_user_id";
|
||||||
|
|
||||||
|
private CustomerDeviceAdapter mAdapter;
|
||||||
|
/** 当前查询的用户 ID */
|
||||||
|
private long mUserId;
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public CustomerDevicePresenter createPresenter() {
|
||||||
|
return new CustomerDevicePresenter(new CustomerImpl());
|
||||||
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public int getLayoutResId(Bundle savedInstanceState) {
|
public int getLayoutResId(Bundle savedInstanceState) {
|
||||||
@@ -31,13 +57,26 @@ public class UserDeviceDetailActivity extends BaseActivityNoP<UserDeviceLayoutBi
|
|||||||
.statusBarDarkFont(true)
|
.statusBarDarkFont(true)
|
||||||
.init();
|
.init();
|
||||||
|
|
||||||
viewBinding.tvUserNamePhone.setText(getString(R.string.user_device_name_phone,
|
mUserId = getIntent().getLongExtra(EXTRA_USER_ID, 0);
|
||||||
getString(R.string.user_sample_name), getString(R.string.user_sample_phone)));
|
mAdapter = new CustomerDeviceAdapter(this);
|
||||||
viewBinding.tvDeviceTotal.setText(getString(R.string.user_device_total, "128"));
|
viewBinding.rvUserDevices.setLayoutManager(new LinearLayoutManager(this));
|
||||||
|
viewBinding.rvUserDevices.setItemAnimator(null);
|
||||||
|
viewBinding.rvUserDevices.setAdapter(mAdapter);
|
||||||
|
|
||||||
|
viewBinding.tvDeviceTotal.setText(getString(R.string.user_device_total, "0"));
|
||||||
|
if (mUserId <= 0) {
|
||||||
|
// 没有有效用户 ID 时直接给出提示,避免发起无效请求
|
||||||
|
showCustomerDetailError(null);
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
// 首屏展示加载提示
|
||||||
|
viewBinding.tvUserDeviceState.setText(R.string.user_device_loading);
|
||||||
|
viewBinding.tvUserDeviceState.setVisibility(View.VISIBLE);
|
||||||
|
mPresenter.getCustomerDetail(mUserId);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 用户设备列表点击事件。
|
* 用户设备页点击事件。
|
||||||
*/
|
*/
|
||||||
@OnClick(R.id.iv_back)
|
@OnClick(R.id.iv_back)
|
||||||
public void onClick(View v) {
|
public void onClick(View v) {
|
||||||
@@ -53,14 +92,57 @@ public class UserDeviceDetailActivity extends BaseActivityNoP<UserDeviceLayoutBi
|
|||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void showError(String message) {
|
public void showCustomerDetail(CustomerDetailEntity detail) {
|
||||||
hideLoading();
|
CustomerEntity customer = detail.getCustomer();
|
||||||
if (message != null && !message.isEmpty()) {
|
if (customer != null) {
|
||||||
ToastUtil.showShort(mContext, message);
|
viewBinding.tvUserNamePhone.setText(getString(R.string.user_device_name_phone,
|
||||||
|
safeText(customer.getName()), safeText(customer.getPhone())));
|
||||||
|
viewBinding.tvUserDeviceCount.setText(getString(R.string.user_device_count,
|
||||||
|
customer.getDeviceCount()));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// 当前持有设备在前,已退回设备在后,统一交给列表适配器渲染
|
||||||
|
List<CustomerDeviceEntity> devices = new ArrayList<>();
|
||||||
|
if (detail.getHeldDevices() != null) {
|
||||||
|
devices.addAll(detail.getHeldDevices());
|
||||||
|
}
|
||||||
|
if (detail.getReturnedDevices() != null) {
|
||||||
|
devices.addAll(detail.getReturnedDevices());
|
||||||
|
}
|
||||||
|
mAdapter.setNewData(devices);
|
||||||
|
viewBinding.tvDeviceTotal.setText(getString(R.string.user_device_total,
|
||||||
|
String.valueOf(devices.size())));
|
||||||
|
viewBinding.tvUserDeviceState.setText(R.string.user_device_empty);
|
||||||
|
viewBinding.tvUserDeviceState.setVisibility(devices.isEmpty()
|
||||||
|
? View.VISIBLE : View.GONE);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void showCustomerDetailError(String message) {
|
||||||
|
String error = TextUtils.isEmpty(message)
|
||||||
|
? getString(R.string.user_device_load_failed) : message;
|
||||||
|
viewBinding.tvUserDeviceState.setText(error);
|
||||||
|
viewBinding.tvUserDeviceState.setVisibility(View.VISIBLE);
|
||||||
|
ToastUtil.showShort(mContext, error);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void showError(String message) {
|
||||||
|
showCustomerDetailError(message);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void logOut(BaseBean bean) {
|
public void logOut(BaseBean bean) {
|
||||||
|
// 登录失效沿用父类统一处理。
|
||||||
|
}
|
||||||
|
|
||||||
|
private String safeText(String value) {
|
||||||
|
return TextUtils.isEmpty(value) ? "--" : value;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
protected void onDestroy() {
|
||||||
|
viewBinding.rvUserDevices.setAdapter(null);
|
||||||
|
super.onDestroy();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -6,20 +6,52 @@ import android.view.View;
|
|||||||
import android.view.inputmethod.EditorInfo;
|
import android.view.inputmethod.EditorInfo;
|
||||||
import android.view.inputmethod.InputMethodManager;
|
import android.view.inputmethod.InputMethodManager;
|
||||||
|
|
||||||
|
import androidx.recyclerview.widget.LinearLayoutManager;
|
||||||
|
|
||||||
import com.ckkj.griddlebiz.R;
|
import com.ckkj.griddlebiz.R;
|
||||||
import com.ckkj.griddlebiz.base.BaseActivityNoP;
|
import com.ckkj.griddlebiz.base.BaseActivity;
|
||||||
|
import com.ckkj.griddlebiz.custom.view.CustomRefreshHeader;
|
||||||
import com.ckkj.griddlebiz.databinding.UserManageLayoutBinding;
|
import com.ckkj.griddlebiz.databinding.UserManageLayoutBinding;
|
||||||
import com.ckkj.griddlebiz.network.BaseBean;
|
import com.ckkj.griddlebiz.network.BaseBean;
|
||||||
|
import com.ckkj.griddlebiz.network.PageResult;
|
||||||
|
import com.ckkj.griddlebiz.user.adapter.CustomerAdapter;
|
||||||
|
import com.ckkj.griddlebiz.user.entity.CustomerEntity;
|
||||||
|
import com.ckkj.griddlebiz.user.mvp.CustomerContract;
|
||||||
|
import com.ckkj.griddlebiz.user.mvp.CustomerImpl;
|
||||||
|
import com.ckkj.griddlebiz.user.mvp.CustomerListPresenter;
|
||||||
import com.ckkj.griddlebiz.utils.show.ToastUtil;
|
import com.ckkj.griddlebiz.utils.show.ToastUtil;
|
||||||
import com.gyf.immersionbar.ImmersionBar;
|
import com.gyf.immersionbar.ImmersionBar;
|
||||||
|
import com.scwang.smart.refresh.footer.ClassicsFooter;
|
||||||
|
|
||||||
|
import java.util.ArrayList;
|
||||||
|
import java.util.LinkedHashMap;
|
||||||
|
import java.util.Map;
|
||||||
|
|
||||||
import butterknife.OnClick;
|
import butterknife.OnClick;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 用户管理:按 SN / 机主 / 用户搜索,展示用户列表,点击用户进入其设备列表。
|
* 用户管理:按姓名/手机号搜索客户,支持下拉刷新与上拉加载更多。
|
||||||
* 列表数据目前使用设计稿示例,后续接入用户接口时替换。
|
|
||||||
*/
|
*/
|
||||||
public class UserManageActivity extends BaseActivityNoP<UserManageLayoutBinding> {
|
public class UserManageActivity extends BaseActivity<UserManageLayoutBinding, CustomerListPresenter>
|
||||||
|
implements CustomerContract.CustomerListView {
|
||||||
|
|
||||||
|
/** 每页条数,与接口 size 参数一致 */
|
||||||
|
private static final int PAGE_SIZE = 20;
|
||||||
|
|
||||||
|
private CustomerAdapter mAdapter;
|
||||||
|
/** 已成功加载到的页码,0 表示尚未加载 */
|
||||||
|
private int mLoadedPage;
|
||||||
|
/** 是否有分页请求正在执行 */
|
||||||
|
private boolean mLoading;
|
||||||
|
/** 是否已没有更多数据 */
|
||||||
|
private boolean mNoMore;
|
||||||
|
/** 当前搜索关键字,空串表示不过滤 */
|
||||||
|
private String mKeyword = "";
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public CustomerListPresenter createPresenter() {
|
||||||
|
return new CustomerListPresenter(new CustomerImpl());
|
||||||
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public int getLayoutResId(Bundle savedInstanceState) {
|
public int getLayoutResId(Bundle savedInstanceState) {
|
||||||
@@ -35,7 +67,10 @@ public class UserManageActivity extends BaseActivityNoP<UserManageLayoutBinding>
|
|||||||
.keyboardEnable(true)
|
.keyboardEnable(true)
|
||||||
.init();
|
.init();
|
||||||
|
|
||||||
viewBinding.tvUserTotal.setText(getString(R.string.user_manage_total, "128"));
|
mAdapter = new CustomerAdapter(this, this::openUserDevices);
|
||||||
|
viewBinding.rvUsers.setLayoutManager(new LinearLayoutManager(this));
|
||||||
|
viewBinding.rvUsers.setItemAnimator(null);
|
||||||
|
viewBinding.rvUsers.setAdapter(mAdapter);
|
||||||
|
|
||||||
// 键盘搜索键触发查询
|
// 键盘搜索键触发查询
|
||||||
viewBinding.etSearch.setOnEditorActionListener((v, actionId, event) -> {
|
viewBinding.etSearch.setOnEditorActionListener((v, actionId, event) -> {
|
||||||
@@ -45,12 +80,16 @@ public class UserManageActivity extends BaseActivityNoP<UserManageLayoutBinding>
|
|||||||
}
|
}
|
||||||
return false;
|
return false;
|
||||||
});
|
});
|
||||||
|
|
||||||
|
viewBinding.tvUserTotal.setText(getString(R.string.user_manage_total, "0"));
|
||||||
|
initRefresh();
|
||||||
|
requestPage(1);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 用户管理页点击事件。
|
* 用户管理页点击事件。
|
||||||
*/
|
*/
|
||||||
@OnClick({R.id.iv_back, R.id.iv_search, R.id.card_user_1, R.id.card_user_2, R.id.card_user_3})
|
@OnClick({R.id.iv_back, R.id.iv_search})
|
||||||
public void onClick(View v) {
|
public void onClick(View v) {
|
||||||
switch (v.getId()) {
|
switch (v.getId()) {
|
||||||
case R.id.iv_back:
|
case R.id.iv_back:
|
||||||
@@ -59,42 +98,153 @@ public class UserManageActivity extends BaseActivityNoP<UserManageLayoutBinding>
|
|||||||
break;
|
break;
|
||||||
|
|
||||||
case R.id.iv_search:
|
case R.id.iv_search:
|
||||||
// 按关键字搜索用户
|
// 按姓名或手机号搜索用户
|
||||||
onSearch();
|
onSearch();
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case R.id.card_user_1:
|
|
||||||
case R.id.card_user_2:
|
|
||||||
case R.id.card_user_3:
|
|
||||||
// 进入该用户的设备列表
|
|
||||||
startActivity(new Intent(mContext, UserDeviceDetailActivity.class));
|
|
||||||
break;
|
|
||||||
|
|
||||||
default:
|
default:
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 搜索用户,接口待接入。
|
* 收起键盘并按关键字重新请求第一页
|
||||||
*/
|
*/
|
||||||
private void onSearch() {
|
private void onSearch() {
|
||||||
InputMethodManager imm = (InputMethodManager) getSystemService(INPUT_METHOD_SERVICE);
|
InputMethodManager imm = (InputMethodManager) getSystemService(INPUT_METHOD_SERVICE);
|
||||||
if (imm != null) {
|
if (imm != null) {
|
||||||
imm.hideSoftInputFromWindow(viewBinding.etSearch.getWindowToken(), 0);
|
imm.hideSoftInputFromWindow(viewBinding.etSearch.getWindowToken(), 0);
|
||||||
}
|
}
|
||||||
ToastUtil.showShort(mContext, R.string.user_manage_search_unavailable);
|
mKeyword = viewBinding.etSearch.getText().toString().trim();
|
||||||
|
mAdapter.setNewData(new ArrayList<>());
|
||||||
|
mLoadedPage = 0;
|
||||||
|
mNoMore = false;
|
||||||
|
viewBinding.rvUsers.scrollToPosition(0);
|
||||||
|
requestPage(1);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 初始化下拉刷新与上拉加载:首屏未加载完成前不允许上拉。
|
||||||
|
*/
|
||||||
|
private void initRefresh() {
|
||||||
|
viewBinding.refreshUsers.setRefreshHeader(new CustomRefreshHeader(mContext));
|
||||||
|
viewBinding.refreshUsers.setRefreshFooter(new ClassicsFooter(mContext));
|
||||||
|
viewBinding.refreshUsers.setEnableLoadMore(false);
|
||||||
|
viewBinding.refreshUsers.setEnableLoadMoreWhenContentNotFull(true);
|
||||||
|
viewBinding.refreshUsers.setOnRefreshListener(refresh -> requestPage(1));
|
||||||
|
viewBinding.refreshUsers.setOnLoadMoreListener(refresh -> {
|
||||||
|
if (!mLoading && !mNoMore && mLoadedPage > 0) {
|
||||||
|
requestPage(mLoadedPage + 1);
|
||||||
|
} else {
|
||||||
|
refresh.finishLoadMore();
|
||||||
|
}
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 分页请求入口:刷新失败时保留当前记录和已成功加载的页码
|
||||||
|
*/
|
||||||
|
private void requestPage(int page) {
|
||||||
|
if (page > 1 && mLoading) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
mLoading = true;
|
||||||
|
if (page == 1) {
|
||||||
|
viewBinding.refreshUsers.finishLoadMore();
|
||||||
|
viewBinding.refreshUsers.setNoMoreData(false);
|
||||||
|
viewBinding.refreshUsers.setEnableLoadMore(false);
|
||||||
|
}
|
||||||
|
// 首屏还没有数据时展示加载提示
|
||||||
|
if (mAdapter.getData().isEmpty()) {
|
||||||
|
viewBinding.tvUserState.setText(R.string.user_manage_loading);
|
||||||
|
viewBinding.tvUserState.setVisibility(View.VISIBLE);
|
||||||
|
}
|
||||||
|
mPresenter.getCustomers(page, PAGE_SIZE, mKeyword);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void showCustomers(PageResult<CustomerEntity> page, int pageNum) {
|
||||||
|
int oldCount = mAdapter.getData().size();
|
||||||
|
// 按用户 ID 去重合并,避免翻页期间数据变动导致重复条目
|
||||||
|
Map<Long, CustomerEntity> merged = new LinkedHashMap<>();
|
||||||
|
if (pageNum > 1) {
|
||||||
|
for (CustomerEntity item : mAdapter.getData()) {
|
||||||
|
merged.put(item.getUserId(), item);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
if (page.getRows() != null) {
|
||||||
|
for (CustomerEntity item : page.getRows()) {
|
||||||
|
merged.put(item.getUserId(), item);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
mAdapter.setNewData(new ArrayList<>(merged.values()));
|
||||||
|
mLoadedPage = pageNum;
|
||||||
|
|
||||||
|
// 本页不满一页或已达到总数,说明没有更多数据
|
||||||
|
boolean fullPage = page.getRows() != null && page.getRows().size() >= PAGE_SIZE;
|
||||||
|
boolean reachTotal = page.getTotal() > 0 && merged.size() >= page.getTotal();
|
||||||
|
mNoMore = !fullPage || reachTotal;
|
||||||
|
if (pageNum > 1 && merged.size() == oldCount) {
|
||||||
|
mNoMore = true;
|
||||||
|
}
|
||||||
|
|
||||||
|
long total = page.getTotal() > 0 ? page.getTotal() : merged.size();
|
||||||
|
viewBinding.tvUserTotal.setText(getString(R.string.user_manage_total,
|
||||||
|
String.valueOf(total)));
|
||||||
|
viewBinding.tvUserState.setText(R.string.user_manage_empty);
|
||||||
|
viewBinding.tvUserState.setVisibility(merged.isEmpty() ? View.VISIBLE : View.GONE);
|
||||||
|
finishPage(pageNum, true);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void showCustomersError(String message, int pageNum) {
|
||||||
|
finishPage(pageNum, false);
|
||||||
|
showError(message);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 结束本次分页加载:刷新与加载更多的失败态由框架分别展示
|
||||||
|
*/
|
||||||
|
private void finishPage(int page, boolean success) {
|
||||||
|
mLoading = false;
|
||||||
|
if (page == 1) {
|
||||||
|
viewBinding.refreshUsers.finishRefresh(success);
|
||||||
|
} else {
|
||||||
|
viewBinding.refreshUsers.finishLoadMore(success);
|
||||||
|
}
|
||||||
|
viewBinding.refreshUsers.setEnableLoadMore(!mAdapter.getData().isEmpty());
|
||||||
|
viewBinding.refreshUsers.setNoMoreData(mNoMore);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 进入该用户的设备列表
|
||||||
|
*/
|
||||||
|
private void openUserDevices(CustomerEntity customer) {
|
||||||
|
Intent intent = new Intent(mContext, UserDeviceDetailActivity.class);
|
||||||
|
intent.putExtra(UserDeviceDetailActivity.EXTRA_USER_ID, customer.getUserId());
|
||||||
|
startActivity(intent);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void showError(String message) {
|
public void showError(String message) {
|
||||||
hideLoading();
|
String error = message == null || message.isEmpty()
|
||||||
if (message != null && !message.isEmpty()) {
|
? getString(R.string.user_manage_load_failed) : message;
|
||||||
ToastUtil.showShort(mContext, message);
|
// 列表为空时用空态文案兜底,避免只弹一次 Toast 后页面空白
|
||||||
|
if (mAdapter != null && mAdapter.getData().isEmpty()) {
|
||||||
|
viewBinding.tvUserState.setText(error);
|
||||||
|
viewBinding.tvUserState.setVisibility(View.VISIBLE);
|
||||||
}
|
}
|
||||||
|
ToastUtil.showShort(mContext, error);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void logOut(BaseBean bean) {
|
public void logOut(BaseBean bean) {
|
||||||
|
// 登录失效沿用父类统一处理。
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
protected void onDestroy() {
|
||||||
|
viewBinding.rvUsers.setAdapter(null);
|
||||||
|
super.onDestroy();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -0,0 +1,49 @@
|
|||||||
|
package com.ckkj.griddlebiz.user.adapter;
|
||||||
|
|
||||||
|
import android.content.Context;
|
||||||
|
import android.text.TextUtils;
|
||||||
|
|
||||||
|
import com.chad.library.adapter.base.BaseQuickAdapter;
|
||||||
|
import com.chad.library.adapter.base.BaseViewHolder;
|
||||||
|
import com.ckkj.griddlebiz.R;
|
||||||
|
import com.ckkj.griddlebiz.user.entity.CustomerEntity;
|
||||||
|
|
||||||
|
import java.util.ArrayList;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 用户管理列表适配器:展示姓名、手机号与订单/设备数量。
|
||||||
|
*/
|
||||||
|
public class CustomerAdapter extends BaseQuickAdapter<CustomerEntity, BaseViewHolder> {
|
||||||
|
|
||||||
|
public interface OnCustomerClickListener {
|
||||||
|
void onCustomerClick(CustomerEntity customer);
|
||||||
|
}
|
||||||
|
|
||||||
|
private final Context mContext;
|
||||||
|
private final OnCustomerClickListener mListener;
|
||||||
|
|
||||||
|
public CustomerAdapter(Context context, OnCustomerClickListener listener) {
|
||||||
|
super(R.layout.item_customer, new ArrayList<>());
|
||||||
|
this.mContext = context;
|
||||||
|
this.mListener = listener;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
protected void convert(BaseViewHolder holder, CustomerEntity item) {
|
||||||
|
holder.setText(R.id.tv_customer_name, safeText(item.getName(), "--"));
|
||||||
|
holder.setText(R.id.tv_customer_phone, safeText(item.getPhone(), "--"));
|
||||||
|
holder.setText(R.id.tv_customer_devices,
|
||||||
|
mContext.getString(R.string.user_manage_devices, item.getDeviceCount()));
|
||||||
|
holder.setText(R.id.tv_customer_orders,
|
||||||
|
mContext.getString(R.string.user_manage_orders, item.getOrderCount()));
|
||||||
|
holder.itemView.setOnClickListener(v -> {
|
||||||
|
if (mListener != null && item.getUserId() > 0) {
|
||||||
|
mListener.onCustomerClick(item);
|
||||||
|
}
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
private String safeText(String value, String fallback) {
|
||||||
|
return TextUtils.isEmpty(value) ? fallback : value;
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1,64 @@
|
|||||||
|
package com.ckkj.griddlebiz.user.adapter;
|
||||||
|
|
||||||
|
import android.content.Context;
|
||||||
|
import android.text.TextUtils;
|
||||||
|
|
||||||
|
import androidx.core.content.ContextCompat;
|
||||||
|
|
||||||
|
import com.chad.library.adapter.base.BaseQuickAdapter;
|
||||||
|
import com.chad.library.adapter.base.BaseViewHolder;
|
||||||
|
import com.ckkj.griddlebiz.R;
|
||||||
|
import com.ckkj.griddlebiz.user.entity.CustomerDeviceEntity;
|
||||||
|
|
||||||
|
import java.util.ArrayList;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 用户设备列表适配器:按是否持有区分状态与图标。
|
||||||
|
*/
|
||||||
|
public class CustomerDeviceAdapter extends BaseQuickAdapter<CustomerDeviceEntity, BaseViewHolder> {
|
||||||
|
|
||||||
|
private final Context mContext;
|
||||||
|
|
||||||
|
public CustomerDeviceAdapter(Context context) {
|
||||||
|
super(R.layout.item_customer_device, new ArrayList<>());
|
||||||
|
this.mContext = context;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
protected void convert(BaseViewHolder holder, CustomerDeviceEntity item) {
|
||||||
|
holder.setText(R.id.tv_customer_device_code, safeText(item.getDeviceCode(), "--"));
|
||||||
|
holder.setText(R.id.tv_customer_device_name, safeText(item.getDeviceName(), "--"));
|
||||||
|
holder.setText(R.id.tv_customer_device_delivered, formatDate(item.getDeliveredAt()));
|
||||||
|
holder.setText(R.id.tv_customer_device_order, safeText(item.getExternalOrderNo(), "--"));
|
||||||
|
holder.setText(R.id.tv_customer_device_return, safeText(item.getReturnNo(), "--"));
|
||||||
|
|
||||||
|
// 当前持有的设备用绿色状态,已退回的用灰色状态
|
||||||
|
boolean held = item.isHeld();
|
||||||
|
holder.setText(R.id.tv_customer_device_status, mContext.getString(held
|
||||||
|
? R.string.user_device_held : R.string.user_device_returned));
|
||||||
|
holder.setBackgroundRes(R.id.tv_customer_device_status, held
|
||||||
|
? R.drawable.user_status_online_bg : R.drawable.user_status_offline_bg);
|
||||||
|
holder.setTextColor(R.id.tv_customer_device_status, ContextCompat.getColor(mContext,
|
||||||
|
held ? R.color.device_manage_status_online : R.color.device_manage_text_secondary));
|
||||||
|
holder.setImageResource(R.id.iv_customer_device_icon, held
|
||||||
|
? R.mipmap.icon_user_device_box : R.mipmap.icon_user_device_box_offline);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 接口时间为 ISO-8601 文本,列表只展示日期部分
|
||||||
|
*/
|
||||||
|
private String formatDate(String value) {
|
||||||
|
if (TextUtils.isEmpty(value)) {
|
||||||
|
return "--";
|
||||||
|
}
|
||||||
|
int index = value.indexOf('T');
|
||||||
|
if (index > 0) {
|
||||||
|
return value.substring(0, index);
|
||||||
|
}
|
||||||
|
return value.length() > 10 ? value.substring(0, 10) : value;
|
||||||
|
}
|
||||||
|
|
||||||
|
private String safeText(String value, String fallback) {
|
||||||
|
return TextUtils.isEmpty(value) ? fallback : value;
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1,41 @@
|
|||||||
|
package com.ckkj.griddlebiz.user.entity;
|
||||||
|
|
||||||
|
import java.io.Serializable;
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 客户详情(文档 9.2 CustomerDetail)。
|
||||||
|
*/
|
||||||
|
public class CustomerDetailEntity implements Serializable {
|
||||||
|
|
||||||
|
/** 客户摘要 */
|
||||||
|
private CustomerEntity customer;
|
||||||
|
/** 当前持有设备 */
|
||||||
|
private List<CustomerDeviceEntity> heldDevices;
|
||||||
|
/** 已退回设备 */
|
||||||
|
private List<CustomerDeviceEntity> returnedDevices;
|
||||||
|
|
||||||
|
public CustomerEntity getCustomer() {
|
||||||
|
return customer;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setCustomer(CustomerEntity customer) {
|
||||||
|
this.customer = customer;
|
||||||
|
}
|
||||||
|
|
||||||
|
public List<CustomerDeviceEntity> getHeldDevices() {
|
||||||
|
return heldDevices;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setHeldDevices(List<CustomerDeviceEntity> heldDevices) {
|
||||||
|
this.heldDevices = heldDevices;
|
||||||
|
}
|
||||||
|
|
||||||
|
public List<CustomerDeviceEntity> getReturnedDevices() {
|
||||||
|
return returnedDevices;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setReturnedDevices(List<CustomerDeviceEntity> returnedDevices) {
|
||||||
|
this.returnedDevices = returnedDevices;
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1,110 @@
|
|||||||
|
package com.ckkj.griddlebiz.user.entity;
|
||||||
|
|
||||||
|
import java.io.Serializable;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 客户关联设备(文档 9.2 CustomerDevice)。
|
||||||
|
*/
|
||||||
|
public class CustomerDeviceEntity implements Serializable {
|
||||||
|
|
||||||
|
/** 设备 ID */
|
||||||
|
private long deviceId;
|
||||||
|
/** 设备 SN */
|
||||||
|
private String deviceCode;
|
||||||
|
/** 设备名称 */
|
||||||
|
private String deviceName;
|
||||||
|
/** 型号 ID */
|
||||||
|
private long modelId;
|
||||||
|
/** 订单 ID */
|
||||||
|
private long orderId;
|
||||||
|
/** 商城订单号 */
|
||||||
|
private String externalOrderNo;
|
||||||
|
/** 是否当前持有 */
|
||||||
|
private boolean held;
|
||||||
|
/** 交付时间(ISO-8601 文本) */
|
||||||
|
private String deliveredAt;
|
||||||
|
/** 退回时间(ISO-8601 文本) */
|
||||||
|
private String returnedAt;
|
||||||
|
/** 退货单号 */
|
||||||
|
private String returnNo;
|
||||||
|
|
||||||
|
public long getDeviceId() {
|
||||||
|
return deviceId;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setDeviceId(long deviceId) {
|
||||||
|
this.deviceId = deviceId;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getDeviceCode() {
|
||||||
|
return deviceCode;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setDeviceCode(String deviceCode) {
|
||||||
|
this.deviceCode = deviceCode;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getDeviceName() {
|
||||||
|
return deviceName;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setDeviceName(String deviceName) {
|
||||||
|
this.deviceName = deviceName;
|
||||||
|
}
|
||||||
|
|
||||||
|
public long getModelId() {
|
||||||
|
return modelId;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setModelId(long modelId) {
|
||||||
|
this.modelId = modelId;
|
||||||
|
}
|
||||||
|
|
||||||
|
public long getOrderId() {
|
||||||
|
return orderId;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setOrderId(long orderId) {
|
||||||
|
this.orderId = orderId;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getExternalOrderNo() {
|
||||||
|
return externalOrderNo;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setExternalOrderNo(String externalOrderNo) {
|
||||||
|
this.externalOrderNo = externalOrderNo;
|
||||||
|
}
|
||||||
|
|
||||||
|
public boolean isHeld() {
|
||||||
|
return held;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setHeld(boolean held) {
|
||||||
|
this.held = held;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getDeliveredAt() {
|
||||||
|
return deliveredAt;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setDeliveredAt(String deliveredAt) {
|
||||||
|
this.deliveredAt = deliveredAt;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getReturnedAt() {
|
||||||
|
return returnedAt;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setReturnedAt(String returnedAt) {
|
||||||
|
this.returnedAt = returnedAt;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getReturnNo() {
|
||||||
|
return returnNo;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setReturnNo(String returnNo) {
|
||||||
|
this.returnNo = returnNo;
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1,60 @@
|
|||||||
|
package com.ckkj.griddlebiz.user.entity;
|
||||||
|
|
||||||
|
import java.io.Serializable;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 客户摘要(文档 9.1 Customer)。
|
||||||
|
*/
|
||||||
|
public class CustomerEntity implements Serializable {
|
||||||
|
|
||||||
|
/** 购买人系统用户 ID */
|
||||||
|
private long userId;
|
||||||
|
/** 姓名 */
|
||||||
|
private String name;
|
||||||
|
/** 手机号 */
|
||||||
|
private String phone;
|
||||||
|
/** 在本代理商名下的订单总数 */
|
||||||
|
private long orderCount;
|
||||||
|
/** 当前持有设备数 */
|
||||||
|
private long deviceCount;
|
||||||
|
|
||||||
|
public long getUserId() {
|
||||||
|
return userId;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setUserId(long userId) {
|
||||||
|
this.userId = userId;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getName() {
|
||||||
|
return name;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setName(String name) {
|
||||||
|
this.name = name;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getPhone() {
|
||||||
|
return phone;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setPhone(String phone) {
|
||||||
|
this.phone = phone;
|
||||||
|
}
|
||||||
|
|
||||||
|
public long getOrderCount() {
|
||||||
|
return orderCount;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setOrderCount(long orderCount) {
|
||||||
|
this.orderCount = orderCount;
|
||||||
|
}
|
||||||
|
|
||||||
|
public long getDeviceCount() {
|
||||||
|
return deviceCount;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setDeviceCount(long deviceCount) {
|
||||||
|
this.deviceCount = deviceCount;
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1,51 @@
|
|||||||
|
package com.ckkj.griddlebiz.user.mvp;
|
||||||
|
|
||||||
|
import com.ckkj.griddlebiz.base.IView;
|
||||||
|
import com.ckkj.griddlebiz.network.PageResult;
|
||||||
|
import com.ckkj.griddlebiz.user.entity.CustomerDetailEntity;
|
||||||
|
import com.ckkj.griddlebiz.user.entity.CustomerEntity;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 用户管理模块的 MVP 协议:客户列表与用户设备详情共用数据层。
|
||||||
|
*/
|
||||||
|
public class CustomerContract {
|
||||||
|
|
||||||
|
public interface CallBack<T> {
|
||||||
|
void success(T data);
|
||||||
|
|
||||||
|
void fail(String message);
|
||||||
|
}
|
||||||
|
|
||||||
|
public interface DataModel {
|
||||||
|
/**
|
||||||
|
* 客户分页(文档 9.1)
|
||||||
|
*
|
||||||
|
* @param page 页码,从 1 开始
|
||||||
|
* @param size 每页条数
|
||||||
|
* @param keyword 姓名或手机号模糊搜索,可为空
|
||||||
|
*/
|
||||||
|
void getCustomers(int page, int size, String keyword,
|
||||||
|
CallBack<PageResult<CustomerEntity>> callBack);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 客户详情(文档 9.2):包含当前持有与已退回设备
|
||||||
|
*/
|
||||||
|
void getCustomerDetail(long userId, CallBack<CustomerDetailEntity> callBack);
|
||||||
|
}
|
||||||
|
|
||||||
|
public interface CustomerListView extends IView {
|
||||||
|
// 客户分页加载成功,pageNum 为本次请求的页码
|
||||||
|
void showCustomers(PageResult<CustomerEntity> page, int pageNum);
|
||||||
|
|
||||||
|
// 客户分页加载失败,pageNum 为本次请求的页码
|
||||||
|
void showCustomersError(String message, int pageNum);
|
||||||
|
}
|
||||||
|
|
||||||
|
public interface CustomerDeviceView extends IView {
|
||||||
|
// 客户详情加载成功
|
||||||
|
void showCustomerDetail(CustomerDetailEntity detail);
|
||||||
|
|
||||||
|
// 客户详情加载失败
|
||||||
|
void showCustomerDetailError(String message);
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1,40 @@
|
|||||||
|
package com.ckkj.griddlebiz.user.mvp;
|
||||||
|
|
||||||
|
import com.ckkj.griddlebiz.base.BasePresenter;
|
||||||
|
import com.ckkj.griddlebiz.user.entity.CustomerDetailEntity;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 用户设备详情业务处理。
|
||||||
|
*/
|
||||||
|
public class CustomerDevicePresenter extends BasePresenter<CustomerContract.CustomerDeviceView> {
|
||||||
|
|
||||||
|
private final CustomerImpl mImpl;
|
||||||
|
|
||||||
|
public CustomerDevicePresenter(CustomerImpl impl) {
|
||||||
|
this.mImpl = impl;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 客户详情(文档 9.2)
|
||||||
|
*
|
||||||
|
* @param userId 购买人系统用户 ID
|
||||||
|
*/
|
||||||
|
public void getCustomerDetail(long userId) {
|
||||||
|
mImpl.getCustomerDetail(userId,
|
||||||
|
new CustomerContract.CallBack<CustomerDetailEntity>() {
|
||||||
|
@Override
|
||||||
|
public void success(CustomerDetailEntity data) {
|
||||||
|
if (getView() != null) {
|
||||||
|
getView().showCustomerDetail(data);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void fail(String message) {
|
||||||
|
if (getView() != null) {
|
||||||
|
getView().showCustomerDetailError(message);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
});
|
||||||
|
}
|
||||||
|
}
|
||||||
112
app/src/main/java/com/ckkj/griddlebiz/user/mvp/CustomerImpl.java
Normal file
@@ -0,0 +1,112 @@
|
|||||||
|
package com.ckkj.griddlebiz.user.mvp;
|
||||||
|
|
||||||
|
import android.text.TextUtils;
|
||||||
|
|
||||||
|
import com.ckkj.griddlebiz.network.BaseBean;
|
||||||
|
import com.ckkj.griddlebiz.network.NetWorkManager;
|
||||||
|
import com.ckkj.griddlebiz.network.PageResult;
|
||||||
|
import com.ckkj.griddlebiz.user.entity.CustomerDetailEntity;
|
||||||
|
import com.ckkj.griddlebiz.user.entity.CustomerEntity;
|
||||||
|
|
||||||
|
import java.util.HashMap;
|
||||||
|
import java.util.Map;
|
||||||
|
|
||||||
|
import io.reactivex.Observer;
|
||||||
|
import io.reactivex.android.schedulers.AndroidSchedulers;
|
||||||
|
import io.reactivex.annotations.NonNull;
|
||||||
|
import io.reactivex.disposables.Disposable;
|
||||||
|
import io.reactivex.schedulers.Schedulers;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 用户管理数据层。
|
||||||
|
*/
|
||||||
|
public class CustomerImpl implements CustomerContract.DataModel {
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 客户分页(文档 9.1)
|
||||||
|
*/
|
||||||
|
@Override
|
||||||
|
public void getCustomers(int page, int size, String keyword,
|
||||||
|
CustomerContract.CallBack<PageResult<CustomerEntity>> callBack) {
|
||||||
|
try {
|
||||||
|
Map<String, Object> params = new HashMap<>();
|
||||||
|
params.put("page", page);
|
||||||
|
params.put("size", size);
|
||||||
|
if (!TextUtils.isEmpty(keyword)) {
|
||||||
|
params.put("keyword", keyword);
|
||||||
|
}
|
||||||
|
NetWorkManager.getRequest()
|
||||||
|
.getAgentCustomers(NetWorkManager.getToken(), params)
|
||||||
|
.subscribeOn(Schedulers.io())
|
||||||
|
.unsubscribeOn(Schedulers.io())
|
||||||
|
.observeOn(AndroidSchedulers.mainThread())
|
||||||
|
.subscribe(new Observer<BaseBean<PageResult<CustomerEntity>>>() {
|
||||||
|
@Override
|
||||||
|
public void onSubscribe(@NonNull Disposable d) {
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void onNext(@NonNull BaseBean<PageResult<CustomerEntity>> bean) {
|
||||||
|
if (bean.getCode() == 200 && bean.getData() != null) {
|
||||||
|
callBack.success(bean.getData());
|
||||||
|
} else {
|
||||||
|
callBack.fail(bean.getMessage());
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void onError(@NonNull Throwable e) {
|
||||||
|
callBack.fail(e.getMessage());
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void onComplete() {
|
||||||
|
}
|
||||||
|
});
|
||||||
|
} catch (Exception e) {
|
||||||
|
e.printStackTrace();
|
||||||
|
callBack.fail(e.getMessage());
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 客户详情(文档 9.2):越权或不存在时 data 为空,统一按失败提示
|
||||||
|
*/
|
||||||
|
@Override
|
||||||
|
public void getCustomerDetail(long userId,
|
||||||
|
CustomerContract.CallBack<CustomerDetailEntity> callBack) {
|
||||||
|
try {
|
||||||
|
NetWorkManager.getRequest()
|
||||||
|
.getAgentCustomerDetail(NetWorkManager.getToken(), userId)
|
||||||
|
.subscribeOn(Schedulers.io())
|
||||||
|
.unsubscribeOn(Schedulers.io())
|
||||||
|
.observeOn(AndroidSchedulers.mainThread())
|
||||||
|
.subscribe(new Observer<BaseBean<CustomerDetailEntity>>() {
|
||||||
|
@Override
|
||||||
|
public void onSubscribe(@NonNull Disposable d) {
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void onNext(@NonNull BaseBean<CustomerDetailEntity> bean) {
|
||||||
|
if (bean.getCode() == 200 && bean.getData() != null) {
|
||||||
|
callBack.success(bean.getData());
|
||||||
|
} else {
|
||||||
|
callBack.fail(bean.getMessage());
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void onError(@NonNull Throwable e) {
|
||||||
|
callBack.fail(e.getMessage());
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void onComplete() {
|
||||||
|
}
|
||||||
|
});
|
||||||
|
} catch (Exception e) {
|
||||||
|
e.printStackTrace();
|
||||||
|
callBack.fail(e.getMessage());
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1,43 @@
|
|||||||
|
package com.ckkj.griddlebiz.user.mvp;
|
||||||
|
|
||||||
|
import com.ckkj.griddlebiz.base.BasePresenter;
|
||||||
|
import com.ckkj.griddlebiz.network.PageResult;
|
||||||
|
import com.ckkj.griddlebiz.user.entity.CustomerEntity;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 用户管理列表业务处理。
|
||||||
|
*/
|
||||||
|
public class CustomerListPresenter extends BasePresenter<CustomerContract.CustomerListView> {
|
||||||
|
|
||||||
|
private final CustomerImpl mImpl;
|
||||||
|
|
||||||
|
public CustomerListPresenter(CustomerImpl impl) {
|
||||||
|
this.mImpl = impl;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 客户分页(文档 9.1)
|
||||||
|
*
|
||||||
|
* @param page 页码,从 1 开始
|
||||||
|
* @param size 每页条数
|
||||||
|
* @param keyword 姓名或手机号,可为空
|
||||||
|
*/
|
||||||
|
public void getCustomers(int page, int size, String keyword) {
|
||||||
|
mImpl.getCustomers(page, size, keyword,
|
||||||
|
new CustomerContract.CallBack<PageResult<CustomerEntity>>() {
|
||||||
|
@Override
|
||||||
|
public void success(PageResult<CustomerEntity> data) {
|
||||||
|
if (getView() != null) {
|
||||||
|
getView().showCustomers(data, page);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void fail(String message) {
|
||||||
|
if (getView() != null) {
|
||||||
|
getView().showCustomersError(message, page);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
});
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1,5 @@
|
|||||||
|
<?xml version="1.0" encoding="utf-8"?>
|
||||||
|
<shape xmlns:android="http://schemas.android.com/apk/res/android"
|
||||||
|
android:shape="oval">
|
||||||
|
<solid android:color="#F5F5F5" />
|
||||||
|
</shape>
|
||||||
132
app/src/main/res/layout/item_customer.xml
Normal file
@@ -0,0 +1,132 @@
|
|||||||
|
<?xml version="1.0" encoding="utf-8"?>
|
||||||
|
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
|
||||||
|
xmlns:app="http://schemas.android.com/apk/res-auto"
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="107dp"
|
||||||
|
android:layout_marginStart="24dp"
|
||||||
|
android:layout_marginTop="10dp"
|
||||||
|
android:layout_marginEnd="24dp"
|
||||||
|
android:background="@drawable/device_manage_card_bg"
|
||||||
|
android:clickable="true"
|
||||||
|
android:focusable="true"
|
||||||
|
android:orientation="vertical">
|
||||||
|
|
||||||
|
<!-- 姓名、手机号与进入箭头 -->
|
||||||
|
<FrameLayout
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="50dp">
|
||||||
|
|
||||||
|
<androidx.cardview.widget.CardView
|
||||||
|
android:layout_width="36dp"
|
||||||
|
android:layout_height="36dp"
|
||||||
|
android:layout_marginStart="14dp"
|
||||||
|
android:layout_marginTop="14dp"
|
||||||
|
app:cardBackgroundColor="#F5F5F5"
|
||||||
|
app:cardCornerRadius="18dp"
|
||||||
|
app:cardElevation="0dp"
|
||||||
|
app:cardPreventCornerOverlap="false">
|
||||||
|
|
||||||
|
<ImageView
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="match_parent"
|
||||||
|
android:contentDescription="@null"
|
||||||
|
android:scaleType="centerCrop"
|
||||||
|
android:src="@mipmap/ic_launcher" />
|
||||||
|
</androidx.cardview.widget.CardView>
|
||||||
|
|
||||||
|
<TextView
|
||||||
|
android:id="@+id/tv_customer_name"
|
||||||
|
style="@style/HomeText"
|
||||||
|
android:layout_width="wrap_content"
|
||||||
|
android:layout_height="17dp"
|
||||||
|
android:layout_marginStart="60dp"
|
||||||
|
android:layout_marginTop="14dp"
|
||||||
|
android:layout_marginEnd="50dp"
|
||||||
|
android:ellipsize="end"
|
||||||
|
android:maxLines="1"
|
||||||
|
android:textColor="#222222"
|
||||||
|
android:textSize="14sp"
|
||||||
|
android:textStyle="bold" />
|
||||||
|
|
||||||
|
<ImageView
|
||||||
|
android:layout_width="15dp"
|
||||||
|
android:layout_height="15dp"
|
||||||
|
android:layout_marginStart="60dp"
|
||||||
|
android:layout_marginTop="35dp"
|
||||||
|
android:contentDescription="@null"
|
||||||
|
android:src="@mipmap/icon_user_phone" />
|
||||||
|
|
||||||
|
<TextView
|
||||||
|
android:id="@+id/tv_customer_phone"
|
||||||
|
style="@style/HomeText"
|
||||||
|
android:layout_width="wrap_content"
|
||||||
|
android:layout_height="15dp"
|
||||||
|
android:layout_marginStart="77dp"
|
||||||
|
android:layout_marginTop="35dp"
|
||||||
|
android:textColor="#999999"
|
||||||
|
android:textSize="12sp" />
|
||||||
|
|
||||||
|
<ImageView
|
||||||
|
android:layout_width="22dp"
|
||||||
|
android:layout_height="22dp"
|
||||||
|
android:layout_gravity="end|top"
|
||||||
|
android:layout_marginTop="21dp"
|
||||||
|
android:layout_marginEnd="14dp"
|
||||||
|
android:contentDescription="@null"
|
||||||
|
android:src="@mipmap/icon_user_arrow" />
|
||||||
|
</FrameLayout>
|
||||||
|
|
||||||
|
<View
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="0.5dp"
|
||||||
|
android:layout_marginStart="14dp"
|
||||||
|
android:layout_marginTop="14dp"
|
||||||
|
android:layout_marginEnd="14dp"
|
||||||
|
android:background="#DDDDDD" />
|
||||||
|
|
||||||
|
<!-- 设备数量与订单数量 -->
|
||||||
|
<LinearLayout
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="15dp"
|
||||||
|
android:layout_marginStart="14dp"
|
||||||
|
android:layout_marginTop="13dp"
|
||||||
|
android:layout_marginEnd="14dp"
|
||||||
|
android:gravity="center_vertical"
|
||||||
|
android:orientation="horizontal">
|
||||||
|
|
||||||
|
<ImageView
|
||||||
|
android:layout_width="15dp"
|
||||||
|
android:layout_height="15dp"
|
||||||
|
android:contentDescription="@null"
|
||||||
|
android:src="@mipmap/icon_user_device_box" />
|
||||||
|
|
||||||
|
<TextView
|
||||||
|
android:id="@+id/tv_customer_devices"
|
||||||
|
style="@style/HomeText"
|
||||||
|
android:layout_width="wrap_content"
|
||||||
|
android:layout_height="15dp"
|
||||||
|
android:layout_marginStart="4dp"
|
||||||
|
android:textColor="#222222"
|
||||||
|
android:textSize="12sp" />
|
||||||
|
|
||||||
|
<Space
|
||||||
|
android:layout_width="0dp"
|
||||||
|
android:layout_height="1dp"
|
||||||
|
android:layout_weight="1" />
|
||||||
|
|
||||||
|
<ImageView
|
||||||
|
android:layout_width="15dp"
|
||||||
|
android:layout_height="15dp"
|
||||||
|
android:contentDescription="@null"
|
||||||
|
android:src="@mipmap/icon_user_clock" />
|
||||||
|
|
||||||
|
<TextView
|
||||||
|
android:id="@+id/tv_customer_orders"
|
||||||
|
style="@style/HomeText"
|
||||||
|
android:layout_width="wrap_content"
|
||||||
|
android:layout_height="15dp"
|
||||||
|
android:layout_marginStart="4dp"
|
||||||
|
android:textColor="#222222"
|
||||||
|
android:textSize="12sp" />
|
||||||
|
</LinearLayout>
|
||||||
|
</LinearLayout>
|
||||||
169
app/src/main/res/layout/item_customer_device.xml
Normal file
@@ -0,0 +1,169 @@
|
|||||||
|
<?xml version="1.0" encoding="utf-8"?>
|
||||||
|
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="130dp"
|
||||||
|
android:layout_marginStart="24dp"
|
||||||
|
android:layout_marginTop="10dp"
|
||||||
|
android:layout_marginEnd="24dp"
|
||||||
|
android:background="@drawable/device_manage_card_bg"
|
||||||
|
android:orientation="vertical">
|
||||||
|
|
||||||
|
<!-- 设备 SN、名称与持有状态 -->
|
||||||
|
<FrameLayout
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="50dp">
|
||||||
|
|
||||||
|
<ImageView
|
||||||
|
android:id="@+id/iv_customer_device_icon"
|
||||||
|
android:layout_width="36dp"
|
||||||
|
android:layout_height="36dp"
|
||||||
|
android:layout_marginStart="14dp"
|
||||||
|
android:layout_marginTop="14dp"
|
||||||
|
android:contentDescription="@null"
|
||||||
|
android:src="@mipmap/icon_user_device_box" />
|
||||||
|
|
||||||
|
<TextView
|
||||||
|
android:id="@+id/tv_customer_device_code"
|
||||||
|
style="@style/HomeText"
|
||||||
|
android:layout_width="wrap_content"
|
||||||
|
android:layout_height="17dp"
|
||||||
|
android:layout_marginStart="60dp"
|
||||||
|
android:layout_marginTop="14dp"
|
||||||
|
android:layout_marginEnd="90dp"
|
||||||
|
android:ellipsize="end"
|
||||||
|
android:maxLines="1"
|
||||||
|
android:textColor="#222222"
|
||||||
|
android:textSize="14sp"
|
||||||
|
android:textStyle="bold" />
|
||||||
|
|
||||||
|
<TextView
|
||||||
|
android:id="@+id/tv_customer_device_name"
|
||||||
|
style="@style/HomeText"
|
||||||
|
android:layout_width="wrap_content"
|
||||||
|
android:layout_height="15dp"
|
||||||
|
android:layout_marginStart="60dp"
|
||||||
|
android:layout_marginTop="35dp"
|
||||||
|
android:layout_marginEnd="90dp"
|
||||||
|
android:ellipsize="end"
|
||||||
|
android:maxLines="1"
|
||||||
|
android:textColor="#999999"
|
||||||
|
android:textSize="12sp" />
|
||||||
|
|
||||||
|
<TextView
|
||||||
|
android:id="@+id/tv_customer_device_status"
|
||||||
|
style="@style/HomeText"
|
||||||
|
android:layout_width="68dp"
|
||||||
|
android:layout_height="27dp"
|
||||||
|
android:layout_gravity="end|top"
|
||||||
|
android:layout_marginTop="14dp"
|
||||||
|
android:layout_marginEnd="14dp"
|
||||||
|
android:background="@drawable/user_status_online_bg"
|
||||||
|
android:gravity="center"
|
||||||
|
android:textColor="#22A45D"
|
||||||
|
android:textSize="12sp" />
|
||||||
|
</FrameLayout>
|
||||||
|
|
||||||
|
<View
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="0.5dp"
|
||||||
|
android:layout_marginStart="14dp"
|
||||||
|
android:layout_marginTop="14dp"
|
||||||
|
android:layout_marginEnd="14dp"
|
||||||
|
android:background="#DDDDDD" />
|
||||||
|
|
||||||
|
<!-- 交付时间、订单号、退货单号 -->
|
||||||
|
<LinearLayout
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="38dp"
|
||||||
|
android:layout_marginStart="14dp"
|
||||||
|
android:layout_marginTop="13dp"
|
||||||
|
android:layout_marginEnd="14dp"
|
||||||
|
android:orientation="horizontal">
|
||||||
|
|
||||||
|
<LinearLayout
|
||||||
|
android:layout_width="0dp"
|
||||||
|
android:layout_height="38dp"
|
||||||
|
android:layout_weight="1"
|
||||||
|
android:orientation="vertical">
|
||||||
|
|
||||||
|
<TextView
|
||||||
|
style="@style/HomeText"
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="15dp"
|
||||||
|
android:maxLines="1"
|
||||||
|
android:text="@string/user_device_delivered"
|
||||||
|
android:textColor="#666666"
|
||||||
|
android:textSize="12sp" />
|
||||||
|
|
||||||
|
<TextView
|
||||||
|
android:id="@+id/tv_customer_device_delivered"
|
||||||
|
style="@style/HomeText"
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="17dp"
|
||||||
|
android:layout_marginTop="6dp"
|
||||||
|
android:ellipsize="end"
|
||||||
|
android:maxLines="1"
|
||||||
|
android:textColor="#222222"
|
||||||
|
android:textSize="14sp"
|
||||||
|
android:textStyle="bold" />
|
||||||
|
</LinearLayout>
|
||||||
|
|
||||||
|
<LinearLayout
|
||||||
|
android:layout_width="0dp"
|
||||||
|
android:layout_height="38dp"
|
||||||
|
android:layout_marginStart="12dp"
|
||||||
|
android:layout_weight="1"
|
||||||
|
android:orientation="vertical">
|
||||||
|
|
||||||
|
<TextView
|
||||||
|
style="@style/HomeText"
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="15dp"
|
||||||
|
android:maxLines="1"
|
||||||
|
android:text="@string/user_device_order_no"
|
||||||
|
android:textColor="#666666"
|
||||||
|
android:textSize="12sp" />
|
||||||
|
|
||||||
|
<TextView
|
||||||
|
android:id="@+id/tv_customer_device_order"
|
||||||
|
style="@style/HomeText"
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="17dp"
|
||||||
|
android:layout_marginTop="6dp"
|
||||||
|
android:ellipsize="end"
|
||||||
|
android:maxLines="1"
|
||||||
|
android:textColor="#222222"
|
||||||
|
android:textSize="14sp"
|
||||||
|
android:textStyle="bold" />
|
||||||
|
</LinearLayout>
|
||||||
|
|
||||||
|
<LinearLayout
|
||||||
|
android:layout_width="0dp"
|
||||||
|
android:layout_height="38dp"
|
||||||
|
android:layout_marginStart="12dp"
|
||||||
|
android:layout_weight="1"
|
||||||
|
android:orientation="vertical">
|
||||||
|
|
||||||
|
<TextView
|
||||||
|
style="@style/HomeText"
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="15dp"
|
||||||
|
android:maxLines="1"
|
||||||
|
android:text="@string/user_device_return_no"
|
||||||
|
android:textColor="#666666"
|
||||||
|
android:textSize="12sp" />
|
||||||
|
|
||||||
|
<TextView
|
||||||
|
android:id="@+id/tv_customer_device_return"
|
||||||
|
style="@style/HomeText"
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="17dp"
|
||||||
|
android:layout_marginTop="6dp"
|
||||||
|
android:ellipsize="end"
|
||||||
|
android:maxLines="1"
|
||||||
|
android:textColor="#222222"
|
||||||
|
android:textSize="14sp"
|
||||||
|
android:textStyle="bold" />
|
||||||
|
</LinearLayout>
|
||||||
|
</LinearLayout>
|
||||||
|
</LinearLayout>
|
||||||
85
app/src/main/res/layout/item_message.xml
Normal file
@@ -0,0 +1,85 @@
|
|||||||
|
<?xml version="1.0" encoding="utf-8"?>
|
||||||
|
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:background="@android:color/white"
|
||||||
|
android:orientation="vertical">
|
||||||
|
|
||||||
|
<!-- 单条消息:头像 + 标题 + 时间 + 摘要 -->
|
||||||
|
<FrameLayout
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="80dp">
|
||||||
|
|
||||||
|
<FrameLayout
|
||||||
|
android:id="@+id/fl_message_avatar"
|
||||||
|
android:layout_width="48dp"
|
||||||
|
android:layout_height="48dp"
|
||||||
|
android:layout_marginStart="16dp"
|
||||||
|
android:layout_marginTop="16dp"
|
||||||
|
android:background="@drawable/message_avatar_bg">
|
||||||
|
|
||||||
|
<ImageView
|
||||||
|
android:id="@+id/iv_message_notice"
|
||||||
|
android:layout_width="27dp"
|
||||||
|
android:layout_height="23dp"
|
||||||
|
android:layout_gravity="center"
|
||||||
|
android:contentDescription="@null"
|
||||||
|
android:src="@drawable/message_bubble_icon" />
|
||||||
|
|
||||||
|
<ImageView
|
||||||
|
android:id="@+id/iv_message_avatar"
|
||||||
|
android:layout_width="48dp"
|
||||||
|
android:layout_height="48dp"
|
||||||
|
android:contentDescription="@null"
|
||||||
|
android:scaleType="centerCrop"
|
||||||
|
android:src="@mipmap/ic_launcher"
|
||||||
|
android:visibility="gone" />
|
||||||
|
</FrameLayout>
|
||||||
|
|
||||||
|
<TextView
|
||||||
|
android:id="@+id/tv_message_title"
|
||||||
|
style="@style/HomeText"
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="17dp"
|
||||||
|
android:layout_marginStart="72dp"
|
||||||
|
android:layout_marginTop="20dp"
|
||||||
|
android:layout_marginEnd="100dp"
|
||||||
|
android:ellipsize="end"
|
||||||
|
android:maxLines="1"
|
||||||
|
android:textColor="#222222"
|
||||||
|
android:textSize="14sp"
|
||||||
|
android:textStyle="bold" />
|
||||||
|
|
||||||
|
<TextView
|
||||||
|
android:id="@+id/tv_message_time"
|
||||||
|
style="@style/HomeText"
|
||||||
|
android:layout_width="wrap_content"
|
||||||
|
android:layout_height="17dp"
|
||||||
|
android:layout_gravity="end|top"
|
||||||
|
android:layout_marginTop="20dp"
|
||||||
|
android:layout_marginEnd="16dp"
|
||||||
|
android:textColor="#666666"
|
||||||
|
android:textSize="14sp" />
|
||||||
|
|
||||||
|
<TextView
|
||||||
|
android:id="@+id/tv_message_summary"
|
||||||
|
style="@style/HomeText"
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="17dp"
|
||||||
|
android:layout_marginStart="72dp"
|
||||||
|
android:layout_marginTop="43dp"
|
||||||
|
android:layout_marginEnd="16dp"
|
||||||
|
android:ellipsize="end"
|
||||||
|
android:maxLines="1"
|
||||||
|
android:textColor="#666666"
|
||||||
|
android:textSize="14sp" />
|
||||||
|
</FrameLayout>
|
||||||
|
|
||||||
|
<!-- 条目分隔线 -->
|
||||||
|
<View
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="0.5dp"
|
||||||
|
android:layout_marginStart="16dp"
|
||||||
|
android:layout_marginEnd="16dp"
|
||||||
|
android:background="#DDDDDD" />
|
||||||
|
</LinearLayout>
|
||||||
128
app/src/main/res/layout/item_pickup_order.xml
Normal file
@@ -0,0 +1,128 @@
|
|||||||
|
<?xml version="1.0" encoding="utf-8"?>
|
||||||
|
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
|
||||||
|
xmlns:app="http://schemas.android.com/apk/res-auto"
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="109dp"
|
||||||
|
android:layout_marginStart="24dp"
|
||||||
|
android:layout_marginTop="10dp"
|
||||||
|
android:layout_marginEnd="24dp"
|
||||||
|
android:background="@drawable/device_manage_card_bg"
|
||||||
|
android:orientation="vertical">
|
||||||
|
|
||||||
|
<!-- 用户、商品与核销时间 -->
|
||||||
|
<LinearLayout
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="36dp"
|
||||||
|
android:layout_marginStart="14dp"
|
||||||
|
android:layout_marginTop="14dp"
|
||||||
|
android:layout_marginEnd="14dp"
|
||||||
|
android:orientation="horizontal">
|
||||||
|
|
||||||
|
<androidx.cardview.widget.CardView
|
||||||
|
android:layout_width="36dp"
|
||||||
|
android:layout_height="36dp"
|
||||||
|
app:cardBackgroundColor="#F5F5F5"
|
||||||
|
app:cardCornerRadius="18dp"
|
||||||
|
app:cardElevation="0dp"
|
||||||
|
app:cardPreventCornerOverlap="false">
|
||||||
|
|
||||||
|
<ImageView
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="match_parent"
|
||||||
|
android:contentDescription="@null"
|
||||||
|
android:scaleType="centerCrop"
|
||||||
|
android:src="@mipmap/ic_launcher" />
|
||||||
|
</androidx.cardview.widget.CardView>
|
||||||
|
|
||||||
|
<LinearLayout
|
||||||
|
android:layout_width="0dp"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:layout_marginStart="8dp"
|
||||||
|
android:layout_weight="1"
|
||||||
|
android:orientation="vertical">
|
||||||
|
|
||||||
|
<TextView
|
||||||
|
android:id="@+id/tv_order_customer"
|
||||||
|
style="@style/HomeText"
|
||||||
|
android:layout_width="wrap_content"
|
||||||
|
android:layout_height="17dp"
|
||||||
|
android:layout_marginEnd="8dp"
|
||||||
|
android:ellipsize="end"
|
||||||
|
android:maxLines="1"
|
||||||
|
android:textColor="#222222"
|
||||||
|
android:textSize="14sp"
|
||||||
|
android:textStyle="bold" />
|
||||||
|
|
||||||
|
<TextView
|
||||||
|
android:id="@+id/tv_order_goods"
|
||||||
|
style="@style/HomeText"
|
||||||
|
android:layout_width="wrap_content"
|
||||||
|
android:layout_height="15dp"
|
||||||
|
android:layout_marginTop="4dp"
|
||||||
|
android:layout_marginEnd="8dp"
|
||||||
|
android:ellipsize="end"
|
||||||
|
android:maxLines="1"
|
||||||
|
android:textColor="#999999"
|
||||||
|
android:textSize="12sp" />
|
||||||
|
</LinearLayout>
|
||||||
|
|
||||||
|
<TextView
|
||||||
|
android:id="@+id/tv_order_time"
|
||||||
|
style="@style/HomeText"
|
||||||
|
android:layout_width="wrap_content"
|
||||||
|
android:layout_height="15dp"
|
||||||
|
android:layout_gravity="top"
|
||||||
|
android:layout_marginTop="1dp"
|
||||||
|
android:textColor="#666666"
|
||||||
|
android:textSize="12sp" />
|
||||||
|
</LinearLayout>
|
||||||
|
|
||||||
|
<View
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="0.5dp"
|
||||||
|
android:layout_marginStart="14dp"
|
||||||
|
android:layout_marginTop="14dp"
|
||||||
|
android:layout_marginEnd="14dp"
|
||||||
|
android:background="#DDDDDD" />
|
||||||
|
|
||||||
|
<!-- 消耗积分与订单号 -->
|
||||||
|
<LinearLayout
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="21dp"
|
||||||
|
android:layout_marginStart="14dp"
|
||||||
|
android:layout_marginTop="13dp"
|
||||||
|
android:layout_marginEnd="14dp"
|
||||||
|
android:gravity="center_vertical"
|
||||||
|
android:orientation="horizontal">
|
||||||
|
|
||||||
|
<TextView
|
||||||
|
android:id="@+id/tv_order_points"
|
||||||
|
style="@style/HomeText"
|
||||||
|
android:layout_width="wrap_content"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:textColor="#FF6900"
|
||||||
|
android:textSize="14sp" />
|
||||||
|
|
||||||
|
<Space
|
||||||
|
android:layout_width="0dp"
|
||||||
|
android:layout_height="1dp"
|
||||||
|
android:layout_weight="1" />
|
||||||
|
|
||||||
|
<ImageView
|
||||||
|
android:layout_width="21dp"
|
||||||
|
android:layout_height="21dp"
|
||||||
|
android:contentDescription="@null"
|
||||||
|
android:src="@mipmap/icon_pickup_stats_code" />
|
||||||
|
|
||||||
|
<TextView
|
||||||
|
android:id="@+id/tv_order_no"
|
||||||
|
style="@style/HomeText"
|
||||||
|
android:layout_width="wrap_content"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:layout_marginStart="4dp"
|
||||||
|
android:ellipsize="end"
|
||||||
|
android:maxLines="1"
|
||||||
|
android:textColor="#FF6900"
|
||||||
|
android:textSize="14sp" />
|
||||||
|
</LinearLayout>
|
||||||
|
</LinearLayout>
|
||||||
79
app/src/main/res/layout/item_product_outbound_pending.xml
Normal file
@@ -0,0 +1,79 @@
|
|||||||
|
<?xml version="1.0" encoding="utf-8"?>
|
||||||
|
<FrameLayout xmlns:android="http://schemas.android.com/apk/res/android"
|
||||||
|
android:id="@+id/card_pending"
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="72dp"
|
||||||
|
android:layout_marginStart="24dp"
|
||||||
|
android:layout_marginTop="10dp"
|
||||||
|
android:layout_marginEnd="24dp"
|
||||||
|
android:background="@drawable/product_card_bg"
|
||||||
|
android:clickable="true"
|
||||||
|
android:focusable="true">
|
||||||
|
|
||||||
|
<ImageView
|
||||||
|
android:id="@+id/cb_pending"
|
||||||
|
android:layout_width="18dp"
|
||||||
|
android:layout_height="18dp"
|
||||||
|
android:layout_gravity="start|center_vertical"
|
||||||
|
android:layout_marginStart="17dp"
|
||||||
|
android:contentDescription="@string/product_outbound_select"
|
||||||
|
android:src="@mipmap/icon_product_inbound_check_off" />
|
||||||
|
|
||||||
|
<LinearLayout
|
||||||
|
android:layout_width="wrap_content"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:layout_gravity="start|top"
|
||||||
|
android:layout_marginStart="48dp"
|
||||||
|
android:layout_marginTop="16dp"
|
||||||
|
android:layout_marginEnd="44dp"
|
||||||
|
android:orientation="vertical">
|
||||||
|
|
||||||
|
<TextView
|
||||||
|
style="@style/HomeText"
|
||||||
|
android:layout_width="wrap_content"
|
||||||
|
android:layout_height="17dp"
|
||||||
|
android:text="@string/product_outbound_device_sn"
|
||||||
|
android:textColor="#666666"
|
||||||
|
android:textSize="14sp" />
|
||||||
|
|
||||||
|
<LinearLayout
|
||||||
|
android:layout_width="wrap_content"
|
||||||
|
android:layout_height="21dp"
|
||||||
|
android:layout_marginTop="6dp"
|
||||||
|
android:gravity="center_vertical"
|
||||||
|
android:orientation="horizontal">
|
||||||
|
|
||||||
|
<TextView
|
||||||
|
android:id="@+id/tv_device_sn"
|
||||||
|
style="@style/HomeText"
|
||||||
|
android:layout_width="wrap_content"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:fontFamily="sans-serif-medium"
|
||||||
|
android:textColor="#222222"
|
||||||
|
android:textSize="14sp" />
|
||||||
|
|
||||||
|
<TextView
|
||||||
|
android:id="@+id/tv_badge"
|
||||||
|
style="@style/HomeText"
|
||||||
|
android:layout_width="wrap_content"
|
||||||
|
android:layout_height="21dp"
|
||||||
|
android:layout_marginStart="6dp"
|
||||||
|
android:background="@drawable/product_inbound_badge_bg"
|
||||||
|
android:gravity="center"
|
||||||
|
android:paddingHorizontal="6dp"
|
||||||
|
android:text="@string/product_outbound_badge"
|
||||||
|
android:textColor="#FF6900"
|
||||||
|
android:textSize="12sp"
|
||||||
|
android:visibility="gone" />
|
||||||
|
</LinearLayout>
|
||||||
|
</LinearLayout>
|
||||||
|
|
||||||
|
<ImageView
|
||||||
|
android:id="@+id/iv_delete"
|
||||||
|
android:layout_width="16dp"
|
||||||
|
android:layout_height="16dp"
|
||||||
|
android:layout_gravity="end|center_vertical"
|
||||||
|
android:layout_marginEnd="16dp"
|
||||||
|
android:contentDescription="@string/product_outbound_delete"
|
||||||
|
android:src="@mipmap/icon_product_inbound_trash" />
|
||||||
|
</FrameLayout>
|
||||||
@@ -412,8 +412,8 @@
|
|||||||
android:orientation="vertical">
|
android:orientation="vertical">
|
||||||
|
|
||||||
<ImageView
|
<ImageView
|
||||||
android:layout_width="60dp"
|
android:layout_width="53dp"
|
||||||
android:layout_height="60dp"
|
android:layout_height="53dp"
|
||||||
android:contentDescription="@null"
|
android:contentDescription="@null"
|
||||||
android:src="@mipmap/icon_home_product_inbound" />
|
android:src="@mipmap/icon_home_product_inbound" />
|
||||||
|
|
||||||
@@ -425,6 +425,29 @@
|
|||||||
android:text="@string/home_product_inbound" />
|
android:text="@string/home_product_inbound" />
|
||||||
</LinearLayout>
|
</LinearLayout>
|
||||||
|
|
||||||
|
|
||||||
|
<LinearLayout
|
||||||
|
android:id="@+id/action_product_outbound"
|
||||||
|
android:layout_width="0dp"
|
||||||
|
android:layout_height="match_parent"
|
||||||
|
android:layout_weight="1"
|
||||||
|
android:gravity="center_horizontal"
|
||||||
|
android:orientation="vertical">
|
||||||
|
|
||||||
|
<ImageView
|
||||||
|
android:layout_width="53dp"
|
||||||
|
android:layout_height="53dp"
|
||||||
|
android:contentDescription="@null"
|
||||||
|
android:src="@mipmap/icon_home_product_outbound" />
|
||||||
|
|
||||||
|
<TextView
|
||||||
|
style="@style/HomeQuickLabel"
|
||||||
|
android:layout_width="60dp"
|
||||||
|
android:layout_height="30dp"
|
||||||
|
android:layout_marginTop="6dp"
|
||||||
|
android:text="@string/home_product_outbound" />
|
||||||
|
</LinearLayout>
|
||||||
|
|
||||||
<LinearLayout
|
<LinearLayout
|
||||||
android:id="@+id/action_product_management"
|
android:id="@+id/action_product_management"
|
||||||
android:layout_width="0dp"
|
android:layout_width="0dp"
|
||||||
@@ -434,8 +457,8 @@
|
|||||||
android:orientation="vertical">
|
android:orientation="vertical">
|
||||||
|
|
||||||
<ImageView
|
<ImageView
|
||||||
android:layout_width="60dp"
|
android:layout_width="53dp"
|
||||||
android:layout_height="60dp"
|
android:layout_height="53dp"
|
||||||
android:contentDescription="@null"
|
android:contentDescription="@null"
|
||||||
android:src="@mipmap/icon_home_product_management" />
|
android:src="@mipmap/icon_home_product_management" />
|
||||||
|
|
||||||
@@ -456,8 +479,8 @@
|
|||||||
android:orientation="vertical">
|
android:orientation="vertical">
|
||||||
|
|
||||||
<ImageView
|
<ImageView
|
||||||
android:layout_width="60dp"
|
android:layout_width="53dp"
|
||||||
android:layout_height="60dp"
|
android:layout_height="53dp"
|
||||||
android:contentDescription="@null"
|
android:contentDescription="@null"
|
||||||
android:src="@mipmap/icon_home_statistics" />
|
android:src="@mipmap/icon_home_statistics" />
|
||||||
|
|
||||||
@@ -479,8 +502,8 @@
|
|||||||
android:orientation="vertical">
|
android:orientation="vertical">
|
||||||
|
|
||||||
<ImageView
|
<ImageView
|
||||||
android:layout_width="60dp"
|
android:layout_width="53dp"
|
||||||
android:layout_height="60dp"
|
android:layout_height="53dp"
|
||||||
android:contentDescription="@null"
|
android:contentDescription="@null"
|
||||||
android:src="@mipmap/icon_home_pickup_verification" />
|
android:src="@mipmap/icon_home_pickup_verification" />
|
||||||
|
|
||||||
|
|||||||
@@ -1,6 +1,5 @@
|
|||||||
<?xml version="1.0" encoding="utf-8"?>
|
<?xml version="1.0" encoding="utf-8"?>
|
||||||
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
|
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
|
||||||
xmlns:app="http://schemas.android.com/apk/res-auto"
|
|
||||||
android:layout_width="match_parent"
|
android:layout_width="match_parent"
|
||||||
android:layout_height="match_parent"
|
android:layout_height="match_parent"
|
||||||
android:background="@android:color/white"
|
android:background="@android:color/white"
|
||||||
@@ -46,149 +45,40 @@
|
|||||||
android:src="@mipmap/icon_message_delete" />
|
android:src="@mipmap/icon_message_delete" />
|
||||||
</FrameLayout>
|
</FrameLayout>
|
||||||
|
|
||||||
<ScrollView
|
<!-- 消息列表:下拉刷新、上拉加载更多 -->
|
||||||
|
<FrameLayout
|
||||||
android:layout_width="match_parent"
|
android:layout_width="match_parent"
|
||||||
android:layout_height="0dp"
|
android:layout_height="0dp"
|
||||||
android:layout_weight="1"
|
android:layout_weight="1"
|
||||||
android:background="#F5F5F5"
|
android:background="#F5F5F5">
|
||||||
android:fillViewport="true"
|
|
||||||
android:overScrollMode="never"
|
|
||||||
android:scrollbars="none">
|
|
||||||
|
|
||||||
<LinearLayout
|
<com.scwang.smart.refresh.layout.SmartRefreshLayout
|
||||||
|
android:id="@+id/refresh_messages"
|
||||||
android:layout_width="match_parent"
|
android:layout_width="match_parent"
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="match_parent">
|
||||||
android:orientation="vertical"
|
|
||||||
android:paddingBottom="24dp">
|
|
||||||
|
|
||||||
<!-- 消息列表 -->
|
<androidx.recyclerview.widget.RecyclerView
|
||||||
<LinearLayout
|
android:id="@+id/rv_messages"
|
||||||
android:layout_width="match_parent"
|
|
||||||
android:layout_height="160dp"
|
|
||||||
android:layout_marginTop="10dp"
|
|
||||||
android:background="@android:color/white"
|
|
||||||
android:orientation="vertical">
|
|
||||||
|
|
||||||
<FrameLayout
|
|
||||||
android:layout_width="match_parent"
|
|
||||||
android:layout_height="80dp">
|
|
||||||
|
|
||||||
<FrameLayout
|
|
||||||
android:layout_width="48dp"
|
|
||||||
android:layout_height="48dp"
|
|
||||||
android:layout_marginStart="16dp"
|
|
||||||
android:layout_marginTop="16dp"
|
|
||||||
android:background="@drawable/message_avatar_bg">
|
|
||||||
|
|
||||||
<ImageView
|
|
||||||
android:layout_width="27dp"
|
|
||||||
android:layout_height="23dp"
|
|
||||||
android:layout_gravity="center"
|
|
||||||
android:contentDescription="@null"
|
|
||||||
android:src="@drawable/message_bubble_icon" />
|
|
||||||
</FrameLayout>
|
|
||||||
|
|
||||||
<TextView
|
|
||||||
style="@style/HomeText"
|
|
||||||
android:layout_width="wrap_content"
|
|
||||||
android:layout_height="17dp"
|
|
||||||
android:layout_marginStart="72dp"
|
|
||||||
android:layout_marginTop="20dp"
|
|
||||||
android:text="@string/message_system_notice"
|
|
||||||
android:textColor="#222222"
|
|
||||||
android:textSize="14sp"
|
|
||||||
android:textStyle="bold" />
|
|
||||||
|
|
||||||
<TextView
|
|
||||||
style="@style/HomeText"
|
|
||||||
android:layout_width="wrap_content"
|
|
||||||
android:layout_height="17dp"
|
|
||||||
android:layout_gravity="end|top"
|
|
||||||
android:layout_marginTop="20dp"
|
|
||||||
android:layout_marginEnd="16dp"
|
|
||||||
android:text="@string/message_yesterday"
|
|
||||||
android:textColor="#666666"
|
|
||||||
android:textSize="14sp" />
|
|
||||||
|
|
||||||
<TextView
|
|
||||||
style="@style/HomeText"
|
|
||||||
android:layout_width="match_parent"
|
|
||||||
android:layout_height="17dp"
|
|
||||||
android:layout_marginStart="72dp"
|
|
||||||
android:layout_marginTop="43dp"
|
|
||||||
android:layout_marginEnd="16dp"
|
|
||||||
android:ellipsize="end"
|
|
||||||
android:maxLines="1"
|
|
||||||
android:text="@string/message_maintenance"
|
|
||||||
android:textColor="#666666"
|
|
||||||
android:textSize="14sp" />
|
|
||||||
</FrameLayout>
|
|
||||||
|
|
||||||
<View
|
|
||||||
android:layout_width="match_parent"
|
|
||||||
android:layout_height="0.5dp"
|
|
||||||
android:layout_marginStart="16dp"
|
|
||||||
android:layout_marginEnd="16dp"
|
|
||||||
android:background="#DDDDDD" />
|
|
||||||
|
|
||||||
<FrameLayout
|
|
||||||
android:layout_width="match_parent"
|
|
||||||
android:layout_height="79.5dp">
|
|
||||||
|
|
||||||
<androidx.cardview.widget.CardView
|
|
||||||
android:layout_width="48dp"
|
|
||||||
android:layout_height="48dp"
|
|
||||||
android:layout_marginStart="16dp"
|
|
||||||
android:layout_marginTop="15.5dp"
|
|
||||||
app:cardBackgroundColor="#F5F5F5"
|
|
||||||
app:cardCornerRadius="24dp"
|
|
||||||
app:cardElevation="0dp"
|
|
||||||
app:cardPreventCornerOverlap="false">
|
|
||||||
|
|
||||||
<ImageView
|
|
||||||
android:layout_width="match_parent"
|
android:layout_width="match_parent"
|
||||||
android:layout_height="match_parent"
|
android:layout_height="match_parent"
|
||||||
android:contentDescription="@null"
|
android:clipToPadding="false"
|
||||||
android:scaleType="centerCrop"
|
android:overScrollMode="never"
|
||||||
android:src="@mipmap/ic_launcher" />
|
android:paddingTop="10dp"
|
||||||
</androidx.cardview.widget.CardView>
|
android:paddingBottom="24dp"
|
||||||
|
android:scrollbars="none" />
|
||||||
<TextView
|
</com.scwang.smart.refresh.layout.SmartRefreshLayout>
|
||||||
style="@style/HomeText"
|
|
||||||
android:layout_width="wrap_content"
|
|
||||||
android:layout_height="17dp"
|
|
||||||
android:layout_marginStart="72dp"
|
|
||||||
android:layout_marginTop="19.5dp"
|
|
||||||
android:text="@string/message_system_notice"
|
|
||||||
android:textColor="#222222"
|
|
||||||
android:textSize="14sp"
|
|
||||||
android:textStyle="bold" />
|
|
||||||
|
|
||||||
<TextView
|
|
||||||
style="@style/HomeText"
|
|
||||||
android:layout_width="wrap_content"
|
|
||||||
android:layout_height="17dp"
|
|
||||||
android:layout_gravity="end|top"
|
|
||||||
android:layout_marginTop="19.5dp"
|
|
||||||
android:layout_marginEnd="16dp"
|
|
||||||
android:text="@string/message_yesterday"
|
|
||||||
android:textColor="#666666"
|
|
||||||
android:textSize="14sp" />
|
|
||||||
|
|
||||||
|
<!-- 加载中 / 空列表 / 加载失败提示,列表有数据时隐藏 -->
|
||||||
<TextView
|
<TextView
|
||||||
|
android:id="@+id/tv_message_state"
|
||||||
style="@style/HomeText"
|
style="@style/HomeText"
|
||||||
android:layout_width="match_parent"
|
android:layout_width="match_parent"
|
||||||
android:layout_height="17dp"
|
android:layout_height="match_parent"
|
||||||
android:layout_marginStart="72dp"
|
android:gravity="center"
|
||||||
android:layout_marginTop="42.5dp"
|
android:paddingBottom="60dp"
|
||||||
android:layout_marginEnd="16dp"
|
android:text="@string/message_empty"
|
||||||
android:ellipsize="end"
|
android:textColor="#999999"
|
||||||
android:maxLines="1"
|
android:textSize="14sp"
|
||||||
android:text="@string/message_maintenance"
|
android:visibility="gone" />
|
||||||
android:textColor="#666666"
|
|
||||||
android:textSize="14sp" />
|
|
||||||
</FrameLayout>
|
</FrameLayout>
|
||||||
</LinearLayout>
|
</LinearLayout>
|
||||||
</LinearLayout>
|
|
||||||
</ScrollView>
|
|
||||||
</LinearLayout>
|
|
||||||
|
|||||||
408
app/src/main/res/layout/pickup_order_stats_header.xml
Normal file
@@ -0,0 +1,408 @@
|
|||||||
|
<?xml version="1.0" encoding="utf-8"?>
|
||||||
|
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
|
||||||
|
xmlns:app="http://schemas.android.com/apk/res-auto"
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:orientation="vertical">
|
||||||
|
|
||||||
|
<!-- 累计统计主卡 -->
|
||||||
|
<FrameLayout
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="121dp"
|
||||||
|
android:layout_marginHorizontal="24dp"
|
||||||
|
android:layout_marginTop="20dp"
|
||||||
|
android:background="@drawable/pickup_stats_hero_bg">
|
||||||
|
|
||||||
|
<LinearLayout
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="match_parent"
|
||||||
|
android:orientation="vertical"
|
||||||
|
android:paddingStart="14dp"
|
||||||
|
android:paddingTop="14dp"
|
||||||
|
android:paddingEnd="14dp">
|
||||||
|
|
||||||
|
<TextView
|
||||||
|
style="@style/HomeText"
|
||||||
|
android:layout_width="wrap_content"
|
||||||
|
android:layout_height="17dp"
|
||||||
|
android:text="@string/pickup_stats_all"
|
||||||
|
android:textColor="@android:color/white"
|
||||||
|
android:textSize="14sp"
|
||||||
|
android:textStyle="bold" />
|
||||||
|
|
||||||
|
<LinearLayout
|
||||||
|
android:layout_width="wrap_content"
|
||||||
|
android:layout_height="29dp"
|
||||||
|
android:layout_marginTop="10dp"
|
||||||
|
android:gravity="bottom"
|
||||||
|
android:orientation="horizontal">
|
||||||
|
|
||||||
|
<TextView
|
||||||
|
android:id="@+id/tv_total_orders"
|
||||||
|
style="@style/HomeText"
|
||||||
|
android:layout_width="wrap_content"
|
||||||
|
android:layout_height="29dp"
|
||||||
|
android:gravity="center_vertical"
|
||||||
|
android:textColor="@android:color/white"
|
||||||
|
android:textSize="24sp"
|
||||||
|
android:textStyle="bold" />
|
||||||
|
|
||||||
|
<TextView
|
||||||
|
style="@style/HomeText"
|
||||||
|
android:layout_width="wrap_content"
|
||||||
|
android:layout_height="17dp"
|
||||||
|
android:layout_marginStart="4dp"
|
||||||
|
android:layout_marginBottom="2dp"
|
||||||
|
android:text="@string/pickup_stats_orders"
|
||||||
|
android:textColor="@android:color/white"
|
||||||
|
android:textSize="14sp" />
|
||||||
|
</LinearLayout>
|
||||||
|
|
||||||
|
<LinearLayout
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="27dp"
|
||||||
|
android:layout_marginTop="10dp"
|
||||||
|
android:background="@drawable/pickup_stats_pill_bg"
|
||||||
|
android:gravity="center_vertical"
|
||||||
|
android:orientation="horizontal"
|
||||||
|
android:paddingStart="12dp">
|
||||||
|
|
||||||
|
<ImageView
|
||||||
|
android:layout_width="13dp"
|
||||||
|
android:layout_height="13dp"
|
||||||
|
android:contentDescription="@null"
|
||||||
|
android:src="@mipmap/icon_pickup_stats_points" />
|
||||||
|
|
||||||
|
<TextView
|
||||||
|
android:id="@+id/tv_total_points"
|
||||||
|
style="@style/HomeText"
|
||||||
|
android:layout_width="wrap_content"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:layout_marginStart="4dp"
|
||||||
|
android:textColor="@android:color/white"
|
||||||
|
android:textSize="14sp" />
|
||||||
|
</LinearLayout>
|
||||||
|
</LinearLayout>
|
||||||
|
|
||||||
|
<LinearLayout
|
||||||
|
android:layout_width="181dp"
|
||||||
|
android:layout_height="29dp"
|
||||||
|
android:layout_gravity="end|top"
|
||||||
|
android:background="@drawable/pickup_stats_badge_bg"
|
||||||
|
android:gravity="center"
|
||||||
|
android:orientation="horizontal">
|
||||||
|
|
||||||
|
<TextView
|
||||||
|
style="@style/HomeText"
|
||||||
|
android:layout_width="wrap_content"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:text="@string/pickup_stats_cumulative"
|
||||||
|
android:textColor="@android:color/white"
|
||||||
|
android:textSize="14sp" />
|
||||||
|
</LinearLayout>
|
||||||
|
</FrameLayout>
|
||||||
|
|
||||||
|
<!-- 四项概览数据 -->
|
||||||
|
<LinearLayout
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="85dp"
|
||||||
|
android:layout_marginStart="24dp"
|
||||||
|
android:layout_marginTop="10dp"
|
||||||
|
android:layout_marginEnd="24dp"
|
||||||
|
android:orientation="horizontal">
|
||||||
|
|
||||||
|
<LinearLayout
|
||||||
|
android:layout_width="0dp"
|
||||||
|
android:layout_height="85dp"
|
||||||
|
android:layout_marginEnd="11dp"
|
||||||
|
android:layout_weight="1"
|
||||||
|
android:background="@drawable/pickup_stats_card_bg"
|
||||||
|
android:orientation="vertical"
|
||||||
|
android:paddingStart="12dp"
|
||||||
|
android:paddingTop="14dp">
|
||||||
|
|
||||||
|
<TextView
|
||||||
|
style="@style/HomeText"
|
||||||
|
android:layout_width="wrap_content"
|
||||||
|
android:layout_height="17dp"
|
||||||
|
android:fontFamily="sans-serif-medium"
|
||||||
|
android:text="@string/pickup_stats_week"
|
||||||
|
android:textColor="#222222"
|
||||||
|
android:textSize="14sp" />
|
||||||
|
|
||||||
|
<LinearLayout
|
||||||
|
android:layout_width="wrap_content"
|
||||||
|
android:layout_height="24dp"
|
||||||
|
android:layout_marginTop="18dp"
|
||||||
|
android:gravity="bottom"
|
||||||
|
android:orientation="horizontal">
|
||||||
|
|
||||||
|
<TextView
|
||||||
|
style="@style/HomeText"
|
||||||
|
android:layout_width="wrap_content"
|
||||||
|
android:layout_height="24dp"
|
||||||
|
android:gravity="center_vertical"
|
||||||
|
android:text="36"
|
||||||
|
android:textColor="#222222"
|
||||||
|
android:textSize="20sp"
|
||||||
|
android:textStyle="bold" />
|
||||||
|
|
||||||
|
<TextView
|
||||||
|
style="@style/HomeText"
|
||||||
|
android:layout_width="wrap_content"
|
||||||
|
android:layout_height="15dp"
|
||||||
|
android:layout_marginStart="4dp"
|
||||||
|
android:layout_marginBottom="1dp"
|
||||||
|
android:text="@string/pickup_stats_orders"
|
||||||
|
android:textColor="#222222"
|
||||||
|
android:textSize="12sp" />
|
||||||
|
</LinearLayout>
|
||||||
|
</LinearLayout>
|
||||||
|
|
||||||
|
<LinearLayout
|
||||||
|
android:layout_width="0dp"
|
||||||
|
android:layout_height="85dp"
|
||||||
|
android:layout_weight="1"
|
||||||
|
android:background="@drawable/pickup_stats_card_bg"
|
||||||
|
android:orientation="vertical"
|
||||||
|
android:paddingStart="12dp"
|
||||||
|
android:paddingTop="14dp">
|
||||||
|
|
||||||
|
<TextView
|
||||||
|
style="@style/HomeText"
|
||||||
|
android:layout_width="wrap_content"
|
||||||
|
android:layout_height="17dp"
|
||||||
|
android:fontFamily="sans-serif-medium"
|
||||||
|
android:text="@string/pickup_stats_month"
|
||||||
|
android:textColor="#222222"
|
||||||
|
android:textSize="14sp" />
|
||||||
|
|
||||||
|
<LinearLayout
|
||||||
|
android:layout_width="wrap_content"
|
||||||
|
android:layout_height="24dp"
|
||||||
|
android:layout_marginTop="18dp"
|
||||||
|
android:gravity="bottom"
|
||||||
|
android:orientation="horizontal">
|
||||||
|
|
||||||
|
<TextView
|
||||||
|
style="@style/HomeText"
|
||||||
|
android:layout_width="wrap_content"
|
||||||
|
android:layout_height="24dp"
|
||||||
|
android:gravity="center_vertical"
|
||||||
|
android:text="123"
|
||||||
|
android:textColor="#222222"
|
||||||
|
android:textSize="20sp"
|
||||||
|
android:textStyle="bold" />
|
||||||
|
|
||||||
|
<TextView
|
||||||
|
style="@style/HomeText"
|
||||||
|
android:layout_width="wrap_content"
|
||||||
|
android:layout_height="15dp"
|
||||||
|
android:layout_marginStart="4dp"
|
||||||
|
android:layout_marginBottom="1dp"
|
||||||
|
android:text="@string/pickup_stats_orders"
|
||||||
|
android:textColor="#222222"
|
||||||
|
android:textSize="12sp" />
|
||||||
|
</LinearLayout>
|
||||||
|
</LinearLayout>
|
||||||
|
</LinearLayout>
|
||||||
|
|
||||||
|
<LinearLayout
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="85dp"
|
||||||
|
android:layout_marginStart="24dp"
|
||||||
|
android:layout_marginTop="10dp"
|
||||||
|
android:layout_marginEnd="24dp"
|
||||||
|
android:orientation="horizontal">
|
||||||
|
|
||||||
|
<LinearLayout
|
||||||
|
android:layout_width="0dp"
|
||||||
|
android:layout_height="85dp"
|
||||||
|
android:layout_marginEnd="11dp"
|
||||||
|
android:layout_weight="1"
|
||||||
|
android:background="@drawable/pickup_stats_card_bg"
|
||||||
|
android:orientation="vertical"
|
||||||
|
android:paddingStart="12dp"
|
||||||
|
android:paddingTop="14dp">
|
||||||
|
|
||||||
|
<TextView
|
||||||
|
style="@style/HomeText"
|
||||||
|
android:layout_width="wrap_content"
|
||||||
|
android:layout_height="17dp"
|
||||||
|
android:fontFamily="sans-serif-medium"
|
||||||
|
android:text="@string/pickup_stats_total_amount"
|
||||||
|
android:textColor="#222222"
|
||||||
|
android:textSize="14sp" />
|
||||||
|
|
||||||
|
<TextView
|
||||||
|
style="@style/HomeText"
|
||||||
|
android:layout_width="wrap_content"
|
||||||
|
android:layout_height="24dp"
|
||||||
|
android:layout_marginTop="18dp"
|
||||||
|
android:gravity="center_vertical"
|
||||||
|
android:text="¥128"
|
||||||
|
android:textColor="#222222"
|
||||||
|
android:textSize="20sp"
|
||||||
|
android:textStyle="bold" />
|
||||||
|
</LinearLayout>
|
||||||
|
|
||||||
|
<LinearLayout
|
||||||
|
android:layout_width="0dp"
|
||||||
|
android:layout_height="85dp"
|
||||||
|
android:layout_weight="1"
|
||||||
|
android:background="@drawable/pickup_stats_card_pending_bg"
|
||||||
|
android:orientation="vertical"
|
||||||
|
android:paddingStart="12dp"
|
||||||
|
android:paddingTop="14dp">
|
||||||
|
|
||||||
|
<TextView
|
||||||
|
style="@style/HomeText"
|
||||||
|
android:layout_width="wrap_content"
|
||||||
|
android:layout_height="17dp"
|
||||||
|
android:fontFamily="sans-serif-medium"
|
||||||
|
android:text="@string/pickup_stats_pending"
|
||||||
|
android:textColor="#222222"
|
||||||
|
android:textSize="14sp" />
|
||||||
|
|
||||||
|
<LinearLayout
|
||||||
|
android:layout_width="wrap_content"
|
||||||
|
android:layout_height="24dp"
|
||||||
|
android:layout_marginTop="18dp"
|
||||||
|
android:gravity="bottom"
|
||||||
|
android:orientation="horizontal">
|
||||||
|
|
||||||
|
<TextView
|
||||||
|
style="@style/HomeText"
|
||||||
|
android:layout_width="wrap_content"
|
||||||
|
android:layout_height="24dp"
|
||||||
|
android:gravity="center_vertical"
|
||||||
|
android:text="4"
|
||||||
|
android:textColor="#FF6900"
|
||||||
|
android:textSize="20sp"
|
||||||
|
android:textStyle="bold" />
|
||||||
|
|
||||||
|
<TextView
|
||||||
|
style="@style/HomeText"
|
||||||
|
android:layout_width="wrap_content"
|
||||||
|
android:layout_height="15dp"
|
||||||
|
android:layout_marginStart="4dp"
|
||||||
|
android:layout_marginBottom="1dp"
|
||||||
|
android:text="@string/pickup_stats_orders"
|
||||||
|
android:textColor="#222222"
|
||||||
|
android:textSize="12sp" />
|
||||||
|
</LinearLayout>
|
||||||
|
</LinearLayout>
|
||||||
|
</LinearLayout>
|
||||||
|
|
||||||
|
<!-- 时间筛选 -->
|
||||||
|
<HorizontalScrollView
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="33dp"
|
||||||
|
android:layout_marginTop="20dp"
|
||||||
|
android:overScrollMode="never"
|
||||||
|
android:scrollbars="none">
|
||||||
|
|
||||||
|
<LinearLayout
|
||||||
|
android:layout_width="wrap_content"
|
||||||
|
android:layout_height="33dp"
|
||||||
|
android:orientation="horizontal"
|
||||||
|
android:paddingStart="24dp"
|
||||||
|
android:paddingEnd="24dp">
|
||||||
|
|
||||||
|
<TextView
|
||||||
|
android:id="@+id/chip_all"
|
||||||
|
style="@style/HomeText"
|
||||||
|
android:layout_width="wrap_content"
|
||||||
|
android:layout_height="33dp"
|
||||||
|
android:background="@drawable/pickup_stats_chip_selector"
|
||||||
|
android:fontFamily="sans-serif-medium"
|
||||||
|
android:gravity="center"
|
||||||
|
android:paddingHorizontal="20dp"
|
||||||
|
android:text="@string/pickup_stats_all"
|
||||||
|
android:textColor="@color/pickup_stats_chip_text"
|
||||||
|
android:textSize="14sp" />
|
||||||
|
|
||||||
|
<TextView
|
||||||
|
android:id="@+id/chip_today"
|
||||||
|
style="@style/HomeText"
|
||||||
|
android:layout_width="wrap_content"
|
||||||
|
android:layout_height="33dp"
|
||||||
|
android:layout_marginStart="6dp"
|
||||||
|
android:background="@drawable/pickup_stats_chip_selector"
|
||||||
|
android:gravity="center"
|
||||||
|
android:paddingHorizontal="20dp"
|
||||||
|
android:text="@string/pickup_stats_today"
|
||||||
|
android:textColor="@color/pickup_stats_chip_text"
|
||||||
|
android:textSize="14sp" />
|
||||||
|
|
||||||
|
<TextView
|
||||||
|
android:id="@+id/chip_week"
|
||||||
|
style="@style/HomeText"
|
||||||
|
android:layout_width="wrap_content"
|
||||||
|
android:layout_height="33dp"
|
||||||
|
android:layout_marginStart="6dp"
|
||||||
|
android:background="@drawable/pickup_stats_chip_selector"
|
||||||
|
android:gravity="center"
|
||||||
|
android:paddingHorizontal="20dp"
|
||||||
|
android:text="@string/pickup_stats_this_week"
|
||||||
|
android:textColor="@color/pickup_stats_chip_text"
|
||||||
|
android:textSize="14sp" />
|
||||||
|
|
||||||
|
<TextView
|
||||||
|
android:id="@+id/chip_month"
|
||||||
|
style="@style/HomeText"
|
||||||
|
android:layout_width="wrap_content"
|
||||||
|
android:layout_height="33dp"
|
||||||
|
android:layout_marginStart="6dp"
|
||||||
|
android:background="@drawable/pickup_stats_chip_selector"
|
||||||
|
android:gravity="center"
|
||||||
|
android:paddingHorizontal="20dp"
|
||||||
|
android:text="@string/pickup_stats_this_month"
|
||||||
|
android:textColor="@color/pickup_stats_chip_text"
|
||||||
|
android:textSize="14sp" />
|
||||||
|
</LinearLayout>
|
||||||
|
</HorizontalScrollView>
|
||||||
|
|
||||||
|
<!-- 核销记录标题与导出 -->
|
||||||
|
<FrameLayout
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="44dp"
|
||||||
|
android:layout_marginHorizontal="24dp"
|
||||||
|
android:layout_marginTop="20dp">
|
||||||
|
|
||||||
|
<LinearLayout
|
||||||
|
android:layout_width="wrap_content"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:orientation="vertical">
|
||||||
|
|
||||||
|
<TextView
|
||||||
|
style="@style/HomeText"
|
||||||
|
android:layout_width="wrap_content"
|
||||||
|
android:layout_height="19dp"
|
||||||
|
android:text="@string/pickup_stats_records"
|
||||||
|
android:textColor="#222222"
|
||||||
|
android:textSize="16sp"
|
||||||
|
android:textStyle="bold" />
|
||||||
|
|
||||||
|
<TextView
|
||||||
|
android:id="@+id/tv_records_count"
|
||||||
|
style="@style/HomeText"
|
||||||
|
android:layout_width="wrap_content"
|
||||||
|
android:layout_height="19dp"
|
||||||
|
android:layout_marginTop="6dp"
|
||||||
|
android:textColor="#FF6900"
|
||||||
|
android:textSize="16sp"
|
||||||
|
android:textStyle="bold" />
|
||||||
|
</LinearLayout>
|
||||||
|
|
||||||
|
<ImageView
|
||||||
|
android:id="@+id/btn_download"
|
||||||
|
android:layout_width="44dp"
|
||||||
|
android:layout_height="44dp"
|
||||||
|
android:layout_gravity="end|top"
|
||||||
|
android:clickable="true"
|
||||||
|
android:contentDescription="@string/pickup_stats_export"
|
||||||
|
android:focusable="true"
|
||||||
|
android:src="@mipmap/icon_pickup_stats_download" />
|
||||||
|
</FrameLayout>
|
||||||
|
</LinearLayout>
|
||||||
@@ -1,6 +1,5 @@
|
|||||||
<?xml version="1.0" encoding="utf-8"?>
|
<?xml version="1.0" encoding="utf-8"?>
|
||||||
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
|
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
|
||||||
xmlns:app="http://schemas.android.com/apk/res-auto"
|
|
||||||
android:layout_width="match_parent"
|
android:layout_width="match_parent"
|
||||||
android:layout_height="match_parent"
|
android:layout_height="match_parent"
|
||||||
android:background="@android:color/white"
|
android:background="@android:color/white"
|
||||||
@@ -34,666 +33,39 @@
|
|||||||
android:textStyle="bold" />
|
android:textStyle="bold" />
|
||||||
</FrameLayout>
|
</FrameLayout>
|
||||||
|
|
||||||
<ScrollView
|
<!-- 统计头部作为列表 header,记录随列表分页加载 -->
|
||||||
|
<FrameLayout
|
||||||
android:layout_width="match_parent"
|
android:layout_width="match_parent"
|
||||||
android:layout_height="0dp"
|
android:layout_height="0dp"
|
||||||
android:layout_weight="1"
|
android:layout_weight="1"
|
||||||
android:background="#F5F5F5"
|
android:background="#F5F5F5">
|
||||||
android:fillViewport="true"
|
|
||||||
|
<com.scwang.smart.refresh.layout.SmartRefreshLayout
|
||||||
|
android:id="@+id/refresh_orders"
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="match_parent">
|
||||||
|
|
||||||
|
<androidx.recyclerview.widget.RecyclerView
|
||||||
|
android:id="@+id/rv_orders"
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="match_parent"
|
||||||
|
android:clipToPadding="false"
|
||||||
android:overScrollMode="never"
|
android:overScrollMode="never"
|
||||||
android:scrollbars="none">
|
android:paddingBottom="24dp"
|
||||||
|
android:scrollbars="none" />
|
||||||
|
</com.scwang.smart.refresh.layout.SmartRefreshLayout>
|
||||||
|
|
||||||
<LinearLayout
|
<!-- 加载中 / 空列表 / 加载失败提示,列表有数据时隐藏 -->
|
||||||
android:layout_width="match_parent"
|
<TextView
|
||||||
android:layout_height="wrap_content"
|
android:id="@+id/tv_order_state"
|
||||||
android:orientation="vertical"
|
style="@style/HomeText"
|
||||||
android:paddingBottom="24dp">
|
|
||||||
|
|
||||||
<!-- 累计统计主卡 -->
|
|
||||||
<FrameLayout
|
|
||||||
android:layout_width="match_parent"
|
|
||||||
android:layout_height="121dp"
|
|
||||||
android:layout_marginHorizontal="24dp"
|
|
||||||
android:layout_marginTop="20dp"
|
|
||||||
android:background="@drawable/pickup_stats_hero_bg">
|
|
||||||
|
|
||||||
<LinearLayout
|
|
||||||
android:layout_width="match_parent"
|
android:layout_width="match_parent"
|
||||||
android:layout_height="match_parent"
|
android:layout_height="match_parent"
|
||||||
android:orientation="vertical"
|
|
||||||
android:paddingStart="14dp"
|
|
||||||
android:paddingTop="14dp"
|
|
||||||
android:paddingEnd="14dp">
|
|
||||||
|
|
||||||
<TextView
|
|
||||||
style="@style/HomeText"
|
|
||||||
android:layout_width="wrap_content"
|
|
||||||
android:layout_height="17dp"
|
|
||||||
android:text="@string/pickup_stats_all"
|
|
||||||
android:textColor="@android:color/white"
|
|
||||||
android:textSize="14sp"
|
|
||||||
android:textStyle="bold" />
|
|
||||||
|
|
||||||
<LinearLayout
|
|
||||||
android:layout_width="wrap_content"
|
|
||||||
android:layout_height="29dp"
|
|
||||||
android:layout_marginTop="10dp"
|
|
||||||
android:gravity="bottom"
|
|
||||||
android:orientation="horizontal">
|
|
||||||
|
|
||||||
<TextView
|
|
||||||
style="@style/HomeText"
|
|
||||||
android:layout_width="wrap_content"
|
|
||||||
android:layout_height="29dp"
|
|
||||||
android:gravity="center_vertical"
|
|
||||||
android:text="1,280"
|
|
||||||
android:textColor="@android:color/white"
|
|
||||||
android:textSize="24sp"
|
|
||||||
android:textStyle="bold" />
|
|
||||||
|
|
||||||
<TextView
|
|
||||||
style="@style/HomeText"
|
|
||||||
android:layout_width="wrap_content"
|
|
||||||
android:layout_height="17dp"
|
|
||||||
android:layout_marginStart="4dp"
|
|
||||||
android:layout_marginBottom="2dp"
|
|
||||||
android:text="@string/pickup_stats_orders"
|
|
||||||
android:textColor="@android:color/white"
|
|
||||||
android:textSize="14sp" />
|
|
||||||
</LinearLayout>
|
|
||||||
|
|
||||||
<LinearLayout
|
|
||||||
android:layout_width="match_parent"
|
|
||||||
android:layout_height="27dp"
|
|
||||||
android:layout_marginTop="10dp"
|
|
||||||
android:background="@drawable/pickup_stats_pill_bg"
|
|
||||||
android:gravity="center_vertical"
|
|
||||||
android:orientation="horizontal"
|
|
||||||
android:paddingStart="12dp">
|
|
||||||
|
|
||||||
<ImageView
|
|
||||||
android:layout_width="13dp"
|
|
||||||
android:layout_height="13dp"
|
|
||||||
android:contentDescription="@null"
|
|
||||||
android:src="@mipmap/icon_pickup_stats_points" />
|
|
||||||
|
|
||||||
<TextView
|
|
||||||
android:id="@+id/tv_total_points"
|
|
||||||
style="@style/HomeText"
|
|
||||||
android:layout_width="wrap_content"
|
|
||||||
android:layout_height="wrap_content"
|
|
||||||
android:layout_marginStart="4dp"
|
|
||||||
android:textColor="@android:color/white"
|
|
||||||
android:textSize="14sp" />
|
|
||||||
</LinearLayout>
|
|
||||||
</LinearLayout>
|
|
||||||
|
|
||||||
<LinearLayout
|
|
||||||
android:layout_width="181dp"
|
|
||||||
android:layout_height="29dp"
|
|
||||||
android:layout_gravity="end|top"
|
|
||||||
android:background="@drawable/pickup_stats_badge_bg"
|
|
||||||
android:gravity="center"
|
android:gravity="center"
|
||||||
android:orientation="horizontal">
|
android:paddingBottom="60dp"
|
||||||
|
android:text="@string/pickup_stats_empty"
|
||||||
<TextView
|
android:textColor="#999999"
|
||||||
style="@style/HomeText"
|
android:textSize="14sp"
|
||||||
android:layout_width="wrap_content"
|
android:visibility="gone" />
|
||||||
android:layout_height="wrap_content"
|
|
||||||
android:text="@string/pickup_stats_cumulative"
|
|
||||||
android:textColor="@android:color/white"
|
|
||||||
android:textSize="14sp" />
|
|
||||||
</LinearLayout>
|
|
||||||
</FrameLayout>
|
</FrameLayout>
|
||||||
|
|
||||||
<!-- 四项概览数据 -->
|
|
||||||
<LinearLayout
|
|
||||||
android:layout_width="match_parent"
|
|
||||||
android:layout_height="85dp"
|
|
||||||
android:layout_marginStart="24dp"
|
|
||||||
android:layout_marginTop="10dp"
|
|
||||||
android:layout_marginEnd="24dp"
|
|
||||||
android:orientation="horizontal">
|
|
||||||
|
|
||||||
<LinearLayout
|
|
||||||
android:layout_width="0dp"
|
|
||||||
android:layout_height="85dp"
|
|
||||||
android:layout_marginEnd="11dp"
|
|
||||||
android:layout_weight="1"
|
|
||||||
android:background="@drawable/pickup_stats_card_bg"
|
|
||||||
android:orientation="vertical"
|
|
||||||
android:paddingStart="12dp"
|
|
||||||
android:paddingTop="14dp">
|
|
||||||
|
|
||||||
<TextView
|
|
||||||
style="@style/HomeText"
|
|
||||||
android:layout_width="wrap_content"
|
|
||||||
android:layout_height="17dp"
|
|
||||||
android:fontFamily="sans-serif-medium"
|
|
||||||
android:text="@string/pickup_stats_week"
|
|
||||||
android:textColor="#222222"
|
|
||||||
android:textSize="14sp" />
|
|
||||||
|
|
||||||
<LinearLayout
|
|
||||||
android:layout_width="wrap_content"
|
|
||||||
android:layout_height="24dp"
|
|
||||||
android:layout_marginTop="18dp"
|
|
||||||
android:gravity="bottom"
|
|
||||||
android:orientation="horizontal">
|
|
||||||
|
|
||||||
<TextView
|
|
||||||
style="@style/HomeText"
|
|
||||||
android:layout_width="wrap_content"
|
|
||||||
android:layout_height="24dp"
|
|
||||||
android:gravity="center_vertical"
|
|
||||||
android:text="36"
|
|
||||||
android:textColor="#222222"
|
|
||||||
android:textSize="20sp"
|
|
||||||
android:textStyle="bold" />
|
|
||||||
|
|
||||||
<TextView
|
|
||||||
style="@style/HomeText"
|
|
||||||
android:layout_width="wrap_content"
|
|
||||||
android:layout_height="15dp"
|
|
||||||
android:layout_marginStart="4dp"
|
|
||||||
android:layout_marginBottom="1dp"
|
|
||||||
android:text="@string/pickup_stats_orders"
|
|
||||||
android:textColor="#222222"
|
|
||||||
android:textSize="12sp" />
|
|
||||||
</LinearLayout>
|
|
||||||
</LinearLayout>
|
|
||||||
|
|
||||||
<LinearLayout
|
|
||||||
android:layout_width="0dp"
|
|
||||||
android:layout_height="85dp"
|
|
||||||
android:layout_weight="1"
|
|
||||||
android:background="@drawable/pickup_stats_card_bg"
|
|
||||||
android:orientation="vertical"
|
|
||||||
android:paddingStart="12dp"
|
|
||||||
android:paddingTop="14dp">
|
|
||||||
|
|
||||||
<TextView
|
|
||||||
style="@style/HomeText"
|
|
||||||
android:layout_width="wrap_content"
|
|
||||||
android:layout_height="17dp"
|
|
||||||
android:fontFamily="sans-serif-medium"
|
|
||||||
android:text="@string/pickup_stats_month"
|
|
||||||
android:textColor="#222222"
|
|
||||||
android:textSize="14sp" />
|
|
||||||
|
|
||||||
<LinearLayout
|
|
||||||
android:layout_width="wrap_content"
|
|
||||||
android:layout_height="24dp"
|
|
||||||
android:layout_marginTop="18dp"
|
|
||||||
android:gravity="bottom"
|
|
||||||
android:orientation="horizontal">
|
|
||||||
|
|
||||||
<TextView
|
|
||||||
style="@style/HomeText"
|
|
||||||
android:layout_width="wrap_content"
|
|
||||||
android:layout_height="24dp"
|
|
||||||
android:gravity="center_vertical"
|
|
||||||
android:text="123"
|
|
||||||
android:textColor="#222222"
|
|
||||||
android:textSize="20sp"
|
|
||||||
android:textStyle="bold" />
|
|
||||||
|
|
||||||
<TextView
|
|
||||||
style="@style/HomeText"
|
|
||||||
android:layout_width="wrap_content"
|
|
||||||
android:layout_height="15dp"
|
|
||||||
android:layout_marginStart="4dp"
|
|
||||||
android:layout_marginBottom="1dp"
|
|
||||||
android:text="@string/pickup_stats_orders"
|
|
||||||
android:textColor="#222222"
|
|
||||||
android:textSize="12sp" />
|
|
||||||
</LinearLayout>
|
|
||||||
</LinearLayout>
|
|
||||||
</LinearLayout>
|
|
||||||
|
|
||||||
<LinearLayout
|
|
||||||
android:layout_width="match_parent"
|
|
||||||
android:layout_height="85dp"
|
|
||||||
android:layout_marginStart="24dp"
|
|
||||||
android:layout_marginTop="10dp"
|
|
||||||
android:layout_marginEnd="24dp"
|
|
||||||
android:orientation="horizontal">
|
|
||||||
|
|
||||||
<LinearLayout
|
|
||||||
android:layout_width="0dp"
|
|
||||||
android:layout_height="85dp"
|
|
||||||
android:layout_marginEnd="11dp"
|
|
||||||
android:layout_weight="1"
|
|
||||||
android:background="@drawable/pickup_stats_card_bg"
|
|
||||||
android:orientation="vertical"
|
|
||||||
android:paddingStart="12dp"
|
|
||||||
android:paddingTop="14dp">
|
|
||||||
|
|
||||||
<TextView
|
|
||||||
style="@style/HomeText"
|
|
||||||
android:layout_width="wrap_content"
|
|
||||||
android:layout_height="17dp"
|
|
||||||
android:fontFamily="sans-serif-medium"
|
|
||||||
android:text="@string/pickup_stats_total_amount"
|
|
||||||
android:textColor="#222222"
|
|
||||||
android:textSize="14sp" />
|
|
||||||
|
|
||||||
<TextView
|
|
||||||
style="@style/HomeText"
|
|
||||||
android:layout_width="wrap_content"
|
|
||||||
android:layout_height="24dp"
|
|
||||||
android:layout_marginTop="18dp"
|
|
||||||
android:gravity="center_vertical"
|
|
||||||
android:text="¥128"
|
|
||||||
android:textColor="#222222"
|
|
||||||
android:textSize="20sp"
|
|
||||||
android:textStyle="bold" />
|
|
||||||
</LinearLayout>
|
|
||||||
|
|
||||||
<LinearLayout
|
|
||||||
android:layout_width="0dp"
|
|
||||||
android:layout_height="85dp"
|
|
||||||
android:layout_weight="1"
|
|
||||||
android:background="@drawable/pickup_stats_card_pending_bg"
|
|
||||||
android:orientation="vertical"
|
|
||||||
android:paddingStart="12dp"
|
|
||||||
android:paddingTop="14dp">
|
|
||||||
|
|
||||||
<TextView
|
|
||||||
style="@style/HomeText"
|
|
||||||
android:layout_width="wrap_content"
|
|
||||||
android:layout_height="17dp"
|
|
||||||
android:fontFamily="sans-serif-medium"
|
|
||||||
android:text="@string/pickup_stats_pending"
|
|
||||||
android:textColor="#222222"
|
|
||||||
android:textSize="14sp" />
|
|
||||||
|
|
||||||
<LinearLayout
|
|
||||||
android:layout_width="wrap_content"
|
|
||||||
android:layout_height="24dp"
|
|
||||||
android:layout_marginTop="18dp"
|
|
||||||
android:gravity="bottom"
|
|
||||||
android:orientation="horizontal">
|
|
||||||
|
|
||||||
<TextView
|
|
||||||
style="@style/HomeText"
|
|
||||||
android:layout_width="wrap_content"
|
|
||||||
android:layout_height="24dp"
|
|
||||||
android:gravity="center_vertical"
|
|
||||||
android:text="4"
|
|
||||||
android:textColor="#FF6900"
|
|
||||||
android:textSize="20sp"
|
|
||||||
android:textStyle="bold" />
|
|
||||||
|
|
||||||
<TextView
|
|
||||||
style="@style/HomeText"
|
|
||||||
android:layout_width="wrap_content"
|
|
||||||
android:layout_height="15dp"
|
|
||||||
android:layout_marginStart="4dp"
|
|
||||||
android:layout_marginBottom="1dp"
|
|
||||||
android:text="@string/pickup_stats_orders"
|
|
||||||
android:textColor="#222222"
|
|
||||||
android:textSize="12sp" />
|
|
||||||
</LinearLayout>
|
|
||||||
</LinearLayout>
|
|
||||||
</LinearLayout>
|
|
||||||
|
|
||||||
<!-- 时间筛选 -->
|
|
||||||
<HorizontalScrollView
|
|
||||||
android:layout_width="match_parent"
|
|
||||||
android:layout_height="33dp"
|
|
||||||
android:layout_marginTop="20dp"
|
|
||||||
android:overScrollMode="never"
|
|
||||||
android:scrollbars="none">
|
|
||||||
|
|
||||||
<LinearLayout
|
|
||||||
android:layout_width="wrap_content"
|
|
||||||
android:layout_height="33dp"
|
|
||||||
android:orientation="horizontal"
|
|
||||||
android:paddingStart="24dp"
|
|
||||||
android:paddingEnd="24dp">
|
|
||||||
|
|
||||||
<TextView
|
|
||||||
android:id="@+id/chip_all"
|
|
||||||
style="@style/HomeText"
|
|
||||||
android:layout_width="wrap_content"
|
|
||||||
android:layout_height="33dp"
|
|
||||||
android:background="@drawable/pickup_stats_chip_selector"
|
|
||||||
android:fontFamily="sans-serif-medium"
|
|
||||||
android:gravity="center"
|
|
||||||
android:paddingHorizontal="20dp"
|
|
||||||
android:text="@string/pickup_stats_all"
|
|
||||||
android:textColor="@color/pickup_stats_chip_text"
|
|
||||||
android:textSize="14sp" />
|
|
||||||
|
|
||||||
<TextView
|
|
||||||
android:id="@+id/chip_today"
|
|
||||||
style="@style/HomeText"
|
|
||||||
android:layout_width="wrap_content"
|
|
||||||
android:layout_height="33dp"
|
|
||||||
android:layout_marginStart="6dp"
|
|
||||||
android:background="@drawable/pickup_stats_chip_selector"
|
|
||||||
android:gravity="center"
|
|
||||||
android:paddingHorizontal="20dp"
|
|
||||||
android:text="@string/pickup_stats_today"
|
|
||||||
android:textColor="@color/pickup_stats_chip_text"
|
|
||||||
android:textSize="14sp" />
|
|
||||||
|
|
||||||
<TextView
|
|
||||||
android:id="@+id/chip_week"
|
|
||||||
style="@style/HomeText"
|
|
||||||
android:layout_width="wrap_content"
|
|
||||||
android:layout_height="33dp"
|
|
||||||
android:layout_marginStart="6dp"
|
|
||||||
android:background="@drawable/pickup_stats_chip_selector"
|
|
||||||
android:gravity="center"
|
|
||||||
android:paddingHorizontal="20dp"
|
|
||||||
android:text="@string/pickup_stats_this_week"
|
|
||||||
android:textColor="@color/pickup_stats_chip_text"
|
|
||||||
android:textSize="14sp" />
|
|
||||||
|
|
||||||
<TextView
|
|
||||||
android:id="@+id/chip_month"
|
|
||||||
style="@style/HomeText"
|
|
||||||
android:layout_width="wrap_content"
|
|
||||||
android:layout_height="33dp"
|
|
||||||
android:layout_marginStart="6dp"
|
|
||||||
android:background="@drawable/pickup_stats_chip_selector"
|
|
||||||
android:gravity="center"
|
|
||||||
android:paddingHorizontal="20dp"
|
|
||||||
android:text="@string/pickup_stats_this_month"
|
|
||||||
android:textColor="@color/pickup_stats_chip_text"
|
|
||||||
android:textSize="14sp" />
|
|
||||||
</LinearLayout>
|
|
||||||
</HorizontalScrollView>
|
|
||||||
|
|
||||||
<!-- 核销记录标题与导出 -->
|
|
||||||
<FrameLayout
|
|
||||||
android:layout_width="match_parent"
|
|
||||||
android:layout_height="44dp"
|
|
||||||
android:layout_marginHorizontal="24dp"
|
|
||||||
android:layout_marginTop="20dp">
|
|
||||||
|
|
||||||
<LinearLayout
|
|
||||||
android:layout_width="wrap_content"
|
|
||||||
android:layout_height="wrap_content"
|
|
||||||
android:orientation="vertical">
|
|
||||||
|
|
||||||
<TextView
|
|
||||||
style="@style/HomeText"
|
|
||||||
android:layout_width="wrap_content"
|
|
||||||
android:layout_height="19dp"
|
|
||||||
android:text="@string/pickup_stats_records"
|
|
||||||
android:textColor="#222222"
|
|
||||||
android:textSize="16sp"
|
|
||||||
android:textStyle="bold" />
|
|
||||||
|
|
||||||
<TextView
|
|
||||||
android:id="@+id/tv_records_count"
|
|
||||||
style="@style/HomeText"
|
|
||||||
android:layout_width="wrap_content"
|
|
||||||
android:layout_height="19dp"
|
|
||||||
android:layout_marginTop="6dp"
|
|
||||||
android:textColor="#FF6900"
|
|
||||||
android:textSize="16sp"
|
|
||||||
android:textStyle="bold" />
|
|
||||||
</LinearLayout>
|
|
||||||
|
|
||||||
<ImageView
|
|
||||||
android:id="@+id/btn_download"
|
|
||||||
android:layout_width="44dp"
|
|
||||||
android:layout_height="44dp"
|
|
||||||
android:layout_gravity="end|top"
|
|
||||||
android:clickable="true"
|
|
||||||
android:contentDescription="@string/pickup_stats_export"
|
|
||||||
android:focusable="true"
|
|
||||||
android:src="@mipmap/icon_pickup_stats_download" />
|
|
||||||
</FrameLayout>
|
|
||||||
|
|
||||||
<!-- 核销记录卡片 -->
|
|
||||||
<LinearLayout
|
|
||||||
android:layout_width="match_parent"
|
|
||||||
android:layout_height="109dp"
|
|
||||||
android:layout_marginStart="24dp"
|
|
||||||
android:layout_marginTop="10dp"
|
|
||||||
android:layout_marginEnd="24dp"
|
|
||||||
android:background="@drawable/device_manage_card_bg"
|
|
||||||
android:orientation="vertical">
|
|
||||||
|
|
||||||
<LinearLayout
|
|
||||||
android:layout_width="match_parent"
|
|
||||||
android:layout_height="36dp"
|
|
||||||
android:layout_marginStart="14dp"
|
|
||||||
android:layout_marginTop="14dp"
|
|
||||||
android:layout_marginEnd="14dp"
|
|
||||||
android:orientation="horizontal">
|
|
||||||
|
|
||||||
<androidx.cardview.widget.CardView
|
|
||||||
android:layout_width="36dp"
|
|
||||||
android:layout_height="36dp"
|
|
||||||
app:cardBackgroundColor="#F5F5F5"
|
|
||||||
app:cardCornerRadius="18dp"
|
|
||||||
app:cardElevation="0dp"
|
|
||||||
app:cardPreventCornerOverlap="false">
|
|
||||||
|
|
||||||
<ImageView
|
|
||||||
android:layout_width="match_parent"
|
|
||||||
android:layout_height="match_parent"
|
|
||||||
android:contentDescription="@null"
|
|
||||||
android:scaleType="centerCrop"
|
|
||||||
android:src="@mipmap/ic_launcher" />
|
|
||||||
</androidx.cardview.widget.CardView>
|
|
||||||
|
|
||||||
<LinearLayout
|
|
||||||
android:layout_width="0dp"
|
|
||||||
android:layout_height="wrap_content"
|
|
||||||
android:layout_marginStart="8dp"
|
|
||||||
android:layout_weight="1"
|
|
||||||
android:orientation="vertical">
|
|
||||||
|
|
||||||
<TextView
|
|
||||||
style="@style/HomeText"
|
|
||||||
android:layout_width="wrap_content"
|
|
||||||
android:layout_height="17dp"
|
|
||||||
android:text="@string/pickup_stats_sample_name"
|
|
||||||
android:textColor="#222222"
|
|
||||||
android:textSize="14sp"
|
|
||||||
android:textStyle="bold" />
|
|
||||||
|
|
||||||
<TextView
|
|
||||||
style="@style/HomeText"
|
|
||||||
android:layout_width="wrap_content"
|
|
||||||
android:layout_height="15dp"
|
|
||||||
android:layout_marginTop="4dp"
|
|
||||||
android:text="@string/pickup_stats_sample_product"
|
|
||||||
android:textColor="#999999"
|
|
||||||
android:textSize="12sp" />
|
|
||||||
</LinearLayout>
|
|
||||||
|
|
||||||
<TextView
|
|
||||||
style="@style/HomeText"
|
|
||||||
android:layout_width="wrap_content"
|
|
||||||
android:layout_height="15dp"
|
|
||||||
android:layout_gravity="top"
|
|
||||||
android:layout_marginTop="1dp"
|
|
||||||
android:text="2026-10-23 10:09:13"
|
|
||||||
android:textColor="#666666"
|
|
||||||
android:textSize="12sp" />
|
|
||||||
</LinearLayout>
|
|
||||||
|
|
||||||
<View
|
|
||||||
android:layout_width="match_parent"
|
|
||||||
android:layout_height="0.5dp"
|
|
||||||
android:layout_marginStart="14dp"
|
|
||||||
android:layout_marginTop="14dp"
|
|
||||||
android:layout_marginEnd="14dp"
|
|
||||||
android:background="#DDDDDD" />
|
|
||||||
|
|
||||||
<LinearLayout
|
|
||||||
android:layout_width="match_parent"
|
|
||||||
android:layout_height="21dp"
|
|
||||||
android:layout_marginStart="14dp"
|
|
||||||
android:layout_marginTop="13dp"
|
|
||||||
android:layout_marginEnd="14dp"
|
|
||||||
android:gravity="center_vertical"
|
|
||||||
android:orientation="horizontal">
|
|
||||||
|
|
||||||
<TextView
|
|
||||||
style="@style/HomeText"
|
|
||||||
android:layout_width="wrap_content"
|
|
||||||
android:layout_height="wrap_content"
|
|
||||||
android:text="@string/pickup_stats_points"
|
|
||||||
android:textColor="#FF6900"
|
|
||||||
android:textSize="14sp" />
|
|
||||||
|
|
||||||
<Space
|
|
||||||
android:layout_width="0dp"
|
|
||||||
android:layout_height="1dp"
|
|
||||||
android:layout_weight="1" />
|
|
||||||
|
|
||||||
<ImageView
|
|
||||||
android:layout_width="21dp"
|
|
||||||
android:layout_height="21dp"
|
|
||||||
android:contentDescription="@null"
|
|
||||||
android:src="@mipmap/icon_pickup_stats_code" />
|
|
||||||
|
|
||||||
<TextView
|
|
||||||
style="@style/HomeText"
|
|
||||||
android:layout_width="wrap_content"
|
|
||||||
android:layout_height="wrap_content"
|
|
||||||
android:layout_marginStart="4dp"
|
|
||||||
android:text="157 403"
|
|
||||||
android:textColor="#FF6900"
|
|
||||||
android:textSize="14sp" />
|
|
||||||
</LinearLayout>
|
|
||||||
</LinearLayout>
|
|
||||||
|
|
||||||
<LinearLayout
|
|
||||||
android:layout_width="match_parent"
|
|
||||||
android:layout_height="109dp"
|
|
||||||
android:layout_marginStart="24dp"
|
|
||||||
android:layout_marginTop="10dp"
|
|
||||||
android:layout_marginEnd="24dp"
|
|
||||||
android:background="@drawable/device_manage_card_bg"
|
|
||||||
android:orientation="vertical">
|
|
||||||
|
|
||||||
<LinearLayout
|
|
||||||
android:layout_width="match_parent"
|
|
||||||
android:layout_height="36dp"
|
|
||||||
android:layout_marginStart="14dp"
|
|
||||||
android:layout_marginTop="14dp"
|
|
||||||
android:layout_marginEnd="14dp"
|
|
||||||
android:orientation="horizontal">
|
|
||||||
|
|
||||||
<androidx.cardview.widget.CardView
|
|
||||||
android:layout_width="36dp"
|
|
||||||
android:layout_height="36dp"
|
|
||||||
app:cardBackgroundColor="#F5F5F5"
|
|
||||||
app:cardCornerRadius="18dp"
|
|
||||||
app:cardElevation="0dp"
|
|
||||||
app:cardPreventCornerOverlap="false">
|
|
||||||
|
|
||||||
<ImageView
|
|
||||||
android:layout_width="match_parent"
|
|
||||||
android:layout_height="match_parent"
|
|
||||||
android:contentDescription="@null"
|
|
||||||
android:scaleType="centerCrop"
|
|
||||||
android:src="@mipmap/ic_launcher" />
|
|
||||||
</androidx.cardview.widget.CardView>
|
|
||||||
|
|
||||||
<LinearLayout
|
|
||||||
android:layout_width="0dp"
|
|
||||||
android:layout_height="wrap_content"
|
|
||||||
android:layout_marginStart="8dp"
|
|
||||||
android:layout_weight="1"
|
|
||||||
android:orientation="vertical">
|
|
||||||
|
|
||||||
<TextView
|
|
||||||
style="@style/HomeText"
|
|
||||||
android:layout_width="wrap_content"
|
|
||||||
android:layout_height="17dp"
|
|
||||||
android:text="@string/pickup_stats_sample_name"
|
|
||||||
android:textColor="#222222"
|
|
||||||
android:textSize="14sp"
|
|
||||||
android:textStyle="bold" />
|
|
||||||
|
|
||||||
<TextView
|
|
||||||
style="@style/HomeText"
|
|
||||||
android:layout_width="wrap_content"
|
|
||||||
android:layout_height="15dp"
|
|
||||||
android:layout_marginTop="4dp"
|
|
||||||
android:text="@string/pickup_stats_sample_product"
|
|
||||||
android:textColor="#999999"
|
|
||||||
android:textSize="12sp" />
|
|
||||||
</LinearLayout>
|
|
||||||
|
|
||||||
<TextView
|
|
||||||
style="@style/HomeText"
|
|
||||||
android:layout_width="wrap_content"
|
|
||||||
android:layout_height="15dp"
|
|
||||||
android:layout_gravity="top"
|
|
||||||
android:layout_marginTop="1dp"
|
|
||||||
android:text="2026-10-23 10:09:13"
|
|
||||||
android:textColor="#666666"
|
|
||||||
android:textSize="12sp" />
|
|
||||||
</LinearLayout>
|
|
||||||
|
|
||||||
<View
|
|
||||||
android:layout_width="match_parent"
|
|
||||||
android:layout_height="0.5dp"
|
|
||||||
android:layout_marginStart="14dp"
|
|
||||||
android:layout_marginTop="14dp"
|
|
||||||
android:layout_marginEnd="14dp"
|
|
||||||
android:background="#DDDDDD" />
|
|
||||||
|
|
||||||
<LinearLayout
|
|
||||||
android:layout_width="match_parent"
|
|
||||||
android:layout_height="21dp"
|
|
||||||
android:layout_marginStart="14dp"
|
|
||||||
android:layout_marginTop="13dp"
|
|
||||||
android:layout_marginEnd="14dp"
|
|
||||||
android:gravity="center_vertical"
|
|
||||||
android:orientation="horizontal">
|
|
||||||
|
|
||||||
<TextView
|
|
||||||
style="@style/HomeText"
|
|
||||||
android:layout_width="wrap_content"
|
|
||||||
android:layout_height="wrap_content"
|
|
||||||
android:text="@string/pickup_stats_points"
|
|
||||||
android:textColor="#FF6900"
|
|
||||||
android:textSize="14sp" />
|
|
||||||
|
|
||||||
<Space
|
|
||||||
android:layout_width="0dp"
|
|
||||||
android:layout_height="1dp"
|
|
||||||
android:layout_weight="1" />
|
|
||||||
|
|
||||||
<ImageView
|
|
||||||
android:layout_width="21dp"
|
|
||||||
android:layout_height="21dp"
|
|
||||||
android:contentDescription="@null"
|
|
||||||
android:src="@mipmap/icon_pickup_stats_code" />
|
|
||||||
|
|
||||||
<TextView
|
|
||||||
style="@style/HomeText"
|
|
||||||
android:layout_width="wrap_content"
|
|
||||||
android:layout_height="wrap_content"
|
|
||||||
android:layout_marginStart="4dp"
|
|
||||||
android:text="157 403"
|
|
||||||
android:textColor="#FF6900"
|
|
||||||
android:textSize="14sp" />
|
|
||||||
</LinearLayout>
|
|
||||||
</LinearLayout>
|
|
||||||
|
|
||||||
<TextView
|
|
||||||
style="@style/HomeText"
|
|
||||||
android:layout_width="wrap_content"
|
|
||||||
android:layout_height="15dp"
|
|
||||||
android:layout_gravity="center_horizontal"
|
|
||||||
android:layout_marginTop="14dp"
|
|
||||||
android:text="@string/pickup_stats_load_more"
|
|
||||||
android:textColor="#999999"
|
|
||||||
android:textSize="12sp" />
|
|
||||||
</LinearLayout>
|
|
||||||
</ScrollView>
|
|
||||||
</LinearLayout>
|
</LinearLayout>
|
||||||
|
|||||||
@@ -487,7 +487,7 @@
|
|||||||
android:focusable="true"
|
android:focusable="true"
|
||||||
android:fontFamily="sans-serif-medium"
|
android:fontFamily="sans-serif-medium"
|
||||||
android:gravity="center"
|
android:gravity="center"
|
||||||
android:text="@string/pickup_confirm_ship"
|
android:text="@string/pickup_confirm_verify"
|
||||||
android:textColor="@android:color/white"
|
android:textColor="@android:color/white"
|
||||||
android:textSize="16sp" />
|
android:textSize="16sp" />
|
||||||
</LinearLayout>
|
</LinearLayout>
|
||||||
|
|||||||
240
app/src/main/res/layout/product_outbound_layout.xml
Normal file
@@ -0,0 +1,240 @@
|
|||||||
|
<?xml version="1.0" encoding="utf-8"?>
|
||||||
|
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
|
||||||
|
xmlns:tools="http://schemas.android.com/tools"
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="match_parent"
|
||||||
|
android:background="@android:color/white"
|
||||||
|
android:fitsSystemWindows="true"
|
||||||
|
android:orientation="vertical"
|
||||||
|
tools:locale="en">
|
||||||
|
|
||||||
|
<FrameLayout
|
||||||
|
android:id="@+id/rl_title"
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="48dp"
|
||||||
|
android:background="@android:color/white">
|
||||||
|
|
||||||
|
<ImageView
|
||||||
|
android:id="@+id/iv_back"
|
||||||
|
android:layout_width="22dp"
|
||||||
|
android:layout_height="22dp"
|
||||||
|
android:layout_gravity="start|center_vertical"
|
||||||
|
android:layout_marginStart="16dp"
|
||||||
|
android:clickable="true"
|
||||||
|
android:contentDescription="@string/product_outbound_back"
|
||||||
|
android:focusable="true"
|
||||||
|
android:src="@mipmap/icon_product_inbound_back" />
|
||||||
|
|
||||||
|
<TextView
|
||||||
|
style="@style/HomeText"
|
||||||
|
android:layout_width="wrap_content"
|
||||||
|
android:layout_height="match_parent"
|
||||||
|
android:layout_gravity="center"
|
||||||
|
android:gravity="center"
|
||||||
|
android:text="@string/product_outbound_title"
|
||||||
|
android:textSize="16sp"
|
||||||
|
android:textStyle="bold" />
|
||||||
|
</FrameLayout>
|
||||||
|
|
||||||
|
<FrameLayout
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="0dp"
|
||||||
|
android:layout_weight="1"
|
||||||
|
android:background="#F5F5F5">
|
||||||
|
|
||||||
|
<!-- 标题栏以下整体滚动,避免 RecyclerView 与 ScrollView 嵌套只显示一屏 -->
|
||||||
|
<androidx.core.widget.NestedScrollView
|
||||||
|
android:id="@+id/scroll_content"
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="match_parent"
|
||||||
|
android:clipToPadding="false"
|
||||||
|
android:fillViewport="true"
|
||||||
|
android:overScrollMode="never"
|
||||||
|
android:paddingBottom="88dp"
|
||||||
|
android:scrollbars="none">
|
||||||
|
|
||||||
|
<LinearLayout
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:orientation="vertical">
|
||||||
|
|
||||||
|
<!-- 提货码输入:出库接口需要已核销订单的提货码 -->
|
||||||
|
<LinearLayout
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="56dp"
|
||||||
|
android:layout_marginStart="24dp"
|
||||||
|
android:layout_marginTop="20dp"
|
||||||
|
android:layout_marginEnd="24dp"
|
||||||
|
android:background="@drawable/product_card_bg"
|
||||||
|
android:gravity="center_vertical"
|
||||||
|
android:orientation="horizontal"
|
||||||
|
android:paddingStart="16dp"
|
||||||
|
android:paddingEnd="16dp"
|
||||||
|
android:visibility="gone">
|
||||||
|
|
||||||
|
<TextView
|
||||||
|
style="@style/HomeText"
|
||||||
|
android:layout_width="wrap_content"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:text="@string/product_outbound_pickup_code"
|
||||||
|
android:textColor="#222222"
|
||||||
|
android:textSize="14sp"
|
||||||
|
android:textStyle="bold" />
|
||||||
|
|
||||||
|
<EditText
|
||||||
|
android:id="@+id/et_pickup_code"
|
||||||
|
style="@style/HomeText"
|
||||||
|
android:layout_width="0dp"
|
||||||
|
android:layout_height="match_parent"
|
||||||
|
android:layout_marginStart="12dp"
|
||||||
|
android:layout_weight="1"
|
||||||
|
android:background="@null"
|
||||||
|
android:gravity="center_vertical"
|
||||||
|
android:hint="@string/product_outbound_pickup_code_hint"
|
||||||
|
android:imeOptions="actionDone"
|
||||||
|
android:inputType="text"
|
||||||
|
android:maxLines="1"
|
||||||
|
android:textColor="#222222"
|
||||||
|
android:textColorHint="#999999"
|
||||||
|
android:textSize="14sp" />
|
||||||
|
</LinearLayout>
|
||||||
|
|
||||||
|
<!-- 扫码卡片 -->
|
||||||
|
<FrameLayout
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="192dp"
|
||||||
|
android:layout_marginStart="24dp"
|
||||||
|
android:layout_marginTop="10dp"
|
||||||
|
android:layout_marginEnd="24dp"
|
||||||
|
android:background="@drawable/product_card_bg">
|
||||||
|
|
||||||
|
<ImageView
|
||||||
|
android:id="@+id/iv_scan"
|
||||||
|
android:layout_width="120dp"
|
||||||
|
android:layout_height="120dp"
|
||||||
|
android:layout_gravity="top|center_horizontal"
|
||||||
|
android:layout_marginTop="4dp"
|
||||||
|
android:clickable="true"
|
||||||
|
android:contentDescription="@string/product_outbound_scan_tip"
|
||||||
|
android:focusable="true"
|
||||||
|
android:src="@mipmap/icon_product_inbound_scan_circle" />
|
||||||
|
|
||||||
|
<TextView
|
||||||
|
android:id="@+id/tv_scan_tip"
|
||||||
|
style="@style/HomeText"
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="17dp"
|
||||||
|
android:layout_gravity="top"
|
||||||
|
android:layout_marginStart="32dp"
|
||||||
|
android:layout_marginTop="128dp"
|
||||||
|
android:layout_marginEnd="32dp"
|
||||||
|
android:gravity="center"
|
||||||
|
android:text="@string/product_outbound_scan_tip"
|
||||||
|
android:textSize="14sp"
|
||||||
|
android:textStyle="bold" />
|
||||||
|
|
||||||
|
<TextView
|
||||||
|
android:id="@+id/tv_manual_entry"
|
||||||
|
style="@style/HomeText"
|
||||||
|
android:layout_width="wrap_content"
|
||||||
|
android:layout_height="17dp"
|
||||||
|
android:layout_gravity="top|center_horizontal"
|
||||||
|
android:layout_marginTop="155dp"
|
||||||
|
android:clickable="true"
|
||||||
|
android:focusable="true"
|
||||||
|
android:fontFamily="sans-serif-medium"
|
||||||
|
android:gravity="center"
|
||||||
|
android:text="@string/product_outbound_manual_entry"
|
||||||
|
android:textColor="@color/color_zhu"
|
||||||
|
android:textSize="14sp" />
|
||||||
|
</FrameLayout>
|
||||||
|
|
||||||
|
<!-- 待出库商品 -->
|
||||||
|
<TextView
|
||||||
|
style="@style/HomeText"
|
||||||
|
android:layout_width="wrap_content"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:layout_marginStart="24dp"
|
||||||
|
android:layout_marginTop="20dp"
|
||||||
|
android:text="@string/product_outbound_pending_title"
|
||||||
|
android:textColor="#222222"
|
||||||
|
android:textSize="16sp"
|
||||||
|
android:textStyle="bold" />
|
||||||
|
|
||||||
|
<LinearLayout
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="44dp"
|
||||||
|
android:layout_marginStart="24dp"
|
||||||
|
android:layout_marginTop="-7dp"
|
||||||
|
android:layout_marginEnd="24dp"
|
||||||
|
android:layout_marginBottom="-14dp"
|
||||||
|
android:gravity="center_vertical"
|
||||||
|
android:orientation="horizontal">
|
||||||
|
|
||||||
|
<TextView
|
||||||
|
android:id="@+id/tv_pending_total"
|
||||||
|
style="@style/HomeText"
|
||||||
|
android:layout_width="wrap_content"
|
||||||
|
android:layout_height="match_parent"
|
||||||
|
android:gravity="center_vertical"
|
||||||
|
android:textColor="#666666"
|
||||||
|
android:textSize="14sp" />
|
||||||
|
|
||||||
|
<Space
|
||||||
|
android:layout_width="0dp"
|
||||||
|
android:layout_height="1dp"
|
||||||
|
android:layout_weight="1" />
|
||||||
|
|
||||||
|
<ImageView
|
||||||
|
android:id="@+id/iv_delete_selected"
|
||||||
|
android:layout_width="16dp"
|
||||||
|
android:layout_height="16dp"
|
||||||
|
android:clickable="true"
|
||||||
|
android:contentDescription="@string/product_outbound_delete"
|
||||||
|
android:focusable="true"
|
||||||
|
android:src="@mipmap/icon_product_inbound_trash" />
|
||||||
|
|
||||||
|
<TextView
|
||||||
|
android:id="@+id/tv_delete_selected"
|
||||||
|
style="@style/HomeText"
|
||||||
|
android:layout_width="wrap_content"
|
||||||
|
android:layout_height="match_parent"
|
||||||
|
android:layout_marginStart="4dp"
|
||||||
|
android:clickable="true"
|
||||||
|
android:focusable="true"
|
||||||
|
android:gravity="center"
|
||||||
|
android:text="@string/product_outbound_delete"
|
||||||
|
android:textColor="#E5484D"
|
||||||
|
android:textSize="14sp" />
|
||||||
|
</LinearLayout>
|
||||||
|
|
||||||
|
<!-- 列表高度随条目增长,由外层 NestedScrollView 统一滑动 -->
|
||||||
|
<androidx.recyclerview.widget.RecyclerView
|
||||||
|
android:id="@+id/rv_pending"
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:layout_marginTop="3dp"
|
||||||
|
android:nestedScrollingEnabled="false"
|
||||||
|
android:overScrollMode="never" />
|
||||||
|
</LinearLayout>
|
||||||
|
</androidx.core.widget.NestedScrollView>
|
||||||
|
|
||||||
|
<!-- 提交出库 -->
|
||||||
|
<TextView
|
||||||
|
android:id="@+id/btn_submit"
|
||||||
|
style="@style/HomeText"
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="56dp"
|
||||||
|
android:layout_gravity="bottom"
|
||||||
|
android:layout_marginStart="24dp"
|
||||||
|
android:layout_marginEnd="24dp"
|
||||||
|
android:background="@drawable/product_inbound_submit_bg"
|
||||||
|
android:clickable="true"
|
||||||
|
android:focusable="true"
|
||||||
|
android:fontFamily="sans-serif-medium"
|
||||||
|
android:gravity="center"
|
||||||
|
android:text="@string/product_outbound_submit"
|
||||||
|
android:textColor="@android:color/white"
|
||||||
|
android:textSize="16sp" />
|
||||||
|
</FrameLayout>
|
||||||
|
</LinearLayout>
|
||||||
@@ -48,6 +48,7 @@
|
|||||||
android:src="@drawable/ic_product_scan_back" />
|
android:src="@drawable/ic_product_scan_back" />
|
||||||
|
|
||||||
<TextView
|
<TextView
|
||||||
|
android:id="@+id/tv_scan_title"
|
||||||
android:layout_width="0dp"
|
android:layout_width="0dp"
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
android:layout_marginStart="4dp"
|
android:layout_marginStart="4dp"
|
||||||
|
|||||||
@@ -35,21 +35,6 @@
|
|||||||
android:textStyle="bold" />
|
android:textStyle="bold" />
|
||||||
</FrameLayout>
|
</FrameLayout>
|
||||||
|
|
||||||
<ScrollView
|
|
||||||
android:layout_width="match_parent"
|
|
||||||
android:layout_height="0dp"
|
|
||||||
android:layout_weight="1"
|
|
||||||
android:background="#F5F5F5"
|
|
||||||
android:fillViewport="true"
|
|
||||||
android:overScrollMode="never"
|
|
||||||
android:scrollbars="none">
|
|
||||||
|
|
||||||
<LinearLayout
|
|
||||||
android:layout_width="match_parent"
|
|
||||||
android:layout_height="wrap_content"
|
|
||||||
android:orientation="vertical"
|
|
||||||
android:paddingBottom="24dp">
|
|
||||||
|
|
||||||
<!-- 用户信息 -->
|
<!-- 用户信息 -->
|
||||||
<FrameLayout
|
<FrameLayout
|
||||||
android:layout_width="match_parent"
|
android:layout_width="match_parent"
|
||||||
@@ -84,6 +69,9 @@
|
|||||||
android:layout_height="17dp"
|
android:layout_height="17dp"
|
||||||
android:layout_marginStart="60dp"
|
android:layout_marginStart="60dp"
|
||||||
android:layout_marginTop="14dp"
|
android:layout_marginTop="14dp"
|
||||||
|
android:layout_marginEnd="16dp"
|
||||||
|
android:ellipsize="end"
|
||||||
|
android:maxLines="1"
|
||||||
android:textColor="#222222"
|
android:textColor="#222222"
|
||||||
android:textSize="14sp"
|
android:textSize="14sp"
|
||||||
android:textStyle="bold" />
|
android:textStyle="bold" />
|
||||||
@@ -97,485 +85,56 @@
|
|||||||
android:src="@mipmap/icon_user_device_location" />
|
android:src="@mipmap/icon_user_device_location" />
|
||||||
|
|
||||||
<TextView
|
<TextView
|
||||||
|
android:id="@+id/tv_user_device_count"
|
||||||
style="@style/HomeText"
|
style="@style/HomeText"
|
||||||
android:layout_width="wrap_content"
|
android:layout_width="wrap_content"
|
||||||
android:layout_height="15dp"
|
android:layout_height="15dp"
|
||||||
android:layout_marginStart="77dp"
|
android:layout_marginStart="77dp"
|
||||||
android:layout_marginTop="35dp"
|
android:layout_marginTop="35dp"
|
||||||
android:text="@string/user_sample_location"
|
|
||||||
android:textColor="#222222"
|
android:textColor="#222222"
|
||||||
android:textSize="12sp" />
|
android:textSize="12sp" />
|
||||||
</FrameLayout>
|
</FrameLayout>
|
||||||
|
|
||||||
|
<!-- 设备总数 -->
|
||||||
<TextView
|
<TextView
|
||||||
android:id="@+id/tv_device_total"
|
android:id="@+id/tv_device_total"
|
||||||
style="@style/HomeText"
|
style="@style/HomeText"
|
||||||
android:layout_width="wrap_content"
|
android:layout_width="match_parent"
|
||||||
android:layout_height="19dp"
|
android:layout_height="wrap_content"
|
||||||
android:layout_marginStart="24dp"
|
android:background="#F5F5F5"
|
||||||
android:layout_marginTop="20dp"
|
android:paddingStart="24dp"
|
||||||
|
android:paddingTop="20dp"
|
||||||
android:textColor="#222222"
|
android:textColor="#222222"
|
||||||
android:textSize="16sp"
|
android:textSize="16sp"
|
||||||
android:textStyle="bold" />
|
android:textStyle="bold" />
|
||||||
|
|
||||||
<!-- 设备卡片 1:在线 -->
|
<!-- 设备列表:当前持有 + 已退回 -->
|
||||||
<LinearLayout
|
|
||||||
android:layout_width="match_parent"
|
|
||||||
android:layout_height="130dp"
|
|
||||||
android:layout_marginStart="24dp"
|
|
||||||
android:layout_marginTop="12dp"
|
|
||||||
android:layout_marginEnd="24dp"
|
|
||||||
android:background="@drawable/device_manage_card_bg"
|
|
||||||
android:orientation="vertical">
|
|
||||||
|
|
||||||
<FrameLayout
|
<FrameLayout
|
||||||
android:layout_width="match_parent"
|
android:layout_width="match_parent"
|
||||||
android:layout_height="50dp">
|
android:layout_height="0dp"
|
||||||
|
android:layout_weight="1"
|
||||||
|
android:background="#F5F5F5">
|
||||||
|
|
||||||
<ImageView
|
<androidx.recyclerview.widget.RecyclerView
|
||||||
android:layout_width="36dp"
|
android:id="@+id/rv_user_devices"
|
||||||
android:layout_height="36dp"
|
android:layout_width="match_parent"
|
||||||
android:layout_marginStart="14dp"
|
android:layout_height="match_parent"
|
||||||
android:layout_marginTop="14dp"
|
android:clipToPadding="false"
|
||||||
android:contentDescription="@null"
|
android:overScrollMode="never"
|
||||||
android:src="@mipmap/icon_user_device_box" />
|
android:paddingBottom="24dp"
|
||||||
|
android:scrollbars="none" />
|
||||||
|
|
||||||
|
<!-- 加载中 / 空列表 / 加载失败提示,列表有数据时隐藏 -->
|
||||||
<TextView
|
<TextView
|
||||||
|
android:id="@+id/tv_user_device_state"
|
||||||
style="@style/HomeText"
|
style="@style/HomeText"
|
||||||
android:layout_width="wrap_content"
|
android:layout_width="match_parent"
|
||||||
android:layout_height="17dp"
|
android:layout_height="match_parent"
|
||||||
android:layout_marginStart="60dp"
|
|
||||||
android:layout_marginTop="14dp"
|
|
||||||
android:text="@string/user_sample_sn"
|
|
||||||
android:textColor="#222222"
|
|
||||||
android:textSize="14sp"
|
|
||||||
android:textStyle="bold" />
|
|
||||||
|
|
||||||
<TextView
|
|
||||||
style="@style/HomeText"
|
|
||||||
android:layout_width="wrap_content"
|
|
||||||
android:layout_height="15dp"
|
|
||||||
android:layout_marginStart="60dp"
|
|
||||||
android:layout_marginTop="35dp"
|
|
||||||
android:maxLines="1"
|
|
||||||
android:text="@string/user_sample_model"
|
|
||||||
android:textColor="#999999"
|
|
||||||
android:textSize="12sp" />
|
|
||||||
|
|
||||||
<TextView
|
|
||||||
style="@style/HomeText"
|
|
||||||
android:layout_width="68dp"
|
|
||||||
android:layout_height="27dp"
|
|
||||||
android:layout_gravity="end|top"
|
|
||||||
android:layout_marginTop="14dp"
|
|
||||||
android:layout_marginEnd="14dp"
|
|
||||||
android:background="@drawable/user_status_online_bg"
|
|
||||||
android:gravity="center"
|
android:gravity="center"
|
||||||
android:text="@string/user_device_online"
|
android:paddingBottom="60dp"
|
||||||
android:textColor="#22A45D"
|
android:text="@string/user_device_empty"
|
||||||
android:textSize="12sp" />
|
android:textColor="#999999"
|
||||||
|
android:textSize="14sp"
|
||||||
|
android:visibility="gone" />
|
||||||
</FrameLayout>
|
</FrameLayout>
|
||||||
|
|
||||||
<View
|
|
||||||
android:layout_width="match_parent"
|
|
||||||
android:layout_height="0.5dp"
|
|
||||||
android:layout_marginStart="14dp"
|
|
||||||
android:layout_marginTop="14dp"
|
|
||||||
android:layout_marginEnd="14dp"
|
|
||||||
android:background="#DDDDDD" />
|
|
||||||
|
|
||||||
<LinearLayout
|
|
||||||
android:layout_width="match_parent"
|
|
||||||
android:layout_height="38dp"
|
|
||||||
android:layout_marginStart="14dp"
|
|
||||||
android:layout_marginTop="13dp"
|
|
||||||
android:layout_marginEnd="14dp"
|
|
||||||
android:orientation="horizontal">
|
|
||||||
|
|
||||||
<LinearLayout
|
|
||||||
android:layout_width="87dp"
|
|
||||||
android:layout_height="38dp"
|
|
||||||
android:orientation="vertical">
|
|
||||||
|
|
||||||
<TextView
|
|
||||||
style="@style/HomeText"
|
|
||||||
android:layout_width="match_parent"
|
|
||||||
android:layout_height="15dp"
|
|
||||||
android:maxLines="1"
|
|
||||||
android:text="@string/user_device_activation"
|
|
||||||
android:textColor="#666666"
|
|
||||||
android:textSize="12sp" />
|
|
||||||
|
|
||||||
<TextView
|
|
||||||
style="@style/HomeText"
|
|
||||||
android:layout_width="match_parent"
|
|
||||||
android:layout_height="17dp"
|
|
||||||
android:layout_marginTop="6dp"
|
|
||||||
android:text="@string/user_sample_activation"
|
|
||||||
android:textColor="#222222"
|
|
||||||
android:textSize="14sp"
|
|
||||||
android:textStyle="bold" />
|
|
||||||
</LinearLayout>
|
|
||||||
|
|
||||||
<LinearLayout
|
|
||||||
android:layout_width="78dp"
|
|
||||||
android:layout_height="38dp"
|
|
||||||
android:layout_marginStart="34dp"
|
|
||||||
android:orientation="vertical">
|
|
||||||
|
|
||||||
<TextView
|
|
||||||
style="@style/HomeText"
|
|
||||||
android:layout_width="match_parent"
|
|
||||||
android:layout_height="15dp"
|
|
||||||
android:maxLines="1"
|
|
||||||
android:text="@string/user_device_runtime"
|
|
||||||
android:textColor="#666666"
|
|
||||||
android:textSize="12sp" />
|
|
||||||
|
|
||||||
<TextView
|
|
||||||
style="@style/HomeText"
|
|
||||||
android:layout_width="match_parent"
|
|
||||||
android:layout_height="17dp"
|
|
||||||
android:layout_marginTop="6dp"
|
|
||||||
android:text="@string/user_sample_runtime"
|
|
||||||
android:textColor="#222222"
|
|
||||||
android:textSize="14sp"
|
|
||||||
android:textStyle="bold" />
|
|
||||||
</LinearLayout>
|
|
||||||
|
|
||||||
<LinearLayout
|
|
||||||
android:layout_width="68dp"
|
|
||||||
android:layout_height="38dp"
|
|
||||||
android:layout_marginStart="34dp"
|
|
||||||
android:orientation="vertical">
|
|
||||||
|
|
||||||
<TextView
|
|
||||||
style="@style/HomeText"
|
|
||||||
android:layout_width="match_parent"
|
|
||||||
android:layout_height="15dp"
|
|
||||||
android:maxLines="1"
|
|
||||||
android:text="@string/user_device_fault_status"
|
|
||||||
android:textColor="#666666"
|
|
||||||
android:textSize="12sp" />
|
|
||||||
|
|
||||||
<TextView
|
|
||||||
style="@style/HomeText"
|
|
||||||
android:layout_width="match_parent"
|
|
||||||
android:layout_height="17dp"
|
|
||||||
android:layout_marginTop="6dp"
|
|
||||||
android:text="@string/user_device_normal"
|
|
||||||
android:textColor="#222222"
|
|
||||||
android:textSize="14sp"
|
|
||||||
android:textStyle="bold" />
|
|
||||||
</LinearLayout>
|
|
||||||
</LinearLayout>
|
|
||||||
</LinearLayout>
|
|
||||||
|
|
||||||
<!-- 设备卡片 2:故障 -->
|
|
||||||
<LinearLayout
|
|
||||||
android:layout_width="match_parent"
|
|
||||||
android:layout_height="130dp"
|
|
||||||
android:layout_marginStart="24dp"
|
|
||||||
android:layout_marginTop="10dp"
|
|
||||||
android:layout_marginEnd="24dp"
|
|
||||||
android:background="@drawable/device_manage_card_bg"
|
|
||||||
android:orientation="vertical">
|
|
||||||
|
|
||||||
<FrameLayout
|
|
||||||
android:layout_width="match_parent"
|
|
||||||
android:layout_height="50dp">
|
|
||||||
|
|
||||||
<ImageView
|
|
||||||
android:layout_width="36dp"
|
|
||||||
android:layout_height="36dp"
|
|
||||||
android:layout_marginStart="14dp"
|
|
||||||
android:layout_marginTop="14dp"
|
|
||||||
android:contentDescription="@null"
|
|
||||||
android:src="@mipmap/icon_user_device_box" />
|
|
||||||
|
|
||||||
<TextView
|
|
||||||
style="@style/HomeText"
|
|
||||||
android:layout_width="wrap_content"
|
|
||||||
android:layout_height="17dp"
|
|
||||||
android:layout_marginStart="60dp"
|
|
||||||
android:layout_marginTop="14dp"
|
|
||||||
android:text="@string/user_sample_sn"
|
|
||||||
android:textColor="#222222"
|
|
||||||
android:textSize="14sp"
|
|
||||||
android:textStyle="bold" />
|
|
||||||
|
|
||||||
<TextView
|
|
||||||
style="@style/HomeText"
|
|
||||||
android:layout_width="wrap_content"
|
|
||||||
android:layout_height="15dp"
|
|
||||||
android:layout_marginStart="60dp"
|
|
||||||
android:layout_marginTop="35dp"
|
|
||||||
android:maxLines="1"
|
|
||||||
android:text="@string/user_sample_model"
|
|
||||||
android:textColor="#999999"
|
|
||||||
android:textSize="12sp" />
|
|
||||||
|
|
||||||
<TextView
|
|
||||||
style="@style/HomeText"
|
|
||||||
android:layout_width="68dp"
|
|
||||||
android:layout_height="27dp"
|
|
||||||
android:layout_gravity="end|top"
|
|
||||||
android:layout_marginTop="14dp"
|
|
||||||
android:layout_marginEnd="14dp"
|
|
||||||
android:background="@drawable/user_status_fault_bg"
|
|
||||||
android:gravity="center"
|
|
||||||
android:text="@string/user_device_fault"
|
|
||||||
android:textColor="#E5484D"
|
|
||||||
android:textSize="12sp" />
|
|
||||||
</FrameLayout>
|
|
||||||
|
|
||||||
<View
|
|
||||||
android:layout_width="match_parent"
|
|
||||||
android:layout_height="0.5dp"
|
|
||||||
android:layout_marginStart="14dp"
|
|
||||||
android:layout_marginTop="14dp"
|
|
||||||
android:layout_marginEnd="14dp"
|
|
||||||
android:background="#DDDDDD" />
|
|
||||||
|
|
||||||
<LinearLayout
|
|
||||||
android:layout_width="match_parent"
|
|
||||||
android:layout_height="38dp"
|
|
||||||
android:layout_marginStart="14dp"
|
|
||||||
android:layout_marginTop="13dp"
|
|
||||||
android:layout_marginEnd="14dp"
|
|
||||||
android:orientation="horizontal">
|
|
||||||
|
|
||||||
<LinearLayout
|
|
||||||
android:layout_width="87dp"
|
|
||||||
android:layout_height="38dp"
|
|
||||||
android:orientation="vertical">
|
|
||||||
|
|
||||||
<TextView
|
|
||||||
style="@style/HomeText"
|
|
||||||
android:layout_width="match_parent"
|
|
||||||
android:layout_height="15dp"
|
|
||||||
android:maxLines="1"
|
|
||||||
android:text="@string/user_device_activation"
|
|
||||||
android:textColor="#666666"
|
|
||||||
android:textSize="12sp" />
|
|
||||||
|
|
||||||
<TextView
|
|
||||||
style="@style/HomeText"
|
|
||||||
android:layout_width="match_parent"
|
|
||||||
android:layout_height="17dp"
|
|
||||||
android:layout_marginTop="6dp"
|
|
||||||
android:text="@string/user_sample_activation"
|
|
||||||
android:textColor="#222222"
|
|
||||||
android:textSize="14sp"
|
|
||||||
android:textStyle="bold" />
|
|
||||||
</LinearLayout>
|
|
||||||
|
|
||||||
<LinearLayout
|
|
||||||
android:layout_width="78dp"
|
|
||||||
android:layout_height="38dp"
|
|
||||||
android:layout_marginStart="34dp"
|
|
||||||
android:orientation="vertical">
|
|
||||||
|
|
||||||
<TextView
|
|
||||||
style="@style/HomeText"
|
|
||||||
android:layout_width="match_parent"
|
|
||||||
android:layout_height="15dp"
|
|
||||||
android:maxLines="1"
|
|
||||||
android:text="@string/user_device_runtime"
|
|
||||||
android:textColor="#666666"
|
|
||||||
android:textSize="12sp" />
|
|
||||||
|
|
||||||
<TextView
|
|
||||||
style="@style/HomeText"
|
|
||||||
android:layout_width="match_parent"
|
|
||||||
android:layout_height="17dp"
|
|
||||||
android:layout_marginTop="6dp"
|
|
||||||
android:text="@string/user_sample_runtime"
|
|
||||||
android:textColor="#222222"
|
|
||||||
android:textSize="14sp"
|
|
||||||
android:textStyle="bold" />
|
|
||||||
</LinearLayout>
|
|
||||||
|
|
||||||
<LinearLayout
|
|
||||||
android:layout_width="68dp"
|
|
||||||
android:layout_height="38dp"
|
|
||||||
android:layout_marginStart="34dp"
|
|
||||||
android:orientation="vertical">
|
|
||||||
|
|
||||||
<TextView
|
|
||||||
style="@style/HomeText"
|
|
||||||
android:layout_width="match_parent"
|
|
||||||
android:layout_height="15dp"
|
|
||||||
android:maxLines="1"
|
|
||||||
android:text="@string/user_device_fault_status"
|
|
||||||
android:textColor="#666666"
|
|
||||||
android:textSize="12sp" />
|
|
||||||
|
|
||||||
<TextView
|
|
||||||
style="@style/HomeText"
|
|
||||||
android:layout_width="match_parent"
|
|
||||||
android:layout_height="17dp"
|
|
||||||
android:layout_marginTop="6dp"
|
|
||||||
android:text="@string/user_device_normal"
|
|
||||||
android:textColor="#222222"
|
|
||||||
android:textSize="14sp"
|
|
||||||
android:textStyle="bold" />
|
|
||||||
</LinearLayout>
|
|
||||||
</LinearLayout>
|
|
||||||
</LinearLayout>
|
|
||||||
|
|
||||||
<!-- 设备卡片 3:离线 -->
|
|
||||||
<LinearLayout
|
|
||||||
android:layout_width="match_parent"
|
|
||||||
android:layout_height="130dp"
|
|
||||||
android:layout_marginStart="24dp"
|
|
||||||
android:layout_marginTop="10dp"
|
|
||||||
android:layout_marginEnd="24dp"
|
|
||||||
android:background="@drawable/device_manage_card_bg"
|
|
||||||
android:orientation="vertical">
|
|
||||||
|
|
||||||
<FrameLayout
|
|
||||||
android:layout_width="match_parent"
|
|
||||||
android:layout_height="50dp">
|
|
||||||
|
|
||||||
<ImageView
|
|
||||||
android:layout_width="36dp"
|
|
||||||
android:layout_height="36dp"
|
|
||||||
android:layout_marginStart="14dp"
|
|
||||||
android:layout_marginTop="14dp"
|
|
||||||
android:contentDescription="@null"
|
|
||||||
android:src="@mipmap/icon_user_device_box_offline" />
|
|
||||||
|
|
||||||
<TextView
|
|
||||||
style="@style/HomeText"
|
|
||||||
android:layout_width="wrap_content"
|
|
||||||
android:layout_height="17dp"
|
|
||||||
android:layout_marginStart="60dp"
|
|
||||||
android:layout_marginTop="14dp"
|
|
||||||
android:text="@string/user_sample_sn"
|
|
||||||
android:textColor="#999999"
|
|
||||||
android:textSize="14sp"
|
|
||||||
android:textStyle="bold" />
|
|
||||||
|
|
||||||
<TextView
|
|
||||||
style="@style/HomeText"
|
|
||||||
android:layout_width="wrap_content"
|
|
||||||
android:layout_height="15dp"
|
|
||||||
android:layout_marginStart="60dp"
|
|
||||||
android:layout_marginTop="35dp"
|
|
||||||
android:maxLines="1"
|
|
||||||
android:text="@string/user_sample_model"
|
|
||||||
android:textColor="#999999"
|
|
||||||
android:textSize="12sp" />
|
|
||||||
|
|
||||||
<TextView
|
|
||||||
style="@style/HomeText"
|
|
||||||
android:layout_width="68dp"
|
|
||||||
android:layout_height="27dp"
|
|
||||||
android:layout_gravity="end|top"
|
|
||||||
android:layout_marginTop="14dp"
|
|
||||||
android:layout_marginEnd="14dp"
|
|
||||||
android:background="@drawable/user_status_offline_bg"
|
|
||||||
android:gravity="center"
|
|
||||||
android:text="@string/user_device_offline"
|
|
||||||
android:textColor="#666666"
|
|
||||||
android:textSize="12sp" />
|
|
||||||
</FrameLayout>
|
|
||||||
|
|
||||||
<View
|
|
||||||
android:layout_width="match_parent"
|
|
||||||
android:layout_height="0.5dp"
|
|
||||||
android:layout_marginStart="14dp"
|
|
||||||
android:layout_marginTop="14dp"
|
|
||||||
android:layout_marginEnd="14dp"
|
|
||||||
android:background="#DDDDDD" />
|
|
||||||
|
|
||||||
<LinearLayout
|
|
||||||
android:layout_width="match_parent"
|
|
||||||
android:layout_height="38dp"
|
|
||||||
android:layout_marginStart="14dp"
|
|
||||||
android:layout_marginTop="13dp"
|
|
||||||
android:layout_marginEnd="14dp"
|
|
||||||
android:orientation="horizontal">
|
|
||||||
|
|
||||||
<LinearLayout
|
|
||||||
android:layout_width="87dp"
|
|
||||||
android:layout_height="38dp"
|
|
||||||
android:orientation="vertical">
|
|
||||||
|
|
||||||
<TextView
|
|
||||||
style="@style/HomeText"
|
|
||||||
android:layout_width="match_parent"
|
|
||||||
android:layout_height="15dp"
|
|
||||||
android:maxLines="1"
|
|
||||||
android:text="@string/user_device_activation"
|
|
||||||
android:textColor="#666666"
|
|
||||||
android:textSize="12sp" />
|
|
||||||
|
|
||||||
<TextView
|
|
||||||
style="@style/HomeText"
|
|
||||||
android:layout_width="match_parent"
|
|
||||||
android:layout_height="17dp"
|
|
||||||
android:layout_marginTop="6dp"
|
|
||||||
android:text="@string/user_sample_activation"
|
|
||||||
android:textColor="#999999"
|
|
||||||
android:textSize="14sp"
|
|
||||||
android:textStyle="bold" />
|
|
||||||
</LinearLayout>
|
|
||||||
|
|
||||||
<LinearLayout
|
|
||||||
android:layout_width="78dp"
|
|
||||||
android:layout_height="38dp"
|
|
||||||
android:layout_marginStart="34dp"
|
|
||||||
android:orientation="vertical">
|
|
||||||
|
|
||||||
<TextView
|
|
||||||
style="@style/HomeText"
|
|
||||||
android:layout_width="match_parent"
|
|
||||||
android:layout_height="15dp"
|
|
||||||
android:maxLines="1"
|
|
||||||
android:text="@string/user_device_runtime"
|
|
||||||
android:textColor="#666666"
|
|
||||||
android:textSize="12sp" />
|
|
||||||
|
|
||||||
<TextView
|
|
||||||
style="@style/HomeText"
|
|
||||||
android:layout_width="match_parent"
|
|
||||||
android:layout_height="17dp"
|
|
||||||
android:layout_marginTop="6dp"
|
|
||||||
android:text="@string/user_sample_runtime"
|
|
||||||
android:textColor="#999999"
|
|
||||||
android:textSize="14sp"
|
|
||||||
android:textStyle="bold" />
|
|
||||||
</LinearLayout>
|
|
||||||
|
|
||||||
<LinearLayout
|
|
||||||
android:layout_width="68dp"
|
|
||||||
android:layout_height="38dp"
|
|
||||||
android:layout_marginStart="34dp"
|
|
||||||
android:orientation="vertical">
|
|
||||||
|
|
||||||
<TextView
|
|
||||||
style="@style/HomeText"
|
|
||||||
android:layout_width="match_parent"
|
|
||||||
android:layout_height="15dp"
|
|
||||||
android:maxLines="1"
|
|
||||||
android:text="@string/user_device_fault_status"
|
|
||||||
android:textColor="#666666"
|
|
||||||
android:textSize="12sp" />
|
|
||||||
|
|
||||||
<TextView
|
|
||||||
style="@style/HomeText"
|
|
||||||
android:layout_width="match_parent"
|
|
||||||
android:layout_height="17dp"
|
|
||||||
android:layout_marginTop="6dp"
|
|
||||||
android:text="@string/user_device_normal"
|
|
||||||
android:textColor="#999999"
|
|
||||||
android:textSize="14sp"
|
|
||||||
android:textStyle="bold" />
|
|
||||||
</LinearLayout>
|
|
||||||
</LinearLayout>
|
|
||||||
</LinearLayout>
|
|
||||||
</LinearLayout>
|
|
||||||
</ScrollView>
|
|
||||||
</LinearLayout>
|
</LinearLayout>
|
||||||
|
|||||||
@@ -74,415 +74,52 @@
|
|||||||
android:src="@mipmap/icon_user_search" />
|
android:src="@mipmap/icon_user_search" />
|
||||||
</FrameLayout>
|
</FrameLayout>
|
||||||
|
|
||||||
<ScrollView
|
<!-- 用户总数 -->
|
||||||
android:layout_width="match_parent"
|
|
||||||
android:layout_height="0dp"
|
|
||||||
android:layout_weight="1"
|
|
||||||
android:background="#F5F5F5"
|
|
||||||
android:fillViewport="true"
|
|
||||||
android:overScrollMode="never"
|
|
||||||
android:scrollbars="none">
|
|
||||||
|
|
||||||
<LinearLayout
|
|
||||||
android:layout_width="match_parent"
|
|
||||||
android:layout_height="wrap_content"
|
|
||||||
android:orientation="vertical"
|
|
||||||
android:paddingBottom="24dp">
|
|
||||||
|
|
||||||
<TextView
|
<TextView
|
||||||
android:id="@+id/tv_user_total"
|
android:id="@+id/tv_user_total"
|
||||||
style="@style/HomeText"
|
style="@style/HomeText"
|
||||||
android:layout_width="wrap_content"
|
android:layout_width="match_parent"
|
||||||
android:layout_height="19dp"
|
android:layout_height="wrap_content"
|
||||||
android:layout_marginStart="24dp"
|
android:background="#F5F5F5"
|
||||||
android:layout_marginTop="20dp"
|
android:paddingStart="24dp"
|
||||||
|
android:paddingTop="20dp"
|
||||||
android:textColor="#222222"
|
android:textColor="#222222"
|
||||||
android:textSize="16sp"
|
android:textSize="16sp"
|
||||||
android:textStyle="bold" />
|
android:textStyle="bold" />
|
||||||
|
|
||||||
<!-- 用户卡片 1 -->
|
<!-- 用户列表:下拉刷新、上拉加载更多 -->
|
||||||
<LinearLayout
|
|
||||||
android:id="@+id/card_user_1"
|
|
||||||
android:layout_width="match_parent"
|
|
||||||
android:layout_height="107dp"
|
|
||||||
android:layout_marginStart="24dp"
|
|
||||||
android:layout_marginTop="12dp"
|
|
||||||
android:layout_marginEnd="24dp"
|
|
||||||
android:background="@drawable/device_manage_card_bg"
|
|
||||||
android:clickable="true"
|
|
||||||
android:focusable="true"
|
|
||||||
android:orientation="vertical">
|
|
||||||
|
|
||||||
<FrameLayout
|
<FrameLayout
|
||||||
android:layout_width="match_parent"
|
android:layout_width="match_parent"
|
||||||
android:layout_height="50dp">
|
android:layout_height="0dp"
|
||||||
|
android:layout_weight="1"
|
||||||
|
android:background="#F5F5F5">
|
||||||
|
|
||||||
<androidx.cardview.widget.CardView
|
<com.scwang.smart.refresh.layout.SmartRefreshLayout
|
||||||
android:layout_width="36dp"
|
android:id="@+id/refresh_users"
|
||||||
android:layout_height="36dp"
|
android:layout_width="match_parent"
|
||||||
android:layout_marginStart="14dp"
|
android:layout_height="match_parent">
|
||||||
android:layout_marginTop="14dp"
|
|
||||||
app:cardBackgroundColor="#F5F5F5"
|
|
||||||
app:cardCornerRadius="18dp"
|
|
||||||
app:cardElevation="0dp"
|
|
||||||
app:cardPreventCornerOverlap="false">
|
|
||||||
|
|
||||||
<ImageView
|
<androidx.recyclerview.widget.RecyclerView
|
||||||
|
android:id="@+id/rv_users"
|
||||||
android:layout_width="match_parent"
|
android:layout_width="match_parent"
|
||||||
android:layout_height="match_parent"
|
android:layout_height="match_parent"
|
||||||
android:contentDescription="@null"
|
android:clipToPadding="false"
|
||||||
android:scaleType="centerCrop"
|
android:overScrollMode="never"
|
||||||
android:src="@mipmap/ic_launcher" />
|
android:paddingBottom="24dp"
|
||||||
</androidx.cardview.widget.CardView>
|
android:scrollbars="none" />
|
||||||
|
</com.scwang.smart.refresh.layout.SmartRefreshLayout>
|
||||||
|
|
||||||
|
<!-- 加载中 / 空列表 / 加载失败提示,列表有数据时隐藏 -->
|
||||||
<TextView
|
<TextView
|
||||||
|
android:id="@+id/tv_user_state"
|
||||||
style="@style/HomeText"
|
style="@style/HomeText"
|
||||||
android:layout_width="wrap_content"
|
|
||||||
android:layout_height="17dp"
|
|
||||||
android:layout_marginStart="60dp"
|
|
||||||
android:layout_marginTop="14dp"
|
|
||||||
android:text="@string/user_sample_name"
|
|
||||||
android:textColor="#222222"
|
|
||||||
android:textSize="14sp"
|
|
||||||
android:textStyle="bold" />
|
|
||||||
|
|
||||||
<ImageView
|
|
||||||
android:layout_width="15dp"
|
|
||||||
android:layout_height="15dp"
|
|
||||||
android:layout_marginStart="60dp"
|
|
||||||
android:layout_marginTop="35dp"
|
|
||||||
android:contentDescription="@null"
|
|
||||||
android:src="@mipmap/icon_user_phone" />
|
|
||||||
|
|
||||||
<TextView
|
|
||||||
style="@style/HomeText"
|
|
||||||
android:layout_width="wrap_content"
|
|
||||||
android:layout_height="15dp"
|
|
||||||
android:layout_marginStart="77dp"
|
|
||||||
android:layout_marginTop="35dp"
|
|
||||||
android:text="@string/user_sample_phone_masked"
|
|
||||||
android:textColor="#999999"
|
|
||||||
android:textSize="12sp" />
|
|
||||||
|
|
||||||
<ImageView
|
|
||||||
android:layout_width="22dp"
|
|
||||||
android:layout_height="22dp"
|
|
||||||
android:layout_gravity="end|top"
|
|
||||||
android:layout_marginTop="21dp"
|
|
||||||
android:layout_marginEnd="14dp"
|
|
||||||
android:contentDescription="@null"
|
|
||||||
android:src="@mipmap/icon_user_arrow" />
|
|
||||||
</FrameLayout>
|
|
||||||
|
|
||||||
<View
|
|
||||||
android:layout_width="match_parent"
|
|
||||||
android:layout_height="0.5dp"
|
|
||||||
android:layout_marginStart="14dp"
|
|
||||||
android:layout_marginTop="14dp"
|
|
||||||
android:layout_marginEnd="14dp"
|
|
||||||
android:background="#DDDDDD" />
|
|
||||||
|
|
||||||
<LinearLayout
|
|
||||||
android:layout_width="match_parent"
|
|
||||||
android:layout_height="15dp"
|
|
||||||
android:layout_marginStart="14dp"
|
|
||||||
android:layout_marginTop="13dp"
|
|
||||||
android:layout_marginEnd="14dp"
|
|
||||||
android:gravity="center_vertical"
|
|
||||||
android:orientation="horizontal">
|
|
||||||
|
|
||||||
<ImageView
|
|
||||||
android:layout_width="15dp"
|
|
||||||
android:layout_height="15dp"
|
|
||||||
android:contentDescription="@null"
|
|
||||||
android:src="@mipmap/icon_user_location" />
|
|
||||||
|
|
||||||
<TextView
|
|
||||||
style="@style/HomeText"
|
|
||||||
android:layout_width="wrap_content"
|
|
||||||
android:layout_height="15dp"
|
|
||||||
android:layout_marginStart="2dp"
|
|
||||||
android:text="@string/user_sample_location"
|
|
||||||
android:textColor="#222222"
|
|
||||||
android:textSize="12sp" />
|
|
||||||
|
|
||||||
<Space
|
|
||||||
android:layout_width="0dp"
|
|
||||||
android:layout_height="1dp"
|
|
||||||
android:layout_weight="1" />
|
|
||||||
|
|
||||||
<ImageView
|
|
||||||
android:layout_width="15dp"
|
|
||||||
android:layout_height="15dp"
|
|
||||||
android:contentDescription="@null"
|
|
||||||
android:src="@mipmap/icon_user_clock" />
|
|
||||||
|
|
||||||
<TextView
|
|
||||||
style="@style/HomeText"
|
|
||||||
android:layout_width="wrap_content"
|
|
||||||
android:layout_height="15dp"
|
|
||||||
android:layout_marginStart="4dp"
|
|
||||||
android:text="@string/user_sample_time"
|
|
||||||
android:textColor="#222222"
|
|
||||||
android:textSize="12sp" />
|
|
||||||
</LinearLayout>
|
|
||||||
</LinearLayout>
|
|
||||||
|
|
||||||
<!-- 用户卡片 2 -->
|
|
||||||
<LinearLayout
|
|
||||||
android:id="@+id/card_user_2"
|
|
||||||
android:layout_width="match_parent"
|
|
||||||
android:layout_height="107dp"
|
|
||||||
android:layout_marginStart="24dp"
|
|
||||||
android:layout_marginTop="10dp"
|
|
||||||
android:layout_marginEnd="24dp"
|
|
||||||
android:background="@drawable/device_manage_card_bg"
|
|
||||||
android:clickable="true"
|
|
||||||
android:focusable="true"
|
|
||||||
android:orientation="vertical">
|
|
||||||
|
|
||||||
<FrameLayout
|
|
||||||
android:layout_width="match_parent"
|
|
||||||
android:layout_height="50dp">
|
|
||||||
|
|
||||||
<androidx.cardview.widget.CardView
|
|
||||||
android:layout_width="36dp"
|
|
||||||
android:layout_height="36dp"
|
|
||||||
android:layout_marginStart="14dp"
|
|
||||||
android:layout_marginTop="14dp"
|
|
||||||
app:cardBackgroundColor="#F5F5F5"
|
|
||||||
app:cardCornerRadius="18dp"
|
|
||||||
app:cardElevation="0dp"
|
|
||||||
app:cardPreventCornerOverlap="false">
|
|
||||||
|
|
||||||
<ImageView
|
|
||||||
android:layout_width="match_parent"
|
android:layout_width="match_parent"
|
||||||
android:layout_height="match_parent"
|
android:layout_height="match_parent"
|
||||||
android:contentDescription="@null"
|
android:gravity="center"
|
||||||
android:scaleType="centerCrop"
|
android:paddingBottom="60dp"
|
||||||
android:src="@mipmap/ic_launcher" />
|
android:text="@string/user_manage_empty"
|
||||||
</androidx.cardview.widget.CardView>
|
|
||||||
|
|
||||||
<TextView
|
|
||||||
style="@style/HomeText"
|
|
||||||
android:layout_width="wrap_content"
|
|
||||||
android:layout_height="17dp"
|
|
||||||
android:layout_marginStart="60dp"
|
|
||||||
android:layout_marginTop="14dp"
|
|
||||||
android:text="@string/user_sample_name"
|
|
||||||
android:textColor="#222222"
|
|
||||||
android:textSize="14sp"
|
|
||||||
android:textStyle="bold" />
|
|
||||||
|
|
||||||
<ImageView
|
|
||||||
android:layout_width="15dp"
|
|
||||||
android:layout_height="15dp"
|
|
||||||
android:layout_marginStart="60dp"
|
|
||||||
android:layout_marginTop="35dp"
|
|
||||||
android:contentDescription="@null"
|
|
||||||
android:src="@mipmap/icon_user_phone" />
|
|
||||||
|
|
||||||
<TextView
|
|
||||||
style="@style/HomeText"
|
|
||||||
android:layout_width="wrap_content"
|
|
||||||
android:layout_height="15dp"
|
|
||||||
android:layout_marginStart="77dp"
|
|
||||||
android:layout_marginTop="35dp"
|
|
||||||
android:text="@string/user_sample_phone_masked"
|
|
||||||
android:textColor="#999999"
|
android:textColor="#999999"
|
||||||
android:textSize="12sp" />
|
|
||||||
|
|
||||||
<ImageView
|
|
||||||
android:layout_width="22dp"
|
|
||||||
android:layout_height="22dp"
|
|
||||||
android:layout_gravity="end|top"
|
|
||||||
android:layout_marginTop="21dp"
|
|
||||||
android:layout_marginEnd="14dp"
|
|
||||||
android:contentDescription="@null"
|
|
||||||
android:src="@mipmap/icon_user_arrow" />
|
|
||||||
</FrameLayout>
|
|
||||||
|
|
||||||
<View
|
|
||||||
android:layout_width="match_parent"
|
|
||||||
android:layout_height="0.5dp"
|
|
||||||
android:layout_marginStart="14dp"
|
|
||||||
android:layout_marginTop="14dp"
|
|
||||||
android:layout_marginEnd="14dp"
|
|
||||||
android:background="#DDDDDD" />
|
|
||||||
|
|
||||||
<LinearLayout
|
|
||||||
android:layout_width="match_parent"
|
|
||||||
android:layout_height="15dp"
|
|
||||||
android:layout_marginStart="14dp"
|
|
||||||
android:layout_marginTop="13dp"
|
|
||||||
android:layout_marginEnd="14dp"
|
|
||||||
android:gravity="center_vertical"
|
|
||||||
android:orientation="horizontal">
|
|
||||||
|
|
||||||
<ImageView
|
|
||||||
android:layout_width="15dp"
|
|
||||||
android:layout_height="15dp"
|
|
||||||
android:contentDescription="@null"
|
|
||||||
android:src="@mipmap/icon_user_location" />
|
|
||||||
|
|
||||||
<TextView
|
|
||||||
style="@style/HomeText"
|
|
||||||
android:layout_width="wrap_content"
|
|
||||||
android:layout_height="15dp"
|
|
||||||
android:layout_marginStart="2dp"
|
|
||||||
android:text="@string/user_sample_location"
|
|
||||||
android:textColor="#222222"
|
|
||||||
android:textSize="12sp" />
|
|
||||||
|
|
||||||
<Space
|
|
||||||
android:layout_width="0dp"
|
|
||||||
android:layout_height="1dp"
|
|
||||||
android:layout_weight="1" />
|
|
||||||
|
|
||||||
<ImageView
|
|
||||||
android:layout_width="15dp"
|
|
||||||
android:layout_height="15dp"
|
|
||||||
android:contentDescription="@null"
|
|
||||||
android:src="@mipmap/icon_user_clock" />
|
|
||||||
|
|
||||||
<TextView
|
|
||||||
style="@style/HomeText"
|
|
||||||
android:layout_width="wrap_content"
|
|
||||||
android:layout_height="15dp"
|
|
||||||
android:layout_marginStart="4dp"
|
|
||||||
android:text="@string/user_sample_time"
|
|
||||||
android:textColor="#222222"
|
|
||||||
android:textSize="12sp" />
|
|
||||||
</LinearLayout>
|
|
||||||
</LinearLayout>
|
|
||||||
|
|
||||||
<!-- 用户卡片 3 -->
|
|
||||||
<LinearLayout
|
|
||||||
android:id="@+id/card_user_3"
|
|
||||||
android:layout_width="match_parent"
|
|
||||||
android:layout_height="107dp"
|
|
||||||
android:layout_marginStart="24dp"
|
|
||||||
android:layout_marginTop="10dp"
|
|
||||||
android:layout_marginEnd="24dp"
|
|
||||||
android:background="@drawable/device_manage_card_bg"
|
|
||||||
android:clickable="true"
|
|
||||||
android:focusable="true"
|
|
||||||
android:orientation="vertical">
|
|
||||||
|
|
||||||
<FrameLayout
|
|
||||||
android:layout_width="match_parent"
|
|
||||||
android:layout_height="50dp">
|
|
||||||
|
|
||||||
<androidx.cardview.widget.CardView
|
|
||||||
android:layout_width="36dp"
|
|
||||||
android:layout_height="36dp"
|
|
||||||
android:layout_marginStart="14dp"
|
|
||||||
android:layout_marginTop="14dp"
|
|
||||||
app:cardBackgroundColor="#F5F5F5"
|
|
||||||
app:cardCornerRadius="18dp"
|
|
||||||
app:cardElevation="0dp"
|
|
||||||
app:cardPreventCornerOverlap="false">
|
|
||||||
|
|
||||||
<ImageView
|
|
||||||
android:layout_width="match_parent"
|
|
||||||
android:layout_height="match_parent"
|
|
||||||
android:contentDescription="@null"
|
|
||||||
android:scaleType="centerCrop"
|
|
||||||
android:src="@mipmap/ic_launcher" />
|
|
||||||
</androidx.cardview.widget.CardView>
|
|
||||||
|
|
||||||
<TextView
|
|
||||||
style="@style/HomeText"
|
|
||||||
android:layout_width="wrap_content"
|
|
||||||
android:layout_height="17dp"
|
|
||||||
android:layout_marginStart="60dp"
|
|
||||||
android:layout_marginTop="14dp"
|
|
||||||
android:text="@string/user_sample_name"
|
|
||||||
android:textColor="#222222"
|
|
||||||
android:textSize="14sp"
|
android:textSize="14sp"
|
||||||
android:textStyle="bold" />
|
android:visibility="gone" />
|
||||||
|
|
||||||
<ImageView
|
|
||||||
android:layout_width="15dp"
|
|
||||||
android:layout_height="15dp"
|
|
||||||
android:layout_marginStart="60dp"
|
|
||||||
android:layout_marginTop="35dp"
|
|
||||||
android:contentDescription="@null"
|
|
||||||
android:src="@mipmap/icon_user_phone" />
|
|
||||||
|
|
||||||
<TextView
|
|
||||||
style="@style/HomeText"
|
|
||||||
android:layout_width="wrap_content"
|
|
||||||
android:layout_height="15dp"
|
|
||||||
android:layout_marginStart="77dp"
|
|
||||||
android:layout_marginTop="35dp"
|
|
||||||
android:text="@string/user_sample_phone_masked"
|
|
||||||
android:textColor="#999999"
|
|
||||||
android:textSize="12sp" />
|
|
||||||
|
|
||||||
<ImageView
|
|
||||||
android:layout_width="22dp"
|
|
||||||
android:layout_height="22dp"
|
|
||||||
android:layout_gravity="end|top"
|
|
||||||
android:layout_marginTop="21dp"
|
|
||||||
android:layout_marginEnd="14dp"
|
|
||||||
android:contentDescription="@null"
|
|
||||||
android:src="@mipmap/icon_user_arrow" />
|
|
||||||
</FrameLayout>
|
</FrameLayout>
|
||||||
|
|
||||||
<View
|
|
||||||
android:layout_width="match_parent"
|
|
||||||
android:layout_height="0.5dp"
|
|
||||||
android:layout_marginStart="14dp"
|
|
||||||
android:layout_marginTop="14dp"
|
|
||||||
android:layout_marginEnd="14dp"
|
|
||||||
android:background="#DDDDDD" />
|
|
||||||
|
|
||||||
<LinearLayout
|
|
||||||
android:layout_width="match_parent"
|
|
||||||
android:layout_height="15dp"
|
|
||||||
android:layout_marginStart="14dp"
|
|
||||||
android:layout_marginTop="13dp"
|
|
||||||
android:layout_marginEnd="14dp"
|
|
||||||
android:gravity="center_vertical"
|
|
||||||
android:orientation="horizontal">
|
|
||||||
|
|
||||||
<ImageView
|
|
||||||
android:layout_width="15dp"
|
|
||||||
android:layout_height="15dp"
|
|
||||||
android:contentDescription="@null"
|
|
||||||
android:src="@mipmap/icon_user_location" />
|
|
||||||
|
|
||||||
<TextView
|
|
||||||
style="@style/HomeText"
|
|
||||||
android:layout_width="wrap_content"
|
|
||||||
android:layout_height="15dp"
|
|
||||||
android:layout_marginStart="2dp"
|
|
||||||
android:text="@string/user_sample_location"
|
|
||||||
android:textColor="#222222"
|
|
||||||
android:textSize="12sp" />
|
|
||||||
|
|
||||||
<Space
|
|
||||||
android:layout_width="0dp"
|
|
||||||
android:layout_height="1dp"
|
|
||||||
android:layout_weight="1" />
|
|
||||||
|
|
||||||
<ImageView
|
|
||||||
android:layout_width="15dp"
|
|
||||||
android:layout_height="15dp"
|
|
||||||
android:contentDescription="@null"
|
|
||||||
android:src="@mipmap/icon_user_clock" />
|
|
||||||
|
|
||||||
<TextView
|
|
||||||
style="@style/HomeText"
|
|
||||||
android:layout_width="wrap_content"
|
|
||||||
android:layout_height="15dp"
|
|
||||||
android:layout_marginStart="4dp"
|
|
||||||
android:text="@string/user_sample_time"
|
|
||||||
android:textColor="#222222"
|
|
||||||
android:textSize="12sp" />
|
|
||||||
</LinearLayout>
|
|
||||||
</LinearLayout>
|
|
||||||
</LinearLayout>
|
|
||||||
</ScrollView>
|
|
||||||
</LinearLayout>
|
</LinearLayout>
|
||||||
|
|||||||
BIN
app/src/main/res/mipmap-hdpi/icon_home_pickup_verification.png
Normal file
|
After Width: | Height: | Size: 2.9 KiB |
BIN
app/src/main/res/mipmap-hdpi/icon_home_product_inbound.png
Normal file
|
After Width: | Height: | Size: 3.0 KiB |
BIN
app/src/main/res/mipmap-hdpi/icon_home_product_management.png
Normal file
|
After Width: | Height: | Size: 3.7 KiB |
BIN
app/src/main/res/mipmap-hdpi/icon_home_product_outbound.png
Normal file
|
After Width: | Height: | Size: 3.1 KiB |
BIN
app/src/main/res/mipmap-hdpi/icon_home_statistics.png
Normal file
|
After Width: | Height: | Size: 3.7 KiB |
BIN
app/src/main/res/mipmap-mdpi/icon_home_pickup_verification.png
Normal file
|
After Width: | Height: | Size: 1.8 KiB |
BIN
app/src/main/res/mipmap-mdpi/icon_home_product_inbound.png
Normal file
|
After Width: | Height: | Size: 1.9 KiB |
BIN
app/src/main/res/mipmap-mdpi/icon_home_product_management.png
Normal file
|
After Width: | Height: | Size: 2.3 KiB |
BIN
app/src/main/res/mipmap-mdpi/icon_home_product_outbound.png
Normal file
|
After Width: | Height: | Size: 2.0 KiB |
BIN
app/src/main/res/mipmap-mdpi/icon_home_statistics.png
Normal file
|
After Width: | Height: | Size: 2.3 KiB |
|
Before Width: | Height: | Size: 4.3 KiB After Width: | Height: | Size: 4.1 KiB |
|
Before Width: | Height: | Size: 4.2 KiB After Width: | Height: | Size: 4.1 KiB |
|
Before Width: | Height: | Size: 3.8 KiB After Width: | Height: | Size: 5.3 KiB |
BIN
app/src/main/res/mipmap-xhdpi/icon_home_product_outbound.png
Normal file
|
After Width: | Height: | Size: 4.3 KiB |
|
Before Width: | Height: | Size: 5.5 KiB After Width: | Height: | Size: 5.4 KiB |
|
Before Width: | Height: | Size: 6.9 KiB After Width: | Height: | Size: 6.6 KiB |
|
Before Width: | Height: | Size: 6.8 KiB After Width: | Height: | Size: 6.5 KiB |
|
Before Width: | Height: | Size: 6.2 KiB After Width: | Height: | Size: 8.7 KiB |
BIN
app/src/main/res/mipmap-xxhdpi/icon_home_product_outbound.png
Normal file
|
After Width: | Height: | Size: 6.6 KiB |
|
Before Width: | Height: | Size: 8.8 KiB After Width: | Height: | Size: 8.8 KiB |
|
Before Width: | Height: | Size: 4.7 KiB After Width: | Height: | Size: 4.3 KiB |
|
Before Width: | Height: | Size: 4.7 KiB After Width: | Height: | Size: 4.4 KiB |
|
Before Width: | Height: | Size: 4.3 KiB After Width: | Height: | Size: 6.0 KiB |
BIN
app/src/main/res/mipmap-xxxhdpi/icon_home_product_outbound.png
Normal file
|
After Width: | Height: | Size: 4.4 KiB |
|
Before Width: | Height: | Size: 6.4 KiB After Width: | Height: | Size: 6.1 KiB |
@@ -12,6 +12,7 @@
|
|||||||
<string name="home_reduction_unit">kg CO₂e</string>
|
<string name="home_reduction_unit">kg CO₂e</string>
|
||||||
<string name="home_quick_actions">Quick Actions</string>
|
<string name="home_quick_actions">Quick Actions</string>
|
||||||
<string name="home_product_inbound">Product\nInbound</string>
|
<string name="home_product_inbound">Product\nInbound</string>
|
||||||
|
<string name="home_product_outbound">Product\noutbound</string>
|
||||||
<string name="home_product_management">Product\nManagemen</string>
|
<string name="home_product_management">Product\nManagemen</string>
|
||||||
<string name="home_statistics">Data\nStatistics</string>
|
<string name="home_statistics">Data\nStatistics</string>
|
||||||
<string name="home_after_sales">After-Sales\nService</string>
|
<string name="home_after_sales">After-Sales\nService</string>
|
||||||
|
|||||||
@@ -8,6 +8,9 @@
|
|||||||
<string name="message_system_notice">System Notice</string>
|
<string name="message_system_notice">System Notice</string>
|
||||||
<string name="message_yesterday">Yesterday</string>
|
<string name="message_yesterday">Yesterday</string>
|
||||||
<string name="message_maintenance">Platform will undergo system maintenance…</string>
|
<string name="message_maintenance">Platform will undergo system maintenance…</string>
|
||||||
|
<string name="message_loading">Loading…</string>
|
||||||
|
<string name="message_empty">No messages</string>
|
||||||
|
<string name="message_load_failed">Failed to load messages</string>
|
||||||
|
|
||||||
<!-- Personal center -->
|
<!-- Personal center -->
|
||||||
<string name="mine_center_title">Personal Center</string>
|
<string name="mine_center_title">Personal Center</string>
|
||||||
|
|||||||
@@ -14,6 +14,11 @@
|
|||||||
<string name="pickup_stats_this_month">This Month</string>
|
<string name="pickup_stats_this_month">This Month</string>
|
||||||
<string name="pickup_stats_records">Redemption Records</string>
|
<string name="pickup_stats_records">Redemption Records</string>
|
||||||
<string name="pickup_stats_records_count">%1$s records</string>
|
<string name="pickup_stats_records_count">%1$s records</string>
|
||||||
|
<string name="pickup_stats_loading">Loading…</string>
|
||||||
|
<string name="pickup_stats_empty">No redemption records</string>
|
||||||
|
<string name="pickup_stats_load_failed">Failed to load records</string>
|
||||||
|
<string name="pickup_stats_goods">%1$s ×%2$d</string>
|
||||||
|
<string name="pickup_stats_order_points">%1$d points used</string>
|
||||||
<string name="pickup_stats_load_more">Swipe up to load more redemption records</string>
|
<string name="pickup_stats_load_more">Swipe up to load more redemption records</string>
|
||||||
<string name="pickup_stats_export">Export</string>
|
<string name="pickup_stats_export">Export</string>
|
||||||
<string name="pickup_stats_export_unavailable">Export is not connected yet</string>
|
<string name="pickup_stats_export_unavailable">Export is not connected yet</string>
|
||||||
|
|||||||
@@ -15,8 +15,8 @@
|
|||||||
<string name="pickup_user_phone">User Phone</string>
|
<string name="pickup_user_phone">User Phone</string>
|
||||||
<string name="pickup_order_time">Order Time</string>
|
<string name="pickup_order_time">Order Time</string>
|
||||||
<string name="pickup_code_label">Pickup Code</string>
|
<string name="pickup_code_label">Pickup Code</string>
|
||||||
<string name="pickup_confirm_ship">Confirm Verification, Ship</string>
|
<string name="pickup_confirm_verify">Confirm Verification</string>
|
||||||
<string name="pickup_code_incomplete">Please enter the complete 6-digit pickup code</string>
|
<string name="pickup_code_incomplete">Please enter the complete 6-digit pickup code</string>
|
||||||
<string name="pickup_verify_success">Verification completed. Order shipped.</string>
|
<string name="pickup_verify_success">Verification completed.</string>
|
||||||
<string name="pickup_scan_invalid">No valid pickup code was detected</string>
|
<string name="pickup_scan_invalid">No valid pickup code was detected</string>
|
||||||
</resources>
|
</resources>
|
||||||
|
|||||||
@@ -41,4 +41,28 @@
|
|||||||
<string name="product_scan_tip">Align the barcode within the frame to scan</string>
|
<string name="product_scan_tip">Align the barcode within the frame to scan</string>
|
||||||
<string name="product_scan_gallery_failed">No barcode was found in the image.</string>
|
<string name="product_scan_gallery_failed">No barcode was found in the image.</string>
|
||||||
<string name="product_scan_flashlight">Flashlight</string>
|
<string name="product_scan_flashlight">Flashlight</string>
|
||||||
|
|
||||||
|
<!-- Product outbound -->
|
||||||
|
<string name="product_outbound_title">Product Outbound</string>
|
||||||
|
<string name="product_outbound_back">Back</string>
|
||||||
|
<string name="product_outbound_scan_title">Scan to Outbound</string>
|
||||||
|
<string name="product_outbound_scan_tip">Tap to scan the device outer box barcode</string>
|
||||||
|
<string name="product_outbound_manual_entry">Scan failed? Enter SN code manually</string>
|
||||||
|
<string name="product_outbound_pending_title">Pending Outbound Products</string>
|
||||||
|
<string name="product_outbound_total">Total: %1$d</string>
|
||||||
|
<string name="product_outbound_delete">Delete</string>
|
||||||
|
<string name="product_outbound_select">Select</string>
|
||||||
|
<string name="product_outbound_device_sn">Device SN:</string>
|
||||||
|
<string name="product_outbound_badge">In List</string>
|
||||||
|
<string name="product_outbound_submit">Submit Outbound</string>
|
||||||
|
<string name="product_outbound_pickup_code">Pickup Code</string>
|
||||||
|
<string name="product_outbound_pickup_code_hint">Enter the pickup code of the verified order</string>
|
||||||
|
<string name="product_outbound_pickup_code_empty">Please enter the pickup code</string>
|
||||||
|
<string name="product_outbound_added">Added: %1$s</string>
|
||||||
|
<string name="product_outbound_duplicate">This device is already in the pending outbound list</string>
|
||||||
|
<string name="product_outbound_select_delete">Select products to delete first</string>
|
||||||
|
<string name="product_outbound_select_submit">Select products to outbound first</string>
|
||||||
|
<string name="product_outbound_submit_success">Outbound completed.</string>
|
||||||
|
<string name="product_outbound_limit">Up to 200 devices can be submitted at a time</string>
|
||||||
|
<string name="product_outbound_camera_permission_content">Product Outbound uses the camera to scan the device outer box barcode. If you decline, you can still enter the SN code manually.</string>
|
||||||
</resources>
|
</resources>
|
||||||
|
|||||||
@@ -2,13 +2,27 @@
|
|||||||
<resources>
|
<resources>
|
||||||
<string name="user_manage_title">User Management</string>
|
<string name="user_manage_title">User Management</string>
|
||||||
<string name="user_manage_back">Back</string>
|
<string name="user_manage_back">Back</string>
|
||||||
<string name="user_manage_search_hint">Search by SN / Owner / User</string>
|
<string name="user_manage_search_hint">Search by name / phone</string>
|
||||||
<string name="user_manage_search">Search</string>
|
<string name="user_manage_search">Search</string>
|
||||||
<string name="user_manage_search_unavailable">Search is not connected yet</string>
|
<string name="user_manage_search_unavailable">Search is not connected yet</string>
|
||||||
<string name="user_manage_total">%1$s users in total</string>
|
<string name="user_manage_total">%1$s users in total</string>
|
||||||
|
<string name="user_manage_loading">Loading…</string>
|
||||||
|
<string name="user_manage_empty">No users</string>
|
||||||
|
<string name="user_manage_load_failed">Failed to load users</string>
|
||||||
|
<string name="user_manage_devices">Devices: %1$d</string>
|
||||||
|
<string name="user_manage_orders">Orders: %1$d</string>
|
||||||
|
|
||||||
<string name="user_device_title">User Devices</string>
|
<string name="user_device_title">User Devices</string>
|
||||||
<string name="user_device_total">%1$s devices in total</string>
|
<string name="user_device_total">%1$s devices in total</string>
|
||||||
|
<string name="user_device_count">Devices: %1$d</string>
|
||||||
|
<string name="user_device_loading">Loading…</string>
|
||||||
|
<string name="user_device_empty">No devices</string>
|
||||||
|
<string name="user_device_load_failed">Failed to load devices</string>
|
||||||
|
<string name="user_device_held">Held</string>
|
||||||
|
<string name="user_device_returned">Returned</string>
|
||||||
|
<string name="user_device_delivered">Delivered</string>
|
||||||
|
<string name="user_device_order_no">Order No.</string>
|
||||||
|
<string name="user_device_return_no">Return No.</string>
|
||||||
<string name="user_device_activation">Activation Date</string>
|
<string name="user_device_activation">Activation Date</string>
|
||||||
<string name="user_device_runtime">Total Runtime</string>
|
<string name="user_device_runtime">Total Runtime</string>
|
||||||
<string name="user_device_fault_status">Fault Status</string>
|
<string name="user_device_fault_status">Fault Status</string>
|
||||||
|
|||||||
@@ -13,6 +13,7 @@
|
|||||||
<string name="home_reduction_unit">千克 CO₂e</string>
|
<string name="home_reduction_unit">千克 CO₂e</string>
|
||||||
<string name="home_quick_actions">快捷操作</string>
|
<string name="home_quick_actions">快捷操作</string>
|
||||||
<string name="home_product_inbound">商品入库</string>
|
<string name="home_product_inbound">商品入库</string>
|
||||||
|
<string name="home_product_outbound">商品出库</string>
|
||||||
<string name="home_product_management">商品管理</string>
|
<string name="home_product_management">商品管理</string>
|
||||||
<string name="home_statistics">数据统计</string>
|
<string name="home_statistics">数据统计</string>
|
||||||
<string name="home_after_sales">售后服务</string>
|
<string name="home_after_sales">售后服务</string>
|
||||||
|
|||||||
@@ -8,6 +8,9 @@
|
|||||||
<string name="message_system_notice">系统通知</string>
|
<string name="message_system_notice">系统通知</string>
|
||||||
<string name="message_yesterday">昨天</string>
|
<string name="message_yesterday">昨天</string>
|
||||||
<string name="message_maintenance">平台将进行系统维护…</string>
|
<string name="message_maintenance">平台将进行系统维护…</string>
|
||||||
|
<string name="message_loading">加载中…</string>
|
||||||
|
<string name="message_empty">暂无消息</string>
|
||||||
|
<string name="message_load_failed">消息加载失败</string>
|
||||||
|
|
||||||
<!-- 个人中心 -->
|
<!-- 个人中心 -->
|
||||||
<string name="mine_center_title">个人中心</string>
|
<string name="mine_center_title">个人中心</string>
|
||||||
|
|||||||
@@ -14,6 +14,11 @@
|
|||||||
<string name="pickup_stats_this_month">本月</string>
|
<string name="pickup_stats_this_month">本月</string>
|
||||||
<string name="pickup_stats_records">核销记录</string>
|
<string name="pickup_stats_records">核销记录</string>
|
||||||
<string name="pickup_stats_records_count">%1$s 条记录</string>
|
<string name="pickup_stats_records_count">%1$s 条记录</string>
|
||||||
|
<string name="pickup_stats_loading">加载中…</string>
|
||||||
|
<string name="pickup_stats_empty">暂无核销记录</string>
|
||||||
|
<string name="pickup_stats_load_failed">记录加载失败</string>
|
||||||
|
<string name="pickup_stats_goods">%1$s ×%2$d</string>
|
||||||
|
<string name="pickup_stats_order_points">消耗 %1$d 积分</string>
|
||||||
<string name="pickup_stats_load_more">上滑加载更多核销记录</string>
|
<string name="pickup_stats_load_more">上滑加载更多核销记录</string>
|
||||||
<string name="pickup_stats_export">导出</string>
|
<string name="pickup_stats_export">导出</string>
|
||||||
<string name="pickup_stats_export_unavailable">导出功能待接入</string>
|
<string name="pickup_stats_export_unavailable">导出功能待接入</string>
|
||||||
|
|||||||
@@ -15,8 +15,8 @@
|
|||||||
<string name="pickup_user_phone">用户手机号</string>
|
<string name="pickup_user_phone">用户手机号</string>
|
||||||
<string name="pickup_order_time">下单时间</string>
|
<string name="pickup_order_time">下单时间</string>
|
||||||
<string name="pickup_code_label">提货码</string>
|
<string name="pickup_code_label">提货码</string>
|
||||||
<string name="pickup_confirm_ship">确认核销,发货</string>
|
<string name="pickup_confirm_verify">确认核销</string>
|
||||||
<string name="pickup_code_incomplete">请输入完整的 6 位提货码</string>
|
<string name="pickup_code_incomplete">请输入完整的 6 位提货码</string>
|
||||||
<string name="pickup_verify_success">核销成功,已发货</string>
|
<string name="pickup_verify_success">核销成功</string>
|
||||||
<string name="pickup_scan_invalid">未识别到有效的提货码</string>
|
<string name="pickup_scan_invalid">未识别到有效的提货码</string>
|
||||||
</resources>
|
</resources>
|
||||||
|
|||||||
@@ -41,4 +41,28 @@
|
|||||||
<string name="product_scan_tip">将条码放入框内,即可自动识别</string>
|
<string name="product_scan_tip">将条码放入框内,即可自动识别</string>
|
||||||
<string name="product_scan_gallery_failed">未从图片中识别到条码</string>
|
<string name="product_scan_gallery_failed">未从图片中识别到条码</string>
|
||||||
<string name="product_scan_flashlight">手电筒</string>
|
<string name="product_scan_flashlight">手电筒</string>
|
||||||
|
|
||||||
|
<!-- 商品出库 -->
|
||||||
|
<string name="product_outbound_title">商品出库</string>
|
||||||
|
<string name="product_outbound_back">返回</string>
|
||||||
|
<string name="product_outbound_scan_title">扫码出库</string>
|
||||||
|
<string name="product_outbound_scan_tip">点击扫描设备外箱条码</string>
|
||||||
|
<string name="product_outbound_manual_entry">扫码失败?手动输入 SN 码</string>
|
||||||
|
<string name="product_outbound_pending_title">待出库商品</string>
|
||||||
|
<string name="product_outbound_total">合计:%1$d</string>
|
||||||
|
<string name="product_outbound_delete">删除</string>
|
||||||
|
<string name="product_outbound_select">选择</string>
|
||||||
|
<string name="product_outbound_device_sn">设备 SN:</string>
|
||||||
|
<string name="product_outbound_badge">已在列表</string>
|
||||||
|
<string name="product_outbound_submit">提交出库</string>
|
||||||
|
<string name="product_outbound_pickup_code">提货码</string>
|
||||||
|
<string name="product_outbound_pickup_code_hint">请输入已核销订单的提货码</string>
|
||||||
|
<string name="product_outbound_pickup_code_empty">请输入提货码</string>
|
||||||
|
<string name="product_outbound_added">已添加:%1$s</string>
|
||||||
|
<string name="product_outbound_duplicate">该设备已在待出库列表</string>
|
||||||
|
<string name="product_outbound_select_delete">请先选择要删除的设备</string>
|
||||||
|
<string name="product_outbound_select_submit">请先勾选要出库的设备</string>
|
||||||
|
<string name="product_outbound_submit_success">出库成功</string>
|
||||||
|
<string name="product_outbound_limit">一次最多提交 200 台设备</string>
|
||||||
|
<string name="product_outbound_camera_permission_content">商品出库需要使用相机扫描设备外箱条码。拒绝或取消授权不影响手动输入 SN 码。</string>
|
||||||
</resources>
|
</resources>
|
||||||
|
|||||||
@@ -2,13 +2,27 @@
|
|||||||
<resources>
|
<resources>
|
||||||
<string name="user_manage_title">用户管理</string>
|
<string name="user_manage_title">用户管理</string>
|
||||||
<string name="user_manage_back">返回</string>
|
<string name="user_manage_back">返回</string>
|
||||||
<string name="user_manage_search_hint">按 SN / 机主 / 用户搜索</string>
|
<string name="user_manage_search_hint">按姓名 / 手机号搜索</string>
|
||||||
<string name="user_manage_search">搜索</string>
|
<string name="user_manage_search">搜索</string>
|
||||||
<string name="user_manage_search_unavailable">搜索功能待接入</string>
|
<string name="user_manage_search_unavailable">搜索功能待接入</string>
|
||||||
<string name="user_manage_total">共 %1$s 位用户</string>
|
<string name="user_manage_total">共 %1$s 位用户</string>
|
||||||
|
<string name="user_manage_loading">加载中…</string>
|
||||||
|
<string name="user_manage_empty">暂无用户</string>
|
||||||
|
<string name="user_manage_load_failed">用户加载失败</string>
|
||||||
|
<string name="user_manage_devices">设备 %1$d 台</string>
|
||||||
|
<string name="user_manage_orders">订单 %1$d 笔</string>
|
||||||
|
|
||||||
<string name="user_device_title">用户设备列表</string>
|
<string name="user_device_title">用户设备列表</string>
|
||||||
<string name="user_device_total">共 %1$s 台设备</string>
|
<string name="user_device_total">共 %1$s 台设备</string>
|
||||||
|
<string name="user_device_count">设备 %1$d 台</string>
|
||||||
|
<string name="user_device_loading">加载中…</string>
|
||||||
|
<string name="user_device_empty">暂无设备</string>
|
||||||
|
<string name="user_device_load_failed">设备加载失败</string>
|
||||||
|
<string name="user_device_held">持有中</string>
|
||||||
|
<string name="user_device_returned">已退回</string>
|
||||||
|
<string name="user_device_delivered">交付时间</string>
|
||||||
|
<string name="user_device_order_no">订单号</string>
|
||||||
|
<string name="user_device_return_no">退回单号</string>
|
||||||
<string name="user_device_activation">激活日期</string>
|
<string name="user_device_activation">激活日期</string>
|
||||||
<string name="user_device_runtime">累计运行时长</string>
|
<string name="user_device_runtime">累计运行时长</string>
|
||||||
<string name="user_device_fault_status">故障状态</string>
|
<string name="user_device_fault_status">故障状态</string>
|
||||||
|
|||||||