reportDetail.vue 1.3 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364
  1. <template>
  2. <view class="default_page" :style="{'min-height':h+'px', 'padding-top':mt+'px'}">
  3. <cus-header title='报告详情'></cus-header>
  4. <div class="pdf"></div>
  5. <div class="bottom">
  6. <div class="zt_btn" @click="askReport">对报告提问</div>
  7. </div>
  8. </view>
  9. </template>
  10. <script>
  11. export default {
  12. data(){
  13. return {
  14. pdfUrl:'',
  15. fileName:''
  16. }
  17. },
  18. onLoad(options) {
  19. this.pdfUrl = options.pdfUrl;
  20. this.fileName = options.fileName;
  21. this.showPdf(this.pdfUrl)
  22. },
  23. methods:{
  24. showPdf(url){
  25. wx.downloadFile({
  26. url,
  27. success: function (res) {
  28. const filePath = res.tempFilePath
  29. wx.openDocument({
  30. filePath: filePath,
  31. success: function (res) {
  32. console.log('打开文档成功')
  33. }
  34. })
  35. }
  36. })
  37. },
  38. askReport(){
  39. uni.navigateTo({
  40. url:`/pages/reportAsk?pdfUrl=${this.pdfUrl}&fileName=${this.fileName}`
  41. })
  42. }
  43. }
  44. }
  45. </script>
  46. <style scoped lang="less">
  47. .default_page{
  48. padding: 0 0 212rpx;
  49. box-sizing: border-box;
  50. .bottom{
  51. width: 100%;
  52. height: 172rpx;
  53. padding: 20rpx 50rpx 0;
  54. box-sizing: border-box;
  55. position: fixed;
  56. left: 0;
  57. bottom: 0;
  58. background: #FFFFFF;
  59. }
  60. }
  61. </style>