|
@@ -55,84 +55,90 @@
|
|
|
//下载附件
|
|
|
downLoad(v){
|
|
|
let that = this
|
|
|
- uni.showLoading({
|
|
|
- title:"打开中...",
|
|
|
- })
|
|
|
+ // uni.showLoading({
|
|
|
+ // title:"打开中...",
|
|
|
+ // })
|
|
|
if(v.path == null){
|
|
|
let qaz = v.url.slice(10).replace(/[\\]/g,'/')
|
|
|
- if(that.list1.indexOf(v.url.slice(10)) == -1){
|
|
|
- uni.downloadFile({
|
|
|
- url:getApp().globalData.updateUrl+qaz,
|
|
|
- success: function(res) {
|
|
|
- if (res.statusCode === 200) {
|
|
|
- that.list1.push(v.url.slice(10))
|
|
|
- that.list2.push(res.tempFilePath)
|
|
|
- uni.openDocument({
|
|
|
- filePath: res.tempFilePath,
|
|
|
- success: function (qwe) {
|
|
|
- uni.hideLoading();
|
|
|
- }
|
|
|
- });
|
|
|
- }else{
|
|
|
- uni.hideLoading()
|
|
|
- uni.showToast({
|
|
|
- title:"下载失败",
|
|
|
- icon:'none'
|
|
|
- })
|
|
|
- }
|
|
|
- },fail:function(){
|
|
|
- uni.hideLoading()
|
|
|
- uni.showToast({
|
|
|
- title:"下载失败",
|
|
|
- icon:'none'
|
|
|
- })
|
|
|
- }
|
|
|
- });
|
|
|
- }else{
|
|
|
- uni.openDocument({
|
|
|
- filePath: that.list2[that.list1.indexOf(v.url.slice(10))],
|
|
|
- success: function (res) {
|
|
|
- uni.hideLoading();
|
|
|
- }
|
|
|
- });
|
|
|
- }
|
|
|
+ uni.navigateTo({
|
|
|
+ url:"/pages/office/office?url="+getApp().globalData.updateUrl+qaz
|
|
|
+ })
|
|
|
+ // if(that.list1.indexOf(v.url.slice(10)) == -1){
|
|
|
+ // uni.downloadFile({
|
|
|
+ // url:getApp().globalData.updateUrl+qaz,
|
|
|
+ // success: function(res) {
|
|
|
+ // if (res.statusCode === 200) {
|
|
|
+ // that.list1.push(v.url.slice(10))
|
|
|
+ // that.list2.push(res.tempFilePath)
|
|
|
+ // uni.openDocument({
|
|
|
+ // filePath: res.tempFilePath,
|
|
|
+ // success: function (qwe) {
|
|
|
+ // uni.hideLoading();
|
|
|
+ // }
|
|
|
+ // });
|
|
|
+ // }else{
|
|
|
+ // uni.hideLoading()
|
|
|
+ // uni.showToast({
|
|
|
+ // title:"下载失败",
|
|
|
+ // icon:'none'
|
|
|
+ // })
|
|
|
+ // }
|
|
|
+ // },fail:function(){
|
|
|
+ // uni.hideLoading()
|
|
|
+ // uni.showToast({
|
|
|
+ // title:"下载失败",
|
|
|
+ // icon:'none'
|
|
|
+ // })
|
|
|
+ // }
|
|
|
+ // });
|
|
|
+ // }else{
|
|
|
+ // uni.openDocument({
|
|
|
+ // filePath: that.list2[that.list1.indexOf(v.url.slice(10))],
|
|
|
+ // success: function (res) {
|
|
|
+ // uni.hideLoading();
|
|
|
+ // }
|
|
|
+ // });
|
|
|
+ // }
|
|
|
}else{
|
|
|
- if(that.list1.indexOf(v.path) == -1){
|
|
|
- uni.downloadFile({
|
|
|
- url:getApp().globalData.saveUrl+v.path,
|
|
|
- success: function(res) {
|
|
|
- if (res.statusCode === 200) {
|
|
|
- that.list1.push(v.path)
|
|
|
- that.list2.push(res.tempFilePath)
|
|
|
- uni.openDocument({
|
|
|
- filePath: res.tempFilePath,
|
|
|
- success: function (qwe) {
|
|
|
- uni.hideLoading();
|
|
|
- }
|
|
|
- });
|
|
|
- }else{
|
|
|
- uni.hideLoading()
|
|
|
- uni.showToast({
|
|
|
- title:"下载失败",
|
|
|
- icon:'none'
|
|
|
- })
|
|
|
- }
|
|
|
- },fail:function(){
|
|
|
- uni.hideLoading()
|
|
|
- uni.showToast({
|
|
|
- title:"下载失败",
|
|
|
- icon:'none'
|
|
|
- })
|
|
|
- }
|
|
|
- });
|
|
|
- }else{
|
|
|
- uni.openDocument({
|
|
|
- filePath: that.list2[that.list1.indexOf(v.path)],
|
|
|
- success: function (res) {
|
|
|
- uni.hideLoading();
|
|
|
- }
|
|
|
- });
|
|
|
- }
|
|
|
+ uni.navigateTo({
|
|
|
+ url:"/pages/office/office?url="+getApp().globalData.saveUrl+v.path
|
|
|
+ })
|
|
|
+ // if(that.list1.indexOf(v.path) == -1){
|
|
|
+ // uni.downloadFile({
|
|
|
+ // url:getApp().globalData.saveUrl+v.path,
|
|
|
+ // success: function(res) {
|
|
|
+ // if (res.statusCode === 200) {
|
|
|
+ // that.list1.push(v.path)
|
|
|
+ // that.list2.push(res.tempFilePath)
|
|
|
+ // uni.openDocument({
|
|
|
+ // filePath: res.tempFilePath,
|
|
|
+ // success: function (qwe) {
|
|
|
+ // uni.hideLoading();
|
|
|
+ // }
|
|
|
+ // });
|
|
|
+ // }else{
|
|
|
+ // uni.hideLoading()
|
|
|
+ // uni.showToast({
|
|
|
+ // title:"下载失败",
|
|
|
+ // icon:'none'
|
|
|
+ // })
|
|
|
+ // }
|
|
|
+ // },fail:function(){
|
|
|
+ // uni.hideLoading()
|
|
|
+ // uni.showToast({
|
|
|
+ // title:"下载失败",
|
|
|
+ // icon:'none'
|
|
|
+ // })
|
|
|
+ // }
|
|
|
+ // });
|
|
|
+ // }else{
|
|
|
+ // uni.openDocument({
|
|
|
+ // filePath: that.list2[that.list1.indexOf(v.path)],
|
|
|
+ // success: function (res) {
|
|
|
+ // uni.hideLoading();
|
|
|
+ // }
|
|
|
+ // });
|
|
|
+ // }
|
|
|
}
|
|
|
|
|
|
|