6/23修正预览,滚动事件
This commit is contained in:
@@ -25,6 +25,7 @@
|
||||
<script setup>
|
||||
import { ref, watch } from 'vue'
|
||||
import baseUrl from '@/api/BaseUrl.js'
|
||||
import { requestAuth } from '@/utils/Auth.js'
|
||||
|
||||
// ======================
|
||||
// Props(可配置)
|
||||
@@ -114,15 +115,34 @@ function choose() {
|
||||
emit('success', { tempFilePaths: tempPaths })
|
||||
return
|
||||
}
|
||||
|
||||
// 有上传接口,自动上传
|
||||
for (const path of tempPaths) {
|
||||
await uploadSingle(path)
|
||||
}
|
||||
},
|
||||
fail: err => {
|
||||
console.log('选图失败', err)
|
||||
emit('fail', err)
|
||||
// 捕获权限拒绝,弹提示引导设置
|
||||
if (err.errMsg.includes('auth') || err.errMsg.includes('Permission')) {
|
||||
uni.showModal({
|
||||
title: '权限不足',
|
||||
content: '相册/相机权限已被拒绝,请前往应用设置手动开启',
|
||||
confirmText: '去设置',
|
||||
cancelText: '取消',
|
||||
success: m => {
|
||||
if (m.confirm) {
|
||||
// #ifdef APP-PLUS
|
||||
uni.openAppAuthorizeSetting()
|
||||
// #endif
|
||||
// #ifdef MP-WEIXIN
|
||||
uni.openSetting()
|
||||
// #endif
|
||||
}
|
||||
},
|
||||
fail() {
|
||||
emit('fail', err)
|
||||
}
|
||||
})
|
||||
}
|
||||
}
|
||||
})
|
||||
}
|
||||
@@ -194,7 +214,6 @@ function remove(index) {
|
||||
|
||||
// 4. 预览图片
|
||||
function preview(index) {
|
||||
console.log(innerList)
|
||||
const urls = innerList.value.map(i => i.url).filter(Boolean)
|
||||
if (urls.length <= 0) return
|
||||
uni.previewImage({
|
||||
|
||||
Reference in New Issue
Block a user