private async void UploadImage()
        {
            try
            {
                var       imageUrl  = "";
                var       imageType = "L";
                var       imageName = "";
                var       filePath  = "";
                MediaFile file      = null;

                await CrossMedia.Current.Initialize();

                var action = await _commonFun.ShowActionSheet("从相册", "拍照");

                IsLoading = true;
                if (action == "从相册")
                {
                    MessagingCenter.Send <CommonMessage>(new CommonMessage()
                    {
                        TaskID = "-1"
                    }, "LocalResetTaskID");
                    file = await CrossMedia.Current.PickPhotoAsync();
                }
                else if (action == "拍照")
                {
                    MessagingCenter.Send <CommonMessage>(new CommonMessage()
                    {
                        TaskID = "-1"
                    }, "LocalResetTaskID");
                    if (!CrossMedia.Current.IsCameraAvailable || !CrossMedia.Current.IsTakePhotoSupported)
                    {
                        return;
                    }
                    file = await CrossMedia.Current.TakePhotoAsync(new Plugin.Media.Abstractions.StoreCameraMediaOptions
                    {
                        Directory = "RMMT",
                        Name      = DateTime.Now.ToString("yy-MM-dd").Replace("-", "")
                                    + DateTime.Now.ToString("HH:mm:ss").Replace(":", "")
                    });
                }

                if (file == null)
                {
                    MessagingCenter.Send <CommonMessage>(new CommonMessage()
                    {
                        TaskID = "0"
                    }, "LocalResetTaskID");
                    IsLoading = false;
                    return;
                }

                imageName = file.Path.Substring(file.Path.LastIndexOf('/') + 1);
                filePath  = file.Path;

                //upload file to server

                try
                {
                    string result = _commonFun.SaveAttachLocal(file.GetStream(), file.Path);

                    file.Dispose();

                    if (!string.IsNullOrWhiteSpace(result))
                    {
                        imageUrl = result;

                        var addDto = new StandardPic()
                        {
                            StandardPicId = 0,
                            PicName       = imageName,
                            PicType       = imageType, //L,G 失分照片/得分照片
                            TIId          = CurrentSystem.TIId,
                            Url           = imageUrl,
                            FilePath      = filePath,
                            PicId         = SPicList.Count == 0 ? 1 : SPicList.Max(p => p.PicId) + 1
                        };

                        SPicList.Add(addDto);
                        //ParamSPicList.Add(addDto);

                        LossImageList = SPicList.Count * 50;
                    }
                    else
                    {
                        _commonFun.AlertLongText("上传失败");
                        return;
                    }
                }
                catch (OperationCanceledException)
                {
                    _commonFun.AlertLongText("上传超时,请重试");
                    return;
                }
                catch (Exception)
                {
                    _commonFun.AlertLongText("上传异常,请重试");
                    return;
                }
                finally
                {
                    IsLoading = false;
                    MessagingCenter.Send <CommonMessage>(new CommonMessage()
                    {
                        TaskID = "0"
                    }, "LocalResetTaskID");
                }
            }
            catch (Exception)
            {
                _commonFun.AlertLongText("操作异常,请重试。-->LocalRegistScoreViewModel");
                return;
            }
        }
        //private RelayCommand _itemTappedCommand;
        //public RelayCommand ItemTappedCommand
        //{
        //	get { return _itemTappedCommand ?? (_itemTappedCommand = new RelayCommand(PicItemTapped)); }
        //}
        #endregion

        #region action
        private async void UploadImage()
        {
            try
            {
                var       imageUrl  = "";
                var       imageType = "L";
                var       imageName = "";
                var       filePath  = "";
                MediaFile file      = null;

                await CrossMedia.Current.Initialize();

                var action = await _commonFun.ShowActionSheet("从相册", "拍照");

                IsLoading = true;
                if (action == "从相册")
                {
                    MessagingCenter.Send <CommonMessage>(new CommonMessage()
                    {
                        TaskID = "-1"
                    }, "ResetTaskID");
                    file = await CrossMedia.Current.PickPhotoAsync();
                }
                else if (action == "拍照")
                {
                    MessagingCenter.Send <CommonMessage>(new CommonMessage()
                    {
                        TaskID = "-1"
                    }, "ResetTaskID");
                    if (!CrossMedia.Current.IsCameraAvailable || !CrossMedia.Current.IsTakePhotoSupported)
                    {
                        return;
                    }
                    file = await CrossMedia.Current.TakePhotoAsync(new Plugin.Media.Abstractions.StoreCameraMediaOptions
                    {
                        Directory = "RMMT",
                        Name      = DateTime.Now.ToString("yy-MM-dd").Replace("-", "")
                                    + DateTime.Now.ToString("HH:mm:ss").Replace(":", "")
                    });
                }

                if (file == null)
                {
                    MessagingCenter.Send <CommonMessage>(new CommonMessage()
                    {
                        TaskID = "0"
                    }, "ResetTaskID");
                    IsLoading = false;
                    return;
                }

                imageName = file.Path.Substring(file.Path.LastIndexOf('/') + 1);
                filePath  = file.Path;

                //upload file to server
                //if (_commonHelper.IsNetWorkConnected() == true)
                //{
                try
                {
                    //var result = await _tourService.UploadFiletoOss(file.GetStream(), file.Path);
                    string result = _commonFun.SaveAttachLocal(file.GetStream(), file.Path);

                    file.Dispose();

                    if (!string.IsNullOrWhiteSpace(result))
                    {
                        imageUrl = result;

                        var addDto = new StandardPic()
                        {
                            StandardPicId = 0,
                            PicName       = imageName,
                            PicType       = imageType, //L,G 失分照片/得分照片
                            TIId          = CurrentSystem.TIId,
                            Url           = imageUrl,
                            FilePath      = filePath,
                            PicId         = CurrentSystem.SPicList.Count == 0 ? 1 : CurrentSystem.SPicList.Max(p => p.PicId) + 1
                        };

                        CurrentSystem.SPicList.Add(addDto);
                        CurrentSystem.ParamSPicList.Add(addDto);

                        LossImageList = CurrentSystem.SPicList.Count * 50;
                    }
                    else
                    {
                        _commonFun.AlertLongText("上传失败");
                        return;
                    }

                    //if (result != null)
                    //{
                    //    var resultInfo = JsonConvert.DeserializeObject<AttachDto>(result.Body);
                    //    if (result.ResultCode == ResultType.Success)
                    //    {
                    //        imageUrl = resultInfo.Url;

                    //        var addDto = new StandardPic()
                    //        {
                    //            //ImageStream = ImageSource.FromStream(() => { return displayStream; }),//resource,
                    //            StandardPicId = 0,
                    //            PicName = imageName,
                    //            PicType = imageType, //L,G 失分照片/得分照片
                    //            TIId = CurrentSystem.TIId,
                    //            Url = imageUrl,
                    //            FilePath = filePath,
                    //            PicId = CurrentSystem.SPicList.Count == 0 ? 1 : CurrentSystem.SPicList.Max(p => p.PicId) + 1
                    //        };

                    //        CurrentSystem.SPicList.Add(addDto);
                    //        CurrentSystem.ParamSPicList.Add(addDto);

                    //        LossImageList = CurrentSystem.SPicList.Count * 50;
                    //    }
                    //    else
                    //    {
                    //        _commonFun.AlertLongText(result.Msg);
                    //        return;
                    //    }
                    //}
                    //else
                    //{
                    //    _commonFun.AlertLongText("上传失败");
                    //    return;
                    //}
                }
                catch (OperationCanceledException)
                {
                    _commonFun.AlertLongText("上传超时,请重试");
                    return;
                }
                catch (Exception)
                {
                    _commonFun.AlertLongText("上传异常,请重试");
                    return;
                }
                finally
                {
                    IsLoading = false;
                    MessagingCenter.Send <CommonMessage>(new CommonMessage()
                    {
                        TaskID = "0"
                    }, "ResetTaskID");
                }
            }
            catch (Exception)
            {
                _commonFun.AlertLongText("操作异常,请重试。-->RegistScoreViewModel");
                return;
            }
            //}
            //else
            //{
            //    MessagingCenter.Send<CommonMessage>(new CommonMessage() { TaskID = 0 }, "ResetTaskID");
            //    file.Dispose();
            //    _commonFun.AlertLongText("网络连接异常");
            //    IsLoading = false;
            //    return;
            //}
        }