fix: BUG修改
This commit is contained in:
parent
ba7b0e85cd
commit
b784bd3c86
8
main.js
8
main.js
@ -38,18 +38,18 @@ if (process.env.NODE_ENV === 'development') {
|
||||
console.log('开发环境')
|
||||
// Vue.prototype.url_config = 'http://47.93.215.234:9809/' // 鞍钢正式地址(弃用)
|
||||
// Vue.prototype.url_config = 'http://42.180.188.17:9809/' // 鞍钢正式地址
|
||||
// Vue.prototype.url_config = 'http://42.180.188.17:11211/' // 鞍钢测试地址
|
||||
Vue.prototype.url_config = 'http://42.180.188.17:11211/' // 鞍钢测试地址
|
||||
// Vue.prototype.url_config = 'http://182.90.224.237:51234/' //雄哥内网穿透地址
|
||||
// Vue.prototype.url_config = 'http://jxj.zhgdyun.com:61212/' //杰哥内网穿透地址
|
||||
// Vue.prototype.url_config = ' http://192.168.34.221:28888/' //郭圣雄本地
|
||||
Vue.prototype.url_config = ' http://192.168.34.221:9111/' //郭圣雄本地
|
||||
// Vue.prototype.url_config = ' http://192.168.34.221:9111/' //郭圣雄本地
|
||||
// Vue.prototype.url_config = 'http://182.90.224.237:51234/' //郭圣雄本地
|
||||
// Vue.prototype.url_config = 'http://192.168.34.155:19111/' //彭洁本地
|
||||
// Vue.prototype.work_url = 'http://47.93.215.234:19997' // 工作流线上地址(弃用)
|
||||
// Vue.prototype.work_url = 'http://42.180.188.17:19997' // 工作流线上地址
|
||||
Vue.prototype.work_url = 'http://42.180.188.17:19097' // 工作流测试地址
|
||||
// Vue.prototype.work_url = 'http://42.180.188.17:19097' // 工作流测试地址
|
||||
// Vue.prototype.work_url = 'http://192.168.34.126:5173' // 工作流地址
|
||||
// Vue.prototype.work_url = 'http://192.168.34.138:5173' // 工作流地址
|
||||
Vue.prototype.work_url = 'http://192.168.34.138:5173' // 工作流地址
|
||||
// Vue.prototype.work_url = 'http://139.9.66.234:5173' // 工作流地址
|
||||
// Vue.prototype.work_url = 'http://192.168.34.126:5173' // 工作流地址
|
||||
// Vue.prototype.url_config = 'http://8.142.139.165:7080/' // 湖里
|
||||
|
||||
@ -220,7 +220,8 @@
|
||||
isVideoLink,
|
||||
isImageLink,
|
||||
openOutsideFile,
|
||||
openLocalFile
|
||||
openLocalFile,
|
||||
removeNetWorkFileTemp
|
||||
} from '@/utils/tool.js'
|
||||
export default {
|
||||
components:{
|
||||
@ -286,6 +287,9 @@
|
||||
})
|
||||
this.detailId = val.id
|
||||
},
|
||||
onUnload() {
|
||||
removeNetWorkFileTemp();
|
||||
},
|
||||
mounted() {
|
||||
},
|
||||
methods:{
|
||||
@ -302,6 +306,7 @@
|
||||
// 下载所有的文件
|
||||
let name = url.substring(url.lastIndexOf('/') + 1);
|
||||
console.log(name, "文件名称");
|
||||
|
||||
if (isVideoLink(url) || isImageLink(url)) {
|
||||
// 是图片和视频
|
||||
this.show = true;
|
||||
|
||||
@ -176,7 +176,8 @@
|
||||
isVideoLink,
|
||||
isImageLink,
|
||||
openOutsideFile,
|
||||
openLocalFile
|
||||
openLocalFile,
|
||||
removeNetWorkFileTemp
|
||||
} from '@/utils/tool.js'
|
||||
export default {
|
||||
components: {
|
||||
@ -242,6 +243,9 @@
|
||||
})
|
||||
this.detailId = val.id
|
||||
},
|
||||
onUnload() {
|
||||
removeNetWorkFileTemp();
|
||||
},
|
||||
mounted() {},
|
||||
methods: {
|
||||
getType(url) {
|
||||
|
||||
@ -184,7 +184,8 @@
|
||||
isVideoLink,
|
||||
isImageLink,
|
||||
openOutsideFile,
|
||||
openLocalFile
|
||||
openLocalFile,
|
||||
removeNetWorkFileTemp
|
||||
} from '@/utils/tool.js'
|
||||
export default {
|
||||
components:{
|
||||
@ -250,6 +251,9 @@
|
||||
})
|
||||
this.detailId = val.id
|
||||
},
|
||||
onUnload() {
|
||||
removeNetWorkFileTemp();
|
||||
},
|
||||
mounted() {
|
||||
},
|
||||
methods:{
|
||||
|
||||
@ -183,7 +183,8 @@
|
||||
isVideoLink,
|
||||
isImageLink,
|
||||
openOutsideFile,
|
||||
openLocalFile
|
||||
openLocalFile,
|
||||
removeNetWorkFileTemp
|
||||
} from '@/utils/tool.js'
|
||||
export default {
|
||||
components:{
|
||||
@ -249,6 +250,9 @@
|
||||
})
|
||||
this.detailId = val.id
|
||||
},
|
||||
onUnload() {
|
||||
removeNetWorkFileTemp();
|
||||
},
|
||||
mounted() {
|
||||
},
|
||||
methods:{
|
||||
|
||||
@ -183,7 +183,8 @@
|
||||
isVideoLink,
|
||||
isImageLink,
|
||||
openOutsideFile,
|
||||
openLocalFile
|
||||
openLocalFile,
|
||||
removeNetWorkFileTemp
|
||||
} from '@/utils/tool.js'
|
||||
export default {
|
||||
components:{
|
||||
@ -249,6 +250,9 @@
|
||||
})
|
||||
this.detailId = val.id
|
||||
},
|
||||
onUnload() {
|
||||
removeNetWorkFileTemp();
|
||||
},
|
||||
mounted() {
|
||||
},
|
||||
methods:{
|
||||
|
||||
@ -282,7 +282,8 @@
|
||||
isVideoLink,
|
||||
isImageLink,
|
||||
openOutsideFile,
|
||||
openLocalFile
|
||||
openLocalFile,
|
||||
removeNetWorkFileTemp
|
||||
} from '@/utils/tool.js'
|
||||
export default {
|
||||
components: {
|
||||
@ -348,6 +349,9 @@
|
||||
})
|
||||
this.detailId = val.id
|
||||
},
|
||||
onUnload() {
|
||||
removeNetWorkFileTemp();
|
||||
},
|
||||
mounted() {},
|
||||
methods: {
|
||||
getType(url) {
|
||||
|
||||
@ -192,7 +192,8 @@
|
||||
isVideoLink,
|
||||
isImageLink,
|
||||
openOutsideFile,
|
||||
openLocalFile
|
||||
openLocalFile,
|
||||
removeNetWorkFileTemp
|
||||
} from '@/utils/tool.js'
|
||||
export default {
|
||||
components:{
|
||||
@ -258,6 +259,9 @@
|
||||
})
|
||||
this.detailId = val.id
|
||||
},
|
||||
onUnload() {
|
||||
removeNetWorkFileTemp();
|
||||
},
|
||||
mounted() {
|
||||
},
|
||||
methods:{
|
||||
|
||||
@ -204,7 +204,8 @@
|
||||
isVideoLink,
|
||||
isImageLink,
|
||||
openOutsideFile,
|
||||
openLocalFile
|
||||
openLocalFile,
|
||||
removeNetWorkFileTemp
|
||||
} from '@/utils/tool.js'
|
||||
export default {
|
||||
components:{
|
||||
@ -270,6 +271,9 @@
|
||||
})
|
||||
this.detailId = val.id
|
||||
},
|
||||
onUnload() {
|
||||
removeNetWorkFileTemp();
|
||||
},
|
||||
mounted() {
|
||||
},
|
||||
methods:{
|
||||
|
||||
20
unpackage/dist/dev/app-plus/app-service.js
vendored
20
unpackage/dist/dev/app-plus/app-service.js
vendored
File diff suppressed because one or more lines are too long
@ -104,6 +104,24 @@ export function getFileImgByType(fileName) {
|
||||
const type = fileTypeMap.get(fileName.split('.').pop())
|
||||
return `/static/image/filetype/${(type || '') === '' ? 'file': type}.png`
|
||||
}
|
||||
//记录下本地文件(网络下载),方便打开的时候直接取本地
|
||||
export function saveNetWorkFileTemp(file) {
|
||||
// #ifndef H5
|
||||
let fileObj = uni.getStorageSync('localNetWorkFile')
|
||||
if (!fileObj) {
|
||||
fileObj = {}
|
||||
}
|
||||
fileObj[file.name] = file.path
|
||||
uni.setStorageSync('localNetWorkFile', fileObj)
|
||||
// #endif
|
||||
}
|
||||
|
||||
//清除下本地文件(网络下载)
|
||||
export function removeNetWorkFileTemp(name) {
|
||||
// #ifndef H5
|
||||
uni.setStorageSync('localNetWorkFile', {})
|
||||
// #endif
|
||||
}
|
||||
|
||||
//记录下本地文件,方便打开的时候直接取本地
|
||||
export function saveFileTemp(file) {
|
||||
@ -128,17 +146,16 @@ export function removeFileTemp(name) {
|
||||
|
||||
//下载并打开文件
|
||||
export function openLocalFile(name, path) {
|
||||
console.log(path)
|
||||
//除h5外其他端先看本地有没有,没有就下载到本地再打开,有就直接打开
|
||||
// #ifdef H5
|
||||
window.open(path)
|
||||
// #endif
|
||||
|
||||
// #ifndef H5
|
||||
let fileObj = uni.getStorageSync('localFile')
|
||||
let fileObj = uni.getStorageSync('localNetWorkFile')
|
||||
if (fileObj && fileObj[name]) {
|
||||
uni.openDocument({
|
||||
filePath: fileObj.path,
|
||||
filePath: fileObj[name],
|
||||
showMenu: true,
|
||||
fileType: getFileImgByType(name),
|
||||
success: function(res) {
|
||||
@ -156,37 +173,38 @@ export function openLocalFile(name, path) {
|
||||
});
|
||||
//ios中文文件名会报错,需要编码下
|
||||
let filePath = uni.getSystemInfoSync().platform === 'ios' ? res.tempFilePath : escape(res
|
||||
.tempFilePath)
|
||||
.tempFilePath);
|
||||
uni.saveFile({
|
||||
tempFilePath: filePath, //临时路径
|
||||
success: function(res) {
|
||||
uni.showToast({
|
||||
icon: 'none',
|
||||
mask: true,
|
||||
title: '保存在:' + res.savedFilePath, //保存路径
|
||||
duration: 2000,
|
||||
});
|
||||
// uni.showToast({
|
||||
// icon: 'none',
|
||||
// mask: true,
|
||||
// title: '保存在:' + res.savedFilePath, //保存路径
|
||||
// duration: 2000,
|
||||
// });
|
||||
//保存好再打开文件
|
||||
setTimeout(() => {
|
||||
uni.openDocument({
|
||||
filePath: res.savedFilePath,
|
||||
showMenu: true,
|
||||
fileType: getFileImgByType(name),
|
||||
success: function(res) {
|
||||
console.log('打开文档成功');
|
||||
}
|
||||
});
|
||||
}, 1000)
|
||||
saveNetWorkFileTemp({name: name,path: res.savedFilePath})
|
||||
// setTimeout(() => {
|
||||
// uni.openDocument({
|
||||
// filePath: res.savedFilePath,
|
||||
// showMenu: true,
|
||||
// fileType: getFileImgByType(name),
|
||||
// success: function(res) {
|
||||
// console.log('打开文档成功');
|
||||
// }
|
||||
// });
|
||||
// }, 1000)
|
||||
}
|
||||
})
|
||||
// uni.openDocument({
|
||||
// filePath: filePath,
|
||||
// showMenu: true,
|
||||
// fileType: getFileImgByType(name),
|
||||
// success: function(res) {
|
||||
// console.log('打开文档成功');
|
||||
// }
|
||||
// });
|
||||
uni.openDocument({
|
||||
filePath: filePath,
|
||||
showMenu: true,
|
||||
fileType: getFileImgByType(name),
|
||||
success: function(res) {
|
||||
console.log('打开文档成功');
|
||||
}
|
||||
});
|
||||
}
|
||||
});
|
||||
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user