Commit bfc4344e by 刘鹏

feat : 部分代码提交

parent 8c56d315
......@@ -29,6 +29,8 @@ import com.yidianling.common.tools.LogUtil
import com.yidianling.common.tools.ToastUtil
import com.yidianling.consultant.api.IConsultantService
import com.yidianling.fm.api.service.IFMService
import com.yidianling.medical.GraphicConsultationFlow1Activity
import com.yidianling.medical.archives.MedicalArchivesListActivity
import com.yidianling.tests.home.NewTestHomeActivity
import com.yidianling.user.StatusUtils
import com.yidianling.user.ui.collect.CollectSexAndBirthActivity
......@@ -79,7 +81,11 @@ class MainActivity : BaseLceActivity<DemoContract.View, DemoContract.Presenter>(
OpenInstall.init(this);// TODO: 1/29/21 统计渠道测试
StatusUtils.isUseOpenInstall = true
// 初始化一键登录sdk
OneKeyLoginHelp.sdkInit(this, OneKeyLoginHelp.YDL_USER_APP, PhoneNumberAuthHelper.SERVICE_TYPE_LOGIN)
OneKeyLoginHelp.sdkInit(
this,
OneKeyLoginHelp.YDL_USER_APP,
PhoneNumberAuthHelper.SERVICE_TYPE_LOGIN
)
bindService()
reLoadData()
requestPermission()
......@@ -87,6 +93,16 @@ class MainActivity : BaseLceActivity<DemoContract.View, DemoContract.Presenter>(
reLoadData()
}
yl_twwz.setOnClickListener {
//医疗图文问诊
GraphicConsultationFlow1Activity.start(this@MainActivity)
}
yl_yhdangan_list.setOnClickListener {
//医疗 用户档案列表
MedicalArchivesListActivity.start(this@MainActivity)
}
tv_home?.setOnClickListener {
mPresenter.loadHome()
}
......@@ -96,7 +112,7 @@ class MainActivity : BaseLceActivity<DemoContract.View, DemoContract.Presenter>(
// .withBoolean("bind_phone", false)
// .withBoolean("isFromGuide", true)
// .navigation()
OneKeyLoginHelp.startLogin(this,false)
OneKeyLoginHelp.startLogin(this, false)
}
bt_to_consultant.setOnClickListener {
// ARouter.getInstance()
......
......@@ -219,6 +219,29 @@
android:text="我的" />
</LinearLayout>
<LinearLayout
android:orientation="horizontal"
android:layout_width="match_parent"
android:layout_height="wrap_content">
<Button
android:id="@+id/yl_twwz"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_weight="1"
android:layout_marginRight="10dp"
android:text="医疗 图文问诊流程" />
<Button
android:id="@+id/yl_yhdangan_list"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_weight="1"
android:layout_marginRight="10dp"
android:text="医疗 用户档案列表" />
</LinearLayout>
</LinearLayout>
<com.ydl.ydlcommon.mvp.lce.view.YDLStateView
......
......@@ -97,12 +97,14 @@ dependencies {
api project(':ydl-platform')
implementation modularPublication('com.ydl:m-im-api')
implementation modularPublication('com.ydl:m-user-api')
implementation modularPublication('com.ydl:m-dynamic-api')
implementation modularPublication('com.ydl:m-consultant-api')
implementation modularPublication('com.ydl:m-confide-api')
}else {
//发布时使用
compileOnly rootProject.ext.dependencies["ydl-m-im-api"]
compileOnly rootProject.ext.dependencies["ydl-m-user-api"]
compileOnly rootProject.ext.dependencies["ydl-m-dynamic-api"]
compileOnly rootProject.ext.dependencies["ydl-m-consultant-api"]
compileOnly rootProject.ext.dependencies["ydl-m-confide-api"]
api rootProject.ext.dependencies["ydl-webview"]
......
......@@ -17,6 +17,14 @@ modular {
// 上报的 壹点灵 业务模块 aar 包的版本号
version = rootProject.ext.ydlPublishVersion[childProject.getName()]
}
medical{
groupId = "com.ydl"
artifactId = "m-im-module-medical"
// 上报的 壹点灵 业务模块 aar 包的版本号
version = rootProject.ext.ydlPublishVersion[childProject.getName()]
}
}
api {
......
......@@ -261,5 +261,32 @@
android:name="com.yidianling.uikit.business.session.activity.WatchPicAndVideoMenuActivity"
android:configChanges="keyboardHidden"
android:theme="@style/platform_NoTitleTheme" />
<!--图文问诊页面1-->
<activity
android:name="com.yidianling.medical.GraphicConsultationFlow1Activity"
android:screenOrientation="portrait" />
<!--图文问诊页面2-->
<activity
android:name="com.yidianling.medical.GraphicConsulttionFlow2Activity"
android:screenOrientation="portrait" />
<activity
android:name="com.yidianling.medical.pic.MedicalBrowsePicturesActivity"
android:screenOrientation="portrait"
android:theme="@style/platform_NoTitleTheme" />
<!--用户档案列表页面-->
<activity
android:name="com.yidianling.medical.archives.MedicalArchivesListActivity"
android:screenOrientation="portrait"
android:theme="@style/platform_NoTitleTheme" />
<!--新增问诊人-->
<activity
android:name="com.yidianling.medical.archives.MedicalAddNewArchivesActivity"
android:screenOrientation="portrait"
android:theme="@style/platform_NoTitleTheme" />
</application>
</manifest>
package com.yidianling.medical
import android.annotation.SuppressLint
import android.content.Context
import android.content.Intent
import android.os.Bundle
import android.os.Parcelable
import android.text.Editable
import android.text.TextWatcher
import android.view.View
import androidx.recyclerview.widget.GridLayoutManager
import com.luck.picture.lib.entity.LocalMedia
import com.luck.picture.lib.listener.OnResultCallbackListener
import com.ydl.ydlcommon.actions.imagepicker.YDLImagePicker.startPicker
import com.ydl.ydlcommon.adapter.custom.PublishImageAdapter
import com.ydl.ydlcommon.base.BaseActivity
import com.ydl.ydlcommon.router.YdlCommonOut.Companion.showToast
import com.ydl.ydlcommon.ui.ParcelableImage
import com.yidianling.im.R
import com.yidianling.medical.pic.MedicalBrowsePicturesActivity
import com.yidianling.medical.pic.MedicalDynamicConstants
import kotlinx.android.synthetic.main.medical_graphic_consultation_flow1.*
import java.util.*
/**
* @Author: 刘鹏
* @Description: 图文问诊页面
* @CreateDate: 2021/10/27 4:28 下午
* -------------------------------
* @UpdateUser:
* @UpdateDate: 2021/10/27 4:28 下午
* @UpdateRemark:
* @Version:
*/
class GraphicConsultationFlow1Activity : BaseActivity() {
companion object {
var publishTrendImgs = ArrayList<ParcelableImage>()
var publishTrendImgBrows = ArrayList<ParcelableImage>()
var PUBLISH_PIC_BROW = 21009
lateinit var imageAdapter: PublishImageAdapter
@JvmStatic
fun start(context: Context) {
val starter = Intent(context, GraphicConsultationFlow1Activity::class.java)
context.startActivity(starter)
}
}
override fun layoutResId(): Int {
return R.layout.medical_graphic_consultation_flow1
}
override fun initDataAndEvent() {
imageAdapter =
PublishImageAdapter(publishTrendImgs, this@GraphicConsultationFlow1Activity);
rv_pic_list.layoutManager = GridLayoutManager(this@GraphicConsultationFlow1Activity, 4);
rv_pic_list.adapter = imageAdapter
setAdapter()
camera_bg.setOnClickListener {
//选择图片
showSelector()
}
how_to_dec.setOnClickListener {
//如何描述
if (dec.visibility == View.GONE) {
dec.visibility = View.VISIBLE
} else {
dec.visibility = View.GONE
}
}
text_service.setOnClickListener {
//下一步
GraphicConsulttionFlow2Activity.start(this@GraphicConsultationFlow1Activity)
}
edit_input.addTextChangedListener(object : TextWatcher {
@SuppressLint("SetTextI18n")
override fun afterTextChanged(s: Editable?) {
val inputNumber = edit_input.text.length.toString()
input_num.text = "$inputNumber/200"
}
override fun beforeTextChanged(s: CharSequence?, start: Int, count: Int, after: Int) {}
override fun onTextChanged(s: CharSequence?, start: Int, before: Int, count: Int) {
}
})
}
override fun onActivityResult(requestCode: Int, resultCode: Int, data: Intent?) {
super.onActivityResult(requestCode, resultCode, data)
if (resultCode == RESULT_OK) {
when (requestCode) {
MedicalDynamicConstants.PUBLISH_PIC_BROW -> {
if (data == null) {
return
}
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) {
publishTrendImgs.add(ParcelableImage("default"))
}
imageAdapter.updateDate(publishTrendImgs)
}
}
}
}
}
private fun setAdapter() {
imageAdapter.setOnItemClickLister(object : PublishImageAdapter.OnItemClickLister {
override fun onItemClick(view: View, position: Int) {
publishTrendImgBrows = ArrayList()
publishTrendImgBrows.clear()
publishTrendImgBrows.addAll(publishTrendImgs)
if (publishTrendImgBrows.size < 9) {
publishTrendImgBrows.removeAt(publishTrendImgBrows.size - 1)
if (publishTrendImgBrows.size > 0) {
val intent = Intent()
intent.setClass(
this@GraphicConsultationFlow1Activity,
MedicalBrowsePicturesActivity::class.java
)
intent.putExtra("browse_type", "preview")
intent.putExtra("position", position)
val bd = Bundle()
bd.putParcelableArrayList(
"allTrendImages",
publishTrendImgBrows as ArrayList<out Parcelable?>
)
intent.putExtra("allTrendImages_bd", bd)
startActivityForResult(intent, PUBLISH_PIC_BROW)
}
} else {
if ("default" == publishTrendImgBrows[8].image_url) {
publishTrendImgBrows.removeAt(8)
}
val intent = Intent()
intent.setClass(
this@GraphicConsultationFlow1Activity,
MedicalBrowsePicturesActivity::class.java
)
intent.putExtra("browse_type", "preview")
intent.putExtra("position", position)
val bd = Bundle()
bd.putParcelableArrayList(
"allTrendImages",
publishTrendImgBrows as ArrayList<out Parcelable?>
)
intent.putExtra("allTrendImages_bd", bd)
startActivityForResult(intent, PUBLISH_PIC_BROW)
}
}
override fun onItemLongClick(view: View, position: Int) {}
})
imageAdapter.setOnDeleteClickLister(object : PublishImageAdapter.OnDeleteClickLister {
override fun onDeleteClick(view: View, position: Int) {
DeleteImg(position)
}
override fun onDeleteLongClick(view: View, position: Int) {}
})
imageAdapter.setOnAddClickLister(object : PublishImageAdapter.OnAddClickLister {
override fun OnAddClick(view: View, position: Int) {
if (publishTrendImgs.size < 9) {
showSelector()
} else {
if ("default" == publishTrendImgs[0].image_url) {
showSelector()
} else {
showToast("最多选择9张照片")
}
}
}
override fun OnAddLongClick(view: View, position: Int) {}
})
}
private fun showSelector() {
val selectedSize = if (publishTrendImgs.size != 0) publishTrendImgs.size - 1 else 0
startPicker(
(this as BaseActivity?)!!,
9 - selectedSize,
object : OnResultCallbackListener {
override fun onResult(list: List<LocalMedia>) {
if (list.isEmpty()) {
return
}
for (i in list.indices) {
AddImag(list[i].androidQToPath)
}
}
override fun onCancel() {
}
})
}
/**
* 添加照片
*/
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)
}
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
}
imageAdapter.updateDate(publishTrendImgs)
}
/**
* 删除照片
*/
private fun DeleteImg(position: Int) {
if (publishTrendImgs.size < 9 && publishTrendImgs.size > 2) {
publishTrendImgs.removeAt(position)
} else if (publishTrendImgs.size == 2) {
publishTrendImgs.clear()
} else {
if ("default" == publishTrendImgs[0].image_url) {
publishTrendImgs.removeAt(position)
} else {
publishTrendImgs.removeAt(position)
publishTrendImgs.add(0, ParcelableImage("default"))
}
}
if (publishTrendImgs.size > 1) {
group_empty_camera.visibility = View.GONE
rv_pic_list.visibility = View.VISIBLE
} else {
group_empty_camera.visibility = View.VISIBLE
rv_pic_list.visibility = View.GONE
}
imageAdapter.updateDate(publishTrendImgs)
}
}
\ No newline at end of file
package com.yidianling.medical
import android.content.Context
import android.content.Intent
import androidx.recyclerview.widget.LinearLayoutManager
import com.ydl.ydlcommon.base.BaseActivity
import com.yidianling.im.R
import kotlinx.android.synthetic.main.medical_graphic_consultation_flow2.*
/**
* 图文问诊2
* */
class GraphicConsulttionFlow2Activity : BaseActivity() {
companion object {
@JvmStatic
fun start(context: Context) {
val starter = Intent(context, GraphicConsulttionFlow2Activity::class.java)
context.startActivity(starter)
}
}
override fun layoutResId(): Int {
return R.layout.medical_graphic_consultation_flow2
}
override fun initDataAndEvent() {
rv_people_list.layoutManager = LinearLayoutManager(this@GraphicConsulttionFlow2Activity)
}
}
\ No newline at end of file
package com.yidianling.medical.archives
import android.annotation.SuppressLint
import android.content.Context
import android.content.Intent
import com.ydl.ydlcommon.base.BaseActivity
import com.yidianling.common.tools.ToastUtil
import com.yidianling.im.R
import com.yidianling.uikit.custom.http.ServiceImpl
import io.reactivex.android.schedulers.AndroidSchedulers
import io.reactivex.schedulers.Schedulers
import kotlinx.android.synthetic.main.medical_add_new_archives_activity.*
/**
* 新增问诊人
* */
class MedicalAddNewArchivesActivity : BaseActivity() {
companion object {
var mMarried = -1
var mRelation = -1
@JvmStatic
fun start(context: Context) {
val starter = Intent(context, MedicalAddNewArchivesActivity::class.java)
context.startActivity(starter)
}
}
override fun layoutResId(): Int {
return R.layout.medical_add_new_archives_activity
}
override fun initDataAndEvent() {
group_merried.setOnCheckedChangeListener { group, checkedId ->
//婚姻状态
when (checkedId) {
R.id.married -> {
//已婚 1
mMarried = 1
}
R.id.unmarried -> {
//未婚 0
mMarried = 0
}
R.id.widowed -> {
//丧偶 2
mMarried = 2
}
R.id.divorce -> {
//离异 3
mMarried = 3
}
else -> {
mMarried = -1
}
}
}
group_relation.setOnCheckedChangeListener { group, checkedId ->
//与本人关系
when (checkedId) {
R.id.me -> {
//本人 0
mRelation = 1
}
R.id.parent -> {
//父母 0
mRelation = 1
}
R.id.spouse -> {
//配偶 2
mRelation = 2
}
R.id.children -> {
//子女 3
mRelation = 3
}
R.id.other -> {
//其他 4
mRelation = 4
}
else -> {
mRelation = -1
}
}
}
add_archives_save.setOnClickListener {
//保存新增问诊人
checkInfo()
}
}
@SuppressLint("CheckResult")
private fun checkInfo() {
if (et_name.text.isNullOrEmpty()) {
ToastUtil.toastLong(this@MedicalAddNewArchivesActivity, "请填写姓名")
return
}
if (et_idcard.text.isNullOrEmpty()) {
ToastUtil.toastLong(this@MedicalAddNewArchivesActivity, "请填写身份证号")
return
}
if (et_idcard.text.length < 15 || et_idcard.text.length > 18) {
ToastUtil.toastLong(this@MedicalAddNewArchivesActivity, "请填写有效身份证号")
return
}
if (mMarried == -1) {
ToastUtil.toastLong(this@MedicalAddNewArchivesActivity, "请选择婚姻状况")
return
}
if (mRelation == -1) {
ToastUtil.toastLong(this@MedicalAddNewArchivesActivity, "请选择与患者的关系")
return
}
ServiceImpl.instance.createArchives(
et_name.text.toString(),
et_idcard.text.toString(),
mMarried,
mRelation
)
.subscribeOn(Schedulers.io())
.observeOn(AndroidSchedulers.mainThread())
.subscribe({
if ("200" == it.code) {
ToastUtil.toastShort("保存成功")
} else {
ToastUtil.toastShort(it.msg)
}
}, {
it.printStackTrace()
ToastUtil.toastShort("网络错误")
})
}
}
\ No newline at end of file
package com.yidianling.medical.archives
import android.annotation.SuppressLint
import android.content.Context
import android.content.Intent
import android.view.LayoutInflater
import android.view.View
import androidx.core.content.ContextCompat
import androidx.recyclerview.widget.LinearLayoutManager
import androidx.swiperefreshlayout.widget.SwipeRefreshLayout
import com.chad.library.adapter.base.BaseQuickAdapter
import com.ydl.ydlcommon.base.BaseActivity
import com.yidianling.im.R
import com.yidianling.medical.archives.adapter.MedicalUserArchivesAdapter
import com.yidianling.medical.widgets.LoadMoreView
import com.yidianling.uikit.custom.http.ServiceImpl.Companion.instance
import io.reactivex.android.schedulers.AndroidSchedulers
import io.reactivex.schedulers.Schedulers
import kotlinx.android.synthetic.main.medical_archives_list_activity.*
/**
* 用户档案列表页面
* */
class MedicalArchivesListActivity : BaseActivity(), SwipeRefreshLayout.OnRefreshListener,
BaseQuickAdapter.RequestLoadMoreListener {
companion object {
private var currPage: Int = 1
private val pageSize: Int = 20
private lateinit var mEmptyView: View
private lateinit var mAdapter: MedicalUserArchivesAdapter
@JvmStatic
fun start(context: Context) {
val starter = Intent(context, MedicalArchivesListActivity::class.java)
context.startActivity(starter)
}
}
override fun layoutResId(): Int {
return R.layout.medical_archives_list_activity
}
override fun initDataAndEvent() {
mEmptyView =
LayoutInflater.from(this).inflate(R.layout.medical_list_empty_view, null, false)
var reLoad = mEmptyView.findViewById<View>(R.id.reLoad)
reLoad.setOnClickListener {
onRefresh()
}
mAdapter = MedicalUserArchivesAdapter()
rv_archives_list.layoutManager = LinearLayoutManager(
this@MedicalArchivesListActivity,
LinearLayoutManager.VERTICAL,
false
);
rv_archives_list.adapter = mAdapter
mAdapter.setLoadMoreView(LoadMoreView())
mAdapter.setOnLoadMoreListener(this@MedicalArchivesListActivity, rv_archives_list)
doctor_swipe_refresh_layout?.setOnRefreshListener(this)
doctor_swipe_refresh_layout?.setColorSchemeColors(
ContextCompat.getColor(this, R.color.platform_main_theme)
)
doctor_swipe_refresh_layout?.setProgressViewOffset(false, 0, 200)
mAdapter.setOnItemClickListener { baseQuickAdapter, view, position ->
}
add_archives.setOnClickListener {
//添加用户档案
MedicalAddNewArchivesActivity.start(this@MedicalArchivesListActivity)
}
iv_back.setOnClickListener {
finish()
}
currPage = 1
getPageList()
}
@SuppressLint("CheckResult")
private fun getPageList() {
//获取来源的专家
instance.getPageList(currPage, pageSize)
.subscribeOn(Schedulers.io())
.observeOn(AndroidSchedulers.mainThread())
.subscribe({ response ->
if ("200" == response.code) {
doctor_swipe_refresh_layout.isRefreshing = false
var list = response.data.rows
if (currPage == 1) {
//第一页数据
if (list != null && list.isNotEmpty()) {
if (list.size < pageSize) {
mAdapter.setNewData(list)
mAdapter.removeAllFooterView()
mAdapter.loadMoreEnd(false)
} else {
currPage++
mAdapter.setNewData(list)
mAdapter.removeAllFooterView()
mAdapter.loadMoreComplete()
}
} else {
mAdapter.loadMoreEnd(false)
mAdapter.emptyView = mEmptyView
}
} else {
//非第一页数据
if (list != null && list.isEmpty()) {
mAdapter.loadMoreEnd(false)
} else {
if (list.size < pageSize) {
mAdapter.addData(list)
mAdapter.loadMoreEnd(false)
} else {
mAdapter.addData(list)
if (currPage == response.data.totalPage) {
mAdapter.loadMoreEnd(false)
} else {
currPage++
mAdapter.loadMoreComplete()
}
}
}
}
}else{
doctor_swipe_refresh_layout.isRefreshing = false
mAdapter.loadMoreFail()
mAdapter.emptyView = mEmptyView
}
}, { e ->
doctor_swipe_refresh_layout.isRefreshing = false
mAdapter.loadMoreFail()
mAdapter.emptyView = mEmptyView
})
}
override fun onRefresh() {
}
override fun onLoadMoreRequested() {
}
}
\ No newline at end of file
package com.yidianling.medical.archives.adapter
import com.chad.library.adapter.base.BaseQuickAdapter
import com.chad.library.adapter.base.BaseViewHolder
import com.yidianling.im.R
import com.yidianling.medical.archives.bean.MedicalArchivesListBean
import com.yidianling.medical.archives.bean.MedicalUserArchivesBean
class MedicalUserArchivesAdapter :BaseQuickAdapter<MedicalArchivesListBean?, BaseViewHolder>(R.layout.medical_item_archives_list){
override fun convert(helper: BaseViewHolder, item: MedicalArchivesListBean?) {
helper.setText(R.id.name, item?.name)
helper.setText(R.id.sex, item?.genderName)
helper.setText(R.id.age, item?.birthday)
helper.setText(R.id.id_card, item?.idcardNo)
}
}
\ No newline at end of file
package com.yidianling.medical.archives.bean
data class MedicalArchivesListBean(
val birthday: String,
val createTime: String,
val gender: Int,
val genderName: String,
val idcardNo: String,
val idcardType: Int,
val isDeleted: Boolean,
val locationCityId: Int,
val locationCityName: String,
val merried: Int,
val name: String,
val patientId: Int,
val phone: String,
val relation: Int,
val userId: Int
)
\ No newline at end of file
package com.yidianling.medical.archives.bean
data class MedicalUserArchivesBean(
val pageNum: Int,
val pageSize: Int,
val rows: List<MedicalArchivesListBean>,
val totalCount: Int,
val totalPage: Int
)
package com.yidianling.medical.pic;
import android.content.Context;
import android.content.Intent;
import android.graphics.Bitmap;
import android.net.Uri;
import com.bumptech.glide.request.target.Target;
import com.ydl.ydl_image.module.GlideApp;
import com.ydl.ydlcommon.actions.imagepicker.ImageDownLoadCallBack;
import com.ydl.ydlcommon.utils.StringUtils;
import com.yidianling.common.tools.RxFileTool;
import java.io.File;
import java.io.FileNotFoundException;
import java.io.FileOutputStream;
import java.io.IOException;
/**
* Created by xiongyu on 2017/3/17.
*/
public class MedicalDownLoadImageService implements Runnable {
private String url;
private Context context;
private ImageDownLoadCallBack callBack;
private File currentFile;
public MedicalDownLoadImageService(Context context, String url, ImageDownLoadCallBack callBack) {
this.url = url;
this.callBack = callBack;
this.context = context;
}
@Override
public void run() {
File file = null;
Bitmap bitmap = null;
try {
// file = Glide.with(context)
// .load(url)
// .downloadOnly(Target.SIZE_ORIGINAL, Target.SIZE_ORIGINAL)
// .get();
bitmap = GlideApp.with(context)
.asBitmap()
.load(url)
.into(Target.SIZE_ORIGINAL, Target.SIZE_ORIGINAL)
.get();
if (bitmap != null) {
// 在这里执行图片保存方法
saveImageToGallery(context, bitmap);
}
} catch (Exception e) {
e.printStackTrace();
} finally {
// if (file != null) {
// callBack.onDownLoadSuccess(file);
// } else {
// callBack.onDownLoadFailed();
// }
if (bitmap != null && currentFile.exists()) {
callBack.onDownLoadSuccess(bitmap);
} else {
callBack.onDownLoadFailed();
}
}
}
public void saveImageToGallery(Context context, Bitmap bmp) {
// 首先保存图片
String fileName = "trend";
File appDir = new File(RxFileTool.getStorageDirectory(context), fileName);
if (!appDir.exists()) {
appDir.mkdirs();
}
fileName = StringUtils.UrlToString(url);
currentFile = new File(appDir, fileName);
FileOutputStream fos = null;
try {
fos = new FileOutputStream(currentFile);
bmp.compress(Bitmap.CompressFormat.JPEG, 100, fos);
fos.flush();
} catch (FileNotFoundException e) {
e.printStackTrace();
} catch (IOException e) {
e.printStackTrace();
} finally {
try {
if (fos != null) {
fos.close();
}
} catch (IOException e) {
e.printStackTrace();
}
}
// 其次把文件插入到系统图库
// try {
// MediaStore.Images.Media.insertImage(context.getContentResolver(),
// currentFile.getAbsolutePath(), fileName, null);
// } catch (FileNotFoundException e) {
// e.printStackTrace();
// }
// 最后通知图库更新
context.sendBroadcast(new Intent(Intent.ACTION_MEDIA_SCANNER_SCAN_FILE,
Uri.fromFile(new File(currentFile.getPath()))));
}
}
package com.yidianling.medical.pic
import com.ydl.ydlcommon.base.config.HttpConfig
class MedicalDynamicConstants {
companion object {
var ZHUANJIA = HttpConfig.YDL_H5+ "confideDetail?id="
var WWWXIADAN = HttpConfig.H5_URL+ "consult/commit/"
const val EACH_PAGE_DATA_NUM = 20
/**
* 保存图片成功
*/
const val REQUEST_SAVE_IMG_SUCCESS = 21004
/**
* 保存图片失败
*/
const val REQUEST_SAVE_IMG_FAIL = 21005
/**
* 发表动态从图库中获取图片
*/
const val REQUEST_CODE_GALLERY_TREN = 21006
/**
* 发表动态拍照
*/
const val REQUEST_CODE_CAMER_TREND = 21007
//从话题详情页或用户主页跳转到动态详情
const val JUMP_TREND_INFO = 30006
/**
* 发布动态选取的图片查看大图后删除
*/
const val PUBLISH_PIC_BROW = 21009
const val IMAGE_PICKER = 32001
/**
* 话题详情最新动态列表刷新
*/
const val TOPIC_DETAIL_NEW_REFRESH = 32101
/**
* 话题详情热门动态列表刷新
*/
const val TOPIC_DETAIL_HOT_REFRESH = 32102
open var TOPIC_DETAIL_H5 = HttpConfig.H5_URL+ "active/topic-members/"
open var TRENF_INFO_SHARE_H5 = HttpConfig.MH5_URL + "ask/"
const val PUBLISH_TYPE = "publish_type"
const val SILENCED_CODE = 1000020
const val BIND_PHONE_ACTION = "wxbind"
const val HELP_URL = "https://h2.yidianling.com/ex-help/96"
val BIND_PHONE = "为了及时接收消息通知,请立即绑定手机"
}
}
package com.yidianling.medical.widgets;
import com.yidianling.im.R;
public final class LoadMoreView extends com.chad.library.adapter.base.loadmore.LoadMoreView {
@Override public int getLayoutId() { return R.layout.im_nim_simple_load_more; }
@Override protected int getLoadingViewId() {
return R.id.load_more_loading_view;
}
@Override protected int getLoadFailViewId() {
return R.id.load_more_load_fail_view;
}
@Override protected int getLoadEndViewId() {
return R.id.load_more_load_end_view;
}
}
......@@ -2,7 +2,9 @@ package com.yidianling.uikit.custom.http
import com.ydl.ydlcommon.base.config.YDL_DOMAIN
import com.ydl.ydlcommon.base.config.YDL_DOMAIN_JAVA
import com.ydl.ydlcommon.base.config.YDL_DOMAIN_JAVA_URL
import com.ydl.ydlcommon.data.http.BaseAPIResponse
import com.yidianling.medical.archives.bean.MedicalUserArchivesBean
import com.yidianling.uikit.custom.http.response.*
import com.yidianling.uikit.custom.http.response.question.QuestionsInfoBean
import io.reactivex.Observable
......@@ -114,5 +116,25 @@ interface ServiceApi {
@Body body: RequestBody
): Observable<BaseAPIResponse<String>>
//医疗获取患者管理列表,支持分页
@GET("ydl-yiliao-api/api/client/user/patient/v1/getPageList")
@Headers(YDL_DOMAIN + YDL_DOMAIN_JAVA_URL)
fun getPageList(
@Query("pageNum") pageNum: Int,
@Query("pageSize") pageSize: Int
): Observable<BaseAPIResponse<MedicalUserArchivesBean>>
//医疗 创建问诊人
@POST("ydl-yiliao-api/api/client/user/patient/v1/create")
@Headers(YDL_DOMAIN + YDL_DOMAIN_JAVA_URL)
fun createArchives(
@Query("name") name: String,
@Query("idcardNo") idcardNo: String,
@Query("relation") relation: Int,
@Query("merried") merried: Int,
@Query("idcardType") idcardType: Int = 1
): Observable<BaseAPIResponse<Any>>
}
\ No newline at end of file
......@@ -4,6 +4,7 @@ import com.alibaba.fastjson.JSON
import com.ydl.ydlcommon.data.http.BaseAPIResponse
import com.ydl.ydlnet.YDLHttpUtils
import com.yidianling.im.http.ImRetrofitApi
import com.yidianling.medical.archives.bean.MedicalUserArchivesBean
import com.yidianling.uikit.custom.http.response.*
import com.yidianling.uikit.custom.http.response.question.QuestionsInfoBean
import io.reactivex.Observable
......@@ -180,4 +181,21 @@ class ServiceImpl private constructor() {
return YDLHttpUtils.obtainApi(ImRetrofitApi::class.java).batchSendCustomizeMessage(body)
}
/***获取患者管理列表*/
fun getPageList(
pageNum: Int,
pageSize: Int
): Observable<BaseAPIResponse<MedicalUserArchivesBean>> {
return YDLHttpUtils.obtainApi(ServiceApi::class.java).getPageList(pageNum, pageSize)
}
fun createArchives(
name: String,
idcardNo: String,
relation: Int,
merried: Int
): Observable<BaseAPIResponse<Any>> {
return YDLHttpUtils.obtainApi(ServiceApi::class.java).createArchives(name,idcardNo,relation,merried)
}
}
\ No newline at end of file
<?xml version="1.0" encoding="utf-8"?>
<shape xmlns:android="http://schemas.android.com/apk/res/android"
android:shape="rectangle">
<corners android:radius="8dp" />
<solid android:color="@color/medical_color_3464ec" />
</shape>
\ No newline at end of file
<?xml version="1.0" encoding="utf-8"?>
<shape xmlns:android="http://schemas.android.com/apk/res/android"
android:shape="rectangle">
<solid android:color="#1a3464ec"/>
<corners android:radius="4dp"/>
</shape>
\ No newline at end of file
<?xml version="1.0" encoding="utf-8"?>
<shape xmlns:android="http://schemas.android.com/apk/res/android"
android:shape="rectangle">
<stroke
android:width="1dp"
android:color="#ff3464ec" />
<corners android:radius="4dp" />
</shape>
\ No newline at end of file
<?xml version="1.0" encoding="utf-8"?>
<shape xmlns:android="http://schemas.android.com/apk/res/android"
android:shape="rectangle">
<solid android:color="#ff3464ec" />
<corners android:radius="8dp" />
</shape>
\ No newline at end of file
<?xml version="1.0" encoding="utf-8"?>
<shape xmlns:android="http://schemas.android.com/apk/res/android"
android:shape="rectangle">
<solid android:color="#ffd7dfea" />
<corners android:radius="8dp" />
</shape>
\ No newline at end of file
<?xml version="1.0" encoding="utf-8"?>
<shape xmlns:android="http://schemas.android.com/apk/res/android"
android:shape="rectangle">
<solid android:color="@color/medical_color_e7ecf0" />
<corners android:radius="2dp" />
</shape>
\ No newline at end of file
<?xml version="1.0" encoding="utf-8"?>
<shape xmlns:android="http://schemas.android.com/apk/res/android"
android:shape="rectangle">
<solid android:color="#fff2f5f8" />
<corners android:radius="8dp" />
</shape>
\ No newline at end of file
<?xml version="1.0" encoding="utf-8"?>
<shape xmlns:android="http://schemas.android.com/apk/res/android"
android:shape="rectangle">
<solid android:color="#fff2f5f8" />
<corners android:radius="4dp" />
</shape>
\ No newline at end of file
<?xml version="1.0" encoding="utf-8"?>
<shape xmlns:android="http://schemas.android.com/apk/res/android"
android:shape="rectangle">
<solid android:color="@color/white" />
<corners android:radius="8dp" />
</shape>
\ No newline at end of file
<?xml version="1.0" encoding="utf-8"?>
<selector xmlns:android="http://schemas.android.com/apk/res/android">
<item android:drawable="@drawable/medical_bg_1a3464ec" android:state_checked="true" />
<item android:drawable="@drawable/medical_bg_f2f5f8_4dp" android:state_checked="false" />
</selector>
\ No newline at end of file
<?xml version="1.0" encoding="utf-8"?>
<selector xmlns:android="http://schemas.android.com/apk/res/android">
<item android:color="@color/medical_color_3464ec" android:state_checked="true" />
<item android:color="#495C72" android:state_checked="false" />
</selector>
\ No newline at end of file
<?xml version="1.0" encoding="utf-8"?>
<shape xmlns:android="http://schemas.android.com/apk/res/android"
android:shape="rectangle">
<solid android:color="@color/medical_color_3464ec"/>
<corners android:radius="4dp"/>
</shape>
\ No newline at end of file
<?xml version="1.0" encoding="utf-8"?>
<shape xmlns:android="http://schemas.android.com/apk/res/android"
android:shape="rectangle">
<stroke android:width="1dp" android:color="#ffc0c9d4" />
<corners android:radius="4dp" />
</shape>
\ No newline at end of file
<?xml version="1.0" encoding="utf-8"?>
<selector xmlns:android="http://schemas.android.com/apk/res/android">
<item android:drawable="@drawable/radiobutton_background_checked" android:state_checked="true" />
<item android:drawable="@drawable/radiobutton_background_unchecked" android:state_checked="false" />
</selector>
\ No newline at end of file
<?xml version="1.0" encoding="utf-8"?>
<selector xmlns:android="http://schemas.android.com/apk/res/android">
<item android:color="@color/white" android:state_checked="true" />
<item android:color="#495C72" android:state_checked="false" />
</selector>
\ No newline at end of file
<?xml version="1.0" encoding="utf-8"?>
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:background="@color/platform_black">
<androidx.viewpager.widget.ViewPager
android:id="@+id/browse_pictures_vp"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:layout_alignParentTop="true"
android:layout_alignParentLeft="true"
android:layout_alignParentStart="true"/>
<View
android:id="@+id/browse_pictures_top_v"
android:layout_width="match_parent"
android:layout_height="20dp"
android:layout_alignParentTop="true"
android:background="#00ffffff"/>
<RelativeLayout
android:layout_width="match_parent"
android:layout_height="45dp"
android:layout_below="@+id/browse_pictures_top_v"
android:background="#00ffffff">
<ImageView
android:id="@+id/browse_pictures_back_iv"
android:layout_width="wrap_content"
android:layout_height="match_parent"
android:layout_alignParentLeft="true"
android:layout_centerVertical="true"
android:paddingLeft="15dp"
android:paddingRight="30dp"
android:src="@drawable/titlebar_arrow_left_white" />
<TextView
android:id="@+id/browse_pictures_num_tv"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_centerInParent="true"
android:text="1/9"
android:textColor="@color/white"
android:textSize="20sp" />
<TextView
android:id="@+id/browse_pictures_save_tv"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignParentRight="true"
android:layout_centerVertical="true"
android:paddingLeft="15dp"
android:paddingRight="15dp"
android:text="保存"
android:textColor="@color/white"
android:textSize="20sp" />
</RelativeLayout>
</RelativeLayout>
<?xml version="1.0" encoding="utf-8"?>
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:background="@color/medical_color_f0f4f8">
<androidx.appcompat.widget.Toolbar
android:id="@+id/toolbar"
android:layout_width="match_parent"
android:layout_height="56dp"
android:background="@color/white"
android:elevation="0dp"
android:gravity="bottom"
app:contentInsetStart="0dp"
app:layout_collapseMode="pin">
<RelativeLayout
android:layout_width="match_parent"
android:layout_height="wrap_content">
<TextView
android:id="@+id/tv_title"
android:layout_width="match_parent"
android:layout_height="56dp"
android:ellipsize="end"
android:gravity="center"
android:maxEms="10"
android:maxLines="1"
android:text="用户档案"
android:textColor="@color/medical_color_10233a"
android:textSize="18sp"
android:textStyle="bold" />
<ImageView
android:id="@+id/iv_back"
android:layout_width="wrap_content"
android:layout_height="56dp"
android:paddingStart="16dp"
android:paddingEnd="20dp"
android:src="@mipmap/medical_icon_title_back" />
</RelativeLayout>
</androidx.appcompat.widget.Toolbar>
<androidx.swiperefreshlayout.widget.SwipeRefreshLayout
android:id="@+id/doctor_swipe_refresh_layout"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:layout_below="@id/toolbar"
android:layout_marginBottom="98dp">
<androidx.recyclerview.widget.RecyclerView
android:id="@+id/rv_archives_list"
android:layout_width="match_parent"
android:layout_height="match_parent" />
</androidx.swiperefreshlayout.widget.SwipeRefreshLayout>
<LinearLayout
android:id="@+id/ll_add"
android:layout_width="match_parent"
android:layout_height="98dp"
android:layout_alignParentBottom="true"
android:background="@color/white"
android:orientation="horizontal"
android:padding="16dp">
<TextView
android:id="@+id/add_archives"
android:layout_width="match_parent"
android:layout_height="48dp"
android:background="@drawable/medical_bg_3464ec_8dp"
android:gravity="center"
android:text="添加"
android:textColor="@color/white"
android:textSize="16sp"
android:textStyle="bold" />
</LinearLayout>
</RelativeLayout>
\ No newline at end of file
<?xml version="1.0" encoding="utf-8"?>
<androidx.constraintlayout.widget.ConstraintLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginLeft="16dp"
android:layout_marginTop="16dp"
android:layout_marginRight="16dp"
android:background="@drawable/medical_bg_ffffff_8dp"
android:padding="16dp">
<TextView
android:id="@+id/name"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:textColor="@color/medical_color_10233a"
android:textSize="18sp"
android:textStyle="bold"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toTopOf="parent"
tools:text="萨芬" />
<View
android:id="@+id/name_right"
android:layout_width="1dp"
android:layout_height="12dp"
android:layout_marginStart="8dp"
android:background="@color/medical_color_c0c9d4"
app:layout_constraintBottom_toBottomOf="@id/name"
app:layout_constraintStart_toEndOf="@id/name"
app:layout_constraintTop_toTopOf="@id/name" />
<TextView
android:id="@+id/sex"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginStart="8dp"
android:textColor="@color/medical_color_10233a"
android:textSize="18sp"
android:textStyle="bold"
app:layout_constraintBaseline_toBaselineOf="@id/name"
app:layout_constraintStart_toEndOf="@id/name_right"
tools:text="男" />
<View
android:id="@+id/sex_right"
android:layout_width="1dp"
android:layout_height="12dp"
android:layout_marginStart="8dp"
android:background="@color/medical_color_c0c9d4"
app:layout_constraintBottom_toBottomOf="@id/name"
app:layout_constraintStart_toEndOf="@id/sex"
app:layout_constraintTop_toTopOf="@id/name" />
<TextView
android:id="@+id/age"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginStart="8dp"
android:textColor="@color/medical_color_10233a"
android:textSize="18sp"
android:textStyle="bold"
app:layout_constraintBaseline_toBaselineOf="@id/name"
app:layout_constraintStart_toEndOf="@id/sex_right"
tools:text="20岁" />
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginStart="12dp"
android:background="@drawable/medical_bg_e7ecf0_2dp"
android:paddingLeft="4dp"
android:paddingTop="2dp"
android:paddingRight="4dp"
android:paddingBottom="1dp"
android:text="已认证"
android:textColor="@color/medical_color_8595a9"
android:textSize="12sp"
app:layout_constraintBaseline_toBaselineOf="@id/name"
app:layout_constraintStart_toEndOf="@id/age" />
<TextView
android:id="@+id/id_card"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginTop="16dp"
android:textColor="@color/medical_color_0c1d31"
android:textSize="16sp"
app:layout_constraintLeft_toLeftOf="@id/name"
app:layout_constraintTop_toBottomOf="@id/name"
tools:text="340*************3456" />
<LinearLayout
android:id="@+id/ll_edit"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:background="@drawable/medical_bg_3464ec_4dp"
android:orientation="horizontal"
android:paddingLeft="8dp"
android:paddingTop="6dp"
android:gravity="center_vertical"
android:paddingRight="8dp"
android:paddingBottom="5dp"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintRight_toRightOf="parent"
app:layout_constraintTop_toTopOf="parent">
<ImageView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:src="@mipmap/medical_blue_edit_icon" />
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginStart="4dp"
android:text="编辑"
android:textColor="#ff3464ec"
android:textSize="12sp" />
</LinearLayout>
</androidx.constraintlayout.widget.ConstraintLayout>
\ No newline at end of file
<?xml version="1.0" encoding="utf-8"?>
<androidx.constraintlayout.widget.ConstraintLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
android:layout_width="match_parent"
android:layout_height="match_parent">
<TextView
android:id="@+id/net_error"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginTop="20dp"
android:text="网络异常,请稍后再试"
android:textColor="@color/medical_color_8595a9"
android:textSize="14sp"
app:layout_constraintBottom_toTopOf="@id/reLoad"
app:layout_constraintLeft_toLeftOf="parent"
app:layout_constraintVertical_chainStyle="packed"
app:layout_constraintRight_toRightOf="parent"
app:layout_constraintTop_toTopOf="parent" />
<TextView
android:id="@+id/reLoad"
android:layout_width="120dp"
android:layout_height="48dp"
android:gravity="center"
android:layout_marginTop="20dp"
android:text="重新加载"
android:background="@drawable/medical_bg_3464ec_8dp"
android:textColor="@color/white"
android:textSize="14sp"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintLeft_toLeftOf="parent"
app:layout_constraintRight_toRightOf="parent"
app:layout_constraintTop_toBottomOf="@id/net_error" />
</androidx.constraintlayout.widget.ConstraintLayout>
\ No newline at end of file
......@@ -63,4 +63,11 @@
<color name="color_bfbfbf">#bfbfbf</color>
<color name="color_f8f8f8">#f8f8f8</color>
<color name="color_c2e7ff">#c2e7ff</color>
<color name="medical_color_10233a">#10233A</color>
<color name="medical_color_3464ec">#3464EC</color>
<color name="medical_color_8595a9">#8595A9</color>
<color name="medical_color_0c1d31">#0c1d31</color>
<color name="medical_color_f0f4f8">#F0F4F8</color>
<color name="medical_color_c0c9d4">#C0C9D4</color>
<color name="medical_color_e7ecf0">#E7ECF0</color>
</resources>
<?xml version="1.0" encoding="utf-8"?>
<resources>
</resources>
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