Commit 3713bbb6 by 刘鹏

feat : 问诊流程、消息更新bug修复

parent a35bde3d
...@@ -10,7 +10,7 @@ ext { ...@@ -10,7 +10,7 @@ ext {
"m-fm" : "0.0.30.03", "m-fm" : "0.0.30.03",
"m-user" : "0.0.61.84", "m-user" : "0.0.61.84",
"m-home" : "0.0.22.70", "m-home" : "0.0.22.70",
"m-im" : "0.0.20.28", "m-im" : "0.0.20.32",
"m-dynamic" : "0.0.7.28", "m-dynamic" : "0.0.7.28",
"m-article" : "0.0.0.10", "m-article" : "0.0.0.10",
...@@ -94,7 +94,7 @@ ext { ...@@ -94,7 +94,7 @@ ext {
"m-fm" : "0.0.30.01", "m-fm" : "0.0.30.01",
"m-user" : "0.0.61.84", "m-user" : "0.0.61.84",
"m-home" : "0.0.22.70", "m-home" : "0.0.22.70",
"m-im" : "0.0.20.28", "m-im" : "0.0.20.32",
"m-dynamic" : "0.0.7.28", "m-dynamic" : "0.0.7.28",
"m-article" : "0.0.0.8", "m-article" : "0.0.0.8",
......
...@@ -60,10 +60,12 @@ class GraphicConsultationFlow1Activity : BaseActivity() { ...@@ -60,10 +60,12 @@ class GraphicConsultationFlow1Activity : BaseActivity() {
private var imgFiles: ArrayList<File>? = null private var imgFiles: ArrayList<File>? = null
@JvmStatic @JvmStatic
fun start(context: Context, doctorId: String,doctorUid:String) { fun start(context: Context, doctorId: String, doctorUid: String) {
val starter = Intent(context, GraphicConsultationFlow1Activity::class.java) val starter = Intent(context, GraphicConsultationFlow1Activity::class.java)
.putExtra("doctorId", doctorId) .putExtra("doctorId", doctorId)
.putExtra("doctorUid", doctorUid) .putExtra("doctorUid", doctorUid)
publishTrendImgs.clear()
publishTrendImgBrows.clear()
context.startActivity(starter) context.startActivity(starter)
} }
} }
...@@ -246,10 +248,12 @@ class GraphicConsultationFlow1Activity : BaseActivity() { ...@@ -246,10 +248,12 @@ class GraphicConsultationFlow1Activity : BaseActivity() {
//下一步 //下一步
GraphicConsulttionFlow2Activity.start( GraphicConsulttionFlow2Activity.start(
this@GraphicConsultationFlow1Activity, this@GraphicConsultationFlow1Activity,
edit_input.text.toString(), fileStr.toString(), mDoctorId,mDoctorUid edit_input.text.toString(),
fileStr.toString(),
mDoctorId,
mDoctorUid
) )
} }
ToastUtil.toastShort("成功")
} else { } else {
ToastUtil.toastShort(response.msg) ToastUtil.toastShort(response.msg)
} }
...@@ -312,11 +316,23 @@ class GraphicConsultationFlow1Activity : BaseActivity() { ...@@ -312,11 +316,23 @@ class GraphicConsultationFlow1Activity : BaseActivity() {
} }
val chane_state = data.getBooleanExtra("chane_state", false) val chane_state = data.getBooleanExtra("chane_state", false)
if (chane_state) { if (chane_state) {
//图片放大删除后,返回的数据
val bundle = data.getBundleExtra("bundle") val bundle = data.getBundleExtra("bundle")
publishTrendImgs = bundle.getParcelableArrayList("publish_img")
if (publishTrendImgs.size > 0) { var list = bundle.getParcelableArrayList<ParcelableImage>("publish_img")
if (list.size == 9) {
publishTrendImgs = list
} else if (list.size > 0) {
publishTrendImgs.clear()
publishTrendImgs.add(ParcelableImage("default")) publishTrendImgs.add(ParcelableImage("default"))
publishTrendImgs.addAll(list)
} else {
publishTrendImgs = list
group_empty_camera.visibility = View.VISIBLE
rv_pic_list.visibility = View.GONE
} }
imageAdapter.updateDate(publishTrendImgs) imageAdapter.updateDate(publishTrendImgs)
} }
} }
...@@ -331,7 +347,7 @@ class GraphicConsultationFlow1Activity : BaseActivity() { ...@@ -331,7 +347,7 @@ class GraphicConsultationFlow1Activity : BaseActivity() {
publishTrendImgBrows.clear() publishTrendImgBrows.clear()
publishTrendImgBrows.addAll(publishTrendImgs) publishTrendImgBrows.addAll(publishTrendImgs)
if (publishTrendImgBrows.size < 9) { if (publishTrendImgBrows.size < 9) {
publishTrendImgBrows.removeAt(publishTrendImgBrows.size - 1) publishTrendImgBrows.removeAt(0)
if (publishTrendImgBrows.size > 0) { if (publishTrendImgBrows.size > 0) {
val intent = Intent() val intent = Intent()
intent.setClass( intent.setClass(
...@@ -339,7 +355,7 @@ class GraphicConsultationFlow1Activity : BaseActivity() { ...@@ -339,7 +355,7 @@ class GraphicConsultationFlow1Activity : BaseActivity() {
MedicalBrowsePicturesActivity::class.java MedicalBrowsePicturesActivity::class.java
) )
intent.putExtra("browse_type", "preview") intent.putExtra("browse_type", "preview")
intent.putExtra("position", position) intent.putExtra("position", position - 1)
val bd = Bundle() val bd = Bundle()
bd.putParcelableArrayList( bd.putParcelableArrayList(
"allTrendImages", "allTrendImages",
...@@ -349,8 +365,8 @@ class GraphicConsultationFlow1Activity : BaseActivity() { ...@@ -349,8 +365,8 @@ class GraphicConsultationFlow1Activity : BaseActivity() {
startActivityForResult(intent, PUBLISH_PIC_BROW) startActivityForResult(intent, PUBLISH_PIC_BROW)
} }
} else { } else {
if ("default" == publishTrendImgBrows[8].image_url) { if ("default" == publishTrendImgBrows[0].image_url) {
publishTrendImgBrows.removeAt(8) publishTrendImgBrows.removeAt(0)
} }
val intent = Intent() val intent = Intent()
intent.setClass( intent.setClass(
...@@ -358,7 +374,7 @@ class GraphicConsultationFlow1Activity : BaseActivity() { ...@@ -358,7 +374,7 @@ class GraphicConsultationFlow1Activity : BaseActivity() {
MedicalBrowsePicturesActivity::class.java MedicalBrowsePicturesActivity::class.java
) )
intent.putExtra("browse_type", "preview") intent.putExtra("browse_type", "preview")
intent.putExtra("position", position) intent.putExtra("position", position - 1)
val bd = Bundle() val bd = Bundle()
bd.putParcelableArrayList( bd.putParcelableArrayList(
"allTrendImages", "allTrendImages",
...@@ -422,22 +438,26 @@ class GraphicConsultationFlow1Activity : BaseActivity() { ...@@ -422,22 +438,26 @@ class GraphicConsultationFlow1Activity : BaseActivity() {
*/ */
private fun AddImag(pic_path: String) { private fun AddImag(pic_path: String) {
val trendImage = ParcelableImage(pic_path) val trendImage = ParcelableImage(pic_path)
if (publishTrendImgs.size < 9 && publishTrendImgs.size > 0) { when (publishTrendImgs.size) {
in 1..8 -> {
publishTrendImgs.add(publishTrendImgs.size, trendImage) publishTrendImgs.add(publishTrendImgs.size, trendImage)
} else if (publishTrendImgs.size == 0) { }
0 -> {
publishTrendImgs.add(ParcelableImage("default")) publishTrendImgs.add(ParcelableImage("default"))
publishTrendImgs.add(publishTrendImgs.size, trendImage) publishTrendImgs.add(publishTrendImgs.size, trendImage)
} else { }
else -> {
publishTrendImgs.removeAt(0) publishTrendImgs.removeAt(0)
publishTrendImgs.add(8, trendImage) publishTrendImgs.add(8, trendImage)
} }
}
if (publishTrendImgs.size > 1) { if (publishTrendImgs.size > 1) {
group_empty_camera.visibility = View.GONE group_empty_camera.visibility = View.GONE
rv_pic_list.visibility = View.VISIBLE rv_pic_list.visibility = View.VISIBLE
} else { } else {
group_empty_camera.visibility = View.GONE group_empty_camera.visibility = View.VISIBLE
rv_pic_list.visibility = View.VISIBLE rv_pic_list.visibility = View.GONE
} }
imageAdapter.updateDate(publishTrendImgs) imageAdapter.updateDate(publishTrendImgs)
...@@ -447,7 +467,7 @@ class GraphicConsultationFlow1Activity : BaseActivity() { ...@@ -447,7 +467,7 @@ class GraphicConsultationFlow1Activity : BaseActivity() {
* 删除照片 * 删除照片
*/ */
private fun DeleteImg(position: Int) { private fun DeleteImg(position: Int) {
if (publishTrendImgs.size < 9 && publishTrendImgs.size > 2) { if (publishTrendImgs.size in 3..8) {
publishTrendImgs.removeAt(position) publishTrendImgs.removeAt(position)
} else if (publishTrendImgs.size == 2) { } else if (publishTrendImgs.size == 2) {
publishTrendImgs.clear() publishTrendImgs.clear()
......
...@@ -9,7 +9,6 @@ import com.medical.ydl.medical.pay.MedicalPayActivity ...@@ -9,7 +9,6 @@ import com.medical.ydl.medical.pay.MedicalPayActivity
import com.ydl.ydlcommon.base.BaseActivity import com.ydl.ydlcommon.base.BaseActivity
import com.ydl.ydlcommon.utils.StatusBarUtils import com.ydl.ydlcommon.utils.StatusBarUtils
import com.ydl.ydlcommon.utils.Utils import com.ydl.ydlcommon.utils.Utils
import com.ydl.ydlcommon.view.dialog.NormalDialog
import com.yidianling.common.tools.ToastUtil import com.yidianling.common.tools.ToastUtil
import com.yidianling.im.R import com.yidianling.im.R
import com.yidianling.medical.archives.MedicalAddNewArchivesActivity import com.yidianling.medical.archives.MedicalAddNewArchivesActivity
...@@ -27,7 +26,7 @@ import kotlinx.coroutines.launch ...@@ -27,7 +26,7 @@ import kotlinx.coroutines.launch
/** /**
* 图文问诊2 * 图文问诊2 选择问诊人
* */ * */
class GraphicConsulttionFlow2Activity : BaseActivity() { class GraphicConsulttionFlow2Activity : BaseActivity() {
...@@ -50,7 +49,13 @@ class GraphicConsulttionFlow2Activity : BaseActivity() { ...@@ -50,7 +49,13 @@ class GraphicConsulttionFlow2Activity : BaseActivity() {
* @param fileStr 图片拼接字符串 * @param fileStr 图片拼接字符串
* */ * */
@JvmStatic @JvmStatic
fun start(context: Context, inputText: String, fileStr: String, doctorId: String,doctorUid:String) { fun start(
context: Context,
inputText: String,
fileStr: String,
doctorId: String,
doctorUid: String
) {
mFlow1Activity = context as BaseActivity mFlow1Activity = context as BaseActivity
val starter = Intent(context, GraphicConsulttionFlow2Activity::class.java) val starter = Intent(context, GraphicConsulttionFlow2Activity::class.java)
.putExtra("inputText", inputText) .putExtra("inputText", inputText)
...@@ -146,26 +151,7 @@ class GraphicConsulttionFlow2Activity : BaseActivity() { ...@@ -146,26 +151,7 @@ class GraphicConsulttionFlow2Activity : BaseActivity() {
} }
private fun backCheck() { private fun backCheck() {
val builder = NormalDialog.Builder(this@GraphicConsulttionFlow2Activity, "center", true)
builder.setTitle("")
builder.setMessage("\n仅剩一步就可抢到医生的问诊名额,确认放弃吗?\n")
builder.setPositiveButton(
"继续填写"
) { dialog, which ->
dialog.dismiss()
}.setNegativeButton(
"放弃填写"
) { dialog, which ->
//关闭页面
finish() finish()
dialog.dismiss()
}
builder.setRight_color("#3464EC")
builder.setLeft_color("#8595A9")
builder.setContent_color("#10233A")
builder.create().show()
} }
/** /**
...@@ -227,7 +213,6 @@ class GraphicConsulttionFlow2Activity : BaseActivity() { ...@@ -227,7 +213,6 @@ class GraphicConsulttionFlow2Activity : BaseActivity() {
} }
}, { e -> }, { e ->
ToastUtil.toastShort("创建订单失败") ToastUtil.toastShort("创建订单失败")
e.printStackTrace() e.printStackTrace()
}) })
} }
...@@ -259,9 +244,11 @@ class GraphicConsulttionFlow2Activity : BaseActivity() { ...@@ -259,9 +244,11 @@ class GraphicConsulttionFlow2Activity : BaseActivity() {
mList = data as ArrayList<MedicalArchivesListBean> mList = data as ArrayList<MedicalArchivesListBean>
} }
mAdapter.setNewData(mList as List<MedicalArchivesListBean?>?) mAdapter.setNewData(mList as List<MedicalArchivesListBean?>?)
} else { mAdapter.notifyDataSetChanged()
} else {
mList.add(MedicalArchivesListBean(true)) mList.add(MedicalArchivesListBean(true))
mAdapter.notifyDataSetChanged()
} }
}, { e -> }, { e ->
......
...@@ -13,8 +13,10 @@ import com.ydl.ydlcommon.base.BaseFragment ...@@ -13,8 +13,10 @@ import com.ydl.ydlcommon.base.BaseFragment
import com.ydl.ydlcommon.data.http.RxUtils import com.ydl.ydlcommon.data.http.RxUtils
import com.yidianling.common.tools.ToastUtil import com.yidianling.common.tools.ToastUtil
import com.yidianling.im.R import com.yidianling.im.R
import com.yidianling.im.api.event.ImLogoutEvent
import com.yidianling.im.api.event.UpdateBottomBarUnreadNumEvent import com.yidianling.im.api.event.UpdateBottomBarUnreadNumEvent
import com.yidianling.im.event.MessageListRefreshEvent import com.yidianling.im.event.ReQureyUnreadNum
import com.yidianling.im.event.UpdateTabUnreadNumEvent
import com.yidianling.im.helper.MsgReceiveHelper import com.yidianling.im.helper.MsgReceiveHelper
import com.yidianling.im.http.ImHttpImpl import com.yidianling.im.http.ImHttpImpl
import com.yidianling.im.router.ImIn import com.yidianling.im.router.ImIn
...@@ -66,6 +68,7 @@ class MeidicalChatFragment : BaseFragment(), XRecyclerView.LoadingListener { ...@@ -66,6 +68,7 @@ class MeidicalChatFragment : BaseFragment(), XRecyclerView.LoadingListener {
override fun initDataAndEvent() { override fun initDataAndEvent() {
mContext = requireContext() mContext = requireContext()
EventBus.getDefault().register(this)
selectModel() selectModel()
...@@ -120,7 +123,10 @@ class MeidicalChatFragment : BaseFragment(), XRecyclerView.LoadingListener { ...@@ -120,7 +123,10 @@ class MeidicalChatFragment : BaseFragment(), XRecyclerView.LoadingListener {
} }
} }
} }
override fun onDestroy() {
super.onDestroy()
EventBus.getDefault().unregister(this)
}
/** /**
* 系统通知开关 * 系统通知开关
* */ * */
...@@ -173,7 +179,8 @@ class MeidicalChatFragment : BaseFragment(), XRecyclerView.LoadingListener { ...@@ -173,7 +179,8 @@ class MeidicalChatFragment : BaseFragment(), XRecyclerView.LoadingListener {
} }
override fun onRefresh() { override fun onRefresh() {
EventBus.getDefault().post(MessageListRefreshEvent(0)) requestTopUnReadNumber()
getChatMessageData() getChatMessageData()
} }
...@@ -377,7 +384,7 @@ class MeidicalChatFragment : BaseFragment(), XRecyclerView.LoadingListener { ...@@ -377,7 +384,7 @@ class MeidicalChatFragment : BaseFragment(), XRecyclerView.LoadingListener {
/** /**
* 重置顶部未读数量 * 重置顶部未读数量
*/ */
private fun resetTopUnReadNumber(bean: UnreadMessageBean) { fun resetTopUnReadNumber(bean: UnreadMessageBean) {
val chatUnreadNum = ImIn.getInUnreadNum()//私聊未读数移动端自己读取云信 val chatUnreadNum = ImIn.getInUnreadNum()//私聊未读数移动端自己读取云信
...@@ -389,6 +396,34 @@ class MeidicalChatFragment : BaseFragment(), XRecyclerView.LoadingListener { ...@@ -389,6 +396,34 @@ class MeidicalChatFragment : BaseFragment(), XRecyclerView.LoadingListener {
) )
} }
private fun onEvent(event: ReQureyUnreadNum) {
getMsgData()
}
/**
* 私聊未读数变化触发的事件,不进行互动和通知未读数的更新
*/
fun onEvent(event: UpdateTabUnreadNumEvent) {
try {
val chatUnreadNum = ImIn.getInUnreadNum() //私聊未读数移动端自己读取云信
// 刷新私聊列表
getChatMessageData()
// 同步底部导航栏的角标数量
EventBus.getDefault().post(UpdateBottomBarUnreadNumEvent(chatUnreadNum))
} catch (e: Exception) {
e.printStackTrace()
}
}
/**
* 云信登出
*/
fun onEvent(event: ImLogoutEvent) {
clearData()
}
/** /**
* 设置页面背景色 * 设置页面背景色
*/ */
......
...@@ -196,12 +196,13 @@ ...@@ -196,12 +196,13 @@
android:focusable="true" android:focusable="true"
android:focusableInTouchMode="true" android:focusableInTouchMode="true"
android:gravity="left|top" android:gravity="left|top"
android:lineSpacingMultiplier="1.1"
android:hint="为了更好获得医生帮助,请尽可能详细描述病情,\n最少需要描述10个字" android:hint="为了更好获得医生帮助,请尽可能详细描述病情,\n最少需要描述10个字"
android:includeFontPadding="false" android:includeFontPadding="false"
android:lineSpacingMultiplier="1.1"
android:maxEms="200"
android:maxLength="200"
android:minHeight="200dp" android:minHeight="200dp"
android:padding="12dp" android:padding="12dp"
android:maxEms="200"
android:paddingBottom="25dp" android:paddingBottom="25dp"
android:textColor="#0C1D31" android:textColor="#0C1D31"
android:textColorHint="#C0C9D4" android:textColorHint="#C0C9D4"
...@@ -323,8 +324,8 @@ ...@@ -323,8 +324,8 @@
android:layout_marginTop="16dp" android:layout_marginTop="16dp"
android:layout_marginBottom="36dp" android:layout_marginBottom="36dp"
android:background="@drawable/medical_bg_d7dfea_8dp" android:background="@drawable/medical_bg_d7dfea_8dp"
android:gravity="center"
android:enabled="false" android:enabled="false"
android:gravity="center"
android:text="下一步" android:text="下一步"
android:textColor="@color/white" android:textColor="@color/white"
android:textSize="@dimen/sp_16" android:textSize="@dimen/sp_16"
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment