Ver código fonte

优化价格上传

ccc 1 mês atrás
pai
commit
66ce256d02

+ 5 - 5
module_backstage/src/main/java/com/module/backstage/fragment/product/PriceFragment.kt

@@ -80,10 +80,13 @@ class PriceFragment : BaseFragment<BackstageFragmentPriceBinding, PriceFragmentV
                 val sellStatus = jsonObject.getBoolean("isSelected")  // 获取 price 值
                 var productName = jsonObject.getString("customName")  // 获取 price 值
                 if (productName==""){
-                    productName = UiUtil.getStringRes(R.string.base_pro_02)
+                    if (productNo=="E01"){
+                        productName = UiUtil.getStringRes(R.string.base_pro_01)
+                    }else if (productNo=="E02"){
+                        productName = UiUtil.getStringRes(R.string.base_pro_02)
+                    }
                 }
                 val name = jsonObject.getString("nameChinese")  // 获取 price 值
-//                val newArray = JSONArray()
                 val newPrice = JSONObject()
                 newPrice.put("codePrice", price)  // 价格
                 newPrice.put("productName", productName)// 自定义名字
@@ -92,9 +95,6 @@ class PriceFragment : BaseFragment<BackstageFragmentPriceBinding, PriceFragmentV
                 newPrice.put("sellStatus", sellStatus) // 商品显示
                 newPrice.put("no", productNo) // 商品编号
                 // 将新对象添加到新数组中
-//                newArray.put(newPrice)
-//                Log.d(TAG, "initViewnewArray: "+newArray)
-//                Log.d(TAG, "newArrayinitView:1 "+newArray)
                 Log.d(TAG, "newArrayinitView:2 "+newPrice)
                 EventBus.getDefault().post(ApiMessageEvent(MMKVName.PRICE, newPrice))
             }