Skip to content
项目
群组
代码片段
帮助
当前项目
正在载入...
登录 / 注册
切换导航面板
I
inspection-pad-web
项目
项目
详情
活动
周期分析
仓库
仓库
文件
提交
分支
标签
贡献者
图表
比较
统计图
议题
0
议题
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
CI / CD
CI / CD
流水线
作业
日程
统计图
Wiki
Wiki
代码片段
代码片段
成员
成员
折叠边栏
关闭边栏
活动
图像
聊天
创建新问题
作业
提交
问题看板
Open sidebar
专网
inspection-pad-web
Commits
30298de4
提交
30298de4
authored
4月 09, 2025
作者:
JaxBBLL
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
fix
上级
25dc648d
显示空白字符变更
内嵌
并排
正在显示
2 个修改的文件
包含
80 行增加
和
1 行删除
+80
-1
index.vue
components/CommonUpload/index.vue
+73
-1
inspectionContentList.vue
pages/inspectionContent/inspectionContentList.vue
+7
-0
没有找到文件。
components/CommonUpload/index.vue
浏览文件 @
30298de4
...
@@ -46,6 +46,10 @@ export default {
...
@@ -46,6 +46,10 @@ export default {
type
:
Array
,
type
:
Array
,
default
:
()
=>
[
"camera"
],
// 默认从相机拍摄
default
:
()
=>
[
"camera"
],
// 默认从相机拍摄
},
},
sizeType
:
{
type
:
Array
,
default
:
()
=>
[
"compressed"
],
// 默认压缩图 ["original", "compressed"]
},
},
},
data
()
{
data
()
{
return
{
return
{
...
@@ -60,12 +64,73 @@ export default {
...
@@ -60,12 +64,73 @@ export default {
this
.
$emit
(
"input"
,
newVal
);
// 同步更新父组件绑定的数据
this
.
$emit
(
"input"
,
newVal
);
// 同步更新父组件绑定的数据
},
},
},
},
methods
:
{
methods
:
{
// 检查并请求权限
async
checkAndRequestPermission
()
{
// 定义所需权限
const
permissions
=
[];
if
(
this
.
sourceType
.
includes
(
"camera"
))
{
permissions
.
push
(
"android.permission.CAMERA"
);
// 相机权限
}
if
(
this
.
sourceType
.
includes
(
"album"
))
{
permissions
.
push
(
"android.permission.READ_EXTERNAL_STORAGE"
);
// 相册权限
}
// 检查权限状态
const
hasPermission
=
await
new
Promise
((
resolve
)
=>
{
plus
.
android
.
requestPermissions
(
permissions
,
(
result
)
=>
{
let
granted
=
true
;
for
(
let
i
=
0
;
i
<
result
.
granted
.
length
;
i
++
)
{
if
(
!
result
.
granted
[
i
])
{
granted
=
false
;
break
;
}
}
resolve
(
granted
);
},
(
error
)
=>
{
console
.
error
(
"权限请求失败:"
,
error
.
message
);
resolve
(
false
);
}
);
});
if
(
!
hasPermission
)
{
// 用户拒绝授权,弹出提示
uni
.
showModal
({
title
:
"权限提示"
,
content
:
"您拒绝了必要的权限,可能导致功能无法正常使用。是否前往设置页面开启权限?"
,
success
:
(
modalRes
)
=>
{
if
(
modalRes
.
confirm
)
{
// 打开应用设置页面
plus
.
runtime
.
openURL
(
"app-settings://"
,
// 跳转到系统设置页面
(
err
)
=>
{
console
.
error
(
"跳转设置页面失败:"
,
err
.
message
);
}
);
}
},
});
return
false
;
}
return
true
;
},
// 选择图片
// 选择图片
chooseImage
()
{
async
chooseImage
()
{
// 检查权限
const
isAuthorized
=
await
this
.
checkAndRequestPermission
();
if
(
!
isAuthorized
)
return
;
const
count
=
this
.
maxCount
-
this
.
images
.
length
;
// 剩余可选图片数量
const
count
=
this
.
maxCount
-
this
.
images
.
length
;
// 剩余可选图片数量
uni
.
chooseImage
({
uni
.
chooseImage
({
count
:
count
,
count
:
count
,
sizeType
:
this
.
sizeType
,
sourceType
:
this
.
sourceType
,
// 使用传递的 sourceType
sourceType
:
this
.
sourceType
,
// 使用传递的 sourceType
success
:
async
(
res
)
=>
{
success
:
async
(
res
)
=>
{
const
tempFilePaths
=
res
.
tempFilePaths
;
const
tempFilePaths
=
res
.
tempFilePaths
;
...
@@ -74,6 +139,13 @@ export default {
...
@@ -74,6 +139,13 @@ export default {
this
.
images
.
push
(
base64
);
this
.
images
.
push
(
base64
);
}
}
},
},
fail
:
(
err
)
=>
{
console
.
error
(
"选择图片失败:"
,
err
);
uni
.
showToast
({
title
:
"选择图片失败,请重试"
,
icon
:
"none"
,
});
},
});
});
},
},
// 预览图片
// 预览图片
...
...
pages/inspectionContent/inspectionContentList.vue
浏览文件 @
30298de4
...
@@ -47,6 +47,9 @@
...
@@ -47,6 +47,9 @@
></image>
></image>
<button
class=
"record-button"
@
click=
"toSign"
>
重签
</button>
<button
class=
"record-button"
@
click=
"toSign"
>
重签
</button>
</div>
</div>
<button
class=
"record-button ml-10"
@
click=
"onSyncData"
>
数据同步
</button>
</view>
</view>
</view>
</view>
</view>
</view>
...
@@ -285,6 +288,7 @@ export default {
...
@@ -285,6 +288,7 @@ export default {
getRoomList
()
{
getRoomList
()
{
return
assRoomApi
.
selectRoomList
(
1
).
then
((
res
)
=>
{
return
assRoomApi
.
selectRoomList
(
1
).
then
((
res
)
=>
{
console
.
log
(
"机房列表"
,
res
);
console
.
log
(
"机房列表"
,
res
);
console
.
log
(
"机房列表"
,
JSON
.
stringify
(
res
));
return
res
;
return
res
;
});
});
},
},
...
@@ -593,6 +597,9 @@ export default {
...
@@ -593,6 +597,9 @@ export default {
urls
:
images
,
urls
:
images
,
});
});
},
},
onSyncData
()
{
console
.
log
(
this
.
uid
);
},
},
},
};
};
</
script
>
</
script
>
...
...
编写
预览
Markdown
格式
0%
重试
或
添加新文件
添加附件
取消
您添加了
0
人
到此讨论。请谨慎行事。
请先完成此评论的编辑!
取消
请
注册
或者
登录
后发表评论