index.vue 8.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191
  1. <template>
  2. <z-paging ref="paging" bgColor="#F7F7F7">
  3. <template #top v-if="!showHeader">
  4. <ut-navbar title="产地加工及包装赋码" :fixed="false" :breadcrumb="false">
  5. <template #left>
  6. <view class=""></view>
  7. </template>
  8. </ut-navbar>
  9. </template>
  10. <template v-if="showHeader">
  11. <template #top>
  12. <up-navbar :fixed="true" :bgColor="navBarBgColor">
  13. <template #left>
  14. <view class="d-flex a-c pb-5" id="topup-navbar" :style="{ width: `${bubble.left - 30}px` }">
  15. <text class="f-s-40 c-333 f-w-5 w-s-no">产地加工及包装赋码</text>
  16. <view class="flex1"></view>
  17. </view>
  18. </template>
  19. </up-navbar>
  20. </template>
  21. <view class="h-500 w-100%"
  22. style="background: linear-gradient(to left, #d2f7d5, #eafad8); position: absolute; top: 0; left: 0; z-index: -1">
  23. </view>
  24. <template>
  25. <up-navbar :fixed="false" bgColor="transparent">
  26. <template #left>
  27. <view class="pd-10"></view>
  28. </template>
  29. </up-navbar>
  30. <view class="user-page-header pd-10 d-flex a-c mg-14 p-rtv">
  31. <view class="user-page-header-avatar mr-20 p-rtv">
  32. <up-avatar size="116rpx"
  33. :src="avatar || 'https://ta.zycpzs.cn/oss-file/smart-trace/szyy/images/common/avatar.png'"></up-avatar>
  34. </view>
  35. <view class="flex1 ov-hd mr-40">
  36. <view class="p-rtv d-flex a-c mb-6">
  37. <view class="flex1 ov-hd f-s-32 c-333 d-flex a-ed">
  38. <text class="mr-12 up-line-1 f-w-5">{{ name }}</text>
  39. <text class="c-999 f-s-24">{{ setCipByNum(phone ?? null, 3, 4) || '-' }}</text>
  40. </view>
  41. </view>
  42. <view class="f-s-22 mr-10 radius-30 pt-4 pb-4 pl-10 pr-10 c-primary bg-#b7e8bc"
  43. style="width: max-content">
  44. {{ currentCpyName }}
  45. </view>
  46. </view>
  47. </view>
  48. </template>
  49. <view class="pd-10 mg-14 mb-0 pb-0">
  50. <view class="b-radius pd-6"
  51. 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%)">
  52. <view class="b-radius pd-10 p-rtv" style="border: 1rpx solid #baedbf">
  53. <image class="w-200"
  54. src="https://ta.zycpzs.cn/oss-file/smart-trace/szyy/images-plt/plant/typeofBusiness.png"
  55. mode="widthFix" style="position: absolute; top: 10rpx; left: 10rpx" />
  56. <view v-if="!speciesArray.length" class="pd-20"></view>
  57. <view v-if="speciesArray.length" class="d-flex pr-15">
  58. <view class="flex1"></view>
  59. <view class="f-s-22 c-primary" @click="$u.route({ url: '/plant/species/config/index' })">
  60. 去修改{{ '>' }}
  61. </view>
  62. </view>
  63. <view v-if="speciesArray.length" class="c-#333 f-s-24 d-flex pl-40 pr-15 pb-15 pt-15">
  64. <view class="ov-hd tx-ov w-s-no">{{ speciesArray.join('、') }}</view>
  65. <view v-if="speciesArray.length > 4" class="flex1 w-s-no">等{{ speciesArray.length }}个品种
  66. </view>
  67. </view>
  68. <view v-if="!speciesArray.length" @click="$u.route({ url: '/plant/species/config/index' })"
  69. class="c-primary bg-#E3F6E7 f-s-22 mg-at radius-10 w-250 h-50 d-flex a-c j-c"> 暂未配置品种,去配置{{
  70. '>' }}
  71. </view>
  72. <view v-if="!speciesArray.length" class="pd-7"></view>
  73. </view>
  74. </view>
  75. </view>
  76. </template>
  77. <view class="pd-24 b-radius p-rtv"
  78. :style="showHeader ? 'background: linear-gradient(to bottom, #dcf8d9, #f7f7f7 70rpx); border: 1rpx solid #fff;' : ''">
  79. <!-- 产地加工卡片 -->
  80. <view class=" process-card" @click="$u.route({ url: '/plant/processing/processing-index/index' })">
  81. <view class="w-200 h-200 d-flex a-c j-c" style="flex-shrink: 0">
  82. <image class="w-100% h-100%"
  83. src="https://ta.zycpzs.cn/oss-file/smart-trace/szyy/images-plt/plant/processing/initial_processing.png"
  84. mode="aspectFit" />
  85. </view>
  86. <view class="card-content">
  87. <view class="f-s-46 c-#333 f-w-6 mb-12">产地加工</view>
  88. <view class="card-desc">可对种子、鲜货进行初加工、趁鲜切制加工</view>
  89. </view>
  90. </view>
  91. <!-- 包装赋码卡片 -->
  92. <view class="process-card" @click="$u.route({ url: '/plant/packaging/list/index' })">
  93. <view class="w-200 h-200 d-flex a-c j-c" style="flex-shrink: 0">
  94. <image class="w-100% h-100%"
  95. src="https://ta.zycpzs.cn/oss-file/smart-trace/szyy/images-plt/plant/processing/packaging_coding.png"
  96. mode="aspectFit" />
  97. </view>
  98. <view class="card-content">
  99. <view class="f-s-46 c-#333 f-w-6 mb-12">包装赋码</view>
  100. <view class="card-desc">可对种源、鲜货、药材进行包装</view>
  101. </view>
  102. </view>
  103. </view>
  104. <template #bottom>
  105. <ut-tabar activeTab="processing"></ut-tabar>
  106. </template>
  107. </z-paging>
  108. </template>
  109. <script setup lang="ts">
  110. import { useInfoStore } from '@/store';
  111. import { setCipByNum } from '@/utils/public';
  112. import { useClientRequest } from '@/utils/request';
  113. const { proxy } = getCurrentInstance() as ComponentInternalInstance;
  114. const infoStore = useInfoStore();
  115. const instance = getCurrentInstance();
  116. const navBarBgColor = ref('transparent');
  117. const name = computed(() => infoStore.userInfo?.name || '');
  118. const phone = computed(() => infoStore.userInfo?.phone || '');
  119. const currentCpyName = computed(() => infoStore.userInfo?.currentCpyName || '');
  120. const avatar = computed(() => infoStore.userInfo?.avatar || '');
  121. const bubble = ref(uni.getMenuButtonBoundingClientRect());
  122. const speciesArray = ref([]);
  123. const stickyTop = ref(0);
  124. // 根据 navConfig 判断是否显示头部:default 显示,custom 隐藏
  125. const showHeader = computed(() => infoStore.navConfig !== 'default');
  126. const getSpecies = async () => {
  127. const res = await useClientRequest.get('/plt-api/app/cpyVariety/list');
  128. if (res?.code === 200) {
  129. speciesArray.value = res.data?.map((item: any) => item.medicineName);
  130. }
  131. };
  132. onMounted(() => {
  133. if (showHeader.value) {
  134. const querys = uni.createSelectorQuery().in(instance?.proxy);
  135. querys
  136. .select('#topup-navbar')
  137. .boundingClientRect((data: any) => {
  138. console.log(data);
  139. stickyTop.value = data.top + data.height;
  140. })
  141. .exec();
  142. getSpecies();
  143. }
  144. });
  145. onShow(() => {
  146. if (showHeader.value) {
  147. getSpecies();
  148. }
  149. });
  150. </script>
  151. <style lang="scss" scoped>
  152. .process-card {
  153. display: flex;
  154. align-items: center;
  155. background-color: #fff;
  156. border-radius: 16rpx;
  157. margin-bottom: 24rpx;
  158. padding: 30rpx 24rpx;
  159. // border: 2rpx solid #b8e6d5;
  160. // box-shadow:
  161. // inset 0 5px 10px 9px #edf8f2,
  162. // inset 0 -5px 10px -5px #edf8f2;
  163. // filter: drop-shadow(-1px 2px 3px #9ad4b6);
  164. overflow: hidden;
  165. }
  166. .card-image-wrapper {
  167. flex-shrink: 0;
  168. }
  169. .card-content {
  170. flex: 1;
  171. padding-left: 30rpx;
  172. display: flex;
  173. flex-direction: column;
  174. justify-content: center;
  175. }
  176. .card-desc {
  177. font-size: 24rpx;
  178. color: #999;
  179. line-height: 1.5;
  180. }
  181. </style>