|
@@ -33,13 +33,18 @@
|
|
|
<view class="title">{{item.fileName}}</view>
|
|
|
</view>
|
|
|
|
|
|
- <view class="title2" @click="downLoad(item.fileUrl)">下载</view>
|
|
|
+
|
|
|
+ <view class="title2">
|
|
|
+ <a class="table-btn" :href='item.fileUrl' target='_blank'>下载</a>
|
|
|
+ </view>
|
|
|
|
|
|
</view>
|
|
|
</view>
|
|
|
|
|
|
<view class="category">{{detailData.name}}</view>
|
|
|
|
|
|
+
|
|
|
+
|
|
|
|
|
|
</view>
|
|
|
</template>
|
|
@@ -69,48 +74,59 @@
|
|
|
// 下载文件
|
|
|
|
|
|
downLoad(urlStr) {
|
|
|
- console.log('urls', urlStr);
|
|
|
- // uni.showLoading({
|
|
|
- // title:'下载中'
|
|
|
- // })
|
|
|
-
|
|
|
- // let dload = document.createElement("a");
|
|
|
-
|
|
|
- // dload.download = '';// 设置下载的文件名,默认是'下载'
|
|
|
-
|
|
|
- // dload.href = urlStr;
|
|
|
-
|
|
|
- // document.body.appendChild(dload);
|
|
|
-
|
|
|
- // dload.click();
|
|
|
-
|
|
|
- // dload.remove(); // 下载之后把创建的元素删除
|
|
|
-
|
|
|
-
|
|
|
- // window.open(urlStr)
|
|
|
-
|
|
|
- // window.location.href='urlStr'
|
|
|
-
|
|
|
- let url = encodeURI(urlStr); //注意中文文件名的网络地址需要encodeURI
|
|
|
+ console.log('urls', urlStr);
|
|
|
+ // uni.showLoading({
|
|
|
+ // title:'下载中'
|
|
|
+ // })
|
|
|
+
|
|
|
+ // let dload = document.createElement("a");
|
|
|
+
|
|
|
+ // dload.download = '';// 设置下载的文件名,默认是'下载'
|
|
|
+
|
|
|
+ // dload.href = urlStr;
|
|
|
+
|
|
|
+ // document.body.appendChild(dload);
|
|
|
+
|
|
|
+ // dload.click();
|
|
|
+
|
|
|
+ // dload.remove(); // 下载之后把创建的元素删除
|
|
|
+
|
|
|
+
|
|
|
+ // window.open(urlStr)
|
|
|
+
|
|
|
+ // window.location.href='urlStr'
|
|
|
+
|
|
|
+ /*
|
|
|
+ let url = encodeURI(urlStr); //注意中文文件名的网络地址需要encodeURI
|
|
|
uni.downloadFile({
|
|
|
url: url,
|
|
|
- success: (res) => {
|
|
|
-
|
|
|
+ success: (res) => {
|
|
|
+
|
|
|
if (res.statusCode === 200) {
|
|
|
uni.saveFile({
|
|
|
tempFilePath: res.tempFilePath,
|
|
|
success: (resData) => {
|
|
|
uni.openDocument({
|
|
|
filePath: resData.savedFilePath,
|
|
|
+ success: (res) => console.log('成功打开文档')
|
|
|
});
|
|
|
+ console.log('bbb', res);
|
|
|
},
|
|
|
- });
|
|
|
-
|
|
|
+ fail() {
|
|
|
+ console.log('打开失败')
|
|
|
+ }
|
|
|
+ });
|
|
|
+ console.log('aaa', res);
|
|
|
}
|
|
|
+ },
|
|
|
+ fail() {
|
|
|
+ console.log('下载失败')
|
|
|
}
|
|
|
-
|
|
|
+
|
|
|
|
|
|
});
|
|
|
+ */
|
|
|
+
|
|
|
},
|
|
|
getDetailData() {
|
|
|
uni.showLoading({
|
|
@@ -300,19 +316,26 @@
|
|
|
.title {
|
|
|
font-size: 28rpx;
|
|
|
color: #333333;
|
|
|
- width: 90%;
|
|
|
+ width: 90%;
|
|
|
+ word-break:break-all;
|
|
|
}
|
|
|
|
|
|
.title2 {
|
|
|
- color: #FFFFFF;
|
|
|
- font-size: 26rpx;
|
|
|
+
|
|
|
background-color: #3F90F7;
|
|
|
border-radius: 6rpx;
|
|
|
width: 90rpx;
|
|
|
height: 52rpx;
|
|
|
line-height: 52rpx;
|
|
|
text-align: center;
|
|
|
- margin-right: 15rpx;
|
|
|
+ margin-right: 15rpx;
|
|
|
+
|
|
|
+ }
|
|
|
+
|
|
|
+ .table-btn {
|
|
|
+ color: #FFFFFF;
|
|
|
+ font-size: 26rpx;
|
|
|
+ text-decoration: none;
|
|
|
}
|
|
|
|
|
|
|