From a1b0ab7044100daaa7e0f1da2d2ca45e38098963 Mon Sep 17 00:00:00 2001
From: 陈嘉乐 <cjl@hdlchina.com.cn>
Date: 星期一, 29 三月 2021 09:13:25 +0800
Subject: [PATCH] 2021-3-29-2
---
HDL_ON/UI/UI2/4-PersonalCenter/MyQRCodePage.cs | 173 +++++++++++++++++++++++++++++++++++++++++++++++++++++++++
1 files changed, 173 insertions(+), 0 deletions(-)
diff --git a/HDL_ON/UI/UI2/4-PersonalCenter/MyQRCodePage.cs b/HDL_ON/UI/UI2/4-PersonalCenter/MyQRCodePage.cs
new file mode 100644
index 0000000..e666d72
--- /dev/null
+++ b/HDL_ON/UI/UI2/4-PersonalCenter/MyQRCodePage.cs
@@ -0,0 +1,173 @@
+锘縰sing System;
+using System.Collections.Generic;
+using HDL_ON.UI.CSS;
+using Shared;
+
+namespace HDL_ON.UI
+{
+ /// <summary>
+ /// 鎴戠殑浜岀淮鐮侀〉闈�
+ /// </summary>
+ public class MyQRCodePage : FrameLayout
+ {
+ FrameLayout bodyView;
+
+ public MyQRCodePage()
+ {
+ bodyView = this;
+ }
+
+ /// <summary>
+ ///
+ /// </summary>
+ /// <param name="isStartCheckResidenceThread">鏄惁寮�鍚綇瀹呯洃鍚嚎绋嬶紝娌℃湁浣忓畢鐨勬椂鍊欏埆浜烘壂鐮佹坊鍔犱綘涓烘垚鍛樼殑鏃跺�欒皟鐢�</param>
+ public void LoadPage(bool isStartCheckResidenceThread = false)
+ {
+ bodyView.BackgroundColor = CSS_Color.BackgroundColor;
+ new TopViewDiv(bodyView, Language.StringByID(StringId.MyQRcode)).LoadTopView();
+
+ int backViewHeight = Application.GetRealHeight(132) + Application.GetRealWidth(266);
+ FrameLayout backView = new FrameLayout()
+ {
+ Y = Application.GetRealHeight(144),
+ X = Application.GetRealWidth(20),
+ Height = backViewHeight,
+ Width = Application.GetRealWidth(335),
+ BackgroundColor = CSS_Color.MainBackgroundColor,
+ Radius = (uint)Application.GetRealWidth(8),
+ };
+ bodyView.AddChidren(backView);
+
+ #region 澶村儚銆佹樀绉般�佸笎鍙�
+ FrameLayout headView = new FrameLayout()
+ {
+ Y = Application.GetRealHeight(16),
+ Height = Application.GetRealHeight(60),
+ };
+ backView.AddChidren(headView);
+
+ ImageView headImage = new ImageView()
+ {
+ X = Application.GetRealWidth(16),
+ Width = Application.GetMinRealAverage(60),
+ Height = Application.GetMinRealAverage(60),
+ Radius = (uint)Application.GetMinRealAverage(30),
+ ImagePath = UserInfo.Current.headImagePagePath,
+ };
+ headView.AddChidren(headImage);
+
+ //鐢ㄦ埛鍚嶇О
+ var btnUserName = new Button()
+ {
+ X = headImage.Right + Application.GetRealWidth(12),
+ Width = Application.GetRealWidth(200),
+ Height = Application.GetRealHeight(30),
+ TextAlignment = TextAlignment.CenterLeft,
+ TextColor = CSS_Color.FirstLevelTitleColor,
+ TextSize = CSS_FontSize.SubheadingFontSize,
+ TextID = StringId.UsersWhoNameIsEmpty,
+ IsBold = true
+ };
+ headView.AddChidren(btnUserName);
+
+ if (!string.IsNullOrEmpty(UserInfo.Current.userName))
+ {
+ btnUserName.Text = UserInfo.Current.userName;
+ }
+
+ //鐢ㄦ埛甯愬彿
+ var btnEmail = new Button()
+ {
+ X = headImage.Right + Application.GetRealWidth(12),
+ Y = btnUserName.Bottom,
+ Height = Application.GetRealHeight(30),
+ TextAlignment = TextAlignment.TopLeft,
+ TextColor = CSS_Color.TextualColor,
+ TextSize = CSS_FontSize.PromptFontSize_FirstLevel,
+ Text = UserInfo.Current.AccountString
+ };
+ headView.AddChidren(btnEmail);
+ #endregion
+
+ //浜岀淮鐮�
+ int codeWidth = Application.GetRealWidth(266);
+ ImageView codeImage = new ImageView()
+ {
+ X = Application.GetRealWidth(35),
+ Y = Application.GetRealHeight(104),
+ Height = codeWidth,
+ Width = codeWidth,
+ ImageBytes = Scan.BytesFromText(UserInfo.Current.AccountString, codeWidth, codeWidth),
+ };
+ backView.AddChidren(codeImage);
+
+ ////浜岀淮鐮佷腑蹇冨ご鍍�
+ //int imageWidth = Application.GetMinRealAverage(60);
+ //int imageX = codeImage.X + (codeWidth - imageWidth) / 2;
+ //int imageY = codeImage.Y + (codeWidth - imageWidth) / 2;
+ //ImageView headImage2 = new ImageView()
+ //{
+ // X = imageX,
+ // Y = imageY,
+ // Width = imageWidth,
+ // Height = imageWidth,
+ // ImagePath = UserInfo.Current.headImagePagePath,
+ // BorderColor = CSS_Color.MainBackgroundColor,
+ // BorderWidth = (uint)Application.GetRealWidth(2),
+ // Radius = (uint)Application.GetMinRealAverage(30),
+ //};
+ //backView.AddChidren(headImage2);
+
+
+ if (isStartCheckResidenceThread)
+ {
+ //寮�鍚娴嬩綇瀹呮槸鍚﹀凡缁忔坊鍔犱簡鐨勭嚎绋�
+ this.StartCheckResidenceThread();
+ }
+ }
+
+ /// <summary>
+ /// 寮�鍚娴嬩綇瀹呮槸鍚﹀凡缁忔坊鍔犱簡鐨勭嚎绋�
+ /// </summary>
+ private void StartCheckResidenceThread()
+ {
+ //鑾峰彇浣忓畢鍒楄〃鐨勫弬鏁�
+ var requestJson = DAL.Server.HttpUtil.GetSignRequestJson(new DAL.Server.GetHomeListObj() { homeType = HomeTypeEnum.ALL.ToString() });
+
+ new System.Threading.Thread(() =>
+ {
+ while (this.Parent != null)
+ {
+ System.Threading.Thread.Sleep(4000);
+
+ //璁块棶浜戠鑾峰彇鍒楄〃
+ var resultObj = DAL.Server.HttpUtil.RequestHttpsPost(DAL.Server.NewAPI.API_POST_Gethomepager, requestJson);
+ if (resultObj.Code == DAL.Server.StateCode.SUCCESS)
+ {
+ var homeList = Newtonsoft.Json.JsonConvert.DeserializeObject<List<RegionInfoResNew>>(resultObj.Data.ToString());
+ if (homeList == null || homeList.Count == 0)
+ {
+ //濡傛灉杩樻病鏈変綇瀹呯殑璇�,缁х画涓嬩竴娆℃娴�
+ continue;
+ }
+ //璋冪敤On鍘熸潵鐨勬柟娉�,鍒锋柊浣忓畢鍒楄〃鍙婂叾缂撳瓨
+ var pm = new DAL.Server.HttpServerRequest();
+ pm.GetHomePager();
+ Application.RunOnMainThread(() =>
+ {
+ //璺宠浆椤甸潰----
+ MainPage.GoUserPage(true, false, () =>
+ {
+ //鏄剧ず娆㈣繋鍥炲鐨勫脊绐楃晫闈�
+ var form = new WellcomToHomeForm();
+ form.ShowForm();
+ });
+ });
+ break;
+ }
+ }
+ })
+ { IsBackground = true }.Start();
+ }
+ }
+}
--
Gitblit v1.8.0