|
@@ -24,7 +24,7 @@
|
|
|
附件
|
|
|
</view>
|
|
|
<view style="margin-bottom: 30rpx;" v-for="v in content.fjFiles" :key="v.fileId">
|
|
|
- <u--text :lines="1" size="15" color="#2979FF" decoration="underline" :text="v.name" @click="downLoad(v.path)"></u--text>
|
|
|
+ <u--text :lines="1" size="15" color="#2979FF" decoration="underline" :text="v.name" @click="downLoad(v)"></u--text>
|
|
|
</view>
|
|
|
</view>
|
|
|
</view>
|
|
@@ -44,7 +44,7 @@
|
|
|
},
|
|
|
methods: {
|
|
|
getNewsContent(id){
|
|
|
- uni.$u.http.get('/oa/article/'+id).then(res=>{
|
|
|
+ uni.$u.http.get('/oa/article/detail/'+id).then(res=>{
|
|
|
// console.log(res)
|
|
|
this.content = res.data
|
|
|
uni.setNavigationBarTitle({
|
|
@@ -58,43 +58,84 @@
|
|
|
uni.showLoading({
|
|
|
title:"打开中...",
|
|
|
})
|
|
|
- if(that.list1.indexOf(v) == -1){
|
|
|
- uni.downloadFile({
|
|
|
- url:getApp().globalData.saveUrl+v,
|
|
|
- success: function(res) {
|
|
|
- if (res.statusCode === 200) {
|
|
|
- that.list1.push(v)
|
|
|
- that.list2.push(res.tempFilePath)
|
|
|
- uni.openDocument({
|
|
|
- filePath: res.tempFilePath,
|
|
|
- success: function (qwe) {
|
|
|
- uni.hideLoading();
|
|
|
+ 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'
|
|
|
+ })
|
|
|
}
|
|
|
- });
|
|
|
- }else{
|
|
|
- uni.hideLoading()
|
|
|
- uni.showToast({
|
|
|
- title:"下载失败",
|
|
|
+ },fail:function(){
|
|
|
+ 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{
|
|
|
- uni.openDocument({
|
|
|
- filePath: that.list2[that.list1.indexOf(v)],
|
|
|
- success: function (res) {
|
|
|
- uni.hideLoading();
|
|
|
- }
|
|
|
- });
|
|
|
+ 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();
|
|
|
+ }
|
|
|
+ });
|
|
|
+ }
|
|
|
}
|
|
|
|
|
|
+
|
|
|
}
|
|
|
}
|
|
|
}
|