/**
- 选择图片
- @doc https://uniapp.dcloud.io/api/media/image?id=chooseimage
*/
export const chooseImage = (params) => {
return new Promise((resolve, reject) => {
uni.chooseImage({
count: params.count || 9,
sizeType: params.sizeType,
sourceType: params.sourceType,
success(val) {
if(val.tempFiles[0].size > 5242880){
showTips('请上传小于5M的图片')
return false
}
resolve(val)
},
fail() {
reject()
}
})
})
}
0 个回复