index.vue 6.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162
  1. <template>
  2. <z-paging ref="paging" v-model="list" @onRefresh="onRefresh" bgColor="#f7f7f7" @query="query" safe-area-inset-bottom hide-empty-view>
  3. <template #top>
  4. <up-navbar title="GAP基地信息" @leftClick="navigateBackOrHome()" :fixed="false"></up-navbar>
  5. <view class="d-flex a-c pd-25">
  6. <view class="min-w-170 flex1">
  7. <ut-action-sheet v-model="form.type" :tabs="tabs" @change="onRefresh" title="选择基地类型">
  8. <view class="d-flex search-select-item a-c">
  9. <view class="flex1 ov-hd f-s-28 c-333 text-center f-w-5 w-s-no">{{ '全部' }}</view>
  10. <up-icon size="24rpx" color="#333" name="arrow-down-fill" class="mr-5"></up-icon>
  11. </view>
  12. </ut-action-sheet>
  13. </view>
  14. <view class="h-86 pl-20 w-100%">
  15. <ut-search ref="searchRef" v-model="form.keywords" @search="onRefresh" margin="0" :border="false" :placeholder="placeholder" bgColor="#fff" height="86rpx" borderRadius="10rpx"></ut-search>
  16. </view>
  17. </view>
  18. </template>
  19. <template>
  20. <template>
  21. <view class="pl-25 pr-25">
  22. <up-swipe-action>
  23. <up-swipe-action-item v-for="item in list" :name="item?.id" :key="item?.id" :options="optionsAction" @click="clickSwipe" class="mb-20">
  24. <view class="b-radius bg-#fff pd-20">
  25. <view class="c-#333 f-s-34 f-w-5 pb-5">德钦县拖顶乡洛沙村各尼拉三七GAP基地</view>
  26. <view class="c-#999 f-s-24 pb-20">2025年-05-12获评</view>
  27. <view class="d-flex pb-5">
  28. <view class="w-50%">
  29. <text class="c-#666 f-s-28">种养殖品种:</text>
  30. <text class="c-#333 f-s-28 f-w-5">三七</text>
  31. </view>
  32. <view class="w-50%">
  33. <text class="c-#666 f-s-28">基地面积:</text>
  34. <text class="c-#333 f-s-28 f-w-5">120亩</text>
  35. </view>
  36. </view>
  37. <view class="border-bottom-#f7f7f7 pb-20">
  38. <text class="c-#666 f-s-28">基地地址:</text>
  39. <text class="c-#333 f-s-28 f-w-5">云南省红河州个旧市卡房镇田心村小田心村268号工业园</text>
  40. </view>
  41. <view class="pl-5 pr-5 pt-20 pb-20 border-top-#f7f7f7 c-#FC333F">
  42. <text class="f-s-28">审核不通过原因:</text>
  43. <text class="f-s-28">云南省红河州个旧市卡房镇田心村小田心村268号工业园</text>
  44. </view>
  45. </view>
  46. </up-swipe-action-item>
  47. </up-swipe-action>
  48. </view>
  49. </template>
  50. <!-- 空数据处理 -->
  51. <template v-if="!address && list.length === 0">
  52. <ut-empty class="mg-at" size="28rpx" color="#999" padding="10rpx" image="/static/images/plant/noEmptyBase.png">非云南省内企业,无法获取已获评的GAP基地信息~</ut-empty>
  53. <view class="d-flex j-c f-s-28 c-#ccc">可点击底部按钮上传佐证材料添加获评信息</view>
  54. </template>
  55. <template v-if="address && list.length === 0">
  56. <ut-empty class="mg-at" size="28rpx" color="#999" padding="10rpx" image="/static/images/plant/noEmptyBase.png">暂无获评GAP基地信息~</ut-empty>
  57. <view class="d-flex j-c f-s-28 c-#ccc">如需认定GAP基地,可前往数字云药官网进行申报</view>
  58. <view class="d-flex j-c f-s-28 c-primary pd-15">https://www.shuziyunyao.com/</view>
  59. <up-button type="primary" class="b-radius" style="width: 340rpx" @click="copyText('https://www.shuziyunyao.com/')">复制网址</up-button>
  60. </template>
  61. </template>
  62. <template #bottom v-if="!address">
  63. <view class="base-bottom-wrap pd-20 pb-0">
  64. <up-button type="primary">
  65. <img class="w-38 h-36 mr-10" src="/static/images/plant/chooseGAP.png" alt="" mode="widthFix" />
  66. <text>添加GAP基地信息</text>
  67. </up-button>
  68. </view>
  69. </template>
  70. </z-paging>
  71. </template>
  72. <script setup lang="ts">
  73. import { copyText } from '@/utils/public';
  74. interface ListItem {
  75. id: number;
  76. name: string;
  77. }
  78. const paging = ref();
  79. const list = ref<ListItem[]>([]);
  80. const placeholder = ref('搜基地名称、品种、基地地址');
  81. const tabs = ref([
  82. { label: '全部', value: '' },
  83. { label: '有效', value: '0' },
  84. { label: '审核不通过', value: '1' },
  85. { label: '待审核', value: '2' },
  86. ]);
  87. // 判断是否是云南的企业
  88. const address = ref(false);
  89. const form = ref({
  90. keywords: '',
  91. type: '',
  92. });
  93. setTimeout(() => {
  94. address.value = true;
  95. }, 2000);
  96. const query = async (pageNum: number, pageSize: number) => {
  97. const params = {
  98. pageNum,
  99. pageSize,
  100. ...form.value,
  101. };
  102. // const res = await cpyList(params);
  103. let res: ListItem[] = [];
  104. //循环push10条数据
  105. for (let i = 0; i < 10; i++) {
  106. res.push({
  107. id: i + 1,
  108. name: `${i + 1}`,
  109. });
  110. }
  111. // const { rows } = res;
  112. paging.value.complete(res);
  113. };
  114. const onRefresh = () => {
  115. paging.value.reload();
  116. };
  117. // 处理地块数据
  118. const showAction = ref(false);
  119. const optionsAction = reactive([
  120. {
  121. text: '删除',
  122. style: {
  123. backgroundColor: '#f56c6c',
  124. },
  125. },
  126. ]);
  127. const clickSwipe = (index: object) => {
  128. console.log(index);
  129. };
  130. </script>
  131. <style lang="scss" scoped>
  132. // @import '@/assets/styles/theme.scss';
  133. .search-select-item {
  134. height: 86rpx;
  135. background-color: #fff;
  136. border-radius: 10rpx;
  137. box-sizing: border-box;
  138. padding-left: 16rpx;
  139. padding-right: 16rpx;
  140. padding-top: 14rpx;
  141. padding-bottom: 14rpx;
  142. }
  143. .u-page {
  144. padding: 0;
  145. }
  146. .u-demo-block__title {
  147. padding: 10px 0 2px 15px;
  148. }
  149. .swipe-action {
  150. &__content {
  151. padding: 25rpx 0;
  152. &__text {
  153. font-size: 15px;
  154. color: $u-main-color;
  155. padding-left: 30rpx;
  156. }
  157. }
  158. }
  159. </style>