From d63d8923861e81d507c9995a88b9e6d07bdcea44 Mon Sep 17 00:00:00 2001 From: wangzhitong Date: Sat, 9 Nov 2024 18:16:43 +0800 Subject: [PATCH] =?UTF-8?q?update=20chooseImage=E3=80=81chooseVideo?= =?UTF-8?q?=E6=B7=BB=E5=8A=A0pageOrientation=E6=B5=8B=E8=AF=95=E4=BE=8B?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- pages/API/choose-image/choose-image.uvue | 36 ++++- pages/API/choose-video/choose-video.uvue | 185 ++++++++++++----------- 2 files changed, 129 insertions(+), 92 deletions(-) diff --git a/pages/API/choose-image/choose-image.uvue b/pages/API/choose-image/choose-image.uvue index 44ef1439..6367ccf6 100644 --- a/pages/API/choose-image/choose-image.uvue +++ b/pages/API/choose-image/choose-image.uvue @@ -32,7 +32,17 @@ - + + + + + 屏幕方向 + + + {{orientationType[orientationTypeIndex]}} + + + 图像裁剪 @@ -111,6 +121,11 @@ ['compressed'], ['original'], ['compressed', 'original'] + ] + var orientationTypeArray = [ + 'portrait', + 'landscape', + 'auto' ] export default { data() { @@ -120,7 +135,9 @@ sourceTypeIndex: 2, sourceType: ['拍照', '相册', '拍照或相册'], sizeTypeIndex: 2, - sizeType: ['压缩', '原图', '压缩或原图'], + sizeType: ['压缩', '原图', '压缩或原图'], + orientationTypeIndex: 0, + orientationType: ['竖屏', '横屏', '自动'], countIndex: 8, count: [1, 2, 3, 4, 5, 6, 7, 8, 9], isCrop: false, @@ -136,7 +153,9 @@ this.sourceType = ['拍照', '相册', '拍照或相册'] this.sizeTypeIndex = 2 this.sizeType = ['压缩', '原图', '压缩或原图'] - this.countIndex = 8 + this.countIndex = 8 + this.orientationTypeIndex = 0 + this.orientationType = ['竖屏', '横屏', '自动'] }, methods: { cropHeightConfim(e : InputConfirmEvent) { @@ -196,6 +215,14 @@ this.sizeTypeIndex = e.tapIndex! } }) + }, + chooseOrientationType(){ + uni.showActionSheet({ + itemList: ['竖屏', '横屏', '自动'], + success: (e) => { + this.orientationTypeIndex = e.tapIndex! + } + }) }, chooseImageCount(event : InputConfirmEvent) { let count = parseInt(event.detail.value) - 1 @@ -221,7 +248,8 @@ sourceType: sourceTypeArray[this.sourceTypeIndex], sizeType: sizeTypeArray[this.sizeTypeIndex], crop: this.isCrop ? { "quality": this.cropPercent, "width": this.cropWidth, "height": this.cropHeight, "resize": this.cropResize } as ChooseImageCropOptions : null, - count: this.imageList.length + this.count[this.countIndex] > 9 ? 9 - this.imageList.length : this.count[this.countIndex], + count: this.imageList.length + this.count[this.countIndex] > 9 ? 9 - this.imageList.length : this.count[this.countIndex], + pageOrientation: orientationTypeArray[this.orientationTypeIndex], success: (res) => { this.imageList = this.imageList.concat(res.tempFilePaths); }, diff --git a/pages/API/choose-video/choose-video.uvue b/pages/API/choose-video/choose-video.uvue index cc6969aa..b813a290 100644 --- a/pages/API/choose-video/choose-video.uvue +++ b/pages/API/choose-video/choose-video.uvue @@ -1,94 +1,103 @@ -