index.vue 4.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205
  1. <template>
  2. <view>
  3. <view class="status_bar"></view>
  4. <view class="" style="position: relative;top: 40px;">
  5. <view style="position: fixed;z-index: 100;">
  6. <uni-nav-bar @clickLeft="clickLeft" left-icon="back" left-text="返回" title="专家诊断"></uni-nav-bar>
  7. </view>
  8. <image :src="$imageURL+'/bigdata_app'+'/image/expertDiagnosis/05571341dbb0771b23d0b271764ac2e.png'" class="expertimages"></image>
  9. <!-- <view class="expert_details"> -->
  10. <!-- <view class="details_item" @click="worm">
  11. <image :src="$imageURL+'/bigdata_app'+'/image/expertDiagnosis/6612b1293fd1f45dd7ce6269a954999.png'"></image>
  12. <p>虫情百科</p>
  13. </view>
  14. <view class="details_item" @click="virus">
  15. <image :src="$imageURL+'/bigdata_app'+'/image/expertDiagnosis/7f34f4eeba4d00819369cfa1b5ecce8.png'"></image>
  16. <p>病害百科</p>
  17. </view> -->
  18. <!-- <view class="details_item" @click="exchange">
  19. <image :src="$imageURL+'/bigdata_app'+'/image/expertDiagnosis/aa6a168b9fb72b62b687a2debc04a9f.png'"></image>
  20. <p>交流圈</p>
  21. </view> -->
  22. <!-- </view> -->
  23. <view class="cooperation">
  24. <view class="cooperation_item">
  25. <p class="cooperation_item_title">合作单位</p>
  26. <view class="zooid">
  27. <view class="zooid_item" v-for="(item,index) in cooperation_unit" :key="index">
  28. <image :src="item.img_urls" mode=""></image>
  29. <p>{{item.name}}</p>
  30. </view>
  31. </view>
  32. </view>
  33. <view class="cooperation_item">
  34. <p class="cooperation_item_title">合作院校</p>
  35. <view class="zooid">
  36. <view class="zooid_item" v-for="(item,index) in cooperation_academy" :key="index">
  37. <image :src="item.img_urls" mode=""></image>
  38. <p>{{item.name}}</p>
  39. </view>
  40. </view>
  41. </view>
  42. <view class="cooperation_item">
  43. <p class="cooperation_item_title">合作专家</p>
  44. <view class="zooid">
  45. <view class="zooid_item" v-for="(item,index) in cooperation_specialist" :key="index">
  46. <image :src="item.img_urls" mode=""></image>
  47. <p>{{item.name}}</p>
  48. </view>
  49. </view>
  50. </view>
  51. </view>
  52. </view>
  53. </view>
  54. </template>
  55. <script>
  56. export default {
  57. data() {
  58. return {
  59. cooperation_academy: [], //合作院校信息
  60. cooperation_unit: [], //合作单位信息
  61. cooperation_specialist: [], //合作专家信息,
  62. jurisdiction:false
  63. }
  64. },
  65. methods: {
  66. async getCooperation(code) {
  67. const res = await this.$myRequest({
  68. url: '/api/api_gateway?method=pest.pests.pests_expert',
  69. data: {
  70. code: code
  71. }
  72. })
  73. console.log(res)
  74. if (code == 1) {
  75. this.cooperation_unit = res.data
  76. } else if (code == 2) {
  77. this.cooperation_academy = res.data
  78. } else if (code == 3) {
  79. this.cooperation_specialist = res.data
  80. }
  81. },
  82. clickLeft() {
  83. // uni.switchTab({
  84. // url: "../index/index"
  85. // })
  86. uni.navigateBack({
  87. delta: 1
  88. })
  89. },
  90. worm() {
  91. uni.navigateTo({
  92. url: "./wormcase?name=" + '虫情百科',
  93. });
  94. },
  95. virus() {
  96. uni.navigateTo({
  97. url: "./wormcase?name=" + '病毒百科',
  98. });
  99. },
  100. exchange() {
  101. if(this.jurisdiction){
  102. uni.navigateTo({
  103. url: "./exchangeShare"
  104. });
  105. }else{
  106. uni.showToast({
  107. title: "您暂无权限进行此操作,如有需要,请联系管理员",
  108. icon: "none"
  109. })
  110. }
  111. }
  112. },
  113. onLoad() {
  114. this.getCooperation(1)
  115. this.getCooperation(2)
  116. this.getCooperation(3)
  117. uni.getStorage({
  118. key:"jurisdiction",
  119. success:(res)=>{
  120. console.log(JSON.parse(res.data))
  121. let items = JSON.parse(res.data).filter((item)=>{
  122. return item.pur_id == 124//"专家诊断"
  123. })
  124. console.log(items)
  125. this.jurisdiction = items[0].children.some((item)=>{
  126. return item.pur_id == 143//"发帖列表"
  127. })
  128. },
  129. })
  130. },
  131. onBackPress(options) {
  132. if (options.from === 'navigateBack') {
  133. return false;
  134. }
  135. this.clickLeft();
  136. return true;
  137. },
  138. }
  139. </script>
  140. <style lang="scss">
  141. .expertimages {
  142. width: 100%;
  143. height: 200rpx;
  144. margin-top: 88rpx;
  145. }
  146. .expert_details {
  147. width: 100%;
  148. height: 120rpx;
  149. display: flex;
  150. // justify-content: space-around;
  151. margin: 20rpx 0 30rpx;
  152. .details_item {
  153. width: 20%;
  154. padding: 10rpx 20rpx;
  155. text-align: center;
  156. font-size: 24rpx;
  157. image {
  158. width: 70%;
  159. height: 84rpx;
  160. }
  161. }
  162. }
  163. .cooperation {
  164. width: 100%;
  165. margin: 20rpx 0 60rpx;
  166. .cooperation_item {
  167. width: 95%;
  168. margin: 20rpx auto;
  169. .cooperation_item_title {
  170. border-left: 8rpx solid #18B566;
  171. text-indent: 16rpx;
  172. }
  173. .zooid {
  174. width: 100%;
  175. display: flex;
  176. flex-wrap: wrap;
  177. margin-top: 20rpx;
  178. .zooid_item {
  179. width: 22%;
  180. margin: 10rpx;
  181. image {
  182. width: 100%;
  183. height: 154rpx;
  184. }
  185. p {
  186. font-size: 24rpx;
  187. text-align: center;
  188. margin: 10rpx 0;
  189. }
  190. }
  191. }
  192. }
  193. }
  194. </style>