检测更新bug修复

This commit is contained in:
lijia 2024-12-02 10:10:15 +08:00
parent e4bdf1384f
commit 866a46a7cb

View File

@ -17,12 +17,14 @@ import android.widget.Toast;
import androidx.annotation.NonNull;
import androidx.annotation.Nullable;
import com.arpa.hndahesudintocctmsdriver.bean.UpAppBean;
import com.arpa.hndahesudintocctmsdriver.event.PersonEvent;
import com.arpa.hndahesudintocctmsdriver.event.RefreshCarListEvent;
import com.arpa.hndahesudintocctmsdriver.event.VehicleEvent;
import com.arpa.hndahesudintocctmsdriver.parts.ConfigParts;
import com.arpa.hndahesudintocctmsdriver.parts.StartOrderParts;
import com.arpa.hndahesudintocctmsdriver.parts.UserParts;
import com.arpa.hndahesudintocctmsdriver.ui.alert.UpAppAlert;
import com.arpa.hndahesudintocctmsdriver.ui.business.BusinessActivity;
import com.arpa.hndahesudintocctmsdriver.util.PicturlUtil;
import com.bumptech.glide.Glide;
@ -93,6 +95,25 @@ public class MyFragment extends BaseFragment {
}
CacheGroup.cacheList.remove("userdata");
}
if (CacheGroup.cacheList.get("up_app") != null) {
Log.e("up_app", CacheGroup.cacheList.get("up_app"));
UpAppBean uab = new Gson().fromJson(CacheGroup.cacheList.get("up_app"), UpAppBean.class);
if (uab.getCode() == 200) {
if (uab.getData() != null) {
new XPopup.Builder(con)
.dismissOnBackPressed(false)
.dismissOnTouchOutside(false)
.asCustom(new UpAppAlert(con, uab.getData().getDownloadUrl(), uab.getData().getContent(), uab.getData().getVersion(), uab.getData().getForce()))
.show();
}else{
Toast.makeText(con, "当前已经是最新版本", Toast.LENGTH_LONG).show();
}
}else{
Toast.makeText(con, uab.getMsg(), Toast.LENGTH_LONG).show();
}
CacheGroup.cacheList.remove("up_app");
}
break;
}
}
@ -262,7 +283,10 @@ public class MyFragment extends BaseFragment {
startActivity(in);
});
//检查更新
onUpdate.setOnClickListener(v -> Toast.makeText(con, "当前已经是最新版本", Toast.LENGTH_LONG).show());
onUpdate.setOnClickListener(v -> {
ur.upApp();
}
);
//系统设置
onSetUp.setOnClickListener(v -> startActivity(new Intent(con, SetupActivity.class)));
}
@ -283,13 +307,13 @@ public class MyFragment extends BaseFragment {
Glide.with(con).load(userBean.getData().getHeadportraitUrl()).into(img_head);
}
if (userBean!=null){
if ("0".equals(userBean.getData().getRealAuthentication())){
if (userBean != null) {
if ("0".equals(userBean.getData().getRealAuthentication())) {
no_auth.setVisibility(View.VISIBLE);
}else{
if (100003 == userBean.getData().getAuditStatus()){
} else {
if (100003 == userBean.getData().getAuditStatus()) {
no_auth.setVisibility(View.GONE);
}else{
} else {
no_auth.setBackgroundResource(R.mipmap.icon_auth_wsh);
}
}