|
|
@@ -21,6 +21,7 @@ import com.yingyang.healthconsultation.dialog.SelectPicDialog
|
|
|
import com.yingyang.healthconsultation.entity.UploadImgBean
|
|
|
import com.yingyang.healthconsultation.utils.CommonUtils
|
|
|
import com.yingyangfly.baselib.adapter.XBaseAdapter
|
|
|
+import com.yingyangfly.baselib.dialog.TipsDialog
|
|
|
import com.yingyangfly.baselib.ext.*
|
|
|
import com.yingyangfly.baselib.mvvm.BaseMVVMActivity
|
|
|
import com.yingyangfly.baselib.router.RouterUrlCommon
|
|
|
@@ -66,6 +67,7 @@ class ConsultationSheetActivity :
|
|
|
/**
|
|
|
* 初始化问诊单图片
|
|
|
*/
|
|
|
+ @SuppressLint("NotifyDataSetChanged")
|
|
|
private fun initImageRv() {
|
|
|
emptyUploadImgBean = UploadImgBean()
|
|
|
imageList.add(emptyUploadImgBean)
|
|
|
@@ -113,10 +115,35 @@ class ConsultationSheetActivity :
|
|
|
upLoadImg(i, img)
|
|
|
}
|
|
|
}
|
|
|
+
|
|
|
+ imgDelete.setOnSingleClickListener {
|
|
|
+ delect(i)
|
|
|
+ }
|
|
|
}
|
|
|
binding.rvPic.adapter = imageAdapter
|
|
|
}
|
|
|
|
|
|
+ /**
|
|
|
+ * 删除图片
|
|
|
+ */
|
|
|
+ private fun delect(i: Int) {
|
|
|
+ TipsDialog.TipDialogBuilder()
|
|
|
+ .title("提示")
|
|
|
+ .content("是否删除该图片")
|
|
|
+ .leftBtnText("否")
|
|
|
+ .rightBtnText("是")
|
|
|
+ .leftClick({
|
|
|
+ }, true)
|
|
|
+ .rightClick({
|
|
|
+ imageList.removeAt(i)
|
|
|
+ if (imageList.contains(emptyUploadImgBean).not()) {
|
|
|
+ imageList.add(0, emptyUploadImgBean)
|
|
|
+ }
|
|
|
+ imageAdapter.notifyDataSetChanged()
|
|
|
+ }, true)
|
|
|
+ .show(supportFragmentManager)
|
|
|
+ }
|
|
|
+
|
|
|
/**
|
|
|
* 图片选择弹框
|
|
|
*/
|
|
|
@@ -142,7 +169,7 @@ class ConsultationSheetActivity :
|
|
|
dialog.show(supportFragmentManager, "SelectPicDialog")
|
|
|
}
|
|
|
|
|
|
- fun getImgLocalPaths(): ArrayList<String> {
|
|
|
+ private fun getImgLocalPaths(): ArrayList<String> {
|
|
|
val localList = arrayListOf<String>()
|
|
|
imageList.forEach {
|
|
|
if (it.localPaht.isNullOrEmpty().not())
|