|
@@ -9,11 +9,14 @@ import android.view.LayoutInflater;
|
|
|
import android.view.View;
|
|
|
import android.view.ViewGroup;
|
|
|
import android.widget.TextView;
|
|
|
+import android.widget.Toast;
|
|
|
|
|
|
import com.common.library.cache.Cache;
|
|
|
import com.common.library.okhttp.callback.Callback;
|
|
|
import com.common.library.utils.PixelUtil;
|
|
|
+import com.google.gson.Gson;
|
|
|
import com.ynstkz.shitu.android.R;
|
|
|
+import com.ynstkz.shitu.android.base.BaseBean;
|
|
|
import com.ynstkz.shitu.android.bean.UserInfoBean;
|
|
|
import com.ynstkz.shitu.android.common.Constants;
|
|
|
import com.ynstkz.shitu.android.data.RequestGroup;
|
|
@@ -68,18 +71,24 @@ public class STSign {
|
|
|
RequestGroup.snedSms(String.valueOf(type), phoneNumber, new Callback() {
|
|
|
@Override
|
|
|
public Object parseNetworkResponse(Response response, int id) throws Exception {
|
|
|
- return null;
|
|
|
+ return new Gson().fromJson(response.body().string(), BaseBean.class);
|
|
|
}
|
|
|
|
|
|
@Override
|
|
|
public void onError(Call call, Exception e, int id) {
|
|
|
-
|
|
|
+ Toast.makeText(STApplication.getContext(), "发送失败!", Toast.LENGTH_SHORT).show();
|
|
|
}
|
|
|
|
|
|
@Override
|
|
|
public void onResponse(Object response, int id) {
|
|
|
- if(callback != null){
|
|
|
- callback.codeCallback(type, "123456");
|
|
|
+ BaseBean baseBean = (BaseBean)response;
|
|
|
+ if(baseBean != null){
|
|
|
+ if("200".equals(baseBean.getCode())){
|
|
|
+ if(callback != null){
|
|
|
+ callback.codeCallback(type);
|
|
|
+ }
|
|
|
+ }
|
|
|
+ Toast.makeText(STApplication.getContext(), baseBean.getMsg(), Toast.LENGTH_SHORT).show();
|
|
|
}
|
|
|
}
|
|
|
});
|
|
@@ -95,21 +104,28 @@ public class STSign {
|
|
|
RequestGroup.verifySms(String.valueOf(type), phoneNumber, code, new Callback() {
|
|
|
@Override
|
|
|
public Object parseNetworkResponse(Response response, int id) throws Exception {
|
|
|
- return null;
|
|
|
+ return new Gson().fromJson(response.body().string(), BaseBean.class);
|
|
|
}
|
|
|
|
|
|
@Override
|
|
|
public void onError(Call call, Exception e, int id) {
|
|
|
if(callback != null){
|
|
|
- callback.isVerifyCodeSuccess(type, phoneNumber, true);
|
|
|
+ callback.isVerifyCodeSuccess(type, phoneNumber, false);
|
|
|
}
|
|
|
}
|
|
|
|
|
|
@Override
|
|
|
public void onResponse(Object response, int id) {
|
|
|
- if(callback != null){
|
|
|
- callback.isVerifyCodeSuccess(type, phoneNumber, true);
|
|
|
+ BaseBean baseBean = (BaseBean)response;
|
|
|
+ if(baseBean != null){
|
|
|
+ if("200".equals(baseBean.getCode())){
|
|
|
+ if(callback != null){
|
|
|
+ callback.isVerifyCodeSuccess(type, phoneNumber, true);
|
|
|
+ }
|
|
|
+ }
|
|
|
+ Toast.makeText(STApplication.getContext(), baseBean.getMsg(), Toast.LENGTH_SHORT).show();
|
|
|
}
|
|
|
+
|
|
|
}
|
|
|
});
|
|
|
}
|