shenbaoDetail.vue 3.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164
  1. <template>
  2. <view class="">
  3. <view class="navbar">
  4. <view class="back">
  5. <text class="iconfont icon-fanhui " @click="backLast()"></text>
  6. </view>
  7. <text>查看申报</text>
  8. </view>
  9. <view class="tabbar" v-if="msg.extra && msg.extra.total_time">
  10. <view @click="tabbar(0)" :class="index==0 ? 'active' : ''">
  11. <text>附件</text>
  12. </view>
  13. <view @click="tabbar(1)" :class="index==1 ? 'active' : ''">
  14. <text>证明材料</text>
  15. </view>
  16. </view>
  17. <div v-if=" msg.extra && msg.extra.total_time" class="nav">
  18. <iframe :src="uploadPdf" frameborder="0" class="iframe"></iframe>
  19. </div>
  20. <div v-else class="nav1">
  21. <iframe :src="uploadPdf" frameborder="0" class="iframe"></iframe>
  22. </div>
  23. </view>
  24. </view>
  25. </template>
  26. <script>
  27. var app = getApp()
  28. import navBar from '../../components/navBar/navbar.vue';
  29. import configData from '../../config.js'
  30. export default {
  31. data() {
  32. return {
  33. msg: '',
  34. uploadPdf: '',
  35. index: 0
  36. }
  37. },
  38. components: {
  39. navBar
  40. },
  41. onLoad(options) {
  42. console.log(options)
  43. if (options.id) {
  44. app.request('/examine/examine-detail', {
  45. examine_question_id: options.id
  46. }, 'post').then(res => {
  47. console.log(res,'res')
  48. var msg = res.data.data
  49. if (msg instanceof Array) {
  50. this.msg = res.data.data[0]
  51. } else {
  52. this.msg = res.data.data
  53. }
  54. console.log(this.msg)
  55. var obj = this.msg.resources
  56. var arr = Object.values(obj);
  57. this.uploadPdf = arr[0]
  58. console.log(this.uploadPdf)
  59. })
  60. }
  61. if(options.url){
  62. this.uploadPdf = options.url
  63. }
  64. },
  65. methods: {
  66. backLast() {
  67. uni.navigateBack()
  68. },
  69. tabbar(index) {
  70. this.index = index
  71. console.log(index)
  72. if (index == 0) {
  73. var obj = this.msg.resources
  74. var arr = Object.values(obj);
  75. this.uploadPdf = arr[0]
  76. } else {
  77. this.uploadPdf = this.msg.extra.prove_files
  78. }
  79. }
  80. }
  81. }
  82. </script>
  83. <style lang="scss">
  84. .nav {
  85. width: 100%;
  86. height: 100%;
  87. position: fixed;
  88. z-index: 222;
  89. top: 200upx;
  90. left: 0;
  91. iframe {
  92. width: 100%;
  93. height: 100%;
  94. }
  95. }
  96. .nav1 {
  97. width: 100%;
  98. height: 100%;
  99. position: fixed;
  100. z-index: 222;
  101. top: 100upx;
  102. left: 0;
  103. iframe {
  104. width: 100%;
  105. height: 100%;
  106. }
  107. }
  108. .tabbar {
  109. width: 100%;
  110. height: 100upx;
  111. position: fixed;
  112. z-index: 222;
  113. top: 100upx;
  114. left: 0;
  115. display: flex;
  116. align-items: center;
  117. border: 1upx solid #EFF1F6;
  118. view {
  119. width: 50%;
  120. display: flex;
  121. align-items: center;
  122. justify-content: center;
  123. height: 100%;
  124. color: black;
  125. }
  126. .active {
  127. color: blue;
  128. }
  129. }
  130. .navbar {
  131. font-size: 32upx;
  132. height: 100upx;
  133. line-height: 100upx;
  134. color: #888888;
  135. position: relative;
  136. position: fixed;
  137. top: 0;
  138. z-index: 9999999;
  139. width: 100%;
  140. background-color: #FFFFFF;
  141. text-align: center;
  142. border-bottom: solid 2upx #EFF1F6;
  143. .back {
  144. height: 100upx;
  145. width: 100upx;
  146. text-align: center;
  147. // background-color: #007AFF;
  148. position: absolute;
  149. float: left;
  150. left: 0upx;
  151. font-size: 32upx;
  152. }
  153. }
  154. </style>