Parcourir la source

fix: 修复上传回显图片,对接农资个人统计信息

lxf il y a 2 semaines
Parent
commit
6aa36d3606

+ 5 - 1
src/api/modules/z_agricultural_store.js

@@ -9,5 +9,9 @@ module.exports = {
     updatePrice: {
         url: url + "/service_price/update",
         type: "post",
-    }
+    },
+    statistics: {
+        url: url + "/statistics",
+        type: "get",
+    },
 }

+ 1 - 1
src/views/old_mini/agri_work/components/priceTable.vue

@@ -21,7 +21,7 @@
                 >
                     <div class="new-table">
                         <div class="line-l">
-                            <div class="line-1 title-1">{{ subP.typeName }}</div>
+                            <div class="line-1 title-1">{{ prescriptionItem.name }}</div>
                             <div class="line-2">{{ subP.defaultName || subP.pesticideFertilizerName }}</div>
                             <div class="title-3">{{ subP.brand }}</div>
                             <div class="title-4">{{ subP.price }}</div>

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

@@ -25,7 +25,7 @@
                     <checkbox v-if="!showBtn" class="checkbox" icon-size="16px" shape="square" v-model="farmInfo.defaultOption">是否勾选为默认农场</checkbox>
                 </cell-group>
             </div>
-            <div class="popup-footer" v-if="!showBtn">
+            <div class="popup-footer" v-if="!showBtn || showEditBtn">
                 <div class="footer-btn no-btn" @click="handleCancel">取消</div>
                 <div class="footer-btn yes-btn" @click="handleEdit">去编辑</div>
             </div>
@@ -49,6 +49,10 @@ const props = defineProps({
         type: Boolean,
         default: false,
     },
+    showEditBtn: {
+        type: Boolean,
+        default: false,
+    },
 });
 
 const store = useStore();

+ 18 - 19
src/views/old_mini/home/subPages/prescriptionPage.vue

@@ -70,38 +70,37 @@ import { useRouter, useRoute } from "vue-router";
 const router = useRouter();
 const route = useRoute();
 const productList = ref([
-    { name: "请选择您的果园土壤类型", items: [{ name: "砂质土" }, { name: "黏质土" }, { name: "壤土" }] },
-    { name: "请选择您的灌溉方式", items: [{ name: "砂质土" }, { name: "黏质土" }, { name: "壤土" }] },
+    { name: "请选择您的果园土壤类型", items: [{ name: "红壤" }, { name: "壤土" }, { name: "冲积土" }] },
+    { name: "请选择您的灌溉方式", items: [{ name: "滴灌" }, { name: "穴灌" }, { name: "微喷灌" }] },
     { name: "是否需要改良土壤", items: [{ name: "需要" }, { name: "不需要" }] },
 ]);
 const outputList = ref([
-    { name: "灾害1" },
-    { name: "灾害2" },
-    { name: "灾害3" },
-    { name: "灾害4" },
-    { name: "灾害5" },
-    { name: "灾害6" },
+    { name: "低温冻害" },
+    { name: "干旱" },
+    { name: "暴雨渍水" },
+    { name: "病虫害" },
+    { name: "阴天寡照" },
 ]);
 // 默认选中前两项
-const outputVal = ref(outputList.value.length >= 2
-        ? [outputList.value[0].name, outputList.value[1].name]
-        : outputList.value.length === 1
-        ? [outputList.value[0].name]
-        : []);
+const outputVal = ref([]);
 const disasterDesc = ref("");
 // 初始化默认选中第一项
 onActivated(() => {
+    // outputVal.value = outputList.value.length >= 2
+    //     ? [outputList.value[0].name, outputList.value[1].name]
+    //     : outputList.value.length === 1
+    //     ? [outputList.value[0].name]
+    //     : []
+    if (route.query.speciesName === '籼稻') {
+        productList.value[0].items = [{ name: "黏质土" }, { name: "壤土" }, { name: "冲积土" }];
+        productList.value[1].items = [{ name: "漫灌" }, { name: "间歇灌溉" }, { name: "喷灌" }];
+    }
     // 为 productList 的每个 group 设置默认选中第一项
     productList.value.forEach((group) => {
         if (group.items && group.items.length > 0 && !group.checked) {
             group.checked = group.items[0].name;
         }
     });
-    // outputVal.value = outputList.value.length >= 2
-    //     ? [outputList.value[0].name, outputList.value[1].name]
-    //     : outputList.value.length === 1
-    //     ? [outputList.value[0].name]
-    //     : []
 });
 
 const goBack = () => {
@@ -207,7 +206,7 @@ const handlePage = () => {
                                 border: none;
                                 background: #f1f1f1;
                                 border-radius: 8px;
-                                padding: 13px 30px;
+                                padding: 13px 24px;
                                 border: 1px solid rgba(255, 255, 255, 0);
                                 color: #000000;
                                 font-size: 15px;

+ 15 - 3
src/views/old_mini/mine/index.vue

@@ -194,11 +194,23 @@ const cellItems = computed(() => {
 
 // 花园信息项数据
 const gardenInfoItems = ref([
-    { num: 128, label: "服务次数" },
-    { num: 256, label: "累计客户" },
-    { num: 512, label: "服务果园" },
+    { num: '--', label: "服务次数" },
+    { num: '--', label: "累计客户" },
+    { num: '--', label: "服务果园" },
 ]);
 
+onActivated(() => {
+    getStatistics();
+})
+
+const getStatistics = () => {
+    VE_API.z_agricultural_store.statistics().then(({ data }) => {
+        gardenInfoItems.value[0].num = data.serviceCount || '--';
+        gardenInfoItems.value[1].num = data.customerCount || '--';
+        gardenInfoItems.value[2].num = data.serviceFarmCount || '--';
+    });
+}
+
 // 处理网格项点击
 const handleGridClick = (item) => {
     if (item.path) {

+ 7 - 3
src/views/old_mini/modify_work/completedWork.vue

@@ -44,7 +44,7 @@
                         <div class="executor-info mt-0">
                             <div class="executor-avatar">
                                 <img
-                                    src="https://birdseye-img-ali-cdn.sysuimars.com/16926861-1e20-4cbd-8bf2-90208db5a2d0/806080da-1a30-4b5b-b64b-b22e722c6cb6/DJI_202509010800_001_806080da-1a30-4b5b-b64b-b22e722c6cb6/DJI_20250901080536_0045_V_code-ws0fsmge97gh.jpeg"
+                                    src="https://birdseye-img-ali-cdn.sysuimars.com/16926861-1e20-4cbd-8bf2-90208db5a2d0/806080da-1a30-4b5b-b64b-b22e722c6cb6/DJI_202509010800_001_806080da-1a30-4b5b-b64b-b22e722c6cb6/DJI_20250901080536_0045_V_code-ws0fsmge97gh.jpeg?x-oss-process=image/resize,w_500"
                                     alt="执行人"
                                 />
                             </div>
@@ -52,7 +52,7 @@
                                 <div class="org-name">
                                     <span class="name">{{ quotationData.agriculturalStoreName || "--" }}</span>
                                     <span class="rating">{{
-                                        quotationData.score ? quotationData.score + "分" : "--"
+                                        quotationData.score ? quotationData.score + "分" : ""
                                     }}</span>
                                 </div>
                                 <div class="service-info">
@@ -404,7 +404,7 @@
     </popup>
 
     <!-- 上传执行照片 -->
-    <upload-execute ref="uploadExecuteRef" :onlyShare="onlyShare" />
+    <upload-execute ref="uploadExecuteRef" @uploadSuccess="handleUploadSuccess" :onlyShare="onlyShare" />
     <!-- 发起需求成功弹窗 -->
     <fn-share-sheet v-model:show="showDemandShare" @select="onDemandSelect" :options="demandOptions" />
 </template>
@@ -586,6 +586,10 @@ const showUploadExecutePopup = () => {
         uploadExecuteRef.value.showPopup(parmasPage.value);
     }, 10);
 };
+
+const handleUploadSuccess = () => {
+    getDetail(query.value.id);
+};
 // 地图
 // const areaRef = ref(null);
 // let newFarmMap = new NewFarmMap();

+ 2 - 2
src/views/old_mini/user/farmDetails.vue

@@ -10,7 +10,7 @@
                     variety: farmDetail.typeName || '',
                     address: farmDetail.address || '',
                     mapImage: '/map.png',
-                    maxWidth:'70px',
+                    maxWidth:'90px',
                 }"
             >
                 <template #right>
@@ -122,7 +122,7 @@
     </div>
     <fn-share-sheet v-model:show="showShare" @select="onSelect" :options="[{ name: '微信', icon: 'wechat' }]" />
     <!-- 农场信息 -->
-    <farm-info-popup ref="farmInfoRef" :farmId="farmIdVal" :showBtn="true"></farm-info-popup>
+    <farm-info-popup ref="farmInfoRef" :farmId="farmIdVal" :showEditBtn="!farmDetail.farmersMiniUserId" :showBtn="true"></farm-info-popup>
 </template>
 
 <script setup>