Compare commits

...

3 Commits

Author SHA1 Message Date
49f11ef8e6 fix: 进港移库归属更正——删除误建IntImpMove,重新适配到国内进港DomImpMove
设计稿11「进港移库」经确认归属国内进港移库(DomImpMove后端8接口齐全),
此前误判为国际进港并预接了不存在的IntImpMove模块(问题清单#31作废)。

- 删除module_gjj的IntImpMove全套实现(3页面+Bean+Api+菜单+路由+权限串)
- GnjMoveStashListActivity双形态适配:待移库/已移库Tab走search/searchMoved
  双端点,Tab角标、筛选弹层4项、全选/批量移库复用平板既有链路
- 新增手机专属页:运单详情(Intent传bean零请求)+拍照上传(detail回填
  已有照片,modify最小体三字段提交,与平板移交编辑页同链路)
- 手机首页入口改挂国内Tab(GnViewModel补通用route跳转,权限串AppDomImpMove)
- 内网真实数据双端验证通过;Proxyman A/B:wbNo/awbType生效,
  fdate/fno/spCode被后端静默忽略(#32)、opId/opDate恒null(#33)
- 问题清单更正#31+新增#32~#34,CLAUDE.md/CHANGELOG/api-doc.md同步

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
2026-08-03 12:17:10 +08:00
eb0655d3fc fix: 11模块设计稿全量走查修正——时间线状态pill/手机短标题/ULD字段顺序/计重卡片图标
设计稿逐态渲染对照走查(01~11 全模块)后的修正:
- 运单追踪竖排时间线为已发生节点补状态pill(绿底展示该环节日志content,超长省略)
- 11 页手机端标题按设计稿改短标题(DeviceUtil.isPhone 分支,平板长标题零变化):
  出库交接/出港待计重/计重记录/计重明细/开始计重/出港运抵/出港移库/出港查询/
  出港货物/进港查询/进港货物
- ULD 编辑表单「来源」移至「所在港」之后(设计稿顺序)
- 出港计重列表卡片与计重记录卡片补字段小图标(airplane/location/person/tag)

接口缺口台账复核:#31 进港移库整模块缺失成立(api-doc 全模块清单+报价单双重印证);
#19 修正定性——IntExpArrive/declare 入参已含收发货人全套字段,改登记为待确认提交口径;
#10 成立(单条 deleteUld 在、批量无)。

双端抽验:手机短标题三页生效(出港待计重/出库交接/进港货物),平板保持长标题,零崩溃。

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
2026-07-31 23:12:14 +08:00
a33776d959 feat: 完成进港查询与进港移库页面5.5寸手机端适配(设计稿11页全部完成)
进港查询(10,06出港查询的进港镜像):
- IntImpQueryActivity 手机布局:搜索行 + 三格统计(总票数/已入库/已出库客户端计数)
  + 状态标签卡片(dlvTime/inDate 前端推断)+ 筛选弹层9项(入参全部经api-doc核对存在)
- 详情页与运单追踪复用08/06已适配页零新增;平板侧滑筛选面板判空守卫,Pad端零变化
- 修复代理人空值兜底:转换器将JSON null归一为空串致DataBinding `??` 失效,
  改用Bean计算属性 agentDisplay(06出港查询同步修正)

进港移库(11,首个后端整模块缺失的设计稿页):
- 全新手机专属3页:列表(双Tab+角标/筛选4项/多选批量移库/卡片长按拍照浮层)
  + 运单详情(三卡片,Intent传bean零请求)+ 拍照上传(复用ImageSelectNewViewHolder,
  pic/originalPic/picNumber三字段规范)
- 后端无IntImpMove模块(api-doc核对),按IntExpMove同名约定预接四接口
  + 预定义权限串AppIntImpMove,后端交付后前端零改动生效(缺口#31)

其他:手机首页国际Tab新增进港查询/进港移库入口;新增资源bg_phone_btn_green/
bg_phone_card_header_orange/bg_phone_photo_add/phone_amber;问题清单登记#30~#31;
双端模拟器验证零崩溃(手机Map Local mock全交互链路,平板回归零变化)

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
2026-07-31 22:35:56 +08:00
55 changed files with 4245 additions and 1926 deletions

View File

@@ -109,6 +109,28 @@ curl -s -X POST "$URL" -H "$AUTH" -H "Content-Type: application/json" \
运单号筛选参数名是 **`no`**(平板既有口径);`chargeName`/`chargeTime` = 柜台办理人/缴费(提取)时间, 运单号筛选参数名是 **`no`**(平板既有口径);`chargeName`/`chargeTime` = 柜台办理人/缴费(提取)时间,
`dlvTime` = 出库时间,`dlvName` 按提货人语义推断作「出库人」展示(待确认 #29 `dlvTime` = 出库时间,`dlvName` 按提货人语义推断作「出库人」展示(待确认 #29
确认出库接口 `pickUpOut` 文档注明**需将全字段传至后端**(平板 `selectedItems.toRequestBody()` 已满足) 确认出库接口 `pickUpOut` 文档注明**需将全字段传至后端**(平板 `selectedItems.toRequestBody()` 已满足)
- `IntImpSearch`进港查询2026-07-31 文档核对):`pageQuery`/`pageQueryTotal` 分页参数名是
**`page`/`limit`**(不是 pageNum/pageSize手机筛选 9 项入参全部真实存在:`beginDate`/`endDate`/
`fno`/`agentCode`/`spCode`/`origin`(始发站)/`awbType`/`businessType`/`goods`(品名,**不是 goodsCn**
`outState`0 未出库/1 已出库)文档为 integer前端传字符串靠 Jackson 隐式转换;`pageQueryTotal`
出参无已入库/已出库分项计数(缺口 #30手机三格统计为客户端计数口径dlvTime 非空=已出库、
inDate 非空=已入库);出参含 `agentName`(中文名)+ `agentCode`agentName 可为 null
- 「进港移库」(设计稿 11**归属更正2026-08-03 用户确认):属国内进港移库 `DomImpMove`**
不是国际进港移库——「后端模块缺失」的旧结论(原缺口 #31)作废,原按 IntExpMove 约定预接的
IntImpMove 前端实现已整体删除。溯源api-doc 53 模块中移库仅 `DomImpMove`国内进港8 接口)与
`IntExpMove`国际出港4 接口移库按转关业务前缀划分DomImpMove 处理 `CI**`、IntExpMove
处理 `IO**`),设计稿详情卡的「国际进港」红标签实为 `awbType` 值(如「国际进港(国内中转)」),
不代表页面归属
- `DomImpMove`国内进港移库2026-08-03 内网实测):手机 Tab 双端点——待移库 `search` /
已移库 `searchMoved`(同一套入参 schema分页参数名 **`page`/`limit`**);入参 A/B 实测:
**`wbNo``awbType`(值为 CICO/CIII/CIIO 转关码)过滤生效;`fdate`/`fno`/`spCode` 文档有定义但
被静默忽略**(缺口 #32`searchMoved`/`detail` 出参 **`opId`/`opDate` 恒 null** 且无操作人姓名
字段(缺口 #33,移库人/移库时间显示"-"`moveId` 形如 `CICO240617155016` 疑似内嵌移库时间戳但无
文档语义;`searchMoved` 出参**无 pic 三字段**search 有)——拍照上传页统一先调 `GET detail`
回填已有照片(#34 前端已规避);照片提交走 `modify` 最小体
`{mawbId, remark, picNumber, pic, originalPic}`平板移交编辑页同链路removeEmptyOrNull
批量移库 `move` 入参 `{fid:"0", ids:[mawbId]}`;国内进港特码字典
`DictUtils.getSpecialCodeList(flag=0, ieFlag="I")` 实测取数正常
- `IntExpCheckIn`出港计重2026-07-29 内网实测):`likeNo` **并非任意模糊**——按 8 位 `no` - `IntExpCheckIn`出港计重2026-07-29 内网实测):`likeNo` **并非任意模糊**——按 8 位 `no`
匹配11 位 wbNo 或部分号均 0 条11 位全号必须走 `wbNo``checkIn`/`checkInList` 匹配11 位 wbNo 或部分号均 0 条11 位全号必须走 `wbNo``checkIn`/`checkInList`
文档有定义但 `pageQuery`/`pageQueryTotal` **均静默忽略**(缺口 #12,待计重/计重中计数依赖); 文档有定义但 `pageQuery`/`pageQueryTotal` **均静默忽略**(缺口 #12,待计重/计重中计数依赖);

View File

@@ -7,7 +7,72 @@
## [Unreleased] ## [Unreleased]
### 变更 (Changed)
- 【进港移库归属更正 · 2026-08-03】设计稿 11「进港移库」经确认归属**国内进港移库
DomImpMove后端 8 接口齐全Pad 首页「国内进港→进港移库」既有页面)**,此前误判为
国际进港并按 IntExpMove 约定预接不存在的 IntImpMove 模块(原问题清单 #31 作废)。处置:
① 删除 module_gjj 的 IntImpMove 全套前端实现3 Activity + 3 ViewModel + Holder + 4 布局 +
`IntImpMoveBean` + Api 4 方法 + 国际 Tab 菜单项 + 权限串/路由/双 Manifest 注册);
② 按 phone-adapt 流程重新适配到 `GnjMoveStashListActivity`app 模块):主列表双形态
Pad 布局移 layout-sw600dp 零改动;手机版 = PhoneSearchBar + 待移库/已移库 Tab
`DomImpMove/search`/`searchMoved` 双端点,`searchMoved` 无移库标识按端点打 `isMoved`+
角标(双端点 limit=1 取 total仅手机发起+ 筛选弹层 4 项 + 全选/已选计数 + 批量移库
(复用平板 `move` 链路)+ 卡片长按「拍照」浮层);新增手机专属页
`GnjMoveStashDetailActivity`Intent 传 bean 零请求,三卡片)与
`GnjMoveStashPhotoActivity`(先调 `detail` 回填已有照片,提交走 `modify` 最小体
三字段规范,与平板移交编辑页同链路);`MoveStashBean``agentName`/`isMoved`/
`actionMenuVisible`/`agentDisplay`/`orDash`;手机首页入口改挂**国内 Tab**`GnViewModel`
补通用 route 跳转,权限串 `GnjYiKu=AppDomImpMove` 与 Pad 一致,新路由
`/app/GnjMoveStashListActivity`)。
2026-08-03 内网真实数据双端验证通过(登录→国内 Tab→列表/Tab/详情/筛选/全选/长按拍照全链路
crash=0平板回归原行为零变化Proxyman A/B`wbNo`/`awbType` 过滤生效,
`fdate`/`fno`/`spCode` 被后端静默忽略(新缺口 #32)、`searchMoved`/`detail` 出参
`opId`/`opDate` 恒 null 且无姓名字段(#33)、`searchMoved` 无 pic 三字段(#34,前端已规避)
### 新增 (Added) ### 新增 (Added)
- 「进港查询」5.5 寸手机端适配(设计稿 10_进港查询06 出港查询的进港镜像;详情页与运单追踪
复用 08/06 已适配页零新增):列表 `IntImpQueryActivity`module_gjj首页菜单实际跳转页
旧版 `GjjQueryListActivity` 路由已注释弃用)手机布局 = PhoneSearchBar运单号+扫码+筛选)+
三格统计(总票数/已入库/已出库,已入库/已出库为已加载数据客户端计数,`pageQueryTotal` 无分项
出参,缺口 #30+ 状态标签卡片(前端推断:`dlvTime` 非空=已出库绿 / `inDate` 非空=已入库橙 /
兜底未入库灰)+ 卡片字段件数(inPc)/重量(inWeight)/代理人/特码;筛选弹层 9 项
(航班日期起止/航班号/代理/特码/始发站/运单类型/业务类型/品名中,**全部经 api-doc 核对为
pageQuery 真实入参**无缺口平板侧滑筛选面板代码判空守卫Pad 端行为零变化
- 「进港移库」5.5 寸手机端全新页面(设计稿 11_进港移库**首个后端整模块缺失的适配页**
api-doc 确认无 IntImpMove 模块、权限体系无对应 key缺口 #31
`IntImpMoveActivity`(待移库/已移库 Tab + 角标、搜索/扫码、筛选弹层 4 项(航班日期/航班号/
特码/运单类型)、多选 + 全选 + 批量移库ConfirmDialogModel 确认)、卡片长按浮层「拍照」)+
`IntImpMoveDetailActivity`(运单详情三卡片:蓝头基本信息/绿头移库信息(仅已移库)/橙头异常照片,
Intent 传 bean 零请求)+ `IntImpMovePhotoActivity`(拍照上传:图片网格复用 module_base
`ImageSelectNewViewHolder`,提交走 pic/originalPic/picNumber 三字段规范);
接口按 IntExpMove 同名约定预接四个pageQuery/pageQueryTotal/move/uploadPic权限串
`AppIntImpMove` 预定义后端交付后前端零改动生效权限串下发前手机首页无入口debug 直启验证)
- 新增 `IntImpMoveBean`(镜像 GjcMove + 航班/照片字段 + isMoved/flightInfo/orDash 计算属性);
`IntImpQueryBean` 新增 isQueryOutbound/isQueryStored/orDash/agentDisplay 计算属性;
手机首页「国际」Tab 增加「进港查询」(图标 gjj_query_icon与「进港移库」图标复用
gjc_yi_ku_icon入口
- 新增手机版资源:`bg_phone_btn_green`(绿色主按钮)、`bg_phone_card_header_orange`(橙色详情卡
表头)、`bg_phone_photo_add`(虚线加号槽位)、色值 `phone_amber`
### 修复 (Fixed)
- 【11 模块全量设计稿走查】修正 4 类差异2026-07-313 个并行审计 + 逐态渲染比对):
① 运单追踪手机竖排时间线补齐已发生节点的状态 pill绿底标签展示该环节日志 content
如「放行状态01」超长省略设计稿 06/08 运单追踪均有此元素);
② 11 个页面手机端标题对齐设计稿短标题(出库交接/出港待计重/计重记录/计重明细/开始计重/
出港运抵/出港移库/出港查询/出港货物/进港查询/进港货物),平板保持原长标题零变化;
③ ULD 编辑表单「来源」字段移至「所在港」之后(设计稿顺序);
④ 出港计重列表卡片(日期/航程/代理/特码)与计重记录卡片(代理)补齐字段小图标
(复用 ic_phone_airplane/location/person/tag与其余模块卡片风格统一
- 出港查询/进港查询卡片「代理人」空值兜底失效:转换器把 JSON null 归一成空串DataBinding
`??` 只判 null 不判空串导致 agentCode 回退永不生效;改用 Bean 计算属性 `agentDisplay`
isNullOrEmpty 双兜底),已同步修正 06 出港查询(`item_gjc_query.xml`
### 验证 (Verified)
- 进港查询手机端Map Local mock 验证三格统计计数、三种状态标签、空值 "--" 兜底、筛选弹层
9 项收缩滚动;平板端回归横排搜索条/侧滑筛选面板/底部统计栏零变化;全程崩溃数 0
- 进港移库手机端Map Local mock 验证双 Tab 角标、双形态卡片、单选/全选联动计数、空选拦截、
移库确认弹框、长按拍照浮层、运单详情、拍照上传页;全程崩溃数 0后端模块缺失接口联调待
后端交付,见问题清单 #31
- 「提取出库」5.5 寸手机端适配(设计稿 09_提取出库列表 `IntImpPickUpDLVActivity`module_gjj - 「提取出库」5.5 寸手机端适配(设计稿 09_提取出库列表 `IntImpPickUpDLVActivity`module_gjj
手机布局 = PhoneSearchBar运单号+扫码+筛选)+ **PhoneStatusTab 待出库/已出库**`outState` 手机布局 = PhoneSearchBar运单号+扫码+筛选)+ **PhoneStatusTab 待出库/已出库**`outState`
为 pageQuery 文档定义入参 0/1Tab 真实过滤 + 角标双 pageQueryTotal抓包证实携带+ 为 pageQuery 文档定义入参 0/1Tab 真实过滤 + 角标双 pageQueryTotal抓包证实携带+

View File

@@ -1066,6 +1066,8 @@ DataBinding 适配器统一放在 `PhoneWidgetKtx.kt`(同名属性按控件类
9 个筛选项曾把「重置/确认」挤出屏幕)。 9 个筛选项曾把「重置/确认」挤出屏幕)。
出港仓库追加:`bg_phone_btn_disabled`(灰底禁用按钮,与 `bg_phone_btn_weak` 同 10dp 圆角, 出港仓库追加:`bg_phone_btn_disabled`(灰底禁用按钮,与 `bg_phone_btn_weak` 同 10dp 圆角,
卡片操作按钮禁用态配 `phone_tag_gray_text` 文字)。 卡片操作按钮禁用态配 `phone_tag_gray_text` 文字)。
进港移库追加:`bg_phone_btn_green`(绿色主按钮,拍照上传「确认提交」)、`bg_phone_card_header_orange`
(橙色详情卡表头,异常照片)、`bg_phone_photo_add`(虚线加号槽位)、色值 `phone_amber`
⚠️ **弹层与浮动按钮的层级**`PhoneFilterPanel` 默认无 elevation页面里有带 elevation 的浮动按钮FAB ⚠️ **弹层与浮动按钮的层级**`PhoneFilterPanel` 默认无 elevation页面里有带 elevation 的浮动按钮FAB
会穿透到弹层之上——给弹层实例加 `android:elevation="8dp"`(大于 FAB 的 6dp 会穿透到弹层之上——给弹层实例加 `android:elevation="8dp"`(大于 FAB 的 6dp
@@ -1141,6 +1143,28 @@ override fun dispatchRestoreInstanceState(container: SparseArray<Parcelable>) =
缺口 #28:无 fdate 入参、出参无车牌(提货车辆)/目的港/业务类型。 缺口 #28:无 fdate 入参、出参无车牌(提货车辆)/目的港/业务类型。
⚠️ 踩坑:`checkAllClick` 全选后底部「已选 N 项」不更新——批量勾选不走 FlowBus 单卡事件, ⚠️ 踩坑:`checkAllClick` 全选后底部「已选 N 项」不更新——批量勾选不走 FlowBus 单卡事件,
必须在 checkAllClick 里同步 selectedCountText 必须在 checkAllClick 里同步 selectedCountText
- 「进港查询」`IntImpQueryActivity`module_gjj06 出港查询的进港镜像:三格统计
总票数/已入库/已出库为已加载数据客户端计数(`pageQueryTotal` 无分项出参,缺口 #30
卡片状态前端推断:`dlvTime` 非空=已出库(绿)/`inDate` 非空=已入库(橙)/兜底未入库(灰)
筛选弹层 9 项**入参全部经 api-doc 核对真实存在**(分页参数名 `page`/`limit`,品名参数名
`goods`);详情页与运单追踪复用 08/06 已适配页零新增;平板侧滑筛选面板代码已判空守卫。
⚠️ 踩坑:代理人绑定不能写 `bean.agentName ?? bean.agentCode`——转换器把 JSON null 归一成
空串,`??` 只判 null 不判空串,须用 Bean 计算属性 `agentDisplay`06 出港查询同步修正))
- 「进港移库」`GnjMoveStashListActivity`app 模块,**2026-08-03 归属更正后重做**:设计稿 11
实际归属**国内进港移库 DomImpMove**(后端 8 接口齐全、Pad 首页「国内进港→进港移库」既有页面),
最初误判为国际进港并按 IntExpMove 约定预接了不存在的 IntImpMove 模块(原缺口 #31),该套
module_gjj 前端实现已整体删除。现行实现主列表双形态Pad 布局移 layout-sw600dp 零改动),
待移库/已移库 Tab 走 **`search`/`searchMoved` 双端点**`searchMoved` 出参无移库标识,前端按
端点给 bean 打 `isMoved`Tab 角标 = 两端点各调一次 limit=1 取分页 total`initPhoneExtras`
开关,仅手机发起);手机专属新页 `GnjMoveStashDetailActivity`Intent 传 bean 零请求,三卡片:
基本信息/移库信息(仅已移库)/异常照片)+ `GnjMoveStashPhotoActivity`(进入先调 `detail` 回填
已有照片——`searchMoved` 出参无 pic 三字段 #34,提交走 **`modify` 最小体**
`{mawbId,remark,picNumber,pic,originalPic}`,与平板移交编辑页同链路);批量移库复用平板
`moveStashClick``move`fid+ids。手机首页入口在**国内 Tab**`GnViewModel`,权限串
`GnjYiKu=AppDomImpMove`,需补通用 route 跳转逻辑,图标从 module_gnj 复制);
GnjMoveStashListActivity 补 @Route `/app/GnjMoveStashListActivity`
2026-08-03 内网真实数据双端验证通过;筛选 A/B`wbNo`/`awbType` 生效,
`fdate`/`fno`/`spCode` 被后端静默忽略(#32)、`opId`/`opDate` 恒 null#33
- 「进港仓库」`IntImpStorageUseActivity`module_gjj07 出港仓库的进港镜像;**首页菜单实际跳转页, - 「进港仓库」`IntImpStorageUseActivity`module_gjj07 出港仓库的进港镜像;**首页菜单实际跳转页,
旧版 `GjjWareHouseActivity` 路由已注释弃用**。差异:卡片/筛选用始发站fdep 入参)替代目的站; 旧版 `GjjWareHouseActivity` 路由已注释弃用**。差异:卡片/筛选用始发站fdep 入参)替代目的站;
搜索框「运单号/航班号」分流含字母→fno、其余→wbNo抓包证实筛选 5 项无入参(缺口 #25 搜索框「运单号/航班号」分流含字母→fno、其余→wbNo抓包证实筛选 5 项无入参(缺口 #25
@@ -1165,8 +1189,11 @@ override fun dispatchRestoreInstanceState(container: SparseArray<Parcelable>) =
双变体首例:手机竖排时间线由 Activity `buildVerticalSteps` 动态构建,平板横向步骤条不动; 双变体首例:手机竖排时间线由 Activity `buildVerticalSteps` 动态构建,平板横向步骤条不动;
手机标题按形态切「运单追踪」)。平板侧滑筛选面板代码已判空守卫(手机变体无 filter_panel 手机标题按形态切「运单追踪」)。平板侧滑筛选面板代码已判空守卫(手机变体无 filter_panel
includeBinding 字段为 @Nullable includeBinding 字段为 @Nullable
-**设计稿 11 个入口01~11已于 2026-07-31 全部适配完成**
-**待办** -**待办**
- `PhoneSearchBar` 接入 AutoQuery 联想(`AutoQueryManager` 目前只对接了 Pad 系组件) - `PhoneSearchBar` 接入 AutoQuery 联想(`AutoQueryManager` 目前只对接了 Pad 系组件)
- 进港移库筛选三项(航班日期/航班号/特码)待后端实装 `fdate`/`fno`/`spCode` 入参(缺口 #32)、
移库人/移库时间待后端回填 `opId`/`opDate` 并补姓名出参(缺口 #33)后自动生效
- 出库交接 Tab 角标恒 0`IntExpOutHandover/pageQueryTotal` 出参恒 0后端缺陷问题清单 #6 - 出库交接 Tab 角标恒 0`IntExpOutHandover/pageQueryTotal` 出参恒 0后端缺陷问题清单 #6
后端修复后角标自动恢复(`handoverState` 过滤本身已于 2026-07-29 实机验证通过)生效 后端修复后角标自动恢复(`handoverState` 过滤本身已于 2026-07-29 实机验证通过)生效
- 📋 **接口对接**:适配中发现的后端接口缺口统一记录在 `documents/后端接口对接问题清单.xlsx` - 📋 **接口对接**:适配中发现的后端接口缺口统一记录在 `documents/后端接口对接问题清单.xlsx`
@@ -1261,6 +1288,7 @@ adb shell am start -n com.lukouguoji.aerologic/com.lukouguoji.gjc.activity.IntEx
| 通过 `Intent.putExtra(Serializable)` 传递的 Bean切换其 `checked`/`showMore` 等状态时崩溃 `NullPointerException: ... on a null object reference` | 这些字段标了 `@Transient`= JVM `transient`,本意是避免 Gson 网络请求序列化 `ObservableBoolean`),但 Java 对象序列化Intent 传递走的机制)会跳过 `transient` 字段的恢复,反序列化后是 null | 接收方 `initOnCreated` 里对列表做 `.map { it.copy() }`——`.copy()` 会重新走一遍类体初始化逻辑,用全新 `ObservableBoolean(false)` 补上 | | 通过 `Intent.putExtra(Serializable)` 传递的 Bean切换其 `checked`/`showMore` 等状态时崩溃 `NullPointerException: ... on a null object reference` | 这些字段标了 `@Transient`= JVM `transient`,本意是避免 Gson 网络请求序列化 `ObservableBoolean`),但 Java 对象序列化Intent 传递走的机制)会跳过 `transient` 字段的恢复,反序列化后是 null | 接收方 `initOnCreated` 里对列表做 `.map { it.copy() }`——`.copy()` 会重新走一遍类体初始化逻辑,用全新 `ObservableBoolean(false)` 补上 |
| 布局构建报 `Error: The string "--" is not permitted within comments` | XML 注释中出现连续双横线(如写"兜底 \"--\""XML 规范禁止 | 注释里改用文字描述(如「兜底双横线」),代码绑定表达式中的 `"--"` 不受影响 | | 布局构建报 `Error: The string "--" is not permitted within comments` | XML 注释中出现连续双横线(如写"兜底 \"--\""XML 规范禁止 | 注释里改用文字描述(如「兜底双横线」),代码绑定表达式中的 `"--"` 不受影响 |
| 多选页手机版点「全选」后底部「已选 N 项」不更新(单卡勾选正常) | 批量勾选在 `checkAllClick` 里直接 set不走 FlowBus 的单卡 EVENT_CHECK_CHANGED 事件,`selectedCountText` 只在事件回调里更新 | `checkAllClick` 末尾自行同步 `selectedCountText`(平板布局不绑定该字段,无影响) | | 多选页手机版点「全选」后底部「已选 N 项」不更新(单卡勾选正常) | 批量勾选在 `checkAllClick` 里直接 set不走 FlowBus 的单卡 EVENT_CHECK_CHANGED 事件,`selectedCountText` 只在事件回调里更新 | `checkAllClick` 末尾自行同步 `selectedCountText`(平板布局不绑定该字段,无影响) |
| XML 里 `bean.a ?? bean.b` 兜底不生效,字段明明有值却显示占位符 | 网络层转换器把 JSON null 归一成空串 `""`DataBinding 的 `??` 只判 null 不判空串,永远取到左侧的空串 | 在 Bean 上加计算属性做 `isNullOrEmpty` 双兜底(如 `agentDisplay`XML 绑计算属性(进港查询/出港查询代理人已踩过) |
--- ---

View File

@@ -152,5 +152,29 @@
android:exported="true" android:exported="true"
tools:replace="android:exported" /> tools:replace="android:exported" />
<!-- 进港查询(手机版适配验证页) -->
<activity
android:name="com.lukouguoji.gjj.activity.IntImpQueryActivity"
android:exported="true"
tools:replace="android:exported" />
<!-- 进港移库(国内进港,手机版适配验证页) -->
<activity
android:name="com.lukouguoji.aerologic.page.gnj.move.stash.list.GnjMoveStashListActivity"
android:exported="true"
tools:replace="android:exported" />
<!-- 进港移库-运单详情(手机版专属页) -->
<activity
android:name="com.lukouguoji.aerologic.page.gnj.move.stash.detail.GnjMoveStashDetailActivity"
android:exported="true"
tools:replace="android:exported" />
<!-- 进港移库-拍照上传(手机版专属页) -->
<activity
android:name="com.lukouguoji.aerologic.page.gnj.move.stash.photo.GnjMoveStashPhotoActivity"
android:exported="true"
tools:replace="android:exported" />
</application> </application>
</manifest> </manifest>

View File

@@ -375,6 +375,20 @@
android:name=".page.gnj.move.stash.list.GnjMoveStashListActivity" android:name=".page.gnj.move.stash.list.GnjMoveStashListActivity"
android:configChanges="orientation|keyboardHidden" android:configChanges="orientation|keyboardHidden"
android:screenOrientation="unspecified" /> android:screenOrientation="unspecified" />
<!-- 国内进港移库-运单详情5.5寸手机版专属) -->
<activity
android:name=".page.gnj.move.stash.detail.GnjMoveStashDetailActivity"
android:configChanges="orientation|keyboardHidden"
android:exported="false"
android:screenOrientation="unspecified" />
<!-- 国内进港移库-拍照上传5.5寸手机版专属) -->
<activity
android:name=".page.gnj.move.stash.photo.GnjMoveStashPhotoActivity"
android:configChanges="orientation|keyboardHidden"
android:exported="false"
android:screenOrientation="unspecified" />
<activity <activity
android:name=".page.gnj.stash.list.GnjStashListActivity" android:name=".page.gnj.stash.list.GnjStashListActivity"
android:configChanges="orientation|keyboardHidden" android:configChanges="orientation|keyboardHidden"

View File

@@ -0,0 +1,49 @@
package com.lukouguoji.aerologic.page.gnj.move.stash.detail
import android.content.Context
import android.content.Intent
import android.os.Bundle
import com.google.gson.Gson
import com.lukouguoji.aerologic.R
import com.lukouguoji.aerologic.databinding.ActivityGnjMoveStashDetailBinding
import com.lukouguoji.aerologic.page.gnj.move.stash.photo.GnjMoveStashPhotoActivity
import com.lukouguoji.module_base.base.BaseBindingActivity
import com.lukouguoji.module_base.bean.MoveStashBean
import com.lukouguoji.module_base.common.Constant
/**
* 国内进港移库「运单详情」5.5 寸手持端专属页面,无平板变体)
*
* 由列表卡片的「查看详情」进入;「异常照片」卡片的加号槽位跳拍照上传页。
* 展示字段全部由列表项带入Gson JSON零新增请求。
*/
class GnjMoveStashDetailActivity :
BaseBindingActivity<ActivityGnjMoveStashDetailBinding, GnjMoveStashDetailViewModel>() {
override fun layoutId() = R.layout.activity_gnj_move_stash_detail
override fun viewModelClass() = GnjMoveStashDetailViewModel::class.java
override fun initOnCreate(savedInstanceState: Bundle?) {
setBackArrow("运单详情")
binding.viewModel = viewModel
binding.activity = this
viewModel.initOnCreated(intent)
}
/** 「异常照片」加号槽位 → 拍照上传页 */
fun openPhoto() {
viewModel.dataBean.value?.let {
GnjMoveStashPhotoActivity.start(this, it.mawbId, it.wbNo)
}
}
companion object {
@JvmStatic
fun start(context: Context, bean: MoveStashBean) {
context.startActivity(
Intent(context, GnjMoveStashDetailActivity::class.java)
.putExtra(Constant.Key.DATA, Gson().toJson(bean))
)
}
}
}

View File

@@ -0,0 +1,25 @@
package com.lukouguoji.aerologic.page.gnj.move.stash.detail
import android.content.Intent
import androidx.lifecycle.MutableLiveData
import com.google.gson.Gson
import com.lukouguoji.module_base.base.BaseViewModel
import com.lukouguoji.module_base.bean.MoveStashBean
import com.lukouguoji.module_base.common.Constant
/**
* 国内进港移库「运单详情」ViewModel5.5 寸手持端专属页面)
*
* 列表项数据已包含详情页所需全部字段(含 isMoved 端点打标),直接由列表带入,不额外请求。
*/
class GnjMoveStashDetailViewModel : BaseViewModel() {
val dataBean = MutableLiveData(MoveStashBean())
fun initOnCreated(intent: Intent) {
val json = intent.getStringExtra(Constant.Key.DATA).orEmpty()
if (json.isNotEmpty()) {
dataBean.value = Gson().fromJson(json, MoveStashBean::class.java)
}
}
}

View File

@@ -1,36 +1,104 @@
package com.lukouguoji.aerologic.page.gnj.move.stash.list package com.lukouguoji.aerologic.page.gnj.move.stash.list
import android.content.Context import android.content.Context
import android.content.Intent import android.content.Intent
import android.os.Bundle import android.os.Bundle
import com.lukouguoji.aerologic.R import androidx.databinding.ObservableBoolean
import com.lukouguoji.aerologic.databinding.ActivityGnjMoveStashListBinding import com.alibaba.android.arouter.facade.annotation.Route
import com.lukouguoji.module_base.base.BaseBindingActivity import com.lukouguoji.aerologic.R
import com.lukouguoji.module_base.ktx.getLifecycleOwner import com.lukouguoji.aerologic.databinding.ActivityGnjMoveStashListBinding
import com.lukouguoji.aerologic.page.gnj.move.stash.photo.GnjMoveStashPhotoActivity
class GnjMoveStashListActivity : import com.lukouguoji.module_base.base.BaseBindingActivity
BaseBindingActivity<ActivityGnjMoveStashListBinding, GnjMoveStashListViewModel>() { import com.lukouguoji.module_base.bean.MoveStashBean
override fun layoutId() = R.layout.activity_gnj_move_stash_list import com.lukouguoji.module_base.common.ConstantEvent
import com.lukouguoji.module_base.impl.FlowBus
override fun viewModelClass() = GnjMoveStashListViewModel::class.java import com.lukouguoji.module_base.impl.observe
import com.lukouguoji.module_base.ktx.getLifecycleOwner
override fun initOnCreate(savedInstanceState: Bundle?) { import com.lukouguoji.module_base.router.ARouterConstants
setBackArrow("国内进港移库") import com.lukouguoji.module_base.util.DeviceUtil
binding.viewModel = viewModel @Route(path = ARouterConstants.ACTIVITY_URL_GNJ_MOVE_STASH_LIST)
class GnjMoveStashListActivity :
viewModel.pageModel BaseBindingActivity<ActivityGnjMoveStashListBinding, GnjMoveStashListViewModel>() {
.bindSmartRefreshLayout(binding.srl, binding.rv, viewModel, getLifecycleOwner()) override fun layoutId() = R.layout.activity_gnj_move_stash_list
viewModel.refresh() override fun viewModelClass() = GnjMoveStashListViewModel::class.java
}
/** 筛选弹层显隐(仅手机 UI 状态,平板布局不绑定) */
companion object { val filterPanelVisible = ObservableBoolean(false)
@JvmStatic
fun start(context: Context) { override fun initOnCreate(savedInstanceState: Bundle?) {
val starter = Intent(context, GnjMoveStashListActivity::class.java) // 设计稿手机端标题为「进港移库」,平板保持原标题
context.startActivity(starter) setBackArrow(if (DeviceUtil.isPhone()) "进港移库" else "国内进港移库")
}
} binding.viewModel = viewModel
binding.activity = this
}
viewModel.pageModel
.bindSmartRefreshLayout(binding.srl, binding.rv, viewModel, getLifecycleOwner())
if (DeviceUtil.isPhone()) {
// 手机专属Tab 角标 + 特码字典等额外请求
viewModel.initPhoneExtras()
// 卡片勾选变化 → 更新全选状态与已选计数
FlowBus.with<String>(ConstantEvent.EVENT_CHECK_CHANGED).observe(this) {
viewModel.updateCheckAllStatus()
}
}
// 拍照上传等子页面完成后刷新列表(平板无发射方,观察无副作用)
FlowBus.with<String>(ConstantEvent.EVENT_REFRESH).observe(this) {
viewModel.refresh()
}
viewModel.refresh()
}
// ==================== 筛选弹层(仅手机) ====================
fun toggleFilterPanel() {
filterPanelVisible.set(!filterPanelVisible.get())
}
/** 筛选:重置(只清空弹层内条件,不影响 Tab 与顶部搜索框) */
fun resetFilter() {
viewModel.flightDate.value = ""
viewModel.flightNo.value = ""
viewModel.spCode.value = ""
viewModel.businessType.value = ""
}
fun confirmFilter() {
filterPanelVisible.set(false)
viewModel.refresh()
}
// ==================== 卡片长按「拍照」浮层(仅手机) ====================
/** 卡片长按展开操作浮层View.OnLongClickListener 要求返回 Boolean */
fun showCardActionPhone(bean: MoveStashBean): Boolean {
bean.actionMenuVisible.set(true)
return true
}
/** 点浮层空白处关闭 */
fun hideCardActionPhone(bean: MoveStashBean) {
bean.actionMenuVisible.set(false)
}
/** 浮层「拍照」→ 拍照上传页 */
fun openPhoto(bean: MoveStashBean) {
bean.actionMenuVisible.set(false)
GnjMoveStashPhotoActivity.start(this, bean.mawbId, bean.wbNo)
}
companion object {
@JvmStatic
fun start(context: Context) {
val starter = Intent(context, GnjMoveStashListActivity::class.java)
context.startActivity(starter)
}
}
}

View File

@@ -3,34 +3,64 @@ package com.lukouguoji.aerologic.page.gnj.move.stash.list
import android.view.View import android.view.View
import android.widget.Toast import android.widget.Toast
import com.lukouguoji.aerologic.databinding.ItemGnjMoveStashListBinding import com.lukouguoji.aerologic.databinding.ItemGnjMoveStashListBinding
import com.lukouguoji.aerologic.page.gnj.move.stash.detail.GnjMoveStashDetailActivity
import com.lukouguoji.gnj.page.yiku.handover.GnjYiKuHandoverActivity import com.lukouguoji.gnj.page.yiku.handover.GnjYiKuHandoverActivity
import com.lukouguoji.module_base.base.BaseViewHolder import com.lukouguoji.module_base.base.BaseViewHolder
import com.lukouguoji.module_base.bean.MoveStashBean import com.lukouguoji.module_base.bean.MoveStashBean
import com.lukouguoji.module_base.common.ConstantEvent
import com.lukouguoji.module_base.impl.FlowBus
import kotlinx.coroutines.GlobalScope
import kotlinx.coroutines.launch
/**
* 国内进港移库列表项 ViewHolder双形态共用
*
* 平板/手机布局差异较大,单侧独有的控件 id 在 Binding 基类中为 @Nullable
* 全部走判空调用平板swipe_menu/btn_edit/ll手机ll_detail
*/
class GnjMoveStashListViewHolder(view: View) : class GnjMoveStashListViewHolder(view: View) :
BaseViewHolder<MoveStashBean, ItemGnjMoveStashListBinding>(view) { BaseViewHolder<MoveStashBean, ItemGnjMoveStashListBinding>(view) {
override fun onBind(item: Any?, position: Int) { override fun onBind(item: Any?, position: Int) {
val bean = getItemBean(item)!! val bean = getItemBean(item)!!
binding.bean = bean binding.bean = bean
binding.position = position
binding.activity = itemView.context as? GnjMoveStashListActivity
// 勾选框(双形态共有):切换选中;手机端另行广播刷新全选/已选计数
binding.ivIcon.setOnClickListener { binding.ivIcon.setOnClickListener {
bean.checked.set(!bean.checked.get()) bean.checked.set(!bean.checked.get())
binding.executePendingBindings()
GlobalScope.launch {
FlowBus.with<String>(ConstantEvent.EVENT_CHECK_CHANGED).emit("check_changed")
}
} }
// ===== 平板独有交互 =====
// 点击列表项进入移交详情 // 点击列表项进入移交详情
binding.ll.setOnClickListener { binding.ll?.setOnClickListener {
GnjYiKuHandoverActivity.startForDetails(itemView.context, bean.mawbId) GnjYiKuHandoverActivity.startForDetails(itemView.context, bean.mawbId)
} }
// 侧滑菜单 - 编辑按钮 // 侧滑菜单 - 编辑按钮
binding.btnEdit.setOnClickListener { binding.btnEdit?.setOnClickListener {
binding.swipeMenu.quickClose() binding.swipeMenu?.quickClose()
if (bean.pickFlag == "1") { if (bean.pickFlag == "1") {
Toast.makeText(itemView.context, "已出库,不可编辑", Toast.LENGTH_SHORT).show() Toast.makeText(itemView.context, "已出库,不可编辑", Toast.LENGTH_SHORT).show()
return@setOnClickListener return@setOnClickListener
} }
GnjYiKuHandoverActivity.startForEdit(itemView.context, bean.mawbId) GnjYiKuHandoverActivity.startForEdit(itemView.context, bean.mawbId)
} }
// ===== 手机独有交互 =====
// 「查看详情」→ 手机版运单详情页
binding.llDetail?.setOnClickListener {
GnjMoveStashDetailActivity.start(itemView.context, bean)
}
binding.executePendingBindings()
} }
} }

View File

@@ -49,6 +49,41 @@ class GnjMoveStashListViewModel : BasePageViewModel() {
val number = MutableLiveData("0") val number = MutableLiveData("0")
val weight = MutableLiveData("0") val weight = MutableLiveData("0")
// ========== 5.5 寸手持端专属字段(平板布局不绑定,默认值保证平板行为零变化) ==========
/** 移库状态 Tab"0" 待移库DomImpMove/search/ "1" 已移库DomImpMove/searchMoved */
val moveState = MutableLiveData("0")
/** 手机筛选弹层:航班日期 / 航班号 / 特码(默认空 → 不进请求) */
val flightDate = MutableLiveData("")
val flightNo = MutableLiveData("")
val spCode = MutableLiveData("")
val spCodeList = MutableLiveData<List<KeyValue>>(emptyList())
val moveStateTabs = MutableLiveData(
listOf(KeyValue("待移库", "0"), KeyValue("已移库", "1"))
)
/** 状态 Tab 角标(与 [moveStateTabs] 等长,取两端点分页 total */
val moveStateCounts = MutableLiveData(listOf("", ""))
/** 底部操作条「已选 N 项」 */
val selectedCount = MutableLiveData("0")
/** 全选状态(手机 PhoneBottomBar 勾选图标) */
val isAllChecked = MutableLiveData(false)
/** 手机专属的额外请求Tab 角标、特码字典)开关,仅手机形态在 Activity 中开启 */
private var phoneExtrasEnabled = false
fun initPhoneExtras() {
phoneExtrasEnabled = true
// 特码字典flag=0 国内、ieFlag=I 进港(是否生效待实测,见问题清单)
DictUtils.getSpecialCodeList(addAll = false, flag = 0, ieFlag = "I") { list ->
spCodeList.postValue(listOf(KeyValue("全部", "")) + list)
}
}
/////////////////////////////////////////////////////////////////////////// ///////////////////////////////////////////////////////////////////////////
// 方法区 // 方法区
/////////////////////////////////////////////////////////////////////////// ///////////////////////////////////////////////////////////////////////////
@@ -95,25 +130,73 @@ class GnjMoveStashListViewModel : BasePageViewModel() {
} }
/** 查询条件分页参数除外search / searchMoved / searchTotal 三处共用同一套入参 */
private fun buildFilterParams(): Map<String, Any?> = mapOf(
"awbType" to businessType.value!!.ifEmpty { null },
"wbNo" to waybill.value!!.ifEmpty { null },
"carrier" to carrier.value!!.ifEmpty { null },
// 以下为手机筛选弹层字段,平板恒为空串 → 恒传 null行为不变
"fdate" to flightDate.value?.ifEmpty { null },
"fno" to flightNo.value?.ifEmpty { null },
"spCode" to spCode.value?.ifEmpty { null },
)
override fun getData() { override fun getData() {
val body = mapOf( val body = (buildFilterParams() + mapOf(
"page" to pageModel.page, "page" to pageModel.page,
"limit" to pageModel.limit, "limit" to pageModel.limit,
"awbType" to businessType.value!!.ifEmpty { null }, )).toRequestBody()
"wbNo" to waybill.value!!.ifEmpty { null }, val moved = moveState.value == "1"
"carrier" to carrier.value!!.ifEmpty { null },
).toRequestBody()
launchLoadingCollect({ launchLoadingCollect({
NetApply.api.getGnjMoveStashList( // 平板 moveState 恒为 "0" → 恒走 search原行为已移库 Tab 走 searchMoved
body if (moved) NetApply.api.getGnjMoveStashMovedList(body)
) else NetApply.api.getGnjMoveStashList(body)
}) { }) {
onSuccess = { onSuccess = {
pageModel.handleListBean(it) // searchMoved 出参无移库标识,按端点打标(卡片形态/详情移库信息卡依赖)
it.list?.forEach { bean -> bean.isMoved = moved }
pageModel.handleListBean(it) { updateCheckAllStatus() }
count.value = it.total count.value = it.total
} }
} }
getCountData(body) getCountData(body)
if (phoneExtrasEnabled) loadTabCounts()
}
/** Tab 角标search / searchMoved 各以 limit=1 查一次取分页 total仅手机形态发起 */
private fun loadTabCounts() {
val body = (buildFilterParams() + mapOf("page" to 1, "limit" to 1)).toRequestBody()
launchCollect({ NetApply.api.getGnjMoveStashList(body) }) {
onSuccess = { updateTabCount(0, it.total) }
}
launchCollect({ NetApply.api.getGnjMoveStashMovedList(body) }) {
onSuccess = { updateTabCount(1, it.total) }
}
}
private fun updateTabCount(index: Int, total: Int?) {
val current = moveStateCounts.value?.toMutableList() ?: mutableListOf("", "")
if (index < current.size) {
current[index] = (total ?: 0).toString()
moveStateCounts.value = current
}
}
// ========== 手机端全选 / 已选计数 ==========
fun toggleSelectAll() {
val list = pageModel.rv?.commonAdapter()?.items
?.filterIsInstance<MoveStashBean>() ?: return
CheckUtil.handleAllCheck(list)
updateCheckAllStatus()
pageModel.rv?.commonAdapter()?.notifyDataSetChanged()
}
fun updateCheckAllStatus() {
val list = pageModel.rv?.commonAdapter()?.items
?.filterIsInstance<MoveStashBean>() ?: return
isAllChecked.value = list.isNotEmpty() && list.all { it.checked.get() }
selectedCount.value = list.count { it.checked.get() }.toString()
} }
private fun getCountData(body: RequestBody) { private fun getCountData(body: RequestBody) {

View File

@@ -0,0 +1,45 @@
package com.lukouguoji.aerologic.page.gnj.move.stash.photo
import android.content.Context
import android.content.Intent
import android.os.Bundle
import com.lukouguoji.aerologic.R
import com.lukouguoji.aerologic.databinding.ActivityGnjMoveStashPhotoBinding
import com.lukouguoji.module_base.base.BaseBindingActivity
import com.lukouguoji.module_base.common.Constant
import com.lukouguoji.module_base.ktx.addOnItemClickListener
/**
* 国内进港移库「拍照上传」5.5 寸手持端专属页面,无平板变体)
*
* 由列表卡片长按浮层「拍照」或运单详情「异常照片」加号槽位进入。
* 已有照片经 DomImpMove/detail 回填,提交走 DomImpMove/modify
* mawbId + pic/originalPic/picNumber 三字段规范,与平板移交编辑页同一链路)。
*/
class GnjMoveStashPhotoActivity :
BaseBindingActivity<ActivityGnjMoveStashPhotoBinding, GnjMoveStashPhotoViewModel>() {
override fun layoutId() = R.layout.activity_gnj_move_stash_photo
override fun viewModelClass() = GnjMoveStashPhotoViewModel::class.java
override fun initOnCreate(savedInstanceState: Bundle?) {
setBackArrow("拍照上传")
binding.viewModel = viewModel
viewModel.rv = binding.rv
binding.rv.addOnItemClickListener(viewModel)
viewModel.initOnCreated(intent)
}
companion object {
@JvmStatic
fun start(context: Context, mawbId: String, wbNo: String) {
context.startActivity(
Intent(context, GnjMoveStashPhotoActivity::class.java)
.putExtra(Constant.Key.ID, mawbId)
.putExtra(Constant.Key.CODE, wbNo)
)
}
}
}

View File

@@ -0,0 +1,174 @@
package com.lukouguoji.aerologic.page.gnj.move.stash.photo
import android.content.Intent
import androidx.lifecycle.MutableLiveData
import androidx.lifecycle.viewModelScope
import androidx.recyclerview.widget.RecyclerView
import com.lukouguoji.module_base.base.BaseViewModel
import com.lukouguoji.module_base.bean.FileBean
import com.lukouguoji.module_base.bean.GnjYiKuBean
import com.lukouguoji.module_base.common.Constant
import com.lukouguoji.module_base.common.ConstantEvent
import com.lukouguoji.module_base.http.net.NetApply
import com.lukouguoji.module_base.impl.FlowBus
import com.lukouguoji.module_base.impl.ImageSelectNewViewHolder
import com.lukouguoji.module_base.interfaces.IOnItemClickListener
import com.lukouguoji.module_base.ktx.commonAdapter
import com.lukouguoji.module_base.ktx.launchCollect
import com.lukouguoji.module_base.ktx.launchLoadingCollect
import com.lukouguoji.module_base.ktx.noNull
import com.lukouguoji.module_base.ktx.showToast
import com.lukouguoji.module_base.ktx.toRequestBody
import com.lukouguoji.module_base.util.MediaUtil
import com.lukouguoji.module_base.util.UploadUtil
import kotlinx.coroutines.Dispatchers
import kotlinx.coroutines.flow.asFlow
import kotlinx.coroutines.flow.catch
import kotlinx.coroutines.flow.filter
import kotlinx.coroutines.flow.flowOn
import kotlinx.coroutines.flow.launchIn
import kotlinx.coroutines.flow.map
import kotlinx.coroutines.flow.onCompletion
import kotlinx.coroutines.flow.onEach
import kotlinx.coroutines.flow.onStart
import kotlinx.coroutines.launch
/**
* 国内进港移库「拍照上传」ViewModel5.5 寸手持端专属页面)
*
* 图片选择/预览/删除复用 module_base 的 ImageSelectNewViewHolder末位加号槽位
* 已有照片经 DomImpMove/detail 回填;提交走 DomImpMove/modify 最小体
* mawbId/remark/picNumber/pic/originalPic与平板移交编辑页同一链路。
*/
class GnjMoveStashPhotoViewModel : BaseViewModel(), IOnItemClickListener {
var mawbId = ""
/** 运单号(副标题展示,由列表带入) */
val wbNo = MutableLiveData("")
/** detail 回填的完整 bean提交时保留 remark 等原值) */
private var detailBean = GnjYiKuBean()
// 图片网格适配器配置(复用公共图片选择组件)
val itemViewHolder = ImageSelectNewViewHolder::class.java
val itemLayoutId = com.lukouguoji.module_base.R.layout.item_image_select_new
var rv: RecyclerView? = null
fun initOnCreated(intent: Intent) {
mawbId = intent.getStringExtra(Constant.Key.ID).orEmpty()
wbNo.value = intent.getStringExtra(Constant.Key.CODE).orEmpty()
// 已有照片回填pic 缩略图 + originalPic 原图),末位补加号槽位
launchCollect({ NetApply.api.getGnjMoveStashDetail(mawbId) }) {
onSuccess = {
detailBean = it.data ?: GnjYiKuBean()
val picList = detailBean.pic.split(",").filter { p -> p.isNotEmpty() }
val originalList = detailBean.originalPic.split(",").filter { p -> p.isNotEmpty() }
val images = picList.mapIndexed { index, picUrl ->
FileBean(
path = MediaUtil.fillUrl(picUrl),
url = picUrl,
originalPic = MediaUtil.fillUrl(originalList.getOrElse(index) { picUrl })
)
}
rv?.post {
rv?.commonAdapter()?.refresh(images + FileBean())
}
}
onFailed = { _, _ ->
// 详情取不到也允许直接新增照片
rv?.post { rv?.commonAdapter()?.refresh(listOf(FileBean())) }
}
}
}
/**
* 确认提交:先补传未上传的本地图片,再按三字段规范提交 modify
*/
fun submitClick() {
(rv?.commonAdapter()?.items ?: emptyList())
.asFlow()
.map { it as FileBean }
.filter { it.path.isNotEmpty() && it.url.isEmpty() }
.onEach {
val data = UploadUtil.upload(it.path).data
// UploadUtil 返回newName=原图(较大)zipFileName=缩略图(较小)
it.url = data?.zipFileName ?: ""
it.originalPic = data?.newName ?: ""
}
.flowOn(Dispatchers.IO)
.onStart { showLoading() }
.catch {
showToast(it.message.noNull("上传图片失败"))
dismissLoading()
}
.onCompletion {
launchLoadingCollect({
val list = (rv?.commonAdapter()?.items ?: emptyList())
.filterIsInstance<FileBean>()
.filter { it.path.isNotEmpty() }
// 最小体提交只更新图片三字段remark 保留 detail 原值),与平板移交编辑页一致
val params = mapOf(
"mawbId" to mawbId,
"remark" to detailBean.remark,
"picNumber" to list.size.toString(),
"pic" to list.joinToString(",") { MediaUtil.removeUrl(it.url) },
"originalPic" to list.joinToString(",") { MediaUtil.removeUrl(it.originalPic) },
).toRequestBody(removeEmptyOrNull = true)
NetApply.api.modifyGnjMoveStash(params)
}) {
onSuccess = {
showToast("提交成功")
viewModelScope.launch {
FlowBus.with<String>(ConstantEvent.EVENT_REFRESH).emit("refresh")
}
getTopActivity().finish()
}
onFailed = { _, msg ->
showToast(msg.noNull("提交失败"))
}
}
}
.launchIn(viewModelScope)
}
/**
* 「拍照/上传」按钮:直接唤起图片选择(含拍照入口)
*/
fun pickClick() {
MediaUtil.pickImage(getTopActivity(), maxNum = 9) { results ->
val adapter = rv?.commonAdapter() ?: return@pickImage
results.forEach { result ->
// 在加号槽位(最后一项)之前插入
val insertPos = (adapter.items.size - 1).coerceAtLeast(0)
adapter.items.add(insertPos, FileBean(path = result.realPath))
adapter.notifyItemInserted(insertPos)
}
}
}
/**
* 图片网格点击回调(长按出删除角标 / 点删除角标移除)
*/
override fun onItemClick(position: Int, type: Int) {
val adapter = rv?.commonAdapter() ?: return
val bean = adapter.getItem(position) as? FileBean ?: return
when (type) {
com.lukouguoji.module_base.R.id.rl -> {
if (bean.path.isNotEmpty()) {
bean.canDelete.set(!bean.canDelete.get())
}
}
com.lukouguoji.module_base.R.id.iv_delete -> {
adapter.removeItem(position)
}
else -> {}
}
}
}

View File

@@ -91,7 +91,9 @@ class LogDetailActivity : BaseBindingActivity<ActivityLogDetailBinding, LogDetai
val step = steps[i] val step = steps[i]
val isActive = step.code in activeCodes val isActive = step.code in activeCodes
val isLast = i == steps.size - 1 val isLast = i == steps.size - 1
val time = logs.lastOrNull { it.status == step.code }?.opDate ?: "" val stepLog = logs.lastOrNull { it.status == step.code }
val time = stepLog?.opDate ?: ""
val statusContent = stepLog?.content ?: ""
val row = LinearLayout(this).apply { val row = LinearLayout(this).apply {
orientation = LinearLayout.HORIZONTAL orientation = LinearLayout.HORIZONTAL
@@ -141,12 +143,41 @@ class LogDetailActivity : BaseBindingActivity<ActivityLogDetailBinding, LogDetai
} }
setPadding(0, 0, 0, if (isLast) 0 else dp(24)) setPadding(0, 0, 0, if (isLast) 0 else dp(24))
} }
content.addView(TextView(this).apply { // 名称行:步骤名(左)+ 已发生节点的状态 pill设计稿如「放行状态01」
val nameRow = LinearLayout(this).apply {
orientation = LinearLayout.HORIZONTAL
gravity = Gravity.CENTER_VERTICAL
layoutParams = LinearLayout.LayoutParams(
LinearLayout.LayoutParams.MATCH_PARENT,
LinearLayout.LayoutParams.WRAP_CONTENT
)
}
nameRow.addView(TextView(this).apply {
text = step.name text = step.name
setTextSize(TypedValue.COMPLEX_UNIT_SP, 15f) setTextSize(TypedValue.COMPLEX_UNIT_SP, 15f)
setTextColor(if (isActive) colorGreen else colorGray) setTextColor(if (isActive) colorGreen else colorGray)
if (isActive) setTypeface(typeface, android.graphics.Typeface.BOLD) if (isActive) setTypeface(typeface, android.graphics.Typeface.BOLD)
layoutParams = LinearLayout.LayoutParams(
0, LinearLayout.LayoutParams.WRAP_CONTENT
).apply { weight = 1f }
}) })
if (isActive && statusContent.isNotEmpty()) {
nameRow.addView(TextView(this).apply {
text = statusContent
setTextSize(TypedValue.COMPLEX_UNIT_SP, 11f)
setTextColor(colorGreen)
setBackgroundResource(com.lukouguoji.module_base.R.drawable.bg_phone_tag_green)
setPadding(dp(8), dp(3), dp(8), dp(3))
maxLines = 1
ellipsize = android.text.TextUtils.TruncateAt.END
maxWidth = dp(180)
layoutParams = LinearLayout.LayoutParams(
LinearLayout.LayoutParams.WRAP_CONTENT,
LinearLayout.LayoutParams.WRAP_CONTENT
).apply { leftMargin = dp(8) }
})
}
content.addView(nameRow)
if (time.isNotEmpty()) { if (time.isNotEmpty()) {
content.addView(TextView(this).apply { content.addView(TextView(this).apply {
text = time text = time

View File

@@ -0,0 +1,153 @@
<?xml version="1.0" encoding="utf-8"?>
<layout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
xmlns:tools="http://schemas.android.com/tools">
<data>
<import type="com.lukouguoji.module_base.ui.weight.search.layout.SearchLayoutType" />
<variable
name="viewModel"
type="com.lukouguoji.aerologic.page.gnj.move.stash.list.GnjMoveStashListViewModel" />
<!-- 平板不使用,仅为与手机变体保持 <variable> 一致DataBinding 双变体强制约束) -->
<variable
name="activity"
type="com.lukouguoji.aerologic.page.gnj.move.stash.list.GnjMoveStashListActivity" />
</data>
<LinearLayout
android:layout_width="match_parent"
android:layout_height="match_parent"
android:background="@color/color_f2"
android:orientation="vertical">
<include layout="@layout/title_tool_bar" />
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginHorizontal="10dp"
android:layout_marginTop="10dp"
android:gravity="center_vertical">
<com.lukouguoji.module_base.ui.weight.search.layout.PadSearchLayout
hint='@{"请选择业务类型"}'
list="@{viewModel.businessTypeList}"
type="@{SearchLayoutType.SPINNER}"
value="@={viewModel.businessType}"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_weight="1" />
<com.lukouguoji.module_base.ui.weight.search.layout.PadSearchLayout
hint='@{"请输入运单号"}'
icon="@{@drawable/img_scan}"
setInputWaybill="@{true}"
setOnIconClickListener="@{()-> viewModel.waybillScanClick()}"
setRefreshCallBack="@{viewModel::refresh}"
setSearchListRefresh="@{viewModel::getWayBillList}"
type="@{SearchLayoutType.INPUT}"
value="@={viewModel.waybill}"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_weight="1" />
<com.lukouguoji.module_base.ui.weight.search.layout.PadSearchLayout
hint='@{"请输入承运人"}'
type="@{SearchLayoutType.INPUT}"
value="@={viewModel.carrier}"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_weight="1" />
<LinearLayout
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_weight="1">
<ImageView
style="@style/iv_search_action"
android:onClick="@{()-> viewModel.refresh()}"
android:src="@drawable/img_search" />
</LinearLayout>
<View
android:layout_width="0dp"
android:layout_height="0dp"
android:layout_weight="1" />
<View
android:layout_width="0dp"
android:layout_height="0dp"
android:layout_weight="1" />
</LinearLayout>
<androidx.appcompat.widget.LinearLayoutCompat
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:gravity="center_vertical"
android:paddingTop="10dp">
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginLeft="15dp"
android:onClick="@{()->viewModel.checkAllClick()}"
android:text="全选" />
<ImageView
android:id="@+id/checkIcon"
android:layout_width="30dp"
android:layout_height="30dp"
android:layout_marginLeft="5dp"
android:onClick="@{()->viewModel.checkAllClick()}"
android:src="@drawable/img_check_all" />
</androidx.appcompat.widget.LinearLayoutCompat>
<com.scwang.smart.refresh.layout.SmartRefreshLayout
android:id="@+id/srl"
android:layout_width="match_parent"
android:layout_height="0dp"
android:layout_weight="1">
<androidx.recyclerview.widget.RecyclerView
android:id="@+id/rv"
itemLayoutId="@{viewModel.itemLayoutId}"
viewHolder="@{viewModel.itemViewHolder}"
android:layout_width="match_parent"
android:layout_height="match_parent"
app:layoutManager="androidx.recyclerview.widget.LinearLayoutManager"
tools:listitem="@layout/item_gnj_move_stash_list" />
</com.scwang.smart.refresh.layout.SmartRefreshLayout>
<LinearLayout
android:layout_width="match_parent"
android:layout_height="50dp"
android:background="@color/color_bottom_layout"
android:gravity="center_vertical"
android:paddingHorizontal="15dp">
<TextView
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_weight="1"
android:text='@{"合计:"+viewModel.count+"条,总件数:"+viewModel.number+",总重量:"+viewModel.weight+"KG"}'
android:textColor="@color/white"
android:textSize="18sp"
android:textStyle="bold"
tools:text="合计3条总件数212总重量342KG" />
<TextView
style="@style/tv_bottom_btn"
android:onClick="@{()-> viewModel.moveStashClick()}"
android:text="移库" />
</LinearLayout>
</LinearLayout>
</layout>

View File

@@ -0,0 +1,296 @@
<?xml version="1.0" encoding="utf-8"?>
<layout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
xmlns:tools="http://schemas.android.com/tools">
<data>
<variable
name="bean"
type="com.lukouguoji.module_base.bean.MoveStashBean" />
<!-- 以下两个变量平板不使用,仅为与手机变体保持 <variable> 一致DataBinding 双变体强制约束) -->
<variable
name="position"
type="Integer" />
<variable
name="activity"
type="com.lukouguoji.aerologic.page.gnj.move.stash.list.GnjMoveStashListActivity" />
</data>
<!-- 外层容器承载间距 -->
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginHorizontal="15dp"
android:layout_marginVertical="5dp"
android:orientation="vertical">
<!-- 侧滑布局 -->
<com.mcxtzhang.swipemenulib.SwipeMenuLayout
android:id="@+id/swipe_menu"
android:layout_width="match_parent"
android:layout_height="wrap_content">
<!-- 主列表项容器 -->
<androidx.appcompat.widget.LinearLayoutCompat
android:id="@+id/ll"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:background="@drawable/bg_item"
android:orientation="horizontal"
android:padding="10dp">
<ImageView
android:id="@+id/iv_icon"
loadImage="@{bean.checked ? @drawable/img_plane_s : @drawable/img_plane}"
android:layout_width="40dp"
android:layout_height="40dp"
android:layout_gravity="center"
android:src="@drawable/img_plane" />
<LinearLayout
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_marginLeft="10dp"
android:layout_weight="1"
android:orientation="vertical">
<androidx.appcompat.widget.LinearLayoutCompat
android:layout_width="match_parent"
android:layout_height="wrap_content">
<androidx.appcompat.widget.LinearLayoutCompat
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_weight="1.1"
android:gravity="center_vertical">
<TextView
completeSpace="@{4}"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="运单号:" />
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="@{bean.wbNo}"
android:textColor="@color/colorPrimary"
tools:text="789165431" />
</androidx.appcompat.widget.LinearLayoutCompat>
<androidx.appcompat.widget.LinearLayoutCompat
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_weight="0.8"
android:gravity="center_vertical">
<TextView
completeSpace="@{4}"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="件数:" />
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text='@{bean.pc}' />
</androidx.appcompat.widget.LinearLayoutCompat>
<androidx.appcompat.widget.LinearLayoutCompat
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_weight="0.7"
android:gravity="center_vertical">
<TextView
completeSpace="@{4}"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="重量:" />
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="@{bean.weight}" />
</androidx.appcompat.widget.LinearLayoutCompat>
<androidx.appcompat.widget.LinearLayoutCompat
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_weight="0.8"
android:gravity="center_vertical">
<TextView
completeSpace="@{4}"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="代理人:" />
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text='@{bean.agentCode}' />
</androidx.appcompat.widget.LinearLayoutCompat>
<androidx.appcompat.widget.LinearLayoutCompat
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_weight="1.1"
android:gravity="center_vertical">
<TextView
completeSpace="@{5}"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="运单类型:" />
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text='@{bean.awbType}' />
</androidx.appcompat.widget.LinearLayoutCompat>
</androidx.appcompat.widget.LinearLayoutCompat>
<androidx.appcompat.widget.LinearLayoutCompat
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginTop="10dp">
<androidx.appcompat.widget.LinearLayoutCompat
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_weight="1.1"
android:gravity="center_vertical">
<TextView
completeSpace="@{4}"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="航班:" />
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="@{bean.flight}" />
</androidx.appcompat.widget.LinearLayoutCompat>
<androidx.appcompat.widget.LinearLayoutCompat
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_weight="0.8"
android:gravity="center_vertical">
<TextView
completeSpace="@{4}"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="始发港:" />
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="@{bean.origin}" />
</androidx.appcompat.widget.LinearLayoutCompat>
<androidx.appcompat.widget.LinearLayoutCompat
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_weight="0.8"
android:gravity="center_vertical">
<TextView
completeSpace="@{4}"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="起始站:" />
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="@{bean.dep}" />
</androidx.appcompat.widget.LinearLayoutCompat>
<androidx.appcompat.widget.LinearLayoutCompat
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_weight="0.8"
android:gravity="center_vertical">
<TextView
completeSpace="@{4}"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="目的港:" />
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="@{bean.dest}" />
</androidx.appcompat.widget.LinearLayoutCompat>
<androidx.appcompat.widget.LinearLayoutCompat
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_weight="1.1"
android:gravity="center_vertical">
<TextView
completeSpace="@{5}"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="品名:" />
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="@{bean.goods}" />
</androidx.appcompat.widget.LinearLayoutCompat>
</androidx.appcompat.widget.LinearLayoutCompat>
</LinearLayout>
<!-- 右侧箭头 -->
<ImageView
android:layout_width="30dp"
android:layout_height="30dp"
android:layout_gravity="center"
android:layout_marginLeft="10dp"
android:src="@drawable/img_pda_right" />
</androidx.appcompat.widget.LinearLayoutCompat>
<!-- 侧滑菜单区域 -->
<androidx.appcompat.widget.LinearLayoutCompat
android:layout_width="wrap_content"
android:layout_height="match_parent"
android:orientation="horizontal">
<!-- 编辑按钮 -->
<TextView
android:id="@+id/btn_edit"
style="@style/tv_item_action"
android:background="@color/colorPrimary"
android:text="编辑" />
</androidx.appcompat.widget.LinearLayoutCompat>
</com.mcxtzhang.swipemenulib.SwipeMenuLayout>
</LinearLayout>
</layout>

View File

@@ -0,0 +1,332 @@
<?xml version="1.0" encoding="utf-8"?>
<!--
国内进港移库「运单详情」—— 5.5 寸手持端专属页面(无平板变体)
对应设计稿 11_进港移库 的「运单详情」页:
· 卡片一:蓝色表头(运单号 + 绿点 + 操作时间)+ 类型标签行(红「运单类型」+ 货物类型)
+ 品名大字 + 两列字段网格(件数/重量/特码/代理/出运路径/承运人)
· 卡片二:绿色表头「移库信息」+ 移库人 / 移库时间(仅已移库显示)
· 卡片三:橙色表头「异常照片」+ 三个虚线加号槽位(点击跳拍照上传页)
-->
<layout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto">
<data>
<import type="android.view.View" />
<variable
name="viewModel"
type="com.lukouguoji.aerologic.page.gnj.move.stash.detail.GnjMoveStashDetailViewModel" />
<variable
name="activity"
type="com.lukouguoji.aerologic.page.gnj.move.stash.detail.GnjMoveStashDetailActivity" />
</data>
<LinearLayout
android:layout_width="match_parent"
android:layout_height="match_parent"
android:background="@color/phone_page_bg"
android:orientation="vertical">
<include layout="@layout/title_tool_bar" />
<ScrollView
android:layout_width="match_parent"
android:layout_height="0dp"
android:layout_weight="1"
android:fillViewport="true"
android:overScrollMode="never">
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="vertical"
android:padding="16dp">
<!-- ==================== 卡片一:运单基本信息 ==================== -->
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:background="@drawable/bg_phone_card"
android:orientation="vertical">
<!-- 蓝色表头:运单号 + 绿点 + 操作时间 -->
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:background="@drawable/bg_phone_card_header_blue"
android:gravity="center_vertical"
android:orientation="horizontal"
android:paddingHorizontal="16dp"
android:paddingVertical="12dp">
<TextView
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_weight="1"
android:text="@{viewModel.dataBean.wbNo}"
android:textColor="@color/white"
android:textSize="17sp"
android:textStyle="bold" />
<View
android:layout_width="8dp"
android:layout_height="8dp"
android:layout_marginEnd="6dp"
android:background="@drawable/bg_phone_dot_green" />
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="@{viewModel.dataBean.orDash(viewModel.dataBean.opDate)}"
android:textColor="@color/white"
android:textSize="14sp" />
</LinearLayout>
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="vertical"
android:padding="16dp">
<!-- 类型标签行:运单类型(红标签) + 货物类型 -->
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:gravity="center_vertical"
android:orientation="horizontal">
<TextView
android:layout_width="wrap_content"
android:layout_height="22dp"
android:background="@drawable/bg_phone_tag_red"
android:gravity="center"
android:paddingHorizontal="8dp"
android:text="@{viewModel.dataBean.orDash(viewModel.dataBean.awbType)}"
android:textColor="@color/phone_tag_red_text"
android:textSize="12sp"
android:textStyle="bold" />
<View
android:layout_width="1dp"
android:layout_height="14dp"
android:layout_marginHorizontal="10dp"
android:background="@color/phone_divider" />
<TextView
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_weight="1"
android:text="@{viewModel.dataBean.orDash(viewModel.dataBean.cargoType)}"
android:textColor="@color/phone_text_body"
android:textSize="14sp" />
</LinearLayout>
<!-- 品名(主字段大字) -->
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginTop="12dp"
android:layout_marginBottom="12dp"
android:text="@{viewModel.dataBean.orDash(viewModel.dataBean.goods)}"
android:textColor="@color/phone_text_strong"
android:textSize="22sp"
android:textStyle="bold" />
<!-- 第 1 行:件数 / 重量 -->
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="horizontal">
<com.lukouguoji.module_base.ui.weight.phone.PhoneKvItem
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_weight="1"
title='@{"件数"}'
value="@{viewModel.dataBean.orDash(viewModel.dataBean.pc)}" />
<com.lukouguoji.module_base.ui.weight.phone.PhoneKvItem
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_marginStart="32dp"
android:layout_weight="1"
title='@{"重量"}'
value='@{viewModel.dataBean.orDash(viewModel.dataBean.weight) + " kg"}' />
</LinearLayout>
<!-- 第 2 行:特码 / 代理 -->
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginTop="12dp"
android:orientation="horizontal">
<com.lukouguoji.module_base.ui.weight.phone.PhoneKvItem
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_weight="1"
title='@{"特码"}'
value="@{viewModel.dataBean.spCode}" />
<com.lukouguoji.module_base.ui.weight.phone.PhoneKvItem
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_marginStart="32dp"
android:layout_weight="1"
title='@{"代理"}'
value="@{viewModel.dataBean.agentDisplay}" />
</LinearLayout>
<!-- 第 3 行:出运路径 / 承运人 -->
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginTop="12dp"
android:orientation="horizontal">
<com.lukouguoji.module_base.ui.weight.phone.PhoneKvItem
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_weight="1"
title='@{"出运路径"}'
value="@{viewModel.dataBean.range}" />
<com.lukouguoji.module_base.ui.weight.phone.PhoneKvItem
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_marginStart="32dp"
android:layout_weight="1"
title='@{"承运人"}'
value="@{viewModel.dataBean.by1}" />
</LinearLayout>
</LinearLayout>
</LinearLayout>
<!-- ==================== 卡片二:移库信息(仅已移库显示) ==================== -->
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginTop="16dp"
android:background="@drawable/bg_phone_card"
android:orientation="vertical"
android:visibility="@{viewModel.dataBean.isMoved ? View.VISIBLE : View.GONE}">
<TextView
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:background="@drawable/bg_phone_card_header_green"
android:paddingHorizontal="16dp"
android:paddingVertical="10dp"
android:text="移库信息"
android:textColor="@color/white"
android:textSize="15sp"
android:textStyle="bold" />
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="horizontal"
android:paddingHorizontal="16dp"
android:paddingVertical="12dp">
<com.lukouguoji.module_base.ui.weight.phone.PhoneKvItem
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_weight="1"
title='@{"移库人"}'
value="@{viewModel.dataBean.opId}" />
<com.lukouguoji.module_base.ui.weight.phone.PhoneKvItem
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_marginStart="32dp"
android:layout_weight="1"
title='@{"移库时间"}'
value="@{viewModel.dataBean.opDate}" />
</LinearLayout>
</LinearLayout>
<!-- ==================== 卡片三:异常照片 ==================== -->
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginTop="16dp"
android:background="@drawable/bg_phone_card"
android:orientation="vertical">
<TextView
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:background="@drawable/bg_phone_card_header_orange"
android:paddingHorizontal="16dp"
android:paddingVertical="10dp"
android:text="异常照片"
android:textColor="@color/white"
android:textSize="15sp"
android:textStyle="bold" />
<!-- 三个虚线加号槽位(等宽正方形由 weight + 固定高实现),点击进拍照上传页 -->
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="horizontal"
android:padding="16dp">
<TextView
android:layout_width="0dp"
android:layout_height="96dp"
android:layout_weight="1"
android:background="@drawable/bg_phone_photo_add"
android:gravity="center"
android:onClick="@{()-> activity.openPhoto()}"
android:text="+"
android:textColor="@color/phone_text_hint"
android:textSize="24sp" />
<TextView
android:layout_width="0dp"
android:layout_height="96dp"
android:layout_marginStart="12dp"
android:layout_weight="1"
android:background="@drawable/bg_phone_photo_add"
android:gravity="center"
android:onClick="@{()-> activity.openPhoto()}"
android:text="+"
android:textColor="@color/phone_text_hint"
android:textSize="24sp" />
<TextView
android:layout_width="0dp"
android:layout_height="96dp"
android:layout_marginStart="12dp"
android:layout_weight="1"
android:background="@drawable/bg_phone_photo_add"
android:gravity="center"
android:onClick="@{()-> activity.openPhoto()}"
android:text="+"
android:textColor="@color/phone_text_hint"
android:textSize="24sp" />
</LinearLayout>
</LinearLayout>
</LinearLayout>
</ScrollView>
</LinearLayout>
</layout>

View File

@@ -1,148 +1,166 @@
<?xml version="1.0" encoding="utf-8"?> <?xml version="1.0" encoding="utf-8"?>
<layout xmlns:android="http://schemas.android.com/apk/res/android" <!--
xmlns:app="http://schemas.android.com/apk/res-auto" 国内进港移库 —— 5.5 寸手持端布局(平板变体见 layout-sw600dp/ 同名文件)
xmlns:tools="http://schemas.android.com/tools">
对应设计稿 documents/5.5寸手持端设计文件/11_进港移库/进港移库.html
<data> · 顶部搜索框(运单号,含扫码)+ 筛选弹层(航班日期 / 航班号 / 特码 / 运单类型)
· 「待移库 / 已移库」Tab 绑定 viewModel.moveState"0"/"1"
<import type="com.lukouguoji.module_base.ui.weight.search.layout.SearchLayoutType" /> 分别走 DomImpMove/search 与 DomImpMove/searchMoved 两个端点
· 已移库 Tab 下隐藏底部操作条(与设计稿一致)
<variable · 卡片长按出「拍照」浮层(见 item_gnj_move_stash_list.xml
name="viewModel" -->
type="com.lukouguoji.aerologic.page.gnj.move.stash.list.GnjMoveStashListViewModel" /> <layout xmlns:android="http://schemas.android.com/apk/res/android"
</data> xmlns:app="http://schemas.android.com/apk/res-auto"
xmlns:tools="http://schemas.android.com/tools">
<LinearLayout
android:layout_width="match_parent" <data>
android:layout_height="match_parent"
android:background="@color/color_f2" <import type="android.view.View" />
android:orientation="vertical">
<import type="com.lukouguoji.module_base.ui.weight.phone.PhoneDataLayoutType" />
<include layout="@layout/title_tool_bar" />
<variable
<LinearLayout name="viewModel"
android:layout_width="match_parent" type="com.lukouguoji.aerologic.page.gnj.move.stash.list.GnjMoveStashListViewModel" />
android:layout_height="wrap_content"
android:layout_marginHorizontal="10dp" <variable
android:layout_marginTop="10dp" name="activity"
android:gravity="center_vertical"> type="com.lukouguoji.aerologic.page.gnj.move.stash.list.GnjMoveStashListActivity" />
</data>
<com.lukouguoji.module_base.ui.weight.search.layout.PadSearchLayout
hint='@{"请选择业务类型"}' <FrameLayout
list="@{viewModel.businessTypeList}" android:layout_width="match_parent"
type="@{SearchLayoutType.SPINNER}" android:layout_height="match_parent"
value="@={viewModel.businessType}" android:background="@color/phone_page_bg">
android:layout_width="0dp"
android:layout_height="wrap_content" <LinearLayout
android:layout_weight="1" /> android:layout_width="match_parent"
android:layout_height="match_parent"
<com.lukouguoji.module_base.ui.weight.search.layout.PadSearchLayout android:orientation="vertical">
hint='@{"请输入运单号"}'
icon="@{@drawable/img_scan}" <include layout="@layout/title_tool_bar" />
setInputWaybill="@{true}"
setOnIconClickListener="@{()-> viewModel.waybillScanClick()}" <!-- ==================== 搜索行 ==================== -->
setRefreshCallBack="@{viewModel::refresh}" <LinearLayout
setSearchListRefresh="@{viewModel::getWayBillList}" android:layout_width="match_parent"
type="@{SearchLayoutType.INPUT}" android:layout_height="wrap_content"
value="@={viewModel.waybill}" android:background="@color/white"
android:layout_width="0dp" android:orientation="vertical"
android:layout_height="wrap_content" android:paddingHorizontal="16dp"
android:layout_weight="1" /> android:paddingTop="16dp"
android:paddingBottom="12dp">
<com.lukouguoji.module_base.ui.weight.search.layout.PadSearchLayout
hint='@{"请输入承运人"}' <com.lukouguoji.module_base.ui.weight.phone.PhoneSearchBar
type="@{SearchLayoutType.INPUT}" android:layout_width="match_parent"
value="@={viewModel.carrier}" android:layout_height="wrap_content"
android:layout_width="0dp" hint='@{"搜索运单号"}'
android:layout_height="wrap_content" setOnFilterClickListener="@{(v)-> activity.toggleFilterPanel()}"
android:layout_weight="1" /> setOnScanClickListener="@{(v)-> viewModel.waybillScanClick()}"
setRefreshCallBack="@{viewModel::refresh}"
<LinearLayout upperCase="@{true}"
android:layout_width="0dp" value="@={viewModel.waybill}" />
android:layout_height="wrap_content"
android:layout_weight="1"> </LinearLayout>
<ImageView <!-- ==================== 待移库 / 已移库 Tab ==================== -->
style="@style/iv_search_action" <com.lukouguoji.module_base.ui.weight.phone.PhoneStatusTab
android:onClick="@{()-> viewModel.refresh()}" android:layout_width="match_parent"
android:src="@drawable/img_search" /> android:layout_height="wrap_content"
counts="@{viewModel.moveStateCounts}"
</LinearLayout> setOnTabChanged="@{viewModel::refresh}"
tabs="@{viewModel.moveStateTabs}"
<View value="@={viewModel.moveState}" />
android:layout_width="0dp"
android:layout_height="0dp" <View
android:layout_weight="1" /> android:layout_width="match_parent"
android:layout_height="1px"
<View android:background="@color/phone_divider" />
android:layout_width="0dp"
android:layout_height="0dp" <!-- ==================== 列表 ==================== -->
android:layout_weight="1" /> <com.scwang.smart.refresh.layout.SmartRefreshLayout
android:id="@+id/srl"
</LinearLayout> android:layout_width="match_parent"
<androidx.appcompat.widget.LinearLayoutCompat android:layout_height="0dp"
android:layout_width="match_parent" android:layout_weight="1">
android:layout_height="wrap_content"
android:gravity="center_vertical" <androidx.recyclerview.widget.RecyclerView
android:paddingTop="10dp"> android:id="@+id/rv"
android:layout_width="match_parent"
<TextView android:layout_height="match_parent"
android:layout_width="wrap_content" android:clipToPadding="false"
android:layout_height="wrap_content" android:overScrollMode="never"
android:layout_marginLeft="15dp" android:paddingBottom="12dp"
android:onClick="@{()->viewModel.checkAllClick()}" itemLayoutId="@{viewModel.itemLayoutId}"
android:text="全选" /> viewHolder="@{viewModel.itemViewHolder}"
app:layoutManager="androidx.recyclerview.widget.LinearLayoutManager"
<ImageView tools:itemCount="3"
android:id="@+id/checkIcon" tools:listitem="@layout/item_gnj_move_stash_list" />
android:layout_width="30dp"
android:layout_height="30dp" </com.scwang.smart.refresh.layout.SmartRefreshLayout>
android:layout_marginLeft="5dp"
android:onClick="@{()->viewModel.checkAllClick()}" <!-- ==================== 底部操作条(已移库 Tab 下隐藏) ==================== -->
android:src="@drawable/img_check_all" /> <com.lukouguoji.module_base.ui.weight.phone.PhoneBottomBar
android:layout_width="match_parent"
</androidx.appcompat.widget.LinearLayoutCompat> android:layout_height="wrap_content"
actionText='@{"移库"}'
<com.scwang.smart.refresh.layout.SmartRefreshLayout allChecked="@{viewModel.isAllChecked}"
android:id="@+id/srl" countText='@{"已选 " + viewModel.selectedCount + " 项"}'
android:layout_width="match_parent" setOnActionClick="@{(v)-> viewModel.moveStashClick()}"
android:layout_height="0dp" setOnAllCheckClick="@{(v)-> viewModel.toggleSelectAll()}"
android:layout_weight="1"> android:visibility="@{`1`.equals(viewModel.moveState) ? View.GONE : View.VISIBLE}" />
<androidx.recyclerview.widget.RecyclerView </LinearLayout>
android:id="@+id/rv"
itemLayoutId="@{viewModel.itemLayoutId}" <!-- ==================== 筛选弹层 ==================== -->
viewHolder="@{viewModel.itemViewHolder}" <com.lukouguoji.module_base.ui.weight.phone.PhoneFilterPanel
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="match_parent" android:layout_height="match_parent"
app:layoutManager="androidx.recyclerview.widget.LinearLayoutManager" panelVisible="@{activity.filterPanelVisible}"
tools:listitem="@layout/item_gnj_move_stash_list" /> setOnConfirmClick="@{(v)-> activity.confirmFilter()}"
setOnDismissClick="@{(v)-> activity.toggleFilterPanel()}"
</com.scwang.smart.refresh.layout.SmartRefreshLayout> setOnResetClick="@{(v)-> activity.resetFilter()}"
title='@{"筛选条件"}'>
<LinearLayout
android:layout_width="match_parent" <!-- 航班日期(入参 fdate -->
android:layout_height="50dp" <com.lukouguoji.module_base.ui.weight.phone.PhoneDataLayout
android:background="@color/color_bottom_layout" android:layout_width="match_parent"
android:gravity="center_vertical" android:layout_height="wrap_content"
android:paddingHorizontal="15dp"> hint='@{"请选择航班日期"}'
title='@{"航班日期"}'
<TextView type="@{PhoneDataLayoutType.DATE}"
android:layout_width="0dp" value="@={viewModel.flightDate}" />
android:layout_height="wrap_content"
android:layout_weight="1" <!-- 航班号(入参 fno -->
android:text='@{"合计:"+viewModel.count+"条,总件数:"+viewModel.number+",总重量:"+viewModel.weight+"KG"}' <com.lukouguoji.module_base.ui.weight.phone.PhoneDataLayout
android:textColor="@color/white" android:layout_width="match_parent"
android:textSize="18sp" android:layout_height="wrap_content"
android:textStyle="bold" hint='@{"请输入航班号"}'
tools:text="合计3条总件数212总重量342KG" /> title='@{"航班号"}'
type="@{PhoneDataLayoutType.INPUT}"
<TextView value="@={viewModel.flightNo}" />
style="@style/tv_bottom_btn"
android:onClick="@{()-> viewModel.moveStashClick()}" <!-- 特码(入参 spCode -->
android:text="移库" /> <com.lukouguoji.module_base.ui.weight.phone.PhoneDataLayout
android:layout_width="match_parent"
</LinearLayout> android:layout_height="wrap_content"
hint='@{"请选择特码"}'
</LinearLayout> list="@{viewModel.spCodeList}"
</layout> title='@{"特码"}'
type="@{PhoneDataLayoutType.SPINNER}"
value="@={viewModel.spCode}" />
<!-- 运单类型(入参 awbType复用平板既有 businessType 字段与字典) -->
<com.lukouguoji.module_base.ui.weight.phone.PhoneDataLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
hint='@{"请选择运单类型"}'
list="@{viewModel.businessTypeList}"
title='@{"运单类型"}'
type="@{PhoneDataLayoutType.SPINNER}"
value="@={viewModel.businessType}" />
</com.lukouguoji.module_base.ui.weight.phone.PhoneFilterPanel>
</FrameLayout>
</layout>

View File

@@ -0,0 +1,123 @@
<?xml version="1.0" encoding="utf-8"?>
<!--
国内进港移库「拍照上传」—— 5.5 寸手持端专属页面(无平板变体)
对应设计稿 11_进港移库/photo.html
· 白卡「运单照片上传」+ 图片预览网格(复用公共 ImageSelectNewViewHolder末位加号槽位
· 底部两个按钮:拍照/上传(蓝) + 确认提交(绿)
提交走 DomImpMove/modifypic/originalPic/picNumber 三字段规范)。
-->
<layout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
xmlns:tools="http://schemas.android.com/tools">
<data>
<variable
name="viewModel"
type="com.lukouguoji.aerologic.page.gnj.move.stash.photo.GnjMoveStashPhotoViewModel" />
</data>
<LinearLayout
android:layout_width="match_parent"
android:layout_height="match_parent"
android:background="@color/phone_page_bg"
android:orientation="vertical">
<include layout="@layout/title_tool_bar" />
<ScrollView
android:layout_width="match_parent"
android:layout_height="0dp"
android:layout_weight="1"
android:fillViewport="true"
android:overScrollMode="never">
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="vertical"
android:padding="16dp">
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:background="@drawable/bg_phone_card"
android:orientation="vertical"
android:padding="16dp">
<!-- 标题:运单照片上传(副行展示运单号) -->
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="运单照片上传"
android:textColor="@color/phone_text_strong"
android:textSize="16sp"
android:textStyle="bold" />
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginTop="4dp"
android:text="@{viewModel.wbNo}"
android:textColor="@color/phone_text_body"
android:textSize="13sp"
tools:text="78133363573" />
<!-- 图片预览网格(末位加号槽位,长按出删除角标) -->
<androidx.recyclerview.widget.RecyclerView
android:id="@+id/rv"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginTop="12dp"
android:overScrollMode="never"
itemLayoutId="@{viewModel.itemLayoutId}"
viewHolder="@{viewModel.itemViewHolder}"
app:layoutManager="androidx.recyclerview.widget.GridLayoutManager"
app:spanCount="3"
tools:itemCount="3" />
<!-- 底部按钮:拍照/上传(蓝) + 确认提交(绿) -->
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginTop="16dp"
android:orientation="horizontal">
<TextView
android:layout_width="0dp"
android:layout_height="44dp"
android:layout_weight="1"
android:background="@drawable/bg_phone_btn_primary"
android:gravity="center"
android:onClick="@{()-> viewModel.pickClick()}"
android:text="拍照/上传"
android:textColor="@color/white"
android:textSize="15sp"
android:textStyle="bold" />
<TextView
android:layout_width="0dp"
android:layout_height="44dp"
android:layout_marginStart="12dp"
android:layout_weight="1"
android:background="@drawable/bg_phone_btn_green"
android:gravity="center"
android:onClick="@{()-> viewModel.submitClick()}"
android:text="确认提交"
android:textColor="@color/white"
android:textSize="15sp"
android:textStyle="bold" />
</LinearLayout>
</LinearLayout>
</LinearLayout>
</ScrollView>
</LinearLayout>
</layout>

View File

@@ -160,17 +160,6 @@
type="@{viewModel.pageType == DetailsPageType.Details ? PhoneFormRowType.TEXT : PhoneFormRowType.SELECT}" type="@{viewModel.pageType == DetailsPageType.Details ? PhoneFormRowType.TEXT : PhoneFormRowType.SELECT}"
value="@={viewModel.uldBean.carrier}" /> value="@={viewModel.uldBean.carrier}" />
<!-- 来源(后端字段暂不支持,已登记清单;提交后端忽略) -->
<com.lukouguoji.module_base.ui.weight.phone.PhoneFormRow
android:layout_width="match_parent"
android:layout_height="wrap_content"
enable="@{viewModel.pageType != DetailsPageType.Details}"
hint='@{"请选择来源"}'
list="@{viewModel.sourceEditList}"
title='@{"来源"}'
type="@{viewModel.pageType == DetailsPageType.Details ? PhoneFormRowType.TEXT : PhoneFormRowType.SELECT}"
value="@={viewModel.uldBean.source}" />
<!-- 自重(kg) --> <!-- 自重(kg) -->
<com.lukouguoji.module_base.ui.weight.phone.PhoneFormRow <com.lukouguoji.module_base.ui.weight.phone.PhoneFormRow
android:layout_width="match_parent" android:layout_width="match_parent"
@@ -221,6 +210,17 @@
type="@{viewModel.pageType == DetailsPageType.Details ? PhoneFormRowType.TEXT : PhoneFormRowType.INPUT}" type="@{viewModel.pageType == DetailsPageType.Details ? PhoneFormRowType.TEXT : PhoneFormRowType.INPUT}"
value="@={viewModel.uldBean.airport}" /> value="@={viewModel.uldBean.airport}" />
<!-- 来源(设计稿顺序位于所在港之后;后端字段暂不支持,已登记清单,提交后端忽略) -->
<com.lukouguoji.module_base.ui.weight.phone.PhoneFormRow
android:layout_width="match_parent"
android:layout_height="wrap_content"
enable="@{viewModel.pageType != DetailsPageType.Details}"
hint='@{"请选择来源"}'
list="@{viewModel.sourceEditList}"
title='@{"来源"}'
type="@{viewModel.pageType == DetailsPageType.Details ? PhoneFormRowType.TEXT : PhoneFormRowType.SELECT}"
value="@={viewModel.uldBean.source}" />
<!-- 入库时间(绑 checkInDate筛选/格式语义待后端确认,已登记清单) --> <!-- 入库时间(绑 checkInDate筛选/格式语义待后端确认,已登记清单) -->
<com.lukouguoji.module_base.ui.weight.phone.PhoneFormRow <com.lukouguoji.module_base.ui.weight.phone.PhoneFormRow
android:layout_width="match_parent" android:layout_width="match_parent"

View File

@@ -1,287 +1,227 @@
<?xml version="1.0" encoding="utf-8"?> <?xml version="1.0" encoding="utf-8"?>
<!--
国内进港移库 —— 列表项 5.5 寸手持端布局(平板变体见 layout-sw600dp/ 同名文件)
一套布局覆盖设计稿两种卡片形态,按 bean.isMoved 切换(载入时按端点打标):
· 待移库:圆形勾选框 + 蓝色运单号 + 橙色「待移库」标签
· 已移库:无勾选框 + 深色运单号 + 绿色对勾「已移库」
长按卡片出「拍照」浮层(跳拍照上传页),点浮层空白处收起。
-->
<layout xmlns:android="http://schemas.android.com/apk/res/android" <layout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
xmlns:tools="http://schemas.android.com/tools"> xmlns:tools="http://schemas.android.com/tools">
<data> <data>
<import type="android.view.View" />
<variable <variable
name="bean" name="bean"
type="com.lukouguoji.module_base.bean.MoveStashBean" /> type="com.lukouguoji.module_base.bean.MoveStashBean" />
<variable
name="position"
type="Integer" />
<variable
name="activity"
type="com.lukouguoji.aerologic.page.gnj.move.stash.list.GnjMoveStashListActivity" />
</data> </data>
<!-- 外层容器承载间距 --> <FrameLayout
<LinearLayout
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:layout_marginHorizontal="15dp" android:layout_marginHorizontal="12dp"
android:layout_marginVertical="5dp" android:layout_marginTop="12dp">
android:orientation="vertical">
<!-- 侧滑布局 --> <LinearLayout
<com.mcxtzhang.swipemenulib.SwipeMenuLayout
android:id="@+id/swipe_menu"
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="wrap_content"> android:layout_height="wrap_content"
android:background="@drawable/bg_phone_card"
android:onLongClick="@{()-> activity.showCardActionPhone(bean)}"
android:orientation="vertical"
android:padding="16dp">
<!-- 主列表项容器 --> <!-- ==================== 卡片头部:勾选框 + 运单号 + 状态 ==================== -->
<androidx.appcompat.widget.LinearLayoutCompat <LinearLayout
android:id="@+id/ll"
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:background="@drawable/bg_item" android:gravity="center_vertical"
android:orientation="horizontal" android:orientation="horizontal">
android:padding="10dp">
<!-- 圆形勾选框(已移库的记录不可勾选,隐藏) -->
<ImageView <ImageView
android:id="@+id/iv_icon" android:id="@+id/iv_icon"
loadImage="@{bean.checked ? @drawable/img_plane_s : @drawable/img_plane}" android:layout_width="20dp"
android:layout_width="40dp" android:layout_height="20dp"
android:layout_height="40dp" android:layout_marginEnd="8dp"
android:layout_gravity="center" android:src="@drawable/ic_phone_check_round_unchecked"
android:src="@drawable/img_plane" /> android:visibility="@{bean.isMoved ? View.GONE : View.VISIBLE}"
loadImage="@{bean.checked.get() ? @drawable/ic_phone_check_round_checked : @drawable/ic_phone_check_round_unchecked}" />
<LinearLayout <!-- 运单号 -->
<TextView
android:layout_width="0dp" android:layout_width="0dp"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:layout_marginLeft="10dp"
android:layout_weight="1" android:layout_weight="1"
android:orientation="vertical"> android:text="@{bean.wbNo}"
android:textColor="@{bean.isMoved ? @color/phone_text_title : @color/phone_primary}"
android:textSize="15sp"
android:textStyle="bold" />
<androidx.appcompat.widget.LinearLayoutCompat <!-- 待移库:橙色状态标签 -->
android:layout_width="match_parent" <TextView
android:layout_height="wrap_content"> android:layout_width="wrap_content"
android:layout_height="20dp"
android:layout_marginStart="8dp"
android:background="@drawable/bg_phone_tag_orange"
android:gravity="center"
android:paddingHorizontal="8dp"
android:text="待移库"
android:textColor="@color/phone_tag_orange_text"
android:textSize="11sp"
android:visibility="@{bean.isMoved ? View.GONE : View.VISIBLE}" />
<androidx.appcompat.widget.LinearLayoutCompat <!-- 已移库:对勾 + 状态文字 -->
android:layout_width="0dp" <LinearLayout
android:layout_height="wrap_content" android:layout_width="wrap_content"
android:layout_weight="1.1" android:layout_height="wrap_content"
android:gravity="center_vertical"> android:layout_marginStart="8dp"
android:gravity="center_vertical"
android:orientation="horizontal"
android:visibility="@{bean.isMoved ? View.VISIBLE : View.GONE}">
<TextView <ImageView
completeSpace="@{4}" android:layout_width="16dp"
android:layout_width="wrap_content" android:layout_height="16dp"
android:layout_height="wrap_content" android:src="@drawable/ic_phone_check_circle" />
android:text="运单号:" />
<TextView <TextView
android:layout_width="wrap_content" android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="@{bean.wbNo}"
android:textColor="@color/colorPrimary"
tools:text="789165431" />
</androidx.appcompat.widget.LinearLayoutCompat>
<androidx.appcompat.widget.LinearLayoutCompat
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_weight="0.8"
android:gravity="center_vertical">
<TextView
completeSpace="@{4}"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="件数:" />
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text='@{bean.pc}' />
</androidx.appcompat.widget.LinearLayoutCompat>
<androidx.appcompat.widget.LinearLayoutCompat
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_weight="0.7"
android:gravity="center_vertical">
<TextView
completeSpace="@{4}"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="重量:" />
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="@{bean.weight}" />
</androidx.appcompat.widget.LinearLayoutCompat>
<androidx.appcompat.widget.LinearLayoutCompat
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_weight="0.8"
android:gravity="center_vertical">
<TextView
completeSpace="@{4}"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="代理人:" />
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text='@{bean.agentCode}' />
</androidx.appcompat.widget.LinearLayoutCompat>
<androidx.appcompat.widget.LinearLayoutCompat
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_weight="1.1"
android:gravity="center_vertical">
<TextView
completeSpace="@{5}"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="运单类型:" />
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text='@{bean.awbType}' />
</androidx.appcompat.widget.LinearLayoutCompat>
</androidx.appcompat.widget.LinearLayoutCompat>
<androidx.appcompat.widget.LinearLayoutCompat
android:layout_width="match_parent"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:layout_marginTop="10dp"> android:layout_marginStart="4dp"
android:text="已移库"
<androidx.appcompat.widget.LinearLayoutCompat android:textColor="@color/phone_text_title"
android:layout_width="0dp" android:textSize="13sp" />
android:layout_height="wrap_content"
android:layout_weight="1.1"
android:gravity="center_vertical">
<TextView
completeSpace="@{4}"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="航班:" />
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="@{bean.flight}" />
</androidx.appcompat.widget.LinearLayoutCompat>
<androidx.appcompat.widget.LinearLayoutCompat
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_weight="0.8"
android:gravity="center_vertical">
<TextView
completeSpace="@{4}"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="始发港:" />
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="@{bean.origin}" />
</androidx.appcompat.widget.LinearLayoutCompat>
<androidx.appcompat.widget.LinearLayoutCompat
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_weight="0.8"
android:gravity="center_vertical">
<TextView
completeSpace="@{4}"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="起始站:" />
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="@{bean.dep}" />
</androidx.appcompat.widget.LinearLayoutCompat>
<androidx.appcompat.widget.LinearLayoutCompat
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_weight="0.8"
android:gravity="center_vertical">
<TextView
completeSpace="@{4}"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="目的港:" />
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="@{bean.dest}" />
</androidx.appcompat.widget.LinearLayoutCompat>
<androidx.appcompat.widget.LinearLayoutCompat
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_weight="1.1"
android:gravity="center_vertical">
<TextView
completeSpace="@{5}"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="品名:" />
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="@{bean.goods}" />
</androidx.appcompat.widget.LinearLayoutCompat>
</androidx.appcompat.widget.LinearLayoutCompat>
</LinearLayout> </LinearLayout>
<!-- 右侧箭头 --> </LinearLayout>
<ImageView
android:layout_width="30dp"
android:layout_height="30dp"
android:layout_gravity="center"
android:layout_marginLeft="10dp"
android:src="@drawable/img_pda_right" />
</androidx.appcompat.widget.LinearLayoutCompat> <!-- ==================== 航班信息行 ==================== -->
<LinearLayout
<!-- 侧滑菜单区域 --> android:layout_width="match_parent"
<androidx.appcompat.widget.LinearLayoutCompat android:layout_height="wrap_content"
android:layout_width="wrap_content" android:layout_marginTop="12dp"
android:layout_height="match_parent" android:layout_marginBottom="12dp"
android:gravity="center_vertical"
android:orientation="horizontal"> android:orientation="horizontal">
<!-- 编辑按钮 --> <ImageView
android:layout_width="14dp"
android:layout_height="14dp"
android:src="@drawable/ic_phone_airplane" />
<TextView <TextView
android:id="@+id/btn_edit" android:layout_width="0dp"
style="@style/tv_item_action" android:layout_height="wrap_content"
android:background="@color/colorPrimary" android:layout_marginStart="4dp"
android:text="编辑" /> android:layout_weight="1"
android:text='@{"航班信息:" + bean.orDash(bean.flight)}'
android:textColor="@color/phone_text_body"
android:textSize="13sp"
tools:text="航班信息20260709/MU2311" />
</androidx.appcompat.widget.LinearLayoutCompat> </LinearLayout>
</com.mcxtzhang.swipemenulib.SwipeMenuLayout> <!-- ==================== 统计框:特码 / 件数 / 重量 ==================== -->
<com.lukouguoji.module_base.ui.weight.phone.PhoneStatBox
android:layout_width="match_parent"
android:layout_height="wrap_content"
label1='@{"特码"}'
label2='@{"件数"}'
label3='@{"重量"}'
value1="@{bean.orDash(bean.spCode)}"
value2='@{bean.orDash(bean.pc) + "件"}'
value3='@{bean.orDash(bean.weight) + "kg"}' />
</LinearLayout> <!-- ==================== 出运路径 ==================== -->
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginTop="12dp"
android:gravity="center_vertical"
android:orientation="horizontal">
<ImageView
android:layout_width="14dp"
android:layout_height="14dp"
android:src="@drawable/ic_phone_location" />
<TextView
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_marginStart="6dp"
android:layout_weight="1"
android:text='@{"出运路径:" + bean.orDash(bean.range)}'
android:textColor="@color/phone_text_body"
android:textSize="13sp" />
</LinearLayout>
<!-- ==================== 查看详情 ==================== -->
<View
android:layout_width="match_parent"
android:layout_height="1px"
android:layout_marginTop="16dp"
android:background="@color/phone_stat_bg" />
<LinearLayout
android:id="@+id/ll_detail"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:gravity="center_vertical|end"
android:orientation="horizontal"
android:paddingTop="12dp">
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="查看详情"
android:textColor="@color/phone_primary"
android:textSize="14sp" />
<ImageView
android:layout_width="16dp"
android:layout_height="16dp"
android:src="@drawable/ic_phone_chevron_right" />
</LinearLayout>
</LinearLayout>
<!-- ==================== 长按操作浮层:拍照 ==================== -->
<FrameLayout
android:layout_width="match_parent"
android:layout_height="match_parent"
android:background="#66000000"
android:clickable="true"
android:onClick="@{()-> activity.hideCardActionPhone(bean)}"
android:visibility="@{bean.actionMenuVisible ? View.VISIBLE : View.GONE}">
<TextView
android:layout_width="56dp"
android:layout_height="56dp"
android:layout_gravity="center"
android:background="@drawable/bg_phone_fab_purple"
android:gravity="center"
android:onClick="@{()-> activity.openPhoto(bean)}"
android:text="拍照"
android:textColor="@color/white"
android:textSize="12sp"
android:textStyle="bold" />
</FrameLayout>
</FrameLayout>
</layout> </layout>

View File

@@ -162,6 +162,13 @@ data class GjcMaWb(
/** 5.5寸手机版:空值统一占位 "--"(空串与 null 都兜底,布局绑定用) */ /** 5.5寸手机版:空值统一占位 "--"(空串与 null 都兜底,布局绑定用) */
fun orDash(value: String?): String = if (value.isNullOrEmpty()) "--" else value fun orDash(value: String?): String = if (value.isNullOrEmpty()) "--" else value
/**
* 5.5寸手机版:代理人展示值(名称优先,空则回退代码)。
* 不能在 XML 里用 `??` 兜底——转换器会把 JSON null 归一成空串,`??` 只判 null 不判空串。
*/
val agentDisplay: String?
get() = if (agentName.isNullOrEmpty()) agentCode else agentName
/** /**
* 5.5寸手机版-出港仓库:卡片状态标签(已清仓=绿 / 未清仓=橙clearNormal 为空视作未清仓)。 * 5.5寸手机版-出港仓库:卡片状态标签(已清仓=绿 / 未清仓=橙clearNormal 为空视作未清仓)。
* 已清仓时卡片「清仓」按钮置灰不可点。 * 已清仓时卡片「清仓」按钮置灰不可点。

View File

@@ -54,4 +54,26 @@ data class IntImpQueryBean(
// ==================== 其他 ==================== // ==================== 其他 ====================
var remark: String? = null, // 备注 var remark: String? = null, // 备注
var activeId: Long? = null // 有效值 var activeId: Long? = null // 有效值
) ) {
/**
* 5.5寸手机版-进港查询:卡片状态标签。
* 已出库 = 出库时间dlvTime非空已入库 = 入库时间inDate非空都为空 = 未入库(灰)。
* 接口无独立状态出参,此判定为前端推断(与平板列表「入库时间/出库时间」两列同源)。
*/
val isQueryOutbound: Boolean
get() = !dlvTime.isNullOrEmpty()
val isQueryStored: Boolean
get() = !inDate.isNullOrEmpty()
/** 5.5寸手机版:空值统一占位 "--"(空串与 null 都兜底,布局绑定用) */
fun orDash(value: String?): String = if (value.isNullOrEmpty()) "--" else value
/**
* 5.5寸手机版:代理人展示值(名称优先,空则回退代码)。
* 不能在 XML 里用 `??` 兜底——转换器会把 JSON null 归一成空串,`??` 只判 null 不判空串。
*/
val agentDisplay: String?
get() = if (agentName.isNullOrEmpty()) agentCode else agentName
}

View File

@@ -6,6 +6,7 @@ import com.lukouguoji.module_base.interfaces.ICheck
class MoveStashBean : ICheck { class MoveStashBean : ICheck {
var activeId: String = "" // null var activeId: String = "" // null
var agentCode: String = "" // HFEXB var agentCode: String = "" // HFEXB
var agentName: String = "" // 代理人名称search 出参有定义)
var awbType: String = "" // 国际进港(国内中转) var awbType: String = "" // 国际进港(国内中转)
var businessType: String = "" // null var businessType: String = "" // null
var by1: String = "" // null var by1: String = "" // null
@@ -49,4 +50,19 @@ class MoveStashBean : ICheck {
override fun getCheckObservable(): ObservableBoolean { override fun getCheckObservable(): ObservableBoolean {
return checked return checked
} }
// ========== 5.5 寸手持端展示辅助字段(仅前端使用,不参与提交) ==========
/** 是否已移库由列表加载端点决定search=待移库 / searchMoved=已移库),载入时打标 */
var isMoved: Boolean = false
/** 卡片长按「拍照」操作浮层显隐(仅 UI 状态) */
val actionMenuVisible = ObservableBoolean(false)
/** 代理显示:网络层会把 null 归一成空串,须 isNullOrEmpty 双兜底(沿用进港/出港查询口径) */
val agentDisplay: String
get() = if (agentName.isNotEmpty()) agentName else agentCode
/** 详情页/卡片字段统一空值占位 */
fun orDash(value: String?): String = if (value.isNullOrEmpty()) "-" else value
} }

View File

@@ -272,6 +272,8 @@ interface Constant {
const val IntImpTally = "AppIntImpTally" //理货报告 const val IntImpTally = "AppIntImpTally" //理货报告
const val IntImpPickUpRecord = "AppIntImpPickUpRecord" //提取记录 const val IntImpPickUpRecord = "AppIntImpPickUpRecord" //提取记录
const val IntImpPickUpDLV = "AppIntImpPickUpDLV" //提取出库 const val IntImpPickUpDLV = "AppIntImpPickUpDLV" //提取出库
// 进港移库后端暂无该模块与权限串2026-07-31 api-doc 核对),按 AppIntImp* 命名约定预定义,
// 权限串下发前手机首页菜单不会显示该入口(已登记后端接口对接问题清单)
const val IntImpAccidentVisa = "AppIntImpAccidentVisa" //事故签证 const val IntImpAccidentVisa = "AppIntImpAccidentVisa" //事故签证
const val GjjManifestListActivity = "AppIntExpManifest" //舱单 const val GjjManifestListActivity = "AppIntExpManifest" //舱单
const val GjjTallyListActivity = "AppIntExpTally" //理货 const val GjjTallyListActivity = "AppIntExpTally" //理货

View File

@@ -1766,6 +1766,12 @@ interface Api {
@POST("DomImpMove/search") @POST("DomImpMove/search")
suspend fun getGnjMoveStashList(@Body data: RequestBody): BaseListBean<MoveStashBean> suspend fun getGnjMoveStashList(@Body data: RequestBody): BaseListBean<MoveStashBean>
/**
* 获取-国内进港移库-已移库列表移库完成分页搜索5.5 寸手机端「已移库」Tab
*/
@POST("DomImpMove/searchMoved")
suspend fun getGnjMoveStashMovedList(@Body data: RequestBody): BaseListBean<MoveStashBean>
/** /**
* 获取-国内进港移库-列表--运单列表 * 获取-国内进港移库-列表--运单列表
*/ */

View File

@@ -104,6 +104,7 @@ object ARouterConstants {
// 国内进港移库(新版本) // 国内进港移库(新版本)
const val ACTIVITY_URL_GNJ_YIKU_LIST = "/gnj/GnjYiKuListActivity" //国内进港 移库列表 const val ACTIVITY_URL_GNJ_YIKU_LIST = "/gnj/GnjYiKuListActivity" //国内进港 移库列表
const val ACTIVITY_URL_GNJ_MOVE_STASH_LIST = "/app/GnjMoveStashListActivity" //国内进港 移库(首页菜单实际跳转页,双形态)
const val ACTIVITY_URL_GNJ_YIKU_DETAILS = "/gnj/GnjYiKuDetailsActivity" //国内进港 移库详情 const val ACTIVITY_URL_GNJ_YIKU_DETAILS = "/gnj/GnjYiKuDetailsActivity" //国内进港 移库详情
const val ACTIVITY_URL_GNJ_YIKU_EDIT = "/gnj/GnjYiKuEditActivity" //国内进港 移库编辑 const val ACTIVITY_URL_GNJ_YIKU_EDIT = "/gnj/GnjYiKuEditActivity" //国内进港 移库编辑
const val ACTIVITY_URL_GNJ_YIKU_HANDOVER = "/gnj/GnjYiKuHandoverActivity" //国内进港 移交编辑/详情 const val ACTIVITY_URL_GNJ_YIKU_HANDOVER = "/gnj/GnjYiKuHandoverActivity" //国内进港 移交编辑/详情

View File

@@ -0,0 +1,16 @@
<?xml version="1.0" encoding="utf-8"?>
<!-- 手机版绿色操作按钮:完成态绿实底 + 10dp 圆角(进港移库-拍照上传「确认提交」) -->
<selector xmlns:android="http://schemas.android.com/apk/res/android">
<item android:state_pressed="true">
<shape android:shape="rectangle">
<solid android:color="#0E9F6E" />
<corners android:radius="10dp" />
</shape>
</item>
<item>
<shape android:shape="rectangle">
<solid android:color="@color/phone_green" />
<corners android:radius="10dp" />
</shape>
</item>
</selector>

View File

@@ -0,0 +1,9 @@
<?xml version="1.0" encoding="utf-8"?>
<!-- 手机版详情卡片表头:橙色底 + 顶部 12dp 圆角(进港移库-异常照片卡片) -->
<shape xmlns:android="http://schemas.android.com/apk/res/android"
android:shape="rectangle">
<solid android:color="@color/phone_amber" />
<corners
android:topLeftRadius="12dp"
android:topRightRadius="12dp" />
</shape>

View File

@@ -0,0 +1,12 @@
<?xml version="1.0" encoding="utf-8"?>
<!-- 手机版照片加号槽位:灰色虚线边框 + 8dp 圆角(进港移库-异常照片) -->
<shape xmlns:android="http://schemas.android.com/apk/res/android"
android:shape="rectangle">
<solid android:color="@android:color/transparent" />
<corners android:radius="8dp" />
<stroke
android:width="1dp"
android:color="@color/phone_divider"
android:dashGap="4dp"
android:dashWidth="4dp" />
</shape>

View File

@@ -79,5 +79,6 @@
<color name="phone_tag_indigo_text">#6366F1</color> <color name="phone_tag_indigo_text">#6366F1</color>
<color name="phone_tag_amber_bg">#FEF3C7</color> <!-- 状态标签-琥珀底(出港运抵申报状态 E --> <color name="phone_tag_amber_bg">#FEF3C7</color> <!-- 状态标签-琥珀底(出港运抵申报状态 E -->
<color name="phone_tag_amber_text">#D97706</color> <color name="phone_tag_amber_text">#D97706</color>
<color name="phone_amber">#F59E0B</color> <!-- 橙色信息卡表头(进港移库-异常照片) -->
</resources> </resources>

View File

@@ -32,7 +32,7 @@ class GjcQueryActivity :
override fun viewModelClass() = GjcQueryViewModel::class.java override fun viewModelClass() = GjcQueryViewModel::class.java
override fun initOnCreate(savedInstanceState: Bundle?) { override fun initOnCreate(savedInstanceState: Bundle?) {
setBackArrow("国际出港查询") setBackArrow(if (DeviceUtil.isPhone()) "出港查询" else "国际出港查询")
binding.viewModel = viewModel binding.viewModel = viewModel

View File

@@ -1,90 +1,91 @@
package com.lukouguoji.gjc.activity package com.lukouguoji.gjc.activity
import android.content.Context import android.content.Context
import android.content.Intent import android.content.Intent
import android.os.Bundle import android.os.Bundle
import android.view.Gravity import android.view.Gravity
import android.widget.ImageView import android.widget.ImageView
import android.widget.LinearLayout import android.widget.LinearLayout
import androidx.appcompat.widget.Toolbar import androidx.appcompat.widget.Toolbar
import com.alibaba.android.arouter.facade.annotation.Route import com.alibaba.android.arouter.facade.annotation.Route
import com.alibaba.android.arouter.launcher.ARouter import com.alibaba.android.arouter.launcher.ARouter
import com.lukouguoji.gjc.R import com.lukouguoji.gjc.R
import com.lukouguoji.gjc.databinding.ActivityGjcQueryDetailsBinding import com.lukouguoji.gjc.databinding.ActivityGjcQueryDetailsBinding
import com.lukouguoji.gjc.viewModel.GjcQueryDetailsViewModel import com.lukouguoji.gjc.viewModel.GjcQueryDetailsViewModel
import com.lukouguoji.module_base.base.BaseBindingActivity import com.lukouguoji.module_base.base.BaseBindingActivity
import com.lukouguoji.module_base.base.CustomVP2Adapter import com.lukouguoji.module_base.base.CustomVP2Adapter
import com.lukouguoji.module_base.common.Constant import com.lukouguoji.module_base.common.Constant
import com.lukouguoji.module_base.router.ARouterConstants import com.lukouguoji.module_base.router.ARouterConstants
import com.lukouguoji.module_base.util.DeviceUtil
/**
* 国际出港查询详情页面 /**
*/ * 国际出港查询详情页面
@Route(path = ARouterConstants.ACTIVITY_URL_GJC_QUERY_DETAILS) */
class GjcQueryDetailsActivity : @Route(path = ARouterConstants.ACTIVITY_URL_GJC_QUERY_DETAILS)
BaseBindingActivity<ActivityGjcQueryDetailsBinding, GjcQueryDetailsViewModel>() { class GjcQueryDetailsActivity :
BaseBindingActivity<ActivityGjcQueryDetailsBinding, GjcQueryDetailsViewModel>() {
override fun layoutId() = R.layout.activity_gjc_query_details
override fun viewModelClass() = GjcQueryDetailsViewModel::class.java override fun layoutId() = R.layout.activity_gjc_query_details
override fun viewModelClass() = GjcQueryDetailsViewModel::class.java
override fun initOnCreate(savedInstanceState: Bundle?) {
setBackArrow("国际出港查询详情") override fun initOnCreate(savedInstanceState: Bundle?) {
binding.viewModel = viewModel setBackArrow(if (DeviceUtil.isPhone()) "出港货物" else "国际出港查询详情")
binding.viewModel = viewModel
// 初始化ViewModel(传入maWbId)
viewModel.initOnCreated(intent) // 初始化ViewModel(传入maWbId)
viewModel.initOnCreated(intent)
// 配置ViewPager2
binding.vp.adapter = CustomVP2Adapter( // 配置ViewPager2
viewModel.fragmentList, binding.vp.adapter = CustomVP2Adapter(
supportFragmentManager, viewModel.fragmentList,
lifecycle supportFragmentManager,
) lifecycle
binding.vp.isUserInputEnabled = false // 禁用滑动 )
binding.vp.offscreenPageLimit = 3 // 预加载3个Fragment binding.vp.isUserInputEnabled = false // 禁用滑动
binding.vp.offscreenPageLimit = 3 // 预加载3个Fragment
// 监听Tab索引变化,切换Fragment
viewModel.currentTab.observe(this) { // 监听Tab索引变化,切换Fragment
binding.vp.setCurrentItem(it, false) // false:无动画 viewModel.currentTab.observe(this) {
} binding.vp.setCurrentItem(it, false) // false:无动画
}
// 标题栏右侧添加日志查询图标
val toolbar = findViewById<Toolbar>(com.lukouguoji.module_base.R.id.toolbar) // 标题栏右侧添加日志查询图标
val logIcon = ImageView(this).apply { val toolbar = findViewById<Toolbar>(com.lukouguoji.module_base.R.id.toolbar)
setImageResource(com.lukouguoji.module_base.R.drawable.img_log) val logIcon = ImageView(this).apply {
layoutParams = Toolbar.LayoutParams( setImageResource(com.lukouguoji.module_base.R.drawable.img_log)
LinearLayout.LayoutParams.WRAP_CONTENT, layoutParams = Toolbar.LayoutParams(
LinearLayout.LayoutParams.WRAP_CONTENT LinearLayout.LayoutParams.WRAP_CONTENT,
).apply { LinearLayout.LayoutParams.WRAP_CONTENT
gravity = Gravity.END or Gravity.CENTER_VERTICAL ).apply {
marginEnd = 15 gravity = Gravity.END or Gravity.CENTER_VERTICAL
width = 30.dp marginEnd = 15
height = 30.dp width = 30.dp
} height = 30.dp
setOnClickListener { }
val wbNo = viewModel.maWbData.value?.get("wbNo") as? String ?: "" setOnClickListener {
ARouter.getInstance() val wbNo = viewModel.maWbData.value?.get("wbNo") as? String ?: ""
.build(ARouterConstants.ACTIVITY_URL_LOG_DETAIL) ARouter.getInstance()
.withString(Constant.Key.KEY, wbNo) .build(ARouterConstants.ACTIVITY_URL_LOG_DETAIL)
.withString(Constant.Key.AWB_TYPE, "IO") .withString(Constant.Key.KEY, wbNo)
.navigation() .withString(Constant.Key.AWB_TYPE, "IO")
} .navigation()
} }
toolbar.addView(logIcon) }
toolbar.addView(logIcon)
// 加载详情数据
viewModel.loadDetails() // 加载详情数据
} viewModel.loadDetails()
}
private val Int.dp: Int
get() = (this * resources!!.displayMetrics.density).toInt() private val Int.dp: Int
get() = (this * resources!!.displayMetrics.density).toInt()
companion object {
@JvmStatic companion object {
fun start(context: Context, maWbId: Long?) { @JvmStatic
val starter = Intent(context, GjcQueryDetailsActivity::class.java) fun start(context: Context, maWbId: Long?) {
.putExtra(Constant.Key.ID, maWbId?.toString() ?: "") val starter = Intent(context, GjcQueryDetailsActivity::class.java)
context.startActivity(starter) .putExtra(Constant.Key.ID, maWbId?.toString() ?: "")
} context.startActivity(starter)
} }
} }
}

View File

@@ -1,105 +1,105 @@
package com.lukouguoji.gjc.activity package com.lukouguoji.gjc.activity
import android.content.Context import android.content.Context
import android.content.Intent import android.content.Intent
import android.os.Bundle import android.os.Bundle
import androidx.databinding.ObservableBoolean import androidx.databinding.ObservableBoolean
import com.alibaba.android.arouter.facade.annotation.Route import com.alibaba.android.arouter.facade.annotation.Route
import com.lukouguoji.gjc.R import com.lukouguoji.gjc.R
import com.lukouguoji.gjc.databinding.ActivityGjcWeighingListBinding import com.lukouguoji.gjc.databinding.ActivityGjcWeighingListBinding
import com.lukouguoji.gjc.viewModel.GjcWeighingViewModel import com.lukouguoji.gjc.viewModel.GjcWeighingViewModel
import com.lukouguoji.module_base.base.BaseBindingActivity import com.lukouguoji.module_base.base.BaseBindingActivity
import com.lukouguoji.module_base.bean.GjcWeighingBean import com.lukouguoji.module_base.bean.GjcWeighingBean
import com.lukouguoji.module_base.common.ConstantEvent import com.lukouguoji.module_base.common.ConstantEvent
import com.lukouguoji.module_base.impl.FlowBus import com.lukouguoji.module_base.impl.FlowBus
import com.lukouguoji.module_base.impl.observe import com.lukouguoji.module_base.impl.observe
import com.lukouguoji.module_base.ktx.getLifecycleOwner import com.lukouguoji.module_base.ktx.getLifecycleOwner
import com.lukouguoji.module_base.router.ARouterConstants import com.lukouguoji.module_base.router.ARouterConstants
import com.lukouguoji.module_base.util.DeviceUtil import com.lukouguoji.module_base.util.DeviceUtil
/** /**
* 国际出港计重列表页 * 国际出港计重列表页
* *
* 布局 id 不区分设备,平板/手机由资源限定符自动选择: * 布局 id 不区分设备,平板/手机由资源限定符自动选择:
* layout-sw600dp/activity_gjc_weighing_list.xml平板 * layout-sw600dp/activity_gjc_weighing_list.xml平板
* layout/activity_gjc_weighing_list.xml手机 * layout/activity_gjc_weighing_list.xml手机
*/ */
@Route(path = ARouterConstants.ACTIVITY_URL_GJC_WEIGHING_LIST) @Route(path = ARouterConstants.ACTIVITY_URL_GJC_WEIGHING_LIST)
class GjcWeighingListActivity : class GjcWeighingListActivity :
BaseBindingActivity<ActivityGjcWeighingListBinding, GjcWeighingViewModel>() { BaseBindingActivity<ActivityGjcWeighingListBinding, GjcWeighingViewModel>() {
override fun layoutId() = R.layout.activity_gjc_weighing_list override fun layoutId() = R.layout.activity_gjc_weighing_list
override fun viewModelClass() = GjcWeighingViewModel::class.java override fun viewModelClass() = GjcWeighingViewModel::class.java
/** 手机版筛选弹层显隐(仅 UI 状态,不涉及业务逻辑) */ /** 手机版筛选弹层显隐(仅 UI 状态,不涉及业务逻辑) */
val filterPanelVisible = ObservableBoolean(false) val filterPanelVisible = ObservableBoolean(false)
override fun initOnCreate(savedInstanceState: Bundle?) { override fun initOnCreate(savedInstanceState: Bundle?) {
setBackArrow("国际出港待计重") setBackArrow(if (DeviceUtil.isPhone()) "出港待计重" else "国际出港待计重")
binding.viewModel = viewModel binding.viewModel = viewModel
binding.activity = this binding.activity = this
// 手机版专属数据:放开默认日期、加载筛选弹层字典、启用三格统计 // 手机版专属数据:放开默认日期、加载筛选弹层字典、启用三格统计
// 平板端不调用,查询链路与请求次数与改造前完全一致 // 平板端不调用,查询链路与请求次数与改造前完全一致
if (DeviceUtil.isPhone()) { if (DeviceUtil.isPhone()) {
viewModel.initPhoneExtras() viewModel.initPhoneExtras()
} }
// 初始化代理人列表从API获取 // 初始化代理人列表从API获取
viewModel.initAgentList() viewModel.initAgentList()
// 初始化特码列表从API获取 // 初始化特码列表从API获取
viewModel.initSpecialCodeList() viewModel.initSpecialCodeList()
// 绑定分页逻辑 // 绑定分页逻辑
viewModel.pageModel viewModel.pageModel
.bindSmartRefreshLayout(binding.srl, binding.rv, viewModel, getLifecycleOwner()) .bindSmartRefreshLayout(binding.srl, binding.rv, viewModel, getLifecycleOwner())
// 监听刷新事件 // 监听刷新事件
FlowBus.with<String>(ConstantEvent.EVENT_CHECK_CHANGED).observe(this) { viewModel.onItemCheckChanged() } FlowBus.with<String>(ConstantEvent.EVENT_CHECK_CHANGED).observe(this) { viewModel.onItemCheckChanged() }
FlowBus.with<String>(ConstantEvent.EVENT_REFRESH) FlowBus.with<String>(ConstantEvent.EVENT_REFRESH)
.observe(this) { .observe(this) {
viewModel.refresh() viewModel.refresh()
} }
// 初始加载 // 初始加载
viewModel.refresh() viewModel.refresh()
} }
// ==================== 手机版专用交互(纯 UI复用既有 ViewModel 字段) ==================== // ==================== 手机版专用交互(纯 UI复用既有 ViewModel 字段) ====================
/** 手机版筛选弹层显隐切换 */ /** 手机版筛选弹层显隐切换 */
fun toggleFilterPanel() { fun toggleFilterPanel() {
filterPanelVisible.set(!filterPanelVisible.get()) filterPanelVisible.set(!filterPanelVisible.get())
} }
/** 手机版筛选:重置(只清弹层内条件,不影响顶部搜索框) */ /** 手机版筛选:重置(只清弹层内条件,不影响顶部搜索框) */
fun resetFilter() { fun resetFilter() {
viewModel.channelFilter.value = "" viewModel.channelFilter.value = ""
viewModel.carrierFilter.value = "" viewModel.carrierFilter.value = ""
viewModel.awbTypeFilter.value = "" viewModel.awbTypeFilter.value = ""
viewModel.agentCode.value = "" viewModel.agentCode.value = ""
} }
/** 手机版筛选:确认 */ /** 手机版筛选:确认 */
fun confirmFilter() { fun confirmFilter() {
filterPanelVisible.set(false) filterPanelVisible.set(false)
viewModel.searchClick() viewModel.searchClick()
} }
/** 手机版卡片内「提前运抵」(单票,由 ViewHolder 调用) */ /** 手机版卡片内「提前运抵」(单票,由 ViewHolder 调用) */
fun preArriveClick(bean: GjcWeighingBean) { fun preArriveClick(bean: GjcWeighingBean) {
viewModel.arrivedAheadSingle(bean) viewModel.arrivedAheadSingle(bean)
} }
companion object { companion object {
@JvmStatic @JvmStatic
fun start(context: Context) { fun start(context: Context) {
val starter = Intent(context, GjcWeighingListActivity::class.java) val starter = Intent(context, GjcWeighingListActivity::class.java)
context.startActivity(starter) context.startActivity(starter)
} }
} }
} }

View File

@@ -1,103 +1,104 @@
package com.lukouguoji.gjc.activity package com.lukouguoji.gjc.activity
import android.content.Context import android.content.Context
import android.content.Intent import android.content.Intent
import android.os.Bundle import android.os.Bundle
import androidx.recyclerview.widget.DividerItemDecoration import androidx.recyclerview.widget.DividerItemDecoration
import androidx.recyclerview.widget.LinearLayoutManager import androidx.recyclerview.widget.LinearLayoutManager
import com.alibaba.android.arouter.facade.annotation.Route import com.alibaba.android.arouter.facade.annotation.Route
import com.lukouguoji.gjc.R import com.lukouguoji.gjc.R
import com.lukouguoji.gjc.databinding.ActivityGjcWeighingRecordDetailsBinding import com.lukouguoji.gjc.databinding.ActivityGjcWeighingRecordDetailsBinding
import com.lukouguoji.gjc.holder.GjcCheckInRecordViewHolder import com.lukouguoji.gjc.holder.GjcCheckInRecordViewHolder
import com.lukouguoji.gjc.viewModel.GjcWeighingRecordDetailsViewModel import com.lukouguoji.gjc.viewModel.GjcWeighingRecordDetailsViewModel
import com.lukouguoji.module_base.base.BaseBindingActivity import com.lukouguoji.module_base.base.BaseBindingActivity
import com.lukouguoji.module_base.base.CommonAdapter import com.lukouguoji.module_base.base.CommonAdapter
import com.lukouguoji.module_base.bean.GjcCheckInRecord import com.lukouguoji.module_base.bean.GjcCheckInRecord
import com.lukouguoji.module_base.bean.GjcWeighingRecordBean import com.lukouguoji.module_base.bean.GjcWeighingRecordBean
import com.lukouguoji.module_base.common.Constant import com.lukouguoji.module_base.common.Constant
import com.lukouguoji.module_base.router.ARouterConstants import com.lukouguoji.module_base.router.ARouterConstants
import com.lukouguoji.module_base.util.DeviceUtil
/**
* 国际出港计重明细页 /**
* * 国际出港计重明细页
* 布局 id 不区分设备,平板/手机由资源限定符自动选择: *
* layout-sw600dp/activity_gjc_weighing_record_details.xml平板列表内联编辑 * 布局 id 不区分设备,平板/手机由资源限定符自动选择:
* layout/activity_gjc_weighing_record_details.xml手机,单条记录经全屏「修改记录」覆层编辑) * layout-sw600dp/activity_gjc_weighing_record_details.xml平板,列表内联编辑)
*/ * layout/activity_gjc_weighing_record_details.xml手机单条记录经全屏「修改记录」覆层编辑
@Route(path = ARouterConstants.ACTIVITY_URL_GJC_WEIGHING_RECORD_DETAILS) */
class GjcWeighingRecordDetailsActivity : @Route(path = ARouterConstants.ACTIVITY_URL_GJC_WEIGHING_RECORD_DETAILS)
BaseBindingActivity<ActivityGjcWeighingRecordDetailsBinding, GjcWeighingRecordDetailsViewModel>() { class GjcWeighingRecordDetailsActivity :
BaseBindingActivity<ActivityGjcWeighingRecordDetailsBinding, GjcWeighingRecordDetailsViewModel>() {
private lateinit var adapter: CommonAdapter
private lateinit var adapter: CommonAdapter
// 当前编辑模式供ViewHolder获取
var currentEditMode = false // 当前编辑模式供ViewHolder获取
var currentEditMode = false
override fun layoutId() = R.layout.activity_gjc_weighing_record_details
override fun layoutId() = R.layout.activity_gjc_weighing_record_details
override fun viewModelClass() = GjcWeighingRecordDetailsViewModel::class.java
override fun viewModelClass() = GjcWeighingRecordDetailsViewModel::class.java
override fun initOnCreate(savedInstanceState: Bundle?) {
setBackArrow("国际出港计重明细") override fun initOnCreate(savedInstanceState: Bundle?) {
setBackArrow(if (DeviceUtil.isPhone()) "计重明细" else "国际出港计重明细")
binding.viewModel = viewModel
binding.viewModel = viewModel
// 初始化RecyclerView
val layoutManager = LinearLayoutManager(this) // 初始化RecyclerView
binding.recyclerView.layoutManager = layoutManager val layoutManager = LinearLayoutManager(this)
binding.recyclerView.layoutManager = layoutManager
// 添加分割线
val divider = DividerItemDecoration(this, DividerItemDecoration.VERTICAL) // 添加分割线
binding.recyclerView.addItemDecoration(divider) val divider = DividerItemDecoration(this, DividerItemDecoration.VERTICAL)
binding.recyclerView.addItemDecoration(divider)
adapter = CommonAdapter(
this, adapter = CommonAdapter(
R.layout.item_gjc_check_in_record, this,
GjcCheckInRecordViewHolder::class.java R.layout.item_gjc_check_in_record,
) GjcCheckInRecordViewHolder::class.java
binding.recyclerView.adapter = adapter )
binding.recyclerView.adapter = adapter
// 监听数据变化更新RecyclerView
viewModel.recordList.observe(this) { records -> // 监听数据变化更新RecyclerView
adapter.refresh(records) viewModel.recordList.observe(this) { records ->
} adapter.refresh(records)
}
// 监听编辑模式变化,更新当前编辑模式并刷新列表
viewModel.isEditMode.observe(this) { isEditMode -> // 监听编辑模式变化,更新当前编辑模式并刷新列表
// 更新当前编辑模式状态 viewModel.isEditMode.observe(this) { isEditMode ->
currentEditMode = isEditMode // 更新当前编辑模式状态
currentEditMode = isEditMode
// 刷新所有可见的 ViewHolder
adapter.notifyDataSetChanged() // 刷新所有可见的 ViewHolder
} adapter.notifyDataSetChanged()
}
// 初始化数据
viewModel.initOnCreated(intent) // 初始化数据
} viewModel.initOnCreated(intent)
}
// ==================== 手机版专用交互(纯 UI复用既有 ViewModel 编辑链路) ====================
// ==================== 手机版专用交互(纯 UI复用既有 ViewModel 编辑链路) ====================
/**
* 手机版:打开「修改记录」覆层编辑指定记录。 /**
* 复用 [GjcWeighingRecordDetailsViewModel.onModifyClick] 的备份/编辑态逻辑, * 手机版:打开「修改记录」覆层编辑指定记录。
* 覆层显隐由 isEditMode 驱动(平板端该状态驱动列表内联编辑,互不影响)。 * 复用 [GjcWeighingRecordDetailsViewModel.onModifyClick] 的备份/编辑态逻辑,
*/ * 覆层显隐由 isEditMode 驱动(平板端该状态驱动列表内联编辑,互不影响)。
fun openPhoneEdit(record: GjcCheckInRecord) { */
viewModel.onModifyClick() fun openPhoneEdit(record: GjcCheckInRecord) {
binding.editRecord = record viewModel.onModifyClick()
} binding.editRecord = record
}
/** 手机版:取消编辑(恢复备份并收起覆层) */
fun closePhoneEdit() { /** 手机版:取消编辑(恢复备份并收起覆层) */
viewModel.onCancelClick() fun closePhoneEdit() {
} viewModel.onCancelClick()
}
companion object {
@JvmStatic companion object {
fun start(context: Context, bean: GjcWeighingRecordBean) { @JvmStatic
val starter = Intent(context, GjcWeighingRecordDetailsActivity::class.java) fun start(context: Context, bean: GjcWeighingRecordBean) {
.putExtra(Constant.Key.BEAN, bean) val starter = Intent(context, GjcWeighingRecordDetailsActivity::class.java)
context.startActivity(starter) .putExtra(Constant.Key.BEAN, bean)
} context.startActivity(starter)
} }
} }
}

View File

@@ -1,99 +1,99 @@
package com.lukouguoji.gjc.activity package com.lukouguoji.gjc.activity
import android.content.Context import android.content.Context
import android.content.Intent import android.content.Intent
import android.os.Bundle import android.os.Bundle
import androidx.databinding.ObservableBoolean import androidx.databinding.ObservableBoolean
import com.alibaba.android.arouter.facade.annotation.Route import com.alibaba.android.arouter.facade.annotation.Route
import com.lukouguoji.gjc.R import com.lukouguoji.gjc.R
import com.lukouguoji.gjc.databinding.ActivityGjcWeighingRecordListBinding import com.lukouguoji.gjc.databinding.ActivityGjcWeighingRecordListBinding
import com.lukouguoji.gjc.viewModel.GjcWeighingRecordViewModel import com.lukouguoji.gjc.viewModel.GjcWeighingRecordViewModel
import com.lukouguoji.module_base.base.BaseBindingActivity import com.lukouguoji.module_base.base.BaseBindingActivity
import com.lukouguoji.module_base.common.ConstantEvent import com.lukouguoji.module_base.common.ConstantEvent
import com.lukouguoji.module_base.impl.FlowBus import com.lukouguoji.module_base.impl.FlowBus
import com.lukouguoji.module_base.impl.observe import com.lukouguoji.module_base.impl.observe
import com.lukouguoji.module_base.ktx.getLifecycleOwner import com.lukouguoji.module_base.ktx.getLifecycleOwner
import com.lukouguoji.module_base.router.ARouterConstants import com.lukouguoji.module_base.router.ARouterConstants
import com.lukouguoji.module_base.util.DeviceUtil import com.lukouguoji.module_base.util.DeviceUtil
/** /**
* 国际出港计重记录列表页 * 国际出港计重记录列表页
* *
* 布局 id 不区分设备,平板/手机由资源限定符自动选择: * 布局 id 不区分设备,平板/手机由资源限定符自动选择:
* layout-sw600dp/activity_gjc_weighing_record_list.xml平板 * layout-sw600dp/activity_gjc_weighing_record_list.xml平板
* layout/activity_gjc_weighing_record_list.xml手机 * layout/activity_gjc_weighing_record_list.xml手机
*/ */
@Route(path = ARouterConstants.ACTIVITY_URL_GJC_WEIGHING_RECORD_LIST) @Route(path = ARouterConstants.ACTIVITY_URL_GJC_WEIGHING_RECORD_LIST)
class GjcWeighingRecordListActivity : class GjcWeighingRecordListActivity :
BaseBindingActivity<ActivityGjcWeighingRecordListBinding, GjcWeighingRecordViewModel>() { BaseBindingActivity<ActivityGjcWeighingRecordListBinding, GjcWeighingRecordViewModel>() {
override fun layoutId() = R.layout.activity_gjc_weighing_record_list override fun layoutId() = R.layout.activity_gjc_weighing_record_list
override fun viewModelClass() = GjcWeighingRecordViewModel::class.java override fun viewModelClass() = GjcWeighingRecordViewModel::class.java
/** 手机版筛选弹层显隐(仅 UI 状态,不涉及业务逻辑) */ /** 手机版筛选弹层显隐(仅 UI 状态,不涉及业务逻辑) */
val filterPanelVisible = ObservableBoolean(false) val filterPanelVisible = ObservableBoolean(false)
override fun initOnCreate(savedInstanceState: Bundle?) { override fun initOnCreate(savedInstanceState: Bundle?) {
setBackArrow("国际出港计重记录") setBackArrow(if (DeviceUtil.isPhone()) "计重记录" else "国际出港计重记录")
binding.viewModel = viewModel binding.viewModel = viewModel
binding.activity = this binding.activity = this
// 手机版专属数据:放开默认日期、加载计重人下拉 // 手机版专属数据:放开默认日期、加载计重人下拉
// 平板端不调用,查询链路与请求次数与改造前完全一致 // 平板端不调用,查询链路与请求次数与改造前完全一致
if (DeviceUtil.isPhone()) { if (DeviceUtil.isPhone()) {
viewModel.initPhoneExtras() viewModel.initPhoneExtras()
} }
// 初始化代理人列表 // 初始化代理人列表
viewModel.initAgentList() viewModel.initAgentList()
// 初始化特码列表 // 初始化特码列表
viewModel.initSpecialCodeList() viewModel.initSpecialCodeList()
// 绑定分页逻辑 // 绑定分页逻辑
viewModel.pageModel viewModel.pageModel
.bindSmartRefreshLayout(binding.srl, binding.rv, viewModel, getLifecycleOwner()) .bindSmartRefreshLayout(binding.srl, binding.rv, viewModel, getLifecycleOwner())
// 监听刷新事件 // 监听刷新事件
FlowBus.with<String>(ConstantEvent.EVENT_REFRESH) FlowBus.with<String>(ConstantEvent.EVENT_REFRESH)
.observe(this) { .observe(this) {
viewModel.refresh() viewModel.refresh()
} }
// 初始加载 // 初始加载
viewModel.refresh() viewModel.refresh()
} }
// ==================== 手机版专用交互(纯 UI复用既有 ViewModel 字段) ==================== // ==================== 手机版专用交互(纯 UI复用既有 ViewModel 字段) ====================
/** 手机版筛选弹层显隐切换 */ /** 手机版筛选弹层显隐切换 */
fun toggleFilterPanel() { fun toggleFilterPanel() {
filterPanelVisible.set(!filterPanelVisible.get()) filterPanelVisible.set(!filterPanelVisible.get())
} }
/** 手机版筛选:重置(只清弹层内条件,不影响顶部搜索框) */ /** 手机版筛选:重置(只清弹层内条件,不影响顶部搜索框) */
fun resetFilter() { fun resetFilter() {
viewModel.checkInDateStart.value = "" viewModel.checkInDateStart.value = ""
viewModel.checkInDateEnd.value = "" viewModel.checkInDateEnd.value = ""
viewModel.agentCode.value = "" viewModel.agentCode.value = ""
viewModel.spCode.value = "" viewModel.spCode.value = ""
viewModel.destFilter.value = "" viewModel.destFilter.value = ""
viewModel.opUserFilter.value = "" viewModel.opUserFilter.value = ""
} }
/** 手机版筛选:确认 */ /** 手机版筛选:确认 */
fun confirmFilter() { fun confirmFilter() {
filterPanelVisible.set(false) filterPanelVisible.set(false)
viewModel.searchClick() viewModel.searchClick()
} }
companion object { companion object {
@JvmStatic @JvmStatic
fun start(context: Context) { fun start(context: Context) {
val starter = Intent(context, GjcWeighingRecordListActivity::class.java) val starter = Intent(context, GjcWeighingRecordListActivity::class.java)
context.startActivity(starter) context.startActivity(starter)
} }
} }
} }

View File

@@ -1,221 +1,221 @@
package com.lukouguoji.gjc.activity package com.lukouguoji.gjc.activity
import android.animation.Animator import android.animation.Animator
import android.animation.AnimatorListenerAdapter import android.animation.AnimatorListenerAdapter
import android.animation.AnimatorSet import android.animation.AnimatorSet
import android.animation.ObjectAnimator import android.animation.ObjectAnimator
import android.content.Context import android.content.Context
import android.content.Intent import android.content.Intent
import android.os.Bundle import android.os.Bundle
import android.view.View import android.view.View
import com.alibaba.android.arouter.facade.annotation.Route import com.alibaba.android.arouter.facade.annotation.Route
import com.lukouguoji.gjc.R import com.lukouguoji.gjc.R
import com.lukouguoji.gjc.databinding.ActivityGjcWeighingStartBinding import com.lukouguoji.gjc.databinding.ActivityGjcWeighingStartBinding
import com.lukouguoji.gjc.viewModel.GjcWeighingStartViewModel import com.lukouguoji.gjc.viewModel.GjcWeighingStartViewModel
import com.lukouguoji.module_base.base.BaseBindingActivity import com.lukouguoji.module_base.base.BaseBindingActivity
import com.lukouguoji.module_base.common.Constant import com.lukouguoji.module_base.common.Constant
import com.lukouguoji.module_base.router.ARouterConstants import com.lukouguoji.module_base.router.ARouterConstants
import com.lukouguoji.module_base.util.DeviceUtil import com.lukouguoji.module_base.util.DeviceUtil
/** /**
* 国际出港计重-开始计重页面 * 国际出港计重-开始计重页面
*/ */
@Route(path = ARouterConstants.ACTIVITY_URL_GJC_WEIGHING_START) @Route(path = ARouterConstants.ACTIVITY_URL_GJC_WEIGHING_START)
class GjcWeighingStartActivity : class GjcWeighingStartActivity :
BaseBindingActivity<ActivityGjcWeighingStartBinding, GjcWeighingStartViewModel>() { BaseBindingActivity<ActivityGjcWeighingStartBinding, GjcWeighingStartViewModel>() {
private var isExpanded = false private var isExpanded = false
override fun layoutId() = R.layout.activity_gjc_weighing_start override fun layoutId() = R.layout.activity_gjc_weighing_start
override fun viewModelClass() = GjcWeighingStartViewModel::class.java override fun viewModelClass() = GjcWeighingStartViewModel::class.java
override fun initOnCreate(savedInstanceState: Bundle?) { override fun initOnCreate(savedInstanceState: Bundle?) {
setBackArrow("国际出港开始计重") setBackArrow(if (DeviceUtil.isPhone()) "开始计重" else "国际出港开始计重")
binding.viewModel = viewModel binding.viewModel = viewModel
// 手机版专属:提交体携带托盘数量/托盘自重(平板不调用,请求体与改造前完全一致) // 手机版专属:提交体携带托盘数量/托盘自重(平板不调用,请求体与改造前完全一致)
if (DeviceUtil.isPhone()) { if (DeviceUtil.isPhone()) {
viewModel.initPhoneExtras() viewModel.initPhoneExtras()
} }
viewModel.initOnCreated(this, intent) viewModel.initOnCreated(this, intent)
setupFloatButtons() setupFloatButtons()
} }
private fun setupFloatButtons() { private fun setupFloatButtons() {
// 浮动按钮组仅平板布局存在layout-sw600dp手机布局无这些 id直接跳过 // 浮动按钮组仅平板布局存在layout-sw600dp手机布局无这些 id直接跳过
val mainFloatButton = binding.mainFloatButton ?: return val mainFloatButton = binding.mainFloatButton ?: return
val maskView = binding.maskView ?: return val maskView = binding.maskView ?: return
val subButton1 = binding.subButton1 ?: return val subButton1 = binding.subButton1 ?: return
val subButton2 = binding.subButton2 ?: return val subButton2 = binding.subButton2 ?: return
// 主按钮点击事件 // 主按钮点击事件
mainFloatButton.setOnClickListener { mainFloatButton.setOnClickListener {
if (!isExpanded) { if (!isExpanded) {
expandButtons() expandButtons()
} }
} }
// 遮罩层点击事件 // 遮罩层点击事件
maskView.setOnClickListener { maskView.setOnClickListener {
collapseButtons() collapseButtons()
} }
// 子按钮1点击事件 - 跳转到出港运抵页面 // 子按钮1点击事件 - 跳转到出港运抵页面
subButton1.setOnClickListener { subButton1.setOnClickListener {
com.alibaba.android.arouter.launcher.ARouter.getInstance() com.alibaba.android.arouter.launcher.ARouter.getInstance()
.build(ARouterConstants.ACTIVITY_URL_INT_EXP_ARRIVE) .build(ARouterConstants.ACTIVITY_URL_INT_EXP_ARRIVE)
.navigation() .navigation()
collapseButtons() collapseButtons()
} }
// 子按钮2点击事件 - 跳转到计重记录 // 子按钮2点击事件 - 跳转到计重记录
subButton2.setOnClickListener { subButton2.setOnClickListener {
com.alibaba.android.arouter.launcher.ARouter.getInstance() com.alibaba.android.arouter.launcher.ARouter.getInstance()
.build(ARouterConstants.ACTIVITY_URL_GJC_WEIGHING_RECORD_LIST) .build(ARouterConstants.ACTIVITY_URL_GJC_WEIGHING_RECORD_LIST)
.navigation() .navigation()
collapseButtons() collapseButtons()
} }
} }
/** /**
* 展开子按钮(仅平板,手机布局无浮动按钮组) * 展开子按钮(仅平板,手机布局无浮动按钮组)
*/ */
private fun expandButtons() { private fun expandButtons() {
val mainFloatButton = binding.mainFloatButton ?: return val mainFloatButton = binding.mainFloatButton ?: return
val maskView = binding.maskView ?: return val maskView = binding.maskView ?: return
val subButton1 = binding.subButton1 ?: return val subButton1 = binding.subButton1 ?: return
val subButton2 = binding.subButton2 ?: return val subButton2 = binding.subButton2 ?: return
isExpanded = true isExpanded = true
// 显示遮罩层 // 显示遮罩层
maskView.visibility = View.VISIBLE maskView.visibility = View.VISIBLE
maskView.alpha = 0f maskView.alpha = 0f
maskView.animate().alpha(0.3f).setDuration(200).start() maskView.animate().alpha(0.3f).setDuration(200).start()
// 显示子按钮 // 显示子按钮
subButton1.visibility = View.VISIBLE subButton1.visibility = View.VISIBLE
subButton2.visibility = View.VISIBLE subButton2.visibility = View.VISIBLE
// 子按钮1动画向左上方移动: 左移15dp, 上移55dp // 子按钮1动画向左上方移动: 左移15dp, 上移55dp
val sub1TransX = ObjectAnimator.ofFloat(subButton1, "translationX", 0f, -5f) val sub1TransX = ObjectAnimator.ofFloat(subButton1, "translationX", 0f, -5f)
val sub1TransY = ObjectAnimator.ofFloat(subButton1, "translationY", 0f, -25f) val sub1TransY = ObjectAnimator.ofFloat(subButton1, "translationY", 0f, -25f)
val sub1Alpha = ObjectAnimator.ofFloat(subButton1, "alpha", 0f, 1f) val sub1Alpha = ObjectAnimator.ofFloat(subButton1, "alpha", 0f, 1f)
val sub1Scale = ObjectAnimator.ofFloat(subButton1, "scaleX", 0f, 1f) val sub1Scale = ObjectAnimator.ofFloat(subButton1, "scaleX", 0f, 1f)
val sub1ScaleY = ObjectAnimator.ofFloat(subButton1, "scaleY", 0f, 1f) val sub1ScaleY = ObjectAnimator.ofFloat(subButton1, "scaleY", 0f, 1f)
val animSet1 = AnimatorSet() val animSet1 = AnimatorSet()
animSet1.playTogether(sub1TransX, sub1TransY, sub1Alpha, sub1Scale, sub1ScaleY) animSet1.playTogether(sub1TransX, sub1TransY, sub1Alpha, sub1Scale, sub1ScaleY)
animSet1.duration = 200 animSet1.duration = 200
// 子按钮2动画向左下方移动: 左移55dp, 下移15dp // 子按钮2动画向左下方移动: 左移55dp, 下移15dp
val sub2TransX = ObjectAnimator.ofFloat(subButton2, "translationX", 0f, -25f) val sub2TransX = ObjectAnimator.ofFloat(subButton2, "translationX", 0f, -25f)
val sub2TransY = ObjectAnimator.ofFloat(subButton2, "translationY", 0f, -5f) val sub2TransY = ObjectAnimator.ofFloat(subButton2, "translationY", 0f, -5f)
val sub2Alpha = ObjectAnimator.ofFloat(subButton2, "alpha", 0f, 1f) val sub2Alpha = ObjectAnimator.ofFloat(subButton2, "alpha", 0f, 1f)
val sub2Scale = ObjectAnimator.ofFloat(subButton2, "scaleX", 0f, 1f) val sub2Scale = ObjectAnimator.ofFloat(subButton2, "scaleX", 0f, 1f)
val sub2ScaleY = ObjectAnimator.ofFloat(subButton2, "scaleY", 0f, 1f) val sub2ScaleY = ObjectAnimator.ofFloat(subButton2, "scaleY", 0f, 1f)
val animSet2 = AnimatorSet() val animSet2 = AnimatorSet()
animSet2.playTogether(sub2TransX, sub2TransY, sub2Alpha, sub2Scale, sub2ScaleY) animSet2.playTogether(sub2TransX, sub2TransY, sub2Alpha, sub2Scale, sub2ScaleY)
animSet2.duration = 200 animSet2.duration = 200
animSet2.startDelay = 50 animSet2.startDelay = 50
// 主按钮隐藏动画 // 主按钮隐藏动画
mainFloatButton.animate() mainFloatButton.animate()
.scaleX(0f) .scaleX(0f)
.scaleY(0f) .scaleY(0f)
.alpha(0f) .alpha(0f)
.setDuration(150) .setDuration(150)
.setListener(object : AnimatorListenerAdapter() { .setListener(object : AnimatorListenerAdapter() {
override fun onAnimationEnd(animation: Animator) { override fun onAnimationEnd(animation: Animator) {
mainFloatButton.visibility = View.GONE mainFloatButton.visibility = View.GONE
} }
}) })
.start() .start()
animSet1.start() animSet1.start()
animSet2.start() animSet2.start()
} }
/** /**
* 收起子按钮(仅平板,手机布局无浮动按钮组) * 收起子按钮(仅平板,手机布局无浮动按钮组)
*/ */
private fun collapseButtons() { private fun collapseButtons() {
val mainFloatButton = binding.mainFloatButton ?: return val mainFloatButton = binding.mainFloatButton ?: return
val maskView = binding.maskView ?: return val maskView = binding.maskView ?: return
val subButton1 = binding.subButton1 ?: return val subButton1 = binding.subButton1 ?: return
val subButton2 = binding.subButton2 ?: return val subButton2 = binding.subButton2 ?: return
isExpanded = false isExpanded = false
// 隐藏遮罩层 // 隐藏遮罩层
maskView.animate().alpha(0f).setDuration(200).withEndAction { maskView.animate().alpha(0f).setDuration(200).withEndAction {
maskView.visibility = View.GONE maskView.visibility = View.GONE
}.start() }.start()
// 子按钮1动画回到原位 // 子按钮1动画回到原位
val sub1TransX = ObjectAnimator.ofFloat(subButton1, "translationX", subButton1.translationX, 0f) val sub1TransX = ObjectAnimator.ofFloat(subButton1, "translationX", subButton1.translationX, 0f)
val sub1TransY = ObjectAnimator.ofFloat(subButton1, "translationY", subButton1.translationY, 0f) val sub1TransY = ObjectAnimator.ofFloat(subButton1, "translationY", subButton1.translationY, 0f)
val sub1Alpha = ObjectAnimator.ofFloat(subButton1, "alpha", 1f, 0f) val sub1Alpha = ObjectAnimator.ofFloat(subButton1, "alpha", 1f, 0f)
val sub1Scale = ObjectAnimator.ofFloat(subButton1, "scaleX", 1f, 0f) val sub1Scale = ObjectAnimator.ofFloat(subButton1, "scaleX", 1f, 0f)
val sub1ScaleY = ObjectAnimator.ofFloat(subButton1, "scaleY", 1f, 0f) val sub1ScaleY = ObjectAnimator.ofFloat(subButton1, "scaleY", 1f, 0f)
val animSet1 = AnimatorSet() val animSet1 = AnimatorSet()
animSet1.playTogether(sub1TransX, sub1TransY, sub1Alpha, sub1Scale, sub1ScaleY) animSet1.playTogether(sub1TransX, sub1TransY, sub1Alpha, sub1Scale, sub1ScaleY)
animSet1.duration = 200 animSet1.duration = 200
// 子按钮2动画回到原位 // 子按钮2动画回到原位
val sub2TransX = ObjectAnimator.ofFloat(subButton2, "translationX", subButton2.translationX, 0f) val sub2TransX = ObjectAnimator.ofFloat(subButton2, "translationX", subButton2.translationX, 0f)
val sub2TransY = ObjectAnimator.ofFloat(subButton2, "translationY", subButton2.translationY, 0f) val sub2TransY = ObjectAnimator.ofFloat(subButton2, "translationY", subButton2.translationY, 0f)
val sub2Alpha = ObjectAnimator.ofFloat(subButton2, "alpha", 1f, 0f) val sub2Alpha = ObjectAnimator.ofFloat(subButton2, "alpha", 1f, 0f)
val sub2Scale = ObjectAnimator.ofFloat(subButton2, "scaleX", 1f, 0f) val sub2Scale = ObjectAnimator.ofFloat(subButton2, "scaleX", 1f, 0f)
val sub2ScaleY = ObjectAnimator.ofFloat(subButton2, "scaleY", 1f, 0f) val sub2ScaleY = ObjectAnimator.ofFloat(subButton2, "scaleY", 1f, 0f)
val animSet2 = AnimatorSet() val animSet2 = AnimatorSet()
animSet2.playTogether(sub2TransX, sub2TransY, sub2Alpha, sub2Scale, sub2ScaleY) animSet2.playTogether(sub2TransX, sub2TransY, sub2Alpha, sub2Scale, sub2ScaleY)
animSet2.duration = 200 animSet2.duration = 200
animSet1.addListener(object : AnimatorListenerAdapter() { animSet1.addListener(object : AnimatorListenerAdapter() {
override fun onAnimationEnd(animation: Animator) { override fun onAnimationEnd(animation: Animator) {
subButton1.visibility = View.GONE subButton1.visibility = View.GONE
} }
}) })
animSet2.addListener(object : AnimatorListenerAdapter() { animSet2.addListener(object : AnimatorListenerAdapter() {
override fun onAnimationEnd(animation: Animator) { override fun onAnimationEnd(animation: Animator) {
subButton2.visibility = View.GONE subButton2.visibility = View.GONE
} }
}) })
// 主按钮显示动画 // 主按钮显示动画
mainFloatButton.visibility = View.VISIBLE mainFloatButton.visibility = View.VISIBLE
mainFloatButton.animate() mainFloatButton.animate()
.scaleX(1f) .scaleX(1f)
.scaleY(1f) .scaleY(1f)
.alpha(1f) .alpha(1f)
.setDuration(200) .setDuration(200)
.setStartDelay(100) .setStartDelay(100)
.setListener(null) .setListener(null)
.start() .start()
animSet1.start() animSet1.start()
animSet2.start() animSet2.start()
} }
companion object { companion object {
/** /**
* 启动开始计重页面 * 启动开始计重页面
* @param context 上下文 * @param context 上下文
* @param maWbId 运单ID默认为0新增模式 * @param maWbId 运单ID默认为0新增模式
*/ */
@JvmStatic @JvmStatic
fun startForAdd(context: Context, maWbId: Long = 0) { fun startForAdd(context: Context, maWbId: Long = 0) {
val starter = Intent(context, GjcWeighingStartActivity::class.java) val starter = Intent(context, GjcWeighingStartActivity::class.java)
.putExtra(Constant.Key.MAWB_ID, maWbId) .putExtra(Constant.Key.MAWB_ID, maWbId)
context.startActivity(starter) context.startActivity(starter)
} }
} }
} }

View File

@@ -1,177 +1,177 @@
package com.lukouguoji.gjc.activity package com.lukouguoji.gjc.activity
import android.app.Activity import android.app.Activity
import android.content.Intent import android.content.Intent
import android.os.Bundle import android.os.Bundle
import androidx.databinding.ObservableBoolean import androidx.databinding.ObservableBoolean
import com.alibaba.android.arouter.facade.annotation.Autowired import com.alibaba.android.arouter.facade.annotation.Autowired
import com.alibaba.android.arouter.facade.annotation.Route import com.alibaba.android.arouter.facade.annotation.Route
import com.alibaba.android.arouter.launcher.ARouter import com.alibaba.android.arouter.launcher.ARouter
import com.lukouguoji.gjc.R import com.lukouguoji.gjc.R
import com.lukouguoji.gjc.databinding.ActivityIntExpArriveBinding import com.lukouguoji.gjc.databinding.ActivityIntExpArriveBinding
import com.lukouguoji.gjc.viewModel.IntExpArriveViewModel import com.lukouguoji.gjc.viewModel.IntExpArriveViewModel
import com.lukouguoji.module_base.base.BaseBindingActivity import com.lukouguoji.module_base.base.BaseBindingActivity
import com.lukouguoji.module_base.bean.GjcHaWb import com.lukouguoji.module_base.bean.GjcHaWb
import com.lukouguoji.module_base.bean.GjcMaWb import com.lukouguoji.module_base.bean.GjcMaWb
import com.lukouguoji.module_base.common.Constant import com.lukouguoji.module_base.common.Constant
import com.lukouguoji.module_base.common.ConstantEvent import com.lukouguoji.module_base.common.ConstantEvent
import com.lukouguoji.module_base.impl.FlowBus import com.lukouguoji.module_base.impl.FlowBus
import com.lukouguoji.module_base.impl.observe import com.lukouguoji.module_base.impl.observe
import com.lukouguoji.module_base.ktx.addOnItemClickListener import com.lukouguoji.module_base.ktx.addOnItemClickListener
import com.lukouguoji.module_base.ktx.commonAdapter import com.lukouguoji.module_base.ktx.commonAdapter
import com.lukouguoji.module_base.router.ARouterConstants import com.lukouguoji.module_base.router.ARouterConstants
import com.lukouguoji.module_base.util.DeviceUtil import com.lukouguoji.module_base.util.DeviceUtil
import java.util.ArrayList import java.util.ArrayList
/** /**
* 国际出港-出港运抵页面 * 国际出港-出港运抵页面
* *
* 布局 id 不区分设备,平板/手机由资源限定符自动选择: * 布局 id 不区分设备,平板/手机由资源限定符自动选择:
* layout-sw600dp/activity_int_exp_arrive.xml平板 * layout-sw600dp/activity_int_exp_arrive.xml平板
* layout/activity_int_exp_arrive.xml手机 * layout/activity_int_exp_arrive.xml手机
*/ */
@Route(path = ARouterConstants.ACTIVITY_URL_INT_EXP_ARRIVE) @Route(path = ARouterConstants.ACTIVITY_URL_INT_EXP_ARRIVE)
class IntExpArriveActivity : class IntExpArriveActivity :
BaseBindingActivity<ActivityIntExpArriveBinding, IntExpArriveViewModel>() { BaseBindingActivity<ActivityIntExpArriveBinding, IntExpArriveViewModel>() {
@JvmField @JvmField
@Autowired @Autowired
var wbNoParam: String? = null var wbNoParam: String? = null
override fun layoutId() = R.layout.activity_int_exp_arrive override fun layoutId() = R.layout.activity_int_exp_arrive
override fun viewModelClass() = IntExpArriveViewModel::class.java override fun viewModelClass() = IntExpArriveViewModel::class.java
/** 手机版筛选弹层显隐(仅 UI 状态,不涉及业务逻辑) */ /** 手机版筛选弹层显隐(仅 UI 状态,不涉及业务逻辑) */
val filterPanelVisible = ObservableBoolean(false) val filterPanelVisible = ObservableBoolean(false)
/** 供 [com.lukouguoji.gjc.holder.IntExpArriveViewHolder] 绑定 item 布局的 viewModel 变量(父类 viewModel 为 protected */ /** 供 [com.lukouguoji.gjc.holder.IntExpArriveViewHolder] 绑定 item 布局的 viewModel 变量(父类 viewModel 为 protected */
val itemViewModel: IntExpArriveViewModel get() = viewModel val itemViewModel: IntExpArriveViewModel get() = viewModel
override fun initOnCreate(savedInstanceState: Bundle?) { override fun initOnCreate(savedInstanceState: Bundle?) {
// 注入 ARouter 参数 // 注入 ARouter 参数
ARouter.getInstance().inject(this) ARouter.getInstance().inject(this)
setBackArrow("国际出港运抵") setBackArrow(if (DeviceUtil.isPhone()) "出港运抵" else "国际出港运抵")
binding.viewModel = viewModel binding.viewModel = viewModel
binding.activity = this binding.activity = this
// 手机版专属数据:加载「代理」筛选下拉 // 手机版专属数据:加载「代理」筛选下拉
// 平板端不调用,查询链路与请求次数与改造前完全一致 // 平板端不调用,查询链路与请求次数与改造前完全一致
if (DeviceUtil.isPhone()) { if (DeviceUtil.isPhone()) {
viewModel.initPhoneExtras() viewModel.initPhoneExtras()
} }
// 如果有传入运单号,自动填充并触发搜索 // 如果有传入运单号,自动填充并触发搜索
if (!wbNoParam.isNullOrEmpty()) { if (!wbNoParam.isNullOrEmpty()) {
viewModel.waybillNo.value = wbNoParam viewModel.waybillNo.value = wbNoParam
viewModel.searchClick() viewModel.searchClick()
} }
// 绑定分页 // 绑定分页
viewModel.pageModel.bindSmartRefreshLayout(binding.srl, binding.rv, viewModel, this) viewModel.pageModel.bindSmartRefreshLayout(binding.srl, binding.rv, viewModel, this)
// 设置item点击监听 // 设置item点击监听
binding.rv.addOnItemClickListener(viewModel) binding.rv.addOnItemClickListener(viewModel)
// 监听刷新事件 // 监听刷新事件
FlowBus.with<String>(ConstantEvent.EVENT_CHECK_CHANGED).observe(this) { viewModel.onItemCheckChanged() } FlowBus.with<String>(ConstantEvent.EVENT_CHECK_CHANGED).observe(this) { viewModel.onItemCheckChanged() }
FlowBus.with<String>(ConstantEvent.EVENT_REFRESH).observe(this) { FlowBus.with<String>(ConstantEvent.EVENT_REFRESH).observe(this) {
viewModel.refresh() viewModel.refresh()
} }
// 初始加载数据(如果没有传入运单号,才执行初始加载) // 初始加载数据(如果没有传入运单号,才执行初始加载)
if (wbNoParam.isNullOrEmpty()) { if (wbNoParam.isNullOrEmpty()) {
viewModel.refresh() viewModel.refresh()
} }
} }
// ==================== 手机版专用交互(纯 UI复用既有 ViewModel 字段与数据) ==================== // ==================== 手机版专用交互(纯 UI复用既有 ViewModel 字段与数据) ====================
/** /**
* 手机版 Tab 切换回调PhoneStatusTab 已通过双向绑定写入 viewModel.currentTab * 手机版 Tab 切换回调PhoneStatusTab 已通过双向绑定写入 viewModel.currentTab
* 这里触发 ViewModel 把适配器数据集替换为过滤后的子集(不发起新请求)。 * 这里触发 ViewModel 把适配器数据集替换为过滤后的子集(不发起新请求)。
*/ */
fun onArriveTabChanged() { fun onArriveTabChanged() {
viewModel.onTabChangedPhone() viewModel.onTabChangedPhone()
} }
/** 卡片长按展开操作浮层View.OnLongClickListener 要求返回 Boolean */ /** 卡片长按展开操作浮层View.OnLongClickListener 要求返回 Boolean */
fun showCardActionPhone(bean: GjcMaWb): Boolean { fun showCardActionPhone(bean: GjcMaWb): Boolean {
bean.actionMenuVisible.set(true) bean.actionMenuVisible.set(true)
return true return true
} }
/** 点击浮层遮罩/空白处:收起操作浮层 */ /** 点击浮层遮罩/空白处:收起操作浮层 */
fun hideCardActionPhone(bean: GjcMaWb) { fun hideCardActionPhone(bean: GjcMaWb) {
bean.actionMenuVisible.set(false) bean.actionMenuVisible.set(false)
} }
/** 选择圈勾选状态变化后回调(由 ViewHolder 调用) */ /** 选择圈勾选状态变化后回调(由 ViewHolder 调用) */
fun onItemCheckChanged() { fun onItemCheckChanged() {
viewModel.onItemCheckChanged() viewModel.onItemCheckChanged()
} }
/** 手机版筛选弹层显隐切换 */ /** 手机版筛选弹层显隐切换 */
fun toggleFilterPanel() { fun toggleFilterPanel() {
filterPanelVisible.set(!filterPanelVisible.get()) filterPanelVisible.set(!filterPanelVisible.get())
} }
/** 手机版筛选:重置 */ /** 手机版筛选:重置 */
fun resetFilter() { fun resetFilter() {
viewModel.flightDate.value = "" viewModel.flightDate.value = ""
viewModel.flightNo.value = "" viewModel.flightNo.value = ""
viewModel.agentCodePhone.value = "" viewModel.agentCodePhone.value = ""
} }
/** 手机版筛选:确认 */ /** 手机版筛选:确认 */
fun confirmFilter() { fun confirmFilter() {
filterPanelVisible.set(false) filterPanelVisible.set(false)
viewModel.searchClick() viewModel.searchClick()
} }
/** /**
* 进入「分单明细」页:直接传递该运单已加载的 haWbList零新增请求。 * 进入「分单明细」页:直接传递该运单已加载的 haWbList零新增请求。
*/ */
fun openSubOrder(bean: GjcMaWb) { fun openSubOrder(bean: GjcMaWb) {
val list = ArrayList<GjcHaWb>(bean.haWbList.orEmpty()) val list = ArrayList<GjcHaWb>(bean.haWbList.orEmpty())
IntExpArriveSubOrderActivity.start(this, bean.wbNo.orEmpty(), list) IntExpArriveSubOrderActivity.start(this, bean.wbNo.orEmpty(), list)
} }
/** /**
* 进入「回执」页(手机专属只读页):复用 haWbList[].response + arrivalOpDate零新增请求。 * 进入「回执」页(手机专属只读页):复用 haWbList[].response + arrivalOpDate零新增请求。
*/ */
fun openReceipt(bean: GjcMaWb) { fun openReceipt(bean: GjcMaWb) {
bean.actionMenuVisible.set(false) bean.actionMenuVisible.set(false)
val list = ArrayList<GjcHaWb>(bean.haWbList.orEmpty()) val list = ArrayList<GjcHaWb>(bean.haWbList.orEmpty())
IntExpArriveReceiptActivity.start(this, bean.wbNo.orEmpty(), list) IntExpArriveReceiptActivity.start(this, bean.wbNo.orEmpty(), list)
} }
/** /**
* 进入「补充信息」页(手机专属新页):对该运单整个 haWbList 批量应用(参照 Pad 端国际进港 * 进入「补充信息」页(手机专属新页):对该运单整个 haWbList 批量应用(参照 Pad 端国际进港
* IntArrSupplementInfoViewModel 的批量复制模式)。后端暂无保存接口,见接口问题清单。 * IntArrSupplementInfoViewModel 的批量复制模式)。后端暂无保存接口,见接口问题清单。
*/ */
fun openSupplement(bean: GjcMaWb) { fun openSupplement(bean: GjcMaWb) {
bean.actionMenuVisible.set(false) bean.actionMenuVisible.set(false)
val list = ArrayList<GjcHaWb>(bean.haWbList.orEmpty()) val list = ArrayList<GjcHaWb>(bean.haWbList.orEmpty())
IntExpArriveSupplementActivity.start(this, bean.wbNo.orEmpty(), list) IntExpArriveSupplementActivity.start(this, bean.wbNo.orEmpty(), list)
} }
override fun onActivityResult(requestCode: Int, resultCode: Int, data: Intent?) { override fun onActivityResult(requestCode: Int, resultCode: Int, data: Intent?) {
super.onActivityResult(requestCode, resultCode, data) super.onActivityResult(requestCode, resultCode, data)
when (requestCode) { when (requestCode) {
Constant.RequestCode.WAYBILL -> { Constant.RequestCode.WAYBILL -> {
if (resultCode == Activity.RESULT_OK) { if (resultCode == Activity.RESULT_OK) {
viewModel.waybillNo.value = data?.getStringExtra(Constant.Result.CODED_CONTENT) viewModel.waybillNo.value = data?.getStringExtra(Constant.Result.CODED_CONTENT)
viewModel.searchClick() viewModel.searchClick()
} }
} }
Constant.RequestCode.CODE -> { Constant.RequestCode.CODE -> {
if (resultCode == Activity.RESULT_OK) { if (resultCode == Activity.RESULT_OK) {
viewModel.hno.value = data?.getStringExtra(Constant.Result.CODED_CONTENT) viewModel.hno.value = data?.getStringExtra(Constant.Result.CODED_CONTENT)
viewModel.searchClick() viewModel.searchClick()
} }
} }
} }
} }
} }

View File

@@ -35,7 +35,7 @@ class IntExpOutHandoverActivity :
val filterPanelVisible = ObservableBoolean(false) val filterPanelVisible = ObservableBoolean(false)
override fun initOnCreate(savedInstanceState: Bundle?) { override fun initOnCreate(savedInstanceState: Bundle?) {
setBackArrow("国际出港出库交接") setBackArrow(if (DeviceUtil.isPhone()) "出库交接" else "国际出港出库交接")
binding.viewModel = viewModel binding.viewModel = viewModel
binding.activity = this binding.activity = this

View File

@@ -1,171 +1,171 @@
package com.lukouguoji.gjc.page.move package com.lukouguoji.gjc.page.move
import android.app.Activity import android.app.Activity
import android.content.Context import android.content.Context
import android.content.Intent import android.content.Intent
import android.os.Bundle import android.os.Bundle
import androidx.databinding.ObservableBoolean import androidx.databinding.ObservableBoolean
import com.alibaba.android.arouter.facade.annotation.Route import com.alibaba.android.arouter.facade.annotation.Route
import com.lukouguoji.gjc.R import com.lukouguoji.gjc.R
import com.lukouguoji.gjc.databinding.ActivityIntExpMoveBinding import com.lukouguoji.gjc.databinding.ActivityIntExpMoveBinding
import com.lukouguoji.gjc.viewModel.IntExpMoveViewModel import com.lukouguoji.gjc.viewModel.IntExpMoveViewModel
import com.lukouguoji.module_base.base.BaseBindingActivity import com.lukouguoji.module_base.base.BaseBindingActivity
import com.lukouguoji.module_base.common.Constant import com.lukouguoji.module_base.common.Constant
import com.lukouguoji.module_base.common.ConstantEvent import com.lukouguoji.module_base.common.ConstantEvent
import com.lukouguoji.module_base.impl.FlowBus import com.lukouguoji.module_base.impl.FlowBus
import com.lukouguoji.module_base.impl.observe import com.lukouguoji.module_base.impl.observe
import com.lukouguoji.module_base.ktx.addOnItemClickListener import com.lukouguoji.module_base.ktx.addOnItemClickListener
import com.lukouguoji.module_base.ktx.showToast import com.lukouguoji.module_base.ktx.showToast
import com.lukouguoji.module_base.model.ConfirmDialogModel import com.lukouguoji.module_base.model.ConfirmDialogModel
import com.lukouguoji.module_base.model.ScanModel import com.lukouguoji.module_base.model.ScanModel
import com.lukouguoji.module_base.router.ARouterConstants import com.lukouguoji.module_base.router.ARouterConstants
import com.lukouguoji.module_base.util.DeviceUtil import com.lukouguoji.module_base.util.DeviceUtil
/** /**
* 国际出港-出港移库 * 国际出港-出港移库
*/ */
@Route(path = ARouterConstants.ACTIVITY_URL_INT_EXP_MOVE) @Route(path = ARouterConstants.ACTIVITY_URL_INT_EXP_MOVE)
class IntExpMoveActivity : BaseBindingActivity<ActivityIntExpMoveBinding, IntExpMoveViewModel>() { class IntExpMoveActivity : BaseBindingActivity<ActivityIntExpMoveBinding, IntExpMoveViewModel>() {
// 布局 id 不区分设备,平板/手机由资源限定符自动选择: // 布局 id 不区分设备,平板/手机由资源限定符自动选择:
// layout-sw600dp/activity_int_exp_move.xml平板 / layout/activity_int_exp_move.xml手机 // layout-sw600dp/activity_int_exp_move.xml平板 / layout/activity_int_exp_move.xml手机
override fun layoutId() = R.layout.activity_int_exp_move override fun layoutId() = R.layout.activity_int_exp_move
override fun viewModelClass() = IntExpMoveViewModel::class.java override fun viewModelClass() = IntExpMoveViewModel::class.java
/** 手机版筛选弹层显隐(仅 UI 状态,不涉及业务逻辑) */ /** 手机版筛选弹层显隐(仅 UI 状态,不涉及业务逻辑) */
val filterPanelVisible = ObservableBoolean(false) val filterPanelVisible = ObservableBoolean(false)
override fun initOnCreate(savedInstanceState: Bundle?) { override fun initOnCreate(savedInstanceState: Bundle?) {
setBackArrow("国际出港移库") setBackArrow(if (DeviceUtil.isPhone()) "出港移库" else "国际出港移库")
binding.viewModel = viewModel binding.viewModel = viewModel
binding.activity = this binding.activity = this
// 手机版专属数据默认「待移库」Tab、Tab 角标计数、特码下拉 // 手机版专属数据默认「待移库」Tab、Tab 角标计数、特码下拉
// 平板端不调用,查询链路与请求次数与改造前完全一致 // 平板端不调用,查询链路与请求次数与改造前完全一致
if (DeviceUtil.isPhone()) { if (DeviceUtil.isPhone()) {
viewModel.initPhoneExtras() viewModel.initPhoneExtras()
} }
initRecyclerView() initRecyclerView()
initListeners() initListeners()
observeData() observeData()
} }
/** /**
* 初始化RecyclerView * 初始化RecyclerView
*/ */
private fun initRecyclerView() { private fun initRecyclerView() {
viewModel.pageModel.bindSmartRefreshLayout( viewModel.pageModel.bindSmartRefreshLayout(
binding.srl, binding.srl,
binding.rv, binding.rv,
viewModel, viewModel,
this this
) )
binding.rv.addOnItemClickListener(viewModel) binding.rv.addOnItemClickListener(viewModel)
} }
/** /**
* 初始化监听器 * 初始化监听器
*/ */
private fun initListeners() { private fun initListeners() {
// 移库按钮btnMove 只存在于平板变体(手机版底部条走 setOnActionClick故判空 // 移库按钮btnMove 只存在于平板变体(手机版底部条走 setOnActionClick故判空
binding.btnMove?.setOnClickListener { binding.btnMove?.setOnClickListener {
showMoveConfirmDialog() showMoveConfirmDialog()
} }
} }
/** /**
* 观察数据变化 * 观察数据变化
*/ */
private fun observeData() { private fun observeData() {
// 监听item选择变化事件,更新全选状态 // 监听item选择变化事件,更新全选状态
FlowBus.with<String>(ConstantEvent.EVENT_CHECK_CHANGED).observe(this) { FlowBus.with<String>(ConstantEvent.EVENT_CHECK_CHANGED).observe(this) {
viewModel.onItemCheckChanged() viewModel.onItemCheckChanged()
} }
// 监听刷新事件 // 监听刷新事件
FlowBus.with<String>(ConstantEvent.EVENT_REFRESH).observe(this) { FlowBus.with<String>(ConstantEvent.EVENT_REFRESH).observe(this) {
viewModel.refresh() viewModel.refresh()
} }
// 初始加载数据 // 初始加载数据
viewModel.refresh() viewModel.refresh()
} }
/** /**
* 扫码运单号 * 扫码运单号
*/ */
fun scanWaybill() { fun scanWaybill() {
ScanModel.startScan(this, Constant.RequestCode.WAYBILL) ScanModel.startScan(this, Constant.RequestCode.WAYBILL)
} }
// ==================== 手机版专用交互(复用既有 ViewModel 字段,无新增业务逻辑) ==================== // ==================== 手机版专用交互(复用既有 ViewModel 字段,无新增业务逻辑) ====================
/** /**
* 手机版筛选弹层显隐切换 * 手机版筛选弹层显隐切换
*/ */
fun toggleFilterPanel() { fun toggleFilterPanel() {
filterPanelVisible.set(!filterPanelVisible.get()) filterPanelVisible.set(!filterPanelVisible.get())
} }
/** /**
* 手机版筛选:重置 * 手机版筛选:重置
* *
* 只清空弹层内的三个条件(承运人 / 运单类型 / 特码),不影响 Tab 与顶部搜索框。 * 只清空弹层内的三个条件(承运人 / 运单类型 / 特码),不影响 Tab 与顶部搜索框。
*/ */
fun resetFilter() { fun resetFilter() {
viewModel.by1.value = "" viewModel.by1.value = ""
viewModel.awbType.value = "" viewModel.awbType.value = ""
viewModel.spCode.value = "" viewModel.spCode.value = ""
} }
/** /**
* 手机版筛选:确定 * 手机版筛选:确定
*/ */
fun confirmFilter() { fun confirmFilter() {
filterPanelVisible.set(false) filterPanelVisible.set(false)
viewModel.searchClick() viewModel.searchClick()
} }
/** /**
* 显示移库确认对话框 * 显示移库确认对话框
* *
* 手机版底部操作条通过 XML 的 setOnActionClick 调用,故为 public。 * 手机版底部操作条通过 XML 的 setOnActionClick 调用,故为 public。
*/ */
fun showMoveConfirmDialog() { fun showMoveConfirmDialog() {
val selectedItems = viewModel.getSelectedItems() val selectedItems = viewModel.getSelectedItems()
if (selectedItems.isEmpty()) { if (selectedItems.isEmpty()) {
showToast("请至少选择一条运单") showToast("请至少选择一条运单")
return return
} }
ConfirmDialogModel( ConfirmDialogModel(
message = "确定要移库选中的 ${selectedItems.size} 条运单吗?", message = "确定要移库选中的 ${selectedItems.size} 条运单吗?",
title = "移库确认" title = "移库确认"
) { ) {
viewModel.submitMove() viewModel.submitMove()
}.show() }.show()
} }
/** /**
* 扫码回调 * 扫码回调
*/ */
override fun onActivityResult(requestCode: Int, resultCode: Int, data: Intent?) { override fun onActivityResult(requestCode: Int, resultCode: Int, data: Intent?) {
super.onActivityResult(requestCode, resultCode, data) super.onActivityResult(requestCode, resultCode, data)
if (requestCode == Constant.RequestCode.WAYBILL && resultCode == Activity.RESULT_OK) { if (requestCode == Constant.RequestCode.WAYBILL && resultCode == Activity.RESULT_OK) {
val code = data?.getStringExtra(Constant.Result.CODED_CONTENT) val code = data?.getStringExtra(Constant.Result.CODED_CONTENT)
viewModel.waybillNo.value = code viewModel.waybillNo.value = code
viewModel.searchClick() viewModel.searchClick()
} }
} }
companion object { companion object {
@JvmStatic @JvmStatic
fun start(context: Context) { fun start(context: Context) {
val starter = Intent(context, IntExpMoveActivity::class.java) val starter = Intent(context, IntExpMoveActivity::class.java)
context.startActivity(starter) context.startActivity(starter)
} }
} }
} }

View File

@@ -189,7 +189,7 @@
android:layout_weight="1" android:layout_weight="1"
android:ellipsize="end" android:ellipsize="end"
android:maxLines="1" android:maxLines="1"
android:text='@{"代理人:" + bean.orDash(bean.agentName ?? bean.agentCode)}' android:text='@{"代理人:" + bean.orDash(bean.agentDisplay)}'
android:textColor="@color/phone_text_body" android:textColor="@color/phone_text_body"
android:textSize="13sp" android:textSize="13sp"
tools:text="代理人:中外运" /> tools:text="代理人:中外运" />

View File

@@ -75,23 +75,51 @@
android:layout_marginTop="12dp" android:layout_marginTop="12dp"
android:orientation="horizontal"> android:orientation="horizontal">
<TextView <LinearLayout
android:layout_width="0dp" android:layout_width="0dp"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:layout_weight="1" android:layout_weight="1"
android:text='@{"日期: " + bean.fdate}' android:gravity="center_vertical"
android:textColor="@color/phone_text_body" android:orientation="horizontal">
android:textSize="13sp"
tools:text="日期: 20260721" />
<TextView <ImageView
android:layout_width="14dp"
android:layout_height="14dp"
android:src="@drawable/ic_phone_airplane" />
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginStart="6dp"
android:text='@{"日期: " + bean.fdate}'
android:textColor="@color/phone_text_body"
android:textSize="13sp"
tools:text="日期: 20260721" />
</LinearLayout>
<LinearLayout
android:layout_width="0dp" android:layout_width="0dp"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:layout_weight="1" android:layout_weight="1"
android:text='@{"航程: " + bean.range}' android:gravity="center_vertical"
android:textColor="@color/phone_text_body" android:orientation="horizontal">
android:textSize="13sp"
tools:text="航程: HFE-LAX" /> <ImageView
android:layout_width="14dp"
android:layout_height="14dp"
android:src="@drawable/ic_phone_location" />
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginStart="6dp"
android:text='@{"航程: " + bean.range}'
android:textColor="@color/phone_text_body"
android:textSize="13sp"
tools:text="航程: HFE-LAX" />
</LinearLayout>
</LinearLayout> </LinearLayout>
@@ -102,23 +130,54 @@
android:layout_marginTop="8dp" android:layout_marginTop="8dp"
android:orientation="horizontal"> android:orientation="horizontal">
<TextView <LinearLayout
android:layout_width="0dp" android:layout_width="0dp"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:layout_weight="1" android:layout_weight="1"
android:text='@{"代理: " + bean.agentName}' android:gravity="center_vertical"
android:textColor="@color/phone_text_body" android:orientation="horizontal">
android:textSize="13sp"
tools:text="代理: 中外运" />
<TextView <ImageView
android:layout_width="14dp"
android:layout_height="14dp"
android:src="@drawable/ic_phone_person" />
<TextView
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_marginStart="6dp"
android:layout_weight="1"
android:ellipsize="end"
android:maxLines="1"
android:text='@{"代理: " + bean.agentName}'
android:textColor="@color/phone_text_body"
android:textSize="13sp"
tools:text="代理: 中外运" />
</LinearLayout>
<LinearLayout
android:layout_width="0dp" android:layout_width="0dp"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:layout_weight="1" android:layout_weight="1"
android:text='@{"特码: " + bean.spCode}' android:gravity="center_vertical"
android:textColor="@color/phone_text_body" android:orientation="horizontal">
android:textSize="13sp"
tools:text="特码: DGR" /> <ImageView
android:layout_width="14dp"
android:layout_height="14dp"
android:src="@drawable/ic_phone_tag" />
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginStart="6dp"
android:text='@{"特码: " + bean.spCode}'
android:textColor="@color/phone_text_body"
android:textSize="13sp"
tools:text="特码: DGR" />
</LinearLayout>
</LinearLayout> </LinearLayout>

View File

@@ -56,14 +56,28 @@
</LinearLayout> </LinearLayout>
<!-- 代理 --> <!-- 代理 -->
<TextView <LinearLayout
android:layout_width="wrap_content" android:layout_width="match_parent"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:layout_marginTop="8dp" android:layout_marginTop="8dp"
android:text='@{"代理: " + bean.agentName}' android:gravity="center_vertical"
android:textColor="@color/phone_text_body" android:orientation="horizontal">
android:textSize="13sp"
tools:text="代理: 马道" /> <ImageView
android:layout_width="14dp"
android:layout_height="14dp"
android:src="@drawable/ic_phone_person" />
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginStart="6dp"
android:text='@{"代理: " + bean.agentName}'
android:textColor="@color/phone_text_body"
android:textSize="13sp"
tools:text="代理: 马道" />
</LinearLayout>
<!-- 运抵统计框 --> <!-- 运抵统计框 -->
<com.lukouguoji.module_base.ui.weight.phone.PhoneStatBox <com.lukouguoji.module_base.ui.weight.phone.PhoneStatBox

View File

@@ -19,6 +19,7 @@ import com.lukouguoji.module_base.ktx.getLifecycleOwner
import com.lukouguoji.module_base.ktx.setUpperCaseAlphanumericFilter import com.lukouguoji.module_base.ktx.setUpperCaseAlphanumericFilter
import com.lukouguoji.module_base.ktx.setUpperCaseLetterFilter import com.lukouguoji.module_base.ktx.setUpperCaseLetterFilter
import com.lukouguoji.module_base.router.ARouterConstants import com.lukouguoji.module_base.router.ARouterConstants
import com.lukouguoji.module_base.util.DeviceUtil
/** /**
* 国际进港查询列表页 * 国际进港查询列表页
@@ -32,7 +33,7 @@ class IntImpQueryActivity :
override fun viewModelClass() = IntImpQueryViewModel::class.java override fun viewModelClass() = IntImpQueryViewModel::class.java
override fun initOnCreate(savedInstanceState: Bundle?) { override fun initOnCreate(savedInstanceState: Bundle?) {
setBackArrow("国际进港查询") setBackArrow(if (DeviceUtil.isPhone()) "进港查询" else "国际进港查询")
binding.viewModel = viewModel binding.viewModel = viewModel
@@ -50,22 +51,35 @@ class IntImpQueryActivity :
viewModel.initSpecialCodeList() viewModel.initSpecialCodeList()
viewModel.initFilterLists() viewModel.initFilterLists()
// 观察筛选面板显示状态 // 平板变体才有侧滑筛选面板filter_panel/filter_overlay 手机变体不存在Binding 字段为 null
viewModel.filterVisible.observe(this) { visible -> val padFilterPanel = binding.filterPanel
if (visible) showFilterPanel() else hideFilterPanel() if (padFilterPanel != null) {
// 观察筛选面板显示状态(滑入/滑出动画)
viewModel.filterVisible.observe(this) { visible ->
if (visible) showFilterPanel() else hideFilterPanel()
}
// 航班号:大写字母+数字
padFilterPanel.filterFlightNo.et.setUpperCaseAlphanumericFilter()
// 始发港:仅大写字母
padFilterPanel.filterOrigin.et.setUpperCaseLetterFilter()
} else {
// 手机变体PhoneFilterPanel 的显隐由 XML 直接绑定 viewModel.filterVisible无需动画代码
binding.phoneFilterFlightNo?.et?.setUpperCaseAlphanumericFilter()
binding.phoneFilterOrigin?.et?.setUpperCaseLetterFilter()
} }
// 航班号:大写字母+数字 // 手机形态专属:已入库/已出库统计计数
binding.filterPanel.filterFlightNo.et.setUpperCaseAlphanumericFilter() if (DeviceUtil.isPhone()) {
// 始发港:仅大写字母 viewModel.initPhoneExtras()
binding.filterPanel.filterOrigin.et.setUpperCaseLetterFilter() }
viewModel.refresh() viewModel.refresh()
} }
private fun showFilterPanel() { private fun showFilterPanel() {
val panel = binding.filterPanel.root val panel = binding.filterPanel?.root ?: return
val overlay = binding.filterOverlay val overlay = binding.filterOverlay ?: return
val panelWidth = window.decorView.width / 3 val panelWidth = window.decorView.width / 3
panel.layoutParams = (panel.layoutParams as FrameLayout.LayoutParams).apply { panel.layoutParams = (panel.layoutParams as FrameLayout.LayoutParams).apply {
@@ -87,8 +101,8 @@ class IntImpQueryActivity :
} }
private fun hideFilterPanel() { private fun hideFilterPanel() {
val panel = binding.filterPanel.root val panel = binding.filterPanel?.root ?: return
val overlay = binding.filterOverlay val overlay = binding.filterOverlay ?: return
if (panel.visibility != View.VISIBLE) return if (panel.visibility != View.VISIBLE) return

View File

@@ -16,6 +16,7 @@ import com.lukouguoji.module_base.base.BaseBindingActivity
import com.lukouguoji.module_base.base.CustomVP2Adapter import com.lukouguoji.module_base.base.CustomVP2Adapter
import com.lukouguoji.module_base.common.Constant import com.lukouguoji.module_base.common.Constant
import com.lukouguoji.module_base.router.ARouterConstants import com.lukouguoji.module_base.router.ARouterConstants
import com.lukouguoji.module_base.util.DeviceUtil
/** /**
* 国际进港查询详情页面 * 国际进港查询详情页面
@@ -28,7 +29,7 @@ class IntImpQueryDetailsActivity :
override fun viewModelClass() = IntImpQueryDetailsViewModel::class.java override fun viewModelClass() = IntImpQueryDetailsViewModel::class.java
override fun initOnCreate(savedInstanceState: Bundle?) { override fun initOnCreate(savedInstanceState: Bundle?) {
setBackArrow("国际进港查询详情") setBackArrow(if (DeviceUtil.isPhone()) "进港货物" else "国际进港查询详情")
binding.viewModel = viewModel binding.viewModel = viewModel
// 初始化ViewModel(传入maWbId) // 初始化ViewModel(传入maWbId)

View File

@@ -19,9 +19,9 @@ class IntImpQueryViewHolder(view: View) :
// 注册整行点击事件 // 注册整行点击事件
notifyItemClick(position, binding.ll) notifyItemClick(position, binding.ll)
// 侧滑菜单 - 修改按钮 // 侧滑菜单 - 修改按钮(平板变体独有;手机变体无侧滑编辑入口,字段为 null
binding.btnEdit.setOnClickListener { binding.btnEdit?.setOnClickListener {
binding.swipeMenu.quickClose() binding.swipeMenu?.quickClose()
clickListener?.onItemClick(position, 2000) // type=2000表示修改操作 clickListener?.onItemClick(position, 2000) // type=2000表示修改操作
} }
} }

View File

@@ -64,6 +64,24 @@ class IntImpQueryViewModel : BasePageViewModel(), IOnItemClickListener {
val awbTypeList = MutableLiveData<List<KeyValue>>(emptyList()) val awbTypeList = MutableLiveData<List<KeyValue>>(emptyList())
val businessTypeList = MutableLiveData<List<KeyValue>>(emptyList()) val businessTypeList = MutableLiveData<List<KeyValue>>(emptyList())
// ==================== 5.5寸手机版专属 ====================
// 三格统计:已入库 / 已出库(总票数复用 totalCount为服务端全量口径
// pageQueryTotal 无分项统计出参——已入库/已出库为「已加载数据」客户端计数口径,
// 与卡片状态标签同一判定dlvTime / inDate见 IntImpQueryBean
val storedCount = MutableLiveData("0")
val outboundCount = MutableLiveData("0")
private var phoneExtrasEnabled = false
private var phoneLoadedList: List<IntImpQueryBean> = emptyList()
/**
* 手机形态专属初始化Activity 在 DeviceUtil.isPhone() 时调用)。
* 平板端不调用,请求次数与行为零变化。
*/
fun initPhoneExtras() {
phoneExtrasEnabled = true
}
// ==================== 筛选条件 ==================== // ==================== 筛选条件 ====================
val spCode = MutableLiveData("") val spCode = MutableLiveData("")
val flightNo = MutableLiveData("") val flightNo = MutableLiveData("")
@@ -165,6 +183,14 @@ class IntImpQueryViewModel : BasePageViewModel(), IOnItemClickListener {
}) { }) {
onSuccess = { pageInfo -> onSuccess = { pageInfo ->
pageModel.handleListBean(pageInfo.toBaseListBean()) pageModel.handleListBean(pageInfo.toBaseListBean())
// 手机三格统计:对已加载数据做客户端计数(平板不触发)
if (phoneExtrasEnabled) {
val pageItems = pageInfo.list ?: emptyList()
phoneLoadedList =
if (pageModel.page <= 1) pageItems else phoneLoadedList + pageItems
updatePhoneCounts()
}
} }
} }
@@ -180,6 +206,16 @@ class IntImpQueryViewModel : BasePageViewModel(), IOnItemClickListener {
} }
} }
/**
* 手机三格统计(已入库/已出库与卡片状态标签同一判定口径dlvTime / inDate
* 统计范围为已加载的列表数据。
*/
private fun updatePhoneCounts() {
outboundCount.value = phoneLoadedList.count { it.isQueryOutbound }.toString()
storedCount.value =
phoneLoadedList.count { !it.isQueryOutbound && it.isQueryStored }.toString()
}
override fun onActivityResult(requestCode: Int, resultCode: Int, data: Intent?) { override fun onActivityResult(requestCode: Int, resultCode: Int, data: Intent?) {
if (resultCode == Activity.RESULT_OK && data != null) { if (resultCode == Activity.RESULT_OK && data != null) {
when (requestCode) { when (requestCode) {

View File

@@ -0,0 +1,234 @@
<?xml version="1.0" encoding="utf-8"?>
<layout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
xmlns:tools="http://schemas.android.com/tools">
<data>
<import type="android.view.View" />
<import type="com.lukouguoji.module_base.ui.weight.search.layout.SearchLayoutType" />
<variable
name="viewModel"
type="com.lukouguoji.gjj.viewModel.IntImpQueryViewModel" />
</data>
<LinearLayout
android:layout_width="match_parent"
android:layout_height="match_parent"
android:background="@color/color_f2"
android:orientation="vertical">
<!-- 标题栏(始终在最上层,不被遮挡) -->
<include layout="@layout/title_tool_bar" />
<!-- 内容区域FrameLayout 包裹,筛选面板和遮罩只在此区域内) -->
<FrameLayout
android:layout_width="match_parent"
android:layout_height="0dp"
android:layout_weight="1">
<!-- 原有内容 -->
<LinearLayout
android:layout_width="match_parent"
android:layout_height="match_parent"
android:orientation="vertical">
<!-- 搜索区域 -->
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginHorizontal="10dp"
android:layout_marginTop="10dp"
android:gravity="center_vertical"
android:orientation="horizontal">
<!-- 航班日期起 -->
<com.lukouguoji.module_base.ui.weight.search.layout.PadSearchLayout
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_weight="1"
hint='@{"请选择开始日期"}'
icon="@{@drawable/img_date}"
type="@{SearchLayoutType.DATE}"
value="@={viewModel.flightDateStart}" />
<!-- 航班日期止 -->
<com.lukouguoji.module_base.ui.weight.search.layout.PadSearchLayout
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_weight="1"
hint='@{"请选择结束航班日期"}'
icon="@{@drawable/img_date}"
type="@{SearchLayoutType.DATE}"
value="@={viewModel.flightDateEnd}" />
<!-- 代理人 -->
<com.lukouguoji.module_base.ui.weight.search.layout.PadSearchLayout
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_weight="1"
hint='@{"请选择代理"}'
list="@{viewModel.agentList}"
type="@{SearchLayoutType.SPINNER}"
value="@={viewModel.agentId}" />
<!-- 出库状态 -->
<com.lukouguoji.module_base.ui.weight.search.layout.PadSearchLayout
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_weight="1"
hint='@{"请选择出库状态"}'
list="@{viewModel.outStatusList}"
type="@{SearchLayoutType.SPINNER}"
value="@={viewModel.outStatus}" />
<!-- 运单号 -->
<com.lukouguoji.module_base.ui.weight.search.layout.PadSearchLayout
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_weight="1"
hint='@{"请输入运单号"}'
icon="@{@drawable/img_scan}"
setOnIconClickListener="@{()-> viewModel.waybillScanClick()}"
type="@{SearchLayoutType.INPUT}"
value="@={viewModel.waybillNo}"
autoQueryEnabled="@{true}"
autoQueryUrl="@{`/IntImpSearch/queryWbNoList`}"
autoQueryParamKey="@{`wbNo`}"
autoQueryMinLength="@{4}"
autoQueryMaxLength="@{8}"
autoQueryTitle="@{`选择运单号`}" />
<!-- 搜索和筛选按钮 -->
<LinearLayout
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_weight="1"
android:gravity="center_vertical|start"
android:orientation="horizontal"
android:paddingHorizontal="24dp">
<ImageView
android:layout_width="36dp"
android:layout_height="36dp"
android:onClick="@{()-> viewModel.searchClick()}"
android:padding="2dp"
android:src="@drawable/img_search" />
<FrameLayout
android:layout_width="36dp"
android:layout_height="36dp"
android:layout_marginLeft="16dp">
<ImageView
android:layout_width="match_parent"
android:layout_height="match_parent"
android:onClick="@{()-> viewModel.filterClick()}"
android:padding="5dp"
android:src="@drawable/img_filter" />
<View
android:layout_width="8dp"
android:layout_height="8dp"
android:layout_gravity="top|end"
android:background="@drawable/bg_red_dot"
android:visibility="@{viewModel.hasFilter ? View.VISIBLE : View.GONE}" />
</FrameLayout>
</LinearLayout>
</LinearLayout>
<!-- 列表区域 -->
<com.scwang.smart.refresh.layout.SmartRefreshLayout
android:id="@+id/srl"
android:layout_width="match_parent"
android:layout_height="0dp"
android:layout_weight="1">
<androidx.recyclerview.widget.RecyclerView
android:id="@+id/rv"
android:layout_width="match_parent"
android:layout_height="match_parent"
itemLayoutId="@{viewModel.itemLayoutId}"
viewHolder="@{viewModel.itemViewHolder}"
app:layoutManager="androidx.recyclerview.widget.LinearLayoutManager"
tools:listitem="@layout/item_int_imp_query" />
</com.scwang.smart.refresh.layout.SmartRefreshLayout>
<!-- 底部统计信息 -->
<LinearLayout
android:layout_width="match_parent"
android:layout_height="50dp"
android:background="@color/white"
android:gravity="center_vertical"
android:paddingHorizontal="15dp">
<LinearLayout
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:gravity="center_vertical"
android:orientation="horizontal">
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text='@{`合计:` + viewModel.totalCount + `票`}'
android:textColor="@color/bottom_tool_tips_text_color"
android:textSize="16sp"
android:textStyle="bold"
tools:text="合计3票" />
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginLeft="20dp"
android:text='@{`总件数:` + viewModel.totalPc}'
android:textColor="@color/bottom_tool_tips_text_color"
android:textSize="16sp"
android:textStyle="bold"
tools:text="总件数100" />
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginLeft="20dp"
android:text='@{`总重量:` + viewModel.totalWeight}'
android:textColor="@color/bottom_tool_tips_text_color"
android:textSize="16sp"
android:textStyle="bold"
tools:text="总重量100" />
</LinearLayout>
</LinearLayout>
</LinearLayout>
<!-- 遮罩层(只覆盖内容区域) -->
<View
android:id="@+id/filter_overlay"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:background="#80000000"
android:clickable="true"
android:focusable="true"
android:onClick="@{()-> viewModel.closeFilter()}"
android:visibility="gone" />
<!-- 筛选面板(从右侧滑入,只在内容区域内) -->
<include
android:id="@+id/filter_panel"
layout="@layout/layout_int_imp_query_filter"
android:layout_width="wrap_content"
android:layout_height="match_parent"
android:layout_gravity="end"
android:visibility="gone"
app:viewModel="@{viewModel}" />
</FrameLayout>
</LinearLayout>
</layout>

View File

@@ -0,0 +1,325 @@
<?xml version="1.0" encoding="utf-8"?>
<layout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools">
<data>
<variable
name="bean"
type="com.lukouguoji.module_base.bean.IntImpQueryBean" />
</data>
<!-- 外层容器承载间距 -->
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginHorizontal="15dp"
android:layout_marginVertical="5dp"
android:orientation="vertical">
<!-- 侧滑布局 -->
<com.mcxtzhang.swipemenulib.SwipeMenuLayout
android:id="@+id/swipe_menu"
android:layout_width="match_parent"
android:layout_height="wrap_content">
<!-- 主列表项容器 -->
<androidx.appcompat.widget.LinearLayoutCompat
android:id="@+id/ll"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:background="@drawable/bg_item"
android:orientation="horizontal"
android:paddingVertical="20dp"
android:paddingHorizontal="10dp">
<!-- 左侧图标 -->
<ImageView
android:layout_width="40dp"
android:layout_height="40dp"
android:layout_gravity="center"
android:src="@drawable/img_plane" />
<LinearLayout
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_marginLeft="10dp"
android:layout_weight="1"
android:orientation="vertical">
<!-- 第一行:运单号、件数、重量、代理人、航班信息 -->
<androidx.appcompat.widget.LinearLayoutCompat
android:layout_width="match_parent"
android:layout_height="wrap_content">
<!-- 运单号 -->
<androidx.appcompat.widget.LinearLayoutCompat
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_weight="0.8"
android:gravity="center_vertical">
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:textSize="15sp"
completeSpace="@{4}"
android:text="运单号:" />
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:textSize="15sp"
android:text="@{bean.wbNo}"
android:textColor="@color/colorPrimary"
tools:text="78109081212" />
</androidx.appcompat.widget.LinearLayoutCompat>
<!-- 件数 -->
<androidx.appcompat.widget.LinearLayoutCompat
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_weight="0.6"
android:gravity="center_vertical">
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:textSize="15sp"
completeSpace="@{3}"
android:text="件数:" />
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:textSize="15sp"
android:text='@{String.valueOf(bean.inPc)}'
tools:text="10" />
</androidx.appcompat.widget.LinearLayoutCompat>
<!-- 重量 -->
<androidx.appcompat.widget.LinearLayoutCompat
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_weight="1"
android:gravity="center_vertical">
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:textSize="15sp"
completeSpace="@{5}"
android:text="重量:" />
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:textSize="15sp"
android:text='@{String.valueOf(bean.inWeight)}'
tools:text="200" />
</androidx.appcompat.widget.LinearLayoutCompat>
<!-- 代理人 -->
<androidx.appcompat.widget.LinearLayoutCompat
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_weight="1"
android:gravity="center_vertical">
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:textSize="15sp"
completeSpace="@{5}"
android:text="代理人:" />
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:textSize="15sp"
android:text='@{bean.agentName}'
tools:text="SF" />
</androidx.appcompat.widget.LinearLayoutCompat>
<!-- 航班信息 -->
<androidx.appcompat.widget.LinearLayoutCompat
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_weight="1.0"
android:gravity="center_vertical">
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:textSize="15sp"
completeSpace="@{5}"
android:text="航班信息:" />
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:textSize="15sp"
android:text='@{bean.flight}'
tools:text="20240216/MU2026" />
</androidx.appcompat.widget.LinearLayoutCompat>
</androidx.appcompat.widget.LinearLayoutCompat>
<!-- 第二行:航程、特码、运单类型、入库时间、出库时间 -->
<androidx.appcompat.widget.LinearLayoutCompat
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginTop="10dp">
<!-- 航程 -->
<androidx.appcompat.widget.LinearLayoutCompat
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_weight="0.8"
android:gravity="center_vertical">
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:textSize="15sp"
completeSpace="@{4}"
android:text="航程:" />
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:textSize="15sp"
android:text="@{bean.range}"
tools:text="LAX-HFE" />
</androidx.appcompat.widget.LinearLayoutCompat>
<!-- 特码 -->
<androidx.appcompat.widget.LinearLayoutCompat
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_weight="0.6"
android:gravity="center_vertical">
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:textSize="15sp"
completeSpace="@{3}"
android:text="特码:" />
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:textSize="15sp"
android:text="@{bean.spCode}"
tools:text="NOR" />
</androidx.appcompat.widget.LinearLayoutCompat>
<!-- 运单类型 -->
<androidx.appcompat.widget.LinearLayoutCompat
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_weight="1"
android:gravity="center_vertical">
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:textSize="15sp"
completeSpace="@{5}"
android:text="运单类型:" />
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:textSize="15sp"
android:text='@{bean.awbName}'
tools:text="国际进港" />
</androidx.appcompat.widget.LinearLayoutCompat>
<!-- 入库时间 -->
<androidx.appcompat.widget.LinearLayoutCompat
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_weight="1"
android:gravity="center_vertical">
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:textSize="15sp"
completeSpace="@{5}"
android:text="入库时间:" />
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:textSize="15sp"
android:text='@{bean.inDate}'
tools:text="2024-05-13 17:10:22" />
</androidx.appcompat.widget.LinearLayoutCompat>
<!-- 出库时间 -->
<androidx.appcompat.widget.LinearLayoutCompat
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_weight="1.0"
android:gravity="center_vertical">
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:textSize="15sp"
completeSpace="@{5}"
android:text="出库时间:" />
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:textSize="15sp"
android:text='@{bean.dlvTime}'
tools:text="2024-05-13 17:10:22" />
</androidx.appcompat.widget.LinearLayoutCompat>
</androidx.appcompat.widget.LinearLayoutCompat>
</LinearLayout>
<!-- 右侧箭头 -->
<ImageView
android:layout_width="30dp"
android:layout_height="30dp"
android:layout_gravity="center"
android:layout_marginLeft="10dp"
android:src="@drawable/img_pda_right" />
</androidx.appcompat.widget.LinearLayoutCompat>
<!-- 侧滑菜单按钮区 -->
<androidx.appcompat.widget.LinearLayoutCompat
android:layout_width="wrap_content"
android:layout_height="match_parent"
android:orientation="horizontal">
<!-- 修改按钮 -->
<TextView
android:id="@+id/btn_edit"
style="@style/tv_item_action"
android:background="@color/colorPrimary"
android:text="修改" />
</androidx.appcompat.widget.LinearLayoutCompat>
</com.mcxtzhang.swipemenulib.SwipeMenuLayout>
</LinearLayout>
</layout>

View File

@@ -1,205 +1,201 @@
<?xml version="1.0" encoding="utf-8"?> <?xml version="1.0" encoding="utf-8"?>
<!--
国际进港查询 —— 手机版布局5.5 寸手持端,最小宽度 < 600dp 时生效)
平板版为同名文件 layout-sw600dp/activity_int_imp_query.xml两者是同一布局的资源变体
DataBinding 因此生成同一个 ActivityIntImpQueryBinding 类。
变体之间必须满足:
· DataBinding 变量完全一致viewModel
· 保留 Activity 中引用的控件 idsrl / rv
· 平板独有的 filter_overlay / filter_panel侧滑筛选手机版不提供
Binding 基类中自动变 @NullableIntImpQueryActivity 已判空处理
交互差异(均复用既有 IntImpQueryViewModel 字段与接口):
· 平板 5 个横排搜索条 → 手机顶部搜索框(运单号)+ 底部筛选弹层
(航班日期起/止、代理从搜索行移入弹层;设计稿无「出库状态」项,未提供)
· 三格统计(总票数/已入库/已出库后两格为手机专属客户端计数initPhoneExtras 开启)
· 筛选弹层显隐直接绑既有 viewModel.filterVisible无需平板的滑入动画代码
-->
<layout xmlns:android="http://schemas.android.com/apk/res/android" <layout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto" xmlns:app="http://schemas.android.com/apk/res-auto"
xmlns:tools="http://schemas.android.com/tools"> xmlns:tools="http://schemas.android.com/tools">
<data> <data>
<import type="android.view.View" /> <import type="android.view.View" />
<import type="com.lukouguoji.module_base.ui.weight.search.layout.SearchLayoutType" />
<import type="com.lukouguoji.module_base.ui.weight.phone.PhoneDataLayoutType" />
<variable <variable
name="viewModel" name="viewModel"
type="com.lukouguoji.gjj.viewModel.IntImpQueryViewModel" /> type="com.lukouguoji.gjj.viewModel.IntImpQueryViewModel" />
</data> </data>
<LinearLayout <FrameLayout
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="match_parent" android:layout_height="match_parent"
android:background="@color/color_f2" android:background="@color/phone_page_bg">
android:orientation="vertical">
<!-- 标题栏(始终在最上层,不被遮挡) --> <LinearLayout
<include layout="@layout/title_tool_bar" />
<!-- 内容区域FrameLayout 包裹,筛选面板和遮罩只在此区域内) -->
<FrameLayout
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="0dp" android:layout_height="match_parent"
android:layout_weight="1"> android:orientation="vertical">
<!-- 原有内容 --> <include layout="@layout/title_tool_bar" />
<!-- ==================== 搜索行 ==================== -->
<LinearLayout <LinearLayout
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="match_parent" android:layout_height="wrap_content"
android:orientation="vertical"> android:background="@color/white"
android:orientation="vertical"
android:paddingHorizontal="16dp"
android:paddingTop="16dp"
android:paddingBottom="12dp">
<!-- 搜索区域 --> <com.lukouguoji.module_base.ui.weight.phone.PhoneSearchBar
<LinearLayout
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:layout_marginHorizontal="10dp" hint='@{"搜索运单号"}'
android:layout_marginTop="10dp" setOnFilterClickListener="@{(v)-> viewModel.filterClick()}"
android:gravity="center_vertical" setOnScanClickListener="@{(v)-> viewModel.waybillScanClick()}"
setRefreshCallBack="@{viewModel::searchClick}"
value="@={viewModel.waybillNo}" />
</LinearLayout>
<!-- ==================== 三格统计:总票数 / 已入库 / 已出库 ==================== -->
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginHorizontal="16dp"
android:layout_marginTop="12dp"
android:orientation="horizontal">
<!-- 总票数(蓝) -->
<LinearLayout
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_weight="1"
android:background="@drawable/bg_phone_card"
android:orientation="horizontal"> android:orientation="horizontal">
<!-- 航班日期起 --> <View
<com.lukouguoji.module_base.ui.weight.search.layout.PadSearchLayout android:layout_width="4dp"
android:layout_width="0dp" android:layout_height="match_parent"
android:layout_height="wrap_content" android:layout_marginVertical="12dp"
android:layout_weight="1" android:background="@color/phone_primary" />
hint='@{"请选择开始日期"}'
icon="@{@drawable/img_date}"
type="@{SearchLayoutType.DATE}"
value="@={viewModel.flightDateStart}" />
<!-- 航班日期止 -->
<com.lukouguoji.module_base.ui.weight.search.layout.PadSearchLayout
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_weight="1"
hint='@{"请选择结束航班日期"}'
icon="@{@drawable/img_date}"
type="@{SearchLayoutType.DATE}"
value="@={viewModel.flightDateEnd}" />
<!-- 代理人 -->
<com.lukouguoji.module_base.ui.weight.search.layout.PadSearchLayout
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_weight="1"
hint='@{"请选择代理"}'
list="@{viewModel.agentList}"
type="@{SearchLayoutType.SPINNER}"
value="@={viewModel.agentId}" />
<!-- 出库状态 -->
<com.lukouguoji.module_base.ui.weight.search.layout.PadSearchLayout
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_weight="1"
hint='@{"请选择出库状态"}'
list="@{viewModel.outStatusList}"
type="@{SearchLayoutType.SPINNER}"
value="@={viewModel.outStatus}" />
<!-- 运单号 -->
<com.lukouguoji.module_base.ui.weight.search.layout.PadSearchLayout
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_weight="1"
hint='@{"请输入运单号"}'
icon="@{@drawable/img_scan}"
setOnIconClickListener="@{()-> viewModel.waybillScanClick()}"
type="@{SearchLayoutType.INPUT}"
value="@={viewModel.waybillNo}"
autoQueryEnabled="@{true}"
autoQueryUrl="@{`/IntImpSearch/queryWbNoList`}"
autoQueryParamKey="@{`wbNo`}"
autoQueryMinLength="@{4}"
autoQueryMaxLength="@{8}"
autoQueryTitle="@{`选择运单号`}" />
<!-- 搜索和筛选按钮 -->
<LinearLayout <LinearLayout
android:layout_width="0dp" android:layout_width="match_parent"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:layout_weight="1" android:orientation="vertical"
android:gravity="center_vertical|start" android:paddingHorizontal="12dp"
android:orientation="horizontal" android:paddingVertical="10dp">
android:paddingHorizontal="24dp">
<ImageView <TextView
android:layout_width="36dp" android:layout_width="wrap_content"
android:layout_height="36dp" android:layout_height="wrap_content"
android:onClick="@{()-> viewModel.searchClick()}" android:text="总票数"
android:padding="2dp" android:textColor="@color/phone_text_body"
android:src="@drawable/img_search" /> android:textSize="12sp" />
<FrameLayout <TextView
android:layout_width="36dp" android:layout_width="wrap_content"
android:layout_height="36dp" android:layout_height="wrap_content"
android:layout_marginLeft="16dp"> android:layout_marginTop="2dp"
android:text="@{viewModel.totalCount}"
<ImageView android:textColor="@color/phone_primary"
android:layout_width="match_parent" android:textSize="20sp"
android:layout_height="match_parent" android:textStyle="bold"
android:onClick="@{()-> viewModel.filterClick()}" tools:text="4" />
android:padding="5dp"
android:src="@drawable/img_filter" />
<View
android:layout_width="8dp"
android:layout_height="8dp"
android:layout_gravity="top|end"
android:background="@drawable/bg_red_dot"
android:visibility="@{viewModel.hasFilter ? View.VISIBLE : View.GONE}" />
</FrameLayout>
</LinearLayout> </LinearLayout>
</LinearLayout> </LinearLayout>
<!-- 列表区域 --> <!-- 已入库(橙) -->
<com.scwang.smart.refresh.layout.SmartRefreshLayout
android:id="@+id/srl"
android:layout_width="match_parent"
android:layout_height="0dp"
android:layout_weight="1">
<androidx.recyclerview.widget.RecyclerView
android:id="@+id/rv"
android:layout_width="match_parent"
android:layout_height="match_parent"
itemLayoutId="@{viewModel.itemLayoutId}"
viewHolder="@{viewModel.itemViewHolder}"
app:layoutManager="androidx.recyclerview.widget.LinearLayoutManager"
tools:listitem="@layout/item_int_imp_query" />
</com.scwang.smart.refresh.layout.SmartRefreshLayout>
<!-- 底部统计信息 -->
<LinearLayout <LinearLayout
android:layout_width="match_parent" android:layout_width="0dp"
android:layout_height="50dp" android:layout_height="wrap_content"
android:background="@color/white" android:layout_marginStart="10dp"
android:gravity="center_vertical" android:layout_weight="1"
android:paddingHorizontal="15dp"> android:background="@drawable/bg_phone_card"
android:orientation="horizontal">
<View
android:layout_width="4dp"
android:layout_height="match_parent"
android:layout_marginVertical="12dp"
android:background="@color/phone_tag_orange_text" />
<LinearLayout <LinearLayout
android:layout_width="wrap_content" android:layout_width="match_parent"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:gravity="center_vertical" android:orientation="vertical"
android:orientation="horizontal"> android:paddingHorizontal="12dp"
android:paddingVertical="10dp">
<TextView <TextView
android:layout_width="wrap_content" android:layout_width="wrap_content"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:text='@{`合计:` + viewModel.totalCount + `票`}' android:text="已入库"
android:textColor="@color/bottom_tool_tips_text_color" android:textColor="@color/phone_text_body"
android:textSize="16sp" android:textSize="12sp" />
android:textStyle="bold"
tools:text="合计3票" />
<TextView <TextView
android:layout_width="wrap_content" android:layout_width="wrap_content"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:layout_marginLeft="20dp" android:layout_marginTop="2dp"
android:text='@{`总件数:` + viewModel.totalPc}' android:text="@{viewModel.storedCount}"
android:textColor="@color/bottom_tool_tips_text_color" android:textColor="@color/phone_tag_orange_text"
android:textSize="16sp" android:textSize="20sp"
android:textStyle="bold" android:textStyle="bold"
tools:text="总件数100" /> tools:text="2" />
</LinearLayout>
</LinearLayout>
<!-- 已出库(绿) -->
<LinearLayout
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_marginStart="10dp"
android:layout_weight="1"
android:background="@drawable/bg_phone_card"
android:orientation="horizontal">
<View
android:layout_width="4dp"
android:layout_height="match_parent"
android:layout_marginVertical="12dp"
android:background="@color/phone_tag_green_text" />
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="vertical"
android:paddingHorizontal="12dp"
android:paddingVertical="10dp">
<TextView <TextView
android:layout_width="wrap_content" android:layout_width="wrap_content"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:layout_marginLeft="20dp" android:text="已出库"
android:text='@{`总重量:` + viewModel.totalWeight}' android:textColor="@color/phone_text_body"
android:textColor="@color/bottom_tool_tips_text_color" android:textSize="12sp" />
android:textSize="16sp"
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginTop="2dp"
android:text="@{viewModel.outboundCount}"
android:textColor="@color/phone_tag_green_text"
android:textSize="20sp"
android:textStyle="bold" android:textStyle="bold"
tools:text="总重量100" /> tools:text="2" />
</LinearLayout> </LinearLayout>
@@ -207,28 +203,131 @@
</LinearLayout> </LinearLayout>
<!-- 遮罩层(只覆盖内容区域) --> <!-- ==================== 列表 ==================== -->
<View <com.scwang.smart.refresh.layout.SmartRefreshLayout
android:id="@+id/filter_overlay" android:id="@+id/srl"
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="match_parent" android:layout_height="0dp"
android:background="#80000000" android:layout_weight="1">
android:clickable="true"
android:focusable="true"
android:onClick="@{()-> viewModel.closeFilter()}"
android:visibility="gone" />
<!-- 筛选面板(从右侧滑入,只在内容区域内) --> <androidx.recyclerview.widget.RecyclerView
<include android:id="@+id/rv"
android:id="@+id/filter_panel" android:layout_width="match_parent"
layout="@layout/layout_int_imp_query_filter" android:layout_height="match_parent"
android:layout_width="wrap_content" android:clipToPadding="false"
android:layout_height="match_parent" android:overScrollMode="never"
android:layout_gravity="end" android:paddingTop="4dp"
android:visibility="gone" android:paddingBottom="24dp"
app:viewModel="@{viewModel}" /> itemLayoutId="@{viewModel.itemLayoutId}"
viewHolder="@{viewModel.itemViewHolder}"
app:layoutManager="androidx.recyclerview.widget.LinearLayoutManager"
tools:itemCount="3"
tools:listitem="@layout/item_int_imp_query" />
</FrameLayout> </com.scwang.smart.refresh.layout.SmartRefreshLayout>
</LinearLayout>
<!-- ==================== 筛选弹层(绑既有 filterVisible ==================== -->
<com.lukouguoji.module_base.ui.weight.phone.PhoneFilterPanel
android:layout_width="match_parent"
android:layout_height="match_parent"
android:elevation="8dp"
panelVisible="@{viewModel.filterVisible}"
setOnConfirmClick="@{(v)-> viewModel.confirmFilter()}"
setOnDismissClick="@{(v)-> viewModel.closeFilter()}"
setOnResetClick="@{(v)-> viewModel.resetFilter()}"
title='@{"筛选条件"}'>
<!-- 航班日期起(平板搜索行字段,手机移入弹层) -->
<com.lukouguoji.module_base.ui.weight.phone.PhoneDataLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
hint='@{"请选择航班日期"}'
title='@{"航班日期起"}'
type="@{PhoneDataLayoutType.DATE}"
value="@={viewModel.flightDateStart}" />
<!-- 航班日期止 -->
<com.lukouguoji.module_base.ui.weight.phone.PhoneDataLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
hint='@{"请选择航班日期"}'
title='@{"航班日期止"}'
type="@{PhoneDataLayoutType.DATE}"
value="@={viewModel.flightDateEnd}" />
<!-- 航班号 -->
<com.lukouguoji.module_base.ui.weight.phone.PhoneDataLayout
android:id="@+id/phone_filter_flight_no"
android:layout_width="match_parent"
android:layout_height="wrap_content"
hint='@{"请输入航班号"}'
title='@{"航班号"}'
type="@{PhoneDataLayoutType.INPUT}"
value="@={viewModel.flightNo}" />
<!-- 代理(平板搜索行字段,手机移入弹层) -->
<com.lukouguoji.module_base.ui.weight.phone.PhoneDataLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
hint='@{"请选择代理"}'
list="@{viewModel.agentList}"
title='@{"代理"}'
type="@{PhoneDataLayoutType.SPINNER}"
value="@={viewModel.agentId}" />
<!-- 特码(复用平板筛选面板同一字典 spCodeList -->
<com.lukouguoji.module_base.ui.weight.phone.PhoneDataLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
hint='@{"请选择特码"}'
list="@{viewModel.spCodeList}"
title='@{"特码"}'
type="@{PhoneDataLayoutType.SPINNER}"
value="@={viewModel.spCode}" />
<!-- 始发站 -->
<com.lukouguoji.module_base.ui.weight.phone.PhoneDataLayout
android:id="@+id/phone_filter_origin"
android:layout_width="match_parent"
android:layout_height="wrap_content"
hint='@{"请输入始发站"}'
title='@{"始发站"}'
type="@{PhoneDataLayoutType.INPUT}"
value="@={viewModel.origin}" />
<!-- 运单类型 -->
<com.lukouguoji.module_base.ui.weight.phone.PhoneDataLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
hint='@{"请选择运单类型"}'
list="@{viewModel.awbTypeList}"
title='@{"运单类型"}'
type="@{PhoneDataLayoutType.SPINNER}"
value="@={viewModel.awbType}" />
<!-- 业务类型 -->
<com.lukouguoji.module_base.ui.weight.phone.PhoneDataLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
hint='@{"请选择业务类型"}'
list="@{viewModel.businessTypeList}"
title='@{"业务类型"}'
type="@{PhoneDataLayoutType.SPINNER}"
value="@={viewModel.businessType}" />
<!-- 品名(中) -->
<com.lukouguoji.module_base.ui.weight.phone.PhoneDataLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
hint='@{"请输入品名"}'
title='@{"品名(中)"}'
type="@{PhoneDataLayoutType.INPUT}"
value="@={viewModel.goodsCn}" />
</com.lukouguoji.module_base.ui.weight.phone.PhoneFilterPanel>
</FrameLayout>
</LinearLayout>
</layout> </layout>

View File

@@ -1,325 +1,226 @@
<?xml version="1.0" encoding="utf-8"?> <?xml version="1.0" encoding="utf-8"?>
<!--
国际进港查询 —— 列表项手机版布局5.5 寸手持端,最小宽度 < 600dp 时生效)
平板版为同名文件 layout-sw600dp/item_int_imp_query.xml两者是同一布局的资源变体
DataBinding 因此生成同一个 ItemIntImpQueryBinding 类。
变体之间必须满足:
· DataBinding 变量完全一致bean
· 保留 IntImpQueryViewHolder 引用的控件 idll整卡点击进详情
· 平板侧滑「修改」按钮swipe_menu/btn_edit手机版不提供设计稿无编辑入口
编辑走详情页头部入口ViewHolder 里已判空,安全
状态标签按 bean 计算属性切换(前端推断,见 IntImpQueryBean 注释):
· 已出库(绿)= dlvTime 非空
· 已入库(橙)= inDate 非空
· 未入库(灰)= 兜底
-->
<layout xmlns:android="http://schemas.android.com/apk/res/android" <layout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"> xmlns:tools="http://schemas.android.com/tools">
<data> <data>
<import type="android.view.View" />
<variable <variable
name="bean" name="bean"
type="com.lukouguoji.module_base.bean.IntImpQueryBean" /> type="com.lukouguoji.module_base.bean.IntImpQueryBean" />
</data> </data>
<!-- 外层容器承载间距 --> <androidx.appcompat.widget.LinearLayoutCompat
<LinearLayout android:id="@+id/ll"
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:layout_marginHorizontal="15dp" android:layout_marginHorizontal="16dp"
android:layout_marginVertical="5dp" android:layout_marginTop="12dp"
android:orientation="vertical"> android:background="@drawable/bg_phone_card"
android:orientation="vertical"
<!-- 侧滑布局 --> android:padding="14dp">
<com.mcxtzhang.swipemenulib.SwipeMenuLayout
android:id="@+id/swipe_menu"
android:layout_width="match_parent"
android:layout_height="wrap_content">
<!-- 主列表项容器 -->
<androidx.appcompat.widget.LinearLayoutCompat
android:id="@+id/ll"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:background="@drawable/bg_item"
android:orientation="horizontal"
android:paddingVertical="20dp"
android:paddingHorizontal="10dp">
<!-- 左侧图标 -->
<ImageView
android:layout_width="40dp"
android:layout_height="40dp"
android:layout_gravity="center"
android:src="@drawable/img_plane" />
<!-- ==================== 头行:蓝点 + 运单号 + 状态标签 + 箭头 ==================== -->
<LinearLayout <LinearLayout
android:layout_width="0dp" android:layout_width="match_parent"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:layout_marginLeft="10dp" android:gravity="center_vertical"
android:layout_weight="1" android:orientation="horizontal">
android:orientation="vertical">
<!-- 第一行:运单号、件数、重量、代理人、航班信息 --> <View
<androidx.appcompat.widget.LinearLayoutCompat android:layout_width="8dp"
android:layout_width="match_parent" android:layout_height="8dp"
android:layout_height="wrap_content"> android:layout_marginEnd="8dp"
android:background="@drawable/bg_phone_dot_blue" />
<!-- 运单号 --> <TextView
<androidx.appcompat.widget.LinearLayoutCompat android:layout_width="0dp"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_weight="0.8"
android:gravity="center_vertical">
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:textSize="15sp"
completeSpace="@{4}"
android:text="运单号:" />
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:textSize="15sp"
android:text="@{bean.wbNo}"
android:textColor="@color/colorPrimary"
tools:text="78109081212" />
</androidx.appcompat.widget.LinearLayoutCompat>
<!-- 件数 -->
<androidx.appcompat.widget.LinearLayoutCompat
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_weight="0.6"
android:gravity="center_vertical">
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:textSize="15sp"
completeSpace="@{3}"
android:text="件数:" />
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:textSize="15sp"
android:text='@{String.valueOf(bean.inPc)}'
tools:text="10" />
</androidx.appcompat.widget.LinearLayoutCompat>
<!-- 重量 -->
<androidx.appcompat.widget.LinearLayoutCompat
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_weight="1"
android:gravity="center_vertical">
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:textSize="15sp"
completeSpace="@{5}"
android:text="重量:" />
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:textSize="15sp"
android:text='@{String.valueOf(bean.inWeight)}'
tools:text="200" />
</androidx.appcompat.widget.LinearLayoutCompat>
<!-- 代理人 -->
<androidx.appcompat.widget.LinearLayoutCompat
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_weight="1"
android:gravity="center_vertical">
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:textSize="15sp"
completeSpace="@{5}"
android:text="代理人:" />
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:textSize="15sp"
android:text='@{bean.agentName}'
tools:text="SF" />
</androidx.appcompat.widget.LinearLayoutCompat>
<!-- 航班信息 -->
<androidx.appcompat.widget.LinearLayoutCompat
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_weight="1.0"
android:gravity="center_vertical">
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:textSize="15sp"
completeSpace="@{5}"
android:text="航班信息:" />
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:textSize="15sp"
android:text='@{bean.flight}'
tools:text="20240216/MU2026" />
</androidx.appcompat.widget.LinearLayoutCompat>
</androidx.appcompat.widget.LinearLayoutCompat>
<!-- 第二行:航程、特码、运单类型、入库时间、出库时间 -->
<androidx.appcompat.widget.LinearLayoutCompat
android:layout_width="match_parent"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:layout_marginTop="10dp"> android:layout_weight="1"
android:text="@{bean.wbNo}"
android:textColor="@color/phone_text_title"
android:textSize="16sp"
android:textStyle="bold"
tools:text="78133363396" />
<!-- 航程 --> <!-- 已出库(绿) -->
<androidx.appcompat.widget.LinearLayoutCompat <TextView
android:layout_width="0dp" android:layout_width="wrap_content"
android:layout_height="wrap_content" android:layout_height="20dp"
android:layout_weight="0.8" android:layout_marginStart="8dp"
android:gravity="center_vertical"> android:background="@drawable/bg_phone_tag_green"
android:gravity="center"
android:paddingHorizontal="8dp"
android:text="已出库"
android:textColor="@color/phone_tag_green_text"
android:textSize="11sp"
android:visibility="@{bean.isQueryOutbound ? View.VISIBLE : View.GONE}" />
<TextView <!-- 已入库(橙) -->
android:layout_width="wrap_content" <TextView
android:layout_height="wrap_content" android:layout_width="wrap_content"
android:textSize="15sp" android:layout_height="20dp"
completeSpace="@{4}" android:layout_marginStart="8dp"
android:text="航程:" /> android:background="@drawable/bg_phone_tag_orange"
android:gravity="center"
android:paddingHorizontal="8dp"
android:text="已入库"
android:textColor="@color/phone_tag_orange_text"
android:textSize="11sp"
android:visibility="@{!bean.isQueryOutbound &amp;&amp; bean.isQueryStored ? View.VISIBLE : View.GONE}" />
<TextView <!-- 未入库(灰,兜底) -->
android:layout_width="wrap_content" <TextView
android:layout_height="wrap_content" android:layout_width="wrap_content"
android:textSize="15sp" android:layout_height="20dp"
android:text="@{bean.range}" android:layout_marginStart="8dp"
tools:text="LAX-HFE" /> android:background="@drawable/bg_phone_tag_gray"
android:gravity="center"
android:paddingHorizontal="8dp"
android:text="未入库"
android:textColor="@color/phone_tag_gray_text"
android:textSize="11sp"
android:visibility="@{!bean.isQueryOutbound &amp;&amp; !bean.isQueryStored ? View.VISIBLE : View.GONE}" />
</androidx.appcompat.widget.LinearLayoutCompat> <ImageView
android:layout_width="16dp"
<!-- 特码 --> android:layout_height="16dp"
<androidx.appcompat.widget.LinearLayoutCompat android:layout_marginStart="6dp"
android:layout_width="0dp" android:src="@drawable/ic_phone_chevron_right" />
android:layout_height="wrap_content"
android:layout_weight="0.6"
android:gravity="center_vertical">
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:textSize="15sp"
completeSpace="@{3}"
android:text="特码:" />
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:textSize="15sp"
android:text="@{bean.spCode}"
tools:text="NOR" />
</androidx.appcompat.widget.LinearLayoutCompat>
<!-- 运单类型 -->
<androidx.appcompat.widget.LinearLayoutCompat
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_weight="1"
android:gravity="center_vertical">
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:textSize="15sp"
completeSpace="@{5}"
android:text="运单类型:" />
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:textSize="15sp"
android:text='@{bean.awbName}'
tools:text="国际进港" />
</androidx.appcompat.widget.LinearLayoutCompat>
<!-- 入库时间 -->
<androidx.appcompat.widget.LinearLayoutCompat
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_weight="1"
android:gravity="center_vertical">
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:textSize="15sp"
completeSpace="@{5}"
android:text="入库时间:" />
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:textSize="15sp"
android:text='@{bean.inDate}'
tools:text="2024-05-13 17:10:22" />
</androidx.appcompat.widget.LinearLayoutCompat>
<!-- 出库时间 -->
<androidx.appcompat.widget.LinearLayoutCompat
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_weight="1.0"
android:gravity="center_vertical">
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:textSize="15sp"
completeSpace="@{5}"
android:text="出库时间:" />
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:textSize="15sp"
android:text='@{bean.dlvTime}'
tools:text="2024-05-13 17:10:22" />
</androidx.appcompat.widget.LinearLayoutCompat>
</androidx.appcompat.widget.LinearLayoutCompat>
</LinearLayout> </LinearLayout>
<!-- 右侧箭头 --> <!-- ==================== 字段网格:件数/重量 ==================== -->
<ImageView <LinearLayout
android:layout_width="30dp" android:layout_width="match_parent"
android:layout_height="30dp" android:layout_height="wrap_content"
android:layout_gravity="center" android:layout_marginTop="12dp"
android:layout_marginLeft="10dp" android:orientation="horizontal">
android:src="@drawable/img_pda_right" />
</androidx.appcompat.widget.LinearLayoutCompat> <LinearLayout
android:layout_width="0dp"
<!-- 侧滑菜单按钮区 --> android:layout_height="wrap_content"
<androidx.appcompat.widget.LinearLayoutCompat android:layout_weight="1"
android:layout_width="wrap_content" android:gravity="center_vertical"
android:layout_height="match_parent"
android:orientation="horizontal"> android:orientation="horizontal">
<!-- 修改按钮 --> <ImageView
android:layout_width="14dp"
android:layout_height="14dp"
android:src="@drawable/ic_phone_package" />
<TextView <TextView
android:id="@+id/btn_edit" android:layout_width="wrap_content"
style="@style/tv_item_action" android:layout_height="wrap_content"
android:background="@color/colorPrimary" android:layout_marginStart="6dp"
android:text="修改" /> android:text='@{"件数:" + (bean.inPc != null ? String.valueOf(bean.inPc) : "--")}'
android:textColor="@color/phone_text_body"
android:textSize="13sp"
tools:text="件数444" />
</androidx.appcompat.widget.LinearLayoutCompat> </LinearLayout>
</com.mcxtzhang.swipemenulib.SwipeMenuLayout> <LinearLayout
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_weight="1"
android:gravity="center_vertical"
android:orientation="horizontal">
</LinearLayout> <ImageView
android:layout_width="14dp"
android:layout_height="14dp"
android:src="@drawable/ic_phone_weight" />
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginStart="6dp"
android:text='@{"重量:" + (bean.inWeight != null ? String.valueOf(bean.inWeight) : "--")}'
android:textColor="@color/phone_text_body"
android:textSize="13sp"
tools:text="重量555" />
</LinearLayout>
</LinearLayout>
<!-- ==================== 字段网格:代理人/特码 ==================== -->
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginTop="8dp"
android:orientation="horizontal">
<LinearLayout
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_weight="1"
android:gravity="center_vertical"
android:orientation="horizontal">
<ImageView
android:layout_width="14dp"
android:layout_height="14dp"
android:src="@drawable/ic_phone_person" />
<TextView
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_marginStart="6dp"
android:layout_weight="1"
android:ellipsize="end"
android:maxLines="1"
android:text='@{"代理人:" + bean.orDash(bean.agentDisplay)}'
android:textColor="@color/phone_text_body"
android:textSize="13sp"
tools:text="代理人:中外运" />
</LinearLayout>
<LinearLayout
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_weight="1"
android:gravity="center_vertical"
android:orientation="horizontal">
<ImageView
android:layout_width="14dp"
android:layout_height="14dp"
android:src="@drawable/ic_phone_tag" />
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginStart="6dp"
android:text='@{"特码:" + bean.orDash(bean.spCode)}'
android:textColor="@color/phone_text_body"
android:textSize="13sp"
tools:text="特码DGR" />
</LinearLayout>
</LinearLayout>
</androidx.appcompat.widget.LinearLayoutCompat>
</layout> </layout>

View File

@@ -78,6 +78,12 @@ class GjViewModel : BaseViewModel() {
Constant.AuthName.GjjWareHouseActivity, Constant.AuthName.GjjWareHouseActivity,
ARouterConstants.ACTIVITY_URL_GJJ_WARE_HOUSE ARouterConstants.ACTIVITY_URL_GJJ_WARE_HOUSE
), ),
ActionBean(
"进港查询",
R.drawable.gjj_query_icon,
Constant.AuthName.GjjQueryListActivity,
ARouterConstants.ACTIVITY_URL_GJJ_QUERY_LIST
),
ActionBean( ActionBean(
"提取出库", "提取出库",
R.drawable.gjj_chu_ku_icon, R.drawable.gjj_chu_ku_icon,

View File

@@ -1,12 +1,14 @@
package com.sixin.module_p.ui.enter.gn package com.sixin.module_p.ui.enter.gn
import android.content.Intent import android.content.Intent
import com.alibaba.android.arouter.launcher.ARouter
import com.lukouguoji.module_base.base.BaseViewModel import com.lukouguoji.module_base.base.BaseViewModel
import com.lukouguoji.module_base.bean.ActionBean import com.lukouguoji.module_base.bean.ActionBean
import com.lukouguoji.module_base.common.Constant import com.lukouguoji.module_base.common.Constant
import com.lukouguoji.module_base.db.perference.SharedPreferenceUtil import com.lukouguoji.module_base.db.perference.SharedPreferenceUtil
import com.lukouguoji.module_base.ktx.logd import com.lukouguoji.module_base.ktx.logd
import com.lukouguoji.module_base.ktx.loge import com.lukouguoji.module_base.ktx.loge
import com.lukouguoji.module_base.router.ARouterConstants
import com.sixin.module_p.R import com.sixin.module_p.R
import com.sixin.module_p.ui.enter.gn.document.PdaDocumentHandoverActivity import com.sixin.module_p.ui.enter.gn.document.PdaDocumentHandoverActivity
import com.sixin.module_p.ui.gnc.cunfang.list.PdaGncCunFangListActivity import com.sixin.module_p.ui.gnc.cunfang.list.PdaGncCunFangListActivity
@@ -57,11 +59,25 @@ class GnViewModel : BaseViewModel() {
R.mipmap.gnc_document_handover, R.mipmap.gnc_document_handover,
Constant.AuthName.DocumentHandover Constant.AuthName.DocumentHandover
), ),
ActionBean(
"进港移库",
R.drawable.gnj_yi_ku_icon, // 图标复制自 module_gnjmodule_p 看不到业务模块资源)
Constant.AuthName.GnjYiKu, // 权限串与 Pad 端菜单一致AppDomImpMove
ARouterConstants.ACTIVITY_URL_GNJ_MOVE_STASH_LIST // 与 Pad 首页菜单同一跳转页app 模块,走路由)
),
) )
.filter { SharedPreferenceUtil.getString(Constant.Share.authList).contains(it.key) } .filter { SharedPreferenceUtil.getString(Constant.Share.authList).contains(it.key) }
fun onItemClick(position: Int) { fun onItemClick(position: Int) {
val bean = actionList.getOrNull(position) ?: return
// 配了路由的直接跳5.5 寸适配页走这条,与 GjViewModel 同模式)
if (bean.route.isNotEmpty()) {
ARouter.getInstance().build(bean.route).navigation()
return
}
when (val title = actionList[position].title) { when (val title = actionList[position].title) {
"出港收运" -> { "出港收运" -> {
GncUnShouYunActivity.start(DevUtils.getTopActivity()) GncUnShouYunActivity.start(DevUtils.getTopActivity())

Binary file not shown.

After

Width:  |  Height:  |  Size: 32 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 26 KiB