Selaa lähdekoodia

Merge branch 'master' of http://www.sysuimars.cn:3000/feiniao/feiniao-farm-h5

lxf 1 viikko sitten
vanhempi
commit
146f62cc69

+ 1 - 1
src/api/modules/farm.js

@@ -59,7 +59,7 @@ module.exports = {
     },
     // 获取农资店列表
     getStoreList: {
-        url: config.base_dev_url + "z_agricultural_store/list",
+        url: config.base_dev_url + "z_agricultural_store/page/{page}/{limit}",
         type: "get",
     },
 }

+ 1 - 1
src/components/chatWindow.vue

@@ -423,7 +423,7 @@ watch(
 );
 
 onDeactivated(() => {
-    // mqttClient.value.client.end(true);
+    mqttClient.value && mqttClient.value.client.end(true);
 });
 
 // mqtt 连接

+ 12 - 2
src/views/old_mini/agri_services/components/farmDynamics.vue

@@ -109,6 +109,10 @@ const props = defineProps({
         type: String,
         default: "",
     },
+    active: {
+        type: Number,
+        default: 0,
+    },
 });
 
 const handleConfirmComplete = (section) => {
@@ -223,8 +227,10 @@ onMounted(() => {
     getContentData();
 });
 
-onActivated(() => {
-    getContentData();
+onActivated(() => { 
+    if(props.active == 0){
+        getContentData();
+    }
 });
 
 const contentData = ref([]);
@@ -252,6 +258,10 @@ const getContentData = async () => {
     }
 };
 
+defineExpose({
+    getContentData,
+});
+
 async function getItemDetail(id) {
     const { data } = await VE_API.z_farm_work_record.getDetail({ id });
     return data || {};

+ 79 - 29
src/views/old_mini/agri_services/components/servicesHall.vue

@@ -4,12 +4,10 @@
         <div class="map-container" ref="mapContainer"></div>
 
         <div class="search-wrap">
-            <el-input
+            <location-search
                 class="search"
-                v-model="searchValue"
-                placeholder="搜索位置"
-                @search="search"
-                :prefix-icon="Search"
+                user-location="113.61702297075017,23.584863449735067"
+                @change="handleLocationChange"
             />
         </div>
 
@@ -43,29 +41,30 @@
             </template>
             <div class="hall-content">
                 <div class="farm-list" ref="cardContentRef" :style="{ height: `${cardContentHeight}px` }">
-                    <div class="task-item" v-for="item in agriculturalStoreList" :key="item.id">
+                    <div class="task-item" v-for="item in agriculturalStoreList" :key="item.id" @click="handleDetail(item)">
                         <div class="task-content">
                             <div class="content-t">
-                                <img class="content-img" src="" alt="" />
+                                <img class="content-img" :src="item.bgUrl" alt="" />
                                 <div class="content-info">
-                                    <div class="content-name">{{ item.storeName }} <span>{{ item.score }}分</span></div>
+                                    <div class="content-name">{{ item.storeName }} <span>{{ item.score||0 }}分</span></div>
                                     <div class="content-text">
                                         <div class="text-item van-ellipsis">
                                             <span>服务类型:</span>
-                                            <span class="text-value">剪枝</span>
+                                            <span class="text-value" v-for="(ele, index) in item.serviceTypeList" :key="ele"
+                                                >{{ ele }}{{ index !== item.serviceTypeList.length - 1 ? "、" : "" }}</span>
                                         </div>
                                         <div class="text-item van-ellipsis">
                                             <span>服务品种:</span>
-                                            <span class="text-value" v-for="ele in item.speciesList" :key="ele"
+                                            <span class="text-value" v-for="(ele, index) in item.speciesList" :key="ele"
                                                 >{{ ele }}{{ index !== item.speciesList.length - 1 ? "、" : "" }}</span>
                                         </div>
                                         <div class="text-item van-ellipsis">
                                             <span>服务区域:</span>
-                                            <span class="text-value">{{ item.address }}</span>
+                                            <span class="text-value">{{ item.address||'无' }}</span>
                                         </div>
                                         <div class="text-item van-ellipsis">
                                             <span>服务设备:</span>
-                                            <span class="text-value" v-for="ele in item.equipmentList" :key="ele"
+                                            <span class="text-value" v-for="(ele, index) in item.equipmentList" :key="ele"
                                                 >{{ ele
                                                 }}{{ index !== item.equipmentList.length - 1 ? "、" : "" }}</span>
                                         </div>
@@ -90,7 +89,7 @@
                                     <Icon name="phone-o" />
                                     <span>电话联系</span>
                                 </div> -->
-                                <div class="r-item">
+                                <div class="r-item" @click.stop="handleOnlineChat(item)">
                                     <Icon name="chat-o" />
                                     <span>线上沟通</span>
                                 </div>
@@ -108,8 +107,11 @@ import { FloatingPanel, Icon } from "vant";
 import { computed, nextTick, onMounted, ref } from "vue";
 import { useStore } from "vuex";
 import IndexMap from "../map/index";
-import taskItem from "@/components/taskItem.vue";
-import { Search } from "@element-plus/icons-vue";
+import LocationSearch from "@/components/pageComponents/LocationSearch.vue";
+import { Point } from "ol/geom";
+import Feature from "ol/Feature";
+import { useRouter } from "vue-router";
+const router = useRouter();
 const props = defineProps({
     isCapital: {
         type: Boolean,
@@ -125,37 +127,79 @@ const height = ref(anchors.value[0]);
 
 const indexMap = new IndexMap();
 const mapContainer = ref(null);
+const mapPoint = ref(null);
 
 onMounted(() => {
-    const point = store.state.home.miniUserLocationPoint;
+    mapPoint.value = store.state.home.miniUserLocationPoint;
     nextTick(() => {
-        indexMap.initMap(point, mapContainer.value, props.isCapital);
+        indexMap.initMap(mapPoint.value, mapContainer.value, props.isCapital);
+        // 设置服务大厅图层点击事件回调
+        indexMap.setGardenHallClickCallback((featureData,) => {
+            router.push(`/expert_homepage?isStore=true&id=${featureData.id}`);
+        });
     });
 
     getStoreList();
 });
 
+const handleDetail = (item) => {
+    router.push(`/expert_homepage?isStore=true&id=${item.id}`);
+};
+
 const agriculturalStoreList = ref([]);
-const getStoreList = () => {
-    VE_API.farm.getStoreList({ type: 1 }).then((res) => {
+const getStoreList = (isInitial = true) => {
+    const params = {
+        page: 1,
+        limit: 99,
+        type: 1,
+    };
+    VE_API.farm.getStoreList(params).then((res) => {
         if (res.data.length) {
             agriculturalStoreList.value = res.data.map((item) => {
                 return {
                     ...item,
-                    speciesList: JSON.parse(item.serviceSpecies || "[]"),
-                    equipmentList: JSON.parse(item.serviceEquipment || "[]"),
+                    speciesList: JSON.parse(item.serviceSpecies || "[\"--\"]"),
+                    equipmentList: JSON.parse(item.serviceEquipment || "[\"--\"]"),
+                    serviceTypeList: JSON.parse(item.serviceType || "[\"--\"]"),
                 };
             });
-            console.log(agriculturalStoreList.value);
+            if (isInitial) {
+                indexMap.initDataHall(res.data);
+            }
         }
     });
 };
 
+// 处理位置搜索变化
+function handleLocationChange(data) {
+    if (data && data.coordinateArray) {
+        mapPoint.value = data.point;
+        // 更新地图位置
+        if (indexMap && indexMap.kmap) {
+            indexMap.kmap.getView().animate({
+                center: data.coordinateArray,
+                zoom: 16,
+                duration: 500,
+            });
+            // 更新点击点
+            if (indexMap.clickPointLayer) {
+                indexMap.clickPointLayer.source.clear();
+                const point = new Feature(new Point(data.coordinateArray));
+                indexMap.clickPointLayer.addFeature(point);
+            }
+        }
+        getStoreList(false);
+    } else {
+        // 重置为初始位置
+        mapPoint.value = store.state.home.miniUserLocationPoint;
+        indexMap.clickPointLayer.source.clear();
+        // 更新区县列表
+        getStoreList();
+    }
+}
+
 const cardContentHeight = ref(245);
-const searchValue = ref("");
-const search = () => {
-    console.log(searchValue.value);
-};
+
 const areaValue = ref("");
 const areaOptions = [
     { value: "1", label: "5km" },
@@ -179,9 +223,14 @@ const handleHeightChange = ({ height }) => {
     }
 };
 
-function toPage() {
-    console.log("topage");
-}
+const handleOnlineChat = ({miniUserIds}) => {
+    router.push(`/chat_frame?userId=${miniUserIds[0]}`);
+};
+
+defineExpose({
+    getStoreList,
+});
+
 </script>
 
 <style lang="scss" scoped>
@@ -252,6 +301,7 @@ function toPage() {
                             border-radius: 8px;
                         }
                         .content-info {
+                            width: calc(100% - 98px);
                             .content-name {
                                 font-size: 16px;
                                 font-weight: 500;

+ 15 - 5
src/views/old_mini/agri_services/index.vue

@@ -1,22 +1,22 @@
 <template>
     <div class="agri-services" :style="{ height: type !== 'manage' ? `calc(100vh - ${tabBarHeight}px - 50px)` : '100vh' }">
         <custom-header name="农事管理" v-if="type === 'manage'"></custom-header>
-        <tabs v-model:active="active" class="tabs" v-if="type !== 'manage'">
+        <tabs v-model:active="active" class="tabs" v-if="type !== 'manage'" @change="handleTabChange">
             <tab title="农事管理">
-                <farm-dynamics />
+                <farm-dynamics ref="farmDynamicsRef" :active="active" />
             </tab>
             <tab title="服务大厅">
-                <services-hall />
+                <services-hall ref="servicesHallRef" />
             </tab>
         </tabs>
         <div v-else class="farm-dynamics-container">
-            <farm-dynamics :type="type" />
+            <farm-dynamics ref="farmDynamicsRef" :type="type" />
         </div>
     </div>
 </template>
 
 <script setup>
-import { ref, computed, onMounted } from "vue";
+import { ref, computed } from "vue";
 import { useRoute } from "vue-router";
 import { useStore } from "vuex";
 import { Tab, Tabs } from "vant";
@@ -31,6 +31,16 @@ const active = ref(0);
 
 const type = ref(route.query.type);
 
+const servicesHallRef = ref(null);
+const farmDynamicsRef = ref(null);
+const handleTabChange = (index) => {
+    if (index === 1) {
+        servicesHallRef.value && servicesHallRef.value.getStoreList();
+    }else{
+        farmDynamicsRef.value && farmDynamicsRef.value.getContentData();
+    }
+}
+
 </script>
 <style lang="scss" scoped>
 .agri-services {

+ 59 - 336
src/views/old_mini/agri_services/map/index.js

@@ -6,7 +6,8 @@ import Feature from "ol/Feature";
 import Style from "ol/style/Style";
 import Photo from "ol-ext/style/Photo";
 import { Fill, Text, Icon, Stroke } from "ol/style.js";
-import { newPoint} from "@/utils/map";
+import { newPoint } from "@/utils/map";
+import VectorLayer from "ol/layer/Vector";
 
 /**
  * @description 地图层对象
@@ -21,7 +22,7 @@ class IndexMap {
       style: (f) => {
         return new Style({
           image: new Icon({
-            src: require("@/assets/img/home/farm-point.png"),
+            src: require("@/assets/img/home/garden-point.png"),
             scale: 0.5,
             anchor: [0.5, 1],
           }),
@@ -29,50 +30,25 @@ class IndexMap {
       },
     });
 
-    this.gardenPointLayer = new KMap.VectorLayer("gardenPointLayer", 99, {
+    this.gardenHallLayer = new KMap.VectorLayer("gardenHallLayer", 99, {
       minZoom: 6,
       maxZoom: 22,
       style: (feature) => {
-        let style1 = new Style({
-          image: new Photo({
-            src: "https://birdseye-img.sysuimars.com/ai_result/2023/11/20/tree_4414/img_27572.jpg" + '?imageView2/1/w/300/interlace/1',
-            radius: 19,
-            shadow: 0,
-            crop: true,
-            onload: function () {
-              that.gardenPointLayer.layer.changed();
-            },
-            displacement: [-1, -1],
-            stroke: new Stroke({
-              width: 2,
-              color: "#fdfcfc00",
-            }),
-          }),
-        });
         let style2 = new Style({
-          image: new Photo({
-            src: require("@/assets/img/map/garden-border.png"),
-            radius: 24,
-            shadow: 0,
-            crop: false,
-            onload: function () {
-              that.gardenPointLayer.layer.changed();
-            },
-            displacement: [0, -6],
-            stroke: new Stroke({
-              width: 0,
-              color: "#fdfcfc00",
-            }),
+          image: new Icon({
+            src: require("@/assets/img/home/farm-point.png"),
+            scale: 0.5,
+            anchor: [0.5, 1],
+            displacement: [0, -36],
           }),
         });
         let style3 = new Style({
           text: new Text({
-            // text: '2.18 农事1',
-            text: feature.get('mapInfo'),
+            text: feature.get('shortName') || '--',
             offsetX: 0,
             offsetY: -30,
             font: "bold 12px sans-serif",
-            fill: new Fill({ color: "#fff" }), // 字体颜色
+            fill: new Fill({ color: "#2199F8" }), // 字体颜色
           }),
         });
 
@@ -82,14 +58,14 @@ class IndexMap {
         // 矩形的参数
         const x = 150; // 矩形中心点的x坐标
         const y = 100; // 矩形中心点的y坐标
-        const width = 98; // 矩形的宽度
+        const width = 58; // 矩形的宽度
         const height = 20; // 矩形的高度
-        const cornerRadius = 8; // 圆角半径
+        const cornerRadius = 4; // 圆角半径
 
         // 创建渐变
         const gradient = ctx.createLinearGradient(x - width / 2, y, x + width / 2, y);
-        gradient.addColorStop(0, '#2199F8');   // 渐变起始颜色
-        gradient.addColorStop(1, '#2199F8');  // 渐变结束颜色
+        gradient.addColorStop(0, '#fff');   // 渐变起始颜色
+        gradient.addColorStop(1, '#fff');  // 渐变结束颜色
 
         // 绘制圆角矩形
         ctx.beginPath();
@@ -115,7 +91,7 @@ class IndexMap {
         });
 
 
-        return [style1, style2, newStyle, style3];
+        return [style2, newStyle, style3];
       },
     });
   }
@@ -123,306 +99,53 @@ class IndexMap {
   initMap(location, target, isCapital) {
     let level = 16;
     let coordinate = util.wktCastGeom(location).getFirstCoordinate();
-    this.kmap = new KMap.Map(target, level, coordinate[0], coordinate[1], null, 8, 22, isCapital ? "img" : "vec");
-    let xyz2 = config.base_img_url3 + "map/lby/{z}/{x}/{y}.png";
-    this.kmap.addXYZLayer(xyz2, { minZoom: 8, maxZoom: 22 }, 2);
+    this.kmap = new KMap.Map(target, level, coordinate[0], coordinate[1], null, 6, 22, isCapital ? "img" : "vec");
     this.kmap.addLayer(this.clickPointLayer.layer);
-    this.kmap.addLayer(this.gardenPointLayer.layer);
-    if (isCapital) {
-      this.initData()
-      const point = ["113.61652616170711,23.58399613872042", "113.61767554789421, 23.590079887444034", "113.62757101477101, 23.590796948574365", "113.62240816252164, 23.59499176519138"]
-    } else {
-      let point = new Feature(new Point(coordinate))
-      this.clickPointLayer.addFeature(point)
-    }
+    this.kmap.addLayer(this.gardenHallLayer.layer);
+    
+    // 添加点击事件
+    this.addGardenHallClick();
+  }
+
+  // 添加服务大厅图层点击事件
+  addGardenHallClick() {
+    let that = this;
+    this.kmap.on("singleclick", (evt) => {
+      that.kmap.map.forEachFeatureAtPixel(evt.pixel, function (feature, layer) {
+        if (layer instanceof VectorLayer && layer.get("name") === "gardenHallLayer") {
+          // 获取点击的要素数据
+          const featureData = feature.getProperties();
+          // 触发点击事件回调
+          if (that.onGardenHallClick) {
+            that.onGardenHallClick(featureData, evt);
+          }
+          return feature;
+        }
+      });
+    });
+  }
+
+  // 设置点击事件回调
+  setGardenHallClickCallback(callback) {
+    this.onGardenHallClick = callback;
   }
 
-  initData() {
-    const gardenList = [{
-      "consequenceText": "如果不做本次农事,会导致您的产量、质量下降15%,管理得分降低5分",
-      "id": "274655",
-      "reCheckText": "本次农事复核成效优异,作物产量潜力实现大幅增长,虫害风险控制优异,未发现虫害风险",
-      "farmName": "荔枝博览园",
-      "farmPoint": "POINT(113.61652616170711 23.58399613872042)",
-      "orderId": "745923635683790848",
-      "area": 2.719998598098755,
-      "expert": 91356,
-      "orderStatus": 4,
-      "activeStatus": 0,
-      "farmId": 766,
-      "regionId": 2,
-      "speciesId": "1",
-      "speciesName": "荔枝",
-      "agriculturalId": 24,
-      "farmWorkId": "699343457474318336",
-      "farmWorkLibId": "699343457474318336",
-      "farmWorkLibName": "梢期防虫",
-      "farmWorkName": "梢期防虫",
-      "expertIcon": "https://birdseye-img.sysuimars.com/birdseye-look-vue/%E5%BE%AE%E4%BF%A1%E5%9B%BE%E7%89%87_20250411150343.png",
-      "expertName": "韦帮稳",
-      "expertUserIcon": "",
-      "expertUserName": "韦帮稳",
-      "icon": 4,
-      "indexChart": [],
-      "indexName": "",
-      "beforeExecuteDate": "2024-12-03",
-      "checkDate": null,
-      "executeDate": "2025-08-15",
-      "indexJson": "",
-      "code": "BZ-BC-04-SQFC-20",
-      "expertPrescription": "",
-      "condition": "单树嫩叶率大于20.0%",
-      "solarName": "",
-      "reCheck": null,
-      "menu": 1,
-      "isEdit": 0,
-      "isMaster": null,
-      "num": null,
-      "purpose": "",
-      "selfExec": null,
-      "defaultFarmWork": 0,
-      "farmWorkType": 3,
-      "farmWorkTypeName": "病虫",
-      "type": 1,
-      "execute": 4,
-      "updateDate0": "2025-08-20",
-      "updateDate1": null,
-      "updateDate2": null,
-      "updateDate3": null,
-      "updateDate4": null,
-      "updateDate5": null,
-      "usageMode": "叶面施",
-      "serviceMain": "广州泽秾丰农资有限公司",
-      "updateDate6": null,
-      "confirmPicture": [],
-      "executeMain": "广州泽秾丰农资有限公司",
-      "storeShortName": "泽秾丰",
-      "weatherWarningMsg": "",
-      "executeEvidence": [],
-      "userEvaluation": null,
-      "reviewDate": null,
-      "reviewDate2": null,
-      "reviewImage": [],
-      "reviewImage2": [],
-      "serviceRegion": "广州市从化区荔枝博览园",
-      "cost": null,
-    },
-    {
-      "consequenceText": "如果不做本次农事,会导致您的产量、质量下降15%,管理得分降低5分",
-      "id": "274656",
-      "reCheckText": "本次农事复核成效优异,作物产量潜力实现大幅增长,控梢情况优秀,叶芽绿在5%以内",
-      "farmName": "荔枝博览园",
-      "farmPoint": "POINT(113.61767554789421 23.590079887444034)",
-      "orderId": "745923638623997952",
-      "area": 2.719998598098755,
-      "expert": 91356,
-      "orderStatus": 4,
-      "activeStatus": 0,
-      "farmId": 766,
-      "regionId": 2,
-      "speciesId": "1",
-      "speciesName": "荔枝",
-      "agriculturalId": 24,
-      "farmWorkId": "699343457474318337",
-      "farmWorkLibId": "699343457474318337",
-      "farmWorkLibName": "控梢",
-      "farmWorkName": "控梢",
-      "expertIcon": "https://birdseye-img.sysuimars.com/birdseye-look-vue/%E5%BE%AE%E4%BF%A1%E5%9B%BE%E7%89%87_20250411150343.png",
-      "expertName": "韦帮稳",
-      "expertUserIcon": "",
-      "expertUserName": "韦帮稳",
-      "icon": 4,
-      "indexChart": [],
-      "indexName": "",
-      "beforeExecuteDate": "2024-12-15",
-      "checkDate": null,
-      "executeDate": "2024-12-03",
-      "indexJson": "",
-      "code": "YJ-TJ-04-KS-14",
-      "expertPrescription": "",
-      "condition": "园区叶芽率大于10.0%",
-      "solarName": "",
-      "reCheck": null,
-      "menu": 1,
-      "isEdit": 0,
-      "isMaster": null,
-      "num": null,
-      "purpose": "",
-      "selfExec": null,
-      "defaultFarmWork": 0,
-      "farmWorkType": 1,
-      "farmWorkTypeName": "调节",
-      "type": 0,
-      "execute": 4,
-      "updateDate0": "2025-08-20",
-      "updateDate1": null,
-      "updateDate2": null,
-      "updateDate3": null,
-      "updateDate4": null,
-      "updateDate5": null,
-      "usageMode": "叶面施",
-      "serviceMain": "广州泽秾丰农资有限公司",
-      "updateDate6": null,
-      "confirmPicture": [],
-      "executeMain": "广州泽秾丰农资有限公司",
-      "storeShortName": "泽秾丰",
-      "weatherWarningMsg": "",
-      "executeEvidence": [],
-      "userEvaluation": null,
-      "reviewDate": null,
-      "reviewDate2": null,
-      "reviewImage": [],
-      "reviewImage2": [],
-      "serviceRegion": "广州市从化区荔枝博览园",
-      "cost": null,
-    },
-    {
-      "consequenceText": "如果不做本次农事,会导致您的产量、质量下降50%,管理得分降低15分",
-      "id": "274657",
-      "reCheckText": "本次农事复核成效优异,作物产量潜力实现大幅增长,树体营养较充足,土壤肥力增加",
-      "farmName": "荔枝博览园",
-      "farmPoint": "POINT(113.62757101477101 23.590796948574365)",
-      "orderId": "745923641274798080",
-      "area": 2.719998598098755,
-      "expert": 91356,
-      "orderStatus": 4,
-      "activeStatus": 0,
-      "farmId": 766,
-      "regionId": 2,
-      "speciesId": "1",
-      "speciesName": "荔枝",
-      "agriculturalId": 24,
-      "farmWorkId": "699343457474318338",
-      "farmWorkLibId": "699343457474318338",
-      "farmWorkLibName": "基肥",
-      "farmWorkName": "基肥",
-      "expertIcon": "https://birdseye-img.sysuimars.com/birdseye-look-vue/%E5%BE%AE%E4%BF%A1%E5%9B%BE%E7%89%87_20250411150343.png",
-      "expertName": "韦帮稳",
-      "expertUserIcon": "",
-      "expertUserName": "韦帮稳",
-      "icon": 4,
-      "indexChart": [],
-      "indexName": "",
-      "beforeExecuteDate": "2024-12-15",
-      "checkDate": null,
-      "executeDate": "2024-12-15",
-      "indexJson": "",
-      "code": "BZ-YY-04-JF-300",
-      "expertPrescription": "",
-      "condition": "基肥日期大于1215",
-      "solarName": "",
-      "reCheck": null,
-      "menu": 1,
-      "isEdit": 0,
-      "isMaster": null,
-      "num": null,
-      "purpose": "",
-      "selfExec": null,
-      "defaultFarmWork": 0,
-      "farmWorkType": 2,
-      "farmWorkTypeName": "营养",
-      "type": 1,
-      "execute": 4,
-      "updateDate0": "2025-08-20",
-      "updateDate1": null,
-      "updateDate2": null,
-      "updateDate3": null,
-      "updateDate4": null,
-      "updateDate5": null,
-      "usageMode": "根部施",
-      "serviceMain": "广州泽秾丰农资有限公司",
-      "updateDate6": null,
-      "confirmPicture": [],
-      "executeMain": "广州泽秾丰农资有限公司",
-      "storeShortName": "泽秾丰",
-      "weatherWarningMsg": "",
-      "executeEvidence": [],
-      "userEvaluation": null,
-      "reviewDate": null,
-      "reviewDate2": null,
-      "reviewImage": [],
-      "reviewImage2": [],
-      "serviceRegion": "广州市从化区荔枝博览园",
-      "cost": null,
-    },
-    {
-      "consequenceText": "如果不做本次农事,会导致您的产量、质量下降10%,管理得分降低3分",
-      "id": "274658",
-      "reCheckText": "本次农事复核成效优异,作物产量潜力实现大幅增长,病虫害基数得到大幅下降,未发现病虫害风险",
-      "farmName": "荔枝博览园",
-      "farmPoint": "POINT(113.62240816252164 23.59499176519138)",
-      "orderId": "745923644080787456",
-      "area": 2.719998598098755,
-      "expert": 91356,
-      "orderStatus": 4,
-      "activeStatus": 0,
-      "farmId": 766,
-      "regionId": 2,
-      "speciesId": "1",
-      "speciesName": "荔枝",
-      "agriculturalId": 24,
-      "farmWorkId": "699343457474318339",
-      "farmWorkLibId": "699343457474318339",
-      "farmWorkLibName": "清园",
-      "farmWorkName": "清园",
-      "expertIcon": "https://birdseye-img.sysuimars.com/birdseye-look-vue/%E5%BE%AE%E4%BF%A1%E5%9B%BE%E7%89%87_20250411150343.png",
-      "expertName": "韦帮稳",
-      "expertUserIcon": "",
-      "expertUserName": "韦帮稳",
-      "icon": 4,
-      "indexChart": [],
-      "indexName": "",
-      "beforeExecuteDate": "2024-12-27",
-      "checkDate": null,
-      "executeDate": "2024-12-15",
-      "indexJson": "",
-      "code": "BZ-BC-04-QY-100",
-      "expertPrescription": "",
-      "condition": "清园日期大于1215",
-      "solarName": "",
-      "reCheck": null,
-      "menu": 1,
-      "isEdit": 0,
-      "isMaster": null,
-      "num": null,
-      "purpose": "",
-      "selfExec": null,
-      "defaultFarmWork": 0,
-      "farmWorkType": 3,
-      "farmWorkTypeName": "病虫",
-      "type": 1,
-      "execute": 4,
-      "updateDate0": "2025-08-20",
-      "updateDate1": null,
-      "updateDate2": null,
-      "updateDate3": null,
-      "updateDate4": null,
-      "updateDate5": null,
-      "usageMode": "叶面施",
-      "serviceMain": "广州泽秾丰农资有限公司",
-      "updateDate6": null,
-      "confirmPicture": [],
-      "executeMain": "广州泽秾丰农资有限公司",
-      "storeShortName": "泽秾丰",
-      "weatherWarningMsg": "",
-      "executeEvidence": [],
-      "userEvaluation": null,
-      "reviewDate": null,
-      "reviewDate2": null,
-      "reviewImage": [],
-      "reviewImage2": [],
-      "serviceRegion": "广州市从化区荔枝博览园",
-      "cost": null,
-    }]
-    for (let item of gardenList) {
-      item.mapInfo = item.executeDate?.replace(/^\d{4}-(\d{2})-(\d{2})$/, '$1.$2') + '  ' + item.farmWorkName
-      this.gardenPointLayer.source.addFeature(newPoint(item, "farmPoint", "myGarden"))
+  initDataHall(taskList) {
+    this.gardenHallLayer.source.clear();
+    if (taskList.length > 0) {  // 如果任务列表不为空,则添加任务点
+      for (let item of taskList) {
+        try{
+          this.gardenHallLayer.source.addFeature(newPoint(item, "point", "hallGarden"))
+        }catch(error){
+          console.log('error');
+        }
+      }
+      this.kmap.getView().fit(this.gardenHallLayer.source.getExtent(), { padding: [60, 40, 30, 40] });
+      const finalZoom = this.kmap.getView().getZoom();
+      if (finalZoom > 18) {
+        this.kmap.getView().setZoom(18);
+      }
     }
-    this.kmap.getView().fit(this.gardenPointLayer.source.getExtent(), { padding: [20, 2, 20, 2] });
-    // const finalZoom = this.kmap.getView().getZoom();
-    // if (finalZoom > 18) {
-    //   this.kmap.getView().setZoom(18);
-    // }
   }
 }
 

+ 5 - 1
src/views/old_mini/home/components/AgriculturalDynamics.vue

@@ -81,7 +81,11 @@ const handleItem = (item) => {
     if (activeTab.value === 4) {
         router.push("/expert_detail?id=" + item.id);
     } else {
-        router.push("/warning_detail?id=" + item.id);
+        let showImage = false;
+        if(activeTab.value === 2){
+            showImage = true;
+        }
+        router.push("/warning_detail?id=" + item.id + "&showImage=" + showImage);
     }
 };
 

+ 24 - 3
src/views/old_mini/home/index.vue

@@ -1,6 +1,11 @@
 <template>
     <div class="home-index" :style="{ height: `calc(100vh - ${tabBarHeight}px)` }">
-        <img class="banner" @click="handleBannerClick" :src="bannerObj?.media?.[0]" alt="" />
+        <div class="banner-wrap">
+            <img class="banner-img" @click="handleBannerClick" :src="bannerObj?.media?.[0]" alt="" />
+            <div class="banner-title">
+                <span class="van-multi-ellipsis--l2">{{ bannerObj?.title }}</span>
+            </div>
+        </div>
         <!-- 天气遮罩 -->
         <div class="weather-mask" v-show="isExpanded" @click="handleMaskClick"></div>
         <!-- 天气 -->
@@ -207,12 +212,28 @@ const handleBannerClick = () => {
     height: 100vh;
     overflow: auto;
     position: relative;
-    .banner {
+    .banner-wrap {
         width: 100%;
         height: 200px;
-        object-fit: cover;
         position: relative;
         z-index: 1;
+        .banner-img{
+            width: 100%;
+            height: 100%;
+            object-fit: cover;
+        }
+        .banner-title{
+            position: absolute;
+            bottom: 0;
+            left: 0;
+            width: 100%;
+            padding: 10px 12px 34px 12px;
+            box-sizing: border-box;
+            background-color: rgba(0, 0, 0, 0.35);
+            color: #fff;
+            font-weight: bold;
+            backdrop-filter: blur(4px);
+        }
     }
     .weather-mask {
         position: fixed;

+ 3 - 1
src/views/old_mini/home/subPages/warningDetail.vue

@@ -11,7 +11,7 @@
                 </div>
             </div>
 
-            <div class="article-image">
+            <div class="article-image" v-if="showImage">
                 <img :src="warningDetail?.media && warningDetail?.media[0]" alt="荔枝开花图片" />
             </div>
 
@@ -30,7 +30,9 @@ import { useRoute } from "vue-router";
 const route = useRoute();
 
 const warningDetail = ref({});
+const showImage = ref(false);
 onActivated(() => {
+    showImage.value = route.query.showImage === 'true' ? true : false;
     getWarningDetail();
 });