dxh 6 years ago
parent
commit
203c21b693

+ 3 - 0
app/src/main/java/com/electric/chargingpile/activity/LoginActivity.java

494
        MainApplication.userPassword = userpassword;
494
        MainApplication.userPassword = userpassword;
495
        ProfileManager.getInstance().setKeyUserpassword(getApplicationContext(), userpassword);
495
        ProfileManager.getInstance().setKeyUserpassword(getApplicationContext(), userpassword);
496
        ProfileManager.getInstance().setPreviousUser(getApplicationContext(), tel);
496
        ProfileManager.getInstance().setPreviousUser(getApplicationContext(), tel);
497
        //保存用户token
498
//        MainApplication.messageToken = myToken;
499
//        ProfileManager.getInstance().setMessageToken(getApplicationContext(), myToken);
497
500
498
    }
501
    }
499
502

+ 19 - 15
app/src/main/java/com/electric/chargingpile/activity/PublishPicTopicActivity.java

50
import com.electric.chargingpile.data.HomePageBean;
50
import com.electric.chargingpile.data.HomePageBean;
51
import com.electric.chargingpile.data.TalkRecommendBean;
51
import com.electric.chargingpile.data.TalkRecommendBean;
52
import com.electric.chargingpile.data.UploadPic;
52
import com.electric.chargingpile.data.UploadPic;
53
import com.electric.chargingpile.manager.ProfileManager;
53
import com.electric.chargingpile.util.BarColorUtil;
54
import com.electric.chargingpile.util.BarColorUtil;
54
import com.electric.chargingpile.util.Bimp;
55
import com.electric.chargingpile.util.Bimp;
55
import com.electric.chargingpile.util.ImageItem;
56
import com.electric.chargingpile.util.ImageItem;
217
            public void afterTextChanged(Editable editable) {
218
            public void afterTextChanged(Editable editable) {
218
                String s = editable.toString();
219
                String s = editable.toString();
219
                Log.e(TAG, "afterTextChanged: s=" + s);
220
                Log.e(TAG, "afterTextChanged: s=" + s);
220
                if (containsEmoji(s)) {
221
                    tv_right.setEnabled(false);
222
                    tv_right.setTextColor(getResources().getColor(R.color.ui_68));
223
                    ToastUtil.showToast(getApplicationContext(), "不支持输入表情", Toast.LENGTH_SHORT);
224
                    return;
225
                }
226
                if (s.length() > 500) {
227
                    tv_right.setEnabled(false);
228
                    tv_right.setBackgroundColor(Color.parseColor("color_9ed3ae"));
229
//					tv_right.setTextColor(getResources().getColor(R.color.ui_68));
230
                    ToastUtil.showToast(getApplicationContext(), "输入字数不能超过500", Toast.LENGTH_SHORT);
231
                    return;
232
                }
221
//                if (containsEmoji(s)) {
222
//                    tv_right.setEnabled(false);
223
//                    tv_right.setTextColor(getResources().getColor(R.color.ui_68));
224
//                    ToastUtil.showToast(getApplicationContext(), "不支持输入表情", Toast.LENGTH_SHORT);
225
//                    return;
226
//                }
227
//                if (s.length() > 500) {
228
//                    tv_right.setEnabled(false);
229
//                    tv_right.setBackgroundColor(Color.parseColor("color_9ed3ae"));
230
////					tv_right.setTextColor(getResources().getColor(R.color.ui_68));
231
//                    ToastUtil.showToast(getApplicationContext(), "输入字数不能超过500", Toast.LENGTH_SHORT);
232
//                    return;
233
//                }
233
                if (!s.trim().isEmpty() && s.length() > 0) {
234
                if (!s.trim().isEmpty() && s.length() > 0) {
234
                    tv_right.setEnabled(true);
235
                    tv_right.setEnabled(true);
235
//					tv_right.setTextColor(getResources().getColor(R.color.lvse));
236
//					tv_right.setTextColor(getResources().getColor(R.color.lvse));
236
                    tv_right.setBackgroundColor(Color.parseColor("#02b637"));
237
                    tv_right.setBackgroundColor(Color.parseColor("#02b637"));
237
                } else {
238
                } else {
238
                    tv_right.setEnabled(false);
239
                    tv_right.setEnabled(false);
239
                    tv_right.setBackgroundColor(Color.parseColor("color_9ed3ae"));
240
                    tv_right.setBackgroundColor(Color.parseColor("#9ed3ae"));
240
                }
241
                }
241
                if(TextUtils.isEmpty(s))
242
                if(TextUtils.isEmpty(s))
242
                    publishtopic_word_num.setText("0");
243
                    publishtopic_word_num.setText("0");
838
        map.put("content", et_context.getText().toString());
839
        map.put("content", et_context.getText().toString());
839
        map.put("urls", urls);
840
        map.put("urls", urls);
840
        map.put("topicId", topicId);
841
        map.put("topicId", topicId);
842
        map.put("coverImgUrl", "");
841
        if (MainApplication.isLogin()) {
843
        if (MainApplication.isLogin()) {
842
            map.put("userId", MainApplication.userId);
844
            map.put("userId", MainApplication.userId);
843
            map.put("appToken", MainApplication.messageToken);
845
            String token = ProfileManager.getInstance().getKeyMessageToken(getApplicationContext());
846
            map.put("appToken", token+"");
844
        }
847
        }
848
        Log.e(TAG, map.toString());
845
        OkHttpUtils.post().params(map).url(url).build().connTimeOut(6000).readTimeOut(6000).execute(new StringCallback() {
849
        OkHttpUtils.post().params(map).url(url).build().connTimeOut(6000).readTimeOut(6000).execute(new StringCallback() {
846
            @Override
850
            @Override
847
            public void onError(Call call, Exception e) {
851
            public void onError(Call call, Exception e) {

+ 2 - 1
app/src/main/java/com/electric/chargingpile/application/MainApplication.java

74
    public static Boolean firstSsyd;
74
    public static Boolean firstSsyd;
75
    public static String password = "";
75
    public static String password = "";
76
    //	public static String url = "http://123.57.6.131";
76
    //	public static String url = "http://123.57.6.131";
77
    public static String url = "http://cdz.evcharge.cc";
77
    public static String url = "http://59.110.68.162";
78
//    public static String url = "http://cdz.evcharge.cc";
78
    public static String urlNew = "http://123.56.67.7:83/api/0200";
79
    public static String urlNew = "http://123.56.67.7:83/api/0200";
79
    public static String pic_url = "http://cdz.evcharge.cc/zhannew/uploadfile/";
80
    public static String pic_url = "http://cdz.evcharge.cc/zhannew/uploadfile/";
80
    //	public static String url = "https://cdz.d1ev.com";
81
    //	public static String url = "https://cdz.d1ev.com";