Parcourir la Source

修改通知展示bug,修改站点详情最新评论bug

hy 2 ans auparavant
Parent
commit
f781c412c8

+ 22 - 18
app/src/main/java/com/electric/chargingpile/activity/MainMapActivity.java

@ -346,7 +346,7 @@ public class MainMapActivity extends Activity implements LocationSource, AMapLoc
346 346
347 347
    private TextView tv_tishi, paoName, paoName1, paoAddress, paoCostWay, paoDaohang, paoDistance,
348 348
            paoFast, paoSlow, paoAlter, paoTotal, tingche, fuwu, dian, tv_grade, tv_shaixuan, tv_recommend_tip,
349
            tv_daohang, tvOne, tvTwo, tv_num, tvThree, tv_sortDistance, tv_sortStarLevel, iv_list, tv_sortFreeTime,notificationText;
349
            tv_daohang, tvOne, tvTwo, tv_num, tvThree, tv_sortDistance, tv_sortStarLevel, iv_list, tv_sortFreeTime;
350 350
    public static TextView tv_atCity;
351 351
    public static RelativeLayout paoRl;
352 352
    public static LinearLayout rl_control;
@ -712,7 +712,10 @@ public class MainMapActivity extends Activity implements LocationSource, AMapLoc
712 712
    private LinearLayout private_telephone;
713 713
    private String telephone;
714 714
715
715
    private ImageView imgNotification;
716
    private TextView tvNotification;
717
    private RelativeLayout layoutNotification;
718
    private boolean isShowNotification= false;
716 719
    @Override
717 720
    protected void onCreate(Bundle savedInstanceState) {
718 721
        super.onCreate(savedInstanceState);
@ -1109,7 +1112,6 @@ public class MainMapActivity extends Activity implements LocationSource, AMapLoc
1109 1112
        tv_sortStarLevel = (TextView) findViewById(R.id.tv_sortStarLevel);
1110 1113
        tv_sortStarLevel.setOnClickListener(this);
1111 1114
        tv_sortFreeTime = (TextView) findViewById(R.id.tv_sortFreeTime);
1112
        notificationText = (TextView) findViewById(R.id.notificationText);
1113 1115
        tv_sortFreeTime.setOnClickListener(this);
1114 1116
        rl_mapList = (RelativeLayout) findViewById(R.id.rl_mapList);
1115 1117
        iv_roadCondition = (ImageView) findViewById(R.id.iv_roadCondition);
@ -1232,6 +1234,10 @@ public class MainMapActivity extends Activity implements LocationSource, AMapLoc
1232 1234
        iv_screening = (ImageView) findViewById(R.id.iv_screening);
1233 1235
        tv_main = (TextView) findViewById(R.id.tv_main);
1234 1236
1237
        layoutNotification=findViewById(R.id.layoutNotification);
1238
        tvNotification=findViewById(R.id.tvNotification);
1239
        imgNotification=findViewById(R.id.imgNotification);
1240
1235 1241
        if (MainApplication.festival_time.equals("1")) {
1236 1242
            iv_screening.setImageResource(R.drawable.icon_cj2);
1237 1243
            iv_main.setImageResource(R.drawable.icon_cj1);
@ -3627,16 +3633,7 @@ public class MainMapActivity extends Activity implements LocationSource, AMapLoc
3627 3633
    //获取系统消息
3628 3634
    private void getMessage() {
3629 3635
        long appTime1 = System.currentTimeMillis() / 1000;
3630
        String token = String.valueOf(appTime1);
3631
3632
        if (MainApplication.msgTime.equals("0")) {
3633
            MainApplication.firstOpenTime = token;
3634
            ProfileManager.getInstance().setFirstOpenTime(getApplicationContext(), token);
3635
            MainApplication.msgTime = token;
3636
            ProfileManager.getInstance().setSystemMsgTime(getApplicationContext(), token);
3637
        }
3638
        String url = MainApplication.url + "/zhannew/basic/web/index.php/zhangonggao/release2?timer=" + MainApplication.msgTime;
3639
//        Log.e(TAG, "onResponse hc url: "+url);
3636
        String url = MainApplication.url + "/zhannew/basic/web/index.php/zhangonggao/release2?timer="+appTime1;
3640 3637
        OkHttpUtils.get().url(url).build().execute(new StringCallback() {
3641 3638
            @Override
3642 3639
            public void onError(Call call, Exception e) {
@ -3651,9 +3648,10 @@ public class MainMapActivity extends Activity implements LocationSource, AMapLoc
3651 3648
                        JSONObject jsonObject = (JSONObject) jsonArray.get(0);
3652 3649
                        String content = jsonObject.optString("content");
3653 3650
                        String url = jsonObject.optString("url");
3654
                        if (rl_charging_notice.getVisibility() != View.VISIBLE){
3655
                            notificationText.setText(content);
3656
                            rl_charging_notice.setOnClickListener(view -> {
3651
                        //当订单提醒显示时,或者 通知处于未提醒状态则展示, 当订单提醒展示,则通知不展示
3652
                        if (rl_charging_notice.getVisibility() != View.VISIBLE && !isShowNotification){
3653
                            tvNotification.setText(content);
3654
                            layoutNotification.setOnClickListener(view -> {
3657 3655
                                if (!TextUtils.isEmpty(url)){
3658 3656
                                    Uri.Builder builder = Uri.parse(url).buildUpon();
3659 3657
                                    builder.appendQueryParameter("user_id", MainApplication.userId);
@ -3665,7 +3663,13 @@ public class MainMapActivity extends Activity implements LocationSource, AMapLoc
3665 3663
                                    startActivity(intent);
3666 3664
                                }
3667 3665
                            });
3668
                            rl_charging_notice.setVisibility(View.VISIBLE);
3666
                            imgNotification.setOnClickListener(v->{
3667
                                isShowNotification=true;
3668
                                layoutNotification.setVisibility(View.GONE);
3669
                            });
3670
                            layoutNotification.setVisibility(View.VISIBLE);
3671
                        }else{
3672
                            layoutNotification.setVisibility(View.GONE);
3669 3673
                        }
3670 3674
                    }
3671 3675
                } catch (JSONException e) {
@ -3959,8 +3963,8 @@ public class MainMapActivity extends Activity implements LocationSource, AMapLoc
3959 3963
                if (EmptyUtils.isNotEmpty(response)) {
3960 3964
                    String rtnCode = JsonUtils.getKeyResult(response, "rtnCode");
3961 3965
                    if ("306".equals(rtnCode)) {
3966
                        layoutNotification.setVisibility(View.GONE);
3962 3967
                        LogUtils.e("有订单");
3963
                        notificationText.setText("您有一笔订单正在进行中,点击查看详情...");
3964 3968
                        rl_charging_notice.setVisibility(View.VISIBLE);
3965 3969
                        if (firstCheck) {
3966 3970
                            if (isStatusBack == false) {

+ 15 - 3
app/src/main/java/com/electric/chargingpile/activity/ZhanCommentActivity.java

@ -271,7 +271,7 @@ public class ZhanCommentActivity extends AppCompatActivity implements View.OnCli
271 271
272 272
                String s1 = et_pinglun.getText().toString();
273 273
                s1= s1.replace(" " ,"");
274
                if (s1.length() >= 5){
274
                if (s1.length() > 0){
275 275
                    tv_make_sure.setTextColor(getResources().getColor(R.color.lvse));
276 276
                    tv_make_sure.setEnabled(true);
277 277
                }else{
@ -986,7 +986,7 @@ public class ZhanCommentActivity extends AppCompatActivity implements View.OnCli
986 986
                .recordVideoSecond(15)//录制视频秒数 默认60s
987 987
                .isPreviewVideo(true)//是否预览视频
988 988
                .isSingleDirectReturn(true)//PictureConfig.SINGLE模式下是否直接返回
989
                //  .filterMaxFileSize(100)//查询指定大小内的图片、视频、音频大小,单位M
989
                .filterMaxFileSize( 100 * 1024 )//查询指定大小内的图片、视频、音频大小,单位 KB
990 990
                .forResult(REQUEST_VIDEO_CODE_CHOOSE);
991 991
    }
992 992
@ -1256,5 +1256,17 @@ public class ZhanCommentActivity extends AppCompatActivity implements View.OnCli
1256 1256
        return valueMap;
1257 1257
1258 1258
    }
1259
1259
    public String getFileExtension(String path) {
1260
        String extension = "";
1261
        File file = new File(path);
1262
        try {
1263
            if (file != null && file.exists()) {
1264
                String name = file.getName();
1265
                extension = name.substring(name.lastIndexOf("."));
1266
            }
1267
        } catch (Exception e) {
1268
            extension = "";
1269
        }
1270
        return extension;
1271
    }
1260 1272
}

+ 455 - 260
app/src/main/java/com/electric/chargingpile/fragment/DetailsFragment.java

@ -14,6 +14,7 @@ import android.os.Handler;
14 14
import android.os.Message;
15 15
import android.text.SpannableString;
16 16
import android.text.Spanned;
17
import android.text.TextUtils;
17 18
import android.text.style.ForegroundColorSpan;
18 19
import android.util.Log;
19 20
import android.view.LayoutInflater;
@ -22,6 +23,7 @@ import android.view.ViewGroup;
22 23
import android.view.ViewTreeObserver;
23 24
import android.widget.ImageView;
24 25
import android.widget.LinearLayout;
26
import android.widget.ListView;
25 27
import android.widget.RelativeLayout;
26 28
import android.widget.Space;
27 29
import android.widget.TextView;
@ -33,21 +35,26 @@ import androidx.fragment.app.Fragment;
33 35
import com.amap.api.maps.AMapUtils;
34 36
import com.amap.api.maps.model.LatLng;
35 37
import com.blankj.utilcode.util.LogUtils;
38
import com.bumptech.glide.Glide;
36 39
import com.electric.chargingpile.R;
37 40
import com.electric.chargingpile.activity.AlterOneActivity;
38 41
import com.electric.chargingpile.activity.ChargingQianDaoActivity;
42
import com.electric.chargingpile.activity.CommentVideoDetailActivity;
39 43
import com.electric.chargingpile.activity.ImagePagerActivity;
40 44
import com.electric.chargingpile.activity.LoginActivity;
41 45
import com.electric.chargingpile.activity.MainMapActivity;
42 46
import com.electric.chargingpile.activity.NewZhanDetailsActivity;
43 47
import com.electric.chargingpile.activity.PriceDetailsActivity;
44 48
import com.electric.chargingpile.activity.ZhanDetailsNew;
49
import com.electric.chargingpile.adapter.ZhanCommentsAapter;
45 50
import com.electric.chargingpile.application.MainApplication;
46 51
import com.electric.chargingpile.data.ChartData;
47 52
import com.electric.chargingpile.data.MyOtto;
48 53
import com.electric.chargingpile.data.PileData;
49 54
import com.electric.chargingpile.data.RankinglistRefreshEvent;
50 55
import com.electric.chargingpile.data.Zhan;
56
import com.electric.chargingpile.util.CarTypeUtil;
57
import com.electric.chargingpile.util.CircleTransform;
51 58
import com.electric.chargingpile.util.DES;
52 59
import com.electric.chargingpile.util.DES3;
53 60
import com.electric.chargingpile.util.DES3S;
@ -114,29 +121,29 @@ public class DetailsFragment extends Fragment implements View.OnClickListener, O
114 121
    private Zhan zhan = null;
115 122
    private CombinedChart mChart;
116 123
    public static ArrayList<JSONObject> datas;
117
    private LinearLayout rl_claimer, ll_claimer, ll_phone, ll_juli, ll_juli1, ll_yunyingshang;
124
    private LinearLayout rl_claimer, ll_claimer, ll_phone, ll_juli, ll_juli1;
118 125
    private RelativeLayout rl_charging_qiandao, rl_grade;
119
    public static RelativeLayout rl_new_comment;
120
    public static TextView tv_new_comment, tv_new_name, tv_new_car, tv_new_time;
121
    public static CircleImageView iv_new_icon;
122
    public static ImageView iv_new_pingfen;
123
    public static ImageView ssv, iv_level_img;
126
127
128
129
130
    public static ImageView ssv;
124 131
    public static CustomScrollView sv;
125 132
    private String gd_jing, gd_wei;
126
    private ImageView iv_commentPic;
133
127 134
    private CustomProgressDialog pd_info;
128 135
    public static TextView tv_picnum;
129 136
    private Socket socket;
130 137
    Context mContext;
131 138
    private TextView tv_claimer, tv_grade;
132
    private View view_789;
139
133 140
    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;
134 141
    private TextView current_time_slot, tv_detail_charging_enter;
135 142
    private LinearLayout tv_cost_info;
136 143
    private LinearLayout ll_no_fenshi, ll_yes_fenshi;
137 144
    private TextView tv_today_num;
138 145
139
    private ImageView collect, iv_fast, iv_slow, type, share, iv_call, zhi, iv_zhanpic, iv_grade, iv_location;
146
    private ImageView collect, iv_fast, iv_slow, type, share, iv_call, zhi, iv_zhanpic, iv_grade;
140 147
    private TextView tv_yunyingshang, fast, slow, open_object, tv_work_open, tv_work_close, holiday_open, holiday_close,
141 148
            belong_name, chargeDetail, tv_submit, parkCost, tv_total, distance1, distance, address, tv_remark, tvcostNum, other;
142 149
    String key = "aSU4wsxf";
@ -148,8 +155,8 @@ public class DetailsFragment extends Fragment implements View.OnClickListener, O
148 155
    String token_url = "http://open.teld.cn/OAuth/Token";// 表示使用的授权模式
149 156
    String postSta_url = "http://open.teld.cn/api/Sta/PostStaDetail";// 表示使用的授权模式
150 157
    String acNum, dcNum, acableNum, dcableNum;
151
    public static TagFlowLayout mFlowLayout;
152
    public static TextView tv_1;
158
159
153 160
    private String[] stringArr;
154 161
    private RelativeLayout rlclaimer;
155 162
    private View detail_view;
@ -158,6 +165,16 @@ public class DetailsFragment extends Fragment implements View.OnClickListener, O
158 165
    private String freeStatus;
159 166
    private LoadingDialog loadingDialog;
160 167
168
169
    private TextView tv_pdelete, tv_pname, tv_sname, tv_ptime, tv_stime, tv_pcontext, tv_scontext, tv_preply, tv_pcar, tv_more, tv_pzan;
170
    private ImageView iv_picon, certified_icon, high_grade_comment_icon;
171
    private LinearLayout ll_pzan;
172
    private  ImageView iv_havemessage ,imgTwo,imgThree,imgVideo,imgStart,iv_commentPic;
173
    private ImageView iv_pgrade, iv_pzan, iv_level_img;
174
    private TagFlowLayout fl_ptag;
175
    private  ListView lv_scomment;
176
    private  RelativeLayout parent,imgLayout;
177
161 178
    private Handler handler = new Handler() {
162 179
        // 主线程通过这个方法处理消息
163 180
        @TargetApi(Build.VERSION_CODES.KITKAT)
@ -585,212 +602,159 @@ public class DetailsFragment extends Fragment implements View.OnClickListener, O
585 602
                    break;
586 603
587 604
                case 6:
588
                    if (null != msg.obj) {
589
                        JSONArray jsonArray = null;
590
                        String s = null;
591
                        try {
592
                            jsonArray = new JSONArray(msg.obj.toString());
593
594
//                            Log.e("s==",s);
595
                        } catch (JSONException e) {
596
                            e.printStackTrace();
597
                        }
598
                        if (null != jsonArray) {
599
                            if (jsonArray.length() > 0) {
600
                                rl_new_comment.setVisibility(View.VISIBLE);
601
                                try {
602
                                    s = jsonArray.get(0).toString();
603
                                } catch (JSONException e) {
604
                                    e.printStackTrace();
605
                                }
606
                                String nickname = JsonUtils.getKeyResult(s, "nickname");
607
                                String tel = JsonUtils.getKeyResult(s, "tel");
608
                                String content = JsonUtils.getKeyResult(s, "content");
609
                                String chexing = JsonUtils.getKeyResult(s, "chexing");
610
                                String star_level = JsonUtils.getKeyResult(s, "star_level");
611
                                String userpic = JsonUtils.getKeyResult(s, "userpic");
612
                                String addtime = JsonUtils.getKeyResult(s, "addtime");
613
                                String tag = JsonUtils.getKeyResult(s, "tag");
614
                                String thumUrl = JsonUtils.getKeyResult(s, "thumUrl");
615
                                String fileUrl = JsonUtils.getKeyResult(s, "fileUrl");
616
                                String title = JsonUtils.getKeyResult(s, "title");
617
//                                Log.e(TAG, "handleMessage: title="+title );
618
619
                                if (title != null) {
620
                                    if (title.equals("")) {
621
                                        iv_level_img.setVisibility(View.GONE);
622
                                    } else if (title.equals("V0")) {
623
                                        iv_level_img.setVisibility(View.GONE);
624
//                    holder.iv_level_img.setImageResource(R.drawable.icon_level_putong);
625
                                    } else if (title.equals("V1")) {
626
                                        iv_level_img.setVisibility(View.VISIBLE);
627
                                        iv_level_img.setImageResource(R.drawable.icon_qingtong);
628
                                    } else if (title.equals("V2")) {
629
                                        iv_level_img.setVisibility(View.VISIBLE);
630
                                        iv_level_img.setImageResource(R.drawable.icon_baiyin);
631
                                    } else if (title.equals("V3")) {
632
                                        iv_level_img.setVisibility(View.VISIBLE);
633
                                        iv_level_img.setImageResource(R.drawable.icon_huangjin);
634
                                    } else if (title.equals("V4")) {
635
                                        iv_level_img.setVisibility(View.VISIBLE);
636
                                        iv_level_img.setImageResource(R.drawable.icon_bojin);
637
                                    } else if (title.equals("V5")) {
638
                                        iv_level_img.setVisibility(View.VISIBLE);
639
                                        iv_level_img.setImageResource(R.drawable.icon_zuanshi);
640
                                    }
641
                                }
642
643
                                if (thumUrl != null && fileUrl != null && !thumUrl.equals("") && !fileUrl.equals("")) {
644
                                    iv_commentPic.setVisibility(View.VISIBLE);
645
                                    final String url = MainApplication.url + "/zhannew/uploadfile/" + thumUrl;
646
                                    final String file_url = MainApplication.url + "/zhannew/uploadfile/" + fileUrl;
647
                                    final String[] ss = {file_url};
648
                                    Picasso.with(MainApplication.context)
649
                                            .load(url)
650
                                            .into(iv_commentPic);
651
                                    iv_commentPic.setOnClickListener(new View.OnClickListener() {
652
                                        @Override
653
                                        public void onClick(View v) {
654
                                            Intent intent = new Intent(getContext(), ImagePagerActivity.class);
655
                                            // 图片url,为了演示这里使用常量,一般从数据库中或网络中获取
656
                                            intent.putExtra(ImagePagerActivity.EXTRA_IMAGE_URLS, ss);
657
                                            intent.putExtra(ImagePagerActivity.EXTRA_IMAGE_INDEX, 0);
658
                                            getContext().startActivity(intent);
659
                                        }
660
                                    });
661
                                } else {
662
                                    iv_commentPic.setVisibility(View.GONE);
663
                                }
664
                                if (tag != null && tag.equals("")) {
665
                                    mFlowLayout.setVisibility(View.GONE);
666
                                } else {
667
                                    if (null == getActivity()) {
668
                                        mFlowLayout.setVisibility(View.GONE);
669
                                    } else {
670
                                        if (null != getActivity()) {
671
                                            mFlowLayout.setVisibility(View.VISIBLE);
672
                                            final LayoutInflater mInflater = LayoutInflater.from(getActivity());
673
                                            stringArr = tag.split(",");
674
                                            mFlowLayout.setClickable(false);
675
                                            mFlowLayout.setEnabled(false);
676
                                            mFlowLayout.setAdapter(new TagAdapter<String>(stringArr) {
677
                                                @Override
678
                                                public View getView(FlowLayout parent, int position, String s) {
679
                                                    TextView tv = (TextView) mInflater.inflate(R.layout.tv1,
680
                                                            mFlowLayout, false);
681
                                                    tv.setText(s);
682
                                                    return tv;
683
                                                }
684
                                            });
685
                                        }
686
                                    }
687
                                }
688
                                tv_new_time.setText(TimeStamp2Date(addtime, "yyyy-MM-dd"));
689
                                String url = MainApplication.url + "/zhannew/uploadfile/" + userpic;
690
//                                Log.e(TAG, "handleMessage: userpic="+userpic );
691
//                                Log.e(TAG, "handleMessage: userpic-url="+url );
692
//                                Log.d("ss==",url);
693
//                                if (null != getActivity()) {
694
//                                    Glide.with(getActivity())
605
//                    if (null != msg.obj) {
606
//                        JSONArray jsonArray = null;
607
//                        String s = null;
608
//                        try {
609
//                            jsonArray = new JSONArray(msg.obj.toString());
610
//
611
////                            Log.e("s==",s);
612
//                        } catch (JSONException e) {
613
//                            e.printStackTrace();
614
//                        }
615
//                        if (null != jsonArray) {
616
//                            if (jsonArray.length() > 0) {
617
//                                rl_new_comment.setVisibility(View.VISIBLE);
618
//                                try {
619
//                                    s = jsonArray.get(0).toString();
620
//                                } catch (JSONException e) {
621
//                                    e.printStackTrace();
622
//                                }
623
//                                String nickname = JsonUtils.getKeyResult(s, "nickname");
624
//                                String tel = JsonUtils.getKeyResult(s, "tel");
625
//                                String chexing = JsonUtils.getKeyResult(s, "chexing");
626
//                                String star_level = JsonUtils.getKeyResult(s, "star_level");
627
//                                String userpic = JsonUtils.getKeyResult(s, "userpic");
628
//                                String addtime = JsonUtils.getKeyResult(s, "addtime");
629
//                                String tag = JsonUtils.getKeyResult(s, "tag");
630
//                                String thumUrl = JsonUtils.getKeyResult(s, "thumUrl");
631
//                                String fileUrl = JsonUtils.getKeyResult(s, "fileUrl");
632
//1
633
//
634
//                                if (thumUrl != null && fileUrl != null && !thumUrl.equals("") && !fileUrl.equals("")) {
635
//                                    iv_commentPic.setVisibility(View.VISIBLE);
636
//                                    final String url = MainApplication.url + "/zhannew/uploadfile/" + thumUrl;
637
//                                    final String file_url = MainApplication.url + "/zhannew/uploadfile/" + fileUrl;
638
//                                    final String[] ss = {file_url};
639
//                                    Picasso.with(MainApplication.context)
695 640
//                                            .load(url)
696
//                                            .placeholder(R.drawable.icon_user1118)
697
//                                            .error(R.drawable.icon_user1118)
698
//                                            .into(iv_new_icon);
699
//                                }else {
700
//                                    iv_new_icon.setImageResource(R.drawable.icon_user1118);
641
//                                            .into(iv_commentPic);
642
//                                    iv_commentPic.setOnClickListener(new View.OnClickListener() {
643
//                                        @Override
644
//                                        public void onClick(View v) {
645
//                                            Intent intent = new Intent(getContext(), ImagePagerActivity.class);
646
//                                            // 图片url,为了演示这里使用常量,一般从数据库中或网络中获取
647
//                                            intent.putExtra(ImagePagerActivity.EXTRA_IMAGE_URLS, ss);
648
//                                            intent.putExtra(ImagePagerActivity.EXTRA_IMAGE_INDEX, 0);
649
//                                            getContext().startActivity(intent);
650
//                                        }
651
//                                    });
652
//                                } else {
653
//                                    iv_commentPic.setVisibility(View.GONE);
701 654
//                                }
702
//                                PicassoUtil.loadingNetImage(getActivity(), url
703
//                                        , iv_new_icon);
704
                                Picasso.with(MainApplication.context)
705
                                        .load(url)
706
                                        .error(R.drawable.icon_user1118)
707
                                        .placeholder(R.drawable.icon_user1118)
708
                                        .into(iv_new_icon);
709
710
                                if (content.equals("") || content.equals(" ")) {
711
                                    tv_new_comment.setVisibility(View.GONE);
712
                                } else {
713
                                    tv_new_comment.setVisibility(View.VISIBLE);
714
                                    SpannableString ss = new SpannableString(content);
715
                                    Pattern pattern = Pattern.compile("#[0-9a-zA-Z\\u4e00-\\u9fa5]+#");
716
                                    Matcher matcher = pattern.matcher(ss);
717
                                    while (matcher.find()) {
718
                                        int start = matcher.start();
719
                                        int end = matcher.end();
720
                                        ss.setSpan(new ForegroundColorSpan(getResources().getColor(R.color.topic_blue)), start, end, Spanned.SPAN_EXCLUSIVE_EXCLUSIVE);
721
722
                                    }
723
                                    tv_new_comment.setText(ss);
724
                                }
725
726
727
                                tv_new_name.setText(nickname);
728
                                if (!nickname.equals("") && !nickname.equals("null")) {
729
                                    tv_new_name.setText(nickname);
730
                                } else {
731
                                    tv_new_name.setText(Util.handlePhoneComment(tel));
732
                                }
733
734
                                if ("待购".equals(chexing)) {
735
                                    tv_new_car.setText("待购");
736
                                } else {
737
                                    String[] strarray = chexing.split("\\$\\$");
738
                                    String name0 = null, name1 = null;
739
                                    if (strarray.length > 1) {
740
                                        name0 = strarray[0];//江淮
741
                                        name1 = strarray[1];//iEV3
742
                                    }
743
                                    if (chexing.equals("nullnull") || chexing == null || chexing.equals("") || chexing.equals("null") || chexing.equals("品牌$$车型") || chexing.equals("null$$null")) {
744
                                        tv_new_car.setText("");
745
                                    } else {
746
                                        tv_new_car.setText(name0 + name1);
747
                                    }
748
                                }
749
                                if (star_level.equals("")) {
750
                                    star_level = "0";
751
                                }
752
                                double d = Double.parseDouble(star_level);
753
                                if (d == 0) {
754
                                    iv_new_pingfen.setVisibility(View.GONE);
755
                                } else {
756
                                    if (d > 0 && d < 1) {
757
                                        iv_new_pingfen.setImageResource(R.drawable.icon_05xing);
758
                                        iv_new_pingfen.setVisibility(View.VISIBLE);
759
                                    } else if (d >= 1 && d < 1.5) {
760
                                        iv_new_pingfen.setVisibility(View.VISIBLE);
761
                                        iv_new_pingfen.setImageResource(R.drawable.icon_1xing);
762
                                    } else if (d >= 1.5 && d < 2) {
763
                                        iv_new_pingfen.setVisibility(View.VISIBLE);
764
                                        iv_new_pingfen.setImageResource(R.drawable.icon_15xing);
765
                                    } else if (d >= 2 && d < 2.5) {
766
                                        iv_new_pingfen.setVisibility(View.VISIBLE);
767
                                        iv_new_pingfen.setImageResource(R.drawable.icon_2xing);
768
                                    } else if (d >= 2.5 && d < 3) {
769
                                        iv_new_pingfen.setVisibility(View.VISIBLE);
770
                                        iv_new_pingfen.setImageResource(R.drawable.icon_25xing);
771
                                    } else if (d >= 3 && d < 3.5) {
772
                                        iv_new_pingfen.setVisibility(View.VISIBLE);
773
                                        iv_new_pingfen.setImageResource(R.drawable.icon_3xing);
774
                                    } else if (d >= 3.5 && d < 4) {
775
                                        iv_new_pingfen.setVisibility(View.VISIBLE);
776
                                        iv_new_pingfen.setImageResource(R.drawable.icon_35xing);
777
                                    } else if (d >= 4 && d < 4.5) {
778
                                        iv_new_pingfen.setVisibility(View.VISIBLE);
779
                                        iv_new_pingfen.setImageResource(R.drawable.icon_4xing);
780
                                    } else if (d >= 4.5 && d < 5) {
781
                                        iv_new_pingfen.setVisibility(View.VISIBLE);
782
                                        iv_new_pingfen.setImageResource(R.drawable.icon_45xing);
783
                                    } else {
784
                                        iv_new_pingfen.setVisibility(View.VISIBLE);
785
                                        iv_new_pingfen.setImageResource(R.drawable.icon_5xing);
786
                                    }
787
                                }
788
789
                            } else {
790
                                rl_new_comment.setVisibility(View.GONE);
791
                            }
792
                        }
793
                    }
655
//                                if (tag != null && tag.equals("")) {
656
//                                    mFlowLayout.setVisibility(View.GONE);
657
//                                } else {
658
//                                    if (null == getActivity()) {
659
//                                        mFlowLayout.setVisibility(View.GONE);
660
//                                    } else {
661
//                                        if (null != getActivity()) {
662
//                                            mFlowLayout.setVisibility(View.VISIBLE);
663
//                                            final LayoutInflater mInflater = LayoutInflater.from(getActivity());
664
//                                            stringArr = tag.split(",");
665
//                                            mFlowLayout.setClickable(false);
666
//                                            mFlowLayout.setEnabled(false);
667
//                                            mFlowLayout.setAdapter(new TagAdapter<String>(stringArr) {
668
//                                                @Override
669
//                                                public View getView(FlowLayout parent, int position, String s) {
670
//                                                    TextView tv = (TextView) mInflater.inflate(R.layout.tv1,
671
//                                                            mFlowLayout, false);
672
//                                                    tv.setText(s);
673
//                                                    return tv;
674
//                                                }
675
//                                            });
676
//                                        }
677
//                                    }
678
//                                }
679
//                                tv_new_time.setText(TimeStamp2Date(addtime, "yyyy-MM-dd"));
680
//                                String url = MainApplication.url + "/zhannew/uploadfile/" + userpic;
681
//
682
//                                Picasso.with(MainApplication.context)
683
//                                        .load(url)
684
//                                        .error(R.drawable.icon_user1118)
685
//                                        .placeholder(R.drawable.icon_user1118)
686
//                                        .into(iv_new_icon);
687
//
688
//
689
//
690
//
691
//                                tv_new_name.setText(nickname);
692
//                                if (!nickname.equals("") && !nickname.equals("null")) {
693
//                                    tv_new_name.setText(nickname);
694
//                                } else {
695
//                                    tv_new_name.setText(Util.handlePhoneComment(tel));
696
//                                }
697
//
698
//                                if ("待购".equals(chexing)) {
699
//                                    tv_new_car.setText("待购");
700
//                                } else {
701
//                                    String[] strarray = chexing.split("\\$\\$");
702
//                                    String name0 = null, name1 = null;
703
//                                    if (strarray.length > 1) {
704
//                                        name0 = strarray[0];//江淮
705
//                                        name1 = strarray[1];//iEV3
706
//                                    }
707
//                                    if (chexing.equals("nullnull") || chexing == null || chexing.equals("") || chexing.equals("null") || chexing.equals("品牌$$车型") || chexing.equals("null$$null")) {
708
//                                        tv_new_car.setText("");
709
//                                    } else {
710
//                                        tv_new_car.setText(name0 + name1);
711
//                                    }
712
//                                }
713
//                                if (star_level.equals("")) {
714
//                                    star_level = "0";
715
//                                }
716
//                                double d = Double.parseDouble(star_level);
717
//                                if (d == 0) {
718
//                                    iv_new_pingfen.setVisibility(View.GONE);
719
//                                } else {
720
//                                    if (d > 0 && d < 1) {
721
//                                        iv_new_pingfen.setImageResource(R.drawable.icon_05xing);
722
//                                        iv_new_pingfen.setVisibility(View.VISIBLE);
723
//                                    } else if (d >= 1 && d < 1.5) {
724
//                                        iv_new_pingfen.setVisibility(View.VISIBLE);
725
//                                        iv_new_pingfen.setImageResource(R.drawable.icon_1xing);
726
//                                    } else if (d >= 1.5 && d < 2) {
727
//                                        iv_new_pingfen.setVisibility(View.VISIBLE);
728
//                                        iv_new_pingfen.setImageResource(R.drawable.icon_15xing);
729
//                                    } else if (d >= 2 && d < 2.5) {
730
//                                        iv_new_pingfen.setVisibility(View.VISIBLE);
731
//                                        iv_new_pingfen.setImageResource(R.drawable.icon_2xing);
732
//                                    } else if (d >= 2.5 && d < 3) {
733
//                                        iv_new_pingfen.setVisibility(View.VISIBLE);
734
//                                        iv_new_pingfen.setImageResource(R.drawable.icon_25xing);
735
//                                    } else if (d >= 3 && d < 3.5) {
736
//                                        iv_new_pingfen.setVisibility(View.VISIBLE);
737
//                                        iv_new_pingfen.setImageResource(R.drawable.icon_3xing);
738
//                                    } else if (d >= 3.5 && d < 4) {
739
//                                        iv_new_pingfen.setVisibility(View.VISIBLE);
740
//                                        iv_new_pingfen.setImageResource(R.drawable.icon_35xing);
741
//                                    } else if (d >= 4 && d < 4.5) {
742
//                                        iv_new_pingfen.setVisibility(View.VISIBLE);
743
//                                        iv_new_pingfen.setImageResource(R.drawable.icon_4xing);
744
//                                    } else if (d >= 4.5 && d < 5) {
745
//                                        iv_new_pingfen.setVisibility(View.VISIBLE);
746
//                                        iv_new_pingfen.setImageResource(R.drawable.icon_45xing);
747
//                                    } else {
748
//                                        iv_new_pingfen.setVisibility(View.VISIBLE);
749
//                                        iv_new_pingfen.setImageResource(R.drawable.icon_5xing);
750
//                                    }
751
//                                }
752
//
753
//                            } else {
754
//                                rl_new_comment.setVisibility(View.GONE);
755
//                            }
756
//                        }
757
//                    }
794 758
                    break;
795 759
796 760
                default:
@ -802,6 +766,7 @@ public class DetailsFragment extends Fragment implements View.OnClickListener, O
802 766
    private ImageView scan_charge_btn;
803 767
    private Space scan_charge_space;
804 768
    private String telNum;
769
    private RelativeLayout rl_new_comment;
805 770
806 771
    @Override
807 772
    public View onCreateView(LayoutInflater inflater, ViewGroup container,
@ -838,7 +803,7 @@ public class DetailsFragment extends Fragment implements View.OnClickListener, O
838 803
                MobclickAgent.onEvent(getActivity(), "0210");
839 804
            }
840 805
        });
841
        eteCityTime(null);
806
        //eteCityTime(null);
842 807
    }
843 808
844 809
    public String TimeStamp2Date(String timestampString, String formats) {
@ -893,7 +858,7 @@ public class DetailsFragment extends Fragment implements View.OnClickListener, O
893 858
        tv_cost_info.setOnClickListener(this);
894 859
895 860
        current_time_slot = (TextView) v.findViewById(R.id.current_time_slot);
896
        iv_level_img = (ImageView) v.findViewById(R.id.iv_level_img);
861
897 862
        detail_view = v.findViewById(R.id.detail_view);
898 863
        detail_claimer_remark = (LinearLayout) v.findViewById(R.id.detail_claimer_remark);
899 864
        detail_tel = (RelativeLayout) v.findViewById(R.id.detail_tel);
@ -928,23 +893,37 @@ public class DetailsFragment extends Fragment implements View.OnClickListener, O
928 893
        detail_go_list = (TextView) v.findViewById(R.id.detail_charging_enter);
929 894
        detail_go_list.setOnClickListener(this);
930 895
931
932
        iv_commentPic = (ImageView) v.findViewById(R.id.iv_commentPic);
933
        mFlowLayout = (TagFlowLayout) v.findViewById(R.id.id_flowlayout_activity);
934
        rl_new_comment = (RelativeLayout) v.findViewById(R.id.rl_new_comment);
935
        tv_1 = (TextView) v.findViewById(R.id.tv_1);
936
        tv_new_comment = (TextView) v.findViewById(R.id.tv_new_comment);
937
        tv_new_name = (TextView) v.findViewById(R.id.tv_new_name);
938
        tv_new_car = (TextView) v.findViewById(R.id.tv_new_car);
939
        tv_new_time = (TextView) v.findViewById(R.id.tv_new_time);
940
        iv_location = (ImageView) v.findViewById(R.id.iv_location);
941
        iv_new_pingfen = (ImageView) v.findViewById(R.id.iv_new_pingfen);
942
        iv_new_icon = (CircleImageView) v.findViewById(R.id.iv_new_icon);
943
        ll_yunyingshang = (LinearLayout) v.findViewById(R.id.ll_yunyingshang);
944
        view_789 = v.findViewById(R.id.view_789);
945 896
        scan_charge_btn = v.findViewById(R.id.scan_charge_btn);
946 897
        scan_charge_btn.setOnClickListener(this);
947 898
        scan_charge_space = v.findViewById(R.id.scan_charge_space);
899
900
        rl_new_comment = v.findViewById(R.id.rl_new_comment);
901
902
         tv_pname = (TextView) v.findViewById(R.id.tv_pname);
903
         tv_pdelete = (TextView) v.findViewById(R.id.tv_pdelete);
904
         tv_ptime = (TextView) v.findViewById(R.id.tv_ptime);
905
         tv_pcontext = (TextView) v.findViewById(R.id.tv_pcontext);
906
         tv_pcar = (TextView) v.findViewById(R.id.tv_pcar);
907
         tv_preply = (TextView) v.findViewById(R.id.tv_preply);
908
         tv_pzan = (TextView) v.findViewById(R.id.tv_pzan);
909
         tv_more = (TextView) v.findViewById(R.id.tv_more);
910
         lv_scomment = (ListView) v.findViewById(R.id.lv_scomment);
911
912
         iv_picon = (ImageView) v.findViewById(R.id.iv_picon);
913
         certified_icon = (ImageView) v.findViewById(R.id.certified_icon);
914
         high_grade_comment_icon = (ImageView) v.findViewById(R.id.high_grade_comment_icon);
915
         iv_pgrade = (ImageView) v.findViewById(R.id.iv_pgrade);
916
         iv_commentPic = (ImageView) v.findViewById(R.id.iv_commentPic);
917
         imgTwo = (ImageView) v.findViewById(R.id.imgTwo);
918
         imgThree = (ImageView) v.findViewById(R.id.imgThree);
919
         imgStart = (ImageView) v.findViewById(R.id.imgStart);
920
         imgVideo = (ImageView) v.findViewById(R.id.imgVideo);
921
         iv_level_img = (ImageView) v.findViewById(R.id.iv_level_img);
922
         iv_pzan = (ImageView) v.findViewById(R.id.iv_pzan);
923
         ll_pzan = (LinearLayout) v.findViewById(R.id.ll_pzan);
924
         fl_ptag = (TagFlowLayout) v.findViewById(R.id.fl_ptag);
925
         parent = (RelativeLayout) v.findViewById(R.id.parent);
926
         imgLayout = (RelativeLayout) v.findViewById(R.id.imgLayout);
948 927
    }
949 928
950 929
    @Override
@ -1263,40 +1242,256 @@ public class DetailsFragment extends Fragment implements View.OnClickListener, O
1263 1242
1264 1243
    @Subscribe
1265 1244
    public void eteCityTime(RankinglistRefreshEvent rankinglistRefreshEvent) {
1245
        String url = MainApplication.url + "/zhannew/basic/web/index.php/tpappcomments/get-comments?zhanid=" + NewZhanDetailsActivity.zhan_id + "&page=1";
1246
        OkHttpUtils.get().url(url).build().execute(new StringCallback() {
1247
            @Override
1248
            public void onError(Call call, Exception e) {
1249
1250
            }
1266 1251
1267
        new Thread(new Runnable() {
1268 1252
            @Override
1269
            public void run() {
1270
                try {
1271
                    long appTime4 = System.currentTimeMillis() / 1000;
1272
                    long updatetime4 = appTime4 - MainMapActivity.cha - 1;
1273
                    String token4 = String.valueOf(updatetime4);
1274
                    String url = "{\"fun\":\"getcomment\",\"zhan_id\":" + "\"" + NewZhanDetailsActivity.zhan_id + "\"" + ",\"timer\":" + "\"" + URLEncoder.encode(DES3.encode(token4)) + "\"" + "}";
1275
//                    Log.e("url===", url);
1276
                    // 创建Socket
1277
                    // socket = new Socket("192.168.1.110",54321);
1278
                    socket = new Socket("cdz.evcharge.cc", 9503); // IP:10.14.114.127,端口54321
1279
                    // 向服务器发送消息
1280
                    PrintWriter out = new PrintWriter(new BufferedWriter(
1281
                            new OutputStreamWriter(socket.getOutputStream())), true);
1282
                    out.println(url);
1283
                    // out.println("{\"fun\":\"getcity\"}");
1284
                    // 接收来自服务器的消息
1285
                    BufferedReader br = new BufferedReader(new InputStreamReader(
1286
                            socket.getInputStream()));
1287
                    String msg = br.readLine();
1288
//                    Log.e("===",msg);
1289
                    if (msg != null) {
1290
                        Message mes = new Message();
1291
                        mes.obj = msg;
1292
                        mes.what = 6;
1293
                        handler.sendMessage(mes);
1294
                    }
1253
            public void onResponse(String response) {
1254
                String rtnCode = JsonUtils.getKeyResult(response, "rtnCode");
1255
                if (null != rtnCode && rtnCode.equals("01")) {
1256
                    try {
1257
                        JSONObject responseJson = new JSONObject(response);
1258
                        String commentData = responseJson.getString("data");
1259
                        JSONArray jsonArray = new JSONArray(commentData);
1260
                        ArrayList<JSONObject> datasJson = new ArrayList<JSONObject>();
1261
                        for (int j = 0; j < jsonArray.length(); j++) {
1262
                            JSONObject jsonObject = (JSONObject) jsonArray.opt(j);
1263
                            String is_play = TextUtils.isEmpty(jsonObject.getString("is_play")) ? "" : jsonObject.getString("is_play"); //0 审核未通过 item隐藏,1 审核通过,item显示
1264
                            String type = TextUtils.isEmpty(jsonObject.getString("type")) ? "" : jsonObject.getString("type"); //23 视频,24 图片
1265
                            if (type.equals("23")) {
1266
                                if (is_play.equals("1")) {
1267
                                    datasJson.add(jsonObject);
1268
                                }
1269
                            } else {
1270
                                datasJson.add(jsonObject);
1271
                            }
1272
                        }
1273
                        if(datasJson.size()>0){
1274
                            rl_new_comment.setVisibility(View.VISIBLE);
1275
1276
                            JSONObject jsonObject = datasJson.get(0);
1277
                            String title = jsonObject.optString("title");
1278
                            String name = jsonObject.optString("nickname");
1279
                            String tel = jsonObject.optString("tel");
1280
                            String content = jsonObject.optString("content");
1281
                            String  theme= jsonObject.optString("theme");
1282
                            String addtime =jsonObject.optString("addtime");
1283
                            String chexing = jsonObject.optString("hascar");
1284
                            int isCertifiedOwner =jsonObject.optInt("is_certified_owner");
1285
                            final String pic_url = MainApplication.url + "/zhannew/uploadfile/" + jsonObject.optString("userpic");
1286
                            String fine = jsonObject.optString("fine");
1287
1288
                            if (title.equals("")) {
1289
                                iv_level_img.setVisibility(View.GONE);
1290
                            } else if (title.equals("V0")) {
1291
                                iv_level_img.setVisibility(View.GONE);
1292
                            } else if (title.equals("V1")) {
1293
                                iv_level_img.setVisibility(View.VISIBLE);
1294
                                iv_level_img.setImageResource(R.drawable.icon_qingtong);
1295
                            } else if (title.equals("V2")) {
1296
                                iv_level_img.setVisibility(View.VISIBLE);
1297
                                iv_level_img.setImageResource(R.drawable.icon_baiyin);
1298
                            } else if (title.equals("V3")) {
1299
                                iv_level_img.setVisibility(View.VISIBLE);
1300
                                iv_level_img.setImageResource(R.drawable.icon_huangjin);
1301
                            } else if (title.equals("V4")) {
1302
                                iv_level_img.setVisibility(View.VISIBLE);
1303
                                iv_level_img.setImageResource(R.drawable.icon_bojin);
1304
                            } else if (title.equals("V5")) {
1305
                                iv_level_img.setVisibility(View.VISIBLE);
1306
                                iv_level_img.setImageResource(R.drawable.icon_zuanshi);
1307
                            }
1295 1308
1296
                } catch (Exception e) {
1309
1310
                            if (!TextUtils.isEmpty(theme.trim())){
1311
                                content= "#"+theme+"#"+content;
1312
                            }
1313
                            if (content.equals("") || content.equals(" ")) {
1314
                                tv_pcontext.setVisibility(View.GONE);
1315
                            } else {
1316
                                tv_pcontext.setVisibility(View.VISIBLE);
1317
                                SpannableString ss = new SpannableString(content);
1318
                                Pattern pattern = Pattern.compile("#[0-9a-zA-Z,\\u4e00-\\u9fa5]+#");
1319
                                Matcher matcher = pattern.matcher(ss);
1320
                                while (matcher.find()) {
1321
                                    int start = matcher.start();
1322
                                    int end = matcher.end();
1323
                                    ss.setSpan(new ForegroundColorSpan(getResources().getColor(R.color.topic_green)), start, end, Spanned.SPAN_EXCLUSIVE_EXCLUSIVE);
1324
1325
                                }
1326
                                tv_pcontext.setText(ss);
1327
                            }
1328
1329
                              //父级头像
1330
                            iv_picon.setImageResource(R.drawable.icon_user1118);
1331
1332
                             Picasso.with(getActivity())
1333
                                .load(pic_url)
1334
                                .error(R.drawable.icon_user1118)
1335
                                .placeholder(R.drawable.icon_user1118)
1336
                                .transform(new CircleTransform())
1337
                                .into(iv_picon);
1338
                            //父级显示名称
1339
                            if (!name.equals("") && !name.equals("null")) {
1340
                                tv_pname.setText(name);
1341
                            } else {
1342
                                tv_pname.setText(Util.handlePhoneComment(tel));
1343
                            }
1344
                            //父级评论时间
1345
                            tv_ptime.setText(TimeStamp2Date(addtime, "yyyy-MM-dd"));
1346
                            //父级评论人车型
1347
1348
                            tv_pcar.setText(CarTypeUtil.getCarType(chexing));
1349
                            if (isCertifiedOwner == 1) {
1350
                                certified_icon.setVisibility(View.VISIBLE);
1351
                            } else {
1352
                               certified_icon.setVisibility(View.GONE);
1353
                            }
1354
1355
1356
                            if ("1".equals(fine)) {
1357
                                high_grade_comment_icon.setVisibility(View.VISIBLE);
1358
                            } else {
1359
                                high_grade_comment_icon.setVisibility(View.GONE);
1360
                            }
1361
1362
                            String tag =jsonObject.optString("tag");
1363
                            if (tag.equals("")) {
1364
                                fl_ptag.setVisibility(View.GONE);
1365
                            } else {
1366
                                fl_ptag.setVisibility(View.VISIBLE);
1367
                                stringArr = tag.split(",");
1368
                                fl_ptag.setClickable(false);
1369
                                fl_ptag.setEnabled(false);
1370
                                fl_ptag.setAdapter(new TagAdapter<String>(stringArr) {
1371
                                    @Override
1372
                                    public View getView(FlowLayout parent, int position, String s) {
1373
                                        TextView tv = (TextView)  LayoutInflater.from(getContext()).inflate(R.layout.tv_comment, fl_ptag, false);
1374
                                        tv.setText(s);
1375
                                        return tv;
1376
                                    }
1377
                                });
1378
                            }
1379
                            //父级点赞
1380
                            String agree_num = jsonObject.optString("agree_num");
1381
                            if (agree_num.equals("0")) {
1382
                                tv_pzan.setText("赞");
1383
                            } else {
1384
                                tv_pzan.setText(agree_num);
1385
                            }
1386
1387
                            String type = TextUtils.isEmpty(jsonObject.optString("type"))?"":jsonObject.optString("type"); //23 视频,24 图片
1388
1389
1390
                            //父级评论图片
1391
                            String fileUrl = jsonObject.optString("fileUrl");
1392
                            String file2Url = jsonObject.optString("file2Url");
1393
                            String file3Url = jsonObject.optString("file3Url");
1394
                            if (type.equals("23")){
1395
                                imgVideo.setVisibility(View.VISIBLE);
1396
                                imgStart.setVisibility(View.VISIBLE);
1397
                                imgLayout.setVisibility(View.VISIBLE);
1398
1399
                                iv_commentPic.setVisibility(View.GONE);
1400
                                imgTwo.setVisibility(View.GONE);
1401
                                imgThree.setVisibility(View.GONE);
1402
1403
                                String thumUrl = jsonObject.optString("thumUrl");
1404
                                if (!TextUtils.isEmpty(thumUrl) && !TextUtils.isEmpty(fileUrl)){
1405
                                    Glide.with(MainApplication.context)
1406
                                            .load(MainApplication.CDN +thumUrl)
1407
                                            .into(imgVideo);
1408
                                }
1409
1410
                            }else {
1411
1412
                                imgVideo.setVisibility(View.GONE);
1413
                                imgStart.setVisibility(View.GONE);
1414
1415
                                if (!fileUrl.equals("")) {
1416
                                    iv_commentPic.setVisibility(View.VISIBLE);
1417
                                    imgLayout.setVisibility(View.VISIBLE);
1418
1419
                                    Picasso.with(MainApplication.context)
1420
                                            .load(MainApplication.url + "/zhannew/uploadfile/"+fileUrl)
1421
                                            .into(iv_commentPic);
1422
1423
                                } else {
1424
                                    iv_commentPic.setVisibility(View.GONE);
1425
                                    imgLayout.setVisibility(View.GONE);
1426
                                }
1427
                                if (!file2Url.equals("")) {
1428
                                    imgTwo.setVisibility(View.VISIBLE);
1429
                                    Picasso.with(MainApplication.context)
1430
                                            .load(MainApplication.url + "/zhannew/uploadfile/"+file2Url)
1431
                                            .into(imgTwo);
1432
                                } else {
1433
                                    imgTwo.setVisibility(View.GONE);
1434
                                }
1435
                                if (!file3Url.equals("")) {
1436
                                    imgThree.setVisibility(View.VISIBLE);
1437
                                    Picasso.with(MainApplication.context)
1438
                                            .load(MainApplication.url + "/zhannew/uploadfile/"+file3Url)
1439
                                            .into(imgThree);
1440
                                } else {
1441
                                    imgThree.setVisibility(View.GONE);
1442
                                }
1443
                            }
1444
                            //父级评分
1445
                            String grade = jsonObject.optString("star_level");
1446
                            if (grade.equals("")) {
1447
                                iv_pgrade.setVisibility(View.GONE);
1448
                            } else {
1449
                                double d = Double.parseDouble(grade);
1450
                                if (d == 0) {
1451
                                    iv_pgrade.setVisibility(View.GONE);
1452
                                } else {
1453
                                    if (d > 0 && d < 1) {
1454
                                        iv_pgrade.setImageResource(R.drawable.icon_05xing);
1455
                                        iv_pgrade.setVisibility(View.VISIBLE);
1456
                                    } else if (d >= 1 && d < 1.5) {
1457
                                        iv_pgrade.setVisibility(View.VISIBLE);
1458
                                        iv_pgrade.setImageResource(R.drawable.icon_1xing);
1459
                                    } else if (d >= 1.5 && d < 2) {
1460
                                        iv_pgrade.setVisibility(View.VISIBLE);
1461
                                        iv_pgrade.setImageResource(R.drawable.icon_15xing);
1462
                                    } else if (d >= 2 && d < 2.5) {
1463
                                        iv_pgrade.setVisibility(View.VISIBLE);
1464
                                        iv_pgrade.setImageResource(R.drawable.icon_2xing);
1465
                                    } else if (d >= 2.5 && d < 3) {
1466
                                        iv_pgrade.setVisibility(View.VISIBLE);
1467
                                        iv_pgrade.setImageResource(R.drawable.icon_25xing);
1468
                                    } else if (d >= 3 && d < 3.5) {
1469
                                        iv_pgrade.setVisibility(View.VISIBLE);
1470
                                        iv_pgrade.setImageResource(R.drawable.icon_3xing);
1471
                                    } else if (d >= 3.5 && d < 4) {
1472
                                        iv_pgrade.setVisibility(View.VISIBLE);
1473
                                        iv_pgrade.setImageResource(R.drawable.icon_35xing);
1474
                                    } else if (d >= 4 && d < 4.5) {
1475
                                        iv_pgrade.setVisibility(View.VISIBLE);
1476
                                        iv_pgrade.setImageResource(R.drawable.icon_4xing);
1477
                                    } else if (d >= 4.5 && d < 5) {
1478
                                        iv_pgrade.setVisibility(View.VISIBLE);
1479
                                        iv_pgrade.setImageResource(R.drawable.icon_45xing);
1480
                                    } else {
1481
                                        iv_pgrade.setVisibility(View.VISIBLE);
1482
                                        iv_pgrade.setImageResource(R.drawable.icon_5xing);
1483
                                    }
1484
                                }
1485
                            }
1486
                        }else{
1487
                            rl_new_comment.setVisibility(View.GONE);
1488
                        }
1489
                    } catch (Exception e) {
1490
1491
                    }
1297 1492
                }
1298 1493
            }
1299
        }).start();
1494
        });
1300 1495
    }
1301 1496
1302 1497
    @Override

+ 9 - 1
app/src/main/java/com/electric/chargingpile/fragment/ZhanCommentFragment.java

@ -374,7 +374,15 @@ public class ZhanCommentFragment extends Fragment {
374 374
375 375
                                for (int j = 0; j < jsonArray.length(); j++) {
376 376
                                    JSONObject jsonObject = (JSONObject) jsonArray.opt(j);
377
                                    datas.add(jsonObject);
377
                                    String is_play = TextUtils.isEmpty( jsonObject.getString("is_play"))?"": jsonObject.getString("is_play")  ; //0 审核未通过 item隐藏,1 审核通过,item显示
378
                                    String type = TextUtils.isEmpty(jsonObject.getString("type"))?"":jsonObject.getString("type"); //23 视频,24 图片
379
                                    if (type.equals("23")){
380
                                        if (is_play.equals("1")){
381
                                            datas.add(jsonObject);
382
                                        }
383
                                    }else{
384
                                        datas.add(jsonObject);
385
                                    }
378 386
                                }
379 387
380 388
                                if (isClear == false) {

+ 10 - 0
app/src/main/res/drawable/bg_main_notification.xml

@ -0,0 +1,10 @@
1
<?xml version="1.0" encoding="utf-8"?>
2
<shape xmlns:android="http://schemas.android.com/apk/res/android"
3
    android:shape="rectangle" >
4
5
    <!-- 表示shape的四个角的角度。只适用于矩形shape,这里的角度是指圆角的程度 -->
6
    <corners android:radius="20dp" />
7
8
    <!-- 这个标签表示纯色填充,通过android:color即可指定shape中填充的颜色 -->
9
    <solid android:color="#FDF6EE" />
10
</shape>

+ 36 - 0
app/src/main/res/layout/activity_main_map.xml

@ -1519,6 +1519,42 @@
1519 1519
                android:src="@drawable/icon_main_oreder_more" />
1520 1520
1521 1521
        </RelativeLayout>
1522
        <RelativeLayout
1523
            android:layout_marginStart="54dp"
1524
            android:layout_marginEnd="54dp"
1525
            android:id="@+id/layoutNotification"
1526
            tools:visibility="visible"
1527
            android:layout_width="match_parent"
1528
            android:layout_height="wrap_content"
1529
            android:layout_marginLeft="15dp"
1530
            android:layout_marginRight="15dp"
1531
            android:background="@drawable/bg_main_notification"
1532
            android:visibility="gone">
1533
1534
            <TextView
1535
                android:paddingStart="20dp"
1536
                android:id="@+id/tvNotification"
1537
                android:paddingEnd="25dp"
1538
                android:maxLines="1"
1539
                android:ellipsize="end"
1540
                android:layout_width="wrap_content"
1541
                android:layout_height="34dp"
1542
                android:gravity="center"
1543
                android:text="您有一笔订单正在进行中您有一笔订单正在进行中,点击查看详情..."
1544
                android:textColor="@color/huimain"
1545
                android:textSize="13sp" />
1546
1547
            <ImageView
1548
                android:id="@+id/imgNotification"
1549
                android:tint="#707070"
1550
                android:layout_width="15dp"
1551
                android:layout_height="15dp"
1552
                android:layout_alignParentRight="true"
1553
                android:layout_centerVertical="true"
1554
                android:layout_marginRight="8dp"
1555
                android:src="@drawable/icon_close" />
1556
1557
        </RelativeLayout>
1522 1558
1523 1559
        <ImageView
1524 1560
            android:id="@+id/tv_person"

+ 5 - 112
app/src/main/res/layout/fragmen_details_new.xml

@ -667,6 +667,7 @@
667 667
                android:background="@color/ui_f4" />
668 668
669 669
            <RelativeLayout
670
                tools:visibility="visible"
670 671
                android:id="@+id/rl_new_comment"
671 672
                android:layout_width="match_parent"
672 673
                android:layout_height="wrap_content"
@ -696,120 +697,12 @@
696 697
                    android:textColor="@color/ui_68"
697 698
                    android:textSize="14sp" />
698 699
699
                <RelativeLayout
700
                    android:id="@+id/rl_icon"
701
                    android:layout_width="35dp"
702
                    android:layout_height="35dp"
703
                    android:layout_below="@+id/tv_new"
704
                    android:layout_alignParentStart="true"
705
                    android:layout_alignParentLeft="true"
706
                    android:layout_gravity="center_vertical"
707
                    android:layout_marginTop="10dp">
708
709
                    <com.electric.chargingpile.view.CircleImageView
710
                        android:id="@+id/iv_new_icon"
711
                        android:layout_width="35dp"
712
                        android:layout_height="35dp"
713
                        android:src="@drawable/icon_touxiang0128"
714
                        app:border_color="@color/white" />
715
716
                    <ImageView
717
                        android:id="@+id/iv_level_img"
718
                        android:layout_width="15dp"
719
                        android:layout_height="15dp"
720
                        android:layout_alignParentRight="true"
721
                        android:layout_alignParentBottom="true" />
722 700
723
724
                </RelativeLayout>
725
726
727
                <TextView
728
                    android:id="@+id/tv_new_name"
729
                    android:layout_width="wrap_content"
730
                    android:layout_height="wrap_content"
731
                    android:layout_alignTop="@+id/rl_icon"
732
                    android:layout_gravity="center_vertical"
733
                    android:layout_marginLeft="10dp"
734
                    android:layout_toEndOf="@+id/rl_icon"
735
                    android:layout_toRightOf="@+id/rl_icon"
736
                    android:text="EV200车主"
737
                    android:textAppearance="?android:attr/textAppearanceSmall"
738
                    android:textColor="@color/ui_65"
739
                    android:textSize="13sp" />
740
741
                <TextView
742
                    android:id="@+id/tv_new_car"
743
                    android:layout_width="wrap_content"
744
                    android:layout_height="wrap_content"
745
                    android:layout_alignTop="@+id/tv_new_name"
746
                    android:layout_gravity="center_vertical"
747
                    android:layout_marginLeft="5dp"
748
                    android:layout_toEndOf="@+id/tv_new_name"
749
                    android:layout_toRightOf="@+id/tv_new_name"
750
                    android:text="北京市"
751
                    android:textAppearance="?android:attr/textAppearanceSmall"
752
                    android:textColor="#888888"
753
                    android:textSize="13sp" />
754
755
                <ImageView
756
                    android:id="@+id/iv_new_pingfen"
757
                    android:layout_width="wrap_content"
758
                    android:layout_height="wrap_content"
759
                    android:layout_alignTop="@+id/tv_new_name"
760
                    android:layout_alignParentRight="true"
761
                    android:layout_gravity="center_vertical"
762
                    android:src="@drawable/icon_5xing"
763
                    android:textAppearance="?android:attr/textAppearanceSmall" />
764
765
                <TextView
766
                    android:id="@+id/tv_new_comment"
767
                    android:layout_width="wrap_content"
768
                    android:layout_height="wrap_content"
769
                    android:layout_below="@+id/tv_new_name"
770
                    android:layout_alignStart="@+id/tv_new_name"
771
                    android:layout_alignLeft="@+id/tv_new_name"
772
                    android:layout_marginTop="10dp"
773
                    android:layout_marginRight="15dp"
774
                    android:text=""
775
                    android:textAppearance="?android:attr/textAppearanceSmall"
776
                    android:textSize="15sp"
777
                    android:visibility="gone" />
778
779
                <com.zhy.view.flowlayout.TagFlowLayout
780
                    android:id="@+id/id_flowlayout_activity"
781
                    android:layout_width="fill_parent"
782
                    android:layout_height="wrap_content"
783
                    android:layout_below="@+id/tv_new_comment"
784
                    android:layout_alignLeft="@+id/tv_new_comment"
785
                    android:layout_marginTop="10dp"
786
                    tools:max_select="-1">
787
788
                </com.zhy.view.flowlayout.TagFlowLayout>
789
790
                <ImageView
791
                    android:id="@+id/iv_commentPic"
792
                    android:layout_width="65dp"
793
                    android:layout_height="65dp"
794
                    android:layout_below="@+id/id_flowlayout_activity"
795
                    android:layout_alignLeft="@+id/tv_new_comment"
796
                    android:layout_marginTop="10dp"
797
                    android:scaleType="centerCrop"
798
                    android:visibility="gone" />
799
800
                <TextView
801
                    android:id="@+id/tv_new_time"
802
                    android:layout_width="wrap_content"
701
                <include
702
                    android:layout_below="@+id/tv_new"
703
                    layout="@layout/item_zhancomments"
803 704
                    android:layout_height="wrap_content"
804
                    android:layout_below="@+id/iv_commentPic"
805
                    android:layout_alignStart="@+id/tv_new_comment"
806
                    android:layout_alignLeft="@+id/tv_new_comment"
807
                    android:layout_marginTop="10dp"
808
                    android:layout_marginBottom="8dp"
809
                    android:text="15分钟前"
810
                    android:textAppearance="?android:attr/textAppearanceSmall"
811
                    android:textColor="@color/ui_68"
812
                    android:textSize="12sp" />
705
                    android:layout_width="wrap_content" />
813 706
814 707
            </RelativeLayout>
815 708