index.vue 3.5 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182
  1. <template>
  2. <z-paging ref="paging" safe-area-inset-bottom v-model="list" @query="query">
  3. <template #top>
  4. <ut-navbar leftText="请选择GAP基地获评信息" :fixed="false"></ut-navbar>
  5. <view class="pd-20">
  6. <ut-search margin="0" height="68rpx" fontSize="26rpx" placeholder="搜基地名称、品种、基地地址" :border="false" v-model="form.keyword" @search="onRefresh"></ut-search>
  7. </view>
  8. </template>
  9. <view class="base-content pd-20">
  10. <view :class="{ active: item.id === checkedId }" v-for="(item, index) in list" :key="item.id" @click="clickItem(item)" class="b-radius bg-#fff pd-20 p-rtv">
  11. <view class="c-#333 f-s-34 f-w-5 pb-5">{{ item?.gapBaseName }}</view>
  12. <view class="c-#999 f-s-24 pb-20">{{ item?.ratedDate }}获评</view>
  13. <view class="d-flex pb-5">
  14. <view class="w-50%">
  15. <text class="c-#666 f-s-28">种养殖品种:</text>
  16. <text class="c-#333 f-s-28 f-w-5">{{ item?.medicineName || '-' }}</text>
  17. </view>
  18. <view class="w-50%">
  19. <text class="c-#666 f-s-28">基地面积:</text>
  20. <text class="c-#333 f-s-28 f-w-5">{{ item?.area }}{{ item?.areaUnit || '亩' }}</text>
  21. </view>
  22. </view>
  23. <view class="pb-20">
  24. <text class="c-#666 f-s-28">基地地址:</text>
  25. <text class="c-#333 f-s-28 f-w-5">{{ item?.address }}</text>
  26. </view>
  27. <view v-if="+item?.res == 2" class="pl-5 pr-5 pt-20 pb-20 border-top-#f7f7f7 c-#FC333F">
  28. <text class="f-s-28">审核不通过原因:</text>
  29. <text class="f-s-28">{{ item?.msg }}</text>
  30. </view>
  31. <image v-if="+item?.res == 2" class="w-145" src="/static/images/plant/resFailed.png" style="position: absolute; top: 0; right: 0" mode="widthFix" />
  32. <image v-if="+item?.res == 0" class="w-100" src="/static/images/plant/resPendingReview.png" style="position: absolute; top: 0; right: 0" mode="widthFix" />
  33. <image v-if="+item?.res == 1" class="w-90" src="/static/images/plant/resEffective.png" style="position: absolute; top: 0; right: 0" mode="widthFix" />
  34. </view>
  35. </view>
  36. </z-paging>
  37. </template>
  38. <script setup lang="ts">
  39. import { useClientRequest } from '@/utils/request';
  40. const paging = ref<any>(null);
  41. const list = ref<any[]>([]);
  42. const form = ref({
  43. keyword: '',
  44. res: '1',
  45. gapBaseType: ''
  46. });
  47. const query = async (pageNum: number, pageSize: number) => {
  48. const res = await useClientRequest.get('/plt-api/app/gapCertificationInfo/pageList', {
  49. ...form.value,
  50. pageNum: pageNum,
  51. pageSize: pageSize,
  52. });
  53. if (res.code == 200) {
  54. paging.value.complete(res.rows || []);
  55. }
  56. };
  57. const checkedId = ref(null);
  58. const clickItem = (item: any) => {
  59. checkedId.value = item.id;
  60. uni.$emit('selectGapInfo', item);
  61. uni.navigateBack();
  62. };
  63. const onRefresh = () => {
  64. try {
  65. paging.value?.reload();
  66. } catch (e) {
  67. console.error('Error refreshing address list:', e);
  68. }
  69. };
  70. onLoad((options: any) => {
  71. form.value.res = options?.res || '1';
  72. form.value.gapBaseType = options?.baseType || '';
  73. })
  74. </script>
  75. <style lang="scss" scoped>
  76. .select-item-card {
  77. border-radius: 16rpx;
  78. &.active {
  79. border-color: #4456fb;
  80. }
  81. }
  82. </style>