index.vue 13 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244
  1. <template>
  2. <z-paging ref="paging" v-model="list" bgColor="#f7f7f7" @query="query" @scroll="onPageScroll">
  3. <template #top>
  4. <up-navbar :fixed="true" :bgColor="navBarBgColor">
  5. <template #left>
  6. <view class="d-flex a-c pb-5" id="topup-navbar" :style="{ width: `${bubble.left - 30}px` }">
  7. <image class="home_icon mr-20"
  8. src="https://ta.zycpzs.cn/oss-file/smart-trace/szyy/images/common/home.png"
  9. mode="widthFix" />
  10. <text class="f-s-40 c-333 f-w-5 w-s-no">中药材种植全链条追溯</text>
  11. <view class="flex1"></view>
  12. </view>
  13. </template>
  14. </up-navbar>
  15. </template>
  16. <view class="h-500 w-100%"
  17. style="background: linear-gradient(to left, #d2f7d5, #eafad8); position: absolute; top: 0; left: 0; z-index: -1">
  18. </view>
  19. <template>
  20. <up-navbar :fixed="false" bgColor="transparent">
  21. <template #left>
  22. <view class="pd-10"></view>
  23. </template>
  24. </up-navbar>
  25. <view class="user-page-header pd-10 d-flex a-c mg-14 p-rtv">
  26. <view class="user-page-header-avatar mr-20 p-rtv">
  27. <up-avatar size="116rpx"
  28. :src="avatar || 'https://ta.zycpzs.cn/oss-file/smart-trace/szyy/images/common/avatar.png'"></up-avatar>
  29. </view>
  30. <view class="flex1 ov-hd mr-40">
  31. <view class="p-rtv d-flex a-c mb-6">
  32. <view class="flex1 ov-hd f-s-32 c-333 d-flex a-ed">
  33. <text class="mr-12 up-line-1 f-w-5">{{ name }}</text>
  34. <text class="c-999 f-s-24">{{ setCipByNum(phone, 3, 4) || '-' }}</text>
  35. </view>
  36. </view>
  37. <view class="f-s-22 mr-10 b-radius pt-4 pb-4 pl-10 pr-10 c-primary"
  38. style="width: max-content; background-color: #b7e8bc">
  39. {{ cpyname }}
  40. </view>
  41. </view>
  42. </view>
  43. </template>
  44. <template>
  45. <view class="p-rtv">
  46. <view class="pd-10 mg-14">
  47. <view class="b-radius pd-6"
  48. style="border: 1rpx solid #fff; background: linear-gradient(90deg, #c1f3c5 0%, rgba(193, 243, 197, 0.5) 20%, rgba(255, 255, 255, 0.5) 35%, rgba(255, 255, 255, 0.5) 50%, rgba(232, 255, 234, 0.5) 100%, #e8ffea 100%), linear-gradient(90deg, transparent 0%, rgba(255, 255, 255, 0.3) 30%, rgba(255, 255, 255, 0.3) 80%, transparent 100%)">
  49. <view class="b-radius pd-10 p-rtv" style="border: 1rpx solid #baedbf">
  50. <image class="w-200" src="/static/images/plant/typeofBusiness.png" mode="widthFix"
  51. style="position: absolute; top: 10rpx; left: 10rpx" />
  52. <view v-if="!speciesArray.length" class="pd-20"></view>
  53. <view v-if="speciesArray.length" class="d-flex pr-15">
  54. <view class="flex1"></view>
  55. <view class="f-s-22 c-primary"
  56. @click="$u.route({ url: '/plant/species/config/index' })">去修改{{ '>' }}</view>
  57. </view>
  58. <view v-if="speciesArray.length" class="c-#333 f-s-24 d-flex pl-40 pr-15 pb-15 pt-15">
  59. <view class="ov-hd tx-ov w-s-no">{{ speciesArray.join('、') }}</view>
  60. <view v-if="speciesArray.length > 4" class="flex1 w-s-no">等{{ speciesArray.length }}个品种
  61. </view>
  62. </view>
  63. <view v-if="!speciesArray.length" @click="$u.route({ url: '/plant/species/config/index' })"
  64. class="c-primary bg-#E3F6E7 f-s-22 mg-at radius-10 w-250 h-50 d-flex a-c j-c">
  65. 暂未配置品种,去配置{{ '>' }}</view>
  66. <view v-if="!speciesArray.length" class="pd-7"></view>
  67. </view>
  68. </view>
  69. </view>
  70. <view class="b-radius pt-0 bg-#f7f7f7"
  71. style="border: 1rpx solid #fff; border-bottom-color: transparent; margin-top: -40rpx">
  72. <up-sticky :offset-top="stickyTop">
  73. <view class="d-flex a-c pd-16 p-rtv">
  74. <view class="c-333 f-s-32 f-w-5 z-index-1">基地与地块管理</view>
  75. <view class="flex1"></view>
  76. <view @click="$u.route({ url: '/plant/base/gap-base-info/index' })"
  77. class="c-primary f-s-22 z-index-1">GAP基地获评信息管理{{ '>' }}</view>
  78. <image src="/static/images/plant/basePlotBG.png" class="w-100%" mode="widthFix"
  79. style="position: absolute; top: 0; left: 0; z-index: -1"></image>
  80. </view>
  81. <view class="d-flex a-c pt-20 pb-20 pl-16 pr-16 bg-#f7f7f7">
  82. <view class="min-w-170 flex1">
  83. <ut-action-sheet v-model="form.type" :tabs="[{ label: '全部', value: '' }]"
  84. @change="onRefresh" title="选择原料类型">
  85. <view class="d-flex search-select-item a-c">
  86. <view class="flex1 ov-hd f-s-28 c-333 text-center f-w-5 w-s-no">{{ '全部' }}
  87. </view>
  88. <up-icon size="24rpx" color="#333" name="arrow-down-fill"
  89. class="mr-5"></up-icon>
  90. </view>
  91. </ut-action-sheet>
  92. </view>
  93. <view class="h-86 pl-20 w-100%">
  94. <ut-search ref="searchRef" v-model="form.keyword" @search="changeSeach" margin="0"
  95. :border="false" :placeholder="form.placeholder" bgColor="#fff" height="86rpx"
  96. borderRadius="10rpx"></ut-search>
  97. </view>
  98. </view>
  99. </up-sticky>
  100. <view class="pd-16">
  101. <template>
  102. <view v-for="(item, index) in list" :key="index" class="b-radius bg-#fff pd-20 mb-20">
  103. <view class="c-333 f-s-34 pd-5 f-w-5">德钦县拖顶乡洛沙村各加尼拉基地</view>
  104. <view class="c-ccc f-s-24 pd-5 pt-0">DQTDLSC00156768951001</view>
  105. <view class="d-flex a-c">
  106. <view class="c-333 f-s-28 pd-5">
  107. <text class="c-#666">基地面积:</text>
  108. <text class="f-w-5">12000亩</text>
  109. </view>
  110. <view class="flex1"></view>
  111. <view class="c-333 f-s-28 pd-5">
  112. <text class="c-#666">建设时间:</text>
  113. <text class="f-w-5">2003年</text>
  114. </view>
  115. </view>
  116. <view class="c-333 f-s-28 pd-5">
  117. <text class="c-#666">基地地址:</text>
  118. <text class="f-w-5">云南省红河州个旧市卡房镇田心村小田心村268号</text>
  119. </view>
  120. <view class="c-333 f-s-28 pd-5 d-flex">
  121. <text class="c-#666 w-s-no">当前在地品种:</text>
  122. <text
  123. class="ov-hd tx-ov w-s-no f-w-5">三七、天麻、徐长卿、白及、徐长卿、白及、三七、天麻、徐长卿、白及、徐长卿、白及</text>
  124. <text class="flex1 w-s-no f-w-5">等120个品种</text>
  125. </view>
  126. <view class="pd-10"></view>
  127. <view class="p-rtv">
  128. <up-image width="100%"
  129. src="https://img1.baidu.com/it/u=436536502,2810995452&fm=253&fmt=auto&app=120&f=JPEG?w=820&h=500"
  130. mode="widthFix"> </up-image>
  131. <view class="pl-20 pr-20 pt-10 pb-10 bg-#00000080 c-#ccc f-s-20"
  132. style="position: absolute; bottom: 140rpx; right: 0; border-radius: 10rpx 0 0 10rpx">
  133. 李思思负责</view>
  134. <view class="pl-20 pr-20 pt-10 pb-10 bg-#00000080 c-#ccc f-s-20"
  135. style="position: absolute; bottom: 80rpx; right: 0; border-radius: 10rpx 0 0 10rpx">
  136. 公司+合作社</view>
  137. <view class="pl-20 pr-20 pt-10 pb-10 bg-#00000080 c-#ccc f-s-20"
  138. style="position: absolute; bottom: 20rpx; right: 0; border-radius: 10rpx 0 0 10rpx">
  139. 经度:E64.63 纬度:N27.7385</view>
  140. </view>
  141. </view>
  142. </template>
  143. </view>
  144. </view>
  145. </view>
  146. </template>
  147. <template #empty>
  148. <ut-empty class="mg-at" color="#ccc" size="28rpx" image="/static/images/plant/noEmptyBase.png">尚未添加绘制种养殖基地信息~</ut-empty>
  149. <view class="b-radius c-#fff f-s-36 bg-#37A954 h-78 w-382 d-flex a-c j-c mg-at">
  150. <img class="w-38 h-36 mr-10" src="/static/images/plant/chooseGAP.png" alt="" mode="widthFix" />
  151. <text>去添加基地</text>
  152. </view>
  153. </template>
  154. </z-paging>
  155. </template>
  156. <script setup lang="ts">
  157. import { useClientRequest } from '@/utils/request';
  158. import { setCipByNum } from '@/utils/public';
  159. interface navbar {
  160. bottom: number;
  161. height: number;
  162. left: number;
  163. right: number;
  164. top: number;
  165. width: number;
  166. id: string;
  167. dataset?: any
  168. }
  169. const instance = getCurrentInstance();
  170. const list = ref([]);
  171. const paging = ref();
  172. const bubble = ref(uni.getMenuButtonBoundingClientRect());
  173. const avatar = ref();
  174. const name = ref('神奇大侠');
  175. const phone = ref('17708862791');
  176. const cpyname = ref('智慧溯源有限公司');
  177. const form = ref({ type: '', placeholder: '搜基地名称、编号、地址、负责人', keyword: '' });
  178. const speciesArray = ref([]);
  179. const navBarBgColor = ref('transparent');
  180. const stickyTop = ref(0);
  181. const changeSeach = () => {
  182. paging.value.reload();
  183. };
  184. const onRefresh = () => {
  185. paging.value.reload();
  186. };
  187. const onPageScroll = (e) => {
  188. const { scrollTop } = e.detail;
  189. if (scrollTop > 20) {
  190. navBarBgColor.value = '#d9f8d6';
  191. } else {
  192. navBarBgColor.value = 'transparent';
  193. }
  194. };
  195. const query = async (pageNum: number, pageSize: number) => {
  196. const params = {
  197. pageNum,
  198. pageSize,
  199. ...form.value,
  200. };
  201. const res = await useClientRequest.get('/plt-api/app/base/pageList', params);
  202. console.log(res);
  203. const { rows } = res;
  204. paging.value.complete(rows);
  205. };
  206. // 查询企业的种植品种
  207. const getSpecies = async () => {
  208. const res = await useClientRequest.get('/plt-api/app/cpyVariety/list');
  209. if (res.code === 200) {
  210. console.log(res);
  211. speciesArray.value = res.data.map((item) => item.varietyName)
  212. }
  213. };
  214. onMounted(() => {
  215. const querys = uni.createSelectorQuery().in(instance.proxy);
  216. querys
  217. .select('#topup-navbar')
  218. .boundingClientRect((data: any) => {
  219. stickyTop.value = data.top + data.height;
  220. })
  221. .exec();
  222. getSpecies()
  223. query(1, 10)
  224. });
  225. // setTimeout(() => {
  226. // useClientRequest.get('/time');
  227. // }, 2000);
  228. </script>
  229. <style lang="scss" scoped>
  230. // @import '@/assets/styles/theme.scss';
  231. .search-select-item {
  232. height: 86rpx;
  233. background-color: #fff;
  234. border-radius: 10rpx;
  235. box-sizing: border-box;
  236. padding-left: 16rpx;
  237. padding-right: 16rpx;
  238. padding-top: 14rpx;
  239. padding-bottom: 14rpx;
  240. }
  241. </style>