ソースを参照

1.添加验证码登录接口

王鹏鹏 2 年 前
コミット
40401e3b7e

+ 1 - 0
.idea/misc.xml

@@ -37,6 +37,7 @@
         <entry key="..\:/workspace/hcp-pad/healthconsultation/src/main/res/drawable/bg_consult.xml" value="0.155" />
         <entry key="..\:/workspace/hcp-pad/healthconsultation/src/main/res/drawable/bg_continue_consultation.xml" value="0.155" />
         <entry key="..\:/workspace/hcp-pad/healthconsultation/src/main/res/drawable/bg_doctor_status.xml" value="0.155" />
+        <entry key="..\:/workspace/hcp-pad/healthconsultation/src/main/res/drawable/bg_go_consultation.xml" value="0.155" />
         <entry key="..\:/workspace/hcp-pad/healthconsultation/src/main/res/drawable/bg_home_page_content.xml" value="0.155" />
         <entry key="..\:/workspace/hcp-pad/healthconsultation/src/main/res/drawable/bg_home_page_search.xml" value="0.155" />
         <entry key="..\:/workspace/hcp-pad/healthconsultation/src/main/res/drawable/bg_home_page_title.xml" value="0.155" />

+ 5 - 1
healthconsultation/src/main/java/com/yingyang/healthconsultation/activity/HealthConsultationActivity.kt

@@ -4,6 +4,7 @@ import android.annotation.SuppressLint
 import android.view.MotionEvent
 import android.view.View
 import com.alibaba.android.arouter.facade.annotation.Route
+import com.alibaba.android.arouter.launcher.ARouter
 import com.yingyang.healthconsultation.R
 import com.yingyang.healthconsultation.adapter.ConsultationAdapter
 import com.yingyang.healthconsultation.adapter.RecommendDoctorAdapter
@@ -43,7 +44,10 @@ class HealthConsultationActivity :
             rvRecommended.adapter = recommendDoctorAdapter
             recommendDoctorAdapter.setData(doctorBeans)
             recommendDoctorAdapter.onClickListener = {
-                JumpUtil.jumpActivity(RouterUrlCommon.doctorDetails, mContext)
+                ARouter.getInstance().build(RouterUrlCommon.doctorDetails)
+                    .withTransition(R.anim.leftin, R.anim.leftout)
+                    .withSerializable("doctorDetails", it)
+                    .navigation(mContext)
             }
         }
     }

+ 49 - 3
healthconsultation/src/main/java/com/yingyang/healthconsultation/doctordetails/DoctorDetailsActivity.kt

@@ -1,25 +1,71 @@
 package com.yingyang.healthconsultation.doctordetails
 
+import android.annotation.SuppressLint
+import android.content.Intent
+import android.os.Bundle
+import android.view.MotionEvent
+import android.view.View
 import com.alibaba.android.arouter.facade.annotation.Route
+import com.yingyang.healthconsultation.R
 import com.yingyang.healthconsultation.databinding.ActivityDoctorDetailsBinding
+import com.yingyang.healthconsultation.entity.ConsultationBean
 import com.yingyangfly.baselib.base.BaseActivity
+import com.yingyangfly.baselib.ext.getEndAnimation
+import com.yingyangfly.baselib.ext.getScaleAnimation
 import com.yingyangfly.baselib.router.RouterUrlCommon
 
 /**
  * 医生详情
  */
 @Route(path = RouterUrlCommon.doctorDetails)
-class DoctorDetailsActivity : BaseActivity<ActivityDoctorDetailsBinding>() {
+class DoctorDetailsActivity : BaseActivity<ActivityDoctorDetailsBinding>(), View.OnTouchListener {
 
-    override fun initViews() {
+    private var doctorDetails: ConsultationBean? = null
 
+    override fun onCreate(savedInstanceState: Bundle?) {
+        doctorDetails = intent.getSerializableExtra("doctorDetails") as ConsultationBean
+        super.onCreate(savedInstanceState)
     }
 
-    override fun initListener() {
+    override fun initViews() {
+        if (doctorDetails != null) {
+            binding.data = doctorDetails
+        }
+    }
 
+    @SuppressLint("ClickableViewAccessibility")
+    override fun initListener() {
+        binding {
+            backLayout.setOnTouchListener(this@DoctorDetailsActivity)
+        }
     }
 
     override fun initData() {
 
     }
+
+    @SuppressLint("ClickableViewAccessibility")
+    override fun onTouch(v: View, event: MotionEvent): Boolean {
+        when (event.action) {
+            MotionEvent.ACTION_DOWN -> {
+                if (v.id == R.id.backLayout) {
+                    v.startAnimation(getScaleAnimation())
+                }
+            }
+            MotionEvent.ACTION_UP -> {
+                v.startAnimation(getEndAnimation())
+                when (v.id) {
+                    R.id.backLayout -> {
+                        finish()
+                    }
+                }
+            }
+            MotionEvent.ACTION_CANCEL -> {
+                if (v.id == R.id.backLayout) {
+                    v.startAnimation(getEndAnimation())
+                }
+            }
+        }
+        return true
+    }
 }

+ 33 - 31
healthconsultation/src/main/java/com/yingyang/healthconsultation/entity/ConsultationBean.kt

@@ -1,36 +1,38 @@
 package com.yingyang.healthconsultation.entity
 
+import java.io.Serializable
+
 /**
  * 在在咨询bean
  */
-data class ConsultationBean(
-    val avatar: String,//头像地址
-    val certificate: String,//医生资格证
-    val consultationTotal: String,//问诊量
-    val createBy: String,
-    val createTime: String,
-    val departmentName: String,//所属部门
-    val email: String,//用户邮箱
-    val goodRate: String,//好评率
-    val id: String,//用户ID
-    val idCard: String,//身份证号
-    val isDoctor: String,//是否医生 0是 1否
-    val isOnline: String,//是否在线 0是 1否
-    val limit: String,
-    val mobile: String,//手机号码
-    val nickName: String,//用户昵称
-    val orgCode: String,
-    val orgName: String,//机构名字
-    val page: String,
-    val password: String,//密码
-    val price: String,//单价
-    val remark: String,//备注
-    val roleCodes: String,//用户关联的所有的角色,用逗号分隔
-    val sex: String,//用户性别(0男 1女 2未知)
-    val speciality: String,//擅长
-    val status: String,//帐号状态(0正常 1停用 2删除)
-    val title: String,//职称
-    val updateBy: String,
-    val updateTime: String,
-    val userName: String//用户账号
-)
+class ConsultationBean: Serializable {
+    val avatar: String? = null//头像地址
+    val certificate: String? = null//医生资格证
+    val consultationTotal: String? = null//问诊量
+    val createBy: String? = null
+    val createTime: String? = null
+    val departmentName: String? = null//所属部门
+    val email: String? = null//用户邮箱
+    val goodRate: String? = null//好评率
+    val id: String? = null//用户ID
+    val idCard: String? = null//身份证号
+    val isDoctor: String? = null//是否医生 0是 1否
+    val isOnline: String? = null//是否在线 0是 1否
+    val limit: String? = null
+    val mobile: String? = null//手机号码
+    val nickName: String? = null//用户昵称
+    val orgCode: String? = null
+    val orgName: String? = null//机构名字
+    val page: String? = null
+    val password: String? = null//密码
+    val price: String? = null//单价
+    val remark: String? = null//备注
+    val roleCodes: String? = null//用户关联的所有的角色,用逗号分隔
+    val sex: String? = null//用户性别(0男 1女 2未知)
+    val speciality: String? = null//擅长
+    val status: String? = null//帐号状态(0正常 1停用 2删除)
+    val title: String? = null//职称
+    val updateBy: String? = null
+    val updateTime: String? = null
+    val userName: String? = null//用户账号
+}

+ 8 - 0
healthconsultation/src/main/res/anim/leftin.xml

@@ -0,0 +1,8 @@
+<?xml version="1.0" encoding="utf-8"?>
+<set xmlns:android="http://schemas.android.com/apk/res/android">
+    <translate
+        android:duration="500"
+        android:fromXDelta="100%p"
+        android:toXDelta="0" />
+</set> 
+

+ 8 - 0
healthconsultation/src/main/res/anim/leftout.xml

@@ -0,0 +1,8 @@
+<?xml version="1.0" encoding="utf-8"?>
+<set xmlns:android="http://schemas.android.com/apk/res/android">
+    <translate
+        android:duration="500"
+        android:fromXDelta="0"
+        android:toXDelta="-100%p" />
+</set> 
+

+ 7 - 0
healthconsultation/src/main/res/drawable/bg_go_consultation.xml

@@ -0,0 +1,7 @@
+<?xml version="1.0" encoding="utf-8"?>
+<shape xmlns:android="http://schemas.android.com/apk/res/android"
+    xmlns:tools="http://schemas.android.com/tools"
+    tools:ignore="ResourceName">
+    <corners android:radius="@dimen/divider_13px" />
+    <solid android:color="@color/color_4A76FF" />
+</shape>

+ 5 - 0
healthconsultation/src/main/res/layout/activity_doctor_details.xml

@@ -194,6 +194,7 @@
                         android:layout_height="@dimen/divider_89px"
                         android:layout_marginStart="@dimen/divider_66px"
                         android:layout_marginTop="@dimen/divider_20px"
+                        android:background="@mipmap/icon_consultation_type"
                         app:layout_constraintStart_toStartOf="parent"
                         app:layout_constraintTop_toBottomOf="@+id/tvConsultingService" />
 
@@ -227,6 +228,10 @@
                         android:layout_height="@dimen/divider_48px"
                         android:layout_marginTop="@dimen/divider_120px"
                         android:layout_marginEnd="@dimen/divider_29px"
+                        android:background="@drawable/bg_go_consultation"
+                        android:text="@string/go_to_consult"
+                        android:textColor="@android:color/white"
+                        android:textSize="@dimen/divider_24px"
                         app:layout_constraintEnd_toEndOf="parent"
                         app:layout_constraintTop_toTopOf="parent" />
 

+ 87 - 90
healthconsultation/src/main/res/layout/activity_health_consultation.xml

@@ -4,114 +4,111 @@
     xmlns:tools="http://schemas.android.com/tools"
     tools:ignore="ResourceName">
 
-    <androidx.constraintlayout.widget.ConstraintLayout
+    <androidx.core.widget.NestedScrollView
         android:layout_width="match_parent"
-        android:layout_height="match_parent"
+        android:layout_height="wrap_content"
         android:background="@mipmap/icon_uniform_background">
 
-        <androidx.constraintlayout.widget.ConstraintLayout
-            android:id="@+id/headLayout"
+        <LinearLayout
             android:layout_width="match_parent"
-            android:layout_height="@dimen/divider_207px"
-            android:layout_marginStart="@dimen/divider_22px"
-            android:layout_marginTop="@dimen/divider_21px"
-            android:layout_marginEnd="@dimen/divider_22px"
-            android:background="@drawable/bg_home_page_title"
-            app:layout_constraintEnd_toEndOf="parent"
-            app:layout_constraintStart_toStartOf="parent"
-            app:layout_constraintTop_toTopOf="parent">
-
-            <LinearLayout
-                android:id="@+id/layoutHome"
-                android:layout_width="@dimen/divider_195px"
-                android:layout_height="wrap_content"
-                android:orientation="horizontal"
+            android:layout_height="match_parent"
+            android:orientation="vertical">
+
+            <androidx.constraintlayout.widget.ConstraintLayout
+                android:id="@+id/headLayout"
+                android:layout_width="match_parent"
+                android:layout_height="@dimen/divider_207px"
+                android:layout_marginStart="@dimen/divider_22px"
+                android:layout_marginTop="@dimen/divider_21px"
+                android:layout_marginEnd="@dimen/divider_22px"
+                android:background="@drawable/bg_home_page_title"
+                app:layout_constraintEnd_toEndOf="parent"
                 app:layout_constraintStart_toStartOf="parent"
                 app:layout_constraintTop_toTopOf="parent">
 
-                <androidx.appcompat.widget.AppCompatImageView
-                    android:layout_width="@dimen/divider_48px"
-                    android:layout_height="@dimen/divider_43px"
-                    android:layout_marginStart="@dimen/divider_37px"
-                    android:layout_marginTop="@dimen/divider_36px"
-                    android:background="@mipmap/bg_home" />
+                <LinearLayout
+                    android:id="@+id/layoutHome"
+                    android:layout_width="@dimen/divider_195px"
+                    android:layout_height="wrap_content"
+                    android:orientation="horizontal"
+                    app:layout_constraintStart_toStartOf="parent"
+                    app:layout_constraintTop_toTopOf="parent">
+
+                    <androidx.appcompat.widget.AppCompatImageView
+                        android:layout_width="@dimen/divider_48px"
+                        android:layout_height="@dimen/divider_43px"
+                        android:layout_marginStart="@dimen/divider_37px"
+                        android:layout_marginTop="@dimen/divider_36px"
+                        android:background="@mipmap/bg_home" />
+
+                    <androidx.appcompat.widget.AppCompatTextView
+                        android:layout_width="wrap_content"
+                        android:layout_height="wrap_content"
+                        android:layout_marginStart="@dimen/divider_14px"
+                        android:layout_marginTop="@dimen/divider_32px"
+                        android:text="@string/home_pager"
+                        android:textColor="@android:color/white"
+                        android:textSize="@dimen/divider_38px"
+                        android:textStyle="bold" />
+
+                </LinearLayout>
 
                 <androidx.appcompat.widget.AppCompatTextView
                     android:layout_width="wrap_content"
                     android:layout_height="wrap_content"
-                    android:layout_marginStart="@dimen/divider_14px"
-                    android:layout_marginTop="@dimen/divider_32px"
-                    android:text="@string/home_pager"
+                    android:layout_marginTop="@dimen/divider_24px"
+                    android:text="@string/online_consultation_accessible_communication"
                     android:textColor="@android:color/white"
                     android:textSize="@dimen/divider_38px"
-                    android:textStyle="bold" />
-
-            </LinearLayout>
-
-            <androidx.appcompat.widget.AppCompatTextView
-                android:layout_width="wrap_content"
-                android:layout_height="wrap_content"
-                android:layout_marginTop="@dimen/divider_24px"
-                android:text="@string/online_consultation_accessible_communication"
-                android:textColor="@android:color/white"
-                android:textSize="@dimen/divider_38px"
-                android:textStyle="bold"
-                app:layout_constraintEnd_toEndOf="parent"
-                app:layout_constraintStart_toStartOf="parent"
-                app:layout_constraintTop_toTopOf="parent" />
-
-            <androidx.appcompat.widget.AppCompatImageView
-                android:layout_width="@dimen/divider_163px"
-                android:layout_height="@dimen/divider_142px"
-                android:layout_marginTop="@dimen/divider_51px"
-                android:layout_marginEnd="@dimen/divider_30px"
-                android:background="@mipmap/icon_marshalling"
-                app:layout_constraintEnd_toEndOf="parent"
-                app:layout_constraintTop_toTopOf="parent" />
-
-            <androidx.constraintlayout.widget.ConstraintLayout
-                android:id="@+id/searchLayout"
-                android:layout_width="match_parent"
-                android:layout_height="@dimen/divider_60px"
-                android:layout_marginStart="@dimen/divider_226px"
-                android:layout_marginEnd="@dimen/divider_226px"
-                android:layout_marginBottom="@dimen/divider_39px"
-                android:background="@drawable/bg_home_page_search"
-                app:layout_constraintBottom_toBottomOf="parent"
-                app:layout_constraintEnd_toEndOf="parent"
-                app:layout_constraintStart_toStartOf="parent">
+                    android:textStyle="bold"
+                    app:layout_constraintEnd_toEndOf="parent"
+                    app:layout_constraintStart_toStartOf="parent"
+                    app:layout_constraintTop_toTopOf="parent" />
 
                 <androidx.appcompat.widget.AppCompatImageView
-                    android:id="@+id/imageSearch"
-                    android:layout_width="@dimen/divider_30px"
-                    android:layout_height="@dimen/divider_28px"
-                    android:layout_marginStart="@dimen/divider_34px"
-                    android:background="@mipmap/icon_search"
-                    app:layout_constraintBottom_toBottomOf="parent"
-                    app:layout_constraintStart_toStartOf="parent"
+                    android:layout_width="@dimen/divider_163px"
+                    android:layout_height="@dimen/divider_142px"
+                    android:layout_marginTop="@dimen/divider_51px"
+                    android:layout_marginEnd="@dimen/divider_30px"
+                    android:background="@mipmap/icon_marshalling"
+                    app:layout_constraintEnd_toEndOf="parent"
                     app:layout_constraintTop_toTopOf="parent" />
 
-                <androidx.appcompat.widget.AppCompatTextView
-                    android:layout_width="wrap_content"
-                    android:layout_height="wrap_content"
-                    android:layout_marginStart="@dimen/divider_9px"
-                    android:text="@string/click_search_doctors"
-                    android:textColor="@color/color_FF767575"
-                    android:textSize="@dimen/divider_28px"
+                <androidx.constraintlayout.widget.ConstraintLayout
+                    android:id="@+id/searchLayout"
+                    android:layout_width="match_parent"
+                    android:layout_height="@dimen/divider_60px"
+                    android:layout_marginStart="@dimen/divider_226px"
+                    android:layout_marginEnd="@dimen/divider_226px"
+                    android:layout_marginBottom="@dimen/divider_39px"
+                    android:background="@drawable/bg_home_page_search"
                     app:layout_constraintBottom_toBottomOf="parent"
-                    app:layout_constraintStart_toEndOf="@+id/imageSearch"
-                    app:layout_constraintTop_toTopOf="parent" />
+                    app:layout_constraintEnd_toEndOf="parent"
+                    app:layout_constraintStart_toStartOf="parent">
+
+                    <androidx.appcompat.widget.AppCompatImageView
+                        android:id="@+id/imageSearch"
+                        android:layout_width="@dimen/divider_30px"
+                        android:layout_height="@dimen/divider_28px"
+                        android:layout_marginStart="@dimen/divider_34px"
+                        android:background="@mipmap/icon_search"
+                        app:layout_constraintBottom_toBottomOf="parent"
+                        app:layout_constraintStart_toStartOf="parent"
+                        app:layout_constraintTop_toTopOf="parent" />
 
-            </androidx.constraintlayout.widget.ConstraintLayout>
-        </androidx.constraintlayout.widget.ConstraintLayout>
+                    <androidx.appcompat.widget.AppCompatTextView
+                        android:layout_width="wrap_content"
+                        android:layout_height="wrap_content"
+                        android:layout_marginStart="@dimen/divider_9px"
+                        android:text="@string/click_search_doctors"
+                        android:textColor="@color/color_FF767575"
+                        android:textSize="@dimen/divider_28px"
+                        app:layout_constraintBottom_toBottomOf="parent"
+                        app:layout_constraintStart_toEndOf="@+id/imageSearch"
+                        app:layout_constraintTop_toTopOf="parent" />
 
-        <androidx.core.widget.NestedScrollView
-            android:layout_width="match_parent"
-            android:layout_height="0dp"
-            app:layout_constraintBottom_toBottomOf="parent"
-            app:layout_constraintEnd_toEndOf="parent"
-            app:layout_constraintStart_toStartOf="parent"
-            app:layout_constraintTop_toBottomOf="@+id/headLayout">
+                </androidx.constraintlayout.widget.ConstraintLayout>
+            </androidx.constraintlayout.widget.ConstraintLayout>
 
             <com.google.android.material.card.MaterialCardView
                 android:layout_width="match_parent"
@@ -167,6 +164,6 @@
 
                 </LinearLayout>
             </com.google.android.material.card.MaterialCardView>
-        </androidx.core.widget.NestedScrollView>
-    </androidx.constraintlayout.widget.ConstraintLayout>
+        </LinearLayout>
+    </androidx.core.widget.NestedScrollView>
 </layout>

BIN
healthconsultation/src/main/res/mipmap-xxhdpi/icon_consultation_type.png


+ 1 - 0
healthconsultation/src/main/res/values/colors.xml

@@ -12,4 +12,5 @@
     <color name="color_FFFF9E05" tools:ignore="ResourceName">#FFFF9E05</color>
     <color name="color_FFB2C3FF" tools:ignore="ResourceName">#FFB2C3FF</color>
     <color name="color_FF82A8FF" tools:ignore="ResourceName">#FF82A8FF</color>
+    <color name="color_4A76FF" tools:ignore="ResourceName">#4A76FF</color>
 </resources>

+ 1 - 0
healthconsultation/src/main/res/values/strings.xml

@@ -10,4 +10,5 @@
     <string name="back_pager" tools:ignore="MissingTranslation,ResourceName">返回</string>
     <string name="doctor_details" tools:ignore="ResourceName">医生详情</string>
     <string name="consulting_service" tools:ignore="ResourceName">咨询服务</string>
+    <string name="go_to_consult" tools:ignore="ResourceName">去咨询</string>
 </resources>