Sfoglia il codice sorgente

月子中心门口机版本,背景颜色根据宝宝姓名自动切换

weizhengliang 3 anni fa
parent
commit
ea535cd46b
26 ha cambiato i file con 495 aggiunte e 47 eliminazioni
  1. 93 30
      callingdoor/src/main/java/com/wdkl/app/ncs/callingdoor/activity/CallingdoorActivity.kt
  2. 2 0
      callingdoor/src/main/java/com/wdkl/app/ncs/callingdoor/di/CallingdoorComponent.kt
  3. 159 0
      callingdoor/src/main/java/com/wdkl/app/ncs/callingdoor/fragment/YzMainFragment.kt
  4. 6 0
      callingdoor/src/main/res/drawable/shape_bottom_bg_blue.xml
  5. 6 0
      callingdoor/src/main/res/drawable/shape_bottom_bg_red.xml
  6. 6 0
      callingdoor/src/main/res/drawable/shape_desc_bg_blue.xml
  7. 6 0
      callingdoor/src/main/res/drawable/shape_desc_bg_red.xml
  8. 12 9
      callingdoor/src/main/res/layout/callingdoor_main_lay.xml
  9. 5 4
      callingdoor/src/main/res/layout/view_title_layout.xml
  10. 144 0
      callingdoor/src/main/res/layout/yz_main_view_layout.xml
  11. BIN
      callingdoor/src/main/res/mipmap-mdpi/ic_daylight_red.png
  12. BIN
      callingdoor/src/main/res/mipmap-mdpi/ic_ethernet_success_red.png
  13. BIN
      callingdoor/src/main/res/mipmap-mdpi/ic_night_red.png
  14. BIN
      callingdoor/src/main/res/mipmap-mdpi/ic_nurse_1.png
  15. BIN
      callingdoor/src/main/res/mipmap-mdpi/ic_nurse_2.png
  16. BIN
      callingdoor/src/main/res/mipmap-mdpi/ic_tcp_success_red.png
  17. BIN
      callingdoor/src/main/res/mipmap-mdpi/ic_wifi_success_red.png
  18. BIN
      callingdoor/src/main/res/mipmap-mdpi/main_bg_boy.png
  19. BIN
      callingdoor/src/main/res/mipmap-mdpi/main_bg_girl.png
  20. BIN
      callingdoor/src/main/res/mipmap-mdpi/room_bg_boy.jpg
  21. BIN
      callingdoor/src/main/res/mipmap-mdpi/room_bg_girl.jpg
  22. 6 1
      callingdoor/src/main/res/values/colors.xml
  23. 8 0
      middleware/src/main/code/com/wdkl/ncs/android/middleware/common/Constant.java
  24. 38 0
      middleware/src/main/code/com/wdkl/ncs/android/middleware/model/vo/FrameBedVO.java
  25. 3 2
      middleware/src/main/code/com/wdkl/ncs/android/middleware/tcp/channel/DeviceChannel.java
  26. 1 1
      resource/src/main/res/values-zh/strings.xml

+ 93 - 30
callingdoor/src/main/java/com/wdkl/app/ncs/callingdoor/activity/CallingdoorActivity.kt

@@ -119,11 +119,13 @@ class CallingdoorActivity :BaseActivity<CallingdoorActivityPresenter, Callingdoo
     private var netErrCount : Int = 0
 
     override fun getLayId(): Int {
-        if ("rk3288".equals(Build.MODEL)) {
+        /*if ("rk3288".equals(Build.MODEL)) {
             return R.layout.callingdoor_main_lay_rk3288
         } else {
             return R.layout.callingdoor_main_lay
-        }
+        }*/
+
+        return R.layout.callingdoor_main_lay
     }
 
     override fun bindDagger() {
@@ -161,7 +163,7 @@ class CallingdoorActivity :BaseActivity<CallingdoorActivityPresenter, Callingdoo
 
         if ("rk3128".equals(Build.MODEL) || "rk3368".equals(Build.MODEL)) {
             //串口监听
-            setSerialListner()
+            setSerialListener()
 
             AppTool.Time.delay(3000) {
                 //打开MIC
@@ -540,7 +542,7 @@ class CallingdoorActivity :BaseActivity<CallingdoorActivityPresenter, Callingdoo
     }
 
     //设置串口监听
-    private fun setSerialListner() {
+    private fun setSerialListener() {
         SerialPortUtil.getInstance().setOnDataReceiveListener(this)
         SerialPortUtil.getInstance().setOnDataReceiveStringListener(this)
         //开启串口心跳
@@ -673,7 +675,7 @@ class CallingdoorActivity :BaseActivity<CallingdoorActivityPresenter, Callingdoo
     override fun showDeviceInfo(deviceInfo: DeviceRoomInfoVO) {
         //显示床位信息界面
         if (!mainFragment.equals(curFragment)) {
-            switchFragment(R.id.callingdoor_main_frame, MainFragment(), mainFragment)
+            switchFragment(R.id.callingdoor_main_frame, YzMainFragment(), mainFragment)
         }
 
         Constant.SIP_ID = deviceInfo.sipId
@@ -700,10 +702,8 @@ class CallingdoorActivity :BaseActivity<CallingdoorActivityPresenter, Callingdoo
         }
         if (Constant.DEVICE_STATUS == 0) {
             tv_room_name.text = "设备未启用"
-            tv_room_name.setTextColor(resources.getColor(R.color.red_color))
         } else {
             tv_room_name.text = Constant.ROOM_NAME
-            tv_room_name.setTextColor(resources.getColor(R.color.main_color))
         }
 
         if (deviceInfo.frameId != null) {
@@ -1027,9 +1027,48 @@ class CallingdoorActivity :BaseActivity<CallingdoorActivityPresenter, Callingdoo
             Constant.EVENT_RESTART_APP -> {
                 AppUpdateHelper.restartApp(activity)
             }
+
+            Constant.EVENT_UPDATE_TITLE -> {
+                updateTitle()
+            }
         }
     }
 
+    private fun updateTitle() {
+        if (Constant.babyGirl) {
+            tv_room_name.setBackgroundResource(R.mipmap.room_bg_girl)
+            rl_activity_main_view.setBackgroundResource(R.color.main_bg_color_girl)
+            view_title_layout_tv_hospital_name.setTextColor(Constant.colorGirl)
+            view_title_clock.setTextColor(Constant.colorGirl)
+            view_title_layout_tv_no.setTextColor(Constant.colorGirl)
+        } else {
+            tv_room_name.setBackgroundResource(R.mipmap.room_bg_boy)
+            rl_activity_main_view.setBackgroundResource(R.color.main_bg_color_boy)
+            view_title_layout_tv_hospital_name.setTextColor(Constant.colorBoy)
+            view_title_clock.setTextColor(Constant.colorBoy)
+            view_title_layout_tv_no.setTextColor(Constant.colorBoy)
+        }
+
+        if (Constant.day_state == 0) {
+            //晚上
+            if (Constant.babyGirl) {
+                view_title_layout_iv_day_night.setImageResource(R.mipmap.ic_night_red)
+            } else {
+                view_title_layout_iv_day_night.setImageResource(R.mipmap.ic_night)
+            }
+        } else {
+            //白天
+            if (Constant.babyGirl) {
+                view_title_layout_iv_day_night.setImageResource(R.mipmap.ic_daylight_red)
+            } else {
+                view_title_layout_iv_day_night.setImageResource(R.mipmap.ic_daylight)
+            }
+        }
+
+        updateNetImg()
+        updateTcpState()
+    }
+
     private fun updateStatus(state: String) {
         this.runOnUiThread {
             when (state) {
@@ -1047,26 +1086,7 @@ class CallingdoorActivity :BaseActivity<CallingdoorActivityPresenter, Callingdoo
     }
 
     private fun updateNetState() {
-        if (NetHelper.getInstance().networkType == ConnectivityManager.TYPE_WIFI) {
-            view_title_layout_iv_wifi.visibility = View.VISIBLE
-            view_title_layout_iv_wifi.setImageResource(R.mipmap.ic_wifi_success)
-            view_title_layout_iv_ethernet.visibility = View.GONE
-        } else if (NetHelper.getInstance().networkType == ConnectivityManager.TYPE_ETHERNET) {
-            view_title_layout_iv_ethernet.visibility = View.VISIBLE
-            view_title_layout_iv_ethernet.setImageResource(R.mipmap.ic_ethernet_success)
-            view_title_layout_iv_wifi.visibility = View.GONE
-        } else {
-            view_title_layout_iv_ethernet.visibility = View.VISIBLE
-            view_title_layout_iv_ethernet.setImageResource(R.mipmap.ic_ethernet_fail)
-            view_title_layout_iv_wifi.visibility = View.GONE
-        }
-
-        /*if (NetHelper.isBTConnected()) {
-            view_title_layout_iv_bt.visibility = View.VISIBLE
-            view_title_layout_iv_bt.setImageResource(R.mipmap.ic_bt_success)
-        } else {
-            view_title_layout_iv_bt.visibility = View.GONE
-        }*/
+        updateNetImg()
 
         /*
         * 检查网络情况,若tcp断开连接多次且IP也是空的则网络异常,重启设备
@@ -1098,9 +1118,44 @@ class CallingdoorActivity :BaseActivity<CallingdoorActivityPresenter, Callingdoo
         }
     }
 
+    private fun updateNetImg() {
+        if (NetHelper.getInstance().networkType == ConnectivityManager.TYPE_WIFI) {
+            view_title_layout_iv_wifi.visibility = View.VISIBLE
+            view_title_layout_iv_ethernet.visibility = View.GONE
+            if (Constant.babyGirl) {
+                view_title_layout_iv_wifi.setImageResource(R.mipmap.ic_wifi_success_red)
+            } else {
+                view_title_layout_iv_wifi.setImageResource(R.mipmap.ic_wifi_success)
+            }
+        } else if (NetHelper.getInstance().networkType == ConnectivityManager.TYPE_ETHERNET) {
+            view_title_layout_iv_ethernet.visibility = View.VISIBLE
+            view_title_layout_iv_wifi.visibility = View.GONE
+            if (Constant.babyGirl) {
+                view_title_layout_iv_ethernet.setImageResource(R.mipmap.ic_ethernet_success_red)
+            } else {
+                view_title_layout_iv_ethernet.setImageResource(R.mipmap.ic_ethernet_success)
+            }
+        } else {
+            view_title_layout_iv_ethernet.visibility = View.VISIBLE
+            view_title_layout_iv_ethernet.setImageResource(R.mipmap.ic_ethernet_fail)
+            view_title_layout_iv_wifi.visibility = View.GONE
+        }
+
+        /*if (NetHelper.isBTConnected()) {
+            view_title_layout_iv_bt.visibility = View.VISIBLE
+            view_title_layout_iv_bt.setImageResource(R.mipmap.ic_bt_success)
+        } else {
+            view_title_layout_iv_bt.visibility = View.GONE
+        }*/
+    }
+
     private fun updateTcpState() {
         if (Constant.TCP_CONNECTED) {
-            view_title_layout_iv_tcp.setImageResource(R.mipmap.ic_tcp_success)
+            if (Constant.babyGirl) {
+                view_title_layout_iv_tcp.setImageResource(R.mipmap.ic_tcp_success_red)
+            } else {
+                view_title_layout_iv_tcp.setImageResource(R.mipmap.ic_tcp_success)
+            }
             view_title_layout_tv_point.setBackgroundResource(R.color.green)
         } else {
             view_title_layout_iv_tcp.setImageResource(R.mipmap.ic_tcp_fail)
@@ -1126,7 +1181,11 @@ class CallingdoorActivity :BaseActivity<CallingdoorActivityPresenter, Callingdoo
                 //设置白天系统音量和响铃音
                 VoiceManagerUtil.setSystemVoice(this, SettingConfig.getDoorDaytimeSystemVolume(this))
                 VoiceManagerUtil.setMusicVoice(this, SettingConfig.getDoorDaytimeSystemVolume(this))
-                view_title_layout_iv_day_night.setImageResource(R.mipmap.ic_daylight)
+                if (Constant.babyGirl) {
+                    view_title_layout_iv_day_night.setImageResource(R.mipmap.ic_daylight_red)
+                } else {
+                    view_title_layout_iv_day_night.setImageResource(R.mipmap.ic_daylight)
+                }
             }
             Constant.day_state = 0
         } else {
@@ -1137,7 +1196,11 @@ class CallingdoorActivity :BaseActivity<CallingdoorActivityPresenter, Callingdoo
                 //设置晚上系统音量和响铃音
                 VoiceManagerUtil.setSystemVoice(this, SettingConfig.getDoorNightSystemVolume(this))
                 VoiceManagerUtil.setMusicVoice(this, SettingConfig.getDoorNightSystemVolume(this))
-                view_title_layout_iv_day_night.setImageResource(R.mipmap.ic_night)
+                if (Constant.babyGirl) {
+                    view_title_layout_iv_day_night.setImageResource(R.mipmap.ic_night_red)
+                } else {
+                    view_title_layout_iv_day_night.setImageResource(R.mipmap.ic_night)
+                }
             }
             Constant.day_state = 1
         }

+ 2 - 0
callingdoor/src/main/java/com/wdkl/app/ncs/callingdoor/di/CallingdoorComponent.kt

@@ -14,6 +14,8 @@ interface CallingdoorComponent {
 
     fun inject(fragment: MainFragment)
 
+    fun inject(fragment: YzMainFragment)
+
     fun inject(fragment: CallFragment)
 
     fun inject(fragment: QrCodeFragment)

+ 159 - 0
callingdoor/src/main/java/com/wdkl/app/ncs/callingdoor/fragment/YzMainFragment.kt

@@ -0,0 +1,159 @@
+package com.wdkl.app.ncs.callingdoor.fragment
+
+import com.enation.javashop.net.engine.model.NetState
+import com.wdkl.app.ncs.callingdoor.R
+import com.wdkl.app.ncs.callingdoor.databinding.MainViewLayoutBinding
+import com.wdkl.app.ncs.callingdoor.launch.CallingdoorLaunch
+import com.wdkl.ncs.android.lib.base.BaseFragment
+import com.wdkl.ncs.android.lib.utils.TimeHandle
+import com.wdkl.ncs.android.lib.utils.showMessage
+import com.wdkl.ncs.android.lib.vo.filter
+import com.wdkl.ncs.android.middleware.common.Constant
+import com.wdkl.ncs.android.middleware.common.MessageEvent
+import com.wdkl.ncs.android.middleware.logic.contract.callingdoor.MainFragmentContract
+import com.wdkl.ncs.android.middleware.logic.presenter.callingdoor.MainFragmentPresenter
+import com.wdkl.ncs.android.middleware.model.vo.FrameRoomVO
+import kotlinx.android.synthetic.main.yz_main_view_layout.*
+import org.greenrobot.eventbus.EventBus
+import org.greenrobot.eventbus.Subscribe
+import org.greenrobot.eventbus.ThreadMode
+
+class YzMainFragment: BaseFragment<MainFragmentPresenter, MainViewLayoutBinding>(), MainFragmentContract.View {
+    val TAG = "YzMainFragment"
+
+    override fun getLayId(): Int {
+        return R.layout.yz_main_view_layout
+    }
+
+    override fun bindDagger() {
+        CallingdoorLaunch.component.inject(this)
+    }
+
+    override fun init() {
+        updateInfo()
+    }
+
+    override fun bindEvent() {
+    }
+
+    override fun destory() {
+    }
+
+    override fun showRoomInfo(roomInfo: FrameRoomVO) {
+        if (roomInfo.frameBedList != null && roomInfo.frameBedList.size > 0) {
+            val bedVO = roomInfo.frameBedList[0]
+            if (bedVO.relativeSex != null && bedVO.relativeSex == 1) {
+                //男孩
+                Constant.babyGirl = false
+                //蓝色主题
+                rl_date_view.setBackgroundResource(R.drawable.shape_bottom_bg_blue)
+                yz_main_view.setBackgroundResource(R.mipmap.main_bg_boy)
+                tv_in_date.setTextColor(Constant.colorBoy)
+                tv_out_date.setTextColor(Constant.colorBoy)
+                tv_mother_name.setTextColor(Constant.colorBoy)
+                tv_desc.setBackgroundResource(R.drawable.shape_desc_bg_blue)
+                tv_baby_gender.setBackgroundResource(R.drawable.shape_desc_bg_blue)
+                tv_baby_name.setTextColor(Constant.colorBoy)
+                img_nurse_icon.setImageResource(R.mipmap.ic_nurse_1)
+                tv_nurse_name.setTextColor(Constant.colorBoy)
+
+                if (bedVO.relativeSex != null) {
+                    tv_baby_gender.text = "男"
+                }
+            } else {
+                //女孩
+                Constant.babyGirl = true
+                //红色主题
+                rl_date_view.setBackgroundResource(R.drawable.shape_bottom_bg_red)
+                yz_main_view.setBackgroundResource(R.mipmap.main_bg_girl)
+                tv_in_date.setTextColor(Constant.colorGirl)
+                tv_out_date.setTextColor(Constant.colorGirl)
+                tv_mother_name.setTextColor(Constant.colorGirl)
+                tv_desc.setBackgroundResource(R.drawable.shape_desc_bg_red)
+                tv_baby_gender.setBackgroundResource(R.drawable.shape_desc_bg_red)
+                tv_baby_name.setTextColor(Constant.colorGirl)
+                img_nurse_icon.setImageResource(R.mipmap.ic_nurse_2)
+                tv_nurse_name.setTextColor(Constant.colorGirl)
+
+                if (bedVO.relativeSex != null) {
+                    tv_baby_gender.text = "女"
+                }
+            }
+
+            if (bedVO.customerInDate != null) {
+                val inDate = TimeHandle.getDateTime(bedVO.customerInDate*1000, "yyyy年MM月dd日")
+                tv_in_date.setText("入住日期: " + inDate)
+            }
+            if (bedVO.customerOutDate != null) {
+                val outDate = TimeHandle.getDateTime(bedVO.customerOutDate*1000, "yyyy年MM月dd日")
+                tv_out_date.setText("出所时间: " + outDate)
+            }
+
+            tv_mother_name.text = bedVO.customerName
+            tv_desc.text = bedVO.customerIllnessDesc
+            if (bedVO.relativeBirthday != null) {
+                val birthday = TimeHandle.getDateTime(bedVO.customerInDate*1000, "MM月dd日")
+                tv_baby_birthday.text = "出生日期: " + birthday
+            }
+            if (bedVO.relativeMemberName != null) {
+                tv_baby_name.text = bedVO.relativeMemberName
+            }
+            tv_nurse_name.text = bedVO.nurseName
+
+            EventBus.getDefault().post(MessageEvent("updateTitle", Constant.EVENT_UPDATE_TITLE))
+        }
+    }
+
+    override fun onError(message: String, type: Int) {
+        showMessage(message)
+    }
+
+    override fun onNoNet() {
+        showMessage("没有网络")
+    }
+
+    override fun complete(message: String, type: Int) {
+    }
+
+    override fun start() {
+    }
+
+    override fun networkMonitor(state: NetState) {
+        state.filter(onWifi = {
+
+        },onMobile = {
+
+        },offline = {
+
+        })
+    }
+
+    override fun onStart() {
+        if (!EventBus.getDefault().isRegistered(this)) {
+            EventBus.getDefault().register(this)
+        }
+        super.onStart()
+    }
+
+    override fun onStop() {
+        if (EventBus.getDefault().isRegistered(this)) {
+            EventBus.getDefault().unregister(this)
+        }
+        super.onStop()
+    }
+
+    private fun updateInfo() {
+        if (Constant.FRAME_ID != -1 && Constant.DEVICE_STATUS == 1) {
+            presenter.loadRoomFrameInfo(Constant.FRAME_ID)
+        }
+    }
+
+    @Subscribe(threadMode = ThreadMode.MAIN)
+    fun onMoonEvent(messageEvent: MessageEvent) {
+        when (messageEvent.type) {
+            Constant.EVENT_UPDATE_CUSTOM -> {
+                updateInfo()
+            }
+        }
+    }
+}

+ 6 - 0
callingdoor/src/main/res/drawable/shape_bottom_bg_blue.xml

@@ -0,0 +1,6 @@
+<?xml version="1.0" encoding="utf-8"?>
+<shape xmlns:android="http://schemas.android.com/apk/res/android">
+    <solid android:color="#B1DAF3"/>
+    <corners
+        android:radius="40dp" />
+</shape>

+ 6 - 0
callingdoor/src/main/res/drawable/shape_bottom_bg_red.xml

@@ -0,0 +1,6 @@
+<?xml version="1.0" encoding="utf-8"?>
+<shape xmlns:android="http://schemas.android.com/apk/res/android">
+    <solid android:color="#FBE5E8"/>
+    <corners
+        android:radius="40dp" />
+</shape>

+ 6 - 0
callingdoor/src/main/res/drawable/shape_desc_bg_blue.xml

@@ -0,0 +1,6 @@
+<?xml version="1.0" encoding="utf-8"?>
+<shape xmlns:android="http://schemas.android.com/apk/res/android">
+    <solid android:color="#0090ff"/>
+    <corners
+        android:radius="10dp" />
+</shape>

+ 6 - 0
callingdoor/src/main/res/drawable/shape_desc_bg_red.xml

@@ -0,0 +1,6 @@
+<?xml version="1.0" encoding="utf-8"?>
+<shape xmlns:android="http://schemas.android.com/apk/res/android">
+    <solid android:color="#FF3B30"/>
+    <corners
+        android:radius="10dp" />
+</shape>

+ 12 - 9
callingdoor/src/main/res/layout/callingdoor_main_lay.xml

@@ -1,9 +1,10 @@
 <?xml version="1.0" encoding="utf-8"?>
 <layout>
     <RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
+        android:id="@+id/rl_activity_main_view"
         android:layout_width="match_parent"
         android:layout_height="match_parent"
-        android:background="#EAF2F9">
+        android:background="@color/main_bg_color_girl">
 
         <include
             android:id="@+id/activity_calling_door_layout_title"
@@ -14,10 +15,11 @@
             android:layout_width="match_parent"
             android:layout_height="wrap_content"
             android:layout_below="@id/activity_calling_door_layout_title"
-            android:paddingLeft="20dp"
-            android:paddingRight="20dp"
+            android:layout_marginTop="10dp"
+            android:background="@mipmap/room_bg_girl"
+            android:gravity="center"
             android:text="--房"
-            android:textColor="@color/main_color"
+            android:textColor="@color/white"
             android:textSize="68sp"
             android:singleLine="true"
             android:ellipsize="marquee"
@@ -32,7 +34,8 @@
             android:layout_alignParentRight="true"
             android:layout_marginTop="10dp"
             android:layout_marginRight="10dp"
-            android:layout_below="@id/tv_room_name">
+            android:layout_below="@id/tv_room_name"
+            android:visibility="gone">
             <TextView
                 android:id="@+id/app_version"
                 android:layout_width="match_parent"
@@ -123,14 +126,14 @@
             android:id="@+id/callingdoor_main_frame"
             android:layout_width="match_parent"
             android:layout_height="match_parent"
-            android:layout_margin="10dp"
-            android:layout_below="@id/tv_room_name"
-            android:layout_toLeftOf="@id/rl_room_actions"/>
+            android:layout_marginTop="10dp"
+            android:layout_below="@id/tv_room_name" />
 
         <!--通话界面-->
         <FrameLayout
             android:id="@+id/call_frame"
             android:layout_width="match_parent"
-            android:layout_height="match_parent" />
+            android:layout_height="match_parent"
+            android:visibility="gone"/>
     </RelativeLayout>
 </layout>

+ 5 - 4
callingdoor/src/main/res/layout/view_title_layout.xml

@@ -23,11 +23,12 @@
         android:layout_marginLeft="20dp"
         android:layout_toRightOf="@+id/view_title_layout_tv_point"
         android:text="----"
-        android:textColor="@color/main_color"
+        android:textColor="@color/text_color_girl"
         android:textSize="@dimen/font_size_20" />
 
     <!--日期时间-->
     <TextClock
+        android:id="@+id/view_title_clock"
         android:layout_width="wrap_content"
         android:layout_height="wrap_content"
         android:layout_centerHorizontal="true"
@@ -35,7 +36,7 @@
         android:format12Hour="yyyy-MM-dd HH:mm EEEE"
         android:format24Hour="yyyy-MM-dd HH:mm EEEE"
         android:timeZone="GMT+8"
-        android:textColor="@color/main_color"
+        android:textColor="@color/text_color_girl"
         android:textSize="@dimen/font_size_20" />
 
     <!--设备号-->
@@ -47,7 +48,7 @@
         android:layout_marginRight="10dp"
         android:layout_toLeftOf="@+id/view_title_layout_ll_right"
         android:text="设备ID:"
-        android:textColor="@color/main_color"
+        android:textColor="@color/text_color_girl"
         android:textSize="@dimen/font_size_20" />
 
     <!--状态图标-->
@@ -99,7 +100,7 @@
             android:layout_gravity="center_vertical"
             android:layout_marginLeft="4dp"
             android:layout_marginRight="4dp"
-            android:src="@mipmap/ic_daylight"/>
+            android:src="@mipmap/ic_daylight_red"/>
 
     </LinearLayout>
 </RelativeLayout>

+ 144 - 0
callingdoor/src/main/res/layout/yz_main_view_layout.xml

@@ -0,0 +1,144 @@
+<?xml version="1.0" encoding="utf-8"?>
+<layout>
+<LinearLayout
+    xmlns:android="http://schemas.android.com/apk/res/android"
+    android:layout_width="match_parent"
+    android:layout_height="match_parent">
+
+    <RelativeLayout
+        android:id="@+id/yz_main_view"
+        android:layout_width="0dp"
+        android:layout_height="match_parent"
+        android:layout_weight="3.8"
+        android:background="@mipmap/main_bg_girl">
+
+        <RelativeLayout
+            android:id="@+id/rl_date_view"
+            android:layout_width="match_parent"
+            android:layout_height="wrap_content"
+            android:layout_alignParentBottom="true"
+            android:layout_marginLeft="20dp"
+            android:layout_marginRight="20dp"
+            android:layout_marginBottom="10dp"
+            android:background="@drawable/shape_bottom_bg_red">
+            <TextView
+                android:id="@+id/tv_in_date"
+                android:layout_width="wrap_content"
+                android:layout_height="wrap_content"
+                android:layout_marginLeft="10dp"
+                android:padding="10dp"
+                android:text="入住时间:"
+                android:textSize="24sp"
+                android:textColor="@color/text_color_girl"/>
+
+            <TextView
+                android:id="@+id/tv_out_date"
+                android:layout_width="wrap_content"
+                android:layout_height="wrap_content"
+                android:layout_alignParentRight="true"
+                android:layout_marginRight="10dp"
+                android:padding="10dp"
+                android:text="出所时间:"
+                android:textSize="24sp"
+                android:textColor="@color/text_color_girl"/>
+        </RelativeLayout>
+
+        <LinearLayout
+            android:layout_width="180dp"
+            android:layout_height="match_parent"
+            android:layout_above="@id/rl_date_view"
+            android:gravity="center"
+            android:orientation="vertical">
+
+            <TextView
+                android:id="@+id/tv_mother_name"
+                android:layout_width="wrap_content"
+                android:layout_height="wrap_content"
+                android:text="--"
+                android:textColor="@color/text_color_girl"
+                android:textSize="32sp"
+                android:textStyle="bold"/>
+
+            <TextView
+                android:id="@+id/tv_desc"
+                android:layout_width="wrap_content"
+                android:layout_height="wrap_content"
+                android:background="@drawable/shape_desc_bg_red"
+                android:layout_marginTop="10dp"
+                android:paddingLeft="20dp"
+                android:paddingRight="20dp"
+                android:text="--"
+                android:textColor="@color/white"
+                android:textSize="24sp"/>
+        </LinearLayout>
+
+        <LinearLayout
+            android:layout_width="200dp"
+            android:layout_height="wrap_content"
+            android:layout_above="@id/rl_date_view"
+            android:layout_alignParentRight="true"
+            android:layout_marginBottom="40dp"
+            android:layout_marginRight="40dp"
+            android:gravity="center"
+            android:orientation="vertical">
+
+            <TextView
+                android:id="@+id/tv_baby_gender"
+                android:layout_width="wrap_content"
+                android:layout_height="wrap_content"
+                android:background="@drawable/shape_desc_bg_red"
+                android:paddingLeft="32dp"
+                android:paddingRight="32dp"
+                android:text="-"
+                android:textColor="@color/white"
+                android:textSize="22sp"/>
+
+            <TextView
+                android:id="@+id/tv_baby_birthday"
+                android:layout_width="wrap_content"
+                android:layout_height="wrap_content"
+                android:layout_marginTop="10dp"
+                android:text="出生日期:"
+                android:textSize="20sp"
+                android:textStyle="bold"/>
+
+            <TextView
+                android:id="@+id/tv_baby_name"
+                android:layout_width="wrap_content"
+                android:layout_height="wrap_content"
+                android:layout_marginTop="10dp"
+                android:text="宝宝"
+                android:textColor="@color/text_color_girl"
+                android:textSize="32sp" />
+        </LinearLayout>
+    </RelativeLayout>
+
+    <LinearLayout
+        android:layout_width="0dp"
+        android:layout_height="match_parent"
+        android:layout_weight="1.2"
+        android:layout_marginStart="10dp"
+        android:gravity="center_horizontal"
+        android:background="@color/white"
+        android:orientation="vertical">
+
+        <ImageView
+            android:id="@+id/img_nurse_icon"
+            android:layout_width="wrap_content"
+            android:layout_height="wrap_content"
+            android:layout_marginTop="60dp"
+            android:src="@mipmap/ic_nurse_2"/>
+
+        <TextView
+            android:id="@+id/tv_nurse_name"
+            android:layout_width="wrap_content"
+            android:layout_height="wrap_content"
+            android:layout_marginTop="20dp"
+            android:text="责护"
+            android:textSize="24sp"
+            android:textColor="@color/text_color_girl"/>
+
+    </LinearLayout>
+
+</LinearLayout>
+</layout>

BIN
callingdoor/src/main/res/mipmap-mdpi/ic_daylight_red.png


BIN
callingdoor/src/main/res/mipmap-mdpi/ic_ethernet_success_red.png


BIN
callingdoor/src/main/res/mipmap-mdpi/ic_night_red.png


BIN
callingdoor/src/main/res/mipmap-mdpi/ic_nurse_1.png


BIN
callingdoor/src/main/res/mipmap-mdpi/ic_nurse_2.png


BIN
callingdoor/src/main/res/mipmap-mdpi/ic_tcp_success_red.png


BIN
callingdoor/src/main/res/mipmap-mdpi/ic_wifi_success_red.png


BIN
callingdoor/src/main/res/mipmap-mdpi/main_bg_boy.png


BIN
callingdoor/src/main/res/mipmap-mdpi/main_bg_girl.png


BIN
callingdoor/src/main/res/mipmap-mdpi/room_bg_boy.jpg


BIN
callingdoor/src/main/res/mipmap-mdpi/room_bg_girl.jpg


+ 6 - 1
callingdoor/src/main/res/values/colors.xml

@@ -17,7 +17,7 @@
     <color name="drawer_item_bg_n">#fffff9</color>
     <color name="green">#00FF00</color>
 
-    <color name="main_color">#2F9DF1</color>
+    <color name="main_color">#FFBDC3</color>
     <color name="content_color">#F3F3F3</color>
     <color name="transparent">#00000000</color>
     <color name="transparent_dialog">#DDFFFFFF</color>
@@ -95,4 +95,9 @@
     <color name="right_item_select">#B1DAF3</color>
 
     <color name="nursing_color">#FFA5A5</color>
+
+    <color name="main_bg_color_girl">#FFBDC3</color>
+    <color name="main_bg_color_boy">#EAF2F9</color>
+    <color name="text_color_girl">#FD3B30</color>
+    <color name="text_color_boy">#0090ff</color>
 </resources>

+ 8 - 0
middleware/src/main/code/com/wdkl/ncs/android/middleware/common/Constant.java

@@ -1,5 +1,7 @@
 package com.wdkl.ncs.android.middleware.common;
 
+import android.graphics.Color;
+
 import com.wdkl.ncs.android.middleware.tcp.enums.DeviceTypeEnum;
 
 public class Constant {
@@ -140,6 +142,10 @@ public class Constant {
     //是否静默升级
     public static boolean silentUpdate = true;
 
+    public static boolean babyGirl = true;
+    public static int colorGirl = Color.parseColor("#FD3B30");
+    public static int colorBoy = Color.parseColor("#0090ff");
+
     /**
      * Sip注册状态
      */
@@ -186,4 +192,6 @@ public class Constant {
     public static final int EVENT_REMOVE_CALL_FRAGMENT = 0x09;
 
     public static final int EVENT_RESTART_APP = 0x10;
+
+    public static final int EVENT_UPDATE_TITLE = 0x11;
 }

+ 38 - 0
middleware/src/main/code/com/wdkl/ncs/android/middleware/model/vo/FrameBedVO.java

@@ -22,10 +22,14 @@ public class FrameBedVO{
     private Integer customerSex;
     private Integer customerAge;
     private String customerAgeUnit;
+    private Long customerInDate;
+    private Long customerOutDate;
+    private String customerIllnessDesc;
     private String deviceSipId;
     private Integer bedDeviceId;
     private String bedDevicePhoneNumber;
 
+    // todo: 应该传mapping,而不是具体的名称
     private Integer doctorId;
     private String doctorName;
     private Integer nurseId;
@@ -44,6 +48,8 @@ public class FrameBedVO{
 
     private Integer relativeSex;
 
+    private Long relativeBirthday;
+
 
     public FrameDO getFrameBed() {
         return frameBed;
@@ -109,6 +115,30 @@ public class FrameBedVO{
         this.customerAgeUnit = customerAgeUnit;
     }
 
+    public Long getCustomerInDate() {
+        return customerInDate;
+    }
+
+    public void setCustomerInDate(Long customerInDate) {
+        this.customerInDate = customerInDate;
+    }
+
+    public Long getCustomerOutDate() {
+        return customerOutDate;
+    }
+
+    public void setCustomerOutDate(Long customerOutDate) {
+        this.customerOutDate = customerOutDate;
+    }
+
+    public String getCustomerIllnessDesc() {
+        return customerIllnessDesc;
+    }
+
+    public void setCustomerIllnessDesc(String customerIllnessDesc) {
+        this.customerIllnessDesc = customerIllnessDesc;
+    }
+
     public String getDeviceSipId() {
         return deviceSipId;
     }
@@ -220,4 +250,12 @@ public class FrameBedVO{
     public void setRelativeSex(Integer relativeSex) {
         this.relativeSex = relativeSex;
     }
+
+    public Long getRelativeBirthday() {
+        return relativeBirthday;
+    }
+
+    public void setRelativeBirthday(Long relativeBirthday) {
+        this.relativeBirthday = relativeBirthday;
+    }
 }

+ 3 - 2
middleware/src/main/code/com/wdkl/ncs/android/middleware/tcp/channel/DeviceChannel.java

@@ -33,7 +33,8 @@ public class DeviceChannel {
                 }
                 break;
             case VOICE:
-                if (tcpModel.getAction()==TcpAction.VoiceAction.CALL){ //语音呼入
+                //去掉呼叫对讲功能
+                /*if (tcpModel.getAction()==TcpAction.VoiceAction.CALL){ //语音呼入
                     //todo: 判断当前是否通话
                     // 当前正在通话中或有新的来电或正在呼叫,直接返回该状态给服务器
                     if (Constant.CALL_STATE != Constant.CALL_STANDBY){
@@ -61,7 +62,7 @@ public class DeviceChannel {
 
                     //交由后续处理
                     EventBus.getDefault().post(new MessageEvent(tcpModel, EVENT_TCP_MSG));
-                }
+                }*/
                 break;
             case VIDEO:
                 break;

+ 1 - 1
resource/src/main/res/values-zh/strings.xml

@@ -1,5 +1,5 @@
 <resources>
-    <string name="javashop_app_name">NCS-门口机</string>
+    <string name="javashop_app_name">月子中心门口机</string>
     <string name="javashop_qrcode_name">扫啊扫</string>
     <string name="javashop_navigation_home_title">首页</string>
     <string name="javashop_navigation_category_title">分类</string>