tr>
import android.text.Spanned;
import android.text.Spanned;
import android.text.TextUtils;
import android.text.style.ForegroundColorSpan;
import android.text.style.ForegroundColorSpan;
import android.util.Log;
import android.util.Log;
import android.view.LayoutInflater;
import android.view.LayoutInflater;
import android.view.ViewTreeObserver;
import android.view.ViewTreeObserver;
import android.widget.ImageView;
import android.widget.ImageView;
import android.widget.LinearLayout;
import android.widget.LinearLayout;
import android.widget.ListView;
import android.widget.RelativeLayout;
import android.widget.RelativeLayout;
import android.widget.Space;
import android.widget.Space;
import android.widget.TextView;
import android.widget.TextView;
import com.amap.api.maps.AMapUtils;
import com.amap.api.maps.AMapUtils;
import com.amap.api.maps.model.LatLng;
import com.amap.api.maps.model.LatLng;
import com.blankj.utilcode.util.LogUtils;
import com.blankj.utilcode.util.LogUtils;
import com.bumptech.glide.Glide;
import com.electric.chargingpile.R;
import com.electric.chargingpile.R;
import com.electric.chargingpile.activity.AlterOneActivity;
import com.electric.chargingpile.activity.AlterOneActivity;
import com.electric.chargingpile.activity.ChargingQianDaoActivity;
import com.electric.chargingpile.activity.ChargingQianDaoActivity;
import com.electric.chargingpile.activity.CommentVideoDetailActivity;
import com.electric.chargingpile.activity.ImagePagerActivity;
import com.electric.chargingpile.activity.ImagePagerActivity;
import com.electric.chargingpile.activity.LoginActivity;
import com.electric.chargingpile.activity.LoginActivity;
import com.electric.chargingpile.activity.MainMapActivity;
import com.electric.chargingpile.activity.MainMapActivity;
import com.electric.chargingpile.activity.NewZhanDetailsActivity;
import com.electric.chargingpile.activity.NewZhanDetailsActivity;
import com.electric.chargingpile.activity.PriceDetailsActivity;
import com.electric.chargingpile.activity.PriceDetailsActivity;
import com.electric.chargingpile.activity.ZhanDetailsNew;
import com.electric.chargingpile.activity.ZhanDetailsNew;
import com.electric.chargingpile.adapter.ZhanCommentsAapter;
import com.electric.chargingpile.application.MainApplication;
import com.electric.chargingpile.application.MainApplication;
import com.electric.chargingpile.data.ChartData;
import com.electric.chargingpile.data.ChartData;
import com.electric.chargingpile.data.MyOtto;
import com.electric.chargingpile.data.MyOtto;
import com.electric.chargingpile.data.PileData;
import com.electric.chargingpile.data.PileData;
import com.electric.chargingpile.data.RankinglistRefreshEvent;
import com.electric.chargingpile.data.RankinglistRefreshEvent;
import com.electric.chargingpile.data.Zhan;
import com.electric.chargingpile.data.Zhan;
import com.electric.chargingpile.util.CarTypeUtil;
import com.electric.chargingpile.util.CircleTransform;
import com.electric.chargingpile.util.DES;
import com.electric.chargingpile.util.DES;
import com.electric.chargingpile.util.DES3;
import com.electric.chargingpile.util.DES3;
import com.electric.chargingpile.util.DES3S;
import com.electric.chargingpile.util.DES3S;
private Zhan zhan = null;
private Zhan zhan = null;
private CombinedChart mChart;
private CombinedChart mChart;
public static ArrayList<JSONObject> datas;
public static ArrayList<JSONObject> datas;
private LinearLayout rl_claimer, ll_claimer, ll_phone, ll_juli, ll_juli1, ll_yunyingshang;
private LinearLayout rl_claimer, ll_claimer, ll_phone, ll_juli, ll_juli1;
private RelativeLayout rl_charging_qiandao, rl_grade;
private RelativeLayout rl_charging_qiandao, rl_grade;
public static RelativeLayout rl_new_comment;
public static TextView tv_new_comment, tv_new_name, tv_new_car, tv_new_time;
public static CircleImageView iv_new_icon;
public static ImageView iv_new_pingfen;
public static ImageView ssv, iv_level_img;
public static ImageView ssv;
public static CustomScrollView sv;
public static CustomScrollView sv;
private String gd_jing, gd_wei;
private String gd_jing, gd_wei;
private ImageView iv_commentPic;
private CustomProgressDialog pd_info;
private CustomProgressDialog pd_info;
public static TextView tv_picnum;
public static TextView tv_picnum;
private Socket socket;
private Socket socket;
Context mContext;
Context mContext;
private TextView tv_claimer, tv_grade;
private TextView tv_claimer, tv_grade;
private View view_789;
String zhan_name, zhan_id, tid, zhan_address, supplier, total_num, fast_num, slow_num, stop_cost, charge_cost, telephone, remarks, suit_car, claimer, belong_attribute, poi_jing, poi_wei, charge_cost_way, other_cost, work_open, work_close;
String zhan_name, zhan_id, tid, zhan_address, supplier, total_num, fast_num, slow_num, stop_cost, charge_cost, telephone, remarks, suit_car, claimer, belong_attribute, poi_jing, poi_wei, charge_cost_way, other_cost, work_open, work_close;
private TextView current_time_slot, tv_detail_charging_enter;
private TextView current_time_slot, tv_detail_charging_enter;
private LinearLayout tv_cost_info;
private LinearLayout tv_cost_info;
private LinearLayout ll_no_fenshi, ll_yes_fenshi;
private LinearLayout ll_no_fenshi, ll_yes_fenshi;
private TextView tv_today_num;
private TextView tv_today_num;
private ImageView collect, iv_fast, iv_slow, type, share, iv_call, zhi, iv_zhanpic, iv_grade, iv_location;
private ImageView collect, iv_fast, iv_slow, type, share, iv_call, zhi, iv_zhanpic, iv_grade;
private TextView tv_yunyingshang, fast, slow, open_object, tv_work_open, tv_work_close, holiday_open, holiday_close,
private TextView tv_yunyingshang, fast, slow, open_object, tv_work_open, tv_work_close, holiday_open, holiday_close,
belong_name, chargeDetail, tv_submit, parkCost, tv_total, distance1, distance, address, tv_remark, tvcostNum, other;
belong_name, chargeDetail, tv_submit, parkCost, tv_total, distance1, distance, address, tv_remark, tvcostNum, other;
String key = "aSU4wsxf";
String key = "aSU4wsxf";
String token_url = "http://open.teld.cn/OAuth/Token";// 表示使用的授权模式
String token_url = "http://open.teld.cn/OAuth/Token";// 表示使用的授权模式
String postSta_url = "http://open.teld.cn/api/Sta/PostStaDetail";// 表示使用的授权模式
String postSta_url = "http://open.teld.cn/api/Sta/PostStaDetail";// 表示使用的授权模式
String acNum, dcNum, acableNum, dcableNum;
String acNum, dcNum, acableNum, dcableNum;
public static TagFlowLayout mFlowLayout;
public static TextView tv_1;
private String[] stringArr;
private String[] stringArr;
private RelativeLayout rlclaimer;
private RelativeLayout rlclaimer;
private View detail_view;
private View detail_view;
private String freeStatus;
private String freeStatus;
private LoadingDialog loadingDialog;
private LoadingDialog loadingDialog;
private TextView tv_pdelete, tv_pname, tv_sname, tv_ptime, tv_stime, tv_pcontext, tv_scontext, tv_preply, tv_pcar, tv_more, tv_pzan;
private ImageView iv_picon, certified_icon, high_grade_comment_icon;
private LinearLayout ll_pzan;
private ImageView iv_havemessage ,imgTwo,imgThree,imgVideo,imgStart,iv_commentPic;
private ImageView iv_pgrade, iv_pzan, iv_level_img;
private TagFlowLayout fl_ptag;
private ListView lv_scomment;
private RelativeLayout parent,imgLayout;
private Handler handler = new Handler() {
private Handler handler = new Handler() {
// 主线程通过这个方法处理消息
// 主线程通过这个方法处理消息
@TargetApi(Build.VERSION_CODES.KITKAT)
@TargetApi(Build.VERSION_CODES.KITKAT)
break;
break;
case 6:
case 6:
if (null != msg.obj) {
JSONArray jsonArray = null;
String s = null;
try {
jsonArray = new JSONArray(msg.obj.toString());
// Log.e("s==",s);
} catch (JSONException e) {
e.printStackTrace();
}
if (null != jsonArray) {
if (jsonArray.length() > 0) {
rl_new_comment.setVisibility(View.VISIBLE);
try {
s = jsonArray.get(0).toString();
} catch (JSONException e) {
e.printStackTrace();
}
String nickname = JsonUtils.getKeyResult(s, "nickname");
String tel = JsonUtils.getKeyResult(s, "tel");
String content = JsonUtils.getKeyResult(s, "content");
String chexing = JsonUtils.getKeyResult(s, "chexing");
String star_level = JsonUtils.getKeyResult(s, "star_level");
String userpic = JsonUtils.getKeyResult(s, "userpic");
String addtime = JsonUtils.getKeyResult(s, "addtime");
String tag = JsonUtils.getKeyResult(s, "tag");
String thumUrl = JsonUtils.getKeyResult(s, "thumUrl");
String fileUrl = JsonUtils.getKeyResult(s, "fileUrl");
String title = JsonUtils.getKeyResult(s, "title");
// Log.e(TAG, "handleMessage: title="+title );
if (title != null) {
if (title.equals("")) {
iv_level_img.setVisibility(View.GONE);
} else if (title.equals("V0")) {
iv_level_img.setVisibility(View.GONE);
// holder.iv_level_img.setImageResource(R.drawable.icon_level_putong);
} else if (title.equals("V1")) {
iv_level_img.setVisibility(View.VISIBLE);
iv_level_img.setImageResource(R.drawable.icon_qingtong);
} else if (title.equals("V2")) {
iv_level_img.setVisibility(View.VISIBLE);
iv_level_img.setImageResource(R.drawable.icon_baiyin);
} else if (title.equals("V3")) {
iv_level_img.setVisibility(View.VISIBLE);
iv_level_img.setImageResource(R.drawable.icon_huangjin);
} else if (title.equals("V4")) {
iv_level_img.setVisibility(View.VISIBLE);
iv_level_img.setImageResource(R.drawable.icon_bojin);
} else if (title.equals("V5")) {
iv_level_img.setVisibility(View.VISIBLE);
iv_level_img.setImageResource(R.drawable.icon_zuanshi);
}
}
if (thumUrl != null && fileUrl != null && !thumUrl.equals("") && !fileUrl.equals("")) {
iv_commentPic.setVisibility(View.VISIBLE);
final String url = MainApplication.url + "/zhannew/uploadfile/" + thumUrl;
final String file_url = MainApplication.url + "/zhannew/uploadfile/" + fileUrl;
final String[] ss = {file_url};
Picasso.with(MainApplication.context)
.load(url)
.into(iv_commentPic);
iv_commentPic.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
Intent intent = new Intent(getContext(), ImagePagerActivity.class);
// 图片url,为了演示这里使用常量,一般从数据库中或网络中获取
intent.putExtra(ImagePagerActivity.EXTRA_IMAGE_URLS, ss);
intent.putExtra(ImagePagerActivity.EXTRA_IMAGE_INDEX, 0);
getContext().startActivity(intent);
}
});
} else {
iv_commentPic.setVisibility(View.GONE);
}
if (tag != null && tag.equals("")) {
mFlowLayout.setVisibility(View.GONE);
} else {
if (null == getActivity()) {
mFlowLayout.setVisibility(View.GONE);
} else {
if (null != getActivity()) {
mFlowLayout.setVisibility(View.VISIBLE);
final LayoutInflater mInflater = LayoutInflater.from(getActivity());
stringArr = tag.split(",");
mFlowLayout.setClickable(false);
mFlowLayout.setEnabled(false);
mFlowLayout.setAdapter(new TagAdapter<String>(stringArr) {
@Override
public View getView(FlowLayout parent, int position, String s) {
TextView tv = (TextView) mInflater.inflate(R.layout.tv1,
mFlowLayout, false);
tv.setText(s);
return tv;
}
});
}
}
}
tv_new_time.setText(TimeStamp2Date(addtime, "yyyy-MM-dd"));
String url = MainApplication.url + "/zhannew/uploadfile/" + userpic;
// Log.e(TAG, "handleMessage: userpic="+userpic );
// Log.e(TAG, "handleMessage: userpic-url="+url );
// Log.d("ss==",url);
// if (null != getActivity()) {
// Glide.with(getActivity())
// if (null != msg.obj) {
// JSONArray jsonArray = null;
// String s = null;
// try {
// jsonArray = new JSONArray(msg.obj.toString());
//
//// Log.e("s==",s);
// } catch (JSONException e) {
// e.printStackTrace();
// }
// if (null != jsonArray) {
// if (jsonArray.length() > 0) {
// rl_new_comment.setVisibility(View.VISIBLE);
// try {
// s = jsonArray.get(0).toString();
// } catch (JSONException e) {
// e.printStackTrace();
// }
// String nickname = JsonUtils.getKeyResult(s, "nickname");
// String tel = JsonUtils.getKeyResult(s, "tel");
// String chexing = JsonUtils.getKeyResult(s, "chexing");
// String star_level = JsonUtils.getKeyResult(s, "star_level");
// String userpic = JsonUtils.getKeyResult(s, "userpic");
// String addtime = JsonUtils.getKeyResult(s, "addtime");
// String tag = JsonUtils.getKeyResult(s, "tag");
// String thumUrl = JsonUtils.getKeyResult(s, "thumUrl");
// String fileUrl = JsonUtils.getKeyResult(s, "fileUrl");
//1
//
// if (thumUrl != null && fileUrl != null && !thumUrl.equals("") && !fileUrl.equals("")) {
// iv_commentPic.setVisibility(View.VISIBLE);
// final String url = MainApplication.url + "/zhannew/uploadfile/" + thumUrl;
// final String file_url = MainApplication.url + "/zhannew/uploadfile/" + fileUrl;
// final String[] ss = {file_url};
// Picasso.with(MainApplication.context)
// .load(url)
// .load(url)
// .placeholder(R.drawable.icon_user1118)
// .error(R.drawable.icon_user1118)
// .into(iv_new_icon);
// }else {
// iv_new_icon.setImageResource(R.drawable.icon_user1118);
// .into(iv_commentPic);
// iv_commentPic.setOnClickListener(new View.OnClickListener() {
// @Override
// public void onClick(View v) {
// Intent intent = new Intent(getContext(), ImagePagerActivity.class);
// // 图片url,为了演示这里使用常量,一般从数据库中或网络中获取
// intent.putExtra(ImagePagerActivity.EXTRA_IMAGE_URLS, ss);
// intent.putExtra(ImagePagerActivity.EXTRA_IMAGE_INDEX, 0);
// getContext().startActivity(intent);
// }
// });
// } else {
// iv_commentPic.setVisibility(View.GONE);
// }
// }
// PicassoUtil.loadingNetImage(getActivity(), url
// , iv_new_icon);
Picasso.with(MainApplication.context)
.load(url)
.error(R.drawable.icon_user1118)
.placeholder(R.drawable.icon_user1118)
.into(iv_new_icon);
if (content.equals("") || content.equals(" ")) {
tv_new_comment.setVisibility(View.GONE);
} else {
tv_new_comment.setVisibility(View.VISIBLE);
SpannableString ss = new SpannableString(content);
Pattern pattern = Pattern.compile("#[0-9a-zA-Z\\u4e00-\\u9fa5]+#");
Matcher matcher = pattern.matcher(ss);
while (matcher.find()) {
int start = matcher.start();
int end = matcher.end();
ss.setSpan(new ForegroundColorSpan(getResources().getColor(R.color.topic_blue)), start, end, Spanned.SPAN_EXCLUSIVE_EXCLUSIVE);
}
tv_new_comment.setText(ss);
}
tv_new_name.setText(nickname);
if (!nickname.equals("") && !nickname.equals("null")) {
tv_new_name.setText(nickname);
} else {
tv_new_name.setText(Util.handlePhoneComment(tel));
}
if ("待购".equals(chexing)) {
tv_new_car.setText("待购");
} else {
String[] strarray = chexing.split("\\$\\$");
String name0 = null, name1 = null;
if (strarray.length > 1) {
name0 = strarray[0];//江淮
name1 = strarray[1];//iEV3
}
if (chexing.equals("nullnull") || chexing == null || chexing.equals("") || chexing.equals("null") || chexing.equals("品牌$$车型") || chexing.equals("null$$null")) {
tv_new_car.setText("");
} else {
tv_new_car.setText(name0 + name1);
}
}
if (star_level.equals("")) {
star_level = "0";
}
double d = Double.parseDouble(star_level);
if (d == 0) {
iv_new_pingfen.setVisibility(View.GONE);
} else {
if (d > 0 && d < 1) {
iv_new_pingfen.setImageResource(R.drawable.icon_05xing);
iv_new_pingfen.setVisibility(View.VISIBLE);
} else if (d >= 1 && d < 1.5) {
iv_new_pingfen.setVisibility(View.VISIBLE);
iv_new_pingfen.setImageResource(R.drawable.icon_1xing);
} else if (d >= 1.5 && d < 2) {
iv_new_pingfen.setVisibility(View.VISIBLE);
iv_new_pingfen.setImageResource(R.drawable.icon_15xing);
} else if (d >= 2 && d < 2.5) {
iv_new_pingfen.setVisibility(View.VISIBLE);
iv_new_pingfen.setImageResource(R.drawable.icon_2xing);
} else if (d >= 2.5 && d < 3) {
iv_new_pingfen.setVisibility(View.VISIBLE);
iv_new_pingfen.setImageResource(R.drawable.icon_25xing);
} else if (d >= 3 && d < 3.5) {
iv_new_pingfen.setVisibility(View.VISIBLE);
iv_new_pingfen.setImageResource(R.drawable.icon_3xing);
} else if (d >= 3.5 && d < 4) {
iv_new_pingfen.setVisibility(View.VISIBLE);
iv_new_pingfen.setImageResource(R.drawable.icon_35xing);
} else if (d >= 4 && d < 4.5) {
iv_new_pingfen.setVisibility(View.VISIBLE);
iv_new_pingfen.setImageResource(R.drawable.icon_4xing);
} else if (d >= 4.5 && d < 5) {
iv_new_pingfen.setVisibility(View.VISIBLE);
iv_new_pingfen.setImageResource(R.drawable.icon_45xing);
} else {
iv_new_pingfen.setVisibility(View.VISIBLE);
iv_new_pingfen.setImageResource(R.drawable.icon_5xing);
}
}
} else {
rl_new_comment.setVisibility(View.GONE);
}
}
}
// if (tag != null && tag.equals("")) {
// mFlowLayout.setVisibility(View.GONE);
// } else {
// if (null == getActivity()) {
// mFlowLayout.setVisibility(View.GONE);
// } else {
// if (null != getActivity()) {
// mFlowLayout.setVisibility(View.VISIBLE);
// final LayoutInflater mInflater = LayoutInflater.from(getActivity());
// stringArr = tag.split(",");
// mFlowLayout.setClickable(false);
// mFlowLayout.setEnabled(false);
// mFlowLayout.setAdapter(new TagAdapter<String>(stringArr) {
// @Override
// public View getView(FlowLayout parent, int position, String s) {
// TextView tv = (TextView) mInflater.inflate(R.layout.tv1,
// mFlowLayout, false);
// tv.setText(s);
// return tv;
// }
// });
// }
// }
// }
// tv_new_time.setText(TimeStamp2Date(addtime, "yyyy-MM-dd"));
// String url = MainApplication.url + "/zhannew/uploadfile/" + userpic;
//
// Picasso.with(MainApplication.context)
// .load(url)
// .error(R.drawable.icon_user1118)
// .placeholder(R.drawable.icon_user1118)
// .into(iv_new_icon);
//
//
//
//
// tv_new_name.setText(nickname);
// if (!nickname.equals("") && !nickname.equals("null")) {
// tv_new_name.setText(nickname);
// } else {
// tv_new_name.setText(Util.handlePhoneComment(tel));
// }
//
// if ("待购".equals(chexing)) {
// tv_new_car.setText("待购");
// } else {
// String[] strarray = chexing.split("\\$\\$");
// String name0 = null, name1 = null;
// if (strarray.length > 1) {
// name0 = strarray[0];//江淮
// name1 = strarray[1];//iEV3
// }
// if (chexing.equals("nullnull") || chexing == null || chexing.equals("") || chexing.equals("null") || chexing.equals("品牌$$车型") || chexing.equals("null$$null")) {
// tv_new_car.setText("");
// } else {
// tv_new_car.setText(name0 + name1);
// }
// }
// if (star_level.equals("")) {
// star_level = "0";
// }
// double d = Double.parseDouble(star_level);
// if (d == 0) {
// iv_new_pingfen.setVisibility(View.GONE);
// } else {
// if (d > 0 && d < 1) {
// iv_new_pingfen.setImageResource(R.drawable.icon_05xing);
// iv_new_pingfen.setVisibility(View.VISIBLE);
// } else if (d >= 1 && d < 1.5) {
// iv_new_pingfen.setVisibility(View.VISIBLE);
// iv_new_pingfen.setImageResource(R.drawable.icon_1xing);
// } else if (d >= 1.5 && d < 2) {
// iv_new_pingfen.setVisibility(View.VISIBLE);
// iv_new_pingfen.setImageResource(R.drawable.icon_15xing);
// } else if (d >= 2 && d < 2.5) {
// iv_new_pingfen.setVisibility(View.VISIBLE);
// iv_new_pingfen.setImageResource(R.drawable.icon_2xing);
// } else if (d >= 2.5 && d < 3) {
// iv_new_pingfen.setVisibility(View.VISIBLE);
// iv_new_pingfen.setImageResource(R.drawable.icon_25xing);
// } else if (d >= 3 && d < 3.5) {
// iv_new_pingfen.setVisibility(View.VISIBLE);
// iv_new_pingfen.setImageResource(R.drawable.icon_3xing);
// } else if (d >= 3.5 && d < 4) {
// iv_new_pingfen.setVisibility(View.VISIBLE);
// iv_new_pingfen.setImageResource(R.drawable.icon_35xing);
// } else if (d >= 4 && d < 4.5) {
// iv_new_pingfen.setVisibility(View.VISIBLE);
// iv_new_pingfen.setImageResource(R.drawable.icon_4xing);
// } else if (d >= 4.5 && d < 5) {
// iv_new_pingfen.setVisibility(View.VISIBLE);
// iv_new_pingfen.setImageResource(R.drawable.icon_45xing);
// } else {
// iv_new_pingfen.setVisibility(View.VISIBLE);
// iv_new_pingfen.setImageResource(R.drawable.icon_5xing);
// }
// }
//
// } else {
// rl_new_comment.setVisibility(View.GONE);
// }
// }
// }
break;
break;
default:
default:
private ImageView scan_charge_btn;
private ImageView scan_charge_btn;
private Space scan_charge_space;
private Space scan_charge_space;
private String telNum;
private String telNum;
private RelativeLayout rl_new_comment;
@Override
@Override
public View onCreateView(LayoutInflater inflater, ViewGroup container,
public View onCreateView(LayoutInflater inflater, ViewGroup container,
MobclickAgent.onEvent(getActivity(), "0210");
MobclickAgent.onEvent(getActivity(), "0210");
}
}
});
});
eteCityTime(null);
//eteCityTime(null);
}
}
public String TimeStamp2Date(String timestampString, String formats) {
public String TimeStamp2Date(String timestampString, String formats) {
tv_cost_info.setOnClickListener(this);
tv_cost_info.setOnClickListener(this);
current_time_slot = (TextView) v.findViewById(R.id.current_time_slot);
current_time_slot = (TextView) v.findViewById(R.id.current_time_slot);
iv_level_img = (ImageView) v.findViewById(R.id.iv_level_img);
detail_view = v.findViewById(R.id.detail_view);
detail_view = v.findViewById(R.id.detail_view);
detail_claimer_remark = (LinearLayout) v.findViewById(R.id.detail_claimer_remark);
detail_claimer_remark = (LinearLayout) v.findViewById(R.id.detail_claimer_remark);
detail_tel = (RelativeLayout) v.findViewById(R.id.detail_tel);
detail_tel = (RelativeLayout) v.findViewById(R.id.detail_tel);
detail_go_list = (TextView) v.findViewById(R.id.detail_charging_enter);
detail_go_list = (TextView) v.findViewById(R.id.detail_charging_enter);
detail_go_list.setOnClickListener(this);
detail_go_list.setOnClickListener(this);
iv_commentPic = (ImageView) v.findViewById(R.id.iv_commentPic);
mFlowLayout = (TagFlowLayout) v.findViewById(R.id.id_flowlayout_activity);
rl_new_comment = (RelativeLayout) v.findViewById(R.id.rl_new_comment);
tv_1 = (TextView) v.findViewById(R.id.tv_1);
tv_new_comment = (TextView) v.findViewById(R.id.tv_new_comment);
tv_new_name = (TextView) v.findViewById(R.id.tv_new_name);
tv_new_car = (TextView) v.findViewById(R.id.tv_new_car);
tv_new_time = (TextView) v.findViewById(R.id.tv_new_time);
iv_location = (ImageView) v.findViewById(R.id.iv_location);
iv_new_pingfen = (ImageView) v.findViewById(R.id.iv_new_pingfen);
iv_new_icon = (CircleImageView) v.findViewById(R.id.iv_new_icon);
ll_yunyingshang = (LinearLayout) v.findViewById(R.id.ll_yunyingshang);
view_789 = v.findViewById(R.id.view_789);
scan_charge_btn = v.findViewById(R.id.scan_charge_btn);
scan_charge_btn = v.findViewById(R.id.scan_charge_btn);
scan_charge_btn.setOnClickListener(this);
scan_charge_btn.setOnClickListener(this);
scan_charge_space = v.findViewById(R.id.scan_charge_space);
scan_charge_space = v.findViewById(R.id.scan_charge_space);
rl_new_comment = v.findViewById(R.id.rl_new_comment);
tv_pname = (TextView) v.findViewById(R.id.tv_pname);
tv_pdelete = (TextView) v.findViewById(R.id.tv_pdelete);
tv_ptime = (TextView) v.findViewById(R.id.tv_ptime);
tv_pcontext = (TextView) v.findViewById(R.id.tv_pcontext);
tv_pcar = (TextView) v.findViewById(R.id.tv_pcar);
tv_preply = (TextView) v.findViewById(R.id.tv_preply);
tv_pzan = (TextView) v.findViewById(R.id.tv_pzan);
tv_more = (TextView) v.findViewById(R.id.tv_more);
lv_scomment = (ListView) v.findViewById(R.id.lv_scomment);
iv_picon = (ImageView) v.findViewById(R.id.iv_picon);
certified_icon = (ImageView) v.findViewById(R.id.certified_icon);
high_grade_comment_icon = (ImageView) v.findViewById(R.id.high_grade_comment_icon);
iv_pgrade = (ImageView) v.findViewById(R.id.iv_pgrade);
iv_commentPic = (ImageView) v.findViewById(R.id.iv_commentPic);
imgTwo = (ImageView) v.findViewById(R.id.imgTwo);
imgThree = (ImageView) v.findViewById(R.id.imgThree);
imgStart = (ImageView) v.findViewById(R.id.imgStart);
imgVideo = (ImageView) v.findViewById(R.id.imgVideo);
iv_level_img = (ImageView) v.findViewById(R.id.iv_level_img);
iv_pzan = (ImageView) v.findViewById(R.id.iv_pzan);
ll_pzan = (LinearLayout) v.findViewById(R.id.ll_pzan);
fl_ptag = (TagFlowLayout) v.findViewById(R.id.fl_ptag);
parent = (RelativeLayout) v.findViewById(R.id.parent);
imgLayout = (RelativeLayout) v.findViewById(R.id.imgLayout);
}
}
@Override
@Override
@Subscribe
@Subscribe
public void eteCityTime(RankinglistRefreshEvent rankinglistRefreshEvent) {
public void eteCityTime(RankinglistRefreshEvent rankinglistRefreshEvent) {
String url = MainApplication.url + "/zhannew/basic/web/index.php/tpappcomments/get-comments?zhanid=" + NewZhanDetailsActivity.zhan_id + "&page=1";
OkHttpUtils.get().url(url).build().execute(new StringCallback() {
@Override
public void onError(Call call, Exception e) {
}
new Thread(new Runnable() {
@Override
@Override
public void run() {
try {
long appTime4 = System.currentTimeMillis() / 1000;
long updatetime4 = appTime4 - MainMapActivity.cha - 1;
String token4 = String.valueOf(updatetime4);
String url = "{\"fun\":\"getcomment\",\"zhan_id\":" + "\"" + NewZhanDetailsActivity.zhan_id + "\"" + ",\"timer\":" + "\"" + URLEncoder.encode(DES3.encode(token4)) + "\"" + "}";
// Log.e("url===", url);
// 创建Socket
// socket = new Socket("192.168.1.110",54321);
socket = new Socket("cdz.evcharge.cc", 9503); // IP:10.14.114.127,端口54321
// 向服务器发送消息
PrintWriter out = new PrintWriter(new BufferedWriter(
new OutputStreamWriter(socket.getOutputStream())), true);
out.println(url);
// out.println("{\"fun\":\"getcity\"}");
// 接收来自服务器的消息
BufferedReader br = new BufferedReader(new InputStreamReader(
socket.getInputStream()));
String msg = br.readLine();
// Log.e("===",msg);
if (msg != null) {
Message mes = new Message();
mes.obj = msg;
mes.what = 6;
handler.sendMessage(mes);
}
public void onResponse(String response) {
String rtnCode = JsonUtils.getKeyResult(response, "rtnCode");
if (null != rtnCode && rtnCode.equals("01")) {
try {
JSONObject responseJson = new JSONObject(response);
String commentData = responseJson.getString("data");
JSONArray jsonArray = new JSONArray(commentData);
ArrayList<JSONObject> datasJson = new ArrayList<JSONObject>();
for (int j = 0; j < jsonArray.length(); j++) {
JSONObject jsonObject = (JSONObject) jsonArray.opt(j);
String is_play = TextUtils.isEmpty(jsonObject.getString("is_play")) ? "" : jsonObject.getString("is_play"); //0 审核未通过 item隐藏,1 审核通过,item显示
String type = TextUtils.isEmpty(jsonObject.getString("type")) ? "" : jsonObject.getString("type"); //23 视频,24 图片
if (type.equals("23")) {
if (is_play.equals("1")) {
datasJson.add(jsonObject);
}
} else {
datasJson.add(jsonObject);
}
}
if(datasJson.size()>0){
rl_new_comment.setVisibility(View.VISIBLE);
JSONObject jsonObject = datasJson.get(0);
String title = jsonObject.optString("title");
String name = jsonObject.optString("nickname");
String tel = jsonObject.optString("tel");
String content = jsonObject.optString("content");
String theme= jsonObject.optString("theme");
String addtime =jsonObject.optString("addtime");
String chexing = jsonObject.optString("hascar");
int isCertifiedOwner =jsonObject.optInt("is_certified_owner");
final String pic_url = MainApplication.url + "/zhannew/uploadfile/" + jsonObject.optString("userpic");
String fine = jsonObject.optString("fine");
if (title.equals("")) {
iv_level_img.setVisibility(View.GONE);
} else if (title.equals("V0")) {
iv_level_img.setVisibility(View.GONE);
} else if (title.equals("V1")) {
iv_level_img.setVisibility(View.VISIBLE);
iv_level_img.setImageResource(R.drawable.icon_qingtong);
} else if (title.equals("V2")) {
iv_level_img.setVisibility(View.VISIBLE);
iv_level_img.setImageResource(R.drawable.icon_baiyin);
} else if (title.equals("V3")) {
iv_level_img.setVisibility(View.VISIBLE);
iv_level_img.setImageResource(R.drawable.icon_huangjin);
} else if (title.equals("V4")) {
iv_level_img.setVisibility(View.VISIBLE);
iv_level_img.setImageResource(R.drawable.icon_bojin);
} else if (title.equals("V5")) {
iv_level_img.setVisibility(View.VISIBLE);
iv_level_img.setImageResource(R.drawable.icon_zuanshi);
}
} catch (Exception e) {
if (!TextUtils.isEmpty(theme.trim())){
content= "#"+theme+"#"+content;
}
if (content.equals("") || content.equals(" ")) {
tv_pcontext.setVisibility(View.GONE);
} else {
tv_pcontext.setVisibility(View.VISIBLE);
SpannableString ss = new SpannableString(content);
Pattern pattern = Pattern.compile("#[0-9a-zA-Z,\\u4e00-\\u9fa5]+#");
Matcher matcher = pattern.matcher(ss);
while (matcher.find()) {
int start = matcher.start();
int end = matcher.end();
ss.setSpan(new ForegroundColorSpan(getResources().getColor(R.color.topic_green)), start, end, Spanned.SPAN_EXCLUSIVE_EXCLUSIVE);
}
tv_pcontext.setText(ss);
}
//父级头像
iv_picon.setImageResource(R.drawable.icon_user1118);
Picasso.with(getActivity())
.load(pic_url)
.error(R.drawable.icon_user1118)
.placeholder(R.drawable.icon_user1118)
.transform(new CircleTransform())
.into(iv_picon);
//父级显示名称
if (!name.equals("") && !name.equals("null")) {
tv_pname.setText(name);
} else {
tv_pname.setText(Util.handlePhoneComment(tel));
}
//父级评论时间
tv_ptime.setText(TimeStamp2Date(addtime, "yyyy-MM-dd"));
//父级评论人车型
tv_pcar.setText(CarTypeUtil.getCarType(chexing));
if (isCertifiedOwner == 1) {
certified_icon.setVisibility(View.VISIBLE);
} else {
certified_icon.setVisibility(View.GONE);
}
if ("1".equals(fine)) {
high_grade_comment_icon.setVisibility(View.VISIBLE);
} else {
high_grade_comment_icon.setVisibility(View.GONE);
}
String tag =jsonObject.optString("tag");
if (tag.equals("")) {
fl_ptag.setVisibility(View.GONE);
} else {
fl_ptag.setVisibility(View.VISIBLE);
stringArr = tag.split(",");
fl_ptag.setClickable(false);
fl_ptag.setEnabled(false);
fl_ptag.setAdapter(new TagAdapter<String>(stringArr) {
@Override
public View getView(FlowLayout parent, int position, String s) {
TextView tv = (TextView) LayoutInflater.from(getContext()).inflate(R.layout.tv_comment, fl_ptag, false);
tv.setText(s);
return tv;
}
});
}
//父级点赞
String agree_num = jsonObject.optString("agree_num");
if (agree_num.equals("0")) {
tv_pzan.setText("赞");
} else {
tv_pzan.setText(agree_num);
}
String type = TextUtils.isEmpty(jsonObject.optString("type"))?"":jsonObject.optString("type"); //23 视频,24 图片
//父级评论图片
String fileUrl = jsonObject.optString("fileUrl");
String file2Url = jsonObject.optString("file2Url");
String file3Url = jsonObject.optString("file3Url");
if (type.equals("23")){
imgVideo.setVisibility(View.VISIBLE);
imgStart.setVisibility(View.VISIBLE);
imgLayout.setVisibility(View.VISIBLE);
iv_commentPic.setVisibility(View.GONE);
imgTwo.setVisibility(View.GONE);
imgThree.setVisibility(View.GONE);
String thumUrl = jsonObject.optString("thumUrl");
if (!TextUtils.isEmpty(thumUrl) && !TextUtils.isEmpty(fileUrl)){
Glide.with(MainApplication.context)
.load(MainApplication.CDN +thumUrl)
.into(imgVideo);
}
}else {
imgVideo.setVisibility(View.GONE);
imgStart.setVisibility(View.GONE);
if (!fileUrl.equals("")) {
iv_commentPic.setVisibility(View.VISIBLE);
imgLayout.setVisibility(View.VISIBLE);
Picasso.with(MainApplication.context)
.load(MainApplication.url + "/zhannew/uploadfile/"+fileUrl)
.into(iv_commentPic);
} else {
iv_commentPic.setVisibility(View.GONE);
imgLayout.setVisibility(View.GONE);
}
if (!file2Url.equals("")) {
imgTwo.setVisibility(View.VISIBLE);
Picasso.with(MainApplication.context)
.load(MainApplication.url + "/zhannew/uploadfile/"+file2Url)
.into(imgTwo);
} else {
imgTwo.setVisibility(View.GONE);
}
if (!file3Url.equals("")) {
imgThree.setVisibility(View.VISIBLE);
Picasso.with(MainApplication.context)
.load(MainApplication.url + "/zhannew/uploadfile/"+file3Url)
.into(imgThree);
} else {
imgThree.setVisibility(View.GONE);
}
}
//父级评分
String grade = jsonObject.optString("star_level");
if (grade.equals("")) {
iv_pgrade.setVisibility(View.GONE);
} else {
double d = Double.parseDouble(grade);
if (d == 0) {
iv_pgrade.setVisibility(View.GONE);
} else {
if (d > 0 && d < 1) {
iv_pgrade.setImageResource(R.drawable.icon_05xing);
iv_pgrade.setVisibility(View.VISIBLE);
} else if (d >= 1 && d < 1.5) {
iv_pgrade.setVisibility(View.VISIBLE);
iv_pgrade.setImageResource(R.drawable.icon_1xing);
} else if (d >= 1.5 && d < 2) {
iv_pgrade.setVisibility(View.VISIBLE);
iv_pgrade.setImageResource(R.drawable.icon_15xing);
} else if (d >= 2 && d < 2.5) {
iv_pgrade.setVisibility(View.VISIBLE);
iv_pgrade.setImageResource(R.drawable.icon_2xing);
} else if (d >= 2.5 && d < 3) {
iv_pgrade.setVisibility(View.VISIBLE);
iv_pgrade.setImageResource(R.drawable.icon_25xing);
} else if (d >= 3 && d < 3.5) {
iv_pgrade.setVisibility(View.VISIBLE);
iv_pgrade.setImageResource(R.drawable.icon_3xing);
} else if (d >= 3.5 && d < 4) {
iv_pgrade.setVisibility(View.VISIBLE);
iv_pgrade.setImageResource(R.drawable.icon_35xing);
} else if (d >= 4 && d < 4.5) {
iv_pgrade.setVisibility(View.VISIBLE);
iv_pgrade.setImageResource(R.drawable.icon_4xing);
} else if (d >= 4.5 && d < 5) {
iv_pgrade.setVisibility(View.VISIBLE);
iv_pgrade.setImageResource(R.drawable.icon_45xing);
} else {
iv_pgrade.setVisibility(View.VISIBLE);
iv_pgrade.setImageResource(R.drawable.icon_5xing);
}
}
}
}else{
rl_new_comment.setVisibility(View.GONE);
}
} catch (Exception e) {
}
}
}
}
}
}).start();
});
}
}
@Override
@Override
|
|
||
| 374 |
|
374 |
|
| 375 |
|
375 |
|
| 376 |
|
376 |
|
| 377 |
|
|
|
|
377 |
|
|
|
378 |
|
|
|
379 |
|
|
|
380 |
|
|
|
381 |
|
|
|
382 |
|
|
|
383 |
|
|
|
384 |
|
|
|
385 |
|
|
| 378 |
|
386 |
|
| 379 |
|
387 |
|
| 380 |
|
388 |
|
|
|
||
|
1 |
|
|
|
2 |
|
|
|
3 |
|
|
|
4 |
|
|
|
5 |
|
|
|
6 |
|
|
|
7 |
|
|
|
8 |
|
|
|
9 |
|
|
|
10 |
|
|
|
||
| 1519 |
|
1519 |
|
| 1520 |
|
1520 |
|
| 1521 |
|
1521 |
|
|
1522 |
|
|
|
1523 |
|
|
|
1524 |
|
|
|
1525 |
|
|
|
1526 |
|
|
|
1527 |
|
|
|
1528 |
|
|
|
1529 |
|
|
|
1530 |
|
|
|
1531 |
|
|
|
1532 |
|
|
|
1533 |
|
|
|
1534 |
|
|
|
1535 |
|
|
|
1536 |
|
|
|
1537 |
|
|
|
1538 |
|
|
|
1539 |
|
|
|
1540 |
|
|
|
1541 |
|
|
|
1542 |
|
|
|
1543 |
|
|
|
1544 |
|
|
|
1545 |
|
|
|
1546 |
|
|
|
1547 |
|
|
|
1548 |
|
|
|
1549 |
|
|
|
1550 |
|
|
|
1551 |
|
|
|
1552 |
|
|
|
1553 |
|
|
|
1554 |
|
|
|
1555 |
|
|
|
1556 |
|
|
|
1557 |
|
|
| 1522 |
|
1558 |
|
| 1523 |
|
1559 |
|
| 1524 |
|
1560 |
|
|
|
||
| 667 |
|
667 |
|
| 668 |
|
668 |
|
| 669 |
|
669 |
|
|
670 |
|
|
| 670 |
|
671 |
|
| 671 |
|
672 |
|
| 672 |
|
673 |
|
|
|
||
| 696 |
|
697 |
|
| 697 |
|
698 |
|
| 698 |
|
699 |
|
| 699 |
|
|
|
| 700 |
|
|
|
| 701 |
|
|
|
| 702 |
|
|
|
| 703 |
|
|
|
| 704 |
|
|
|
| 705 |
|
|
|
| 706 |
|
|
|
| 707 |
|
|
|
| 708 |
|
|
|
| 709 |
|
|
|
| 710 |
|
|
|
| 711 |
|
|
|
| 712 |
|
|
|
| 713 |
|
|
|
| 714 |
|
|
|
| 715 |
|
|
|
| 716 |
|
|
|
| 717 |
|
|
|
| 718 |
|
|
|
| 719 |
|
|
|
| 720 |
|
|
|
| 721 |
|
|
|
| 722 |
|
700 |
|
| 723 |
|
|
|
| 724 |
|
|
|
| 725 |
|
|
|
| 726 |
|
|
|
| 727 |
|
|
|
| 728 |
|
|
|
| 729 |
|
|
|
| 730 |
|
|
|
| 731 |
|
|
|
| 732 |
|
|
|
| 733 |
|
|
|
| 734 |
|
|
|
| 735 |
|
|
|
| 736 |
|
|
|
| 737 |
|
|
|
| 738 |
|
|
|
| 739 |
|
|
|
| 740 |
|
|
|
| 741 |
|
|
|
| 742 |
|
|
|
| 743 |
|
|
|
| 744 |
|
|
|
| 745 |
|
|
|
| 746 |
|
|
|
| 747 |
|
|
|
| 748 |
|
|
|
| 749 |
|
|
|
| 750 |
|
|
|
| 751 |
|
|
|
| 752 |
|
|
|
| 753 |
|
|
|
| 754 |
|
|
|
| 755 |
|
|
|
| 756 |
|
|
|
| 757 |
|
|
|
| 758 |
|
|
|
| 759 |
|
|
|
| 760 |
|
|
|
| 761 |
|
|
|
| 762 |
|
|
|
| 763 |
|
|
|
| 764 |
|
|
|
| 765 |
|
|
|
| 766 |
|
|
|
| 767 |
|
|
|
| 768 |
|
|
|
| 769 |
|
|
|
| 770 |
|
|
|
| 771 |
|
|
|
| 772 |
|
|
|
| 773 |
|
|
|
| 774 |
|
|
|
| 775 |
|
|
|
| 776 |
|
|
|
| 777 |
|
|
|
| 778 |
|
|
|
| 779 |
|
|
|
| 780 |
|
|
|
| 781 |
|
|
|
| 782 |
|
|
|
| 783 |
|
|
|
| 784 |
|
|
|
| 785 |
|
|
|
| 786 |
|
|
|
| 787 |
|
|
|
| 788 |
|
|
|
| 789 |
|
|
|
| 790 |
|
|
|
| 791 |
|
|
|
| 792 |
|
|
|
| 793 |
|
|
|
| 794 |
|
|
|
| 795 |
|
|
|
| 796 |
|
|
|
| 797 |
|
|
|
| 798 |
|
|
|
| 799 |
|
|
|
| 800 |
|
|
|
| 801 |
|
|
|
| 802 |
|
|
|
|
701 |
|
|
|
702 |
|
|
|
703 |
|
|
| 803 |
|
704 |
|
| 804 |
|
|
|
| 805 |
|
|
|
| 806 |
|
|
|
| 807 |
|
|
|
| 808 |
|
|
|
| 809 |
|
|
|
| 810 |
|
|
|
| 811 |
|
|
|
| 812 |
|
|
|
|
705 |
|
|
| 813 |
|
706 |
|
| 814 |
|
707 |
|
| 815 |
|
708 |
|