|
|
@@ -96,11 +96,17 @@ public class MeView : MonoBehaviour, MenuBackInterface
|
|
|
inputField.text = LoginMgr.myUserInfo.birthday;
|
|
|
}
|
|
|
else if (i == 6) {
|
|
|
+ // countryCode = LoginMgr.myUserInfo.country;
|
|
|
+ // stateCode = LoginMgr.myUserInfo.state;
|
|
|
+ // cityCode = LoginMgr.myUserInfo.city;
|
|
|
+ // System.Tuple<string, string, string> xxx = JC.Unity.Picker.LocationParseComponent.ins.ParseNameByCode(countryCode, stateCode, cityCode);
|
|
|
+ // inputField.text = (xxx.Item1 + " " + xxx.Item2 + " " + xxx.Item3).Trim();
|
|
|
+
|
|
|
+ //渲染后端返回的gps地理位置
|
|
|
countryCode = LoginMgr.myUserInfo.country;
|
|
|
stateCode = LoginMgr.myUserInfo.state;
|
|
|
cityCode = LoginMgr.myUserInfo.city;
|
|
|
- System.Tuple<string, string, string> xxx = JC.Unity.Picker.LocationParseComponent.ins.ParseNameByCode(countryCode, stateCode, cityCode);
|
|
|
- inputField.text = (xxx.Item1 + " " + xxx.Item2 + " " + xxx.Item3).Trim();
|
|
|
+ inputField.text = (countryCode + " " + stateCode + " " + cityCode).Trim();
|
|
|
}
|
|
|
}
|
|
|
nameText.text = LoginMgr.myUserInfo.nickname;
|
|
|
@@ -120,16 +126,28 @@ public class MeView : MonoBehaviour, MenuBackInterface
|
|
|
[SerializeField] GameObject locationPickerPrefab;
|
|
|
private string countryCode = "", stateCode = "", cityCode = "";
|
|
|
public void OpenLocationPicker() {
|
|
|
- GameObject o = GameObject.Instantiate(locationPickerPrefab);
|
|
|
- o.GetComponentInChildren<JC.Unity.Picker.LocationPickerGroup>().onEnter += (JC.Unity.Picker.LocationInfo info) => {
|
|
|
- countryCode = info.GetCountryRegion().Item2;
|
|
|
- stateCode = info.GetState().Item2;
|
|
|
- cityCode = info.GetCity().Item2;
|
|
|
+ // GameObject o = GameObject.Instantiate(locationPickerPrefab);
|
|
|
+ // o.GetComponentInChildren<JC.Unity.Picker.LocationPickerGroup>().onEnter += (JC.Unity.Picker.LocationInfo info) => {
|
|
|
+ // countryCode = info.GetCountryRegion().Item2;
|
|
|
+ // stateCode = info.GetState().Item2;
|
|
|
+ // cityCode = info.GetCity().Item2;
|
|
|
+ // GetInputField(inputs.transform.GetChild(6)).text =
|
|
|
+ // info.GetCountryRegion().Item1 + " " +
|
|
|
+ // info.GetState().Item1 + " " +
|
|
|
+ // info.GetCity().Item1;
|
|
|
+ // };
|
|
|
+
|
|
|
+ //2022-12-6 gps获取地理位置
|
|
|
+ string[] address = GPSTool.GetAddress();
|
|
|
+ if (address != null) {
|
|
|
+ countryCode = address[0];
|
|
|
+ stateCode = address[1];
|
|
|
+ cityCode = address[2];
|
|
|
GetInputField(inputs.transform.GetChild(6)).text =
|
|
|
- info.GetCountryRegion().Item1 + " " +
|
|
|
- info.GetState().Item1 + " " +
|
|
|
- info.GetCity().Item1;
|
|
|
- };
|
|
|
+ countryCode + " " +
|
|
|
+ stateCode + " " +
|
|
|
+ cityCode;
|
|
|
+ }
|
|
|
}
|
|
|
#endregion
|
|
|
|