修改工作区下载逻辑;云端文件夹基本功能已完成。
This commit is contained in:
@@ -394,6 +394,31 @@
|
||||
font-weight: 500;
|
||||
}
|
||||
|
||||
.team-info {
|
||||
margin-top: 14rpx;
|
||||
display: flex;
|
||||
align-items: center;
|
||||
flex-wrap: wrap;
|
||||
gap: 12rpx;
|
||||
}
|
||||
|
||||
.team-type-tag {
|
||||
font-size: 22rpx;
|
||||
color: #3b86ff;
|
||||
background: rgba(59, 134, 255, 0.1);
|
||||
padding: 6rpx 16rpx;
|
||||
border-radius: 8rpx;
|
||||
font-weight: 500;
|
||||
}
|
||||
|
||||
.team-desc-text {
|
||||
font-size: 24rpx;
|
||||
color: #999;
|
||||
line-height: 1.5;
|
||||
flex: 1;
|
||||
min-width: 0;
|
||||
}
|
||||
|
||||
.select-team-tip {
|
||||
padding: 80rpx 0;
|
||||
}
|
||||
@@ -595,6 +620,11 @@
|
||||
background: rgba(59, 134, 255, 0.1);
|
||||
}
|
||||
|
||||
.member-role.member {
|
||||
color: #67c23a;
|
||||
background: rgba(103, 194, 58, 0.1);
|
||||
}
|
||||
|
||||
.member-actions-right {
|
||||
display: flex;
|
||||
gap: 8rpx;
|
||||
@@ -611,6 +641,11 @@
|
||||
border: 1rpx solid #3b86ff;
|
||||
}
|
||||
|
||||
.demote-admin {
|
||||
color: #e6a23c;
|
||||
border: 1rpx solid #e6a23c;
|
||||
}
|
||||
|
||||
.remove-member {
|
||||
color: #f56c6c;
|
||||
border: 1rpx solid #f56c6c;
|
||||
@@ -645,6 +680,88 @@
|
||||
padding: 14rpx 32rpx;
|
||||
}
|
||||
|
||||
/* 搜索结果列表 */
|
||||
.search-result-list {
|
||||
margin-top: 16rpx;
|
||||
border-radius: 14rpx;
|
||||
overflow: hidden;
|
||||
background: #f8f9fc;
|
||||
}
|
||||
|
||||
.search-result-item {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
padding: 18rpx 20rpx;
|
||||
border-bottom: 1rpx solid #eee;
|
||||
}
|
||||
|
||||
.search-result-item:last-child {
|
||||
border-bottom: none;
|
||||
}
|
||||
|
||||
.search-result-item:active {
|
||||
background: rgba(59, 134, 255, 0.05);
|
||||
}
|
||||
|
||||
.result-avatar {
|
||||
width: 64rpx;
|
||||
height: 64rpx;
|
||||
border-radius: 50%;
|
||||
flex-shrink: 0;
|
||||
margin-right: 16rpx;
|
||||
}
|
||||
|
||||
.result-default-avatar {
|
||||
width: 64rpx;
|
||||
height: 64rpx;
|
||||
border-radius: 50%;
|
||||
background: linear-gradient(135deg, #3b86ff, #6db3ff);
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
flex-shrink: 0;
|
||||
margin-right: 16rpx;
|
||||
}
|
||||
|
||||
.result-info {
|
||||
flex: 1;
|
||||
min-width: 0;
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
gap: 4rpx;
|
||||
}
|
||||
|
||||
.result-name {
|
||||
font-size: 28rpx;
|
||||
color: #333;
|
||||
font-weight: 500;
|
||||
}
|
||||
|
||||
.result-email {
|
||||
font-size: 22rpx;
|
||||
color: #999;
|
||||
overflow: hidden;
|
||||
text-overflow: ellipsis;
|
||||
white-space: nowrap;
|
||||
}
|
||||
|
||||
.result-add-btn {
|
||||
flex-shrink: 0;
|
||||
font-size: 24rpx;
|
||||
color: #3b86ff;
|
||||
padding: 10rpx 24rpx;
|
||||
border: 1rpx solid #3b86ff;
|
||||
border-radius: 20rpx;
|
||||
}
|
||||
|
||||
.search-empty {
|
||||
margin-top: 16rpx;
|
||||
text-align: center;
|
||||
font-size: 24rpx;
|
||||
color: #bbb;
|
||||
padding: 20rpx 0;
|
||||
}
|
||||
|
||||
.folder-null {
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
@@ -661,9 +778,76 @@
|
||||
color: #ddd;
|
||||
}
|
||||
|
||||
/* 删除团队 */
|
||||
.delete-team-section {
|
||||
border-top: 1rpx solid #eee;
|
||||
padding-top: 20rpx;
|
||||
margin-top: 10rpx;
|
||||
}
|
||||
|
||||
.delete-team-btn {
|
||||
text-align: center;
|
||||
padding: 18rpx;
|
||||
font-size: 26rpx;
|
||||
color: #e74c3c;
|
||||
background: rgba(231, 76, 60, 0.06);
|
||||
border-radius: 14rpx;
|
||||
border: 1rpx solid rgba(231, 76, 60, 0.2);
|
||||
}
|
||||
|
||||
.delete-team-btn:active {
|
||||
background: rgba(231, 76, 60, 0.12);
|
||||
}
|
||||
|
||||
/* 修改团队信息 */
|
||||
.edit-team-section {
|
||||
border-top: 1rpx solid #eee;
|
||||
padding-top: 20rpx;
|
||||
margin-top: 10rpx;
|
||||
}
|
||||
|
||||
.edit-team-btn {
|
||||
text-align: center;
|
||||
padding: 18rpx;
|
||||
font-size: 26rpx;
|
||||
color: #3b86ff;
|
||||
background: rgba(59, 134, 255, 0.06);
|
||||
border-radius: 14rpx;
|
||||
border: 1rpx solid rgba(59, 134, 255, 0.2);
|
||||
}
|
||||
|
||||
.edit-team-btn:active {
|
||||
background: rgba(59, 134, 255, 0.12);
|
||||
}
|
||||
|
||||
.edit-team-form {
|
||||
margin-bottom: 10rpx;
|
||||
}
|
||||
|
||||
.form-label {
|
||||
font-size: 26rpx;
|
||||
color: #666;
|
||||
margin-bottom: 8rpx;
|
||||
margin-top: 18rpx;
|
||||
}
|
||||
|
||||
.text-btn {
|
||||
padding: 8rpx 20rpx;
|
||||
border-radius: 30rpx;
|
||||
font-size: 14px;
|
||||
font-weight: 500;
|
||||
}
|
||||
|
||||
/* ===== 上传文件弹窗 ===== */
|
||||
.upload-path-label {
|
||||
font-size: 26rpx;
|
||||
color: #666;
|
||||
margin-bottom: 10rpx;
|
||||
}
|
||||
|
||||
.upload-path-hint {
|
||||
font-size: 22rpx;
|
||||
color: #999;
|
||||
margin-bottom: 20rpx;
|
||||
text-align: center;
|
||||
}
|
||||
File diff suppressed because it is too large
Load Diff
@@ -317,28 +317,13 @@
|
||||
|
||||
uni.downloadFile({
|
||||
url: downloadUrl,
|
||||
name: fileName, // 重要:指定文件名,保证打开正常
|
||||
name: fileName,
|
||||
success: (downloadRes) => {
|
||||
uni.hideLoading();
|
||||
if (downloadRes.statusCode === 200) {
|
||||
// 下载成功 → 直接打开文件
|
||||
uni.openDocument({
|
||||
filePath: downloadRes.tempFilePath,
|
||||
showMenu: true, // 右上角显示 分享/保存 按钮
|
||||
success: () => {
|
||||
uni.showToast({
|
||||
title: '打开成功',
|
||||
icon: 'success'
|
||||
});
|
||||
},
|
||||
fail: (err) => {
|
||||
console.error('打开失败:', err);
|
||||
uni.showToast({
|
||||
title: '无法打开此文件',
|
||||
icon: 'error'
|
||||
});
|
||||
}
|
||||
});
|
||||
const tempPath = downloadRes.tempFilePath;
|
||||
// 下载成功,保存到 yxd 目录
|
||||
saveFileToYxd(fileName, tempPath);
|
||||
} else {
|
||||
uni.showToast({ title: '下载失败', icon: 'error' });
|
||||
}
|
||||
@@ -356,6 +341,133 @@
|
||||
}
|
||||
};
|
||||
|
||||
// 将下载的文件保存到外部存储 yxd 目录
|
||||
const saveFileToYxd = (fileName, tempPath) => {
|
||||
// #ifdef APP-PLUS
|
||||
// App 端:复制文件到 /storage/emulated/0/yxd/
|
||||
const YXD_PATH = '/storage/emulated/0/yxd/';
|
||||
|
||||
const ensureYxdDir = (callback) => {
|
||||
plus.io.resolveLocalFileSystemURL(YXD_PATH, (dirEntry) => {
|
||||
callback(dirEntry);
|
||||
}, () => {
|
||||
plus.io.resolveLocalFileSystemURL('/storage/emulated/0/', (rootEntry) => {
|
||||
rootEntry.getDirectory('yxd', { create: true }, (dirEntry) => {
|
||||
callback(dirEntry);
|
||||
}, (err) => {
|
||||
console.error('创建 yxd 目录失败:', JSON.stringify(err));
|
||||
uni.showToast({ title: '创建目录失败', icon: 'error' });
|
||||
openFileConfirm(fileName, tempPath);
|
||||
});
|
||||
}, (err) => {
|
||||
console.error('访问外部存储根目录失败:', JSON.stringify(err));
|
||||
uni.showToast({ title: '无法访问存储目录', icon: 'error' });
|
||||
openFileConfirm(fileName, tempPath);
|
||||
});
|
||||
});
|
||||
};
|
||||
|
||||
ensureYxdDir((yxdDirEntry) => {
|
||||
plus.io.resolveLocalFileSystemURL(tempPath, (fileEntry) => {
|
||||
fileEntry.copyTo(
|
||||
yxdDirEntry,
|
||||
fileName,
|
||||
() => {
|
||||
const targetPath = YXD_PATH + fileName;
|
||||
console.log('文件已保存到:', targetPath);
|
||||
openFileConfirm(fileName, targetPath);
|
||||
},
|
||||
(err) => {
|
||||
console.error('复制文件失败:', JSON.stringify(err));
|
||||
openFileConfirm(fileName, tempPath);
|
||||
}
|
||||
);
|
||||
}, (err) => {
|
||||
console.error('读取临时文件失败:', JSON.stringify(err));
|
||||
openFileConfirm(fileName, tempPath);
|
||||
});
|
||||
});
|
||||
// #endif
|
||||
// #ifndef APP-PLUS
|
||||
uni.saveFile({
|
||||
tempFilePath: tempPath,
|
||||
success: (saveRes) => {
|
||||
openFileConfirm(fileName, saveRes.savedFilePath);
|
||||
},
|
||||
fail: () => {
|
||||
openFileConfirm(fileName, tempPath);
|
||||
}
|
||||
});
|
||||
// #endif
|
||||
};
|
||||
|
||||
// 下载成功后确认是否打开文件
|
||||
const openFileConfirm = (fileName, filePath) => {
|
||||
uni.showActionSheet({
|
||||
title: `${fileName} 下载完成`,
|
||||
itemList: ['打开文件', '选择其他应用打开', '仅保存'],
|
||||
success: (res) => {
|
||||
switch (res.tapIndex) {
|
||||
case 0:
|
||||
openFile(filePath);
|
||||
break;
|
||||
case 1:
|
||||
openFileWithMenu(filePath);
|
||||
break;
|
||||
case 2:
|
||||
uni.showToast({
|
||||
title: '文件已保存到 yxd 目录',
|
||||
icon: 'success'
|
||||
});
|
||||
break;
|
||||
}
|
||||
},
|
||||
fail: () => {
|
||||
uni.showToast({
|
||||
title: '文件已保存到 yxd 目录',
|
||||
icon: 'success'
|
||||
});
|
||||
}
|
||||
});
|
||||
};
|
||||
|
||||
// 使用系统默认应用打开
|
||||
const openFile = (filePath) => {
|
||||
uni.openDocument({
|
||||
filePath: filePath,
|
||||
success: () => uni.showToast({
|
||||
title: '打开成功',
|
||||
icon: 'success'
|
||||
}),
|
||||
fail: (err) => {
|
||||
console.error('打开文件失败:', err);
|
||||
uni.showToast({
|
||||
title: '无法打开此文件',
|
||||
icon: 'error'
|
||||
});
|
||||
}
|
||||
});
|
||||
};
|
||||
|
||||
// 选择其他应用打开
|
||||
const openFileWithMenu = (filePath) => {
|
||||
uni.openDocument({
|
||||
filePath: filePath,
|
||||
showMenu: true,
|
||||
success: () => uni.showToast({
|
||||
title: '打开成功',
|
||||
icon: 'success'
|
||||
}),
|
||||
fail: (err) => {
|
||||
console.error('打开文件失败:', err);
|
||||
uni.showToast({
|
||||
title: '无法打开此文件',
|
||||
icon: 'error'
|
||||
});
|
||||
}
|
||||
});
|
||||
};
|
||||
|
||||
// 删除
|
||||
const handleDelete = (folder) => {
|
||||
uni.showModal({
|
||||
|
||||
Reference in New Issue
Block a user