index.vue 4.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202
  1. <template>
  2. <view>
  3. <view class="status_bar"></view>
  4. <view class="" style="position: relative;top: 44px;">
  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. },
  87. worm() {
  88. uni.navigateTo({
  89. url: "./wormcase?name=" + '虫情百科',
  90. });
  91. },
  92. virus() {
  93. uni.navigateTo({
  94. url: "./wormcase?name=" + '病害百科',
  95. });
  96. },
  97. exchange() {
  98. if(this.jurisdiction){
  99. uni.navigateTo({
  100. url: "./exchangeShare"
  101. });
  102. }else{
  103. uni.showToast({
  104. title: "您暂无权限进行此操作,如有需要,请联系管理员",
  105. icon: "none"
  106. })
  107. }
  108. }
  109. },
  110. onLoad() {
  111. this.getCooperation(1)
  112. this.getCooperation(2)
  113. this.getCooperation(3)
  114. uni.getStorage({
  115. key:"jurisdiction",
  116. success:(res)=>{
  117. console.log(JSON.parse(res.data))
  118. let items = JSON.parse(res.data).filter((item)=>{
  119. return item.pur_id == 124//"专家诊断"
  120. })
  121. console.log(items)
  122. this.jurisdiction = items[0].children.some((item)=>{
  123. return item.pur_id == 143//"发帖列表"
  124. })
  125. },
  126. })
  127. },
  128. onBackPress(options) {
  129. if (options.from === 'navigateBack') {
  130. return false;
  131. }
  132. this.clickLeft();
  133. return true;
  134. },
  135. }
  136. </script>
  137. <style lang="scss">
  138. .expertimages {
  139. width: 100%;
  140. height: 200rpx;
  141. margin-top: 88rpx;
  142. }
  143. .expert_details {
  144. width: 100%;
  145. height: 120rpx;
  146. display: flex;
  147. // justify-content: space-around;
  148. margin: 20rpx 0 30rpx;
  149. .details_item {
  150. width: 20%;
  151. padding: 10rpx 20rpx;
  152. text-align: center;
  153. font-size: 24rpx;
  154. image {
  155. width: 70%;
  156. height: 84rpx;
  157. }
  158. }
  159. }
  160. .cooperation {
  161. width: 100%;
  162. margin: 20rpx 0 60rpx;
  163. .cooperation_item {
  164. width: 95%;
  165. margin: 20rpx auto;
  166. .cooperation_item_title {
  167. border-left: 8rpx solid #18B566;
  168. text-indent: 16rpx;
  169. }
  170. .zooid {
  171. width: 100%;
  172. display: flex;
  173. flex-wrap: wrap;
  174. margin-top: 20rpx;
  175. .zooid_item {
  176. width: 22%;
  177. margin: 10rpx;
  178. image {
  179. width: 100%;
  180. height: 154rpx;
  181. }
  182. p {
  183. font-size: 24rpx;
  184. text-align: center;
  185. margin: 10rpx 0;
  186. }
  187. }
  188. }
  189. }
  190. }
  191. </style>