lisy 2 settimane fa
parent
commit
5dbd4ffa6b
3 ha cambiato i file con 166 aggiunte e 22 eliminazioni
  1. 7 2
      src/components/ut-tabar/ut-tabar.vue
  2. 159 19
      src/pages/plant/port/index.vue
  3. 0 1
      stats.html

+ 7 - 2
src/components/ut-tabar/ut-tabar.vue

@@ -4,12 +4,12 @@
             <image class="w-100%" src="/static/images/plant/bottombg.png" mode="widthFix" style="position: absolute; bottom: 0; left: 0; z-index: -1" />
             <view class="d-flex h-140 w-100% j-sa" style="position: absolute; bottom: 0; left: 0">
                 <view class="d-flex a-c flex1 j-sa">
-                    <view class="c-#999 f-s-24 d-flex flex-cln">
+                    <view @click="goToSwitchWithParams('/pages/switch/index1', { type: 'plant', title: '种植端基地', path: '/pages/plant/base/index' })" class="c-#999 f-s-24 d-flex flex-cln">
                         <image v-if="activeTab !== 'base'" class="w-80" src="/static/images/plant/bottomBase.png" mode="widthFix" />
                         <image v-if="activeTab === 'base'" class="w-80" src="/static/images/plant/bottomBaseActive.png" mode="widthFix" />
                         <view class="text-center" :class="activeTab === 'base' ? 'c-primary f-w-5' : ''">基地</view>
                     </view>
-                    <view class="c-#999 f-s-24 d-flex flex-cln">
+                    <view @click="goToSwitchWithParams('/pages/switch/index2', { type: 'port', title: '种植端种养殖', path: '/pages/plant/port/index' })" class="c-#999 f-s-24 d-flex flex-cln">
                         <image v-if="activeTab !== 'planting'" class="w-80" src="/static/images/plant/bottomPlantingBreeding.png" mode="widthFix" />
                         <image v-if="activeTab === 'planting'" class="w-80" src="/static/images/plant/bottomPlantingBreedingActive.png" mode="widthFix" />
                         <view class="text-center" :class="activeTab === 'planting' ? 'c-primary f-w-5' : ''">种养殖</view>
@@ -38,9 +38,14 @@
 </template>
 
 <script setup lang="ts">
+import { goToSwitchPage } from '@/utils/public';
 defineProps<{
     activeTab?: string; // 当前活跃的tab标识符:'base' | 'planting' | 'warehouse' | 'processing' | 'more'
 }>();
 const windowInfo = uni.getWindowInfo();
 const safeAreaBottom = windowInfo.safeAreaInsets.bottom;
+const goToSwitchWithParams = (pages: string, data: unknown): void => {
+    // 使用公共函数跳转到switch页面并传递参数
+    goToSwitchPage(pages, data);
+};
 </script>

+ 159 - 19
src/pages/plant/port/index.vue

@@ -5,27 +5,67 @@
                 <template #left><view class=""></view></template>
             </ut-navbar>
         </template>
-        <view class="b-radius pt-0 bg-#f7f7f7">
-            <up-sticky :offset-top="10">
-                <view class="d-flex a-c pd-26 bg-#f7f7f7">
-                    <view class="min-w-170 flex1">
-                        <ut-action-sheet v-model="form.queryType" :tabs="[{ label: '全部', value: '' }]" @change="onRefresh" title="选择原料类型">
-                            <view class="d-flex search-select-item a-c">
-                                <view class="flex1 ov-hd f-s-28 c-333 text-center f-w-5 w-s-no">{{ '全部' }} </view>
-                                <up-icon size="24rpx" color="#333" name="arrow-down-fill" class="mr-5"></up-icon>
-                            </view>
-                        </ut-action-sheet>
+        <up-sticky :offset-top="0">
+            <view class="d-flex a-c pd-26 pb-0 bg-#f7f7f7">
+                <view class="min-w-170 flex1">
+                    <ut-action-sheet v-model="form.queryType" :tabs="[{ label: '全部', value: '' }]" @change="onRefresh" title="选择原料类型">
+                        <view class="d-flex search-select-item a-c">
+                            <view class="flex1 ov-hd f-s-28 c-333 text-center f-w-5 w-s-no">{{ '全部' }} </view>
+                            <up-icon size="24rpx" color="#333" name="arrow-down-fill" class="mr-5"></up-icon>
+                        </view>
+                    </ut-action-sheet>
+                </view>
+                <view class="h-86 pl-20 w-100%">
+                    <ut-search ref="searchRef" v-model="form.keyword" @search="changeSeach" margin="0" :border="false" placeholder="搜批次号、品种名、基地名" bgColor="#fff" height="86rpx" borderRadius="10rpx"></ut-search>
+                </view>
+            </view>
+            <view class="pd-26 bg-#f7f7f7" :style="{ width: windowInfo ? windowInfo.screenWidth - 26 + 'px' : '100%' }">
+                <up-subsection :list="subList" :current="subCurrent" @change="sectionChange" style="width: 100%; height: 100rpx; background-color: #fff" inactive-color="#999" active-color="#37A954" fontSize="36rpx" mode="subsection"></up-subsection>
+            </view>
+        </up-sticky>
+        <!-- 养殖 -->
+        <view class="pd-26 pt-0">
+            <view class="b-radius bg-#fff pd-10">
+                <view class="d-flex j-ed f-s-22 c-#666"> 2025-12-25 </view>
+                <view class="d-flex a-ed pd-16 pt-8 pb-8">
+                    <view class="c-#333 f-s-34 f-w-5 mr-6"> 美洲大蠊</view>
+                    <view class="c-#666 f-s-26">虫卵属蓝棵</view>
+                </view>
+                <view class="d-flex a-c f-s-28 pd-16 pt-8 pb-8">
+                    <view class="c-#666 w-s-no">养殖批号:</view>
+                    <view class="c-#333 f-w-5">1231231231232</view>
+                </view>
+                <view class="d-flex a-c f-s-28 pd-16 pt-8 pb-8">
+                    <view class="c-#666 w-s-no">种源批号:</view>
+                    <view class="c-#333 f-w-5">1231231231232</view>
+                </view>
+                <view class="d-flex a-c f-s-28 pd-16 pt-8 pb-8">
+                    <view class="c-#666 w-s-no">基地:</view>
+                    <view class="c-#333 f-w-5 tx-ov w-s-no ov-hd">123112312312312312312312312312312312312312312323</view>
+                    <view class="flex1 d-flex j-ed"><up-icon name="arrow-right" size="34rpx"></up-icon></view>
+                </view>
+                <view class="d-flex f-s-28 pd-16 pt-8 pb-8">
+                    <view class="d-flex a-c w-50%">
+                        <view class="c-#666 w-s-no">养殖区域:</view>
+                        <view class="c-#333 f-w-5 tx-ov w-s-no ov-hd">20亩</view>
                     </view>
-                    <view class="h-86 pl-20 w-100%">
-                        <ut-search ref="searchRef" v-model="form.keyword" @search="changeSeach" margin="0" :border="false" placeholder="搜批次号、品种名、基地名" bgColor="#fff" height="86rpx" borderRadius="10rpx"></ut-search>
+                    <view class="d-flex a-c w-50%">
+                        <view class="c-#666 w-s-no">养殖量:</view>
+                        <view class="c-#333 f-w-5 tx-ov w-s-no ov-hd">120000</view>
                     </view>
                 </view>
-                <view class="pl-26 pr-26">
-                    <up-subsection :list="subList" :current="subCurrent" @change="sectionChange" style="width: 100%; height: 100rpx; background-color: #fff" active-color="#37A954" mode="subsection"></up-subsection>
+                <view class="pd-16 pt-8 pb-8">
+                    <up-line color="#f7f7f7"></up-line>
+                </view>
+                <view class="pd-16 pt-8 pb-8 d-flex j-sb gap-20">
+                    <up-button :customStyle="customStyle1">种源信息</up-button>
+                    <up-button :customStyle="customStyle2">饲养管理</up-button>
+                    <up-button :customStyle="customStyle3">采收管理</up-button>
                 </view>
-            </up-sticky>
+            </view>
         </view>
-        <view class="pd-26">
+        <!-- 种苗繁育 -->
+        <view class="pd-26 pt-0">
             <view class="b-radius bg-#fff pd-10">
                 <view class="d-flex j-ed f-s-22 c-#666"> 2025-12-25 </view>
                 <view class="d-flex a-ed pd-16 pt-8 pb-8">
@@ -33,7 +73,89 @@
                     <view class="c-#666 f-s-26">虫卵属蓝棵</view>
                 </view>
                 <view class="d-flex a-c f-s-28 pd-16 pt-8 pb-8">
-                    <view class="c-#666 w-s-no">养殖批号:</view>
+                    <view class="c-#666 w-s-no">繁育批号:</view>
+                    <view class="c-#333 f-w-5">1231231231232</view>
+                </view>
+                <view class="d-flex a-c f-s-28 pd-16 pt-8 pb-8">
+                    <view class="c-#666 w-s-no">种源批号:</view>
+                    <view class="c-#333 f-w-5">1231231231232</view>
+                </view>
+                <view class="d-flex a-c f-s-28 pd-16 pt-8 pb-8">
+                    <view class="c-#666 w-s-no">基地:</view>
+                    <view class="c-#333 f-w-5 tx-ov w-s-no ov-hd">123112312312312312312312312312312312312312312323</view>
+                    <view class="flex1 d-flex j-ed"><up-icon name="arrow-right" size="34rpx"></up-icon></view>
+                </view>
+                <view class="d-flex f-s-28 pd-16 pt-8 pb-8">
+                    <view class="d-flex a-c w-50%">
+                        <view class="c-#666 w-s-no">种植面积:</view>
+                        <view class="c-#333 f-w-5 tx-ov w-s-no ov-hd">20亩</view>
+                    </view>
+                    <view class="d-flex a-c w-50%">
+                        <view class="c-#666 w-s-no">繁育量:</view>
+                        <view class="c-#333 f-w-5 tx-ov w-s-no ov-hd">120000</view>
+                    </view>
+                </view>
+                <view class="pd-16 pt-8 pb-8">
+                    <up-line color="#f7f7f7"></up-line>
+                </view>
+                <view class="pd-16 pt-8 pb-8 d-flex j-sb gap-20">
+                    <up-button :customStyle="customStyle1">种源信息</up-button>
+                    <up-button :customStyle="customStyle2">种植管理</up-button>
+                    <up-button :customStyle="customStyle3">采收管理</up-button>
+                </view>
+            </view>
+        </view>
+        <!-- 种植 -->
+        <view class="pd-26 pt-0">
+            <view class="b-radius bg-#fff pd-10">
+                <view class="d-flex j-ed f-s-22 c-#666"> 2025-12-25 </view>
+                <view class="d-flex a-ed pd-16 pt-8 pb-8">
+                    <view class="c-#333 f-s-34 f-w-5 mr-6"> 美洲大蠊</view>
+                    <view class="c-#666 f-s-26">虫卵属蓝棵</view>
+                </view>
+                <view class="d-flex a-c f-s-28 pd-16 pt-8 pb-8">
+                    <view class="c-#666 w-s-no">种植批号:</view>
+                    <view class="c-#333 f-w-5">1231231231232</view>
+                </view>
+                <view class="d-flex a-c f-s-28 pd-16 pt-8 pb-8">
+                    <view class="c-#666 w-s-no">种源批号:</view>
+                    <view class="c-#333 f-w-5">1231231231232</view>
+                </view>
+                <view class="d-flex a-c f-s-28 pd-16 pt-8 pb-8">
+                    <view class="c-#666 w-s-no">基地:</view>
+                    <view class="c-#333 f-w-5 tx-ov w-s-no ov-hd">123112312312312312312312312312312312312312312323</view>
+                    <view class="flex1 d-flex j-ed"><up-icon name="arrow-right" size="34rpx"></up-icon></view>
+                </view>
+                <view class="d-flex f-s-28 pd-16 pt-8 pb-8">
+                    <view class="d-flex a-c w-50%">
+                        <view class="c-#666 w-s-no">种植面积:</view>
+                        <view class="c-#333 f-w-5 tx-ov w-s-no ov-hd">20亩</view>
+                    </view>
+                    <view class="d-flex a-c w-50%">
+                        <view class="c-#666 w-s-no">种植量:</view>
+                        <view class="c-#333 f-w-5 tx-ov w-s-no ov-hd">120000</view>
+                    </view>
+                </view>
+                <view class="pd-16 pt-8 pb-8">
+                    <up-line color="#f7f7f7"></up-line>
+                </view>
+                <view class="pd-16 pt-8 pb-8 d-flex j-sb gap-20">
+                    <up-button :customStyle="customStyle1">种源信息</up-button>
+                    <up-button :customStyle="customStyle2">种植管理</up-button>
+                    <up-button :customStyle="customStyle3">采收管理</up-button>
+                </view>
+            </view>
+        </view>
+        <!-- 种畜繁育 -->
+        <view class="pd-26 pt-0">
+            <view class="b-radius bg-#fff pd-10">
+                <view class="d-flex j-ed f-s-22 c-#666"> 2025-12-25 </view>
+                <view class="d-flex a-ed pd-16 pt-8 pb-8">
+                    <view class="c-#333 f-s-34 f-w-5 mr-6"> 美洲大蠊</view>
+                    <view class="c-#666 f-s-26">虫卵属蓝棵</view>
+                </view>
+                <view class="d-flex a-c f-s-28 pd-16 pt-8 pb-8">
+                    <view class="c-#666 w-s-no">繁育批号:</view>
                     <view class="c-#333 f-w-5">1231231231232</view>
                 </view>
                 <view class="d-flex a-c f-s-28 pd-16 pt-8 pb-8">
@@ -65,16 +187,22 @@
                 </view>
             </view>
         </view>
-
         <view class="h-210" v-if="list?.length"></view>
         <view v-if="list?.length" :style="{ height: `${safeAreaBottom}px` }"></view>
+        <template #empty>
+            <view class="d-flex flex-cln a-c" style="margin-top: -200rpx">
+                <ut-empty class="mg-at" color="#ccc" size="28rpx" image="/static/images/plant/noEmptyBase.png">暂无进行中的养殖任务</ut-empty>
+                <text class="c-#ccc f-s-28">点击下方按钮去添加吧~</text>
+            </view>
+        </template>
         <template #bottom>
             <ut-tabar activeTab="planting"></ut-tabar>
         </template>
     </z-paging>
 </template>
 <script setup lang="ts">
-const list = ref<unknown[]>([]);
+import { useClientRequest } from '@/utils/request';
+const list = ref<unknown[]>();
 const form = ref({ queryType: '', keyword: '' });
 const paging = ref();
 const windowInfo = uni.getWindowInfo();
@@ -89,6 +217,18 @@ const sectionChange = (index: number) => {
 const changeSeach = () => {
     paging.value.reload();
 };
+const query = async (pageNum: number, pageSize: number) => {
+    const params = {
+        pageNum,
+        pageSize,
+        ...form.value,
+    };
+    const res = await useClientRequest.get('/plt-api/app/base/pageList', params);
+    if (res) {
+        const { rows } = res;
+        paging.value.complete(rows);
+    }
+};
 //按钮样式
 const customStyle1 = reactive({
     color: '#37A954',

File diff suppressed because it is too large
+ 0 - 1
stats.html


Some files were not shown because too many files changed in this diff