app/src/main/java/safeluck/drive/evaluation/fragment/NetWorkTrainFragment.java
@@ -12,6 +12,7 @@
import android.text.TextUtils;
import android.text.style.AbsoluteSizeSpan;
import android.text.style.ForegroundColorSpan;
import android.util.Base64;
import android.util.Log;
import android.view.LayoutInflater;
import android.view.MotionEvent;
@@ -21,12 +22,10 @@
import android.widget.ImageView;
import android.widget.ListView;
import android.widget.TextView;
import android.widget.Toast;
import androidx.annotation.NonNull;
import androidx.annotation.Nullable;
import androidx.fragment.app.DialogFragment;
import androidx.lifecycle.Observer;
import androidx.lifecycle.ViewModelProviders;
import androidx.work.OneTimeWorkRequest;
@@ -34,11 +33,11 @@
import com.anyun.exam.lib.AYSdk;
import com.anyun.exam.lib.MyLog;
import com.google.gson.Gson;
import org.json.JSONException;
import org.json.JSONObject;
import java.nio.charset.Charset;
import java.util.ArrayList;
import java.util.Collections;
import java.util.Date;
@@ -48,8 +47,6 @@
import safeluck.drive.evaluation.Constant;
import safeluck.drive.evaluation.DB.Student;
import safeluck.drive.evaluation.DB.WokViewModel;
import safeluck.drive.evaluation.DB.appstatusdb.AppStatus;
import safeluck.drive.evaluation.DB.appstatusdb.AppStatusViewModel;
import safeluck.drive.evaluation.DB.exam_status.ExamStatusInitWorker;
import safeluck.drive.evaluation.DB.exam_status.ExamStatusViewModel;
import safeluck.drive.evaluation.DB.failitems.FailedProjViewModel;
@@ -60,22 +57,16 @@
import safeluck.drive.evaluation.DB.exam_status.ExamStatus;
import safeluck.drive.evaluation.bean.ExamPlatformData;
import safeluck.drive.evaluation.bean.ScoreBean;
import safeluck.drive.evaluation.bean.SimulateNightBean;
import safeluck.drive.evaluation.cEventCenter.CEventCenter;
import safeluck.drive.evaluation.cEventCenter.ICEventListener;
import safeluck.drive.evaluation.customview.ArrowView;
import safeluck.drive.evaluation.customview.HouseView;
import safeluck.drive.evaluation.customview.LoadProgressDialog;
import safeluck.drive.evaluation.customview.QRCodeDialog;
import safeluck.drive.evaluation.customview.SelectDialog;
import safeluck.drive.evaluation.httpmodule.RetrofitCreator;
import safeluck.drive.evaluation.im.MessageProcessor;
import safeluck.drive.evaluation.platformMessage.JKMessage0201;
import safeluck.drive.evaluation.platformMessage.JKMessage0202;
import safeluck.drive.evaluation.platformMessage.JKMessage0204;
import safeluck.drive.evaluation.platformMessage.PlatFormConstant;
import safeluck.drive.evaluation.util.Utils;
import safeluck.drive.evaluation.viewmodels.TimeViewModel;
/**
 * 联网训练UI
@@ -536,6 +527,7 @@
        btn_ids.add(R.id.btn_10);
        view.findViewById(R.id.iv_head).setOnClickListener(this);
        view.findViewById(R.id.iv_coach_head).setOnClickListener(this);
        ((TextView)view.findViewById(R.id.tv_score_tip)).setText("当前考试得分");
        av_curve = view.findViewById(R.id.av3);
        av_park = view.findViewById(R.id.av2);
@@ -580,7 +572,6 @@
    }
private LoadProgressDialog loadProgressDialog;
    @Override
    public void onClick(View v) {
        switch (v.getId()) {
@@ -634,16 +625,38 @@
                break;
            case R.id.iv_head:
                MyLog.i(PlatFormConstant.HTTPTAG,"签到");
                loadProgressDialog = LoadProgressDialog.newInstance("请稍后...");
                loadProgressDialog.setStyle(DialogFragment.STYLE_NORMAL,R.style.Dialog_FullScreen);
                loadProgressDialog.showNow(getFragmentManager(),"loadingdiaolog");
                MyLog.i(TAG,"学员签到");
                if (ExamPlatformData.getInstance().IsStuSign()){
                    ExamPlatformData.getInstance().setStuSign(false);
                    qrcode(1,false);
                }else{
                    ExamPlatformData.getInstance().setStuSign(true);
                    qrcode(1,true);
                }
                break;
            case R.id.iv_coach_head:
                MyLog.i(PlatFormConstant.HTTPTAG,"教练签到");
                if (ExamPlatformData.getInstance().IsCoachSign()){
                    ExamPlatformData.getInstance().setCoachSign(false);
                    qrcode(0,false);
                }else{
                    ExamPlatformData.getInstance().setCoachSign(true);
                    qrcode(0,true);
                }
                //从服务器获取用于生成签到二维码的url
                break;
        }
    }
    private void qrcode(int type,boolean isSign) {
        content = "87,"+String.valueOf(type)+ ","+ExamPlatformData.getInstance().getPhone()
                +(isSign?",signin":",signout");
        Log.i(TAG,String.format("二维码内容:%s",content));
        byte[] bytes = Utils.qrencrypt(content.getBytes(),"safeluck");
        String str = Base64.encodeToString(bytes,Base64.DEFAULT);
        Log.i(TAG,"base64加密后的字符串="+str);
        QRCodeDialog qrCodeDialog = QRCodeDialog.newInstance(str);
        qrCodeDialog.show(getFragmentManager(),"qrdialog" );
    }
    private void sendJK0202(int type) {
        final JKMessage0202 jkMessage0202 = new JKMessage0202();