This commit is contained in:
zpc 2026-01-04 22:03:39 +08:00
parent 36eef8189d
commit 5ab8050a43
3 changed files with 92 additions and 3 deletions

View File

@ -3,8 +3,8 @@ import {
post
} from "./request";
// var base_url = "https://camera.api.suigongxj.top/";
var base_url = "https://watermarkcamera.api.zpc-xy.com/";
var base_url = "https://camera.api.suigongxj.top/";
// var base_url = "https://watermarkcamera.api.zpc-xy.com/";
export const getBaseUrl = () => {
return base_url;
}

View File

@ -53,7 +53,8 @@
"NSPhotoLibraryAddUsageDescription" : "需要访问相册以保存水印图片",
"NSPhotoLibraryUsageDescription" : "需要访问相册以保存水印图片",
"NSLocationWhenInUseUsageDescription" : "定位工作人员位置"
}
},
"dSYMs" : false
},
/* SDK */
"sdkConfigs" : {

View File

@ -575,6 +575,89 @@ const handleShareImages = async () => {
};
// #endif
// #ifdef APP-PLUS
// App
const handleShareImages = async () => {
if (imageList.value.length === 0) {
uni.showToast({
title: '没有可分享的图片',
icon: 'none'
});
return;
}
if (isSubmitting.value) {
return;
}
isSubmitting.value = true;
try {
uni.showLoading({
title: '准备分享...',
});
//
await refreshAllWatermarks();
//
const imagePaths = imageList.value.map(img => img.watermark);
//
let shareText = '';
if (workContent.value) {
shareText += `工作内容:${workContent.value}\n`;
}
if (locationInfo.value) {
shareText += `位置:${locationInfo.value}\n`;
}
if (departments.value[deptIndex.value] && deptIndex.value > 0) {
shareText += `部门:${departments.value[deptIndex.value]}\n`;
}
const validWorkers = workers.value.filter(w => w.trim() !== '');
if (validWorkers.length > 0) {
shareText += `施工人员:${validWorkers.join('、')}\n`;
}
shareText += `${imagePaths.length} 张照片`;
uni.hideLoading();
// 使 plus.share
plus.share.sendWithSystem({
type: 'image',
pictures: imagePaths,
content: shareText
}, () => {
console.log('分享成功');
uni.showToast({
title: '分享成功',
icon: 'success'
});
}, (err) => {
console.error('分享失败:', err);
//
if (err.code !== -2) {
uni.showToast({
title: '分享失败',
icon: 'none'
});
}
});
} catch (error) {
console.error('分享失败:', error);
uni.hideLoading();
uni.showToast({
title: '分享失败',
icon: 'none'
});
} finally {
setTimeout(() => {
isSubmitting.value = false;
}, 500);
}
};
// #endif
//
const handleComboxSelect = async (value) => {
console.log("选择的工作内容:", value);
@ -1001,6 +1084,11 @@ onLoad(async () => {
}
// #endif
// #ifdef APP-PLUS
// App
canShare.value = true;
// #endif
try {
const config = await getConfig();
console.log("配置", config);