|
|
@@ -31,6 +31,7 @@ import android.widget.PopupWindow;
|
|
|
import android.widget.TextView;
|
|
|
|
|
|
import com.andreabaccega.widget.FormEditText;
|
|
|
+import com.baidu.mapapi.search.core.PoiInfo;
|
|
|
import com.common.LogUtil;
|
|
|
import com.common.data.StringUtil;
|
|
|
import com.common.system.DisplayUtil;
|
|
|
@@ -45,6 +46,8 @@ import com.core.net.http.ViewUtil;
|
|
|
import com.core.utils.CommonUtil;
|
|
|
import com.core.utils.IntentUtils;
|
|
|
import com.core.utils.ToastUtil;
|
|
|
+import com.core.widget.view.Activity.SearchLocationActivity;
|
|
|
+import com.core.widget.view.model.SearchPoiParam;
|
|
|
import com.me.network.app.http.HttpClient;
|
|
|
import com.me.network.app.http.Method;
|
|
|
import com.me.network.app.http.rx.ResultListener;
|
|
|
@@ -71,6 +74,8 @@ import java.util.Map;
|
|
|
public class EnterpriseRegisterActivity extends BaseActivity implements View.OnClickListener {
|
|
|
private final int ENTERPRISE_REGISTER = 0x11;
|
|
|
private final int INDUSTRY_CHOOSE = 0x12;
|
|
|
+ private final int SELECT_ADDRESS_REQUEST = 0x13;
|
|
|
+ private final int SELECT_ADDRESS_RESULT = 0x14;
|
|
|
|
|
|
private Button mNextStepButton;
|
|
|
private FormEditText mEnterpriseCompanyEt;
|
|
|
@@ -110,6 +115,12 @@ public class EnterpriseRegisterActivity extends BaseActivity implements View.OnC
|
|
|
}
|
|
|
Intent intent = new Intent();
|
|
|
intent.setClass(EnterpriseRegisterActivity.this, AdminRegisterActivity.class);
|
|
|
+ intent.putExtra("companyName", mEnterpriseCompanyEt.getText().toString());
|
|
|
+ intent.putExtra("industry", mEnterpriseIndustryEt.getText().toString());
|
|
|
+ intent.putExtra("address", mEnterpriseAddressEt.getText().toString());
|
|
|
+ intent.putExtra("latitude", mLatitude + "");
|
|
|
+ intent.putExtra("longitude", mLongitude + "");
|
|
|
+
|
|
|
startActivity(intent);
|
|
|
} else {
|
|
|
String errMsg = resultObject.optString("errMsg");
|
|
|
@@ -129,6 +140,8 @@ public class EnterpriseRegisterActivity extends BaseActivity implements View.OnC
|
|
|
}
|
|
|
};
|
|
|
private HttpClient mHttpClient;
|
|
|
+ private double mLatitude;
|
|
|
+ private double mLongitude;
|
|
|
|
|
|
@Override
|
|
|
protected void onCreate(Bundle savedInstanceState) {
|
|
|
@@ -153,6 +166,7 @@ public class EnterpriseRegisterActivity extends BaseActivity implements View.OnC
|
|
|
}
|
|
|
});
|
|
|
mEnterpriseIndustryEt.setOnClickListener(this);
|
|
|
+ mEnterpriseAddressEt.setOnClickListener(this);
|
|
|
}
|
|
|
|
|
|
private void initViews() {
|
|
|
@@ -223,6 +237,18 @@ public class EnterpriseRegisterActivity extends BaseActivity implements View.OnC
|
|
|
Intent intent = new Intent();
|
|
|
intent.setClass(this, IndustryChooseActivity.class);
|
|
|
startActivityForResult(intent, INDUSTRY_CHOOSE);
|
|
|
+ } else if (i == R.id.enterprise_register_address_et) {
|
|
|
+ Intent intent = new Intent(ct, SearchLocationActivity.class);
|
|
|
+ SearchPoiParam poiParam = new SearchPoiParam();
|
|
|
+ poiParam.setType(2);
|
|
|
+ poiParam.setTitle("地图搜索");
|
|
|
+ poiParam.setRadius(1000);
|
|
|
+ //poiParam.setContrastLatLng(new LatLng(companyLocation.getLocation().mLongitude, companyLocation.getLocation().mLatitude));
|
|
|
+ poiParam.setResultCode(SELECT_ADDRESS_RESULT);
|
|
|
+ poiParam.setDistanceTag(MyApplication.getInstance().getResources().getString(R.string.rice));
|
|
|
+ intent.putExtra("data", poiParam);
|
|
|
+ startActivityForResult(intent, SELECT_ADDRESS_REQUEST);
|
|
|
+
|
|
|
}
|
|
|
}
|
|
|
|
|
|
@@ -244,10 +270,6 @@ public class EnterpriseRegisterActivity extends BaseActivity implements View.OnC
|
|
|
CommonUtil.setSharedPreferences(ct, "sessionId", sessionId);
|
|
|
CommonUtil.setSharedPreferences(ct, "pageToken", pageToken);
|
|
|
|
|
|
-// Intent intent = new Intent();
|
|
|
-// intent.setClass(EnterpriseRegisterActivity.this, AdminRegisterActivity.class);
|
|
|
-// startActivity(intent);
|
|
|
-
|
|
|
enterpriseRegister(pageToken, sessionId);
|
|
|
} else {
|
|
|
progressDialog.dismiss();
|
|
|
@@ -293,15 +315,6 @@ public class EnterpriseRegisterActivity extends BaseActivity implements View.OnC
|
|
|
LinkedHashMap<String, Object> headers = new LinkedHashMap<>();
|
|
|
headers.put("Cookie", "JSESSIONID=" + sessionId);
|
|
|
ViewUtil.httpSendRequest(this, url, params, mHandler, headers, ENTERPRISE_REGISTER, null, null, "post");
|
|
|
-
|
|
|
-// String fileBytes = getFileBytes(mLicenseFile);
|
|
|
-//
|
|
|
-// String url = "http://192.168.253.192:8080/account/api/file";
|
|
|
-// Map<String, Object> params = new HashMap<>();
|
|
|
-// params.put("data", fileBytes);
|
|
|
-// LinkedHashMap<String, Object> headers = new LinkedHashMap<>();
|
|
|
-// headers.put("Cookie", "JSESSIONID=" + CommonUtil.getSharedPreferences(ct, "sessionId"));
|
|
|
-// ViewUtil.httpSendRequest(this, url, params, mHandler, headers, 111, null, null, "post");
|
|
|
}
|
|
|
|
|
|
private String getFileBytes(File licenseFile) {
|
|
|
@@ -485,6 +498,17 @@ public class EnterpriseRegisterActivity extends BaseActivity implements View.OnC
|
|
|
String industry = data.getStringExtra("industry");
|
|
|
mEnterpriseIndustryEt.setText(industry);
|
|
|
}
|
|
|
+ } else if (requestCode == SELECT_ADDRESS_REQUEST) {
|
|
|
+ if (data != null && resultCode == SELECT_ADDRESS_RESULT) {
|
|
|
+ PoiInfo poi = data.getParcelableExtra("resultKey");
|
|
|
+ if (poi == null) return;
|
|
|
+ if (poi.address.contains(poi.city))
|
|
|
+ mEnterpriseAddressEt.setText(poi.address);
|
|
|
+ else
|
|
|
+ mEnterpriseAddressEt.setText(poi.city + poi.address);
|
|
|
+ mLatitude = poi.location.latitude;
|
|
|
+ mLongitude = poi.location.longitude;
|
|
|
+ }
|
|
|
}
|
|
|
}
|
|
|
|