意见反馈 修改细节

This commit is contained in:
Caiyanpeng committed 2021-04-23 09:12:32 +08:00
1 parent 1c712ff7d5
commit dd08f916eb
41 files changed
+7043 -1134

No files matched your search

@@ -0,0 +1,121 @@
using Assets.Scripts;
using Assets.Scripts.Apis;
using Assets.Scripts.UI.Control;
using System;
using System.Collections;
using System.Collections.Generic;
using System.Linq;
using UnityEngine;
using UnityEngine.EventSystems;
using UnityEngine.UI;
public class FeedbackController : PFUIPanel
{
// Start is called before the first frame update
Transform main,images;
PFUIInputField content;
Dictionary<string, string> paths;
Sprite plus;
void Awake()
{
ApiBase.SetCookie("3B7C1A274805FBB658A16F7B658F7FC3B01599154A952C20011B0F207A9F7B9709CAB23AD8B62FF5F85806DD0AD5059223FD6A582EF79B3F211E64572290202D2821928E824BA6C5313C32C4291763A3797304AE193B272DB9907F7D5AB46D53");
main = transform.Find("Main");
images = main.Find("Images");
paths = new Dictionary<string, string>();
plus = Resources.Load<Sprite>("Images/c-1");
for (int i = 0; i < images.childCount; i++)
{
var img = images.GetChild(i);
int index = i;
UIManager.AddEvent(img.gameObject, UnityEngine.EventSystems.EventTriggerType.PointerClick,
(e)=> AddImage(e,index));
UIManager.AddEvent(img.Find("close").gameObject, UnityEngine.EventSystems.EventTriggerType.PointerClick,
(e) => { DelImage(e, img,index); });
img.Find("close").gameObject.SetActive(false);
img.GetComponent<Image>().sprite = plus;
//if (i > 0) SetImageActive(img, false);
}
UIManager.AddEvent(main.Find("BtnSubmit").gameObject, EventTriggerType.PointerClick, (b) => Submit());
UIManager.AddEvent(main.Find("BtnCancel").gameObject, EventTriggerType.PointerClick, (b) => Close());
UIManager.AddEvent(main.Find("Exit").gameObject, EventTriggerType.PointerClick, (b) => Close());
content = main.Find("Content").Find("input").GetComponent<PFUIInputField>();
content.GetComponent<InputField>().onValueChanged.AddListener((s) =>
{
content.transform.Find("Number").GetComponent<Text>().text = $"<color=#9e9ead>{s.Length}</color>/200";
});
content.transform.Find("Number").GetComponent<Text>().text = $"<color=#9e9ead>0</color>/200";
LoadUserInfo();
}
public override void Show()
{
base.Show();
paths.Clear();
for (int i = 0; i < images.childCount; i++)
{
images.GetChild(i).GetComponent<Image>().sprite = plus;
//if (i > 0) SetImageActive(img, false);
}
content.Text = "";
LoadUserInfo();
}
void SetImageActive(Transform img, bool b)
{
img.GetComponent<Button>().interactable = b;
img.GetComponent<Button>().enabled = b;
img.GetComponent<CanvasGroup>().alpha = Convert.ToInt32(b);
}
void LoadUserInfo()
{
if (App.CurrentUser == null) return;
main.Find("Email").Find("Value").Find("Text").GetComponent<Text>().text = App.CurrentUser.Phone;
main.Find("ID").Find("Value").Find("Text").GetComponent<Text>().text = App.CurrentUser.Id.ToString();
main.Find("Version").Find("Value").Find("Text").GetComponent<Text>().text = App.AppVersion;
main.Find("Time").Find("Value").Find("Text").GetComponent<Text>().text = DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss");
}
void AddImage(BaseEventData e,int index)
{
var self = ((PointerEventData)e).pointerEnter;
Utils.OpenFile((path) =>
{
self.GetComponent<Image>().sprite = Utils.PngToSprite(path, 110, 110);
self.transform.Find("close").gameObject.SetActive(true);
paths[self.name] = path;
});
}
void DelImage(BaseEventData e,Transform self,int index)
{
self.GetComponent<Image>().sprite = plus;
paths.Remove(self.name);
self.Find("close").gameObject.SetActive(false);
//self.SetSiblingIndex(paths.Count);
//if (paths.Count < 2)
//{
// SetImageActive(images.GetChild(paths.Count+1), false);
//}
//for(int i = index)
//if (index < 2) SetImageActive(images.GetChild(index + 1), false);
//SetImageActive(images.GetChild(index), false);
}
async void Submit()
{
var list = paths.OrderBy(x => x.Key).Select(x => x.Value).ToList();
//var list = images.GetComponents<Transform>().Where(x => x.tag != null && x.tag != "Untagged").Select(x=>x.tag).ToList();
var r = await ConfigHelper.userApi.AddFeedBack(content.Text, list);
if (!r.result)
{
Utils.showToast(gameObject, r.errMsg);
}
else
{
Utils.showToast(gameObject, "已提交");
}
}
// Update is called once per frame
void Update()
{
}
}
@@ -0,0 +1,11 @@
fileFormatVersion: 2
guid: 1206c94b4f7d4f642ad5c7eedf233386
MonoImporter:
externalObjects: {}
serializedVersion: 2
defaultReferences: []
executionOrder: 0
icon: {instanceID: 0}
userData:
assetBundleName:
assetBundleVariant:
@@ -1,4 +1,6 @@
using System.Collections;
using Assets.Scripts;
using DG.Tweening;
using System.Collections;
using System.Collections.Generic;
using System.Threading;
using UnityEngine;
@@ -8,7 +10,7 @@ public class QuickLoginScroll : MonoBehaviour
{
// Start is called before the first frame update
private ScrollRect scroll;
private Transform content;
private Transform content,lightbg;
private float contentSize;
private int count;
[SerializeField] Button L, R;
@@ -16,6 +18,7 @@ public class QuickLoginScroll : MonoBehaviour
{
scroll = gameObject.GetComponent<ScrollRect>();
content = gameObject.transform.Find("Viewport").Find("Content");
lightbg = transform.parent.Find("Light");
//Initial();
if (L != null)
{
@@ -34,6 +37,14 @@ public class QuickLoginScroll : MonoBehaviour
//R.onClick.AddListener(goRight);
}
}
private void doAni()
{
lightbg.GetComponent<Image>().color = Utils.HexToColorHtml("#ffffff00");
lightbg.GetComponent<Image>().gameObject.SetActive(false);
//lightbg.GetComponent<Image>().DOFade(0, 0.15f);
}
public void Initial()
{
count = content.childCount;
@@ -55,6 +66,7 @@ public class QuickLoginScroll : MonoBehaviour
void goLeft()
{
if (scroll.horizontalNormalizedPosition <= contentSize) return;
doAni();
if (!start) startPosition = scroll.horizontalNormalizedPosition;
start = true;
scrollValue = -1 * contentSize / 30;
@@ -62,6 +74,7 @@ public class QuickLoginScroll : MonoBehaviour
void goRight()
{
if ((scroll.horizontalNormalizedPosition + contentSize) >= 1) return;
doAni();
if (!start) startPosition = scroll.horizontalNormalizedPosition;
start = true;
scrollValue = contentSize / 30;
@@ -78,7 +91,10 @@ public class QuickLoginScroll : MonoBehaviour
string c;
if (i == index)
{
lightbg.GetComponent<Image>().gameObject.SetActive(true);
lightbg.GetComponent<Image>().DOFade(1, 0.2f);
content.GetChild(i).GetComponent<QuickLoginUser>().setActive();
//
}
else
{
@@ -98,7 +114,6 @@ public class QuickLoginScroll : MonoBehaviour
start = false;
scroll.horizontalNormalizedPosition = startPosition + totalScrollValue;
//Debug.Log();
SetColor();
totalScrollValue = 0;
}
@@ -40,7 +40,7 @@ public class QuickLoginUser : MonoBehaviour
// Update is called once per frame
void Update()
{
//DOTween.To(()=>)
}
async void goMain()
{
@@ -75,6 +75,7 @@ public class QuickLoginUser : MonoBehaviour
// content.Find("empty1").transform.SetSiblingIndex(0);
// content.Find("empty2").transform.SetSiblingIndex(content.childCount - 1);
//}
UIManager.Instance.userInfoIndex = 0;
content.parent.parent.GetComponent<QuickLoginScroll>().Initial();
DeleteList(index);
}
@@ -84,7 +85,10 @@ public class QuickLoginUser : MonoBehaviour
var userInfos = UIManager.Instance.userInfos;
userInfos.RemoveAt(index);
UIManager.Instance.userInfos = userInfos;
UIManager.Instance.userInfoIndex = 0;
if (userInfos.Count == 0)
{
top.GetComponent<LoginController>().goLogin(true);
}
}
public void setActive()
@@ -93,7 +97,8 @@ public class QuickLoginUser : MonoBehaviour
//transform.Find("Avatar").GetComponent<RawImage>().color = color;
transform.Find("Avatar").GetComponent<RawImage>().DOFade(1f, 0.3f);
transform.GetComponent<Button>().enabled = true;
transform.Find("NickNameText").GetComponent<Text>().enabled = true;
transform.Find("NickNameText").GetComponent<Text>().DOFade(1f, 0.3f);
//transform.Find("NickNameText").GetComponent<Text>().enabled = true;
transform.Find("BtnDelete").GetComponent<Button>().gameObject.SetActive(true);
}
public void setNoActive()
@@ -102,7 +107,7 @@ public class QuickLoginUser : MonoBehaviour
//transform.Find("Avatar").GetComponent<RawImage>().color = color;
transform.Find("Avatar").GetComponent<RawImage>().DOFade(0.5f, 0.3f);
transform.GetComponent<Button>().enabled = false;
transform.Find("NickNameText").GetComponent<Text>().enabled = false;
transform.Find("NickNameText").GetComponent<Text>().DOFade(0, 0.3f);//.enabled = false;
transform.Find("BtnDelete").GetComponent<Button>().gameObject.SetActive(false);
}
}
+4
View File
@@ -44,6 +44,10 @@ public class MainNav : MonoBehaviour
{
UIManager.ShowSettingModal();
});
UIManager.AddEvent(transform.Find("Support").gameObject, EventTriggerType.PointerClick, x =>
{
UIManager.ShowFeedBackModal();
});
}
// Start is called before the first frame update
+1 -1
View File
@@ -13,6 +13,6 @@ public class RotateBg : MonoBehaviour
// Update is called once per frame
void Update()
{
transform.Rotate(new Vector3(0,0,-0.01f*1/3));
transform.Rotate(new Vector3(0,0,-Time.deltaTime * 1/3));
}
}
+1 -1
View File
@@ -8,7 +8,7 @@ using UnityEngine.UI;
public class NewsController : PFUIPanel
{
// Start is called before the first frame update
void Start()
void Awake()
{
content = transform.Find("Main").Find("Inner").Find("Content");
exit = transform.Find("Main").Find("Exit");
@@ -39,6 +39,8 @@ public class EditUserController : PFUIPanel
private Button mBackButton;
private Button mSwitchButton;
PfUIButton mChangeAvatar;
Transform linkContainer;
protected override void Awake()
{
Debug.Log(Utils.GetIP(Utils.ADDRESSFAM.IPv4));
@@ -101,7 +103,7 @@ public class EditUserController : PFUIPanel
}
});
linkContainer = transform.Find("LinkContainer");
mSexDropdown.ClearOptions();
mSexDropdown.AddOptions(new List<string>
@@ -147,7 +149,8 @@ public class EditUserController : PFUIPanel
// new Dropdown.OptionData()
//});
LoadDataSync();
LoadDataSync();
}
async Task Login()
{
@@ -199,6 +202,11 @@ public class EditUserController : PFUIPanel
mName.Text = currentUser.Contact;
mPhone.Text = currentUser.ContactPhone;
mAddr.Text = currentUser.ContactAddress;
//string.IsNullOrEmpty(currentUser.Unionid)
linkContainer.Find("Wx").GetComponent<Image>().sprite =
string.IsNullOrEmpty(currentUser.Unionid)
? Resources.Load<Sprite>("Images/Wechat_person_0")
: Resources.Load<Sprite>("Images/Wechat_person_1");
}
// Start is called before the first frame update
protected override void Start()
@@ -313,6 +321,6 @@ public class EditUserController : PFUIPanel
}
void Cancel(BaseEventData e)
{
UIManager.ShowHomePanel();
UIManager.ShowUserInfoPanel();
}
}
@@ -262,10 +262,10 @@ public class MapListController : PFUIPanel
string sort = "Hot",sortDire = "desc";
//string name = "";
//string name = "";
public void GetList()
async void GetList()
{
if (isEnd) return;
var res = ConfigHelper.mapApi.GetList(pageIndex, pageSize, ftname,distance,string.Join(",",hands),is3d,sort,sortDire,isFav);
var res = await ConfigHelper.mapApi.GetList(pageIndex, pageSize, ftname,distance,string.Join(",",hands),is3d,sort,sortDire,isFav);
if (res.result)
{
if (res.data.Count == 0 && pageIndex != 0)
@@ -59,6 +59,8 @@ public class RouteItem : MonoBehaviour, IPointerExitHandler, IPointerEnterHandle
{
//btnContinue.gameObject.SetActive(false);
btnContinue.GetComponent<Button>().onClick.AddListener(GoContinue);
btnContinue.GetComponent<Button>().interactable = !(result.Progress == 1.0);
btnContinue.GetComponent<Button>().enabled = !(result.Progress == 1.0);
}
btnReRide = right.Find("BtnReRide");
if (btnReRide)
@@ -112,7 +114,8 @@ public class RouteItem : MonoBehaviour, IPointerExitHandler, IPointerEnterHandle
{
if (f)
{
btnContinue.GetComponent<Image>().color = Utils.HexToColorHtml("#F93086");
btnContinue.GetComponent<Image>().color =
routeResult.Progress == 1? Utils.HexToColorHtml("#c8c8c880"): Utils.HexToColorHtml("#F93086");
btnReRide.GetComponent<Image>().color = Utils.HexToColorHtml("#F93086");
btnDelete.GetComponent<Image>().color = Utils.HexToColorHtml("#353543");
btnContinue.Find("Text").GetComponent<Text>().color = Utils.HexToColorHtml("#ffffff");