Merge branch 'master' of http://gitea.bugtc.com/zhouyanli/property-manager-side
This commit is contained in:
@@ -3,7 +3,7 @@
|
||||
* @Author: Zy
|
||||
* @Date: 2026-05-15 08:50:47
|
||||
* @LastEditor: Zy
|
||||
* @LastEditTime: 2026-05-19 16:34:23
|
||||
* @LastEditTime: 2026-06-18 09:47:21
|
||||
*/
|
||||
import request, {
|
||||
filterParams,
|
||||
|
||||
@@ -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({
|
||||
|
||||
@@ -151,7 +151,6 @@ function handleComplaint(id) {
|
||||
}
|
||||
|
||||
function scrolltolower() {
|
||||
console.log('触发')
|
||||
if (isLoading.value || !hasMore.value) {
|
||||
return
|
||||
}
|
||||
|
||||
@@ -92,7 +92,7 @@ function handleInput() {
|
||||
resetList()
|
||||
} else {
|
||||
queryParmas.value.keyword = ''
|
||||
Searching.value = false
|
||||
Searching.value = true
|
||||
resetList()
|
||||
}
|
||||
}
|
||||
|
||||
@@ -66,9 +66,7 @@
|
||||
</view>
|
||||
<view class="inspection_items">
|
||||
<view class="label">巡检结果:</view>
|
||||
<!-- <view class="desction_value"> {{ ite.desition }}</view> -->
|
||||
<view class="desction_value">
|
||||
<!-- <rich-text :nodes="ite.desition"></rich-text> -->
|
||||
<textarea class="my_textarea" disabled auto-height :value="ite.desition" />
|
||||
</view>
|
||||
</view>
|
||||
@@ -164,7 +162,7 @@ function handlePrivew(lists, index) {
|
||||
if (lists.length <= 0) return
|
||||
uni.previewImage({
|
||||
urls: lists,
|
||||
count: index
|
||||
current: index
|
||||
})
|
||||
}
|
||||
</script>
|
||||
|
||||
@@ -259,7 +259,7 @@ function handlePrivew(items, index) {
|
||||
if (items.length <= 0) return
|
||||
uni.previewImage({
|
||||
urls: items,
|
||||
count: index
|
||||
current: index
|
||||
})
|
||||
}
|
||||
</script>
|
||||
|
||||
@@ -294,7 +294,7 @@ function handlePrivew(items, index = 0) {
|
||||
if (items.length <= 0) return
|
||||
uni.previewImage({
|
||||
urls: items,
|
||||
count: index
|
||||
current: index
|
||||
})
|
||||
}
|
||||
</script>
|
||||
|
||||
51
wuye-manager-uniapp/utils/Auth.js
Normal file
51
wuye-manager-uniapp/utils/Auth.js
Normal file
@@ -0,0 +1,51 @@
|
||||
/**
|
||||
* 请求权限
|
||||
* @param {String} scope 权限标识
|
||||
* @param {String} tip 拒绝后的提示文案
|
||||
*/
|
||||
export function requestAuth(scope, tip) {
|
||||
return new Promise((resolve, reject) => {
|
||||
// #ifdef APP-PLUS || MP-WEIXIN
|
||||
uni.getSetting({
|
||||
success: (res) => {
|
||||
console.log(res)
|
||||
// 1. 已授权
|
||||
if (res.authSetting[scope]) {
|
||||
resolve(true)
|
||||
return
|
||||
}
|
||||
// 2. 未申请过,发起授权弹窗
|
||||
uni.authorize({
|
||||
scope,
|
||||
success: () => resolve(true),
|
||||
fail: () => {
|
||||
// 3. 用户拒绝,引导去设置页开启
|
||||
uni.showModal({
|
||||
title: '权限申请',
|
||||
content: tip,
|
||||
confirmText: '去设置',
|
||||
cancelText: '取消',
|
||||
success: (modal) => {
|
||||
if (modal.confirm) {
|
||||
uni.openSetting({
|
||||
success: (setRes) => {
|
||||
resolve(setRes.authSetting[scope])
|
||||
},
|
||||
fail: () => reject(false)
|
||||
})
|
||||
} else {
|
||||
reject(false)
|
||||
}
|
||||
}
|
||||
})
|
||||
}
|
||||
})
|
||||
},
|
||||
fail: () => reject(false)
|
||||
})
|
||||
// #endif
|
||||
// #ifdef H5
|
||||
resolve(true)
|
||||
// #endif
|
||||
})
|
||||
}
|
||||
Reference in New Issue
Block a user