提交 55e752f6 编写于 作者: DCloud-WZF's avatar DCloud-WZF 💬

fix: 修复 showActionSheet 回调参数类型警告

上级 a1f21b55
......@@ -32,15 +32,15 @@
<input class="click-t" :value="countIndex+1" type="number" :maxlength="1" @confirm="chooseImageCount"
confirm-type="done" />
</view>
</view>
<!-- #ifdef APP -->
<view class="uni-list-cell cell-pd">
<view class="uni-list-cell-left uni-label">
屏幕方向
</view>
<view class="uni-list-cell-right" @click="chooseOrientationType">
<text class="click-t">{{orientationType[orientationTypeIndex]}}</text>
</view>
</view>
<!-- #ifdef APP -->
<view class="uni-list-cell cell-pd">
<view class="uni-list-cell-left uni-label">
屏幕方向
</view>
<view class="uni-list-cell-right" @click="chooseOrientationType">
<text class="click-t">{{orientationType[orientationTypeIndex]}}</text>
</view>
</view>
<!-- #endif -->
<!-- #ifdef APP-ANDROID -->
......@@ -131,11 +131,11 @@
['compressed'],
['original'],
['compressed', 'original']
]
var orientationTypeArray = [
'portrait',
'landscape',
'auto'
]
var orientationTypeArray = [
'portrait',
'landscape',
'auto'
]
var albumModeTypeArray = [
"custom",
......@@ -149,8 +149,8 @@
sourceTypeIndex: 2,
sourceType: ['拍照', '相册', '拍照或相册'],
sizeTypeIndex: 2,
sizeType: ['压缩', '原图', '压缩或原图'],
orientationTypeIndex: 0,
sizeType: ['压缩', '原图', '压缩或原图'],
orientationTypeIndex: 0,
orientationType: ['竖屏', '横屏', '自动'],
albumModeTypeIndex:0,
albumModeType:["自定义相册","系统相册"],
......@@ -172,8 +172,8 @@
this.sourceType = ['拍照', '相册', '拍照或相册']
this.sizeTypeIndex = 2
this.sizeType = ['压缩', '原图', '压缩或原图']
this.countIndex = 8
this.orientationTypeIndex = 0
this.countIndex = 8
this.orientationTypeIndex = 0
this.orientationType = ['竖屏', '横屏', '自动']
},
methods: {
......@@ -214,7 +214,7 @@
uni.showActionSheet({
itemList: this.albumModeType,
success: (e) => {
this.albumModeTypeIndex = e.tapIndex!
this.albumModeTypeIndex = e.tapIndex
}
})
},
......@@ -231,7 +231,7 @@
uni.showActionSheet({
itemList: ['拍照', '相册', '拍照或相册'],
success: (e) => {
this.sourceTypeIndex = e.tapIndex!
this.sourceTypeIndex = e.tapIndex
}
})
},
......@@ -239,17 +239,17 @@
uni.showActionSheet({
itemList: ['压缩', '原图', '压缩或原图'],
success: (e) => {
this.sizeTypeIndex = e.tapIndex!
this.sizeTypeIndex = e.tapIndex
}
})
},
chooseOrientationType(){
uni.showActionSheet({
itemList: ['竖屏', '横屏', '自动'],
success: (e) => {
this.orientationTypeIndex = e.tapIndex
}
})
},
chooseOrientationType(){
uni.showActionSheet({
itemList: ['竖屏', '横屏', '自动'],
success: (e) => {
this.orientationTypeIndex = e.tapIndex!
}
})
},
chooseImageCount(event : InputConfirmEvent) {
let count = parseInt(event.detail.value) - 1
......@@ -275,7 +275,7 @@
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],
// #ifdef APP
pageOrientation: orientationTypeArray[this.orientationTypeIndex],
// #endif
......@@ -353,4 +353,4 @@
transition-property: height, margin-bottom;
transition-duration: 200ms;
}
</style>
</style>
......@@ -23,15 +23,15 @@
<view class="uni-list-cell-right" @click="chooseSizeType">
<text class="click-t">{{sizeTypes[sizeTypeIndex].title}}</text>
</view>
</view>
<view class="uni-list-cell cell-pd">
<view class="uni-list-cell-left uni-label">
方式
</view>
<view class="uni-list-cell-right" @click="chooseMediaType">
<text class="click-t">{{(mediaTypes[mediaTypeIndex] as ChooseSource).title}}</text>
</view>
</view>
<view class="uni-list-cell cell-pd">
<view class="uni-list-cell-left uni-label">
方式
</view>
<view class="uni-list-cell-right" @click="chooseMediaType">
<text class="click-t">{{(mediaTypes[mediaTypeIndex] as ChooseSource).title}}</text>
</view>
</view>
<view class="uni-list-cell cell-pd">
......@@ -53,17 +53,17 @@
<text class="click-t">{{orientationTypes[orientationTypeIndex].title}}</text>
</view>
</view>
<!-- #endif -->
<!-- #ifdef APP-ANDROID -->
<view class="uni-list-cell cell-pd">
<view class="uni-list-cell-left uni-label">
相册模式
</view>
<view class="uni-list-cell-right" @click="albumModeChange">
<text class="click-t">{{albumModeTypes[albumModeTypeIndex].title}}</text>
</view>
</view>
<!-- #endif -->
<!-- #ifdef APP-ANDROID -->
<view class="uni-list-cell cell-pd">
<view class="uni-list-cell-left uni-label">
相册模式
</view>
<view class="uni-list-cell-right" @click="albumModeChange">
<text class="click-t">{{albumModeTypes[albumModeTypeIndex].title}}</text>
</view>
</view>
<!-- #endif -->
<view class="uni-list-cell cell-pd">
......@@ -178,16 +178,16 @@
value: ['back'],
title: '后置摄像头',
}
];
const albumModeList : ChooseSource[] = [
{
value: ['custom'],
title: '自定义相册',
},
{
value: ['system'],
title: '系统相册',
}
];
const albumModeList : ChooseSource[] = [
{
value: ['custom'],
title: '自定义相册',
},
{
value: ['system'],
title: '系统相册',
}
];
export default {
data() {
......@@ -198,7 +198,7 @@
mediaTypeIndex: 2,
sizeTypeIndex: 2,
cameraTypeIndex: 1,
orientationTypeIndex: 0,
orientationTypeIndex: 0,
albumModeTypeIndex: 0,
countIndex: 9,
maxDuration: 10,
......@@ -206,7 +206,7 @@
mediaTypes: mediaTypeList as ChooseSource[],
sizeTypes: sizeTypeList as ChooseSource[],
cameraTypes: cameraTypeList as ChooseSource[],
orientationTypes: orientationTypeList as ChooseSource[],
orientationTypes: orientationTypeList as ChooseSource[],
albumModeTypes: albumModeList as ChooseSource[],
}
},
......@@ -215,23 +215,23 @@
uni.showActionSheet({
itemList: ['拍摄', '相册', '拍摄或相册'],
success: (e) => {
this.sourceTypeIndex = e.tapIndex!
this.sourceTypeIndex = e.tapIndex
}
})
},
chooseSizeType() {
uni.showActionSheet({
itemList: ['压缩', '原图', '压缩或原图'],
success: (e) => {
this.sizeTypeIndex = e.tapIndex
}
})
},
chooseSizeType() {
uni.showActionSheet({
itemList: ['压缩', '原图', '压缩或原图'],
success: (e) => {
this.sizeTypeIndex = e.tapIndex!
}
})
},
chooseMediaType() {
uni.showActionSheet({
itemList: ['仅图片', '仅视频', '不限制'],
success: (e) => {
this.mediaTypeIndex = e.tapIndex!
this.mediaTypeIndex = e.tapIndex
}
})
},
......@@ -241,7 +241,7 @@
uni.showToast({
position: "bottom",
title: "图片数量应该不小于1不大于9"
})
})
this.countIndex = 9;
return
}
......@@ -251,7 +251,7 @@
uni.showActionSheet({
itemList: ['竖屏', '横屏', '自动'],
success: (e) => {
this.orientationTypeIndex = e.tapIndex!
this.orientationTypeIndex = e.tapIndex
}
})
},
......@@ -259,23 +259,23 @@
uni.showActionSheet({
itemList: ['前置', '后置'],
success: (e) => {
this.cameraTypeIndex = e.tapIndex!
this.cameraTypeIndex = e.tapIndex
}
})
},
onMaxDurationConfirm(value : number) {
this.maxDuration = value;
},
albumModeChange(){
uni.showActionSheet({
itemList: ['自定义相册','系统相册'],
success: (e) => {
this.albumModeTypeIndex = e.tapIndex!
}
})
},
albumModeChange(){
uni.showActionSheet({
itemList: ['自定义相册','系统相册'],
success: (e) => {
this.albumModeTypeIndex = e.tapIndex
}
})
},
chooseMedia() {
if (this.mediaList.length >= this.countIndex) {
if (this.mediaList.length >= this.countIndex) {
const message = "已经有" + this.countIndex + "个了,请删除部分后重新选择";
uni.showToast({
position: "bottom",
......@@ -293,9 +293,9 @@
maxDuration: this.maxDuration,
// #ifdef APP
pageOrientation: orientationTypeList[this.orientationTypeIndex].value[0],
// #endif
// #ifdef APP-ANDROID
albumMode: albumModeList[this.albumModeTypeIndex].value[0],
// #endif
// #ifdef APP-ANDROID
albumMode: albumModeList[this.albumModeTypeIndex].value[0],
// #endif
success: (res) => {
const tempFiles : ChooseMediaTempFile[] = res.tempFiles as ChooseMediaTempFile[];
......@@ -311,18 +311,18 @@
}
})
},
previewMedia: function (index : number) {
const file : FileSource = this.mediaList[index];
if(file.fileType == "image"){
uni.previewImage({
current: 0,
urls: [file.filePath]
})
}else{
const url = "/pages/API/choose-media/fullscreen-video?url=" + file.filePath + "&cover=" + file.imagePath;
uni.navigateTo({
url:url,
})
previewMedia: function (index : number) {
const file : FileSource = this.mediaList[index];
if(file.fileType == "image"){
uni.previewImage({
current: 0,
urls: [file.filePath]
})
}else{
const url = "/pages/API/choose-media/fullscreen-video?url=" + file.filePath + "&cover=" + file.imagePath;
uni.navigateTo({
url:url,
})
}
},
......@@ -377,4 +377,4 @@
.item_width {
width: 130px;
}
</style>
</style>
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册