|
|
@ -29,7 +29,7 @@ |
|
|
<!-- <view style="padding: 15rpx 0 0 5rpx;line-height: 1.6;font-size: 30rpx;color: #7F7F7F;">{{v.content}}</view>--> |
|
|
<!-- <view style="padding: 15rpx 0 0 5rpx;line-height: 1.6;font-size: 30rpx;color: #7F7F7F;">{{v.content}}</view>--> |
|
|
<!-- </view>--> |
|
|
<!-- </view>--> |
|
|
<view class="list_box"> |
|
|
<view class="list_box"> |
|
|
<view class="ul"> |
|
|
<!-- <view class="ul"> |
|
|
<view class="li"> |
|
|
<view class="li"> |
|
|
<view class="li_title">坐位体前屈</view> |
|
|
<view class="li_title">坐位体前屈</view> |
|
|
<view class="li_content">测试结果:{{surveyInfo.seated_forward_bend}}</view> |
|
|
<view class="li_content">测试结果:{{surveyInfo.seated_forward_bend}}</view> |
|
|
@ -79,6 +79,9 @@ |
|
|
<view class="li_title">十米往返跑</view> |
|
|
<view class="li_title">十米往返跑</view> |
|
|
<view class="li_content">测试结果:{{surveyInfo.ten_meter_shuttle_run}}</view> |
|
|
<view class="li_content">测试结果:{{surveyInfo.ten_meter_shuttle_run}}</view> |
|
|
</view> |
|
|
</view> |
|
|
|
|
|
</view> --> |
|
|
|
|
|
<view v-for="(item,index) in surveyInfo.physical_test_report"> |
|
|
|
|
|
<view style="color: blue;" @click="previewFile(item)">{{surveyInfo.created_at}}体测报告{{index}}</view> |
|
|
</view> |
|
|
</view> |
|
|
</view> |
|
|
</view> |
|
|
</view> |
|
|
</view> |
|
|
@ -123,6 +126,51 @@ |
|
|
} |
|
|
} |
|
|
this.surveyInfo = res.data |
|
|
this.surveyInfo = res.data |
|
|
}, |
|
|
}, |
|
|
|
|
|
|
|
|
|
|
|
async previewFile(url) { |
|
|
|
|
|
|
|
|
|
|
|
console.log(url) |
|
|
|
|
|
|
|
|
|
|
|
try { |
|
|
|
|
|
// 1. 下载文件到本地 |
|
|
|
|
|
const { |
|
|
|
|
|
tempFilePath |
|
|
|
|
|
} = await this.downloadFile(url); |
|
|
|
|
|
|
|
|
|
|
|
// 2. 打开文件 |
|
|
|
|
|
await uni.openDocument({ |
|
|
|
|
|
filePath: tempFilePath, |
|
|
|
|
|
showMenu: true, |
|
|
|
|
|
success: () => { |
|
|
|
|
|
console.log('打开文档成功'); |
|
|
|
|
|
} |
|
|
|
|
|
}); |
|
|
|
|
|
} catch (err) { |
|
|
|
|
|
uni.showToast({ |
|
|
|
|
|
title: '预览失败', |
|
|
|
|
|
icon: 'none' |
|
|
|
|
|
}); |
|
|
|
|
|
console.error('预览失败:', err); |
|
|
|
|
|
} |
|
|
|
|
|
}, |
|
|
|
|
|
downloadFile(url) { |
|
|
|
|
|
return new Promise((resolve, reject) => { |
|
|
|
|
|
uni.downloadFile({ |
|
|
|
|
|
url, |
|
|
|
|
|
success: (res) => { |
|
|
|
|
|
if (res.statusCode === 200) { |
|
|
|
|
|
resolve(res); |
|
|
|
|
|
} else { |
|
|
|
|
|
reject(new Error('下载失败')); |
|
|
|
|
|
} |
|
|
|
|
|
}, |
|
|
|
|
|
fail: (err) => { |
|
|
|
|
|
reject(err); |
|
|
|
|
|
} |
|
|
|
|
|
}); |
|
|
|
|
|
}); |
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
} |
|
|
} |
|
|
} |
|
|
} |
|
|
</script> |
|
|
</script> |
|
|
@ -207,8 +255,9 @@ |
|
|
|
|
|
|
|
|
.list_box{ |
|
|
.list_box{ |
|
|
font-size: 30rpx; |
|
|
font-size: 30rpx; |
|
|
text-align: center; |
|
|
// text-align: center; |
|
|
margin-top: 120rpx; |
|
|
margin-left: 50rpx; |
|
|
|
|
|
margin-top: 20rpx; |
|
|
.ul{ |
|
|
.ul{ |
|
|
padding: 0 20rpx; |
|
|
padding: 0 20rpx; |
|
|
display: flex; |
|
|
display: flex; |
|
|
|