Bladeren bron

更正逻辑,优化注销逻辑

hy 3 jaren geleden
bovenliggende
commit
c8fa0f6466

+ 28 - 11
app/src/main/java/com/electric/chargingpile/activity/LogOutActivity.java

@ -25,6 +25,7 @@ import com.electric.chargingpile.util.DES3;
25 25
import com.electric.chargingpile.util.ImageTools;
26 26
import com.electric.chargingpile.util.JsonUtils;
27 27
import com.electric.chargingpile.util.ToastUtil;
28
import com.electric.chargingpile.util.Util;
28 29
import com.electric.chargingpile.view.StateDialog;
29 30
import com.zhy.http.okhttp.OkHttpUtils;
30 31
import com.zhy.http.okhttp.callback.StringCallback;
@ -36,7 +37,7 @@ import pub.devrel.easypermissions.EasyPermissions;
36 37
37 38
public class LogOutActivity extends AppCompatActivity {
38 39
39
    private TextView text,addTimeText;
40
    private TextView text,addTimeText,nameTitle;
40 41
    private String state;
41 42
    private View unSubmittedLayout;
42 43
    private View unRegisterLayout;
@ -53,15 +54,27 @@ public class LogOutActivity extends AppCompatActivity {
53 54
54 55
    private void initIntent() {
55 56
        state = getIntent().getStringExtra("state");
56
        if (state !=null && state.equals("1")){
57
        boolean b = state != null && state.equals("1");
58
        isShow(b);
59
    }
60
61
    private void isShow(boolean bool) {
62
        if (bool){
57 63
            text.setText("不注销了");
58 64
            unSubmittedLayout.setVisibility(View.GONE);
59 65
            unRegisterLayout.setVisibility(View.VISIBLE);
66
            String phone= Util.handlePhone(MainApplication.userPhone);
67
68
            StringBuilder append = new StringBuilder("账号")
69
                    .append(phone)
70
                    .append("已申请注销");
71
            nameTitle.setText(append);
60 72
        }else {
61 73
            text.setText("确定注销");
62 74
            unSubmittedLayout.setVisibility(View.VISIBLE);
63 75
            unRegisterLayout.setVisibility(View.GONE);
64 76
        }
77
65 78
    }
66 79
67 80
    private void initView() {
@ -69,12 +82,14 @@ public class LogOutActivity extends AppCompatActivity {
69 82
70 83
            if (state !=null && state.equals("1")){
71 84
                signOut();
85
                startActivity(new Intent(LogOutActivity.this,LoginActivity.class));
72 86
            }
73 87
            finish();
74 88
        });
75 89
76 90
        text = findViewById(R.id.text);
77 91
        addTimeText = findViewById(R.id.addTime);
92
        nameTitle = findViewById(R.id.nameTitle);
78 93
        unSubmittedLayout = findViewById(R.id.unSubmittedLayout);
79 94
        unRegisterLayout = findViewById(R.id.unRegisterLayout);
80 95
        text.setOnClickListener(v->{
@ -112,13 +127,13 @@ public class LogOutActivity extends AppCompatActivity {
112 127
            public void onResponse(String response) {
113 128
                Log.e("onResponse applyLogOutNet", response);
114 129
                String rtnCode = JsonUtils.getKeyResult(response, "rtnCode");
130
                String rtnMsg = JsonUtils.getKeyResult(response, "rtnMsg");
115 131
                if (rtnCode.equals("01")){
116
                    signOut();
117
                    startActivity(new Intent(LogOutActivity.this,MainMapActivity.class));
118
                }else{
119
                    String rtnMsg = JsonUtils.getKeyResult(response, "rtnMsg");
120
                    showDialog(rtnMsg);
132
                    state = "1";
133
                    quiryState();
134
                    isShow(true);
121 135
                }
136
                showDialog(rtnMsg);
122 137
123 138
            }
124 139
        });
@ -154,10 +169,11 @@ public class LogOutActivity extends AppCompatActivity {
154 169
            public void onResponse(String response) {
155 170
                Log.e("onResponse cancelLogout", response);
156 171
                String rtnCode = JsonUtils.getKeyResult(response, "rtnCode");
172
                String rtnMsg = JsonUtils.getKeyResult(response, "rtnMsg");
157 173
                if (rtnCode.equals("01")){
174
                    ToastUtil.showToast(LogOutActivity.this,rtnMsg, Toast.LENGTH_SHORT);
158 175
                    finish();
159 176
                }else{
160
                    String rtnMsg = JsonUtils.getKeyResult(response, "rtnMsg");
161 177
                    ToastUtil.showToast(LogOutActivity.this,rtnMsg, Toast.LENGTH_SHORT);
162 178
                }
163 179
            }
@ -183,8 +199,8 @@ public class LogOutActivity extends AppCompatActivity {
183 199
                    String data = JsonUtils.getKeyResult(response, "data");
184 200
                    String addTime = JsonUtils.getKeyResult(data, "addTime");
185 201
                    String status = JsonUtils.getKeyResult(data, "status");
186
                    addTimeText.setText(addTime);
187
202
                    addTimeText.setText("提交时间:"+addTime);
203
                    state = "1";
188 204
                }else{
189 205
//                    String rtnMsg = JsonUtils.getKeyResult(response, "rtnMsg");
190 206
//                    ToastUtil.showToast(LogOutActivity.this,rtnMsg, Toast.LENGTH_SHORT);
@ -268,7 +284,8 @@ public class LogOutActivity extends AppCompatActivity {
268 284
        if (keyCode == KeyEvent.KEYCODE_BACK){
269 285
            if (state !=null && state.equals("1")){
270 286
                signOut();
271
                startActivity(new Intent(LogOutActivity.this,MainMapActivity.class));
287
                startActivity(new Intent(LogOutActivity.this,LoginActivity.class));
288
                finish();
272 289
                return true;
273 290
            }
274 291
        }

+ 7 - 0
app/src/main/java/com/electric/chargingpile/activity/UserCenterMoreActivity.java

@ -775,7 +775,14 @@ public class UserCenterMoreActivity extends Activity implements View.OnClickList
775 775
        super.onResume();
776 776
        if (MainApplication.isLogin()) {
777 777
            getFeedBackNum();
778
            tv_exit.setVisibility(View.VISIBLE);
779
        }else{
780
            tv_exit.setVisibility(View.GONE);
781
778 782
        }
783
784
785
779 786
        MobclickAgent.onResume(this);
780 787
    }
781 788

+ 218 - 207
app/src/main/res/layout/activity_logout.xml

@ -34,225 +34,236 @@
34 34
            android:src="@drawable/icon_lvback1119" />
35 35
    </com.zhy.autolayout.AutoRelativeLayout>
36 36
37
    <LinearLayout
37
   <androidx.core.widget.NestedScrollView
38
       android:fillViewport="true"
39
       android:overScrollMode="never"
40
       android:layout_width="match_parent"
41
       android:layout_height="match_parent">
42
       <RelativeLayout
43
           android:orientation="vertical"
44
           android:layout_width="match_parent"
45
           android:layout_height="match_parent">
46
           <LinearLayout
47
                tools:visibility="gone"
48
               android:orientation="vertical"
49
               android:id="@+id/unSubmittedLayout"
50
               android:layout_width="match_parent"
51
               android:layout_height="wrap_content">
38 52
39
        android:orientation="vertical"
40
        android:id="@+id/unSubmittedLayout"
41
        android:layout_width="match_parent"
42
        android:layout_height="wrap_content">
53
               <ImageView
54
                   android:layout_marginTop="40dp"
55
                   android:layout_gravity="center"
56
                   android:src="@drawable/ic_logout_hint"
57
                   android:layout_width="wrap_content"
58
                   android:layout_height="wrap_content"/>
43 59
44
        <ImageView
45
            android:layout_marginTop="40dp"
46
            android:layout_gravity="center"
47
            android:src="@drawable/ic_logout_hint"
48
            android:layout_width="wrap_content"
49
            android:layout_height="wrap_content"/>
60
               <TextView
61
                   android:layout_gravity="center"
62
                   android:layout_marginTop="30dp"
63
                   android:textStyle="bold"
64
                   android:gravity="center"
65
                   android:layout_width="match_parent"
66
                   android:layout_height="wrap_content"
67
                   android:text="非常遗憾不能继续为您服务\n感谢您的支持和陪伴"
68
                   android:textColor="@color/color_0e0e0e"
69
                   android:textSize="19sp"
70
                   />
71
               <TextView
72
                   android:layout_marginTop="20dp"
73
                   android:layout_marginEnd="12dp"
74
                   android:layout_marginStart="12dp"
75
                   android:layout_width="match_parent"
76
                   android:layout_height="wrap_content"
77
                   android:text="注销账号前我们需要确认以下是否有未完成或未结算,以保证您的帐号安全"
78
                   android:textColor="#ff707070"
79
                   android:textSize="12sp"
80
                   />
81
               <LinearLayout
82
                   android:background="@drawable/bg_radius_6_white"
83
                   android:layout_marginTop="20dp"
84
                   android:layout_marginEnd="12dp"
85
                   android:layout_marginStart="12dp"
86
                   android:orientation="vertical"
87
                   android:layout_width="match_parent"
88
                   android:layout_height="wrap_content">
89
                   <LinearLayout
90
                       android:padding="14dp"
91
                       android:layout_width="match_parent"
92
                       android:layout_height="wrap_content">
93
                       <TextView
94
                           android:layout_gravity="center_vertical"
95
                           android:layout_width="wrap_content"
96
                           android:layout_height="wrap_content"
97
                           android:text="●"
98
                           android:textColor="@color/color_707070"
99
                           android:textSize="4sp"
100
                           />
50 101
51
        <TextView
52
            android:layout_gravity="center"
53
            android:layout_marginTop="30dp"
54
            android:textStyle="bold"
55
            android:gravity="center"
56
            android:layout_width="match_parent"
57
            android:layout_height="wrap_content"
58
            android:text="非常遗憾不能继续为您服务\n感谢您的支持和陪伴"
59
            android:textColor="@color/color_0e0e0e"
60
            android:textSize="19sp"
61
            />
62
        <TextView
63
            android:layout_marginTop="20dp"
64
            android:layout_marginEnd="12dp"
65
            android:layout_marginStart="12dp"
66
            android:layout_width="match_parent"
67
            android:layout_height="wrap_content"
68
            android:text="注销账号前我们需要确认以下是否有未完成或未结算,以保证您的帐号安全"
69
            android:textColor="#ff707070"
70
            android:textSize="12sp"
71
            />
72
        <LinearLayout
73
            android:background="@drawable/bg_radius_6_white"
74
            android:layout_marginTop="20dp"
75
            android:layout_marginEnd="12dp"
76
            android:layout_marginStart="12dp"
77
            android:orientation="vertical"
78
            android:layout_width="match_parent"
79
            android:layout_height="wrap_content">
80
            <LinearLayout
81
                android:padding="14dp"
82
                android:layout_width="match_parent"
83
                android:layout_height="wrap_content">
84
                <TextView
85
                    android:layout_gravity="center_vertical"
86
                    android:layout_width="wrap_content"
87
                    android:layout_height="wrap_content"
88
                    android:text="●"
89
                    android:textColor="@color/color_707070"
90
                    android:textSize="4sp"
91
                    />
102
                       <TextView
103
                           android:layout_marginStart="6dp"
104
                           android:layout_width="wrap_content"
105
                           android:layout_height="wrap_content"
106
                           android:text="您的账号当前没有正在充电的订单"
107
                           android:textColor="@color/color_707070"
108
                           android:textSize="12sp"
109
                           />
92 110
93
                <TextView
94
                    android:layout_marginStart="6dp"
95
                    android:layout_width="wrap_content"
96
                    android:layout_height="wrap_content"
97
                    android:text="您的账号当前没有正在充电的订单"
98
                    android:textColor="@color/color_707070"
99
                    android:textSize="12sp"
100
                    />
111
                   </LinearLayout>
112
                   <LinearLayout
113
                       android:padding="14dp"
114
                       android:layout_width="match_parent"
115
                       android:layout_height="wrap_content">
116
                       <TextView
117
                           android:layout_gravity="center_vertical"
118
                           android:layout_width="wrap_content"
119
                           android:layout_height="wrap_content"
120
                           android:text="●"
121
                           android:textColor="@color/color_707070"
122
                           android:textSize="4sp"
123
                           />
101 124
102
            </LinearLayout>
103
            <LinearLayout
104
                android:padding="14dp"
105
                android:layout_width="match_parent"
106
                android:layout_height="wrap_content">
107
                <TextView
108
                    android:layout_gravity="center_vertical"
109
                    android:layout_width="wrap_content"
110
                    android:layout_height="wrap_content"
111
                    android:text="●"
112
                    android:textColor="@color/color_707070"
113
                    android:textSize="4sp"
114
                    />
125
                       <TextView
126
                           android:layout_marginStart="6dp"
127
                           android:layout_width="wrap_content"
128
                           android:layout_height="wrap_content"
129
                           android:text="您的账号没有未结算的充电订单"
130
                           android:textColor="@color/color_707070"
131
                           android:textSize="12sp"
132
                           />
115 133
116
                <TextView
117
                    android:layout_marginStart="6dp"
118
                    android:layout_width="wrap_content"
119
                    android:layout_height="wrap_content"
120
                    android:text="您的账号没有未结算的充电订单"
121
                    android:textColor="@color/color_707070"
122
                    android:textSize="12sp"
123
                    />
134
                   </LinearLayout>
135
                   <LinearLayout
136
                       android:padding="14dp"
137
                       android:layout_width="match_parent"
138
                       android:layout_height="wrap_content">
139
                       <TextView
140
                           android:layout_gravity="center_vertical"
141
                           android:layout_width="wrap_content"
142
                           android:layout_height="wrap_content"
143
                           android:text="●"
144
                           android:textColor="@color/color_707070"
145
                           android:textSize="4dp"
146
                           />
124 147
125
            </LinearLayout>
126
            <LinearLayout
127
                android:padding="14dp"
128
                android:layout_width="match_parent"
129
                android:layout_height="wrap_content">
130
                <TextView
131
                    android:layout_gravity="center_vertical"
132
                    android:layout_width="wrap_content"
133
                    android:layout_height="wrap_content"
134
                    android:text="●"
135
                    android:textColor="@color/color_707070"
136
                    android:textSize="4dp"
137
                    />
148
                       <TextView
149
                           android:layout_width="wrap_content"
150
                           android:layout_height="wrap_content"
151
                           android:layout_marginStart="6dp"
152
                           android:text="您的账号如果有余额请先完成退款或联系客服清空赠送金额"
153
                           android:textColor="@color/color_707070"
154
                           android:textSize="12sp" />
138 155
139
                <TextView
140
                    android:layout_width="wrap_content"
141
                    android:layout_height="wrap_content"
142
                    android:layout_marginStart="6dp"
143
                    android:text="您的账号如果有余额请先完成退款或联系客服清空赠送金额"
144
                    android:textColor="@color/color_707070"
145
                    android:textSize="12sp" />
156
                   </LinearLayout>
157
                   <LinearLayout
158
                       android:padding="14dp"
159
                       android:layout_width="match_parent"
160
                       android:layout_height="wrap_content">
161
                       <TextView
162
                           android:layout_gravity="center_vertical"
163
                           android:layout_width="wrap_content"
164
                           android:layout_height="wrap_content"
165
                           android:text="●"
166
                           android:textColor="@color/color_707070"
167
                           android:textSize="4dp"
168
                           />
146 169
147
            </LinearLayout>
148
            <LinearLayout
149
                android:padding="14dp"
150
                android:layout_width="match_parent"
151
                android:layout_height="wrap_content">
152
                <TextView
153
                    android:layout_gravity="center_vertical"
154
                    android:layout_width="wrap_content"
155
                    android:layout_height="wrap_content"
156
                    android:text="●"
157
                    android:textColor="@color/color_707070"
158
                    android:textSize="4dp"
159
                    />
170
                       <TextView
171
                           android:layout_width="wrap_content"
172
                           android:layout_height="wrap_content"
173
                           android:layout_marginStart="6dp"
174
                           android:text="余额是否为0"
175
                           android:textColor="@color/color_707070"
176
                           android:textSize="12sp" />
160 177
161
                <TextView
162
                    android:layout_width="wrap_content"
163
                    android:layout_height="wrap_content"
164
                    android:layout_marginStart="6dp"
165
                    android:text="余额是否为0"
166
                    android:textColor="@color/color_707070"
167
                    android:textSize="12sp" />
178
                   </LinearLayout>
179
                   <View
180
                       android:background="@color/color_f5f6f7"
181
                       android:layout_marginEnd="14dp"
182
                       android:layout_marginStart="14dp"
183
                       android:layout_width="match_parent"
184
                       android:layout_height="1dp"/>
168 185
169
            </LinearLayout>
170
            <View
171
                android:background="@color/color_f5f6f7"
172
                android:layout_marginEnd="14dp"
173
                android:layout_marginStart="14dp"
174
                android:layout_width="match_parent"
175
                android:layout_height="1dp"/>
186
                   <TextView
187
                       android:padding="14dp"
188
                       android:layout_width="match_parent"
189
                       android:layout_height="wrap_content"
190
                       android:text="注销提交后冻结账号15天,15天后自动注销账号,将清除账号所有相关信息和记录。冻结期内不可使用APP功能,可取消注销。"
191
                       android:textColor="#ff707070"
192
                       android:textSize="12sp"
193
                       />
194
               </LinearLayout>
195
           </LinearLayout>
176 196
177
            <TextView
178
                android:padding="14dp"
179
                android:layout_width="match_parent"
180
                android:layout_height="wrap_content"
181
                android:text="注销提交后冻结账号15天,15天后自动注销账号,将清除账号所有相关信息和记录。冻结期内不可使用APP功能,可取消注销。"
182
                android:textColor="#ff707070"
183
                android:textSize="12sp"
184
                />
185
        </LinearLayout>
186
    </LinearLayout>
197
           <LinearLayout
198
               tools:visibility="visible"
199
               android:visibility="gone"
200
               android:id="@+id/unRegisterLayout"
201
               android:orientation="vertical"
202
               android:layout_width="match_parent"
203
               android:layout_height="wrap_content">
204
               <ImageView
205
                   android:layout_marginTop="40dp"
206
                   android:layout_gravity="center_horizontal"
207
                   android:src="@drawable/ic_logout_hint2"
208
                   android:layout_width="wrap_content"
209
                   android:layout_height="wrap_content"/>
210
               <TextView
211
                   android:id="@+id/nameTitle"
212
                   android:layout_gravity="center"
213
                   android:layout_marginTop="30dp"
214
                   android:layout_width="wrap_content"
215
                   android:layout_height="wrap_content"
216
                   android:textColor="@color/color_0e0e0e"
217
                   android:textSize="21sp"
218
                   />
187 219
188
    <LinearLayout
189
        android:visibility="gone"
190
        android:id="@+id/unRegisterLayout"
191
        android:orientation="vertical"
192
        android:layout_width="match_parent"
193
        android:layout_height="wrap_content">
194
        <ImageView
195
            android:layout_marginTop="40dp"
196
            android:layout_gravity="center_horizontal"
197
            android:src="@drawable/ic_logout_hint2"
198
            android:layout_width="wrap_content"
199
            android:layout_height="wrap_content"/>
200
        <TextView
201
            android:layout_gravity="center"
202
            android:layout_marginTop="30dp"
203
            android:layout_width="wrap_content"
204
            android:layout_height="wrap_content"
205
            android:text="注销正在审核中…"
206
            android:textColor="@color/color_0e0e0e"
207
            android:textSize="21sp"
208
            />
220
               <TextView
221
                   android:id="@+id/addTime"
222
                   android:layout_marginTop="20dp"
223
                   android:layout_gravity="center"
224
                   android:layout_width="wrap_content"
225
                   android:layout_height="wrap_content"
226
                   tools:text="提交时间:2021-8-16  17:00"
227
                   android:textColor="@color/app_color_9b"
228
                   android:textSize="12sp"
229
                   />
230
               <TextView
231
                   android:layout_marginEnd="20dp"
232
                   android:layout_marginStart="20dp"
233
                   android:layout_marginTop="20dp"
234
                   android:layout_gravity="center"
235
                   android:layout_width="wrap_content"
236
                   android:layout_height="wrap_content"
237
                   android:text="您的账号已提交注销申请,账号将冻结15天,冻结期内可登录APP撤销申请,不可使用APP功能,将在15天后正式注销账号,清除账号相关信息。"
238
                   android:textColor="#ff0e0e0e"
239
                   android:textSize="12sp"
240
                   />
241
               <TextView
242
                   android:layout_marginEnd="20dp"
243
                   android:layout_marginStart="20dp"
244
                   android:layout_marginTop="20dp"
245
                   android:layout_gravity="center"
246
                   android:layout_width="wrap_content"
247
                   android:layout_height="wrap_content"
248
                   android:text="账号正式注销后,再次注册APP将为新注册账号,已注销的账号信息无法找回。"
249
                   android:textColor="#ff0e0e0e"
250
                   android:textSize="12sp"
251
                   />
252
           </LinearLayout>
209 253
210
        <TextView
211
            android:id="@+id/addTime"
212
            android:layout_marginTop="20dp"
213
            android:layout_gravity="center"
214
            android:layout_width="wrap_content"
215
            android:layout_height="wrap_content"
216
            tools:text="提交时间:2021-8-16  17:00"
217
            android:textColor="@color/app_color_9b"
218
            android:textSize="12sp"
219
            />
220
        <TextView
221
            android:layout_marginEnd="20dp"
222
            android:layout_marginStart="20dp"
223
            android:layout_marginTop="20dp"
224
            android:layout_gravity="center"
225
            android:layout_width="wrap_content"
226
            android:layout_height="wrap_content"
227
            android:text="您的账号已提交注销申请,账号将冻结15天,冻结期内可登录APP撤销申请,不可使用APP功能,将在15天后正式注销账号,清除账号相关信息。"
228
            android:textColor="#ff0e0e0e"
229
            android:textSize="12sp"
230
            />
231
        <TextView
232
            android:layout_marginEnd="20dp"
233
            android:layout_marginStart="20dp"
234
            android:layout_marginTop="20dp"
235
            android:layout_gravity="center"
236
            android:layout_width="wrap_content"
237
            android:layout_height="wrap_content"
238
            android:text="账号正式注销后,再次注册APP将为新注册账号,已注销的账号信息无法找回。"
239
            android:textColor="#ff0e0e0e"
240
            android:textSize="12sp"
241
            />
242
    </LinearLayout>
243
    <View
244
        android:layout_weight="1"
245
        android:layout_width="match_parent"
246
        android:layout_height="0dp"/>
247
    <TextView
248
        android:id="@+id/text"
249
        android:layout_marginBottom="40dp"
250
        android:layout_marginEnd="12dp"
251
        android:layout_marginStart="12dp"
252
        android:gravity="center"
253
        android:textColor="@color/white"
254
        android:text="退出登录"
255
        android:background="@drawable/bg_raduis_20_lvse"
256
        android:layout_width="match_parent"
257
        android:layout_height="40dp"/>
254
           <TextView
255
               android:layout_alignParentBottom="true"
256
               android:id="@+id/text"
257
               android:layout_marginBottom="40dp"
258
               android:layout_marginEnd="12dp"
259
               android:layout_marginStart="12dp"
260
               android:gravity="center"
261
               android:textColor="@color/white"
262
               android:text="退出登录"
263
               android:background="@drawable/bg_raduis_20_lvse"
264
               android:layout_width="match_parent"
265
               android:layout_height="40dp"/>
266
       </RelativeLayout>
267
268
   </androidx.core.widget.NestedScrollView>
258 269
</LinearLayout>