index.vue 5.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134
  1. <template>
  2. <view class="ksqulc">
  3. <z-paging ref="paging" bgColor="#F7F7F7" safe-area-inset-bottom paging-class="paging-btm-shadow" refresher-only @onRefresh="onRefresh" scroll-with-animation>
  4. <template #top>
  5. <ut-navbar leftText="GAP基地获评信息详情" :fixed="false" border></ut-navbar>
  6. </template>
  7. <view class="p-rtv">
  8. <!-- 基本信息 -->
  9. <image class="gap_res_image w-160 h-160" :src="`/static/images/plant/base/gap_res${form.res}.png`" mode="widthFix" />
  10. <view class="pd-24 bg-#fff mb-10">
  11. <view class="f-s-30 pd2-16-0 info-border-bottom">
  12. <span class="c-#666">基地类型:</span>
  13. <span class="c-#333">{{ selectDictLabel(pt_base_type, form?.gapBaseType) || '-' }}</span>
  14. </view>
  15. <view class="f-s-30 pd2-16-0 info-border-bottom">
  16. <span class="c-#666">基地名称:</span>
  17. <span class="c-#333">{{ form?.gapBaseName || '-' }}</span>
  18. </view>
  19. <view class="f-s-30 pd2-16-0 info-border-bottom">
  20. <span class="c-#666">获评品种:</span>
  21. <span class="c-#333">{{ form?.medicineName || '-' }}</span>
  22. </view>
  23. <view class="f-s-30 pd2-16-0 info-border-bottom">
  24. <span class="c-#666">获评时间:</span>
  25. <span class="c-#333">{{ form?.ratedDate || '-' }}</span>
  26. </view>
  27. <view class="f-s-30 pd2-16-0 info-border-bottom">
  28. <span class="c-#666">基地所在地区:</span>
  29. <span class="c-#333">{{ form?.adcodeName || '-' }}</span>
  30. </view>
  31. <view class="f-s-30 pd2-16-0 info-border-bottom">
  32. <span class="c-#666">详细地址:</span>
  33. <span class="c-#333">{{ form?.address || '-' }}</span>
  34. </view>
  35. <view class="f-s-30 pd2-16-0 info-border-bottom">
  36. <view class="f-s-30 c-#666 mb-10">基地范围:</view>
  37. <view class="bg-#f7f7f7 d-flex ov-hd p-rtv">
  38. <image class="w-full" v-if="form?.basePic" :src="form?.basePic" mode="widthFix" @click="previewBasePic"></image>
  39. <view v-else class="w-full h-120 d-flex a-c j-c c-999">暂无基地范围</view>
  40. </view>
  41. </view>
  42. <view class="f-s-30 pd2-16-0 info-border-bottom">
  43. <span class="c-#666">基地面积:</span>
  44. <span class="c-#333">{{ form?.area || '-' }}{{ form?.areaUnit || '亩' }}</span>
  45. </view>
  46. <view class="f-s-30 pd2-16-0 info-border-bottom">
  47. <span class="c-#666">基地经纬度:</span>
  48. <span class="c-#333">E{{ form?.lng || '-' }}, N{{ form?.lat || '-' }}</span>
  49. </view>
  50. <view v-if="form?.certFile" class="f-s-30 pd2-16-0 info-border-bottom">
  51. <view class="f-s-30 c-#666 mb-10">官方公示证明材料</view>
  52. <ut-album :urls="form?.certFile"></ut-album>
  53. </view>
  54. <view v-if="form?.url" class="f-s-30 pd2-16-0 info-border-bottom">
  55. <span class="c-#666">官方公示网址:</span>
  56. <span class="c-#333">{{ form?.url || '-' }}</span>
  57. </view>
  58. </view>
  59. </view>
  60. <template v-if="form.res == '2'" #bottom>
  61. <view class="pd-20 d-flex">
  62. <up-button @click="$u.route({ type: 'redirect', url: '/plant/base/gap-base-info-edit/index', params: { id: did } })" type="primary">修改</up-button>
  63. </view>
  64. </template>
  65. </z-paging>
  66. </view>
  67. </template>
  68. <script setup lang="ts">
  69. import { useClientRequest } from '@/utils/request';
  70. import { getUrlParams, recursiveDecodeURIComponent } from '@/utils/ruoyi';
  71. const { proxy } = getCurrentInstance() as ComponentInternalInstance;
  72. const { pt_base_type } = toRefs<any>(proxy?.useDict('pt_base_type'));
  73. const paging = ref<any>(null);
  74. const form = ref<any>({});
  75. const did = ref('');
  76. // 获取详情(GAP获评信息)
  77. const getDetailById = async (id: string) => {
  78. if (!id) return;
  79. const res = await useClientRequest.get(`/plt-api/app/gapCertificationInfo/getInfoById/${id}`);
  80. if (res && res.code === 200) {
  81. form.value = res.data || {};
  82. }
  83. };
  84. const onRefresh = () => {
  85. getDetailById(did.value);
  86. paging.value?.complete();
  87. };
  88. // 页面入参解析并加载
  89. onLoad((options: any) => {
  90. did.value = options?.id || getUrlParams(recursiveDecodeURIComponent(options?.q))?.id || '';
  91. getDetailById(did.value);
  92. });
  93. // 预览基地范围图片
  94. const previewBasePic = () => {
  95. const url = form.value?.basePic;
  96. if (!url) return;
  97. uni.previewImage({ urls: [url], current: 0 });
  98. };
  99. </script>
  100. <style lang="scss" scoped>
  101. .z-paging-wrap {
  102. position: absolute;
  103. right: 0;
  104. top: 0;
  105. bottom: 0;
  106. left: 0;
  107. }
  108. .btn-aree-center {
  109. position: absolute;
  110. top: 0;
  111. right: 0;
  112. bottom: 0;
  113. left: 0;
  114. }
  115. .plot-item {
  116. border: 1rpx solid rgba($u-primary, 0.4);
  117. border-radius: 10rpx;
  118. }
  119. .gap-info-card {
  120. border: 1rpx solid rgba($u-primary, 0.4);
  121. }
  122. .gap_res_image {
  123. position: absolute;
  124. right: 30rpx;
  125. top: 30rpx;
  126. }
  127. </style>