private void DeleteImage(StandardPic item)
        {
            try
            {
                var index = SPicList.IndexOf(item);

                if (SPicList != null && SPicList.Count > 0 &&
                    index > -1)
                {
                    SPicList.Remove(item);
                    //ParamSPicList.FirstOrDefault(p => p.PicId == item.PicId).Url = string.Empty;

                    LossImageList = SPicList.Count * 50;
                }
            }
            catch (Exception)
            {
                _commonFun.AlertLongText("操作异常,请重试。-->LocalRegistScoreViewModel");
                return;
            }
        }
        void Preview(StandardPic dto)
        {
            //List<ImagePreviewDto> list = new List<ImagePreviewDto>() { new ImagePreviewDto() {
            //        Url = LossPicAttachItem.Url
            //    }};


            //Device.BeginInvokeOnMainThread(async () =>
            //{
            //    if (_previewTimer)
            //    {
            //        _previewTimer = false;
            //        await PopupNavigation.PushAsync(new PreviewImagePage(list, 0), true);
            //        Device.StartTimer(TimeSpan.FromSeconds(3), () =>
            //        {
            //            _previewTimer = true;
            //            return false;
            //        });
            //    }
            //});

            try
            {
                string url = LossPicAttachItem.Url;

                string filename = url.LastIndexOf("/") > 0 ? url.Substring(url.LastIndexOf("/") + 1) : "";
                if (String.IsNullOrEmpty(filename))
                {
                    return;
                }
                if (CrossFilePicker.Current.IsExistFile(filename, "RMMT_IMAGE"))
                {
                    //本地预览
                    CrossFilePicker.Current.OpenFile(filename, "RMMT_IMAGE");
                }
                else if (CrossFilePicker.Current.IsExistFile(filename, "RMMTIMAGEVIEW"))
                {
                    //已从服务器上缓存的图片。
                    CrossFilePicker.Current.OpenFile(filename, "RMMTIMAGEVIEW");
                }
                else
                {
                    if (App.SysOS == "IOS")
                    {
                        _commonFun.DownLoadFileFromOss(url, filename, "RMMTIMAGEVIEW");
                    }
                    else
                    {
                        if (_commonHelper.IsNetWorkConnected() == true)
                        {
                            _commonFun.DownLoadFileFromOss(url, filename, "RMMTIMAGEVIEW");
                        }
                        else
                        {
                            _commonFun.AlertLongText("请在连网时预览");
                            return;
                        }
                    }
                }
            }
            catch (Exception)
            {
                _commonFun.AlertLongText("加载异常,请重试");
            }
        }
        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;
            }
        }