Merge remote-tracking branch 'origin/CJL-NEW'
| | |
| | | 关闭定位服务 |
| | | </summary> |
| | | </member> |
| | | <member name="F:Shared.Application.IsStatusBarBlack"> |
| | | <summary> |
| | | 当前是否设置顶部状态栏字体颜色 |
| | | </summary> |
| | | </member> |
| | | <member name="M:Shared.Application.SetStatusBarTextBlack(System.Boolean)"> |
| | | <summary> |
| | | 设置顶部状态栏字体颜色 |
| | | </summary> |
| | | <param name="isBlack">是否设置黑色</param> |
| | | </member> |
| | | <member name="T:Shared.Button"> |
| | | <summary> |
| | | Button 按键 |
| | |
| | | Y坐标 |
| | | </summary> |
| | | </member> |
| | | <member name="F:Shared.Tip.IsTipLong"> |
| | | <summary> |
| | | 针对Android有效 |
| | | </summary> |
| | | </member> |
| | | <member name="P:Shared.Tip.CloseTime"> |
| | | <summary> |
| | | 针对iOS有效 |
| | | </summary> |
| | | </member> |
| | | <member name="M:Shared.Tip.Show(Shared.View)"> |
| | | <summary> |
| | | 点击哪个View时显赫提示 |
| | |
| | | <summary> |
| | | Y轴坐标 |
| | | </summary> |
| | | </member> |
| | | <member name="M:Shared.BaseActivity.HideVirtualButtons(Android.App.Activity)"> |
| | | <summary> |
| | | HideVirtualButtons |
| | | </summary> |
| | | <param name="activity"></param> |
| | | </member> |
| | | <member name="M:Shared.BaseActivity.SetImagePermission(System.Action{System.Boolean})"> |
| | | <summary> |
| | |
| | | </summary> |
| | | <value>是否可以滑动</value> |
| | | </member> |
| | | <member name="P:Shared.CurtainRollSeekBar.CurtainPaddingLeftRight"> |
| | | <summary> |
| | | 进度条与左右边框边距 |
| | | </summary> |
| | | </member> |
| | | <member name="P:Shared.CurtainRollSeekBar.CurtainPaddingTop"> |
| | | <summary> |
| | | 顶部padding |
| | | </summary> |
| | | </member> |
| | | <member name="P:Shared.CurtainRollSeekBar.IsOffline"> |
| | | <summary> |
| | | 是否离线 离线的话禁止滑动并绘制背景遮挡层 |
| | |
| | | </summary> |
| | | <value>X坐标</value> |
| | | </member> |
| | | <member name="P:Shared.DiyImageSeekBar.IsInvertedProgress"> |
| | | <summary> |
| | | 进度值是否取反 |
| | | </summary> |
| | | </member> |
| | | <member name="F:Shared.DiyImageSeekBar.OnProgressChangedEvent"> |
| | | <summary> |
| | | EventHandler |
| | |
| | | </summary> |
| | | <value>X坐标</value> |
| | | </member> |
| | | <member name="P:Shared.CurtainSeekBarOn.IsInvertedProgress"> |
| | | <summary> |
| | | 进度值是否取反 |
| | | </summary> |
| | | </member> |
| | | <member name="F:Shared.CurtainSeekBarOn.OnProgressChangedEvent"> |
| | | <summary> |
| | | EventHandler |
| | |
| | | 设置是否为百叶窗样式 |
| | | </summary> |
| | | </member> |
| | | <member name="P:Shared.CurtainRollSeekBarOn.IsInvertedProgress"> |
| | | <summary> |
| | | 进度值是否取反 |
| | | </summary> |
| | | </member> |
| | | <member name="F:Shared.CurtainRollSeekBarOn.OnProgressChangedEvent"> |
| | | <summary> |
| | | EventHandler |
| | |
| | | using Android.Content; |
| | | using Android.Net; |
| | | using Android.OS; |
| | | using CN.Jpush.Android.Api; |
| | | using HDL_ON; |
| | | using Java.Util; |
| | | using Shared; |
| | |
| | | { |
| | | Language.CurrentLanguage = "Chinese"; |
| | | } |
| | | #if Release |
| | | //注册极光推送 |
| | | InitJPush(activity); |
| | | #endif |
| | | |
| | | BaseActivity.NetworkStateChanged += (int obj) => |
| | | { |
| | |
| | | MainPage.Log($"经纬度:::{arg1}:{arg2}"); |
| | | }; |
| | | } |
| | | |
| | | /// <summary> |
| | | /// |
| | | /// </summary> |
| | | /// <param name="activity"></param> |
| | | void InitJPush(BaseActivity activity) |
| | | { |
| | | try |
| | | { |
| | | //#if Release |
| | | //保存获取的极光服务器上的注册ID到本地文件 |
| | | var tokenID = JPushInterface.GetRegistrationID(activity); |
| | | Console.WriteLine("RegistrationID: " + tokenID); |
| | | if (!string.IsNullOrEmpty(tokenID) && OnAppConfig.Instance.PushDeviceToken != tokenID) |
| | | { |
| | | OnAppConfig.Instance.PushDeviceToken = tokenID; |
| | | OnAppConfig.Instance.PhoneName = Android.OS.Build.Manufacturer; |
| | | OnAppConfig.Instance.SaveUserConfig(); |
| | | } |
| | | int loadTokenCount = 0; |
| | | System.Threading.Tasks.Task.Run(() => |
| | | { |
| | | while (string.IsNullOrEmpty(tokenID)) |
| | | { |
| | | System.Threading.Thread.Sleep(1000); |
| | | tokenID = JPushInterface.GetRegistrationID(activity); |
| | | Utlis.WriteLine("Sleep.tokenID + " + JPushInterface.GetRegistrationID(activity)); |
| | | loadTokenCount++; |
| | | if (loadTokenCount > 30) |
| | | { |
| | | break; |
| | | } |
| | | } |
| | | Utlis.WriteLine("RegistrationID: " + tokenID); |
| | | if (!string.IsNullOrEmpty(tokenID) && OnAppConfig.Instance.PushDeviceToken != tokenID) |
| | | { |
| | | OnAppConfig.Instance.PushDeviceToken = tokenID; |
| | | OnAppConfig.Instance.PhoneName = Android.OS.Build.Manufacturer; |
| | | OnAppConfig.Instance.SaveUserConfig(); |
| | | } |
| | | }); |
| | | |
| | | //#endif |
| | | } |
| | | catch |
| | | { |
| | | |
| | | } |
| | | } |
| | | |
| | | public static bool IsShowTip = true; |
| | | void init() |
| | | { |
| | | //手机名称 Android.OS.Build.Manufacturer; |
| | | OnAppConfig.Instance.PhoneName = Android.OS.Build.Manufacturer; |
| | | //OnAppConfig.Instance.PhoneName = Android.OS.Build.Manufacturer; |
| | | #if Release |
| | | //设置极光调试模式,为false时只打印警告信息 |
| | | JPushInterface.SetDebugMode(false); |
| | | JPushInterface.Init(this);//保存手机名称到本地文件 |
| | | #endif |
| | | } |
| | | void checkSomeInfo() |
| | | { |
| | |
| | | //BusSocket.Start(); |
| | | } |
| | | } |
| | | |
| | | } |
| | |
| | | 9036=场景问题 |
| | | 9037=APP使用辅助 |
| | | 9038=常见问题 |
| | | |
| | | 9039=分享与功能 |
| | | 9040=报警类 |
| | | 9041=系统信息 |
| | | 9042=信息中心 |
| | | 9043=该账号已在其它设备登录 |
| | | |
| | | |
| | | 10000=无效登录密钥,请重新登录! |
| | |
| | | <Reference Include="Shared.Droid.JLCountryCode"> |
| | | <HintPath>..\DLL\Android\Shared.Droid.JLCountryCode.dll</HintPath> |
| | | </Reference> |
| | | <Reference Include="JPushAndroid"> |
| | | <HintPath>..\DLL\Android\JPushAndroid.dll</HintPath> |
| | | </Reference> |
| | | </ItemGroup> |
| | | <ItemGroup> |
| | | <Compile Include="MainActivity.cs" /> |
| | |
| | | <Compile Include="ZXingCustomScanView.cs" /> |
| | | <Compile Include="ZXingOverlayView.cs" /> |
| | | <Compile Include="Other\JLCountrycode.cs" /> |
| | | <Compile Include="JPush.cs" /> |
| | | </ItemGroup> |
| | | <ItemGroup> |
| | | <None Include="Resources\AboutResources.txt" /> |
| | |
| | | <Version>12.0.3</Version> |
| | | </PackageReference> |
| | | <PackageReference Include="MQTTnet"> |
| | | <Version>3.0.8</Version> |
| | | <Version>3.0.13</Version> |
| | | </PackageReference> |
| | | <PackageReference Include="ZXing.Net.Mobile"> |
| | | <Version>2.4.1</Version> |
| | |
| | | <AndroidAsset Include="Assets\Phone\PersonalCenter\Support\Close.png" /> |
| | | <AndroidAsset Include="Assets\Phone\PersonalCenter\Head.png" /> |
| | | <AndroidAsset Include="Assets\Phone\PersonalCenter\Transfer.png" /> |
| | | <AndroidAsset Include="Assets\Phone\Collection\MesCenter\All.png" /> |
| | | <AndroidAsset Include="Assets\Phone\Collection\MesCenter\System.png" /> |
| | | <AndroidAsset Include="Assets\Phone\Collection\MesCenter\Alarm.png" /> |
| | | <AndroidAsset Include="Assets\Phone\Collection\MesCenter\AllOn.png" /> |
| | | <AndroidAsset Include="Assets\Phone\Collection\MesCenter\Share.png" /> |
| | | <AndroidAsset Include="Assets\Phone\Collection\MesCenter\AlarmOn.png" /> |
| | | <AndroidAsset Include="Assets\Phone\Collection\MesCenter\ShareOn.png" /> |
| | | <AndroidAsset Include="Assets\Phone\Collection\MesCenter\SystemOn.png" /> |
| | | <AndroidAsset Include="Assets\Phone\Classification\Room\Roombg1.png" /> |
| | | <AndroidAsset Include="Assets\Phone\Classification\Room\Roombg2.png" /> |
| | | <AndroidAsset Include="Assets\Phone\Classification\Room\Roombg3.png" /> |
| | | <AndroidAsset Include="Assets\Phone\Classification\Room\Roombg4.png" /> |
| | | <AndroidAsset Include="Assets\Phone\Classification\Room\Roombg5.png" /> |
| | | <AndroidAsset Include="Assets\Phone\Classification\Room\Roombg6.png" /> |
| | | <AndroidAsset Include="Assets\Phone\Classification\Room\Roombg7.png" /> |
| | | <AndroidAsset Include="Assets\Phone\Classification\Room\Roombg8.png" /> |
| | | <AndroidAsset Include="Assets\Phone\Classification\Room\Roombg9.png" /> |
| | | <AndroidAsset Include="Assets\Phone\Classification\Room\Roombg10.png" /> |
| | | </ItemGroup> |
| | | <ItemGroup> |
| | | <AndroidNativeLibrary Include="libs\armeabi-v7a\libelianjni.so" /> |
| | | <AndroidNativeLibrary Include="libs\armeabi-v7a\libjcore127.so" /> |
| | | </ItemGroup> |
| | | <Import Project="..\HDL_ON\HDL_ON.projitems" Label="Shared" Condition="Exists('..\HDL_ON\HDL_ON.projitems')" /> |
| | | <Import Project="$(MSBuildExtensionsPath)\Xamarin\Android\Xamarin.Android.CSharp.targets" /> |
New file |
| | |
| | | using System; |
| | | using Android.App; |
| | | using Android.Content; |
| | | using Android.OS; |
| | | using CN.Jpush.Android.Api; |
| | | using CN.Jpush.Android.Service; |
| | | using HDL_ON; |
| | | using Shared; |
| | | |
| | | namespace HDL_ON_Android |
| | | { |
| | | [BroadcastReceiver(Name = "com.hdl.onpro.JpushNotificationReceiver", Exported = false, Enabled = true)] |
| | | [IntentFilter(new string[] { "cn.jpush.android.intent.REGISTRATION", |
| | | "cn.jpush.android.intent.MESSAGE_RECEIVED", |
| | | "cn.jpush.android.intent.NOTIFICATION_RECEIVED", |
| | | "cn.jpush.android.intent.NOTIFICATION_OPENED", |
| | | "cn.jpush.android.intent.CONNECTION" }, Categories = new string[] { "com.hdl.onpro" })] |
| | | public class JpushNotificationReceiver : BroadcastReceiver |
| | | { |
| | | private static string TAG = "JpushNotificationReceiver"; |
| | | private NotificationManager nm; |
| | | static string ACTION = "android.intent.action.BOOT_COMPLETED"; |
| | | public override void OnReceive(Context context, Intent intent) |
| | | { |
| | | if (nm == null) |
| | | { |
| | | nm = (NotificationManager)context.GetSystemService(Context.NotificationService); |
| | | } |
| | | //base.OnReceive (context, intent); |
| | | try |
| | | { |
| | | Bundle bundle = intent.Extras; |
| | | if (intent.Action == ACTION) |
| | | { |
| | | //开机自动服务自动启动,PushService是要启动的服务 |
| | | Intent service = new Intent(context, typeof(PushService)); |
| | | context.StartService(service); |
| | | } |
| | | |
| | | //接收Registration Id |
| | | if (JPushInterface.ActionRegistrationId == intent.Action) |
| | | { |
| | | string regId = bundle.GetString(JPushInterface.ExtraRegistrationId); |
| | | if (!string.IsNullOrEmpty(regId)) |
| | | { |
| | | OnAppConfig.Instance.PushDeviceToken = regId; |
| | | //OnAppConfig.Instance.PhoneName = userPhoneName; |
| | | OnAppConfig.Instance.SaveUserConfig(); |
| | | } |
| | | } |
| | | //用户点击打开了通知 |
| | | else if (JPushInterface.ActionNotificationOpened == intent.Action) |
| | | { |
| | | OpenNotification(context, bundle); |
| | | } |
| | | //接受到推送下来的通知 |
| | | else if (JPushInterface.ActionNotificationReceived == intent.Action) |
| | | { |
| | | //int notifactionId = bundle.GetInt(JPushInterface.ExtraNotificationId); |
| | | ReceivingNotification(context, bundle); |
| | | //Shared.Common.CommonPage.Instance.SingOut(); |
| | | } |
| | | //接收到推送下来的自定义消息 |
| | | else if (JPushInterface.ActionMessageReceived == intent.Action) |
| | | { |
| | | bundle.GetString(JPushInterface.ExtraMessage); |
| | | } |
| | | else |
| | | { |
| | | } |
| | | } |
| | | catch (System.Exception e) |
| | | { |
| | | |
| | | System.Console.WriteLine("极光推送出错:" + e.Message); |
| | | } |
| | | } |
| | | /// <summary> |
| | | /// 接收消息通知 |
| | | /// </summary> |
| | | /// <param name="context">Context.</param> |
| | | /// <param name="bundle">Bundle.</param> |
| | | private void ReceivingNotification(Context context, Bundle bundle) |
| | | { |
| | | String title = bundle.GetString(JPushInterface.ExtraNotificationTitle); |
| | | System.Console.WriteLine(TAG, " title : " + title); |
| | | String message = bundle.GetString(JPushInterface.ExtraAlert); |
| | | System.Console.WriteLine(TAG, "message : " + message); |
| | | String extras = bundle.GetString(JPushInterface.ExtraExtra); |
| | | System.Console.WriteLine(TAG, "extras : " + extras); |
| | | |
| | | //处理极光消息推送的逻辑函数 |
| | | AdjustJiguangMsgPush(title, message, extras); |
| | | } |
| | | |
| | | /// <summary> |
| | | /// 处理极光信息推送 |
| | | /// </summary> |
| | | /// <param name="title">标题</param> |
| | | /// <param name="message">信息</param> |
| | | /// <param name="extras">负载数据</param> |
| | | public void AdjustJiguangMsgPush(string title, string message, string extras) |
| | | { |
| | | if (extras.Contains("Offline") == true) |
| | | { |
| | | |
| | | Shared.Application.RunOnMainThread(() => |
| | | { |
| | | //此帐号已在别处登录,您被迫下线 |
| | | //ShowAlert("此帐号已在别处登录,您被迫下线"); |
| | | //账号在别处登陆,被踢下线 跳转到登录页面 |
| | | HDLCommon.Current.ShowAlert(Language.StringByID(StringId.LoggedOnOtherDevices)); |
| | | |
| | | }); |
| | | return; |
| | | } |
| | | } |
| | | |
| | | /// <summary> |
| | | /// 打开消息显示界面 |
| | | /// </summary> |
| | | /// <param name="context">Context.</param> |
| | | /// <param name="bundle">Bundle.</param> |
| | | private void OpenNotification(Context context, Bundle bundle) |
| | | { |
| | | |
| | | Intent i = new Intent(context, typeof(BaseActivity));//Intent intent=new Intent( 起始组件对象 , 目标 Service.class); |
| | | i.PutExtras(bundle); |
| | | i.SetFlags(ActivityFlags.NewTask); |
| | | context.StartActivity(i); |
| | | |
| | | String extras = bundle.GetString(JPushInterface.ExtraExtra); |
| | | //String myValue = ""; |
| | | try |
| | | { |
| | | VideoMethod(extras); |
| | | //JSONObject extrasJson = new JSONObject(extras); |
| | | //myValue = extrasJson.OptString("myKey"); |
| | | |
| | | } |
| | | catch (Exception e) |
| | | { |
| | | System.Console.WriteLine(TAG, "Unexpected: extras is not a valid json", e); |
| | | return; |
| | | } |
| | | |
| | | //if (TYPE_THIS.equals(myValue)) |
| | | //{ |
| | | //Intent mIntent = new Intent(context, ThisActivity.class); |
| | | //mIntent.putExtras(bundle); |
| | | //mIntent.setFlags(Intent.FLAG_ACTIVITY_NEW_TASK); |
| | | //context.startActivity(mIntent); |
| | | //} |
| | | //else if (TYPE_ANOTHER.equals(myValue)) |
| | | //{ |
| | | //Intent mIntent = new Intent(context, AnotherActivity.class); |
| | | //mIntent.putExtras(bundle); |
| | | //mIntent.setFlags(Intent.FLAG_ACTIVITY_NEW_TASK); |
| | | //context.startActivity(mIntent); |
| | | //} |
| | | } |
| | | |
| | | /// <summary> |
| | | /// android通知栏点击处理方法 |
| | | /// </summary> |
| | | /// <param name="hiddenJson">云端推过来的数据</param> |
| | | private void VideoMethod(string hiddenJson) |
| | | { |
| | | Utlis.WriteLine("JPUSH:" + hiddenJson); |
| | | var hiddanJson = Newtonsoft.Json.Linq.JObject.Parse(hiddenJson); |
| | | if (hiddanJson == null) |
| | | { |
| | | return; |
| | | } |
| | | var json = Newtonsoft.Json.Linq.JObject.Parse(hiddanJson["HiddanJson"].ToString()); |
| | | if (json == null) |
| | | { |
| | | return; |
| | | } |
| | | |
| | | |
| | | |
| | | } |
| | | } |
| | | |
| | | } |
| | |
| | | <!-- 播放本地音乐权限--> |
| | | <uses-permission android:name="android.permission.CHANGE_WIFI_MULTICAST_STATE" /> |
| | | <uses-permission android:name="android.permission.ACCESS_NETWORK_STATE" /> |
| | | <!--极光推送 Required 一些系统要求的权限,如访问网络等--> |
| | | <!-- Required 一些系统要求的权限,如访问网络等--> |
| | | <uses-permission android:name="com.hdl.onpro.permission.JPUSH_MESSAGE" /> |
| | | <uses-permission android:name="android.permission.RECEIVE_USER_PRESENT" /> |
| | | <uses-permission android:name="android.permission.INTERNET" /> |
| | | <uses-permission android:name="android.permission.READ_PHONE_STATE" /> |
| | | <uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE" /> |
| | | <uses-permission android:name="android.permission.READ_EXTERNAL_STORAGE" /> |
| | | <uses-permission android:name="android.permission.WRITE_SETTINGS" /> |
| | | <uses-permission android:name="android.permission.MOUNT_UNMOUNT_FILESYSTEMS" /> |
| | | <uses-permission android:name="android.permission.ACCESS_NETWORK_STATE" /> |
| | | <uses-permission android:name="android.permission.ACCESS_WIFI_STATE" /> |
| | | <!-- Optional for location --> |
| | | <uses-permission android:name="android.permission.VIBRATE" /> |
| | | <uses-permission android:name="android.permission.SYSTEM_ALERT_WINDOW" /> |
| | | <!-- 用于开启 debug 版本的应用在6.0 系统上 层叠窗口权限 --> |
| | | <uses-permission android:name="android.permission.ACCESS_COARSE_LOCATION" /> |
| | | <uses-permission android:name="android.permission.CHANGE_WIFI_STATE" /> |
| | | <uses-permission android:name="android.permission.ACCESS_FINE_LOCATION" /> |
| | | <uses-permission android:name="android.permission.ACCESS_LOCATION_EXTRA_COMMANDS" /> |
| | | <uses-permission android:name="android.permission.CHANGE_NETWORK_STATE" /> |
| | | <uses-permission android:name="android.permission.GET_TASKS" /> |
| | | <uses-permission android:name="android.permission.AUTHENTICATE_ACCOUNTS" /> |
| | | <!-- 极光推送结束 --> |
| | | <application android:allowBackup="true" android:icon="@drawable/Icon" android:networkSecurityConfig="@xml/network_security_config" android:largeHeap="true" android:label="ON+"> |
| | | <provider android:name="android.support.v4.content.FileProvider" android:authorities="com.hdl.onpro.fileProvider" android:grantUriPermissions="true" android:exported="false"> |
| | | <meta-data android:name="android.support.FILE_PROVIDER_PATHS" android:resource="@xml/file_paths" /> |
| | | </provider> |
| | | <!--极光推送--> |
| | | <activity android:name="cn.jpush.android.ui.PopWinActivity" android:exported="false" /> |
| | | <activity android:name="cn.jpush.android.ui.PushActivity" android:configChanges="orientation|keyboardHidden" android:theme="@android:style/Theme.NoTitleBar" android:exported="false"> |
| | | <intent-filter> |
| | | <action android:name="cn.jpush.android.ui.PushActivity" /> |
| | | <category android:name="android.intent.category.DEFAULT" /> |
| | | <category android:name="com.hdl.onpro" /> |
| | | </intent-filter> |
| | | </activity> |
| | | <service android:name="cn.jpush.android.service.PushService" android:process=":mult"> |
| | | <intent-filter> |
| | | <action android:name="cn.jpush.android.intent.REGISTER" /> |
| | | <action android:name="cn.jpush.android.intent.REPORT" /> |
| | | <action android:name="cn.jpush.android.intent.PushService" /> |
| | | <action android:name="cn.jpush.android.intent.PUSH_TIME" /> |
| | | </intent-filter> |
| | | </service> |
| | | <!-- since 3.0.9 Required SDK 核心功能--> |
| | | <provider android:authorities="com.hdl.onpro.DataProvider" android:name="cn.jpush.android.service.DataProvider" android:process=":pushcore" android:exported="false" /> |
| | | <service android:name="cn.jpush.android.service.DaemonService" android:enabled="true" android:exported="true"> |
| | | <intent-filter> |
| | | <action android:name="cn.jpush.android.intent.DaemonService" /> |
| | | <category android:name="com.hdl.onpro" /> |
| | | </intent-filter> |
| | | </service> |
| | | <!-- since 3.1.0 Required SDK 核心功能--> |
| | | <provider android:authorities="com.hdl.onpro.DownloadProvider" android:name="cn.jpush.android.service.DownloadProvider" android:exported="true" /> |
| | | <receiver android:name="cn.jpush.android.service.PushReceiver" android:enabled="true"> |
| | | <intent-filter android:priority="1000"> |
| | | <action android:name="cn.jpush.android.intent.NOTIFICATION_RECEIVED_PROXY" /> |
| | | <category android:name="com.hdl.onpro" /> |
| | | </intent-filter> |
| | | <intent-filter> |
| | | <action android:name="android.intent.action.USER_PRESENT" /> |
| | | <action android:name="android.net.conn.CONNECTIVITY_CHANGE" /> |
| | | </intent-filter> |
| | | <!-- Optional --> |
| | | <intent-filter> |
| | | <action android:name="android.intent.action.PACKAGE_ADDED" /> |
| | | <action android:name="android.intent.action.PACKAGE_REMOVED" /> |
| | | <data android:scheme="package" /> |
| | | </intent-filter> |
| | | </receiver> |
| | | <receiver android:name="cn.jpush.android.service.AlarmReceiver" android:exported="false" /> |
| | | <!-- User defined. For test only 用户自定义的广播接收器--> |
| | | <!-- Required . Enable it you can get statistics data with channel --> |
| | | <meta-data android:name="JPUSH_CHANNEL" android:value="developer-default" /> |
| | | <meta-data android:name="JPUSH_APPKEY" android:value="cbd90743ac45cbca06c8118b" /> |
| | | <!-- </>值来自开发者平台取得的AppKey--> |
| | | <!-- 极光推送结束 --> |
| | | </application> |
| | | </manifest> |
| | |
| | | |
| | | //读取推送信息 |
| | | UIApplication.SharedApplication.ApplicationIconBadgeNumber = 0; |
| | | |
| | | if (userInfo == null) |
| | | { |
| | | return; |
| | | } |
| | | |
| | | Console.WriteLine(userInfo); |
| | | |
| | | if (application.ApplicationState == UIApplicationState.Active || application.ApplicationState == UIApplicationState.Background) |
| | | { |
| | | NSString key_hiddenJson = new NSString("HiddenJson"); |
| | | if (userInfo.ContainsKey(key_hiddenJson)) |
| | | { |
| | | var hiddenJson = userInfo["HiddenJson"].ToString(); |
| | | if (string.IsNullOrEmpty(hiddenJson)) |
| | | { |
| | | return; |
| | | } |
| | | |
| | | if (hiddenJson.Contains("cmtID")) |
| | | { |
| | | /////目前根据这个判断是否是可视对讲数据 |
| | | //VideoMethod(hiddenJson); |
| | | } |
| | | else |
| | | { |
| | | |
| | | NSDictionary hiddenJsonDic = userInfo["HiddenJson"] as NSDictionary; |
| | | if (hiddenJsonDic == null) |
| | | { |
| | | return; |
| | | } |
| | | NSString key_Offline = new NSString("Offline"); |
| | | if (hiddenJsonDic.ContainsKey(key_Offline)) |
| | | { |
| | | string signOut = hiddenJsonDic["Offline"].ToString(); |
| | | |
| | | if (signOut == "0") |
| | | { |
| | | //不下线 |
| | | } |
| | | else |
| | | { |
| | | //强制下线 |
| | | //CommonPage.Instance.SingOut(); |
| | | HDLCommon.Current.ShowAlert(Language.StringByID(StringId.LoggedOnOtherDevices)); |
| | | } |
| | | } |
| | | } |
| | | } |
| | | } |
| | | else |
| | | { |
| | | NSString key_hiddenJson = new NSString("HiddenJson"); |
| | | if (userInfo.ContainsKey(key_hiddenJson)) |
| | | { |
| | | |
| | | var hiddenJson = userInfo["HiddenJson"].ToString(); |
| | | if (string.IsNullOrEmpty(hiddenJson)) |
| | | { |
| | | return; |
| | | } |
| | | |
| | | if (hiddenJson.Contains("cmtID")) |
| | | { |
| | | /////目前根据这个判断是否是可视对讲数据 |
| | | //VideoMethod(hiddenJson); |
| | | } |
| | | else |
| | | { |
| | | |
| | | NSDictionary hiddenJsonDic = userInfo["HiddenJson"] as NSDictionary; |
| | | if (hiddenJsonDic == null) |
| | | { |
| | | return; |
| | | } |
| | | NSString key_Offline = new NSString("Offline"); |
| | | if (hiddenJsonDic.ContainsKey(key_Offline)) |
| | | { |
| | | string signOut = hiddenJsonDic["Offline"].ToString(); |
| | | |
| | | if (signOut == "0") |
| | | { |
| | | //不下线 |
| | | } |
| | | else |
| | | { |
| | | //标记下线 |
| | | haveToSignOut = true; |
| | | } |
| | | } |
| | | } |
| | | } |
| | | |
| | | } |
| | | completionHandler(UIBackgroundFetchResult.NewData); |
| | | } |
| | | |
| | | public override void ReceivedRemoteNotification(UIApplication application, NSDictionary userInfo) |
| | |
| | | Console.WriteLine("OnActivated"); |
| | | base.OnActivated(application); |
| | | |
| | | if (haveToSignOut == true) |
| | | { |
| | | //强制下线 |
| | | //CommonPage.Instance.SingOut(); |
| | | HDLCommon.Current.ShowAlert(Language.StringByID(StringId.LoggedOnOtherDevices)); |
| | | } |
| | | |
| | | } |
| | | |
| | | public override bool FinishedLaunching(UIApplication application, NSDictionary launchOptions) |
| | | { |
| | | |
| | | //Shared.Application.FontSize = 12; |
| | | //Shared.Application.IsUsePingFang = true; |
| | | Shared.Application.IsUsePingFang = true; |
| | | Window = new UIWindow(UIScreen.MainScreen.Bounds); |
| | | rootViewController = new UINavigationController(new ViewController()) { NavigationBarHidden = true }; |
| | | Window.RootViewController = rootViewController; |
| | | Window.MakeKeyAndVisible(); |
| | | |
| | | |
| | | |
| | | AppCenter.Start("e1add75a-82c6-4a5c-a902-4705b195748e",typeof(Analytics), typeof(Crashes)); |
| | | base.FinishedLaunching(application, launchOptions); |
| | |
| | | // UserInfo.Current.areaCode = nsCount; |
| | | // OnAppConfig.Instance.SaveUserConfig(); |
| | | //} |
| | | |
| | | application.IdleTimerDisabled = true; |
| | | application.RegisterForRemoteNotificationTypes(UIRemoteNotificationType.Alert | UIRemoteNotificationType.Badge | UIRemoteNotificationType.Sound); |
| | | |
| | | //window.AccessibilityNavigationStyle = UIAccessibilityNavigationStyle.Automatic; |
| | | // check for a notification |
| | | if (launchOptions != null) |
| | | { |
| | | // check for a remote notification |
| | | if (launchOptions.ContainsKey(UIApplication.LaunchOptionsRemoteNotificationKey)) |
| | | { |
| | | |
| | | NSDictionary remoteNotification = launchOptions[UIApplication.LaunchOptionsRemoteNotificationKey] as NSDictionary; |
| | | if (remoteNotification != null) |
| | | { |
| | | //UIApplication.SharedApplication.ApplicationIconBadgeNumber = 0; |
| | | } |
| | | } |
| | | } |
| | | DealWithPushMes(launchOptions); |
| | | |
| | | if (UIDevice.CurrentDevice.CheckSystemVersion(8, 0)) |
| | | { |
| | | var notificationSettings = UIUserNotificationSettings.GetSettingsForTypes(UIUserNotificationType.Alert | UIUserNotificationType.Badge | UIUserNotificationType.Sound, null); |
| | |
| | | Console.WriteLine("FinishedLaunching"); |
| | | return true; |
| | | } |
| | | |
| | | /// <summary> |
| | | /// 退出登录标记 |
| | | /// </summary> |
| | | bool haveToSignOut; |
| | | /// <summary> |
| | | /// 处理通知 |
| | | /// </summary> |
| | | /// <param name="launchOptions"></param> |
| | | void DealWithPushMes(NSDictionary launchOptions) |
| | | { |
| | | haveToSignOut = false; |
| | | if (launchOptions != null) |
| | | { |
| | | // check for a remote notification |
| | | if (launchOptions.ContainsKey(UIApplication.LaunchOptionsRemoteNotificationKey)) |
| | | { |
| | | NSDictionary userInfo = launchOptions[UIApplication.LaunchOptionsRemoteNotificationKey] as NSDictionary; |
| | | if (userInfo != null) |
| | | { |
| | | NSString key_hiddenJson = new NSString("HiddenJson"); |
| | | if (userInfo.ContainsKey(key_hiddenJson)) |
| | | { |
| | | var hiddenJson = userInfo["HiddenJson"].ToString(); |
| | | if (!string.IsNullOrEmpty(hiddenJson)) |
| | | { |
| | | if (hiddenJson.Contains("cmtID")) |
| | | { |
| | | |
| | | ///目前根据这个判断是否是可视对讲数据 |
| | | // VideoMethod(hiddenJson); |
| | | } |
| | | else |
| | | { |
| | | |
| | | NSDictionary hiddenJsonDic = userInfo["HiddenJson"] as NSDictionary; |
| | | if (hiddenJsonDic != null) |
| | | { |
| | | NSString key_Offline = new NSString("Offline"); |
| | | if (hiddenJsonDic.ContainsKey(key_Offline)) |
| | | { |
| | | string signOut = hiddenJsonDic["Offline"].ToString(); |
| | | |
| | | if (signOut == "0") |
| | | { |
| | | //不下线 |
| | | } |
| | | else |
| | | { |
| | | //标记下线 |
| | | haveToSignOut = true; |
| | | } |
| | | } |
| | | |
| | | } |
| | | } |
| | | } |
| | | |
| | | |
| | | } |
| | | |
| | | } |
| | | } |
| | | } |
| | | } |
| | | |
| | | |
| | | |
| | | } |
| | | } |
| | | |
| | |
| | | <BundleResource Include="Resources\Phone\Public\Search.png" /> |
| | | <BundleResource Include="Resources\Phone\PersonalCenter\Head.png" /> |
| | | <BundleResource Include="Resources\Phone\PersonalCenter\Transfer.png" /> |
| | | <BundleResource Include="Resources\Phone\Collection\MesCenter\All.png" /> |
| | | <BundleResource Include="Resources\Phone\Collection\MesCenter\System.png" /> |
| | | <BundleResource Include="Resources\Phone\Collection\MesCenter\Alarm.png" /> |
| | | <BundleResource Include="Resources\Phone\Collection\MesCenter\AllOn.png" /> |
| | | <BundleResource Include="Resources\Phone\Collection\MesCenter\Share.png" /> |
| | | <BundleResource Include="Resources\Phone\Collection\MesCenter\AlarmOn.png" /> |
| | | <BundleResource Include="Resources\Phone\Collection\MesCenter\ShareOn.png" /> |
| | | <BundleResource Include="Resources\Phone\Collection\MesCenter\SystemOn.png" /> |
| | | <BundleResource Include="Resources\Phone\Classification\Room\Roombg1.png" /> |
| | | <BundleResource Include="Resources\Phone\Classification\Room\Roombg2.png" /> |
| | | <BundleResource Include="Resources\Phone\Classification\Room\Roombg3.png" /> |
| | | <BundleResource Include="Resources\Phone\Classification\Room\Roombg4.png" /> |
| | | <BundleResource Include="Resources\Phone\Classification\Room\Roombg5.png" /> |
| | | <BundleResource Include="Resources\Phone\Classification\Room\Roombg6.png" /> |
| | | <BundleResource Include="Resources\Phone\Classification\Room\Roombg7.png" /> |
| | | <BundleResource Include="Resources\Phone\Classification\Room\Roombg8.png" /> |
| | | <BundleResource Include="Resources\Phone\Classification\Room\Roombg9.png" /> |
| | | <BundleResource Include="Resources\Phone\Classification\Room\Roombg10.png" /> |
| | | </ItemGroup> |
| | | <ItemGroup> |
| | | <ITunesArtwork Include="iTunesArtwork" /> |
| | |
| | | 9036=场景问题 |
| | | 9037=APP使用辅助 |
| | | 9038=常见问题 |
| | | |
| | | 9039=分享与功能 |
| | | 9040=报警类 |
| | | 9041=系统信息 |
| | | 9042=信息中心 |
| | | 9043=该账号已在其它设备登录 |
| | | |
| | | |
| | | 10000=无效登录密钥,请重新登录! |
| | |
| | | ON_Plus, |
| | | } |
| | | |
| | | /// <summary> |
| | | /// 分享 类型 |
| | | /// 分享类型 1.ROOM 2.DEVICE 3.SCENE |
| | | /// </summary> |
| | | public enum ShareType |
| | | { |
| | | /// <summary> |
| | | /// |
| | | /// </summary> |
| | | ROOM = 1, |
| | | /// <summary> |
| | | /// |
| | | /// </summary> |
| | | DEVICE, |
| | | /// <summary> |
| | | /// |
| | | /// </summary> |
| | | SCENE, |
| | | } |
| | | |
| | | |
| | | #endregion |
| | | } |
| | |
| | | #if __IOS__ |
| | | requestObj.DeviceType = PhoneDeviceType.IOS.ToString(); |
| | | #endif |
| | | var requestJson = Newtonsoft.Json.JsonConvert.SerializeObject(requestObj); |
| | | var requestJson = HttpUtil.GetSignRequestJson(requestObj); |
| | | var revertObj = HttpUtil.RequestHttpsPost(NewAPI.API_POST_CheckAppVersion, requestJson); |
| | | if (revertObj.Code == StateCode.SUCCESS) |
| | | { |
| | |
| | | /// 常见问题 |
| | | /// </summary> |
| | | public const int CommonQuestion = 9038; |
| | | /// <summary> |
| | | /// 分享与功能 |
| | | /// </summary> |
| | | public const int SharingAndFunctionality = 9039; |
| | | /// <summary> |
| | | /// 报警类 |
| | | /// </summary> |
| | | public const int AlarmType = 9040; |
| | | /// <summary> |
| | | /// 系统信息 |
| | | /// </summary> |
| | | public const int SystemMessage = 9041; |
| | | /// <summary> |
| | | /// 信息中心 |
| | | /// </summary> |
| | | public const int MessageCenter = 9042; |
| | | /// <summary> |
| | | /// 该账号已在其它设备登录。 |
| | | /// </summary> |
| | | public const int LoggedOnOtherDevices = 9043; |
| | | |
| | | |
| | | #region 网络请求响应错误提示信息 |
| | |
| | | } |
| | | } |
| | | |
| | | /// <summary> |
| | | /// |
| | | /// </summary> |
| | | /// <param name="fileName"></param> |
| | | /// <param name="imagePath"></param> |
| | | public static void FileCopyToRootPath(string oldPath, string fileName) |
| | | { |
| | | System.IO.FileInfo fileInfo = new System.IO.FileInfo(oldPath); |
| | | if (fileInfo.Exists) |
| | | { |
| | | fileInfo.CopyTo(Path.Combine(RootPath, fileName), true); |
| | | //Utlis.WriteLine("FileCopyToRootPath : " + Path.Combine(RootPath, fileName)); |
| | | } |
| | | } |
| | | |
| | | ///// <summary> |
| | | ///// 下载电台、音乐、DLNA等等网络图片 |
| | | ///// </summary> |
| | |
| | | using System.Text; |
| | | using System.Security.Cryptography; |
| | | using HDL_ON.DriverLayer; |
| | | using HDL_ON.Entity; |
| | | |
| | | namespace HDL_ON.DAL.Mqtt |
| | | { |
| | |
| | | { |
| | | MqttInfoConfig.Current.mMqttInfo = mqttInfoRequestResult_Obj; |
| | | await MQTTConnectAsync(); |
| | | //1.判断是否绑定了网关,获取网关远程连接的加密KEY |
| | | if (DB_ResidenceData.residenceData.CheckWhetherGatewayIsBound()) |
| | | { |
| | | //2.找出是否存在匹配当前住宅的mac,存在再进行远程。 |
| | | MqttInfoConfig.Current.HomeGatewayInfo = DB_ResidenceData.residenceData.HomeGateway; |
| | | //3.开始连接 |
| | | await MQTTConnectAsync(); |
| | | } |
| | | else |
| | | { |
| | | Utlis.WriteLine("============>还没绑定网关"); |
| | | } |
| | | } |
| | | } |
| | | |
| | |
| | | /// <returns></returns> |
| | | public string UpdataUserHeadImage(string fileName) |
| | | { |
| | | FileStream fs = new FileStream(fileName, FileMode.Open, FileAccess.Read); |
| | | byte[] bytes = new byte[fs.Length]; |
| | | fs.Read(bytes, 0, bytes.Length); |
| | | byte[] bytes = Shared.IO.FileUtils.ReadFile(fileName); |
| | | var revertObj = HttpUtil.RequestHttpsUpload(RestSharp.Method.POST, NewAPI.API_POST_Head_Upload, bytes); |
| | | return revertObj.Code; |
| | | } |
| | |
| | | /// </summary> |
| | | public string GetHomePager(HomeTypeEnum homeType = HomeTypeEnum.ALL) |
| | | { |
| | | var requestJson = Newtonsoft.Json.JsonConvert.SerializeObject(new GetHomeListObj() { homeType = homeType.ToString() }); |
| | | var requestJson = HttpUtil.GetSignRequestJson(new GetHomeListObj() { homeType = homeType.ToString() }); |
| | | var resultObj = HttpUtil.RequestHttpsPost(NewAPI.API_POST_Gethomepager, requestJson); |
| | | if (resultObj.Code == StateCode.SUCCESS) |
| | | { |
| | |
| | | } |
| | | DB_ResidenceData.residenceData.SaveResidenceData(); |
| | | UserInfo.Current.SaveUserInfo(); |
| | | |
| | | //刷新一次住宅网关 |
| | | GetHomeGatewayList(); |
| | | } |
| | | |
| | | } |
| | |
| | | requestObj.Address = editName; |
| | | } |
| | | |
| | | var requestJson = Newtonsoft.Json.JsonConvert.SerializeObject(requestObj); |
| | | var requestJson = HttpUtil.GetSignRequestJson(requestObj); |
| | | return HttpUtil.RequestHttpsPostFroHome(NewAPI.API_POST_Home_UpdateHome, requestJson); |
| | | } |
| | | |
| | | /// <summary> |
| | | /// 获取刷新当前住宅网关接口 |
| | | /// 获取刷新当前住宅的网关列表 |
| | | /// </summary> |
| | | public void GetHomeGatewayList() |
| | | { |
| | | if (string.IsNullOrEmpty(DB_ResidenceData.residenceData.residecenInfo.RegionID)) return; |
| | | var nowhomeId = DB_ResidenceData.residenceData.residecenInfo.RegionID; |
| | | var requestJson = Newtonsoft.Json.JsonConvert.SerializeObject(new HomeIdObj() { homeId = nowhomeId }); |
| | | var revertObj = HttpUtil.RequestHttpsPostFroHome(NewAPI.API_POST_GetGatewayList, requestJson); |
| | | if (revertObj.Code == StateCode.SUCCESS) |
| | | try |
| | | { |
| | | var mHomeGatewayRes = Newtonsoft.Json.JsonConvert.DeserializeObject<List<HomeGatewayInfo>>(revertObj.Data.ToString()); |
| | | if (nowhomeId == DB_ResidenceData.residenceData.residecenInfo.RegionID) |
| | | if (string.IsNullOrEmpty(DB_ResidenceData.residenceData.residecenInfo.RegionID)) return; |
| | | var nowhomeId = DB_ResidenceData.residenceData.residecenInfo.RegionID; |
| | | var requestJson = HttpUtil.GetSignRequestJson(new HomeIdObj() { homeId = nowhomeId }); |
| | | var revertObj = HttpUtil.RequestHttpsPostFroHome(NewAPI.API_POST_GetGatewayList, requestJson); |
| | | if (revertObj.Code == StateCode.SUCCESS) |
| | | { |
| | | if (mHomeGatewayRes != null) |
| | | var mHomeGatewayRes = Newtonsoft.Json.JsonConvert.DeserializeObject<List<HomeGatewayInfo>>(revertObj.Data.ToString()); |
| | | if (nowhomeId == DB_ResidenceData.residenceData.residecenInfo.RegionID) |
| | | { |
| | | if (mHomeGatewayRes.Count > 0) |
| | | if (mHomeGatewayRes != null) |
| | | { |
| | | DB_ResidenceData.residenceData.residenceGatewayMAC = mHomeGatewayRes[0].mac; |
| | | if (mHomeGatewayRes.Count > 0) |
| | | { |
| | | DB_ResidenceData.residenceData.HomeGateway = mHomeGatewayRes[0]; |
| | | DB_ResidenceData.residenceData.SaveResidenceData(); |
| | | return; |
| | | } |
| | | } |
| | | else |
| | | { |
| | | DB_ResidenceData.residenceData.residenceGatewayMAC = ""; |
| | | |
| | | } |
| | | //其余情况清空网关信息 |
| | | DB_ResidenceData.residenceData.HomeGateway = null; |
| | | DB_ResidenceData.residenceData.SaveResidenceData(); |
| | | } |
| | | |
| | | if (mHomeGatewayRes != null) |
| | | { |
| | | //Utlis.WriteLine ("获得当前住宅网关个数:" + mHomeGatewayRes.content.Count); |
| | | } |
| | | } |
| | | else |
| | | { |
| | | //提示错误 |
| | | } |
| | | } |
| | | else |
| | | catch |
| | | { |
| | | //提示错误 |
| | | |
| | | } |
| | | } |
| | | |
| | |
| | | /// <returns></returns> |
| | | public ResponsePackNew GetResidenceMemberAccount() |
| | | { |
| | | var requestJson = Newtonsoft.Json.JsonConvert.SerializeObject(new HomeIdObj() { homeId = DB_ResidenceData.residenceData.residecenInfo.RegionID }); |
| | | var requestJson = HttpUtil.GetSignRequestJson(new HomeIdObj() { homeId = DB_ResidenceData.residenceData.residecenInfo.RegionID }); |
| | | return HttpUtil.RequestHttpsPostFroHome(NewAPI.API_POST_Child_FindAll, requestJson); |
| | | } |
| | | |
| | |
| | | childAccountId = subaccount.childAccountId, |
| | | homeId = subaccount.homeId |
| | | }; |
| | | var requestJson = Newtonsoft.Json.JsonConvert.SerializeObject(requestObj); |
| | | var requestJson = HttpUtil.GetSignRequestJson(requestObj); |
| | | return HttpUtil.RequestHttpsPostFroHome(NewAPI.API_POST_Child_Delete, requestJson); |
| | | } |
| | | |
| | |
| | | /// <returns></returns> |
| | | public ResponsePackNew EditSubAccountNickName(string nickName, string childAccountId) |
| | | { |
| | | var requestJson = Newtonsoft.Json.JsonConvert.SerializeObject(new UpdateChildNickNameObj() |
| | | var requestJson = HttpUtil.GetSignRequestJson(new UpdateChildNickNameObj() |
| | | { |
| | | homeId = DB_ResidenceData.residenceData.residecenInfo.RegionID, |
| | | childAccountId = childAccountId, |
| | |
| | | /// <returns></returns> |
| | | public ResponsePackNew ChangeCreateSceneState(bool isAllow, string childAccountId) |
| | | { |
| | | var requestJson = Newtonsoft.Json.JsonConvert.SerializeObject(new UpdateChildAllowCreateSceneObj() |
| | | var requestJson = HttpUtil.GetSignRequestJson(new UpdateChildAllowCreateSceneObj() |
| | | { |
| | | homeId = DB_ResidenceData.residenceData.residecenInfo.RegionID, |
| | | childAccountId = childAccountId, |
| | |
| | | }); |
| | | return HttpUtil.RequestHttpsPostFroHome(NewAPI.API_POST_Child_Update, requestJson); |
| | | } |
| | | |
| | | #region 新数据分享 |
| | | /// <summary> |
| | | /// 添加分享 |
| | | /// </summary> |
| | | /// <param name="addShareObj"></param> |
| | | /// <returns></returns> |
| | | public ResponsePackNew AddShare(AddShareObj addShareObj) |
| | | { |
| | | var requestJson = HttpUtil.GetSignRequestJson(addShareObj); |
| | | |
| | | return HttpUtil.RequestHttpsPostFroHome(NewAPI.API_POST_Share_Add, requestJson); |
| | | } |
| | | |
| | | /// <summary> |
| | | /// 删除分享 |
| | | /// </summary> |
| | | /// <param name="deleteShareObj"></param> |
| | | /// <returns></returns> |
| | | public ResponsePackNew DeleteShare(DeleteShareObj deleteShareObj) |
| | | { |
| | | var requestJson = HttpUtil.GetSignRequestJson(deleteShareObj); |
| | | |
| | | return HttpUtil.RequestHttpsPostFroHome(NewAPI.API_POST_Share_Delete, requestJson); |
| | | } |
| | | |
| | | /// <summary> |
| | | /// 获取分享 |
| | | /// </summary> |
| | | /// <param name="addShareObj"></param> |
| | | /// <returns></returns> |
| | | public ResponsePackNew GetShare(GetShareObj getShareObj) |
| | | { |
| | | var requestJson = HttpUtil.GetSignRequestJson(getShareObj); |
| | | |
| | | return HttpUtil.RequestHttpsPostFroHome(NewAPI.API_POST_Share_Delete, requestJson); |
| | | } |
| | | #endregion |
| | | |
| | | /// <summary> |
| | | /// 获取住宅下子账号的共享数据列表 |
| | |
| | | //string jsonString = Newtonsoft.Json.JsonConvert.SerializeObject(d); |
| | | //return RequestHttps($"{severAddress}/ZigbeeDataShare/GetShareDataBySubAccount", jsonString, true); |
| | | |
| | | var requestJson = Newtonsoft.Json.JsonConvert.SerializeObject(new HomeShareFindAll() |
| | | var requestJson = HttpUtil.GetSignRequestJson(new HomeShareFindAll() |
| | | { |
| | | homeId = DB_ResidenceData.residenceData.residecenInfo.RegionID, |
| | | childAccountId = childAccountId |
| | |
| | | /// <returns></returns> |
| | | public ResponsePackNew DeleteShareData(ShareData shareData) |
| | | { |
| | | var requestJson = Newtonsoft.Json.JsonConvert.SerializeObject(new ShareFileDownObj() |
| | | var requestJson = HttpUtil.GetSignRequestJson(new ShareFileDownObj() |
| | | { |
| | | homeId = shareData.homeId, |
| | | homeShareId = shareData.id |
| | |
| | | { |
| | | //添加子账号 |
| | | var requestObj = new ChildAddObj() { homeId = DB_ResidenceData.residenceData.residecenInfo.RegionID, account = subAccount, nickName = nickName }; |
| | | var requestJson = Newtonsoft.Json.JsonConvert.SerializeObject(requestObj); |
| | | var requestJson = HttpUtil.GetSignRequestJson(requestObj); |
| | | return HttpUtil.RequestHttpsPostFroHome(NewAPI.API_POST_Child_Add, requestJson); |
| | | |
| | | } |
| | |
| | | { |
| | | try |
| | | { |
| | | var requestJson = Newtonsoft.Json.JsonConvert.SerializeObject(new GetMqttRemoteInfoObj() |
| | | var requestJson = HttpUtil.GetSignRequestJson(new GetMqttRemoteInfoObj() |
| | | { |
| | | attachClientId = attachClientId, |
| | | homeType = HomeTypeEnum.BUSPRO.ToString() |
| | |
| | | #if __IOS__ |
| | | deviceType = PhoneDeviceType.IOS.ToString(); |
| | | #endif |
| | | //是否生成模式 |
| | | //是否生产模式 |
| | | bool isProduce = true; |
| | | #if DEBUG |
| | | isProduce = false; |
| | | #endif |
| | | |
| | | if (string.IsNullOrEmpty(OnAppConfig.Instance.PushDeviceToken)) return false; |
| | | if (string.IsNullOrEmpty(OnAppConfig.Instance.PushDeviceToken)) { |
| | | Utlis.WriteLine("PushDeviceToken 为空"); |
| | | return false; |
| | | } |
| | | |
| | | var mAddpushinfoObj = new AddpushinfoObj() |
| | | { |
| | |
| | | deviceName = OnAppConfig.Instance.PhoneName, |
| | | deviceType = deviceType, |
| | | produce = isProduce, |
| | | |
| | | }; |
| | | |
| | | var mAddpushinfoJson = Newtonsoft.Json.JsonConvert.SerializeObject(mAddpushinfoObj); |
| | | //var mAddpushinfoJson = HttpUtil.GetSignRequestJson(mAddpushinfoObj); |
| | | var revertObj = HttpUtil.RequestHttpsPost(NewAPI.API_POST_PushSerivce_AddToken, mAddpushinfoJson); |
| | | if (revertObj.Code == StateCode.SUCCESS) |
| | | { |
| | |
| | | { |
| | | OnAppConfig.Instance.PushId = pushId; |
| | | OnAppConfig.Instance.SaveUserConfig(); |
| | | |
| | | return true; |
| | | } |
| | | } |
| | | Utlis.WriteLine("AddToken 成功"); |
| | | |
| | | } |
| | | else |
| | | { |
| | | Utlis.WriteLine("AddToken 失败"); |
| | | //Utlis.WriteLine("AddToken 失败"); |
| | | } |
| | | return false; |
| | | } |
| | |
| | | } |
| | | } |
| | | |
| | | |
| | | /// <summary> |
| | | /// 查询推送信息列表 |
| | | /// </summary> |
| | | /// <returns></returns> |
| | | public ResponsePackNew PushSerivceGetpushmessagelist() |
| | | public ResponsePackNew PushSerivceGetPushmessagelist() |
| | | { |
| | | var requestJson = Newtonsoft.Json.JsonConvert.SerializeObject(new GetMessageListObj() |
| | | var requestJson = HttpUtil.GetSignRequestJson(new GetMessageListObj() |
| | | { |
| | | pushId = OnAppConfig.Instance.PushId |
| | | }); |
| | |
| | | { |
| | | if (string.IsNullOrEmpty(OnAppConfig.Instance.PushId)) return false; |
| | | |
| | | var requestJson = Newtonsoft.Json.JsonConvert.SerializeObject(new PushIdObj() |
| | | var requestJson = HttpUtil.GetSignRequestJson(new PushIdObj() |
| | | { |
| | | pushId = OnAppConfig.Instance.PushId |
| | | }); |
| | |
| | | if (string.IsNullOrEmpty(OnAppConfig.Instance.PushId)) return false; |
| | | try |
| | | { |
| | | var requestJson = Newtonsoft.Json.JsonConvert.SerializeObject(new PushIdObj() { |
| | | var requestJson = HttpUtil.GetSignRequestJson(new PushIdObj() { |
| | | pushId = OnAppConfig.Instance.PushId |
| | | }); |
| | | |
| | |
| | | |
| | | try |
| | | { |
| | | var requestJson = Newtonsoft.Json.JsonConvert.SerializeObject(new PushIdObj() |
| | | var requestJson = HttpUtil.GetSignRequestJson(new PushIdObj() |
| | | { |
| | | pushId = OnAppConfig.Instance.PushId |
| | | }); |
| | |
| | | |
| | | try |
| | | { |
| | | var requestJson = Newtonsoft.Json.JsonConvert.SerializeObject(new PushMsgIdObj() |
| | | var requestJson = HttpUtil.GetSignRequestJson(new PushMsgIdObj() |
| | | { |
| | | msgId = msgId |
| | | }); |
| | |
| | | |
| | | try |
| | | { |
| | | var requestJson = Newtonsoft.Json.JsonConvert.SerializeObject(new PushMsgIdObj() |
| | | var requestJson = HttpUtil.GetSignRequestJson(new PushMsgIdObj() |
| | | { |
| | | msgId = msgId |
| | | }); |
| | |
| | | return false; |
| | | } |
| | | } |
| | | |
| | | /// <summary> |
| | | /// 注册推送 |
| | | /// </summary> |
| | | public void RegisteredPush() |
| | | { |
| | | new System.Threading.Thread(() => |
| | | { |
| | | var success = PushSerivceAddPushInfo(); |
| | | if (success) |
| | | { |
| | | Utlis.WriteLine("推送注册成功"); |
| | | } |
| | | else |
| | | { |
| | | Utlis.WriteLine("推送注册失败"); |
| | | } |
| | | }) |
| | | { IsBackground = true }.Start(); |
| | | } |
| | | |
| | | /// <summary> |
| | | /// 注销推送 |
| | | /// </summary> |
| | | public void SignOutPush() |
| | | { |
| | | new System.Threading.Thread(() => |
| | | { |
| | | var success = PushSerivceSignOut(); |
| | | if (success) |
| | | { |
| | | Utlis.WriteLine("推送注销成功"); |
| | | } |
| | | else |
| | | { |
| | | Utlis.WriteLine("推送注销失败"); |
| | | } |
| | | }) |
| | | { IsBackground = true }.Start(); |
| | | } |
| | | |
| | | #endregion |
| | | |
| | | #region 检测更新 |
| | |
| | | #if __IOS__ |
| | | requestObj.DeviceType = PhoneDeviceType.IOS.ToString(); |
| | | #endif |
| | | var requestJson = Newtonsoft.Json.JsonConvert.SerializeObject(requestObj); |
| | | var requestJson = HttpUtil.GetSignRequestJson(requestObj); |
| | | return HttpUtil.RequestHttpsPost(NewAPI.API_POST_CheckAppVersion, requestJson); |
| | | } |
| | | |
| | |
| | | #if __IOS__ |
| | | requestObj.DeviceType = PhoneDeviceType.IOS.ToString(); |
| | | #endif |
| | | var requestJson = Newtonsoft.Json.JsonConvert.SerializeObject(requestObj); |
| | | var requestJson = HttpUtil.GetSignRequestJson(requestObj); |
| | | return HttpUtil.RequestHttpsPost(NewAPI.API_POST_GetAppVersion, requestJson); |
| | | } |
| | | |
| | |
| | | |
| | | #endregion |
| | | |
| | | #region mqtt远程连接(旧) |
| | | /// <summary> |
| | | /// 请求Mqtt数据 |
| | | /// </summary> |
| | | /// <param name="dataStringJson">请求的参数.</param> |
| | | public ResponsePack RequestMqttInfo(string dataStringJson) |
| | | { |
| | | ResponsePack revertObj = null; |
| | | |
| | | var webClient = new WebClient(); |
| | | #region |
| | | webClient.Headers.Add("CONTENT-TYPE", "application/json"); |
| | | var url = "https://global.hdlcontrol.com/ProposedProductionApi/EmqMqtt/GetConnMqttInfo"; |
| | | |
| | | byte[] bytes = null; |
| | | try |
| | | { |
| | | bytes = webClient.UploadData(url, Encoding.UTF8.GetBytes(dataStringJson)); |
| | | } |
| | | catch (Exception ex) |
| | | { |
| | | Console.WriteLine(ex.Message); |
| | | revertObj = new ResponsePack() { StateCode = "Net_Error" }; |
| | | } |
| | | |
| | | string responseString = null; |
| | | if (bytes != null) |
| | | { |
| | | responseString = Encoding.UTF8.GetString(bytes); |
| | | } |
| | | |
| | | if (responseString != null) |
| | | { |
| | | try |
| | | { |
| | | revertObj = Newtonsoft.Json.JsonConvert.DeserializeObject<ResponsePack>(responseString); |
| | | } |
| | | catch (Exception ex) |
| | | { |
| | | Console.WriteLine(ex.ToString()); |
| | | } |
| | | } |
| | | return revertObj; |
| | | #endregion |
| | | } |
| | | #endregion |
| | | |
| | | #region 备份部分 |
| | | ///// <summary> |
| | |
| | | public static ResponsePackNew RequestHttpsPostFroHome(string apiPath, string bodyParameterJson, int mTimeout = 10) |
| | | { |
| | | string urlHead = DB_ResidenceData.residenceData.residecenInfo.regionUrl; |
| | | var replaceToken = ""; |
| | | if (DB_ResidenceData.residenceData.residecenInfo.IsOthreShare) |
| | | { |
| | | replaceToken = DB_ResidenceData.residenceData.MasterToken; |
| | | } |
| | | return RequestHttps(Method.POST, apiPath, bodyParameterJson, null, null, urlHead, replaceToken, mTimeout); |
| | | //var replaceToken = ""; |
| | | //if (DB_ResidenceData.residenceData.residecenInfo.IsOthreShare) |
| | | //{ |
| | | // replaceToken = DB_ResidenceData.residenceData.MasterToken; |
| | | //} |
| | | return RequestHttps(Method.POST, apiPath, bodyParameterJson, null, null, urlHead, "", mTimeout); |
| | | } |
| | | |
| | | /// <summary> |
| | |
| | | /// <summary> |
| | | /// 上传头像 |
| | | /// </summary> |
| | | public const string API_POST_Head_Upload = "/home-wisdom/head/portrait/upload"; |
| | | public const string API_POST_Head_Upload = "/home-wisdom/app/head/portrait/upload"; |
| | | /// <summary> |
| | | /// 下载头像 |
| | | /// </summary> |
| | | public const string API_POST_Head_Down = "/home-wisdom/head/portrait/down"; |
| | | public const string API_POST_Head_Down = "/home-wisdom/app/head/portrait/down"; |
| | | /// <summary> |
| | | /// 根据账号下载头像 |
| | | /// </summary> |
| | | public const string API_POST_Head_DownWithAccount = "/home-wisdom/head/portrait/downWithAccount"; |
| | | public const string API_POST_Head_DownWithAccount = "/home-wisdom/app/head/portrait/downWithAccount"; |
| | | /// <summary> |
| | | /// 绑定认证(手机/邮箱) |
| | | /// </summary> |
| | |
| | | #endregion |
| | | |
| | | #region ■ HomeCluster -- 住宅管理接口___________________________ |
| | | ///// <summary> |
| | | ///// 添加住宅 |
| | | ///// </summary> |
| | | //public const string API_POST_Addhome = "/HomeCluster/V1/addhome"; |
| | | /// <summary> |
| | | /// 获取住宅分页 |
| | | /// </summary> |
| | | public const string API_POST_Gethomepager = "/home-wisdom/home/list"; |
| | | public const string API_POST_Gethomepager = "/home-wisdom/app/home/list"; |
| | | /// <summary> |
| | | /// 删除住宅 |
| | | /// </summary> |
| | | public const string API_POST_Home_Delete = "/home-wisdom/home/delete"; |
| | | public const string API_POST_Home_Delete = "/home-wisdom/app/home/delete"; |
| | | /// <summary> |
| | | /// 更新住宅 |
| | | /// </summary> |
| | | public const string API_POST_Home_UpdateHome = "/home-wisdom/home/update"; |
| | | |
| | | public const string API_POST_Home_UpdateHome = "/home-wisdom/app/home/update"; |
| | | /// <summary> |
| | | /// 住宅迁移 |
| | | /// </summary> |
| | | public const string API_POST_Home_Transfer = "/home-wisdom/app/home/transfer"; |
| | | #endregion |
| | | |
| | | #region ■ 子账号 -- 添加住宅成员___________________________ |
| | | /// <summary> |
| | | /// 添加子账户 |
| | | /// </summary> |
| | | public const string API_POST_Child_Add = "/home-wisdom/child/account/add"; |
| | | public const string API_POST_Child_Add = "/home-wisdom/app/child/account/add"; |
| | | /// <summary> |
| | | /// 删除子账户 |
| | | /// </summary> |
| | | public const string API_POST_Child_Delete = "/home-wisdom/child/account/delete"; |
| | | public const string API_POST_Child_Delete = "/home-wisdom/app/child/account/delete"; |
| | | /// <summary> |
| | | /// 根据住宅 id 查询所有的子账户 |
| | | /// </summary> |
| | | public const string API_POST_Child_FindAll = "/home-wisdom/child/account/findAll"; |
| | | public const string API_POST_Child_FindAll = "/home-wisdom/app/child/account/findAll"; |
| | | /// <summary> |
| | | /// 更新远程控制 |
| | | /// </summary> |
| | | public const string API_POST_Child_Update = "/home-wisdom/child/account/update"; |
| | | public const string API_POST_Child_Update = "/home-wisdom/app/child/account/update"; |
| | | /// <summary> |
| | | /// 子账号管理员获取主账号授权Token |
| | | /// </summary> |
| | | public const string API_POST_Child_GetMasterToken = "/home-wisdom/child/account/masterToken/get"; |
| | | public const string API_POST_Child_GetMasterToken = "/home-wisdom/app/child/account/masterToken/get"; |
| | | /// <summary> |
| | | /// 下载子账号头像 |
| | | /// </summary> |
| | | public const string API_POST_Child_DownloadHeadImage = "/home-wisdom/child/account/getHeadPortrait"; |
| | | public const string API_POST_Child_DownloadHeadImage = "/home-wisdom/app/child/account/getHeadPortrait"; |
| | | #region 数据分享 |
| | | /// <summary> |
| | | /// 分享指定文件给指定成员 |
| | | /// </summary> |
| | | public const string API_POST_Home_Share_Add = "/home-wisdom/home/share/add"; |
| | | public const string API_POST_Home_Share_Add = "/home-wisdom/app/home/share/add"; |
| | | /// <summary> |
| | | /// 查询指定成员的所有分享文件 |
| | | /// </summary> |
| | | public const string API_POST_Home_Share_FindAll = "/home-wisdom/home/share/findAll"; |
| | | public const string API_POST_Home_Share_FindAll = "/home-wisdom/app/home/share/findAll"; |
| | | /// <summary> |
| | | /// 下载指定的分享文件 |
| | | /// </summary> |
| | | public const string API_POST_Home_Share_DownOne = "/home-wisdom/home/share/downOne"; |
| | | public const string API_POST_Home_Share_DownOne = "/home-wisdom/app/home/share/downOne"; |
| | | /// <summary> |
| | | /// 删除指定的分享文件 |
| | | /// </summary> |
| | | public const string API_POST_Home_Share_Delete = "/home-wisdom/home/share/delete"; |
| | | public const string API_POST_Home_Share_Delete = "/home-wisdom/app/home/share/delete"; |
| | | |
| | | #endregion |
| | | |
| | | #endregion |
| | | |
| | | #region ■ GatewayCluster -- 网关___________________________ |
| | | |
| | | /// <summary> |
| | | /// 绑定网关到住宅 |
| | | /// </summary> |
| | | public const string API_POST_BindGateway = "/home-wisdom/gateway/bindGateway"; |
| | | |
| | | ///// <summary> |
| | | ///// 绑定网关到住宅 |
| | | ///// </summary> |
| | | //public const string API_POST_BindGateway = "/home-wisdom/app/gateway/bindGateway"; |
| | | /// <summary> |
| | | /// 获取住宅网关分页 |
| | | /// </summary> |
| | | public const string API_POST_GetGatewayList = "/home-wisdom/gateway/getGatewayList"; |
| | | |
| | | public const string API_POST_GetGatewayList = "/home-wisdom/app/gateway/getGatewayList"; |
| | | ///// <summary> |
| | | ///// 解绑绑网关到住宅 |
| | | ///// </summary> |
| | | public const string API_POST_UntieGateway = "/home-wisdom/gateway/untieGateway"; |
| | | public const string API_POST_UntieGateway = "/home-wisdom/app/gateway/untieGateway"; |
| | | |
| | | #endregion |
| | | |
| | |
| | | /// <summary> |
| | | /// 获取远程连接 |
| | | /// </summary> |
| | | public const string API_POST_GetMqttRemoteInfo = "/home-wisdom/mqtt/getRemoteInfo"; |
| | | public const string API_POST_GetMqttRemoteInfo = "/home-wisdom/app/mqtt/getRemoteInfo"; |
| | | #endregion |
| | | |
| | | #region ■ HomebackupCluster -- 住宅备份微服务___________________________ |
| | | /// <summary> |
| | | /// 创建文件夹 |
| | | /// </summary> |
| | | public const string API_POST_Folder_Create = "/home-wisdom/backup/folder/create"; |
| | | |
| | | /// <summary> |
| | | /// 删除文件夹 |
| | | /// </summary> |
| | | public const string API_POST_Folder_Delete = "/home-wisdom/backup/folder/delete"; |
| | | |
| | | /// <summary> |
| | | /// 查找所有文件夹 |
| | | /// </summary> |
| | | public const string API_POST_Folder_FindAll = "/home-wisdom/backup/folder/findAll"; |
| | | |
| | | /// <summary> |
| | | /// 更新文件夹 |
| | | /// </summary> |
| | | public const string API_POST_Folder_Update = "/home-wisdom/backup/folder/update"; |
| | | |
| | | /// <summary> |
| | | /// 上传文件 |
| | | /// </summary> |
| | | public const string API_POST_File_Create = "/home-wisdom/backup/file/create"; |
| | | ///// <summary> |
| | | ///// 创建文件夹 |
| | | ///// </summary> |
| | | //public const string API_POST_Folder_Create = "/home-wisdom/app/backup/folder/create"; |
| | | |
| | | ///// <summary> |
| | | ///// 删除文件 |
| | | ///// 删除文件夹 |
| | | ///// </summary> |
| | | //public const string API_DELETE_File_Delete = "/HomebackupCluster/V1/file/delete"; |
| | | //public const string API_POST_Folder_Delete = "/home-wisdom/app/backup/folder/delete"; |
| | | |
| | | /// <summary> |
| | | /// 下载备份文件 |
| | | /// </summary> |
| | | public const string API_POST_File_Down = "/home-wisdom/backup/file/downOne"; |
| | | ///// <summary> |
| | | ///// 查找所有文件夹 |
| | | ///// </summary> |
| | | //public const string API_POST_Folder_FindAll = "/home-wisdom/app/backup/folder/findAll"; |
| | | |
| | | /// <summary> |
| | | /// 查询一个文件夹所有文件名 |
| | | /// </summary> |
| | | public const string API_POST_File_FindAll = "/home-wisdom/backup/file/findAll"; |
| | | ///// <summary> |
| | | ///// 更新文件夹 |
| | | ///// </summary> |
| | | //public const string API_POST_Folder_Update = "/home-wisdom/app/backup/folder/update"; |
| | | |
| | | ///// <summary> |
| | | ///// 上传文件 |
| | | ///// </summary> |
| | | //public const string API_POST_File_Create = "/home-wisdom/app/backup/file/create"; |
| | | |
| | | /////// <summary> |
| | | /////// 删除文件 |
| | | /////// </summary> |
| | | ////public const string API_DELETE_File_Delete = "/HomebackupCluster/V1/file/delete"; |
| | | |
| | | ///// <summary> |
| | | ///// 下载备份文件 |
| | | ///// </summary> |
| | | //public const string API_POST_File_Down = "/home-wisdom/app/backup/file/downOne"; |
| | | |
| | | ///// <summary> |
| | | ///// 查询一个文件夹所有文件名 |
| | | ///// </summary> |
| | | //public const string API_POST_File_FindAll = "/home-wisdom/app/backup/file/findAll"; |
| | | |
| | | #endregion |
| | | |
| | | #region ■ zigbeespeakerservice -- 语音控制服务___________________________ |
| | | |
| | | /// <summary> |
| | | /// 获取音箱列表 |
| | | /// </summary> |
| | | public const string API_GET_Speaker_Auth = "/speakerservices/Auth"; |
| | | ///// <summary> |
| | | ///// 获取音箱列表 |
| | | ///// </summary> |
| | | //public const string API_GET_Speaker_Auth = "/speakerservices/Auth"; |
| | | |
| | | /// <summary> |
| | | /// 修改音箱备注 |
| | | /// </summary> |
| | | public const string API_PUT_Speaker_Auth_Rename = "/speakerservices/Auth"; |
| | | ///// <summary> |
| | | ///// 修改音箱备注 |
| | | ///// </summary> |
| | | //public const string API_PUT_Speaker_Auth_Rename = "/speakerservices/Auth"; |
| | | |
| | | /// <summary> |
| | | /// 获取设备和场景列表 |
| | | /// </summary> |
| | | public const string API_GET_Speaker_BatchEdit_V2 = "/speakerservices/BatchEdit_V2"; |
| | | ///// <summary> |
| | | ///// 获取设备和场景列表 |
| | | ///// </summary> |
| | | //public const string API_GET_Speaker_BatchEdit_V2 = "/speakerservices/BatchEdit_V2"; |
| | | |
| | | /// <summary> |
| | | /// 添加设备和场景列表 |
| | | /// </summary> |
| | | public const string API_POST_Speaker_BatchEdit_V2 = "/speakerservices/BatchEdit_V2"; |
| | | ///// <summary> |
| | | ///// 添加设备和场景列表 |
| | | ///// </summary> |
| | | //public const string API_POST_Speaker_BatchEdit_V2 = "/speakerservices/BatchEdit_V2"; |
| | | |
| | | |
| | | #endregion |
| | |
| | | |
| | | |
| | | |
| | | #region ■ -- 房间、设备、场景分享___________________________ |
| | | /// <summary> |
| | | /// 添加分享 |
| | | /// </summary> |
| | | public const string API_POST_Share_Add = "/home-wisdom/app/share/add"; |
| | | /// <summary> |
| | | /// 删除分享 |
| | | /// </summary> |
| | | public const string API_POST_Share_Delete = "/home-wisdom/app/share/delete"; |
| | | /// <summary> |
| | | /// 获取分享 |
| | | /// </summary> |
| | | public const string API_POST_Share_Get = "/home-wisdom/app/share/get"; |
| | | #endregion |
| | | |
| | | #endregion |
| | | } |
| | |
| | | |
| | | #endregion |
| | | |
| | | #region 数据分享 |
| | | /// <summary> |
| | | /// 添加分享 |
| | | /// </summary> |
| | | [System.Serializable] |
| | | public class AddShareObj |
| | | { |
| | | /// <summary> |
| | | /// 住宅ID |
| | | /// </summary> |
| | | public int homeId; |
| | | /// <summary> |
| | | /// |
| | | /// </summary> |
| | | public List<ShareDatasItem> shareDatas; |
| | | /// <summary> |
| | | /// 子账号ID |
| | | /// </summary> |
| | | public List<string> childAccountIds; |
| | | } |
| | | |
| | | |
| | | public class ShareDatasItem |
| | | { |
| | | /// <summary> |
| | | /// 分享类型表id |
| | | /// </summary> |
| | | public string shareTypeId; |
| | | /// <summary> |
| | | /// 分享类型 1.ROOM 2.DEVICE 3.SCENE |
| | | /// </summary> |
| | | public string shareType; |
| | | } |
| | | |
| | | |
| | | /// <summary> |
| | | /// 删除分享 |
| | | /// </summary> |
| | | [System.Serializable] |
| | | public class DeleteShareObj |
| | | { |
| | | /// <summary> |
| | | /// |
| | | /// </summary> |
| | | public List<ShareDatasItem> shareDatas; |
| | | /// <summary> |
| | | /// 子账号ID |
| | | /// </summary> |
| | | public List<string> childAccountIds; |
| | | } |
| | | |
| | | /// <summary> |
| | | /// 获取分享 |
| | | /// </summary> |
| | | [System.Serializable] |
| | | public class GetShareObj |
| | | { |
| | | /// <summary> |
| | | /// 住宅ID |
| | | /// </summary> |
| | | public int homeId; |
| | | /// <summary> |
| | | /// 分享主键ids |
| | | /// </summary> |
| | | public List<string> ids; |
| | | } |
| | | |
| | | #endregion |
| | | |
| | | #endregion |
| | | |
| | | |
| | |
| | | using System; |
| | | using System.Collections.Generic; |
| | | using System.Threading; |
| | | using HDL_ON.DAL.Server; |
| | | using Shared; |
| | | |
| | | namespace HDL_ON.Entity |
| | |
| | | public DB_ResidenceData() |
| | | { |
| | | } |
| | | |
| | | /// <summary> |
| | | /// 主人token |
| | | /// </summary> |
| | |
| | | } |
| | | else |
| | | { |
| | | var curRegion = UserInfo.Current.regionList.Find((obj) => obj.RegionID == CurReginID); |
| | | var curRegion = UserInfo.Current.regionList.Find((obj) => obj.RegionID == CurReginID); |
| | | //if (curRegion == null) |
| | | //{ |
| | | // CurReginID = UserInfo.Current.regionList[0].RegionID; |
| | | // return UserInfo.Current.regionList[0]; |
| | | //} |
| | | return curRegion; |
| | | } |
| | | } |
| | | } |
| | | |
| | | ///// <summary> |
| | | ///// 获取网关列表 |
| | | ///// </summary> |
| | | //void GetHomeGatewayList() |
| | | //{ |
| | | // new Thread(() => |
| | | // { |
| | | // //切换住宅后,查询一次网关列表 |
| | | // new HttpServerRequest().GetHomeGatewayList(); |
| | | // }) |
| | | // { IsBackground = true }.Start(); |
| | | |
| | | //} |
| | | |
| | | //string curReginID; |
| | | ///// <summary> |
| | | ///// 当前选择的住宅索引 |
| | | ///// </summary> |
| | | //public string CurReginID |
| | | //{ |
| | | // set |
| | | // { |
| | | // curReginID = value; |
| | | // GetHomeGatewayList(); |
| | | // } |
| | | // get |
| | | // { |
| | | // return curReginID; |
| | | // } |
| | | //} |
| | | /// <summary> |
| | | /// 当前选择的住宅索引 |
| | | /// </summary> |
| | |
| | | } |
| | | |
| | | /// <summary> |
| | | /// 网关详细信息 |
| | | /// </summary> |
| | | public HomeGatewayInfo HomeGateway; |
| | | |
| | | /// <summary> |
| | | /// 检测住宅是否绑定了网关 |
| | | /// </summary> |
| | | /// <returns></returns> |
| | | public bool CheckWhetherGatewayIsBound() |
| | | { |
| | | if (HomeGateway != null && !string.IsNullOrEmpty(HomeGateway.mac)) |
| | | { |
| | | return true; |
| | | } |
| | | else |
| | | { |
| | | return false; |
| | | } |
| | | } |
| | | |
| | | /// <summary> |
| | | /// 当前住宅的网关MAC |
| | | /// </summary> |
| | | public string residenceGatewayMAC |
| | | { |
| | | get |
| | | { |
| | | if (CheckWhetherGatewayIsBound()) |
| | | { |
| | | return HomeGateway.mac.ToUpper(); |
| | | } |
| | | else |
| | | { |
| | | return ""; |
| | | } |
| | | } |
| | | set |
| | | { |
| | | if (CheckWhetherGatewayIsBound()) |
| | | { |
| | | HomeGateway.mac = value; |
| | | } |
| | | else |
| | | { |
| | | HomeGateway = new HomeGatewayInfo() { mac = value }; |
| | | } |
| | | } |
| | | |
| | | } |
| | | |
| | | /// <summary> |
| | | /// 住宅图片 |
| | | /// </summary> |
| | | public string residenceImage; |
| | | /// <summary> |
| | | /// 当前住宅的网关MAC |
| | | /// </summary> |
| | | public string residenceGatewayMAC = "4E47323347591243";//"0281B9078C000000";// "00964E19C4467B1E"; |
| | | //public string residenceGatewayMAC = "4E47323347591243";//"0281B9078C000000";// "00964E19C4467B1E"; |
| | | /// <summary> |
| | | /// 保存住宅数据 |
| | | /// </summary> |
| | |
| | | } else { |
| | | instance = temp; |
| | | } |
| | | } catch { } |
| | | } catch { |
| | | instance = new OnAppConfig() { }; |
| | | } |
| | | } |
| | | return instance; |
| | | } |
| | |
| | | <Compile Include="$(MSBuildThisFileDirectory)UI\UI2\4-PersonalCenter\GetSupport\GetSupportPage.cs" />
|
| | | <Compile Include="$(MSBuildThisFileDirectory)UI\UI2\4-PersonalCenter\RoomListManage\Transfer\TransferConfirmPage.cs" />
|
| | | <Compile Include="$(MSBuildThisFileDirectory)UI\UI0-Public\Widget\ConfirmButton.cs" />
|
| | | <Compile Include="$(MSBuildThisFileDirectory)UI\UI2\4-PersonalCenter\RoomListManage\Transfer\AdminMigrationConfirmPage.cs" />
|
| | | <Compile Include="$(MSBuildThisFileDirectory)UI\UI2\4-PersonalCenter\RoomListManage\Transfer\TransferInputPage.cs" />
|
| | | <Compile Include="$(MSBuildThisFileDirectory)UI\UI2\4-PersonalCenter\RoomListManage\Transfer\AdminMigrationInputPage.cs" />
|
| | | <Compile Include="$(MSBuildThisFileDirectory)UI\UI2\4-PersonalCenter\RoomListManage\Transfer\TransferUserConfirmPage.cs" />
|
| | | <Compile Include="$(MSBuildThisFileDirectory)UI\UI2\1-HomePage\MessageCenterPage.cs" />
|
| | | <Compile Include="$(MSBuildThisFileDirectory)UI\UI0-Public\Widget\MenuButton.cs" />
|
| | | <Compile Include="$(MSBuildThisFileDirectory)UI\UI0-Public\RoomGalleryPage.cs" />
|
| | | </ItemGroup>
|
| | | <ItemGroup>
|
| | | <Folder Include="$(MSBuildThisFileDirectory)UI\" />
|
New file |
| | |
| | | using HDL_ON.UI.CSS;
|
| | | using Shared; |
| | | using System; |
| | | namespace HDL_ON.UI |
| | | { |
| | | /// <summary> |
| | | /// 房间图库界面 |
| | | /// </summary> |
| | | public class RoomGalleryPage : FrameLayout |
| | | { |
| | | FrameLayout bodyView; |
| | | VerticalScrolViewLayout contentView; |
| | | |
| | | string lastPath; |
| | | |
| | | Action<string> backAction; |
| | | |
| | | public RoomGalleryPage(string lastPath, Action<string> action) |
| | | { |
| | | bodyView = this; |
| | | this.lastPath = lastPath; |
| | | backAction = action; |
| | | } |
| | | |
| | | public void LoadPage(bool loadSceneGallery) |
| | | { |
| | | bodyView.BackgroundColor = CSS_Color.MainBackgroundColor; |
| | | new TopViewDiv(bodyView, Language.StringByID(StringId.DefaultGallery)).LoadTopView(); |
| | | |
| | | |
| | | contentView = new VerticalScrolViewLayout() |
| | | { |
| | | Y = Application.GetRealHeight(64), |
| | | Height = Application.GetRealHeight(603), |
| | | }; |
| | | bodyView.AddChidren(contentView); |
| | | |
| | | if(loadSceneGallery) |
| | | { |
| | | LoadSceneGallery(); |
| | | } |
| | | } |
| | | /// <summary> |
| | | /// 加载场景图库 |
| | | /// </summary> |
| | | void LoadSceneGallery() |
| | | { |
| | | contentView.RemoveAll(); |
| | | |
| | | |
| | | FrameLayout roomImageRow = new FrameLayout() |
| | | { |
| | | Height = Application.GetRealWidth(97), |
| | | }; |
| | | for (int i = 0; i < 10; i++) |
| | | { |
| | | string curImagePath = $"Classification/Room/Roombg{i + 1}.png"; |
| | | |
| | | var sceneImageView = new FrameLayout() |
| | | { |
| | | Width = Application.GetRealWidth(172), |
| | | Height = Application.GetRealWidth(97), |
| | | BackgroundImagePath = curImagePath, |
| | | }; |
| | | if (i % 2 == 0) |
| | | { |
| | | roomImageRow = new FrameLayout() |
| | | { |
| | | Height = Application.GetRealWidth(97), |
| | | }; |
| | | contentView.AddChidren(new Button() { Height = Application.GetRealWidth(12) }); |
| | | contentView.AddChidren(roomImageRow); |
| | | sceneImageView.X = Application.GetRealWidth(10); |
| | | roomImageRow.AddChidren(sceneImageView); |
| | | } |
| | | else |
| | | { |
| | | sceneImageView.X = Application.GetRealWidth(194); |
| | | roomImageRow.AddChidren(sceneImageView); |
| | | } |
| | | if (lastPath == curImagePath) |
| | | { |
| | | var btnLastChooseTip = new Button() |
| | | { |
| | | X = Application.GetRealWidth(146), |
| | | Y = Application.GetRealWidth(6), |
| | | Width = Application.GetRealWidth(20), |
| | | Height = Application.GetRealWidth(20), |
| | | UnSelectedImagePath = "Intelligence/Gallery/chooseTipIcon.png", |
| | | }; |
| | | sceneImageView.AddChidren(btnLastChooseTip); |
| | | } |
| | | |
| | | sceneImageView.MouseUpEventHandler = (sender, e) => { |
| | | this.RemoveFromParent(); |
| | | backAction(curImagePath); |
| | | }; |
| | | } |
| | | |
| | | } |
| | | |
| | | |
| | | } |
| | | } |
New file |
| | |
| | | using System; |
| | | using HDL_ON.UI.CSS; |
| | | using Shared; |
| | | |
| | | namespace HDL_ON.UI |
| | | { |
| | | /// <summary> |
| | | /// 信息中心的菜单按钮 |
| | | /// 宽高都是86 |
| | | /// </summary> |
| | | public class MenuButton : FrameLayout |
| | | { |
| | | /// <summary> |
| | | /// |
| | | /// </summary> |
| | | public Button ImageButton; |
| | | /// <summary> |
| | | /// |
| | | /// </summary> |
| | | public Button TextButton; |
| | | /// <summary> |
| | | /// |
| | | /// </summary> |
| | | public Action SelectAction; |
| | | |
| | | /// <summary> |
| | | /// |
| | | /// </summary> |
| | | public MenuButton() |
| | | { |
| | | Height = Application.GetRealWidth(86); |
| | | Width = Application.GetRealWidth(86); |
| | | Show(); |
| | | } |
| | | |
| | | /// <summary> |
| | | /// |
| | | /// </summary> |
| | | void Show() |
| | | { |
| | | ImageButton = new Button() |
| | | { |
| | | Height = Application.GetRealWidth(60), |
| | | Width = Application.GetRealWidth(60), |
| | | Gravity = Gravity.CenterHorizontal |
| | | }; |
| | | this.AddChidren(ImageButton); |
| | | |
| | | TextButton = new Button() |
| | | { |
| | | Y = Application.GetRealWidth(68), |
| | | Height = this.Height - Application.GetRealWidth(68), |
| | | Width = Application.GetRealWidth(86), |
| | | TextColor = CSS_Color.PromptingColor1, |
| | | SelectedTextColor = CSS_Color.FirstLevelTitleColor, |
| | | TextSize = CSS_FontSize.PromptFontSize_FirstLevel, |
| | | TextAlignment = TextAlignment.Center |
| | | }; |
| | | this.AddChidren(TextButton); |
| | | |
| | | |
| | | EventHandler<MouseEventArgs> eventHandler = (sender, e) => |
| | | { |
| | | SelectAction?.Invoke(); |
| | | }; |
| | | |
| | | ImageButton.MouseUpEventHandler = eventHandler; |
| | | TextButton.MouseUpEventHandler = eventHandler; |
| | | this.MouseUpEventHandler = eventHandler; |
| | | } |
| | | |
| | | /// <summary> |
| | | /// |
| | | /// </summary> |
| | | bool isSelected; |
| | | /// <summary> |
| | | /// 选中状态 |
| | | /// </summary> |
| | | /// <value><c>true</c> if this instance is selected; otherwise, <c>false</c>.</value> |
| | | public bool IsSelected |
| | | { |
| | | get |
| | | { |
| | | return isSelected; |
| | | } |
| | | set |
| | | { |
| | | isSelected = value; |
| | | ImageButton.IsSelected = isSelected; |
| | | TextButton.IsSelected = isSelected; |
| | | |
| | | } |
| | | } |
| | | } |
| | | } |
| | |
| | | callbackAction = action; |
| | | bodyView = new FrameLayout() |
| | | { |
| | | BackgroundColor = CSS_Color.BackgroundColor, |
| | | BackgroundColor = CSS_Color.MainBackgroundColor, |
| | | }; |
| | | AddChidren(bodyView); |
| | | |
| | |
| | | { |
| | | bodyView = new FrameLayout() |
| | | { |
| | | BackgroundColor = CSS_Color.BackgroundColor, |
| | | BackgroundColor = CSS_Color.MainBackgroundColor, |
| | | }; |
| | | AddChidren(bodyView); |
| | | |
| | |
| | | /// <summary> |
| | | /// 当前温度信息 |
| | | /// </summary> |
| | | Button btnTempValues; |
| | | TextButton btnTempValues; |
| | | /// <summary> |
| | | /// 当前湿度信息 |
| | | /// </summary> |
| | | Button btnHumidityValues; |
| | | TextButton btnHumidityValues; |
| | | /// <summary> |
| | | /// 当前pm2.5状态 |
| | | /// </summary> |
| | | Button btnPm25Values; |
| | | TextButton btnPm25Values; |
| | | /// <summary> |
| | | /// 切换显示功能类型区域 |
| | | /// </summary> |
| | |
| | | /// 当前显示对控制类型是否是设备功能控制 |
| | | /// </summary> |
| | | bool CurShowTypeIsFunction = true; |
| | | #endregion |
| | | |
| | | #region 报警信息 |
| | | Button btnMsgBg; |
| | | Button btnMsgTime; |
| | | Button btnMsg; |
| | | Button btnMsgIcon; |
| | | #endregion |
| | | |
| | | public HomePage() |
| | |
| | | }; |
| | | environmentalView.AddChidren(btnTempIcon); |
| | | |
| | | btnTempValues = new Button() |
| | | btnTempValues = new TextButton() |
| | | { |
| | | X = btnTempIcon.Right + Application.GetRealWidth(4), |
| | | Width = Application.GetRealWidth(30), |
| | |
| | | }; |
| | | environmentalView.AddChidren(btnHumidityIcon); |
| | | |
| | | btnHumidityValues = new Button() |
| | | btnHumidityValues = new TextButton() |
| | | { |
| | | X = btnHumidityIcon.Right + Application.GetRealWidth(4), |
| | | Width = Application.GetRealWidth(30), |
| | |
| | | }; |
| | | environmentalView.AddChidren(btnPm25Icon); |
| | | |
| | | btnPm25Values = new Button() |
| | | btnPm25Values = new TextButton() |
| | | { |
| | | X = btnPm25Icon.Right + Application.GetRealWidth(4), |
| | | Width = Application.GetRealWidth(130), |
| | |
| | | }; |
| | | topView.AddChidren(msgView); |
| | | |
| | | var btngb = new Button() |
| | | btnMsgBg = new Button() |
| | | { |
| | | BackgroundColor = CSS_Color.MainColor,//0x3F4484F4, |
| | | Alpha = 0.4f, |
| | | }; |
| | | msgView.AddChidren(btngb); |
| | | msgView.AddChidren(btnMsgBg); |
| | | |
| | | Button btnMsgIcon; |
| | | |
| | | btnMsgIcon = new Button() |
| | | { |
| | | X = Application.GetRealWidth(12), |
| | |
| | | }; |
| | | msgView.AddChidren(btnMsgIcon); |
| | | |
| | | Button btnMsg; |
| | | |
| | | btnMsg = new Button() |
| | | { |
| | | X = Application.GetRealWidth(10) + btnMsgIcon.Right, |
| | |
| | | }; |
| | | msgView.AddChidren(btnMsg); |
| | | |
| | | Button btnMsgTime; |
| | | |
| | | btnMsgTime = new Button() |
| | | { |
| | | X = Application.GetRealWidth(299), |
| | |
| | | TextAlignment = TextAlignment.CenterLeft, |
| | | }; |
| | | msgView.AddChidren(btnMsgTime); |
| | | |
| | | LoadEvent_GotoMessageCenterPage(); |
| | | |
| | | #endregion |
| | | |
| | | #endregion |
| | |
| | | }; |
| | | } |
| | | |
| | | /// <summary> |
| | | /// 加载跳转信息中心页面 |
| | | /// </summary> |
| | | void LoadEvent_GotoMessageCenterPage() |
| | | { |
| | | EventHandler<MouseEventArgs> eventHandler = (sender, e) => |
| | | { |
| | | var skipPage = new MessageCenterPage(); |
| | | MainPage.BasePageView.AddChidren(skipPage); |
| | | skipPage.LoadPage(); |
| | | MainPage.BasePageView.PageIndex = MainPage.BasePageView.ChildrenCount - 1; |
| | | }; |
| | | btnMsgBg.MouseUpEventHandler = eventHandler; |
| | | btnMsgTime.MouseUpEventHandler = eventHandler; |
| | | btnMsg.MouseUpEventHandler = eventHandler; |
| | | btnMsgIcon.MouseUpEventHandler = eventHandler; |
| | | } |
| | | |
| | | } |
| | | } |
New file |
| | |
| | | using System; |
| | | using Shared; |
| | | using HDL_ON.UI.CSS; |
| | | using System.Collections.Generic; |
| | | using System.Threading; |
| | | using HDL_ON.DAL.Server; |
| | | |
| | | namespace HDL_ON.UI |
| | | { |
| | | /// <summary> |
| | | /// 信息中心页面 |
| | | /// </summary> |
| | | public class MessageCenterPage : FrameLayout |
| | | { |
| | | FrameLayout bodyView; |
| | | /// <summary> |
| | | /// 当前 |
| | | /// </summary> |
| | | VerticalScrolViewLayout bodyScrolView; |
| | | /// <summary> |
| | | /// 内容为空提示View |
| | | /// </summary> |
| | | EmptyTipView emptyTipView; |
| | | |
| | | /// <summary> |
| | | /// menuView |
| | | /// </summary> |
| | | FrameLayout menuView; |
| | | MenuButton allMenuButton; |
| | | MenuButton shareMenuButton; |
| | | MenuButton alarmMenuButton; |
| | | MenuButton systemMenuButton; |
| | | FrameLayout messageView; |
| | | |
| | | /// <summary> |
| | | /// 显示的消息类型 |
| | | /// 1全部 2分享与功能 3报警类 4系统信息 |
| | | /// </summary> |
| | | int showMesType = 1; |
| | | /// <summary> |
| | | /// 推送消息列表 |
| | | /// </summary> |
| | | List<PushMessageInfo> PushMessageInfoList = new List<PushMessageInfo>(); |
| | | |
| | | |
| | | /// <summary> |
| | | /// |
| | | /// </summary> |
| | | public MessageCenterPage() |
| | | { |
| | | bodyView = this; |
| | | BackgroundColor = CSS_Color.BackgroundColor; |
| | | } |
| | | |
| | | /// <summary> |
| | | /// |
| | | /// </summary> |
| | | public void LoadPage() |
| | | { |
| | | new TopViewDiv(bodyView, Language.StringByID(StringId.MessageCenter)).LoadTopView(); |
| | | |
| | | AddTopMenuView(); |
| | | AddMessageView(); |
| | | MenuButtonSelect(1); |
| | | //TestLoad(); |
| | | GetPushMessageList(); |
| | | } |
| | | |
| | | /// <summary> |
| | | /// 顶部菜单选项 |
| | | /// </summary> |
| | | void AddTopMenuView() |
| | | { |
| | | |
| | | menuView = new FrameLayout() |
| | | { |
| | | Y = Application.GetRealHeight(64), |
| | | Height = Application.GetRealWidth(117), |
| | | BackgroundColor = CSS_Color.MainBackgroundColor, |
| | | }; |
| | | bodyView.AddChidren(menuView); |
| | | |
| | | |
| | | #region 全部按钮 |
| | | allMenuButton = new MenuButton() |
| | | { |
| | | X = Application.GetRealWidth(15), |
| | | Y = Application.GetRealWidth(16), |
| | | }; |
| | | menuView.AddChidren(allMenuButton); |
| | | allMenuButton.ImageButton.SelectedImagePath = "Collection/MesCenter/AllOn.png"; |
| | | allMenuButton.ImageButton.UnSelectedImagePath = "Collection/MesCenter/All.png"; |
| | | allMenuButton.TextButton.TextID = StringId.All; |
| | | Action allAction = () => |
| | | { |
| | | MenuButtonSelect(1); |
| | | }; |
| | | allMenuButton.SelectAction = allAction; |
| | | #endregion |
| | | |
| | | #region 分享与功能 |
| | | shareMenuButton = new MenuButton() |
| | | { |
| | | X = allMenuButton.Right, |
| | | Y = Application.GetRealWidth(16), |
| | | }; |
| | | menuView.AddChidren(shareMenuButton); |
| | | shareMenuButton.ImageButton.SelectedImagePath = "Collection/MesCenter/ShareOn.png"; |
| | | shareMenuButton.ImageButton.UnSelectedImagePath = "Collection/MesCenter/Share.png"; |
| | | shareMenuButton.TextButton.TextID = StringId.SharingAndFunctionality; |
| | | Action shateAction = () => |
| | | { |
| | | MenuButtonSelect(2); |
| | | }; |
| | | shareMenuButton.SelectAction = shateAction; |
| | | #endregion |
| | | |
| | | #region 报警类 |
| | | alarmMenuButton = new MenuButton() |
| | | { |
| | | X = shareMenuButton.Right, |
| | | Y = Application.GetRealWidth(16), |
| | | }; |
| | | menuView.AddChidren(alarmMenuButton); |
| | | alarmMenuButton.ImageButton.SelectedImagePath = "Collection/MesCenter/AlarmOn.png"; |
| | | alarmMenuButton.ImageButton.UnSelectedImagePath = "Collection/MesCenter/Alarm.png"; |
| | | alarmMenuButton.TextButton.TextID = StringId.AlarmType; |
| | | Action alarmAction = () => |
| | | { |
| | | MenuButtonSelect(3); |
| | | }; |
| | | alarmMenuButton.SelectAction = alarmAction; |
| | | #endregion |
| | | |
| | | #region 系统信息 |
| | | systemMenuButton = new MenuButton() |
| | | { |
| | | X = alarmMenuButton.Right, |
| | | Y = Application.GetRealWidth(16), |
| | | }; |
| | | menuView.AddChidren(systemMenuButton); |
| | | systemMenuButton.ImageButton.SelectedImagePath = "Collection/MesCenter/SystemOn.png"; |
| | | systemMenuButton.ImageButton.UnSelectedImagePath = "Collection/MesCenter/System.png"; |
| | | systemMenuButton.TextButton.TextID = StringId.SystemMessage; |
| | | Action systemAction = () => |
| | | { |
| | | MenuButtonSelect(4); |
| | | }; |
| | | systemMenuButton.SelectAction = systemAction; |
| | | #endregion |
| | | |
| | | } |
| | | |
| | | /// <summary> |
| | | /// 中间信息内容 |
| | | /// </summary> |
| | | void AddMessageView() |
| | | { |
| | | int messageViewY = menuView.Bottom + Application.GetRealWidth(8); |
| | | int messageViewHeight = bodyView.Height - messageViewY; |
| | | messageView = new FrameLayout() |
| | | { |
| | | Y = messageViewY, |
| | | Height = messageViewHeight, |
| | | BackgroundColor = CSS_Color.MainBackgroundColor, |
| | | }; |
| | | bodyView.AddChidren(messageView); |
| | | |
| | | bodyScrolView = new VerticalScrolViewLayout() |
| | | { |
| | | Height = messageViewHeight, |
| | | }; |
| | | messageView.AddChidren(bodyScrolView); |
| | | |
| | | } |
| | | |
| | | /// <summary> |
| | | /// |
| | | /// </summary> |
| | | /// <param name="selectId">1全部 2分享与功能 3报警类 4系统信息</param> |
| | | void MenuButtonSelect(int selectId) |
| | | { |
| | | showMesType = selectId; |
| | | |
| | | if (selectId == 1) |
| | | { |
| | | allMenuButton.IsSelected = true; |
| | | shareMenuButton.IsSelected = false; |
| | | alarmMenuButton.IsSelected = false; |
| | | systemMenuButton.IsSelected = false; |
| | | |
| | | } |
| | | else if (selectId == 2) |
| | | { |
| | | allMenuButton.IsSelected = false; |
| | | shareMenuButton.IsSelected = true; |
| | | alarmMenuButton.IsSelected = false; |
| | | systemMenuButton.IsSelected = false; |
| | | |
| | | } |
| | | else if (selectId == 3) |
| | | { |
| | | allMenuButton.IsSelected = false; |
| | | shareMenuButton.IsSelected = false; |
| | | alarmMenuButton.IsSelected = true; |
| | | systemMenuButton.IsSelected = false; |
| | | } |
| | | else if (selectId == 4) |
| | | { |
| | | allMenuButton.IsSelected = false; |
| | | shareMenuButton.IsSelected = false; |
| | | alarmMenuButton.IsSelected = false; |
| | | systemMenuButton.IsSelected = true; |
| | | |
| | | } |
| | | } |
| | | |
| | | |
| | | |
| | | /// <summary> |
| | | /// 添加内容为空提示页面 |
| | | /// </summary> |
| | | void AddEmptyTipView() |
| | | { |
| | | emptyTipView = new EmptyTipView() |
| | | { |
| | | Gravity = Gravity.Center |
| | | }; |
| | | messageView.AddChidren(emptyTipView); |
| | | } |
| | | |
| | | /// <summary> |
| | | /// 加载报警信息RowView |
| | | /// </summary> |
| | | /// <param name="VerticalScrolViewMiddle"></param> |
| | | /// <param name="pushMessageInfo"></param> |
| | | void AddRowView(VerticalScrolViewLayout VerticalScrolViewMiddle, PushMessageInfo pushMessageInfo) |
| | | { |
| | | var rowView = new RowLayout() |
| | | { |
| | | Height = Application.GetRealHeight(65), |
| | | LineColor = CSS_Color.MainBackgroundColor, |
| | | }; |
| | | VerticalScrolViewMiddle.AddChidren(rowView); |
| | | |
| | | //标题 |
| | | var btnTilte = new Button() |
| | | { |
| | | X = Application.GetRealWidth(16), |
| | | Y = Application.GetRealHeight(12), |
| | | Width = Application.GetRealWidth(320), |
| | | Height = Application.GetRealHeight(20), |
| | | TextAlignment = TextAlignment.CenterLeft, |
| | | TextColor = CSS_Color.FirstLevelTitleColor, |
| | | TextSize = CSS_FontSize.TextFontSize, |
| | | Text = pushMessageInfo.messageTitle |
| | | }; |
| | | rowView.AddChidren(btnTilte); |
| | | |
| | | //副标题 |
| | | var btnSubtitle = new Button() |
| | | { |
| | | X = Application.GetRealWidth(16), |
| | | Y = btnTilte.Bottom + Application.GetRealHeight(4), |
| | | Width = Application.GetRealWidth(240), |
| | | Height = Application.GetRealHeight(17), |
| | | TextAlignment = TextAlignment.CenterLeft, |
| | | TextColor = CSS_Color.PromptingColor1, |
| | | TextSize = CSS_FontSize.PromptFontSize_FirstLevel, |
| | | Text = pushMessageInfo.messageContent |
| | | }; |
| | | rowView.AddChidren(btnSubtitle); |
| | | |
| | | //日期 |
| | | var btnDatetime = new Button() |
| | | { |
| | | X = Application.GetRealWidth(259), |
| | | Y = btnTilte.Bottom + Application.GetRealHeight(4), |
| | | Width = Application.GetRealWidth(100), |
| | | Height = Application.GetRealHeight(17), |
| | | TextAlignment = TextAlignment.CenterRight, |
| | | TextColor = CSS_Color.PromptingColor1, |
| | | TextSize = CSS_FontSize.PromptFontSize_FirstLevel, |
| | | Text = pushMessageInfo.createTime |
| | | }; |
| | | rowView.AddChidren(btnDatetime); |
| | | |
| | | var lineView = new LineView(rowView.Height); |
| | | rowView.AddChidren(lineView); |
| | | |
| | | //删除按钮 |
| | | var deleteBtn = new Button() |
| | | { |
| | | TextID = StringId.Del, |
| | | BackgroundColor = CSS_Color.AuxiliaryColor2, |
| | | TextColor = CSS_Color.MainBackgroundColor, |
| | | TextSize = CSS_FontSize.TextFontSize, |
| | | }; |
| | | rowView.AddRightView(deleteBtn); |
| | | deleteBtn.MouseUpEventHandler = (sender, e) => |
| | | { |
| | | rowView.RemoveFromParent(); |
| | | }; |
| | | |
| | | //EventHandler<MouseEventArgs> eventHandler = (sender, e) => |
| | | //{ |
| | | //}; |
| | | |
| | | //btnTilte.MouseUpEventHandler = eventHandler; |
| | | //btnSubtitle.MouseUpEventHandler = eventHandler; |
| | | } |
| | | |
| | | /// <summary> |
| | | /// 加载年份标题 |
| | | /// </summary> |
| | | /// <param name="VerticalScrolViewMiddle"></param> |
| | | /// <param name="yearStr"></param> |
| | | void AddYearRowView(VerticalScrolViewLayout VerticalScrolViewMiddle, string yearStr) |
| | | { |
| | | var bgView = new FrameLayout() |
| | | { |
| | | Height = Application.GetRealHeight(57), |
| | | }; |
| | | VerticalScrolViewMiddle.AddChidren(bgView); |
| | | |
| | | var yearBtn = new Button() |
| | | { |
| | | X = Application.GetRealWidth(16), |
| | | Y = Application.GetRealHeight(16), |
| | | Width = Application.GetRealWidth(320), |
| | | Height = Application.GetRealHeight(33), |
| | | TextAlignment = TextAlignment.CenterLeft, |
| | | TextColor = CSS_Color.FirstLevelTitleColor, |
| | | TextSize = CSS_FontSize.EmphasisFontSize_FirstLevel, |
| | | IsBold = true, |
| | | Text = yearStr |
| | | }; |
| | | bgView.AddChidren(yearBtn); |
| | | } |
| | | |
| | | /// <summary> |
| | | /// |
| | | /// </summary> |
| | | void GetPushMessageList() |
| | | { |
| | | var waitPage = new Loading(); |
| | | waitPage.Start(Language.StringByID(StringId.PleaseWait)); |
| | | bodyScrolView.RemoveAll(); |
| | | PushMessageInfoList.Clear(); |
| | | |
| | | new Thread(() => |
| | | { |
| | | try |
| | | { |
| | | var result = new HttpServerRequest().PushSerivceGetPushmessagelist(); |
| | | if (result.Code == StateCode.SUCCESS) |
| | | { |
| | | PushMessageInfoList = Newtonsoft.Json.JsonConvert.DeserializeObject<List<PushMessageInfo>>(result.Data.ToString()); |
| | | Application.RunOnMainThread(() => |
| | | { |
| | | if (PushMessageInfoList != null && PushMessageInfoList.Count > 0) |
| | | { |
| | | |
| | | ParseAndDisplayPushList(); |
| | | } |
| | | else |
| | | { |
| | | AddEmptyTipView(); |
| | | } |
| | | }); |
| | | } |
| | | else |
| | | { |
| | | Application.RunOnMainThread(() => |
| | | { |
| | | AddEmptyTipView(); |
| | | }); |
| | | IMessageCommon.Current.ShowErrorInfoAlter(result.Code); |
| | | } |
| | | } |
| | | catch (Exception ex) |
| | | { |
| | | } |
| | | finally |
| | | { |
| | | Application.RunOnMainThread(() => |
| | | { |
| | | if (waitPage != null) |
| | | { |
| | | waitPage.RemoveFromParent(); |
| | | waitPage = null; |
| | | } |
| | | }); |
| | | } |
| | | }) |
| | | { IsBackground = true }.Start(); |
| | | } |
| | | |
| | | /// <summary> |
| | | /// 解析和显示推送消息 |
| | | /// </summary> |
| | | void ParseAndDisplayPushList() |
| | | { |
| | | // |
| | | if (showMesType == 1) |
| | | { |
| | | |
| | | } |
| | | } |
| | | |
| | | #region 测试 |
| | | /// <summary> |
| | | /// |
| | | /// </summary> |
| | | void TestLoad() |
| | | { |
| | | PushMessageInfoList.Add(new PushMessageInfo() |
| | | { |
| | | messageTitle = "报警信息", |
| | | messageContent = "门锁被打开", |
| | | createTime = "11月30 10:50", |
| | | }); |
| | | |
| | | PushMessageInfoList.Add(new PushMessageInfo() |
| | | { |
| | | messageTitle = "报警信息1", |
| | | messageContent = "门锁被打开", |
| | | createTime = "11月30 11:50", |
| | | }); |
| | | |
| | | PushMessageInfoList.Add(new PushMessageInfo() |
| | | { |
| | | messageTitle = "报警信息2", |
| | | messageContent = "门锁被打开", |
| | | createTime = "11月30 12:50", |
| | | }); |
| | | |
| | | AddYearRowView(bodyScrolView, "2020年"); |
| | | foreach (var info in PushMessageInfoList) |
| | | { |
| | | AddRowView(bodyScrolView, info); |
| | | } |
| | | |
| | | AddYearRowView(bodyScrolView, "2019年"); |
| | | foreach (var info in PushMessageInfoList) |
| | | { |
| | | AddRowView(bodyScrolView, info); |
| | | } |
| | | } |
| | | #endregion |
| | | } |
| | | |
| | | |
| | | /// <summary> |
| | | /// 推送消息类型 |
| | | /// </summary> |
| | | [System.Serializable] |
| | | public class PushMessageInfo |
| | | { |
| | | /// <summary> |
| | | /// 记录Id |
| | | /// </summary> |
| | | public string id; |
| | | /// <summary> |
| | | /// 是否已读 |
| | | /// </summary> |
| | | public bool isRead; |
| | | /// <summary> |
| | | /// 消息内容 |
| | | /// </summary> |
| | | public string messageContent; |
| | | /// <summary> |
| | | /// 扩展数据 |
| | | /// </summary> |
| | | public string messageExpand; |
| | | /// <summary> |
| | | /// 消息主题 |
| | | /// </summary> |
| | | public string messageTitle; |
| | | /// <summary> |
| | | /// 消息类型;0:提示;1:报警;2:丰林可是对讲呼叫;3:强制下线推送 |
| | | /// </summary> |
| | | public string messageType; |
| | | /// <summary> |
| | | /// 推送Token记录Id |
| | | /// </summary> |
| | | public string pushId; |
| | | /// <summary> |
| | | /// 推送类型;0:默认;1:报警;2:提示;3:新闻;4:推荐; |
| | | /// </summary> |
| | | public string pushType; |
| | | /// <summary> |
| | | /// 推送时间 |
| | | /// </summary> |
| | | public string createTime; |
| | | |
| | | } |
| | | |
| | | } |
| | |
| | | { |
| | | Gravity = Gravity.CenterHorizontal, |
| | | Width = Application.GetRealWidth(343), |
| | | Height = Application.GetRealHeight(184), |
| | | Height = Application.GetRealWidth(192),//2020-12-01 房间图片比例改回16:9 |
| | | Radius = (uint)Application.GetRealWidth(12), |
| | | Tag = room.sid, |
| | | }; |
| | |
| | | var roomViewbg = new ImageView() |
| | | { |
| | | Width = Application.GetRealWidth(343), |
| | | Height = Application.GetRealHeight(184), |
| | | Height = Application.GetRealWidth(192),//2020-12-01 房间图片比例改回16:9 |
| | | ImagePath = room.backgroundImage, |
| | | Radius = (uint)Application.GetRealWidth(12), |
| | | }; |
| | |
| | | |
| | | var btn = new Button() |
| | | { |
| | | Height = Application.GetRealHeight(20), |
| | | Height = Application.GetRealWidth(20), |
| | | }; |
| | | roomListView.AddChidren(btn); |
| | | |
| | |
| | | { |
| | | btnTakePicture.IsSelected = false; |
| | | |
| | | var pid = Guid.NewGuid(); |
| | | //var pid = Guid.NewGuid(); |
| | | //CropImage.TakePicture((imagePath) => |
| | | //{ |
| | | // if (imagePath != null) |
| | | // { |
| | | // addSceneImageView.ImagePath = imagePath.ToString(); |
| | | // scene.ImagePath = addSceneImageView.ImagePath; |
| | | // MainPage.Log("SelectPicture 裁剪图片返回路径: " + imagePath); |
| | | // } |
| | | //}, pid.ToString(), 4, 3); |
| | | |
| | | |
| | | //var imageName = Guid.NewGuid().ToString(); |
| | | var imageName = scene.sid; |
| | | CropImage.TakePicture((imagePath) => |
| | | { |
| | | if (imagePath != null) |
| | | { |
| | | addSceneImageView.ImagePath = imagePath.ToString(); |
| | | scene.ImagePath = addSceneImageView.ImagePath; |
| | | MainPage.Log("SelectPicture 裁剪图片返回路径: " + imagePath); |
| | | } |
| | | }, pid.ToString(), 4, 3); |
| | | if (pageTitleId == StringId.EditScene) |
| | | { |
| | | scene.SaveSceneData(); |
| | | } |
| | | CropImageCallBack(imagePath, imageName); |
| | | }, imageName, 4, 3); |
| | | |
| | | //if (pageTitleId == StringId.EditScene) |
| | | //{ |
| | | // scene.SaveFunctionData(); |
| | | //} |
| | | pictureOptionView.Parent.RemoveFromParent(); |
| | | }; |
| | | btnAlbum.MouseDownEventHandler = (sender, e) => { |
| | |
| | | btnAlbum.MouseUpEventHandler = (sender, e) => |
| | | { |
| | | btnAlbum.IsSelected = false; |
| | | var pid = Guid.NewGuid(); |
| | | //var pid = Guid.NewGuid(); |
| | | //CropImage.SelectPicture((imagePath) => |
| | | //{ |
| | | // if (imagePath != null) |
| | | // { |
| | | // addSceneImageView.ImagePath = imagePath.ToString(); |
| | | // scene.ImagePath = addSceneImageView.ImagePath; |
| | | // MainPage.Log("SelectPicture 裁剪图片返回路径: " + imagePath); |
| | | // } |
| | | //}, pid.ToString(), 4, 3); |
| | | |
| | | //从相册选择图片裁剪 |
| | | //var imageName = Guid.NewGuid().ToString(); |
| | | var imageName = scene.sid; |
| | | CropImage.SelectPicture((imagePath) => |
| | | { |
| | | if (imagePath != null) |
| | | { |
| | | addSceneImageView.ImagePath = imagePath.ToString(); |
| | | scene.ImagePath = addSceneImageView.ImagePath; |
| | | MainPage.Log("SelectPicture 裁剪图片返回路径: " + imagePath); |
| | | } |
| | | }, pid.ToString(), 4, 3); |
| | | if (pageTitleId == StringId.EditScene) |
| | | { |
| | | scene.SaveSceneData(); |
| | | } |
| | | CropImageCallBack(imagePath, imageName); |
| | | }, imageName, 4, 3); |
| | | |
| | | |
| | | //if (pageTitleId == StringId.EditScene) |
| | | //{ |
| | | // scene.SaveFunctionData(); |
| | | //} |
| | | pictureOptionView.Parent.RemoveFromParent(); |
| | | }; |
| | | |
| | |
| | | galleryPage.LoadPage(true); |
| | | MainPage.BasePageView.PageIndex = MainPage.BasePageView.ChildrenCount - 1; |
| | | }; |
| | | |
| | | } |
| | | |
| | | /// <summary> |
| | | /// 裁剪完照片回调,统一处理 |
| | | /// </summary> |
| | | /// <param name="imagePath">裁剪后的真实路径</param> |
| | | /// <param name="imageName">自定义的图片名称</param> |
| | | void CropImageCallBack(string imagePath, string imageName) |
| | | { |
| | | if (string.IsNullOrEmpty(imagePath) == true) |
| | | { |
| | | return; |
| | | } |
| | | |
| | | try |
| | | { |
| | | var mPath = imagePath; |
| | | MainPage.Log("SelectPicture 裁剪图片返回路径: " + imagePath); |
| | | |
| | | #if __IOS__ |
| | | |
| | | |
| | | #else |
| | | //1.使用新名字,解决相同路径不刷新图片问题 |
| | | imageName = Guid.NewGuid().ToString() + ".png"; |
| | | //1.2如果是自定义图片删除之前的 |
| | | if (!addSceneImageView.ImagePath.Contains("Gallery/scenebg")) |
| | | { |
| | | Utlis.WriteLine("删除: " + addSceneImageView.ImagePath); |
| | | System.IO.File.Delete(addSceneImageView.ImagePath); |
| | | } |
| | | //1.3如果是安卓需要拷贝回来APP根目录 |
| | | FileUtils.FileCopyToRootPath(imagePath, imageName); |
| | | System.IO.File.Delete(imagePath); |
| | | MainPage.Log("SelectPicture 最终路径: " + imageName); |
| | | mPath = imageName; |
| | | #endif |
| | | //清空原来图片 |
| | | addSceneImageView.ImagePath = "NULL"; |
| | | addSceneImageView.ImagePath = mPath; |
| | | scene.ImagePath = mPath; |
| | | |
| | | if (pageTitleId == StringId.EditScene) |
| | | { |
| | | scene.SaveFunctionData(); |
| | | } |
| | | } |
| | | catch |
| | | { |
| | | |
| | | } |
| | | |
| | | } |
| | | |
| | |
| | | btnEditSceneNameIcon.MouseUpEventHandler = eventHandler; |
| | | } |
| | | |
| | | |
| | | } |
| | | } |
| | |
| | | versionUpdateView.BtnTilte.TextID = StringId.VersionUpdate; |
| | | Action versionUpdateAction = () => |
| | | { |
| | | //OpenUrl(); |
| | | |
| | | TestDDDDD(); |
| | | OpenUrl(); |
| | | //TestDDDDD(); |
| | | }; |
| | | versionUpdateView.GoAction = versionUpdateAction; |
| | | #endregion |
| | |
| | | public ComplaintsPage() |
| | | { |
| | | bodyView = this; |
| | | BackgroundColor = CSS_Color.MainBackgroundColor; |
| | | } |
| | | |
| | | public void LoadPage() |
| | |
| | | public GetSupportPage() |
| | | { |
| | | bodyView = this; |
| | | BackgroundColor = CSS_Color.MainBackgroundColor; |
| | | } |
| | | |
| | | public void LoadPage() |
| | |
| | | headPortraitView.AddChidren(btnMemberName); |
| | | |
| | | #region RoomList |
| | | FrameLayout contentView = new FrameLayout() |
| | | VerticalScrolViewLayout roomListView = new VerticalScrolViewLayout() |
| | | { |
| | | Y = Application.GetRealHeight(138), |
| | | Height = Application.GetRealHeight(485), |
| | | BackgroundColor = CSS_Color.MainBackgroundColor, |
| | | Height = Application.GetRealHeight(471), |
| | | //BackgroundColor = CSS_Color.MainBackgroundColor, |
| | | }; |
| | | bodyView.AddChidren(contentView); |
| | | bodyView.AddChidren(roomListView); |
| | | |
| | | var titleView = new FrameLayout() |
| | | { |
| | | BackgroundColor = CSS_Color.MainBackgroundColor, |
| | | Height = Application.GetRealWidth(44), |
| | | }; |
| | | contentView.AddChidren(titleView); |
| | | roomListView.AddChidren(titleView); |
| | | |
| | | var btnTitle = new Button() |
| | | { |
| | |
| | | Height = Application.GetRealHeight(1), |
| | | BackgroundColor = CSS_Color.DividingLineColor, |
| | | }; |
| | | contentView.AddChidren(btnLine); |
| | | roomListView.AddChidren(btnLine); |
| | | |
| | | //--------------------------------------------- |
| | | var roomListView = new VerticalScrolViewLayout() |
| | | { |
| | | Y = btnLine.Bottom, |
| | | Height = Application.GetRealHeight(440), |
| | | }; |
| | | contentView.AddChidren(roomListView); |
| | | //var roomListView = new VerticalScrolViewLayout() |
| | | //{ |
| | | // Y = btnLine.Bottom, |
| | | // Height = Application.GetRealHeight(440), |
| | | //}; |
| | | //contentView.AddChidren(roomListView); |
| | | |
| | | //List<Function> funss = new List<Function>(); |
| | | //if (memberInfo.CurResidenceShareDate.Count > 0) |
| | |
| | | } |
| | | } |
| | | |
| | | if (DB_ResidenceData.rooms.Count > 10) |
| | | { |
| | | roomListView.ScrollEnabled = true; |
| | | } |
| | | else |
| | | { |
| | | roomListView.ScrollEnabled = false; |
| | | //if (DB_ResidenceData.rooms.Count > 10) |
| | | //{ |
| | | // roomListView.ScrollEnabled = true; |
| | | //} |
| | | //else |
| | | //{ |
| | | // roomListView.ScrollEnabled = false; |
| | | |
| | | roomListView.AddChidren(new Button() |
| | | { |
| | | Height = Application.GetRealWidth(441), |
| | | BackgroundColor = CSS_Color.BackgroundColor, |
| | | }); |
| | | } |
| | | // roomListView.AddChidren(new Button() |
| | | // { |
| | | // Height = Application.GetRealWidth(441), |
| | | // BackgroundColor = CSS_Color.BackgroundColor, |
| | | // }); |
| | | //} |
| | | #endregion |
| | | |
| | | btnDelMember = new Button() |
| | |
| | | using System; |
| | | using HDL_ON.DAL.Server; |
| | | using HDL_ON.Entity; |
| | | using Shared; |
| | | |
| | |
| | | OnAppConfig.Instance.SaveUserConfig(); |
| | | DB_ResidenceData.InitRoomFunction(); |
| | | DB_ResidenceData.residenceData.SaveResidenceData(); |
| | | //刷新一次住宅网关 |
| | | new HttpServerRequest().GetHomeGatewayList(); |
| | | |
| | | Application.RunOnMainThread(() => |
| | | { |
| | | btnCurResidenceName.Text = DB_ResidenceData.residenceData.residecenInfo.Name; |
| | |
| | | }).Start(); |
| | | #endregion |
| | | |
| | | //2.注销推送 |
| | | new HttpServerRequest().SignOutPush(); |
| | | //3.跳转登录页面 |
| | | UserInfo.Current.LastTime = DateTime.MinValue; |
| | | UserInfo.Current.SaveUserInfo(); |
| | | MainPage.GoLoginPage(UserInfo.Current); |
| | |
| | | btnTakePicture.MouseUpEventHandler = (sender, e) => |
| | | { |
| | | btnTakePicture.IsSelected = false; |
| | | var pid = Guid.NewGuid(); |
| | | CropImage.TakePicture((Action<string>)((imagePath) => |
| | | //var pid = Guid.NewGuid(); |
| | | //CropImage.TakePicture((Action<string>)((imagePath) => |
| | | //{ |
| | | // if (imagePath != null) |
| | | // { |
| | | // UserInfo.Current.headImagePagePath = imagePath.ToString(); |
| | | // userHeadImageView.ImagePath = imagePath.ToString(); |
| | | // updataHeadImage(); |
| | | // new System.Threading.Thread(() => |
| | | // { |
| | | // new DAL.Server.HttpServerRequest().UpdataUserHeadImage(imagePath); |
| | | // }) |
| | | // { IsBackground = true }.Start(); |
| | | // UserInfo.Current.SaveUserInfo(); |
| | | // MainPage.Log("SelectPicture 裁剪图片返回路径: " + imagePath); |
| | | // } |
| | | //}), pid.ToString(), 1, 1); |
| | | |
| | | //拍照裁剪 |
| | | var imageName = "headImage"; |
| | | //var imageName = Guid.NewGuid().ToString(); |
| | | CropImage.TakePicture((imagePath) => |
| | | { |
| | | if (imagePath != null) |
| | | { |
| | | UserInfo.Current.headImagePagePath = imagePath.ToString(); |
| | | userHeadImageView.ImagePath = imagePath.ToString(); |
| | | updataHeadImage(); |
| | | new System.Threading.Thread(() => |
| | | { |
| | | new DAL.Server.HttpServerRequest().UpdataUserHeadImage(imagePath); |
| | | }) |
| | | { IsBackground = true }.Start(); |
| | | UserInfo.Current.SaveUserInfo(); |
| | | MainPage.Log("SelectPicture 裁剪图片返回路径: " + imagePath); |
| | | } |
| | | }), pid.ToString(), 1, 1); |
| | | CropImageCallBack(imagePath, imageName); |
| | | |
| | | }, imageName, 1, 1); |
| | | |
| | | pictureOptionView.RemoveFromParent(); |
| | | baseView.RemoveFromParent(); |
| | | }; |
| | |
| | | btnAlbum.MouseUpEventHandler = (sender, e) => |
| | | { |
| | | btnAlbum.IsSelected = false; |
| | | var pid = Guid.NewGuid(); |
| | | //var pid = Guid.NewGuid(); |
| | | //CropImage.SelectPicture((imagePath) => |
| | | //{ |
| | | // if (imagePath != null) |
| | | // { |
| | | // UserInfo.Current.headImagePagePath = imagePath.ToString(); |
| | | // userHeadImageView.ImagePath = imagePath.ToString(); |
| | | // updataHeadImage(); |
| | | |
| | | // new System.Threading.Thread(() => |
| | | // { |
| | | // new DAL.Server.HttpServerRequest().UpdataUserHeadImage(imagePath); |
| | | // }) |
| | | // { IsBackground = true }.Start(); UserInfo.Current.SaveUserInfo(); |
| | | // MainPage.Log("SelectPicture 裁剪图片返回路径: " + imagePath); |
| | | // } |
| | | //}, pid.ToString(), 1, 1); |
| | | |
| | | //从相册选择图片裁剪 |
| | | //var imageName = Guid.NewGuid().ToString(); |
| | | var imageName = "headImage"; |
| | | CropImage.SelectPicture((imagePath) => |
| | | { |
| | | if (imagePath != null) |
| | | { |
| | | UserInfo.Current.headImagePagePath = imagePath.ToString(); |
| | | userHeadImageView.ImagePath = imagePath.ToString(); |
| | | updataHeadImage(); |
| | | CropImageCallBack(imagePath, imageName); |
| | | }, imageName, 1, 1); |
| | | |
| | | new System.Threading.Thread(() => |
| | | { |
| | | new DAL.Server.HttpServerRequest().UpdataUserHeadImage(imagePath); |
| | | }) |
| | | { IsBackground = true }.Start(); UserInfo.Current.SaveUserInfo(); |
| | | MainPage.Log("SelectPicture 裁剪图片返回路径: " + imagePath); |
| | | } |
| | | }, pid.ToString(), 1, 1); |
| | | pictureOptionView.RemoveFromParent(); |
| | | baseView.RemoveFromParent(); |
| | | }; |
| | | } |
| | | |
| | | /// <summary> |
| | | /// 裁剪完照片回调,统一处理 |
| | | /// </summary> |
| | | /// <param name="imagePath">裁剪后的真实路径</param> |
| | | /// <param name="imageName">自定义的图片名称</param> |
| | | void CropImageCallBack(string imagePath, string imageName) |
| | | { |
| | | if (string.IsNullOrEmpty(imagePath) == true) |
| | | { |
| | | return; |
| | | } |
| | | try |
| | | { |
| | | MainPage.Log("SelectPicture 裁剪图片返回路径: " + imagePath); |
| | | |
| | | var headPath = imagePath; |
| | | #if __IOS__ |
| | | |
| | | |
| | | #else |
| | | //1.使用新名字,解决相同路径不刷新图片问题 |
| | | imageName = Guid.NewGuid().ToString() + ".png"; |
| | | //1.2删除原来本地头像 |
| | | System.IO.File.Delete(userHeadImageView.ImagePath); |
| | | Utlis.WriteLine("删除: " + userHeadImageView.ImagePath); |
| | | //1.3如果是安卓需要拷贝回来APP根目录 |
| | | FileUtils.FileCopyToRootPath(imagePath, imageName); |
| | | System.IO.File.Delete(imagePath); |
| | | headPath = imageName; |
| | | MainPage.Log("SelectPicture 最终路径: " + imageName); |
| | | #endif |
| | | |
| | | //清空原来图片 |
| | | userHeadImageView.ImagePath = "NULL"; |
| | | //生成图片 |
| | | UserInfo.Current.headImagePagePath = headPath; |
| | | userHeadImageView.ImagePath = headPath; |
| | | updataHeadImage(); |
| | | |
| | | new System.Threading.Thread(() => |
| | | { |
| | | new DAL.Server.HttpServerRequest().UpdataUserHeadImage(headPath); |
| | | }) |
| | | { IsBackground = true }.Start(); |
| | | UserInfo.Current.SaveUserInfo(); |
| | | } |
| | | catch { } |
| | | |
| | | } |
| | | |
| | | /// <summary> |
| | | /// 加载修改用户名称事件 |
| | | /// </summary> |
| | | void LoadEvent_EditUserName() |
| | |
| | | /// </summary> |
| | | Button btnCommissioningAuthoritySwitchIcon; |
| | | |
| | | #region 管理员权限迁移 |
| | | FrameLayout administratorPermissionMigrationRow; |
| | | Button btnAdministratorPermissionMigrationTitle; |
| | | Button btnAdministratorPermissionMigrationExplan; |
| | | Button btnAdministratorPermissionMigrationSkinIcon; |
| | | #endregion |
| | | |
| | | #region 过户 |
| | | /// <summary> |
| | | /// |
| | |
| | | |
| | | |
| | | #region 管理员权限迁移 |
| | | FrameLayout administratorPermissionMigrationRow; |
| | | administratorPermissionMigrationRow = new FrameLayout() |
| | | { |
| | | Y = Application.GetRealHeight(8) + roomManagementRow.Bottom, |
| | |
| | | }; |
| | | bodyView.AddChidren(administratorPermissionMigrationRow); |
| | | |
| | | var btnAdministratorPermissionMigrationTitle = new Button() |
| | | btnAdministratorPermissionMigrationTitle = new Button() |
| | | { |
| | | X = Application.GetRealWidth(16), |
| | | Y = Application.GetRealHeight(10), |
| | |
| | | }; |
| | | administratorPermissionMigrationRow.AddChidren(btnAdministratorPermissionMigrationTitle); |
| | | |
| | | var btnAdministratorPermissionMigrationExplan = new Button() |
| | | btnAdministratorPermissionMigrationExplan = new Button() |
| | | { |
| | | X = Application.GetRealWidth(16), |
| | | Y = btnAdministratorPermissionMigrationTitle.Bottom, |
| | |
| | | }; |
| | | administratorPermissionMigrationRow.AddChidren(btnAdministratorPermissionMigrationExplan); |
| | | |
| | | Button btnAdministratorPermissionMigrationSkinIcon; |
| | | |
| | | btnAdministratorPermissionMigrationSkinIcon = new Button() |
| | | { |
| | | X = Application.GetRealWidth(343), |
| | |
| | | LoadEvent_SkipRoomsPage(); |
| | | LoadEvent_EditResidencName(); |
| | | LoadEvent_EditResidencAddress(); |
| | | //LoadEvent_SkipAdminMigrationConfirmPage(); |
| | | //LoadEvent_SkipTransferConfirmPage(); |
| | | } |
| | | |
| | |
| | | } |
| | | |
| | | /// <summary> |
| | | /// 跳转管理员权限迁移页面 |
| | | /// </summary> |
| | | void LoadEvent_SkipAdminMigrationConfirmPage() |
| | | { |
| | | EventHandler<MouseEventArgs> eventHandler = (sender, e) => { |
| | | var skipPage = new AdminMigrationConfirmPage(); |
| | | MainPage.BasePageView.AddChidren(skipPage); |
| | | skipPage.LoadPage(); |
| | | MainPage.BasePageView.PageIndex = MainPage.BasePageView.ChildrenCount - 1; |
| | | }; |
| | | |
| | | administratorPermissionMigrationRow.MouseUpEventHandler = eventHandler; |
| | | btnAdministratorPermissionMigrationTitle.MouseUpEventHandler = eventHandler; |
| | | btnAdministratorPermissionMigrationExplan.MouseUpEventHandler = eventHandler; |
| | | btnAdministratorPermissionMigrationSkinIcon.MouseUpEventHandler = eventHandler; |
| | | } |
| | | |
| | | /// <summary> |
| | | /// 跳转过户页面 |
| | | /// </summary> |
| | | void LoadEvent_SkipTransferConfirmPage() |
| | |
| | | btnTrasferSkinIcon.MouseUpEventHandler = eventHandler; |
| | | btnTransferTitle.MouseUpEventHandler = eventHandler; |
| | | } |
| | | |
| | | |
| | | } |
| | | } |
| | |
| | | roomBgView = new FrameLayout() |
| | | { |
| | | Y = Application.GetRealHeight(64), |
| | | Height = Application.GetRealHeight(224), |
| | | Height = Application.GetRealWidth(232), |
| | | BackgroundColor = CSS_Color.MainBackgroundColor, |
| | | }; |
| | | bodyView.AddChidren(roomBgView); |
| | |
| | | Gravity = Gravity.CenterHorizontal, |
| | | Y = Application.GetRealWidth(20), |
| | | Width = Application.GetRealWidth(343), |
| | | Height = Application.GetRealHeight(184), |
| | | Height = Application.GetRealWidth(192),//2020-12-01 房间图片比例改回16:9 |
| | | //UnSelectedImagePath = room.backgroundImage, |
| | | ImagePath = room.backgroundImage, |
| | | Radius = (uint)Application.GetRealWidth(12), |
| | |
| | | }.Show(bodyView); |
| | | return; |
| | | } |
| | | if(string.IsNullOrEmpty( room.floorName)) |
| | | if (string.IsNullOrEmpty(room.floorName)) |
| | | { |
| | | new Tip() |
| | | { |
| | |
| | | { |
| | | baseView.RemoveFromParent(); |
| | | }; |
| | | btnTakePicture.MouseDownEventHandler = (sender, e) => { |
| | | btnTakePicture.MouseDownEventHandler = (sender, e) => |
| | | { |
| | | btnTakePicture.IsSelected = true; |
| | | }; |
| | | //拍照 |
| | | btnTakePicture.MouseUpEventHandler = (sender, e) => |
| | | { |
| | | btnTakePicture.IsSelected = false; |
| | | var pid = Guid.NewGuid(); |
| | | //var pid = Guid.NewGuid(); |
| | | //CropImage.TakePicture((imagePath) => |
| | | //{ |
| | | // if (imagePath != null) |
| | | // { |
| | | // btnRoomBg.ImagePath = imagePath.ToString(); |
| | | // room.backgroundImage = btnRoomBg.ImagePath; |
| | | // MainPage.Log("SelectPicture 裁剪图片返回路径: " + imagePath); |
| | | // } |
| | | //}, pid.ToString(), 16, 9); |
| | | |
| | | //var imageName = Guid.NewGuid().ToString(); |
| | | var imageName = room.sid; |
| | | CropImage.TakePicture((imagePath) => |
| | | { |
| | | if (imagePath != null) |
| | | { |
| | | btnRoomBg.ImagePath = imagePath.ToString(); |
| | | room.backgroundImage = btnRoomBg.ImagePath; |
| | | MainPage.Log("SelectPicture 裁剪图片返回路径: " + imagePath); |
| | | } |
| | | }, pid.ToString(), 16, 9); |
| | | if (pageTitleId == StringId.EditRoomInfo) |
| | | { |
| | | room.SaveRoomData(); |
| | | } |
| | | CropImageCallBack(imagePath, imageName); |
| | | |
| | | }, imageName, 16, 9); |
| | | |
| | | baseView.RemoveFromParent(); |
| | | }; |
| | | btnAlbum.MouseDownEventHandler = (sender, e) => { |
| | | //选择照片 |
| | | btnAlbum.MouseDownEventHandler = (sender, e) => |
| | | { |
| | | btnAlbum.IsSelected = true; |
| | | }; |
| | | |
| | | btnAlbum.MouseUpEventHandler = (sender, e) => |
| | | { |
| | | btnAlbum.IsSelected = false; |
| | | var pid = Guid.NewGuid(); |
| | | //var pid = Guid.NewGuid(); |
| | | //CropImage.SelectPicture((imagePath) => |
| | | //{ |
| | | // if (imagePath != null) |
| | | // { |
| | | // btnRoomBg.ImagePath = imagePath.ToString(); |
| | | // room.backgroundImage = btnRoomBg.ImagePath; |
| | | // MainPage.Log("SelectPicture 裁剪图片返回路径: " + imagePath); |
| | | // } |
| | | //}, pid.ToString(), 16, 9); |
| | | |
| | | //从相册选择图片裁剪 |
| | | //var imageName = Guid.NewGuid().ToString(); |
| | | var imageName = room.sid; |
| | | CropImage.SelectPicture((imagePath) => |
| | | { |
| | | if (imagePath != null) |
| | | CropImageCallBack(imagePath, imageName); |
| | | |
| | | }, imageName, 16, 9); |
| | | |
| | | baseView.RemoveFromParent(); |
| | | |
| | | }; |
| | | |
| | | //房间默认图库 |
| | | btnDefaultGallery.MouseUpEventHandler = (sender, e) => { |
| | | pictureOptionView.Parent.RemoveFromParent(); |
| | | Action<string> action = (obj) => { |
| | | room.backgroundImage = obj; |
| | | btnRoomBg.ImagePath = room.backgroundImage; |
| | | if (pageTitleId == StringId.EditRoomInfo) |
| | | { |
| | | btnRoomBg.ImagePath = imagePath.ToString(); |
| | | room.backgroundImage = btnRoomBg.ImagePath; |
| | | MainPage.Log("SelectPicture 裁剪图片返回路径: " + imagePath); |
| | | room.SaveRoomData(); |
| | | } |
| | | }, pid.ToString(), 16, 9); |
| | | }; |
| | | |
| | | var galleryPage = new RoomGalleryPage(room.backgroundImage, action); |
| | | MainPage.BasePageView.AddChidren(galleryPage); |
| | | galleryPage.LoadPage(true); |
| | | MainPage.BasePageView.PageIndex = MainPage.BasePageView.ChildrenCount - 1; |
| | | |
| | | }; |
| | | } |
| | | |
| | | /// <summary> |
| | | /// 裁剪完照片回调,统一处理 |
| | | /// </summary> |
| | | /// <param name="imagePath">裁剪后的真实路径</param> |
| | | /// <param name="imageName">自定义的图片名称</param> |
| | | void CropImageCallBack(string imagePath, string imageName) |
| | | { |
| | | if (string.IsNullOrEmpty(imagePath) == true) |
| | | { |
| | | return; |
| | | } |
| | | try |
| | | { |
| | | var mPath = imagePath; |
| | | MainPage.Log("SelectPicture 裁剪图片返回路径: " + imagePath); |
| | | #if __IOS__ |
| | | |
| | | |
| | | #else |
| | | //imageName = imageName + ".png"; |
| | | |
| | | //1.使用新名字,解决相同路径不刷新图片问题 |
| | | imageName = Guid.NewGuid().ToString() + ".png"; |
| | | //1.2如果是自定义图片删除之前的 |
| | | if (!btnRoomBg.ImagePath.Contains("Room")) { |
| | | Utlis.WriteLine("删除: " + btnRoomBg.ImagePath); |
| | | System.IO.File.Delete(btnRoomBg.ImagePath); |
| | | } |
| | | //1.3如果是安卓需要拷贝回来APP根目录 |
| | | FileUtils.FileCopyToRootPath(imagePath, imageName); |
| | | System.IO.File.Delete(imagePath); |
| | | mPath = imageName; |
| | | #endif |
| | | //清空原来图片 |
| | | btnRoomBg.ImagePath = "NULL"; |
| | | //生成图片 |
| | | room.backgroundImage = mPath; |
| | | btnRoomBg.ImagePath = mPath; |
| | | |
| | | if (pageTitleId == StringId.EditRoomInfo) |
| | | { |
| | | room.SaveRoomData(); |
| | | } |
| | | baseView.RemoveFromParent(); |
| | | }; |
| | | } |
| | | catch { } |
| | | } |
| | | } |
| | | } |
| | |
| | | /// </summary> |
| | | void LoadRoomRow(Room room) |
| | | { |
| | | roomsListView.AddChidren(new Button() |
| | | { |
| | | Height = Application.GetRealHeight(8), |
| | | Tag = room.name+"line", |
| | | }); |
| | | |
| | | var roomRow = new FrameLayout() |
| | | { |
| | | Gravity = Gravity.CenterHorizontal, |
| | | Tag = room.name + "row", |
| | | Width = Application.GetRealWidth(343), |
| | | Height = Application.GetRealHeight(92), |
| | | Radius = (uint)Application.GetRealWidth(12), |
| | | Height = Application.GetRealHeight(100), |
| | | }; |
| | | roomsListView.AddChidren(roomRow); |
| | | |
| | | var btnBg = new Button() |
| | | var btnBg = new ImageView() |
| | | { |
| | | Y = Application.GetRealHeight(0 - (192 - 92) / 2), |
| | | Height = Application.GetRealHeight(192), |
| | | UnSelectedImagePath = room.backgroundImage, |
| | | Y = Application.GetRealHeight(10), |
| | | Height = Application.GetRealHeight(90), |
| | | Width = Application.GetRealWidth(343), |
| | | ImagePath = room.backgroundImage, |
| | | Radius = (uint)Application.GetRealWidth(12), |
| | | Gravity = Gravity.CenterHorizontal, |
| | | }; |
| | | roomRow.AddChidren(btnBg); |
| | | |
| | | //ImageView imageView = new ImageView() |
| | | //{ |
| | | // Height = Application.GetRealHeight(92), |
| | | // Radius = (uint)Application.GetRealWidth(12), |
| | | //}; |
| | | //roomRow.AddChidren(imageView); |
| | | |
| | | var btnShadow = new Button() |
| | | { |
| | | BackgroundColor = 0x19333333, |
| | | }; |
| | | roomRow.AddChidren(btnShadow); |
| | | |
| | | var btnRoomName = new Button() |
| | | { |
| | | X = Application.GetRealWidth(12), |
| | | Y = Application.GetRealHeight(10), |
| | | X = Application.GetRealWidth(28), |
| | | Y = Application.GetRealHeight(21), |
| | | Width = Application.GetRealWidth(266), |
| | | Height = Application.GetRealHeight(26), |
| | | TextAlignment = TextAlignment.CenterLeft, |
| | | Height = Application.GetRealHeight(22), |
| | | TextAlignment = TextAlignment.TopLeft, |
| | | TextColor = CSS_Color.MainBackgroundColor, |
| | | TextSize = CSS_FontSize.SubheadingFontSize, |
| | | Text = room.floorName + room.name, |
| | | }; |
| | | roomRow.AddChidren(btnRoomName); |
| | | |
| | | btnShadow.MouseUpEventHandler += (sender, e) => |
| | | { |
| | | EventHandler<MouseEventArgs> eventHandler = (sender, e) => { |
| | | LoadEvent_SkipEditRoomPage(room, btnRoomName, btnBg); |
| | | }; |
| | | btnBg.MouseUpEventHandler = eventHandler; |
| | | roomRow.MouseUpEventHandler = eventHandler; |
| | | btnRoomName.MouseUpEventHandler = eventHandler; |
| | | } |
| | | |
| | | } |
| | |
| | | /// <summary> |
| | | /// 跳转到编辑房间的界面 |
| | | /// </summary> |
| | | void LoadEvent_SkipEditRoomPage(Room r,Button btnRoomName,Button btnBg) |
| | | void LoadEvent_SkipEditRoomPage(Room r, Button btnRoomName, ImageView btnBg) |
| | | { |
| | | editBackAction = () => |
| | | { |
| | |
| | | else |
| | | { |
| | | btnRoomName.Text = r.floorName + r.name; |
| | | btnBg.UnSelectedImagePath = r.backgroundImage; |
| | | btnBg.ImagePath = r.backgroundImage; |
| | | } |
| | | }; |
| | | var skipPage = new RoomEditPage(r, StringId.EditRoomInfo,editBackAction); |
New file |
| | |
| | | using System; |
| | | using Shared; |
| | | using HDL_ON.UI.CSS; |
| | | |
| | | namespace HDL_ON.UI |
| | | { |
| | | /// <summary> |
| | | /// 管理员权限迁移确认提醒界面 |
| | | /// </summary> |
| | | public class AdminMigrationConfirmPage : FrameLayout |
| | | { |
| | | /// <summary> |
| | | /// |
| | | /// </summary> |
| | | FrameLayout bodyView; |
| | | |
| | | public AdminMigrationConfirmPage() |
| | | { |
| | | bodyView = this; |
| | | } |
| | | |
| | | /// <summary> |
| | | /// |
| | | /// </summary> |
| | | public void LoadPage() |
| | | { |
| | | BackgroundColor = CSS_Color.MainBackgroundColor; |
| | | |
| | | new TopViewDiv(bodyView, Language.StringByID(StringId.AdministratorPermissionMigration)).LoadTopView(); |
| | | |
| | | #region 头像 |
| | | FrameLayout headView = new FrameLayout() |
| | | { |
| | | Y = Application.GetRealHeight(72), |
| | | Height = Application.GetRealHeight(132), |
| | | }; |
| | | bodyView.AddChidren(headView); |
| | | |
| | | |
| | | ImageView myHeadImage = new ImageView() |
| | | { |
| | | X = Application.GetRealWidth(48), |
| | | Y = Application.GetRealHeight(96), |
| | | Width = Application.GetRealWidth(84), |
| | | Height = Application.GetRealWidth(84), |
| | | Radius = (uint)Application.GetRealWidth(42), |
| | | ImagePath = UserInfo.Current.headImagePagePath, |
| | | Gravity = Gravity.CenterVertical, |
| | | }; |
| | | headView.AddChidren(myHeadImage); |
| | | |
| | | ImageView transferImage = new ImageView() |
| | | { |
| | | X = Application.GetRealWidth(144), |
| | | Y = Application.GetRealHeight(96), |
| | | Width = Application.GetRealWidth(84), |
| | | Height = Application.GetRealWidth(32), |
| | | ImagePath = "PersonalCenter/Transfer.png", |
| | | Gravity = Gravity.Center, |
| | | }; |
| | | headView.AddChidren(transferImage); |
| | | |
| | | ImageView otherHeadImage = new ImageView() |
| | | { |
| | | X = Application.GetRealWidth(231), |
| | | Y = Application.GetRealHeight(96), |
| | | Width = Application.GetRealWidth(101), |
| | | Height = Application.GetRealWidth(101), |
| | | ImagePath = "PersonalCenter/Head.png", |
| | | Gravity = Gravity.CenterVertical, |
| | | }; |
| | | headView.AddChidren(otherHeadImage); |
| | | |
| | | #endregion |
| | | |
| | | var btnTip = new Button() |
| | | { |
| | | Y = headView.Bottom, |
| | | X = Application.GetRealWidth(16), |
| | | Width = Application.GetRealWidth(343), |
| | | Height = Application.GetRealHeight(22), |
| | | TextAlignment = TextAlignment.Center, |
| | | TextColor = CSS_Color.FirstLevelTitleColor, |
| | | TextSize = CSS_FontSize.SubheadingFontSize, |
| | | Text = "您将转移您的管理员权限给其他HDL账号", |
| | | }; |
| | | bodyView.AddChidren(btnTip); |
| | | |
| | | |
| | | //请注意 |
| | | var btnPleaseNote = new Button() |
| | | { |
| | | Y = btnTip.Bottom + Application.GetRealHeight(38), |
| | | X = Application.GetRealWidth(16), |
| | | Width = Application.GetRealWidth(343), |
| | | Height = Application.GetRealHeight(17), |
| | | TextAlignment = TextAlignment.CenterLeft, |
| | | TextColor = CSS_Color.FirstLevelTitleColor, |
| | | TextSize = CSS_FontSize.PromptFontSize_FirstLevel, |
| | | Text = "请注意:", |
| | | }; |
| | | bodyView.AddChidren(btnPleaseNote); |
| | | |
| | | //请注意的内容 |
| | | var btnPleaseNoteStr = new Button() |
| | | { |
| | | Y = btnPleaseNote.Bottom + Application.GetRealHeight(8), |
| | | X = Application.GetRealWidth(16), |
| | | Width = Application.GetRealWidth(343), |
| | | Height = Application.GetRealHeight(170), |
| | | TextAlignment = TextAlignment.TopLeft, |
| | | TextColor = CSS_Color.TextualColor, |
| | | TextSize = CSS_FontSize.PromptFontSize_FirstLevel, |
| | | IsMoreLines = true, |
| | | Text = "1.该住宅您的管理员数据(云端数据)将全部转移给新的管理员 \n\n2.新的管理员可以选择不保留原有住宅成员的数据,其他成员将会不能使用 \n\n3.在转移后,您若需要成为家庭成员,由新的管理员设置 \n\n4.接收方账号为有效的HDL账号 \n\n5.接收方账号与转移方账号不可为同一个账号 (绑定的其他登录)", |
| | | }; |
| | | bodyView.AddChidren(btnPleaseNoteStr); |
| | | |
| | | // |
| | | var btnConfirm = new ConfirmButton() |
| | | { |
| | | Y = Application.GetRealHeight(583), |
| | | Text = "确认转移", |
| | | }; |
| | | bodyView.AddChidren(btnConfirm); |
| | | |
| | | btnConfirm.MouseUpEventHandler = (sender, e) => { |
| | | //Utlis.ShowTip("暂不支持"); |
| | | var skipPage = new AdminMigrationInputPage(); |
| | | MainPage.BasePageView.AddChidren(skipPage); |
| | | skipPage.LoadPage(); |
| | | MainPage.BasePageView.PageIndex = MainPage.BasePageView.ChildrenCount - 1; |
| | | }; |
| | | |
| | | |
| | | } |
| | | |
| | | } |
| | | |
| | | } |
New file |
| | |
| | | using System; |
| | | using Shared; |
| | | using HDL_ON.UI.CSS; |
| | | |
| | | namespace HDL_ON.UI |
| | | { |
| | | /// <summary> |
| | | /// 管理员转移输入账号界面 |
| | | /// </summary> |
| | | public class AdminMigrationInputPage : FrameLayout |
| | | { |
| | | /// <summary> |
| | | /// |
| | | /// </summary> |
| | | FrameLayout bodyView; |
| | | |
| | | public AdminMigrationInputPage() |
| | | { |
| | | bodyView = this; |
| | | } |
| | | |
| | | /// <summary> |
| | | /// |
| | | /// </summary> |
| | | public void LoadPage() |
| | | { |
| | | BackgroundColor = CSS_Color.BackgroundColor; |
| | | |
| | | new TopViewDiv(bodyView, Language.StringByID(StringId.AdministratorPermissionMigration)).LoadTopView(); |
| | | |
| | | #region 账号填写 |
| | | var accountView = new FrameLayout() |
| | | { |
| | | Y = Application.GetRealHeight(72), |
| | | Height = Application.GetRealHeight(50), |
| | | BackgroundColor = CSS_Color.MainBackgroundColor |
| | | }; |
| | | bodyView.AddChidren(accountView); |
| | | |
| | | var btnAccountIcon = new Button() |
| | | { |
| | | X = Application.GetRealWidth(16), |
| | | Gravity = Gravity.CenterVertical, |
| | | Width = Application.GetMinRealAverage(24), |
| | | Height = Application.GetMinRealAverage(24), |
| | | UnSelectedImagePath = "LoginIcon/AccountIcon.png", |
| | | }; |
| | | accountView.AddChidren(btnAccountIcon); |
| | | |
| | | var etAccount = new EditText() |
| | | { |
| | | X = Application.GetRealWidth(52), |
| | | Width = Application.GetRealWidth(307), |
| | | TextAlignment = TextAlignment.CenterLeft, |
| | | TextColor = CSS_Color.FirstLevelTitleColor, |
| | | TextSize = CSS_FontSize.TextFontSize, |
| | | PlaceholderTextColor = CSS_Color.PromptingColor1, |
| | | PlaceholderText = "请输入接收方账号", |
| | | }; |
| | | accountView.AddChidren(etAccount); |
| | | |
| | | var btnLine = new Button() |
| | | { |
| | | BackgroundColor = CSS_Color.DividingLineColor, |
| | | Height = Application.GetRealHeight(1), |
| | | Y = accountView.Height - Application.GetRealHeight(1), |
| | | X = Application.GetRealWidth(16), |
| | | Width = Application.GetRealWidth(343), |
| | | }; |
| | | accountView.AddChidren(btnLine); |
| | | #endregion |
| | | |
| | | #region 账号填写 |
| | | var accountConfirmView = new FrameLayout() |
| | | { |
| | | Y = accountView.Bottom, |
| | | Height = Application.GetRealHeight(50), |
| | | BackgroundColor = CSS_Color.MainBackgroundColor |
| | | }; |
| | | bodyView.AddChidren(accountConfirmView); |
| | | |
| | | var btnAccountConfirmIcon = new Button() |
| | | { |
| | | X = Application.GetRealWidth(16), |
| | | Gravity = Gravity.CenterVertical, |
| | | Width = Application.GetMinRealAverage(24), |
| | | Height = Application.GetMinRealAverage(24), |
| | | UnSelectedImagePath = "LoginIcon/AccountIcon.png", |
| | | }; |
| | | accountConfirmView.AddChidren(btnAccountConfirmIcon); |
| | | |
| | | var etAccountConfirm = new EditText() |
| | | { |
| | | X = Application.GetRealWidth(52), |
| | | Width = Application.GetRealWidth(307), |
| | | TextAlignment = TextAlignment.CenterLeft, |
| | | TextColor = CSS_Color.FirstLevelTitleColor, |
| | | TextSize = CSS_FontSize.TextFontSize, |
| | | PlaceholderTextColor = CSS_Color.PromptingColor1, |
| | | PlaceholderText = "请再次输入接收方账号", |
| | | }; |
| | | accountConfirmView.AddChidren(etAccountConfirm); |
| | | |
| | | //var btnLine2 = new Button() |
| | | //{ |
| | | // BackgroundColor = CSS_Color.DividingLineColor, |
| | | // Height = Application.GetRealHeight(1), |
| | | // Y = accountConfirmView.Height - Application.GetRealHeight(1), |
| | | //}; |
| | | //accountConfirmView.AddChidren(btnLine2); |
| | | #endregion |
| | | |
| | | var btnTip = new Button() |
| | | { |
| | | Y = accountConfirmView.Bottom + Application.GetRealHeight(12), |
| | | X = Application.GetRealWidth(16), |
| | | Width = Application.GetRealWidth(343), |
| | | TextAlignment = TextAlignment.TopLeft, |
| | | TextColor = CSS_Color.AuxiliaryColor2, |
| | | TextSize = CSS_FontSize.PromptFontSize_FirstLevel, |
| | | Text = "*请确认账号无误,在数据转移过程中不可取消操作", |
| | | IsMoreLines = true |
| | | |
| | | }; |
| | | bodyView.AddChidren(btnTip); |
| | | |
| | | var btnConfirm = new ConfirmButton() |
| | | { |
| | | Y = Application.GetRealHeight(251), |
| | | Text = "转移", |
| | | }; |
| | | bodyView.AddChidren(btnConfirm); |
| | | |
| | | Button btnEmailOption = new Button() |
| | | { |
| | | Y = btnConfirm.Bottom + Application.GetRealWidth(6), |
| | | Width = Application.GetRealWidth(220), |
| | | Height = Application.GetRealWidth(32), |
| | | TextSize = CSS_FontSize.TextFontSize, |
| | | TextColor = CSS_Color.MainColor, |
| | | Gravity = Gravity.CenterHorizontal, |
| | | TextAlignment = TextAlignment.Center, |
| | | Text = "扫描二维码迁移" |
| | | }; |
| | | bodyView.AddChidren(btnEmailOption); |
| | | } |
| | | |
| | | } |
| | | |
| | | } |
| | |
| | | }; |
| | | bodyView.AddChidren(btnTip); |
| | | |
| | | |
| | | //请注意 |
| | | var btnPleaseNote = new Button() |
| | | { |
| | | Y = btnTip.Bottom + Application.GetRealHeight(38), |
| | | X = Application.GetRealWidth(16), |
| | | Width = Application.GetRealWidth(343), |
| | | Height = Application.GetRealHeight(17), |
| | | TextAlignment = TextAlignment.CenterLeft, |
| | | TextColor = CSS_Color.FirstLevelTitleColor, |
| | | TextSize = CSS_FontSize.PromptFontSize_FirstLevel, |
| | | Text = "请注意:", |
| | | }; |
| | | bodyView.AddChidren(btnPleaseNote); |
| | | |
| | | //请注意的内容 |
| | | var btnPleaseNoteStr = new Button() |
| | | { |
| | | Y = btnPleaseNote.Bottom + Application.GetRealHeight(8), |
| | | X = Application.GetRealWidth(16), |
| | | Width = Application.GetRealWidth(343), |
| | | Height = Application.GetRealHeight(170), |
| | | TextAlignment = TextAlignment.TopLeft, |
| | | TextColor = CSS_Color.TextualColor, |
| | | TextSize = CSS_FontSize.PromptFontSize_FirstLevel, |
| | | IsMoreLines = true, |
| | | Text = "1.该住宅您的数据(云端数据)将全部转移给新的户主 \n\n2.过户后,原有的成员将自动解绑该住宅 \n\n3.新户主账号为有效的HDL账号 \n\n4.接收方账号与转移方账号不可为同一个账号 (绑定的其他登录)", |
| | | }; |
| | | bodyView.AddChidren(btnPleaseNoteStr); |
| | | |
| | | // |
| | | var btnConfirm = new ConfirmButton() |
| | | { |
| | |
| | | }; |
| | | bodyView.AddChidren(btnConfirm); |
| | | |
| | | btnConfirm.MouseUpEventHandler = (sender, e) => { |
| | | //Utlis.ShowTip("暂不支持"); |
| | | |
| | | var skipPage = new TransferInputPage(); |
| | | MainPage.BasePageView.AddChidren(skipPage); |
| | | skipPage.LoadPage(); |
| | | MainPage.BasePageView.PageIndex = MainPage.BasePageView.ChildrenCount - 1; |
| | | |
| | | }; |
| | | |
| | | } |
| | | |
| | | } |
New file |
| | |
| | | using System; |
| | | using Shared; |
| | | using HDL_ON.UI.CSS; |
| | | |
| | | namespace HDL_ON.UI |
| | | { |
| | | /// <summary> |
| | | /// 过户输入账号界面 |
| | | /// </summary> |
| | | public class TransferInputPage : FrameLayout |
| | | { |
| | | /// <summary> |
| | | /// |
| | | /// </summary> |
| | | FrameLayout bodyView; |
| | | |
| | | public TransferInputPage() |
| | | { |
| | | bodyView = this; |
| | | } |
| | | |
| | | /// <summary> |
| | | /// |
| | | /// </summary> |
| | | public void LoadPage() |
| | | { |
| | | BackgroundColor = CSS_Color.BackgroundColor; |
| | | |
| | | new TopViewDiv(bodyView, Language.StringByID(StringId.Transfer)).LoadTopView(); |
| | | |
| | | #region 账号填写 |
| | | var accountView = new FrameLayout() |
| | | { |
| | | Y = Application.GetRealHeight(72), |
| | | Height = Application.GetRealHeight(50), |
| | | BackgroundColor = CSS_Color.MainBackgroundColor |
| | | }; |
| | | bodyView.AddChidren(accountView); |
| | | |
| | | var btnAccountIcon = new Button() |
| | | { |
| | | X = Application.GetRealWidth(16), |
| | | Gravity = Gravity.CenterVertical, |
| | | Width = Application.GetMinRealAverage(24), |
| | | Height = Application.GetMinRealAverage(24), |
| | | UnSelectedImagePath = "LoginIcon/AccountIcon.png", |
| | | }; |
| | | accountView.AddChidren(btnAccountIcon); |
| | | |
| | | var etAccount = new EditText() |
| | | { |
| | | X = Application.GetRealWidth(52), |
| | | Width = Application.GetRealWidth(307), |
| | | TextAlignment = TextAlignment.CenterLeft, |
| | | TextColor = CSS_Color.FirstLevelTitleColor, |
| | | TextSize = CSS_FontSize.TextFontSize, |
| | | PlaceholderTextColor = CSS_Color.PromptingColor1, |
| | | PlaceholderText = "请输入接收方账号", |
| | | }; |
| | | accountView.AddChidren(etAccount); |
| | | |
| | | var btnLine = new Button() |
| | | { |
| | | BackgroundColor = CSS_Color.DividingLineColor, |
| | | Height = Application.GetRealHeight(1), |
| | | Y = accountView.Height - Application.GetRealHeight(1), |
| | | X = Application.GetRealWidth(16), |
| | | Width = Application.GetRealWidth(343), |
| | | }; |
| | | accountView.AddChidren(btnLine); |
| | | #endregion |
| | | |
| | | #region 账号填写 |
| | | var accountConfirmView = new FrameLayout() |
| | | { |
| | | Y = accountView.Bottom, |
| | | Height = Application.GetRealHeight(50), |
| | | BackgroundColor = CSS_Color.MainBackgroundColor |
| | | }; |
| | | bodyView.AddChidren(accountConfirmView); |
| | | |
| | | var btnAccountConfirmIcon = new Button() |
| | | { |
| | | X = Application.GetRealWidth(16), |
| | | Gravity = Gravity.CenterVertical, |
| | | Width = Application.GetMinRealAverage(24), |
| | | Height = Application.GetMinRealAverage(24), |
| | | UnSelectedImagePath = "LoginIcon/AccountIcon.png", |
| | | }; |
| | | accountConfirmView.AddChidren(btnAccountConfirmIcon); |
| | | |
| | | var etAccountConfirm = new EditText() |
| | | { |
| | | X = Application.GetRealWidth(52), |
| | | Width = Application.GetRealWidth(307), |
| | | TextAlignment = TextAlignment.CenterLeft, |
| | | TextColor = CSS_Color.FirstLevelTitleColor, |
| | | TextSize = CSS_FontSize.TextFontSize, |
| | | PlaceholderTextColor = CSS_Color.PromptingColor1, |
| | | PlaceholderText = "请再次输入接收方账号", |
| | | }; |
| | | accountConfirmView.AddChidren(etAccountConfirm); |
| | | |
| | | //var btnLine2 = new Button() |
| | | //{ |
| | | // BackgroundColor = CSS_Color.DividingLineColor, |
| | | // Height = Application.GetRealHeight(1), |
| | | // Y = accountConfirmView.Height - Application.GetRealHeight(1), |
| | | //}; |
| | | //accountConfirmView.AddChidren(btnLine2); |
| | | #endregion |
| | | |
| | | var btnTip = new Button() |
| | | { |
| | | Y = accountConfirmView.Bottom + Application.GetRealHeight(12), |
| | | X = Application.GetRealWidth(16), |
| | | Width = Application.GetRealWidth(343), |
| | | TextAlignment = TextAlignment.TopLeft, |
| | | TextColor = CSS_Color.AuxiliaryColor2, |
| | | TextSize = CSS_FontSize.PromptFontSize_FirstLevel, |
| | | Text = "*请确认账号无误,在数据转移过程中不可取消操作", |
| | | IsMoreLines = true |
| | | |
| | | }; |
| | | bodyView.AddChidren(btnTip); |
| | | |
| | | var btnConfirm = new ConfirmButton() |
| | | { |
| | | Y = Application.GetRealHeight(251), |
| | | Text = "过户", |
| | | }; |
| | | bodyView.AddChidren(btnConfirm); |
| | | |
| | | btnConfirm.MouseUpEventHandler = (sender, e) => { |
| | | var skipPage = new TransferUserConfirmPage(); |
| | | MainPage.BasePageView.AddChidren(skipPage); |
| | | skipPage.LoadPage(); |
| | | MainPage.BasePageView.PageIndex = MainPage.BasePageView.ChildrenCount - 1; |
| | | }; |
| | | |
| | | Button btnEmailOption = new Button() |
| | | { |
| | | Y = btnConfirm.Bottom + Application.GetRealWidth(6), |
| | | Width = Application.GetRealWidth(220), |
| | | Height = Application.GetRealWidth(32), |
| | | TextSize = CSS_FontSize.TextFontSize, |
| | | TextColor = CSS_Color.MainColor, |
| | | Gravity = Gravity.CenterHorizontal, |
| | | TextAlignment = TextAlignment.Center, |
| | | Text = "扫描二维码过户" |
| | | }; |
| | | bodyView.AddChidren(btnEmailOption); |
| | | |
| | | |
| | | } |
| | | |
| | | } |
| | | |
| | | } |
New file |
| | |
| | | using System; |
| | | using Shared; |
| | | using HDL_ON.UI.CSS; |
| | | |
| | | namespace HDL_ON.UI |
| | | { |
| | | /// <summary> |
| | | /// 过户账号确认界面 |
| | | /// 个人资料 |
| | | /// </summary> |
| | | public class TransferUserConfirmPage : FrameLayout |
| | | { |
| | | /// <summary> |
| | | /// |
| | | /// </summary> |
| | | FrameLayout bodyView; |
| | | |
| | | public TransferUserConfirmPage() |
| | | { |
| | | bodyView = this; |
| | | } |
| | | |
| | | /// <summary> |
| | | /// |
| | | /// </summary> |
| | | public void LoadPage() |
| | | { |
| | | BackgroundColor = CSS_Color.BackgroundColor; |
| | | |
| | | new TopViewDiv(bodyView, "个人资料").LoadTopView(); |
| | | |
| | | var headView = new FrameLayout() |
| | | { |
| | | Y = Application.GetRealHeight(64), |
| | | Height = Application.GetRealHeight(204), |
| | | BackgroundColor = CSS_Color.MainBackgroundColor, |
| | | }; |
| | | bodyView.AddChidren(headView); |
| | | |
| | | ImageView myHeadImage = new ImageView() |
| | | { |
| | | Y = Application.GetRealHeight(32), |
| | | Width = Application.GetRealWidth(84), |
| | | Height = Application.GetRealWidth(84), |
| | | Radius = (uint)Application.GetRealWidth(42), |
| | | ImagePath = UserInfo.Current.headImagePagePath, |
| | | Gravity = Gravity.CenterHorizontal, |
| | | }; |
| | | headView.AddChidren(myHeadImage); |
| | | |
| | | var btnConfirm = new Button() |
| | | { |
| | | Y = headView.Bottom + Application.GetRealHeight(8), |
| | | Height = Application.GetRealHeight(50), |
| | | TextAlignment = TextAlignment.Center, |
| | | TextColor = CSS_Color.MainColor, |
| | | TextSize = CSS_FontSize.SubheadingFontSize, |
| | | BackgroundColor = CSS_Color.MainBackgroundColor, |
| | | Text = "确认过户" |
| | | |
| | | }; |
| | | bodyView.AddChidren(btnConfirm); |
| | | |
| | | } |
| | | |
| | | } |
| | | |
| | | } |
| | |
| | | using HDL_ON.Entity; |
| | | using Shared; |
| | | using HDL_ON.UI.CSS; |
| | | using HDL_ON.DAL.Server; |
| | | |
| | | namespace HDL_ON.UI |
| | | { |
| | |
| | | |
| | | //刷新功能状态 |
| | | DB_ResidenceData.residenceData.RefreshResidenceFunctionStatus(); |
| | | //注册推送ID |
| | | RegisteredPush(); |
| | | |
| | | } |
| | | catch (Exception ex) |
| | | { |
| | |
| | | ContextView.AddChidren(personalCenterPage); |
| | | personalCenterPage.LoadView(); |
| | | } |
| | | |
| | | /// <summary> |
| | | /// 注册推送 |
| | | /// </summary> |
| | | void RegisteredPush() |
| | | { |
| | | new HttpServerRequest().RegisteredPush(); |
| | | } |
| | | } |
| | | } |