package com.xunao.effectdemo.activity;

import androidx.appcompat.app.AppCompatActivity;

import android.app.Activity;
import android.content.Intent;
import android.os.Bundle;
import android.util.Log;
import android.view.View;
import android.widget.Button;

import com.xunao.effectdemo.R;
import com.xunao.effectdemo.net.ApiHttpClient;
import com.xunao.effectdemo.net.ApiUrl;
import com.xunao.effectdemo.net.CSMHttpCallback;

import java.util.HashMap;
import java.util.Map;

/**
 * 地图闯关
 */
public class MapChallengeActivity extends Activity {
    Button btnMap1, btnMap2, btnMap3, btnMap4, btnMap5, btnMap6;

    Intent intent;

    private String name = "13004166772";
    private String pwd = "123890";
    private String token = "MWIzYmVmOTdiYzI5Y2UwM2ZiOThlMTI3YjRmYWJlNzA=";
    private String member_id = "61128";
    private String maps_id = "185";
    private String student_id = "180721";


    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_map_challenge);
        initView();
    }

    void initView(){
        btnMap1 = findViewById(R.id.btn_map_1);
        btnMap2 = findViewById(R.id.btn_map_2);
        btnMap2.setOnClickListener(v -> {
            intent = new Intent(MapChallengeActivity.this, AudioActivity.class);
            startActivity(intent);
        });
        btnMap3 = findViewById(R.id.btn_map_3);
        btnMap3.setOnClickListener(v -> {
            intent = new Intent(MapChallengeActivity.this, VideoDemandActivity.class);
            startActivity(intent);
        });
        btnMap4 = findViewById(R.id.btn_map_4);
        btnMap4.setOnClickListener(v -> {
            intent = new Intent(MapChallengeActivity.this, DragActivity.class);
            startActivity(intent);
        });
        btnMap5 = findViewById(R.id.btn_map_5);
        btnMap6 = findViewById(R.id.btn_map_6);
        btnMap6.setOnClickListener(v -> {
            intent = new Intent(MapChallengeActivity.this, RolePlayActivity.class);
            startActivity(intent);
        });

    }

    void login(){
        Map<String, String> params = new HashMap<>();
        params.put("ptcmobile",name);
        params.put("ptcpswd",pwd);
        ApiHttpClient.get(ApiUrl.login,params, new CSMHttpCallback() {
            @Override
            protected void onSuccess(String jsonStr) {

            }

            @Override
            protected void onFail(String msg) {

            }
        });
    }

}