Commit 3713bbb6 by 刘鹏

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

parent a35bde3d
......@@ -10,7 +10,7 @@ ext {
"m-fm" : "0.0.30.03",
"m-user" : "0.0.61.84",
"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-article" : "0.0.0.10",
......@@ -94,7 +94,7 @@ ext {
"m-fm" : "0.0.30.01",
"m-user" : "0.0.61.84",
"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-article" : "0.0.0.8",
......
......@@ -60,10 +60,12 @@ class GraphicConsultationFlow1Activity : BaseActivity() {
private var imgFiles: ArrayList<File>? = null
@JvmStatic
fun start(context: Context, doctorId: String,doctorUid:String) {
fun start(context: Context, doctorId: String, doctorUid: String) {
val starter = Intent(context, GraphicConsultationFlow1Activity::class.java)
.putExtra("doctorId", doctorId)
.putExtra("doctorUid", doctorUid)
publishTrendImgs.clear()
publishTrendImgBrows.clear()
context.startActivity(starter)
}
}
......@@ -102,32 +104,32 @@ class GraphicConsultationFlow1Activity : BaseActivity() {
//防止连击
return@setOnClickListener
}
if (edit_input.text.length < 10) {
ToastUtil.toastShort("请最少填写10个字")
return@setOnClickListener
} else {
if (publishTrendImgs.size > 0) {
var scope = CoroutineScope(Dispatchers.Default + Job())
scope.launch {
val publishImgs: MutableList<ParcelableImage> = ArrayList()
publishImgs.addAll(publishTrendImgs)
if (publishTrendImgs.size > 0) {
if ("default" == publishTrendImgs[0].image_url) {
publishImgs.removeAt(0)
}
if (edit_input.text.length < 10) {
ToastUtil.toastShort("请最少填写10个字")
return@setOnClickListener
} else {
if (publishTrendImgs.size > 0) {
var scope = CoroutineScope(Dispatchers.Default + Job())
scope.launch {
val publishImgs: MutableList<ParcelableImage> = ArrayList()
publishImgs.addAll(publishTrendImgs)
if (publishTrendImgs.size > 0) {
if ("default" == publishTrendImgs[0].image_url) {
publishImgs.removeAt(0)
}
upFile(publishImgs)
}
} else {
//下一步
GraphicConsulttionFlow2Activity.start(
this@GraphicConsultationFlow1Activity,
edit_input.text.toString(), "", mDoctorId, mDoctorUid
)
upFile(publishImgs)
}
} else {
//下一步
GraphicConsulttionFlow2Activity.start(
this@GraphicConsultationFlow1Activity,
edit_input.text.toString(), "", mDoctorId, mDoctorUid
)
}
}
}
edit_input.addTextChangedListener(object : TextWatcher {
......@@ -246,10 +248,12 @@ class GraphicConsultationFlow1Activity : BaseActivity() {
//下一步
GraphicConsulttionFlow2Activity.start(
this@GraphicConsultationFlow1Activity,
edit_input.text.toString(), fileStr.toString(), mDoctorId,mDoctorUid
edit_input.text.toString(),
fileStr.toString(),
mDoctorId,
mDoctorUid
)
}
ToastUtil.toastShort("成功")
} else {
ToastUtil.toastShort(response.msg)
}
......@@ -312,11 +316,23 @@ class GraphicConsultationFlow1Activity : BaseActivity() {
}
val chane_state = data.getBooleanExtra("chane_state", false)
if (chane_state) {
//图片放大删除后,返回的数据
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.addAll(list)
} else {
publishTrendImgs = list
group_empty_camera.visibility = View.VISIBLE
rv_pic_list.visibility = View.GONE
}
imageAdapter.updateDate(publishTrendImgs)
}
}
......@@ -331,7 +347,7 @@ class GraphicConsultationFlow1Activity : BaseActivity() {
publishTrendImgBrows.clear()
publishTrendImgBrows.addAll(publishTrendImgs)
if (publishTrendImgBrows.size < 9) {
publishTrendImgBrows.removeAt(publishTrendImgBrows.size - 1)
publishTrendImgBrows.removeAt(0)
if (publishTrendImgBrows.size > 0) {
val intent = Intent()
intent.setClass(
......@@ -339,7 +355,7 @@ class GraphicConsultationFlow1Activity : BaseActivity() {
MedicalBrowsePicturesActivity::class.java
)
intent.putExtra("browse_type", "preview")
intent.putExtra("position", position)
intent.putExtra("position", position - 1)
val bd = Bundle()
bd.putParcelableArrayList(
"allTrendImages",
......@@ -349,8 +365,8 @@ class GraphicConsultationFlow1Activity : BaseActivity() {
startActivityForResult(intent, PUBLISH_PIC_BROW)
}
} else {
if ("default" == publishTrendImgBrows[8].image_url) {
publishTrendImgBrows.removeAt(8)
if ("default" == publishTrendImgBrows[0].image_url) {
publishTrendImgBrows.removeAt(0)
}
val intent = Intent()
intent.setClass(
......@@ -358,7 +374,7 @@ class GraphicConsultationFlow1Activity : BaseActivity() {
MedicalBrowsePicturesActivity::class.java
)
intent.putExtra("browse_type", "preview")
intent.putExtra("position", position)
intent.putExtra("position", position - 1)
val bd = Bundle()
bd.putParcelableArrayList(
"allTrendImages",
......@@ -422,22 +438,26 @@ class GraphicConsultationFlow1Activity : BaseActivity() {
*/
private fun AddImag(pic_path: String) {
val trendImage = ParcelableImage(pic_path)
if (publishTrendImgs.size < 9 && publishTrendImgs.size > 0) {
publishTrendImgs.add(publishTrendImgs.size, trendImage)
} else if (publishTrendImgs.size == 0) {
publishTrendImgs.add(ParcelableImage("default"))
publishTrendImgs.add(publishTrendImgs.size, trendImage)
} else {
publishTrendImgs.removeAt(0)
publishTrendImgs.add(8, trendImage)
when (publishTrendImgs.size) {
in 1..8 -> {
publishTrendImgs.add(publishTrendImgs.size, trendImage)
}
0 -> {
publishTrendImgs.add(ParcelableImage("default"))
publishTrendImgs.add(publishTrendImgs.size, trendImage)
}
else -> {
publishTrendImgs.removeAt(0)
publishTrendImgs.add(8, trendImage)
}
}
if (publishTrendImgs.size > 1) {
group_empty_camera.visibility = View.GONE
rv_pic_list.visibility = View.VISIBLE
} else {
group_empty_camera.visibility = View.GONE
rv_pic_list.visibility = View.VISIBLE
group_empty_camera.visibility = View.VISIBLE
rv_pic_list.visibility = View.GONE
}
imageAdapter.updateDate(publishTrendImgs)
......@@ -447,7 +467,7 @@ class GraphicConsultationFlow1Activity : BaseActivity() {
* 删除照片
*/
private fun DeleteImg(position: Int) {
if (publishTrendImgs.size < 9 && publishTrendImgs.size > 2) {
if (publishTrendImgs.size in 3..8) {
publishTrendImgs.removeAt(position)
} else if (publishTrendImgs.size == 2) {
publishTrendImgs.clear()
......
......@@ -9,7 +9,6 @@ import com.medical.ydl.medical.pay.MedicalPayActivity
import com.ydl.ydlcommon.base.BaseActivity
import com.ydl.ydlcommon.utils.StatusBarUtils
import com.ydl.ydlcommon.utils.Utils
import com.ydl.ydlcommon.view.dialog.NormalDialog
import com.yidianling.common.tools.ToastUtil
import com.yidianling.im.R
import com.yidianling.medical.archives.MedicalAddNewArchivesActivity
......@@ -27,7 +26,7 @@ import kotlinx.coroutines.launch
/**
* 图文问诊2
* 图文问诊2 选择问诊人
* */
class GraphicConsulttionFlow2Activity : BaseActivity() {
......@@ -50,7 +49,13 @@ class GraphicConsulttionFlow2Activity : BaseActivity() {
* @param fileStr 图片拼接字符串
* */
@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
val starter = Intent(context, GraphicConsulttionFlow2Activity::class.java)
.putExtra("inputText", inputText)
......@@ -146,26 +151,7 @@ class GraphicConsulttionFlow2Activity : BaseActivity() {
}
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()
dialog.dismiss()
}
builder.setRight_color("#3464EC")
builder.setLeft_color("#8595A9")
builder.setContent_color("#10233A")
builder.create().show()
finish()
}
/**
......@@ -227,7 +213,6 @@ class GraphicConsulttionFlow2Activity : BaseActivity() {
}
}, { e ->
ToastUtil.toastShort("创建订单失败")
e.printStackTrace()
})
}
......@@ -259,9 +244,11 @@ class GraphicConsulttionFlow2Activity : BaseActivity() {
mList = data as ArrayList<MedicalArchivesListBean>
}
mAdapter.setNewData(mList as List<MedicalArchivesListBean?>?)
} else {
mAdapter.notifyDataSetChanged()
} else {
mList.add(MedicalArchivesListBean(true))
mAdapter.notifyDataSetChanged()
}
}, { e ->
......
......@@ -13,8 +13,10 @@ import com.ydl.ydlcommon.base.BaseFragment
import com.ydl.ydlcommon.data.http.RxUtils
import com.yidianling.common.tools.ToastUtil
import com.yidianling.im.R
import com.yidianling.im.api.event.ImLogoutEvent
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.http.ImHttpImpl
import com.yidianling.im.router.ImIn
......@@ -66,6 +68,7 @@ class MeidicalChatFragment : BaseFragment(), XRecyclerView.LoadingListener {
override fun initDataAndEvent() {
mContext = requireContext()
EventBus.getDefault().register(this)
selectModel()
......@@ -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 {
}
override fun onRefresh() {
EventBus.getDefault().post(MessageListRefreshEvent(0))
requestTopUnReadNumber()
getChatMessageData()
}
......@@ -377,7 +384,7 @@ class MeidicalChatFragment : BaseFragment(), XRecyclerView.LoadingListener {
/**
* 重置顶部未读数量
*/
private fun resetTopUnReadNumber(bean: UnreadMessageBean) {
fun resetTopUnReadNumber(bean: UnreadMessageBean) {
val chatUnreadNum = ImIn.getInUnreadNum()//私聊未读数移动端自己读取云信
......@@ -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 @@
android:focusable="true"
android:focusableInTouchMode="true"
android:gravity="left|top"
android:lineSpacingMultiplier="1.1"
android:hint="为了更好获得医生帮助,请尽可能详细描述病情,\n最少需要描述10个字"
android:includeFontPadding="false"
android:lineSpacingMultiplier="1.1"
android:maxEms="200"
android:maxLength="200"
android:minHeight="200dp"
android:padding="12dp"
android:maxEms="200"
android:paddingBottom="25dp"
android:textColor="#0C1D31"
android:textColorHint="#C0C9D4"
......@@ -323,8 +324,8 @@
android:layout_marginTop="16dp"
android:layout_marginBottom="36dp"
android:background="@drawable/medical_bg_d7dfea_8dp"
android:gravity="center"
android:enabled="false"
android:gravity="center"
android:text="下一步"
android:textColor="@color/white"
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