929 lines
30 KiB
Java
929 lines
30 KiB
Java
package cn.shangyu.gdxzExpert.activity;
|
||
|
||
import android.annotation.SuppressLint;
|
||
import android.content.Intent;
|
||
import android.os.Handler;
|
||
import android.os.Message;
|
||
import android.util.Log;
|
||
import android.view.MotionEvent;
|
||
import android.view.View;
|
||
import android.view.View.OnClickListener;
|
||
import android.view.View.OnTouchListener;
|
||
import android.view.ViewGroup;
|
||
import android.widget.AdapterView;
|
||
import android.widget.AdapterView.OnItemClickListener;
|
||
import android.widget.BaseAdapter;
|
||
import android.widget.Button;
|
||
import android.widget.ImageView;
|
||
import android.widget.LinearLayout;
|
||
import android.widget.ListView;
|
||
import android.widget.RelativeLayout;
|
||
import android.widget.ScrollView;
|
||
import android.widget.TextView;
|
||
|
||
import com.google.gson.Gson;
|
||
import com.google.gson.JsonSyntaxException;
|
||
import com.gyf.immersionbar.ImmersionBar;
|
||
import com.nostra13.universalimageloader.core.ImageLoader;
|
||
|
||
import java.util.ArrayList;
|
||
import java.util.HashMap;
|
||
import java.util.List;
|
||
import java.util.Map;
|
||
|
||
import cn.shangyu.gdxzExpert.R;
|
||
import cn.shangyu.gdxzExpert.application.BaseApplication;
|
||
import cn.shangyu.gdxzExpert.base.BaseActivity;
|
||
import cn.shangyu.gdxzExpert.bean.ExpertDetail;
|
||
import cn.shangyu.gdxzExpert.http.OnCallBackFromNet;
|
||
import cn.shangyu.gdxzExpert.polyvplayer.VideoDetailPolyvPlayerActivity;
|
||
import cn.shangyu.gdxzExpert.ui.CustomProgressDialog;
|
||
import cn.shangyu.gdxzExpert.utils.ImageOptions;
|
||
import cn.shangyu.gdxzExpert.utils.LogUtil;
|
||
import cn.shangyu.gdxzExpert.utils.SetListViewHeightBasedOnChildrenUtil;
|
||
import cn.shangyu.gdxzExpert.utils.SharePrefUtil;
|
||
import cn.shangyu.gdxzExpert.utils.StringUtil;
|
||
import cn.shangyu.gdxzExpert.utils.ToastUtil;
|
||
import cn.shangyu.gdxzExpert.utils.UIUtils;
|
||
import cn.shangyu.gdxzExpert.utils.Url;
|
||
import cn.shangyu.gdxzExpert.view.MyScrollView;
|
||
import cn.shangyu.gdxzExpert.widget.ECAlertDialog;
|
||
import cn.shangyu.gdxzExpert.widget.LoadingPage.ResultState;
|
||
|
||
/**
|
||
* @author gcs------------我的专家详情
|
||
*/
|
||
public class ExpertDetailActivity extends BaseActivity implements
|
||
OnClickListener,OnCallBackFromNet {
|
||
|
||
private View view;
|
||
private Intent intent;
|
||
private String uuid;// 专家的UUID
|
||
private CustomProgressDialog pd;
|
||
private Button bt_add_expert;// 添加随诊专家
|
||
private Button bt_send_flower;// 送花
|
||
private ImageView bt_telephone;// 电话咨询
|
||
private ImageView bt_appointment;// 门诊预约
|
||
private ImageView bt_month_payment;// 包月服务
|
||
private ImageView iv_photo;// 专家头像
|
||
private TextView tv_expert_desc1;// 专家描述
|
||
private TextView tv_expert_desc2;// 专家描述
|
||
private TextView tv_name;// 姓名
|
||
private TextView tv_job, tv_conslut_num;// 职称 公益咨询数量
|
||
private TextView tv_hospital;// 坐镇医院
|
||
private TextView tv_specialities;// 专长
|
||
private TextView tv_patient_num;// 服务患者术
|
||
private TextView tv_flower_num;// 送花数
|
||
private ImageView iv_man_or_woman;// 男女
|
||
private ImageView iv_is_star;// 是否是名医0不是1是
|
||
private TextView tv_phone_zixun;// 电话咨询
|
||
private TextView tv_menzhen_zixun;// 门诊预约
|
||
private TextView tv_month_server;// 包月服务
|
||
private boolean isFriend;// true 是随访关系
|
||
private String relation;// 0 没有,1vip
|
||
private Gson gson;
|
||
private ExpertDetail expertDetail;
|
||
private ECAlertDialog buildAlert;
|
||
private RelativeLayout mDoctor_visit;// 专家出诊信息
|
||
protected static final int GET_DATA_SUCCESS = 100; // 请求数据成功的结果码
|
||
@SuppressLint("HandlerLeak")
|
||
Handler handler = new Handler() {
|
||
public void handleMessage(Message msg) {
|
||
|
||
switch (msg.what) {
|
||
case GET_DATA_SUCCESS:
|
||
setData();
|
||
break;
|
||
}
|
||
|
||
}
|
||
|
||
};
|
||
private LinearLayout ll_weight_layout1;
|
||
private LinearLayout ll_weight_layout2;
|
||
private RelativeLayout rl_weight_shipin,rl_weight_dongtai;
|
||
private ListView lv_gandan_dongtai,lv_gandan_video;
|
||
private MyScrollView sc_my;
|
||
private ScrollView sc_parent;
|
||
|
||
/**
|
||
* @author Administrator
|
||
* @date 2015-10-20 上午9:05:24
|
||
* <p/>
|
||
* 功能说明:设置专家详数据
|
||
* <p/>
|
||
* method
|
||
*/
|
||
private void setData() {
|
||
// TODO Auto-generated method stub
|
||
|
||
ImageLoader.getInstance().displayImage(
|
||
Url.urlHtml + expertDetail.getData().getPhoto(), iv_photo,
|
||
ImageOptions.getImageOptions(R.drawable.expert_img));
|
||
SharePrefUtil.saveString(ExpertDetailActivity.this, "ex_photo",
|
||
expertDetail.getData().getPhoto());
|
||
String intro = expertDetail.getData().getIntro();
|
||
// LogUtils.e("intro.length()==" + intro.length());
|
||
if (StringUtil.isEmpty(intro)) {
|
||
ll_weight_layout1.setVisibility(View.GONE);
|
||
ll_weight_layout2.setVisibility(View.VISIBLE);
|
||
tv_expert_desc2.setText(getResources().getString(R.string.zanwu));
|
||
} else {
|
||
if (intro.length() < 100) {
|
||
ll_weight_layout1.setVisibility(View.GONE);
|
||
ll_weight_layout2.setVisibility(View.VISIBLE);
|
||
tv_expert_desc2.setText(expertDetail.getData().getIntro());
|
||
} else {
|
||
ll_weight_layout1.setVisibility(View.VISIBLE);
|
||
ll_weight_layout2.setVisibility(View.GONE);
|
||
tv_expert_desc1.setText(expertDetail.getData().getIntro());
|
||
}
|
||
}
|
||
tv_name.setText(expertDetail.getData().getRealName());
|
||
tv_job.setText(expertDetail.getData().getPositionName());
|
||
tv_hospital.setText(expertDetail.getData().getHospitalName());
|
||
tv_specialities.setText(expertDetail.getData().getOfficeName());
|
||
tv_patient_num.setText(expertDetail.getExpertApplyNum()+"");
|
||
tv_flower_num.setText(expertDetail.getSendFlowerNum()+"");
|
||
tv_name.setText(expertDetail.getData().getRealName());
|
||
tv_conslut_num.setText(expertDetail.getConsultTotalNum()+"");
|
||
|
||
if (isFriend) {
|
||
bt_add_expert.setText("解除随访专家");
|
||
}
|
||
|
||
if (expertDetail.getData().getSex() == 0) {// 0男1女
|
||
iv_man_or_woman.setBackgroundResource(R.drawable.new_man);
|
||
} else if (expertDetail.getData().getSex() == 1) {
|
||
iv_man_or_woman.setBackgroundResource(R.drawable.new_woman);
|
||
}
|
||
|
||
if (expertDetail.getData().getIsStar()==0) {
|
||
iv_is_star.setVisibility(View.GONE);
|
||
} else {
|
||
iv_is_star.setVisibility(View.VISIBLE);
|
||
}
|
||
|
||
/**
|
||
* 医生视频
|
||
* */
|
||
if(expertDetail.getVideoResTop2().size() > 0){
|
||
lv_gandan_video.setVisibility(View.VISIBLE);
|
||
rl_weight_shipin.setVisibility(View.VISIBLE);
|
||
if(expertDetail.getVideoResTop2().size() == 1){
|
||
GandanVideoListAdapter adapter = new GandanVideoListAdapter(expertDetail.getVideoResTop2());
|
||
lv_gandan_video.setAdapter(adapter);
|
||
|
||
|
||
}else{
|
||
List<ExpertDetail.VideoResTop2Bean> video = new ArrayList<>();
|
||
for(int i = 0;i<2;i++){
|
||
video.add(expertDetail.getVideoResTop2().get(i));
|
||
}
|
||
|
||
GandanVideoListAdapter adapter = new GandanVideoListAdapter(video);
|
||
lv_gandan_video.setAdapter(adapter);
|
||
SetListViewHeightBasedOnChildrenUtil.SetListViewHeightBasedOnChildren(lv_gandan_video,adapter);
|
||
}
|
||
|
||
}else{
|
||
lv_gandan_video.setVisibility(View.GONE);
|
||
rl_weight_shipin.setVisibility(View.GONE);
|
||
}
|
||
/**
|
||
* 医生动态
|
||
* */
|
||
|
||
|
||
if(expertDetail.getDongTaiResTop2().size() > 0){
|
||
lv_gandan_dongtai.setVisibility(View.VISIBLE);
|
||
rl_weight_dongtai.setVisibility(View.VISIBLE);
|
||
if(expertDetail.getDongTaiResTop2().size() == 1){
|
||
GandanDongtaiListAdapter adapter = new GandanDongtaiListAdapter(expertDetail.getDongTaiResTop2());
|
||
lv_gandan_dongtai.setAdapter(adapter);
|
||
|
||
}else{
|
||
List<ExpertDetail.DongTaiResTop2Bean> video = new ArrayList<>();
|
||
for(int i = 0;i<2;i++){
|
||
video.add(expertDetail.getDongTaiResTop2().get(i));
|
||
}
|
||
|
||
GandanDongtaiListAdapter adapter = new GandanDongtaiListAdapter(video);
|
||
lv_gandan_dongtai.setAdapter(adapter);
|
||
SetListViewHeightBasedOnChildrenUtil.SetListViewHeightBasedOnChildren(lv_gandan_dongtai,adapter);
|
||
}
|
||
|
||
}else{
|
||
lv_gandan_dongtai.setVisibility(View.GONE);
|
||
rl_weight_dongtai.setVisibility(View.GONE);
|
||
}
|
||
|
||
|
||
|
||
/**
|
||
* VIP服务
|
||
* */
|
||
// 当没有开启服务是图片为灰色
|
||
// if (expertDetail.data.callDisable.equals("Y")) {
|
||
// bt_telephone.setImageResource(R.drawable.new_expert_service_phone);
|
||
// } else {
|
||
// if (expertDetail.data.callIsEnable.equals("0")) {
|
||
// bt_telephone
|
||
// .setImageResource(R.drawable.new_expert_service_phone);
|
||
// }
|
||
// }
|
||
//
|
||
// if (expertDetail.data.clinicDisable.equals("Y")) {
|
||
// bt_appointment
|
||
// .setImageResource(R.drawable.new_expert_service_clinic);
|
||
// } else {
|
||
// if (expertDetail.data.clinicIsEnable.equals("0")) {
|
||
// bt_appointment
|
||
// .setImageResource(R.drawable.new_expert_service_clinic);
|
||
// }
|
||
// }
|
||
//
|
||
// if (expertDetail.data.monthDisable.equals("Y")) {
|
||
// bt_month_payment
|
||
// .setImageResource(R.drawable.new_expert_service_vip);
|
||
// } else {
|
||
// if (expertDetail.data.monthIsEnable.equals("0")) {
|
||
// bt_month_payment
|
||
// .setImageResource(R.drawable.new_expert_service_vip);
|
||
// }
|
||
// }
|
||
|
||
// if (expertDetail.data.callIsEnable.equals("0")) {
|
||
// bt_telephone.setImageResource(R.drawable.new_expert_service_phone);
|
||
// }
|
||
// if (expertDetail.data.clinicIsEnable.equals("0")) {
|
||
// bt_appointment.setImageResource(R.drawable.new_expert_service_clinic);
|
||
// }
|
||
// if (expertDetail.data.monthIsEnable.equals("0")) {
|
||
// bt_month_payment.setImageResource(R.drawable.new_expert_service_vip);
|
||
// }
|
||
|
||
}
|
||
|
||
@Override
|
||
public void setTitle() {
|
||
top_title.setText("专家详情");
|
||
top_back_layout.setOnClickListener(this);
|
||
|
||
}
|
||
|
||
@Override
|
||
public View onCreateSuccessedView() {
|
||
ImmersionBar.with(this).keyboardEnable(true).statusBarDarkFont(true).titleBar(mToolbar).init();
|
||
view = View.inflate(ExpertDetailActivity.this,
|
||
R.layout.activity_doctor_detail, null);
|
||
initIntent();
|
||
initView();
|
||
initListener();
|
||
requestData();
|
||
return view;
|
||
}
|
||
|
||
/**
|
||
* 初始化intent传回的数据
|
||
*/
|
||
private void initIntent() {
|
||
// TODO Auto-generated method stub
|
||
|
||
intent = getIntent();
|
||
uuid = intent.getStringExtra("uuid");
|
||
Log.e("TGGG", "uuid = "+uuid);
|
||
}
|
||
|
||
@Override
|
||
protected void onResume() {
|
||
// TODO Auto-generated method stub
|
||
super.onResume();
|
||
if (BaseApplication.refreshExpertDetial) {
|
||
requestData();
|
||
BaseApplication.refreshExpertDetial = false;
|
||
|
||
}
|
||
}
|
||
|
||
/**
|
||
* 初始化控件
|
||
*/
|
||
private void initView() {
|
||
mDoctor_visit = (RelativeLayout) view.findViewById(R.id.rl_visit);
|
||
bt_add_expert = (Button) view.findViewById(R.id.bt_add_expert);
|
||
bt_send_flower = (Button) view.findViewById(R.id.bt_send_flower);
|
||
bt_telephone = (ImageView) view.findViewById(R.id.bt_telephone);
|
||
bt_appointment = (ImageView) view.findViewById(R.id.bt_appointment);
|
||
bt_month_payment = (ImageView) view.findViewById(R.id.bt_month_payment);
|
||
bt_telephone.setOnClickListener(this);
|
||
bt_appointment.setOnClickListener(this);
|
||
bt_month_payment.setOnClickListener(this);
|
||
iv_photo = view.findViewById(R.id.iv_photo);
|
||
|
||
tv_name = (TextView) view.findViewById(R.id.tv_name);
|
||
tv_job = (TextView) view.findViewById(R.id.tv_job);
|
||
tv_conslut_num = (TextView) view.findViewById(R.id.tv_conslut_num);
|
||
tv_hospital = (TextView) view.findViewById(R.id.tv_hospital);
|
||
tv_specialities = (TextView) view.findViewById(R.id.tv_specialities);
|
||
tv_patient_num = (TextView) view.findViewById(R.id.tv_patient_num);
|
||
tv_flower_num = (TextView) view.findViewById(R.id.tv_flower_num);
|
||
tv_phone_zixun = (TextView) view.findViewById(R.id.tv_phone_zixun);
|
||
tv_menzhen_zixun = (TextView) view.findViewById(R.id.tv_menzhen_zixun);
|
||
tv_month_server = (TextView) view.findViewById(R.id.tv_month_server);
|
||
sc_my = (MyScrollView) view.findViewById(R.id.sc_my);
|
||
sc_parent = (ScrollView) view.findViewById(R.id.sc_parent);
|
||
|
||
sc_parent.setOnTouchListener(new OnTouchListener() {
|
||
|
||
@Override
|
||
public boolean onTouch(View v, MotionEvent event) {
|
||
// TODO Auto-generated method stub
|
||
sc_my.requestDisallowInterceptTouchEvent(false);
|
||
return false;
|
||
}
|
||
});
|
||
sc_my.setOnTouchListener(new OnTouchListener() {
|
||
|
||
@Override
|
||
public boolean onTouch(View v, MotionEvent event) {
|
||
// TODO Auto-generated method stub
|
||
|
||
sc_parent.requestDisallowInterceptTouchEvent(true);
|
||
return false;
|
||
}
|
||
});
|
||
|
||
ll_weight_layout1 = (LinearLayout) view
|
||
.findViewById(R.id.ll_weight_layout1);
|
||
ll_weight_layout2 = (LinearLayout) view
|
||
.findViewById(R.id.ll_weight_layout2);
|
||
tv_expert_desc1 = (TextView) view.findViewById(R.id.tv_expert_desc1);
|
||
tv_expert_desc2 = (TextView) view.findViewById(R.id.tv_expert_desc2);
|
||
|
||
iv_man_or_woman = (ImageView) view.findViewById(R.id.iv_man_or_woman);
|
||
iv_is_star = (ImageView) view.findViewById(R.id.iv_is_star);
|
||
|
||
rl_weight_shipin = (RelativeLayout) view.findViewById(R.id.rl_weight_shipin);
|
||
rl_weight_dongtai = (RelativeLayout) view.findViewById(R.id.rl_weight_dongtai);
|
||
|
||
lv_gandan_dongtai = (ListView) view.findViewById(R.id.lv_gandan_dongtai);
|
||
lv_gandan_video = (ListView) view.findViewById(R.id.lv_gandan_video);
|
||
|
||
}
|
||
|
||
/**
|
||
* @author Administrator
|
||
* @date 2015-10-19 下午1:50:16
|
||
* <p/>
|
||
* 功能说明:初始化监听器
|
||
* <p/>
|
||
* method
|
||
*/
|
||
private void initListener() {
|
||
// TODO Auto-generated method stub
|
||
mDoctor_visit.setOnClickListener(this);
|
||
bt_add_expert.setOnClickListener(this);
|
||
bt_send_flower.setOnClickListener(this);
|
||
bt_telephone.setOnClickListener(this);
|
||
bt_appointment.setOnClickListener(this);
|
||
bt_month_payment.setOnClickListener(this);
|
||
iv_is_star.setOnClickListener(this);
|
||
rl_weight_dongtai.setOnClickListener(this);
|
||
rl_weight_shipin.setOnClickListener(this);
|
||
|
||
lv_gandan_video.setOnItemClickListener(new OnItemClickListener() {
|
||
|
||
@Override
|
||
public void onItemClick(AdapterView<?> parent, View view,
|
||
int position, long id) {
|
||
// TODO Auto-generated method stub
|
||
Intent intentvideo1 = VideoDetailPolyvPlayerActivity.newIntent(ExpertDetailActivity.this, VideoDetailPolyvPlayerActivity.PlayMode.portrait,"");
|
||
// 在线视频和下载的视频播放的时候只显示播放器窗口,用该参数来控制
|
||
intentvideo1.putExtra("startNow", false);
|
||
intentvideo1.putExtra("isVlmsOnline", false);
|
||
intentvideo1.putExtra("url", expertDetail.getVideoResTop2().get(position)
|
||
.getPath());
|
||
intentvideo1.putExtra("uuid", expertDetail.getVideoResTop2().get(position)
|
||
.getUuid());
|
||
intentvideo1.putExtra("title",expertDetail.getVideoResTop2().get(position)
|
||
.getName());
|
||
intentvideo1.putExtra("readnum", expertDetail.getVideoResTop2().get(position)
|
||
.getReadnum());
|
||
intentvideo1.putExtra("imgpath",expertDetail.getVideoResTop2().get(position)
|
||
.getImgpath());
|
||
intentvideo1.putExtra("public_name",
|
||
expertDetail.getVideoResTop2().get(position).getPublic_name());
|
||
startActivity(intentvideo1);
|
||
|
||
|
||
}
|
||
});
|
||
|
||
|
||
|
||
lv_gandan_dongtai.setOnItemClickListener(new OnItemClickListener() {
|
||
|
||
@Override
|
||
public void onItemClick(AdapterView<?> arg0, View arg1,
|
||
int position, long arg3) {
|
||
/* Intent intent = new Intent(ExpertDetailActivity.this, GDEventDetailActivity.class);
|
||
intent.putExtra("newsTitle", expertDetail.getDongTaiResTop2().get(position).getTITLE());
|
||
if (expertDetail.getDongTaiResTop2().get(position).getEditType()==1) {
|
||
intent.putExtra("url", Url.urlHtml + expertDetail.getDongTaiResTop2().get(position).getPath());
|
||
}else {
|
||
intent.putExtra("url",expertDetail.getDongTaiResTop2().get(position).getPath());
|
||
}
|
||
intent.putExtra("summary", expertDetail.getDongTaiResTop2().get(position).getAuthor());
|
||
intent.setType("dongtai");
|
||
startActivity(intent);*/
|
||
|
||
Intent intent = new Intent(ExpertDetailActivity.this, NewsDetailActivity.class);
|
||
if (expertDetail.getDongTaiResTop2().get(position).getEditType()==1) {
|
||
intent.putExtra("url", Url.urlHtml + expertDetail.getDongTaiResTop2().get(position).getPath());
|
||
}else {
|
||
intent.putExtra("url",expertDetail.getDongTaiResTop2().get(position).getPath());
|
||
}
|
||
// intent.putExtra("title", news.title);
|
||
intent.putExtra("title", "动态详情");
|
||
intent.putExtra("summary", "名院名科名医,来肝胆相照做\"名\"星");
|
||
intent.putExtra("flag", 1);
|
||
startActivity(intent);
|
||
|
||
}
|
||
});
|
||
|
||
}
|
||
|
||
/**
|
||
* @author Administrator
|
||
* @date 2015-10-19 下午1:51:31
|
||
* <p/>
|
||
* 功能说明:请求数据
|
||
* <p/>
|
||
* method
|
||
*/
|
||
private void requestData() {
|
||
// TODO Auto-generated method stub
|
||
showProgressDialog("加载中");
|
||
Map<String, Object> param = new HashMap<String, Object>();
|
||
param.put("expert_uuid", uuid);
|
||
|
||
sendJsonPostParamtoNet(Url.expertDetail, param, 01, this);
|
||
|
||
// pd = new CustomProgressDialog(this, "请稍候");
|
||
// pd.show();
|
||
// new Thread() {
|
||
// public void run() {
|
||
// try {
|
||
// List<BasicNameValuePair> parameters = new ArrayList<BasicNameValuePair>();
|
||
// BasicNameValuePair valuePair = new BasicNameValuePair(
|
||
// "expert_uuid", uuid);
|
||
//
|
||
// parameters.add(valuePair);
|
||
//
|
||
// HttpResult httpResult = HttpHelper.post(Url.expertDetail,
|
||
// parameters);// 请求网络
|
||
// String result = httpResult.getString();// str为服务器返回的json串
|
||
// Log.e("TGGG", "result = "+result);
|
||
// if (result == null) {
|
||
//
|
||
// ToastUtil.showMessage("获取专家信息失败,请重试");
|
||
// pd.dismiss();
|
||
// return;
|
||
// }
|
||
// Message msg = Message.obtain();
|
||
// msg.obj = result;
|
||
// msg.what = 2;
|
||
// handler.sendMessage(msg);
|
||
//
|
||
// } catch (Exception e) {
|
||
// // TODO Auto-generated catch block
|
||
// e.printStackTrace();
|
||
// pd.dismiss();
|
||
// ToastUtil.showMessage("获取信息失败,请重试");
|
||
// }
|
||
// }
|
||
//
|
||
// ;
|
||
// }.start();
|
||
}
|
||
|
||
@Override
|
||
public ResultState onLoad() {
|
||
return ResultState.STATE_SUCCESSED;
|
||
}
|
||
|
||
/**
|
||
* 集中处理按钮点击事件
|
||
*/
|
||
@Override
|
||
public void onClick(View v) {
|
||
|
||
switch (v.getId()) {
|
||
//更多视频
|
||
case R.id.rl_weight_shipin:
|
||
if (expertDetail.getGandan_expert_uuid()!=null) {
|
||
Intent Videointent = new Intent(this, MoreVideoActivity.class);
|
||
Videointent.putExtra("uuid", expertDetail.getGandan_expert_uuid());
|
||
Videointent.putExtra("title", "医生视频");
|
||
startActivity(Videointent);
|
||
}
|
||
|
||
break;
|
||
//更多动态
|
||
case R.id.rl_weight_dongtai:
|
||
if (expertDetail.getGandan_expert_uuid()!=null) {
|
||
Intent intent3 = new Intent(this, MoreDongtaiActivity.class);
|
||
intent3.putExtra("hospitalUuid", expertDetail.getGandan_expert_uuid());
|
||
intent3.putExtra("title","医生动态" );
|
||
startActivity(intent3);
|
||
}
|
||
|
||
break;
|
||
|
||
|
||
|
||
case R.id.rl_visit:
|
||
// Intent intVisit = new Intent(getApplicationContext(),
|
||
// VisitExpertActivity.class);
|
||
// intVisit.putExtra("detailUuid", uuid);
|
||
// startActivity(intVisit);
|
||
break;
|
||
case R.id.iv_is_star:
|
||
// Intent star = new Intent(getApplicationContext(),
|
||
// StarDoctorActivity.class);
|
||
//
|
||
// startActivity(star);
|
||
break;
|
||
case R.id.top_back_layout:
|
||
// 返回按键
|
||
|
||
finish();
|
||
break;
|
||
case R.id.bt_add_expert:
|
||
// 添加随访组专家
|
||
// LogUtils.v("添加随访组医生");
|
||
// try {
|
||
// if (isFriend) {
|
||
//
|
||
// buildAlert = ECAlertDialog.buildAlert(this, "您确定解除随访专家?",
|
||
// "取消", "确定", new DialogInterface.OnClickListener() {
|
||
//
|
||
// @Override
|
||
// public void onClick(DialogInterface dialog,
|
||
// int which) {// 取消
|
||
// // TODO Auto-generated method stub
|
||
// buildAlert.dismiss();
|
||
// }
|
||
//
|
||
// }, new DialogInterface.OnClickListener() {// 下载升级
|
||
//
|
||
// @Override
|
||
// public void onClick(DialogInterface dialog,
|
||
// int which) {
|
||
// // TODO Auto-generated method stub
|
||
// buildAlert.dismiss();
|
||
// remove();
|
||
// }
|
||
// });
|
||
// buildAlert.setCanceledOnTouchOutside(false);
|
||
// buildAlert.show();
|
||
//
|
||
// } else if (expertDetail.data == null) {
|
||
// ToastUtil.showMessage("专家信息为空,不可添加随访");
|
||
// return;
|
||
// } else {
|
||
// if (expertDetail.data == null) {
|
||
// ToastUtil.showMessage("专家信息为空,不可添加随访专家");
|
||
// return;
|
||
// }
|
||
// Intent addexpertintent = new Intent(this,
|
||
// AddExpertActivity.class);
|
||
// addexpertintent.putExtra("uuid", uuid);
|
||
// addexpertintent.putExtra("photo", expertDetail.data.photo);
|
||
// addexpertintent.putExtra("realName",
|
||
// expertDetail.data.realName);
|
||
//
|
||
// startActivity(addexpertintent);
|
||
// }
|
||
//
|
||
// } catch (Exception e) {
|
||
// // TODO: handle exception
|
||
// ToastUtil.showMessage("服务器异常");
|
||
// }
|
||
|
||
break;
|
||
case R.id.bt_send_flower:
|
||
// 我要送花
|
||
|
||
// try {
|
||
// // Intent sendFlowerintent = new Intent(this,
|
||
// // SendFlowerActivity.class);
|
||
// Intent sendFlowerintent = new Intent(this,
|
||
// SendFlowerNewActivity.class);
|
||
// sendFlowerintent.putExtra("uuid", uuid);
|
||
// if (expertDetail.data == null) {
|
||
// ToastUtil.showMessage("专家信息为空,不可送花");
|
||
// return;
|
||
// }
|
||
// sendFlowerintent.putExtra("name", expertDetail.data.realName);
|
||
// startActivity(sendFlowerintent);
|
||
// } catch (Exception e) {
|
||
// // TODO: handle exception
|
||
// ToastUtil.showMessage("专家信息为空,不可送花");
|
||
// }
|
||
|
||
break;
|
||
case R.id.bt_telephone:
|
||
// 电话咨询
|
||
// LogUtils.v("电话咨询");
|
||
// try {
|
||
// if (expertDetail.data == null) {
|
||
// ToastUtil.showMessage("专家信息为空,不可订购服务");
|
||
// return;
|
||
// }
|
||
//
|
||
// if (expertDetail.data.callDisable.equals("Y")) {
|
||
// ToastUtil.showMessage("专家未开启此服务");
|
||
// return;
|
||
// } else if (expertDetail.data.callIsEnable.equals("0")) {
|
||
// ToastUtil.showMessage("专家未开启此服务");
|
||
// return;
|
||
// }
|
||
//
|
||
// Intent telophoneIntent = new Intent(this,
|
||
// PhoneConsultActivity.class);
|
||
// telophoneIntent.putExtra("uuid", uuid);
|
||
// telophoneIntent.putExtra("name", expertDetail.data.realName);
|
||
// startActivity(telophoneIntent);
|
||
// } catch (Exception e) {
|
||
// // TODO: handle exception
|
||
// ToastUtil.showMessage("专家信息为空,不可订购服务");
|
||
// }
|
||
|
||
break;
|
||
case R.id.bt_appointment:
|
||
// 门诊预约
|
||
// LogUtils.v("门诊预约");
|
||
// try {
|
||
// if (expertDetail.data == null) {
|
||
// ToastUtil.showMessage("专家信息为空,不可订购服务");
|
||
// return;
|
||
// }
|
||
//
|
||
// if (expertDetail.data.clinicDisable.equals("Y")) {
|
||
// ToastUtil.showMessage("专家未开启此服务");
|
||
// return;
|
||
// } else if (expertDetail.data.clinicIsEnable.equals("0")) {
|
||
// ToastUtil.showMessage("专家未开启此服务");
|
||
// return;
|
||
// }
|
||
// Intent clinicIntent = new Intent(this, ClinicActivity.class);
|
||
// clinicIntent.putExtra("uuid", uuid);
|
||
// clinicIntent.putExtra("name", expertDetail.data.realName);
|
||
// startActivity(clinicIntent);
|
||
// } catch (Exception e) {
|
||
// // TODO: handle exception
|
||
// ToastUtil.showMessage("专家信息为空,不可订购服务");
|
||
// }
|
||
|
||
break;
|
||
case R.id.bt_month_payment:
|
||
// 包月服务
|
||
// LogUtils.v("包月服务");
|
||
// try {
|
||
// if (expertDetail.data == null) {
|
||
// ToastUtil.showMessage("专家信息为空,不可订购服务");
|
||
// return;
|
||
// }
|
||
// if (expertDetail.data.monthDisable.equals("Y")) {
|
||
// ToastUtil.showMessage("专家未开启此服务");
|
||
// return;
|
||
// } else if (expertDetail.data.monthIsEnable.equals("0")) {
|
||
// ToastUtil.showMessage("专家未开启此服务");
|
||
// return;
|
||
// }
|
||
// Intent monthIntent = new Intent(this, MonthActivity.class);
|
||
// monthIntent.putExtra("uuid", uuid);
|
||
// monthIntent.putExtra("name", expertDetail.data.realName);
|
||
// startActivity(monthIntent);
|
||
// } catch (Exception e) {
|
||
// // TODO: handle exception
|
||
// ToastUtil.showMessage("专家信息为空,不可订购服务");
|
||
// }
|
||
|
||
break;
|
||
|
||
}
|
||
|
||
}
|
||
|
||
private class GandanDongtaiListAdapter extends BaseAdapter {
|
||
|
||
private List<ExpertDetail.DongTaiResTop2Bean> dongtai;
|
||
|
||
public GandanDongtaiListAdapter(List<ExpertDetail.DongTaiResTop2Bean> dongtai) {
|
||
// TODO Auto-generated constructor stub
|
||
this.dongtai = dongtai;
|
||
}
|
||
|
||
@Override
|
||
public int getCount() {
|
||
// TODO Auto-generated method stub
|
||
return dongtai.size();
|
||
}
|
||
|
||
@Override
|
||
public Object getItem(int position) {
|
||
// TODO Auto-generated method stub
|
||
return dongtai.get(position);
|
||
}
|
||
|
||
@Override
|
||
public long getItemId(int position) {
|
||
// TODO Auto-generated method stub
|
||
return position;
|
||
}
|
||
|
||
@Override
|
||
public View getView(int position, View convertView, ViewGroup parent) {
|
||
// TODO Auto-generated method stub
|
||
ViewHolder vh;
|
||
if (convertView == null) {
|
||
vh = new ViewHolder();
|
||
convertView = UIUtils.inflate(R.layout.item_more_video);
|
||
vh.mTv_name = (TextView) convertView.findViewById(R.id.tv_video_title);
|
||
vh.mIV_video = (ImageView) convertView.findViewById(R.id.iv_video_image);
|
||
vh.mTv_date = (TextView) convertView.findViewById(R.id.tv_video_date);
|
||
convertView.setTag(vh);
|
||
} else {
|
||
vh = (ViewHolder) convertView.getTag();
|
||
}
|
||
vh.mTv_name.setText(dongtai.get(position).getTITLE());
|
||
vh.mTv_date.setText(dongtai.get(position).getAuthor());
|
||
ImageLoader.getInstance().displayImage(
|
||
Url.urlHtml + dongtai.get(position).getHEAD_IMG(),
|
||
vh.mIV_video,
|
||
ImageOptions.getImageOptions(R.drawable.img_news_empty));
|
||
|
||
return convertView;
|
||
}
|
||
|
||
public class ViewHolder {
|
||
public TextView mTv_name, mTv_date;
|
||
public ImageView mIV_video;
|
||
}
|
||
|
||
}
|
||
|
||
|
||
|
||
private class GandanVideoListAdapter extends BaseAdapter {
|
||
|
||
private List<ExpertDetail.VideoResTop2Bean> video;
|
||
|
||
public GandanVideoListAdapter(List<ExpertDetail.VideoResTop2Bean> video) {
|
||
// TODO Auto-generated constructor stub
|
||
this.video = video;
|
||
}
|
||
|
||
@Override
|
||
public int getCount() {
|
||
// TODO Auto-generated method stub
|
||
return video.size();
|
||
}
|
||
|
||
@Override
|
||
public Object getItem(int position) {
|
||
// TODO Auto-generated method stub
|
||
return video.get(position);
|
||
}
|
||
|
||
@Override
|
||
public long getItemId(int position) {
|
||
// TODO Auto-generated method stub
|
||
return position;
|
||
}
|
||
|
||
@Override
|
||
public View getView(int position, View convertView, ViewGroup parent) {
|
||
// TODO Auto-generated method stub
|
||
ViewHolder vh;
|
||
if (convertView == null) {
|
||
vh = new ViewHolder();
|
||
convertView = UIUtils.inflate(R.layout.item_more_video);
|
||
vh.mTv_name = (TextView) convertView.findViewById(R.id.tv_video_title);
|
||
vh.mIV_video = (ImageView) convertView.findViewById(R.id.iv_video_image);
|
||
vh.mTv_date = (TextView) convertView.findViewById(R.id.tv_video_date);
|
||
convertView.setTag(vh);
|
||
} else {
|
||
vh = (ViewHolder) convertView.getTag();
|
||
}
|
||
vh.mTv_name.setText(video.get(position).getName());
|
||
vh.mTv_date.setText(video.get(position).getPublic_name());
|
||
ImageLoader.getInstance().displayImage(
|
||
Url.urlHtml + video.get(position).getImgpath(),
|
||
vh.mIV_video,
|
||
ImageOptions.getImageOptions(R.drawable.img_news_empty));
|
||
|
||
return convertView;
|
||
}
|
||
public class ViewHolder {
|
||
public TextView mTv_name, mTv_date;
|
||
public ImageView mIV_video;
|
||
}
|
||
|
||
}
|
||
/**
|
||
* @author Administrator
|
||
* @date 2015-12-1 上午8:58:18
|
||
* <p/>
|
||
* 功能说明:解除专家
|
||
* <p/>
|
||
* method
|
||
*/
|
||
// private void remove() {
|
||
// // TODO Auto-generated method stub
|
||
// pd = new CustomProgressDialog(this, "请稍候");
|
||
// pd.show();
|
||
// new Thread() {
|
||
// public void run() {
|
||
// try {
|
||
// List<BasicNameValuePair> parameters = new ArrayList<BasicNameValuePair>();
|
||
// BasicNameValuePair valuePair = new BasicNameValuePair(
|
||
// "expertUuid", uuid);
|
||
// BasicNameValuePair valuePair2 = new BasicNameValuePair(
|
||
// "patientUuid", SharePrefUtil.getString(
|
||
// ExpertDetailActivity.this, "uuid", ""));
|
||
// parameters.add(valuePair);
|
||
// parameters.add(valuePair2);
|
||
// HttpResult httpResult = HttpHelper.post(Url.cancelRes,
|
||
// parameters);// 请求网络
|
||
// String result = httpResult.getString();// str为服务器返回的json串
|
||
// if (result == null) {
|
||
// ToastUtil.showMessage("请求服务器失败,请重试");
|
||
// pd.dismiss();
|
||
// return;
|
||
// }
|
||
// Message msg = Message.obtain();
|
||
// msg.obj = result;
|
||
// msg.what = 1;
|
||
// handler.sendMessage(msg);
|
||
//
|
||
// } catch (Exception e) {
|
||
// // TODO Auto-generated catch block
|
||
// e.printStackTrace();
|
||
// pd.dismiss();
|
||
// ToastUtil.showMessage("请求失败,请重试");
|
||
// }
|
||
// }
|
||
//
|
||
// ;
|
||
// }.start();
|
||
// }
|
||
|
||
@Override
|
||
protected void processClick(View v) {
|
||
// TODO Auto-generated method stub
|
||
|
||
}
|
||
|
||
@Override
|
||
public void onCallbackFromThread(String resultJson) {
|
||
// TODO Auto-generated method stub
|
||
|
||
}
|
||
|
||
@Override
|
||
public void onCallBackFromThread(String resultJson, int resultCode) {
|
||
// TODO Auto-generated method stub
|
||
|
||
LogUtil.e(resultJson);
|
||
switch (resultCode) {
|
||
case 01:
|
||
closeProgressDialog();
|
||
Gson gson = new Gson();
|
||
try {
|
||
expertDetail = gson.fromJson(resultJson, ExpertDetail.class);
|
||
} catch (JsonSyntaxException e1) {
|
||
// TODO Auto-generated catch block
|
||
e1.printStackTrace();
|
||
}
|
||
if ("1".equals(expertDetail.getCode())) {
|
||
handler.sendEmptyMessage(GET_DATA_SUCCESS);
|
||
} else {
|
||
ToastUtil.showMessage("获取专家信息失败,请重试");
|
||
return;
|
||
}
|
||
|
||
break;
|
||
}
|
||
|
||
|
||
|
||
|
||
}
|
||
|
||
}
|