shenbaoDetail.vue 3.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150
  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.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.total_time" class="nav">
  18. <iframe :src="uploadPdf" frameborder="0" class="iframe"></iframe>
  19. </div>
  20. <div v-if="!msg.extra.total_time" 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. if(options.id){
  43. app.request('/examine/examine-detail',{examine_question_id:options.id},'post').then(res=>{
  44. console.log(res)
  45. var msg = res.data.data
  46. if(msg instanceof Array){
  47. this.msg = res.data.data[0]
  48. }else{
  49. this.msg = res.data.data
  50. }
  51. console.log(this.msg)
  52. var obj = this.msg.extra.resource_ids[0]
  53. // var arr = Object.values(obj);
  54. this.uploadPdf = obj
  55. })
  56. }else{
  57. this.uploadPdf = options.url
  58. }
  59. },
  60. methods: {
  61. backLast(){
  62. uni.navigateBack()
  63. },
  64. tabbar(index){
  65. this.index = index
  66. console.log(index)
  67. if(index==0){
  68. this.uploadPdf = this.msg.extra.resource_ids[0]
  69. }else{
  70. this.uploadPdf = this.msg.extra.prove_files[0]
  71. }
  72. }
  73. }
  74. }
  75. </script>
  76. <style lang="scss">
  77. .nav{
  78. width: 100%;
  79. height: 100%;
  80. position: fixed;
  81. z-index: 222;
  82. top: 200upx;
  83. left: 0;
  84. iframe{
  85. width: 100%;
  86. height: 100%;
  87. }
  88. }
  89. .nav1{
  90. width: 100%;
  91. height: 100%;
  92. position: fixed;
  93. z-index: 222;
  94. top: 100upx;
  95. left: 0;
  96. iframe{
  97. width: 100%;
  98. height: 100%;
  99. }
  100. }
  101. .tabbar{
  102. width: 100%;
  103. height: 100upx;
  104. position: fixed;
  105. z-index: 222;
  106. top: 100upx;
  107. left: 0;
  108. display: flex;
  109. align-items: center;
  110. border: 1upx solid #EFF1F6;
  111. view{
  112. width: 50%;
  113. display: flex;
  114. align-items: center;
  115. justify-content: center;
  116. height: 100%;
  117. color: black;
  118. }
  119. .active{
  120. color: blue;
  121. }
  122. }
  123. .navbar {
  124. font-size: 32upx;
  125. height: 100upx;
  126. line-height: 100upx;
  127. color: #888888;
  128. position: relative;
  129. position: fixed;
  130. top: 0;
  131. z-index: 9999999;
  132. width: 100%;
  133. background-color: #FFFFFF;
  134. text-align: center;
  135. border-bottom: solid 2upx #EFF1F6;
  136. .back {
  137. height: 100upx;
  138. width: 100upx;
  139. text-align: center;
  140. // background-color: #007AFF;
  141. position: absolute;
  142. float: left;
  143. left: 0upx;
  144. font-size: 32upx;
  145. }
  146. }
  147. </style>