feat: 新增首页净材/毛菜入口按钮及StoreActivity称重识别页面

- 首页新增净材、毛菜两个渐变色按钮(蓝/橙),隐藏原ImageView入口
- 新增StoreActivity,继承GoodsListActivity,复用秤监听、相机、识别弹窗能力
- GoodsListActivity.replaceIncludeContent()新增else分支,非采购/自采页面隐藏flContainer
- BaseDialog设备列表提取为常量,优化小屏幕判断逻辑
- 更新本地测试环境地址及环境切换弹窗文案

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
2026-05-26 18:54:30 +08:00
co-authored by Claude Sonnet 4.6
parent fa58304ca1
commit ac9494a0f3
10 changed files with 144 additions and 7 deletions
+4
View File
@@ -55,6 +55,10 @@
android:windowSoftInputMode="adjustPan" />
<activity android:name="com.sw.inbound.activity.LocalImagePreviewActivity" />
<activity android:name="com.sw.inbound.activity.PurchaseOrderActivity" />
<activity
android:name="com.sw.inbound.activity.StoreActivity"
android:screenOrientation="landscape"
android:windowSoftInputMode="adjustPan" />
<activity android:name="com.sw.inbound.activity.FunActivity"
android:screenOrientation="landscape" />
<!-- 首页 ActivityXML 版本,对应 HomeScreen.kt Compose 版本) -->
@@ -43,7 +43,8 @@ object GlobalData {
/**
* 具体业务 BaseUrl
*/
const val TEST_BASE_URL = "http://192.168.1.201:14801"
// const val TEST_BASE_URL = "http://192.168.1.201:14801"
const val TEST_BASE_URL = "http://192.168.10.118:14801"
const val UAT_BASE_URL = "https://dev.yixiong-tech.com:8083"
const val PROD_BASE_URL = "https://api.dm.yixiong-tech.com:8443"
var appBaseUrl: String = ""
@@ -476,10 +476,12 @@ abstract class GoodsListActivity : BaseActivity() {
val tempBinding =
ListItemReceiptGoodsBinding.inflate(layoutInflater, binding.flContainer, false)
binding.flContainer.addView(tempBinding.root)
} else {
} else if (this is SelfProcurementActivity) {
val tempBinding =
ListItemSelfProcurementBinding.inflate(layoutInflater, binding.flContainer, false)
binding.flContainer.addView(tempBinding.root)
} else {
binding.flContainer.gone()
}
}
@@ -107,6 +107,20 @@ class HomeActivity : BaseActivity() {
putExtra(GoodsListActivity.IS_RECEIPT_PAGE, false)
}
}
// 净材按钮点击提示
binding.btnOrderPurchase.setOnClickListener {
startActivity<StoreActivity> {
//putExtra(GoodsListActivity.IS_RECEIPT_PAGE, false)
}
}
// 毛菜按钮点击提示
binding.btnOrderSelfProcurement.setOnClickListener {
startActivity<StoreActivity> {
//putExtra(GoodsListActivity.IS_RECEIPT_PAGE, false)
}
}
}
/**
@@ -0,0 +1,43 @@
package com.sw.inbound.activity
import android.os.Bundle
import androidx.recyclerview.widget.RecyclerView
import com.sw.inbound.model.response.DictType
import com.sw.inbound.utils.ext.gone
import dagger.hilt.android.AndroidEntryPoint
/**
* 入库称重页面
* 继承 GoodsListActivity 以复用秤监听、相机拍照、菜品识别弹窗等核心能力,
* 同时通过隐藏不需要的 View 精简界面,避免大量重复代码。
*/
@AndroidEntryPoint
class StoreActivity : GoodsListActivity() {
override fun onCreate(savedInstanceState: Bundle?) {
super.onCreate(savedInstanceState)
hideUnusedViews()
}
/** 隐藏采购单列表、仓库下拉、提交按钮等本页面不需要的控件 */
private fun hideUnusedViews() {
binding.flWarehouseDropdown.gone()
binding.cvDropdownBg.gone()
binding.tvPurchaseNo.gone()
binding.btnConfirmReceipt.gone()
binding.tvConfirmNum.gone()
binding.tvNotConfirmNum.gone()
binding.flContainer.gone()
binding.rvGoodsList.gone()
}
override fun initRecyclerView() {
// 本页面无列表,空实现
}
override fun initView() {
// 本页面无额外初始化逻辑,空实现
}
override fun getWarehouseList(): List<DictType> = emptyList()
}
@@ -14,11 +14,17 @@ import com.sw.inbound.activity.GoodsListActivity
import com.sw.inbound.utils.ext.dp
import com.sw.inbound.utils.ext.hideKeyboard
//测试设备,小屏幕
private val devices = listOf(
"f0bcabbb-0d58-3b14-8bed-9863b7ec61ef",
"3dff871a-c66a-3fd8-93ce-81b57ead80f4"
)
abstract class BaseDialog(
context: Context,
var defWidth: Int = 1500.dp,
// var defHeight: Int = 900.dp
var defHeight: Int = if ("f0bcabbb-0d58-3b14-8bed-9863b7ec61ef" == GlobalData.deviceId) 750.dp else 900.dp
var defHeight: Int = if (devices.contains(GlobalData.deviceId)) 750.dp else 900.dp
) : Dialog(context, R.style.DialogTheme) {
override fun onCreate(savedInstanceState: Bundle?) {
@@ -0,0 +1,13 @@
<?xml version="1.0" encoding="utf-8"?>
<shape xmlns:android="http://schemas.android.com/apk/res/android"
android:shape="rectangle">
<!-- 从上到下:浅蓝(占比多)→ 深蓝,angle=270 表示从上到下 -->
<gradient
android:angle="270"
android:startColor="#88BBFF"
android:centerColor="#1A6EFF"
android:centerX="0.65"
android:endColor="#0032C8"
android:type="linear" />
<corners android:radius="16dp" />
</shape>
@@ -0,0 +1,13 @@
<?xml version="1.0" encoding="utf-8"?>
<shape xmlns:android="http://schemas.android.com/apk/res/android"
android:shape="rectangle">
<!-- 从上到下:浅橙(占比多)→ 深橙,angle=270 表示从上到下 -->
<gradient
android:angle="270"
android:startColor="#FFD08A"
android:centerColor="#FF9632"
android:centerX="0.65"
android:endColor="#CC6400"
android:type="linear" />
<corners android:radius="16dp" />
</shape>
+43 -2
View File
@@ -76,13 +76,14 @@
</LinearLayout>
<!-- 功能入口区域,水平居中排列两个入口图标 -->
<!-- 功能入口区域(原始,已隐藏) -->
<LinearLayout
android:layout_width="match_parent"
android:layout_height="0dp"
android:layout_weight="1"
android:gravity="center"
android:orientation="horizontal">
android:orientation="horizontal"
android:visibility="gone">
<!-- 采购单入库入口 -->
<ImageView
@@ -106,4 +107,44 @@
</LinearLayout>
<!-- 功能入口区域(新版,按钮样式) -->
<LinearLayout
android:layout_width="match_parent"
android:layout_height="0dp"
android:layout_weight="1"
android:gravity="center"
android:orientation="horizontal">
<!-- 净材入库入口 -->
<Button
android:id="@+id/btnOrderPurchase"
android:layout_width="595dp"
android:layout_height="477dp"
android:background="@drawable/bg_gradient_blue_btn"
android:foreground="?android:attr/selectableItemBackground"
android:text="净材"
android:textColor="@color/white"
android:textSize="100sp"
android:textStyle="bold"
android:stateListAnimator="@null" />
<Space
android:layout_width="15dp"
android:layout_height="1dp" />
<!-- 毛菜入库入口 -->
<Button
android:id="@+id/btnOrderSelfProcurement"
android:layout_width="595dp"
android:layout_height="477dp"
android:background="@drawable/bg_gradient_orange_btn"
android:foreground="?android:attr/selectableItemBackground"
android:text="毛菜"
android:textColor="@color/white"
android:textSize="100sp"
android:textStyle="bold"
android:stateListAnimator="@null" />
</LinearLayout>
</LinearLayout>
@@ -38,7 +38,7 @@
android:layout_height="72dp"
android:gravity="center_vertical"
android:paddingStart="16dp"
android:text="测试环境"
android:text="本地环境"
android:textColor="#ff141428"
android:textSize="28sp" />
@@ -48,7 +48,7 @@
android:layout_height="72dp"
android:gravity="center_vertical"
android:paddingStart="16dp"
android:text="UAT 环境"
android:text="测试环境"
android:textColor="#ff141428"
android:textSize="28sp" />