Parcourir la source

fix: 分享跳转dev

lxf il y a 1 semaine
Parent
commit
8685b24f4b

+ 5 - 5
src/components/chatWindow.vue

@@ -334,7 +334,7 @@ watch(
                         senderIcon: senderIcon.value,
                         title: params.farmWorkName + ' 农事已完成,请您确认',
                         cardType:'farm_work',
-                        linkUrl:`/completed_work?json=${JSON.stringify({id:params.id})}`,
+                        linkUrl:`/completed_work?miniJson=${JSON.stringify({id:params.id})}`,
                         time: getCurrentTime(),
                     };
                     if(params.executeEvidence && params.executeEvidence.length > 5) {
@@ -359,13 +359,13 @@ watch(
                             farmWorkOrderId:params.farmWorkOrderId,
                             isAssign: true
                         }
-                        message.linkUrl = `/completed_work?json=${JSON.stringify(jsonParams)}`;
+                        message.linkUrl = `/completed_work?miniJson=${JSON.stringify(jsonParams)}`;
                     }
 
                     if(params.type === 'reviewWork') {
                         message.cardType = 'reviewWork';
                         message.title = '向您分享了农事执行成果'
-                        message.linkUrl = `/review_work?json=${JSON.stringify({id: params.id,goBack: true})}`;
+                        message.linkUrl = `/review_work?miniJson=${JSON.stringify({id: params.id,goBack: true})}`;
                     }
 
                     if(params.type === 'remindExecute' || params.type === 'remindUser') {
@@ -375,10 +375,10 @@ watch(
                         }
                         if(params.type === 'remindExecute') {
                             message.title = '请您尽快执行 ' + params.farmWorkName + ' 农事';
-                            message.linkUrl = `/completed_work?json=${JSON.stringify(jsonParams)}`;
+                            message.linkUrl = `/completed_work?miniJson=${JSON.stringify(jsonParams)}`;
                         } else if(params.type === 'remindUser') {
                             message.title = '请您尽快完成复核';
-                            message.linkUrl = `/review_work?json=${JSON.stringify({id:params.id,goBack: true})}`;
+                            message.linkUrl = `/review_work?miniJson=${JSON.stringify({id:params.id,goBack: true})}`;
                         }
                         message.cardType = params.type
                     }

+ 1 - 1
src/components/taskItem.vue

@@ -349,7 +349,7 @@ const toDetail = (status, id, farmWorkId) => {
         // 复核成效
         router.push({
             path: "/review_work",
-            query: { json: JSON.stringify({ id, goBack: true }) },
+            query: { miniJson: JSON.stringify({ id, goBack: true }) },
         });
     } else {
         detailDialogRef.value.showDialog(farmWorkId, "", false);

+ 3 - 3
src/views/old_mini/agri_services/components/farmDynamics.vue

@@ -125,7 +125,7 @@ const handleImgUpload = () => {
                     router.push({
                     path: "/review_work",
                     query: {
-                            json: JSON.stringify({ id: currentSection.value.id, goBack: true }),
+                            miniJson: JSON.stringify({ id: currentSection.value.id, goBack: true }),
                         },
                     });
                 }, 500)
@@ -307,11 +307,11 @@ const handleApply = (section, type) => {
 
 const handleClick = (section) => {
     if (activePlanIndex.value == 5) {
-        router.push(`/review_work?json=${JSON.stringify({ id: section.id, goBack: true })}`);
+        router.push(`/review_work?miniJson=${JSON.stringify({ id: section.id, goBack: true })}`);
     } else {
         router.push({
             path: "/completed_work",
-            query: { json: JSON.stringify({ id: section.id }) },
+            query: { miniJson: JSON.stringify({ id: section.id }) },
         });
     }
 };

+ 1 - 1
src/views/old_mini/farm_manage/components/demandHall.vue

@@ -212,7 +212,7 @@ function getStatisticsAreaByDistrict() {
 function toDetail(item) {
     router.push({
         path: "/completed_work",
-        query: { json: JSON.stringify({ id: item.id }) },
+        query: { miniJson: JSON.stringify({ id: item.id }) },
     });
 }
 

+ 1 - 1
src/views/old_mini/mine/pages/serviceDetail.vue

@@ -106,7 +106,7 @@ const getDetailList = () => {
 };
 
 const handleClick = (section) => {
-    router.push(`/review_work?json=${JSON.stringify({id:section.id,goBack: true})}`);
+    router.push(`/review_work?miniJson=${JSON.stringify({id:section.id,goBack: true})}`);
 };
 
 const handleChatFarm = () => {

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

@@ -478,7 +478,7 @@ const handleSelfDone = () => {
                 router.replace({
                     path: "/review_work",
                     query: {
-                        json: JSON.stringify({ id: query.value.id, goBack: true }),
+                        miniJson: JSON.stringify({ id: query.value.id, goBack: true }),
                     },
                 });
             }, 500)
@@ -552,7 +552,7 @@ const handlePopupBtn = () => {
                 router.replace({
                     path: "/review_work",
                     query: {
-                        json: JSON.stringify({ id: query.value.id,goBack: true }),
+                        miniJson: JSON.stringify({ id: query.value.id,goBack: true }),
                     },
                 });
             }, 500)
@@ -654,7 +654,7 @@ const orderObj = ref({});
 const speciesList = computed(() => toList(quotationData.value.serviceSpecies));
 const equipmentList = computed(() => toList(quotationData.value.serviceEquipment));
 onActivated(async () => {
-    query.value = useRoute().query?.json ? JSON.parse(useRoute().query?.json) : {};
+    query.value = useRoute().query?.miniJson ? JSON.parse(useRoute().query?.miniJson) : {};
     const id = query.value?.id;
     if (id) {
         await getDetail(id);

+ 1 - 1
src/views/old_mini/modify_work/index.vue

@@ -551,7 +551,7 @@ function handlePopupBtn() {
         router.replace({
             path: "/completed_work",
             query: {
-                json: JSON.stringify({ id: route.query.id }),
+                miniJson: JSON.stringify({ id: route.query.id }),
             },
         });
     }

+ 1 - 1
src/views/old_mini/modify_work/reviewWork.vue

@@ -297,7 +297,7 @@ const paramsPage = ref({});
 onActivated(() => {
     window.scrollTo(0, 0);
     curRole.value = localStorage.getItem("SET_USER_CUR_ROLE");
-    paramsPage.value = route.query.json ? JSON.parse(route.query.json) : {};
+    paramsPage.value = route.query.miniJson ? JSON.parse(route.query.miniJson) : {};
     getDetail();
     getTriggerImg(paramsPage.value.id);
 });

+ 1 - 1
src/views/old_mini/monitor/index.vue

@@ -307,7 +307,7 @@ const handleCardClick = (card) => {
     };
     router.push({
         path: card.route,
-        query: params,
+        query: { ...params, miniJson: JSON.stringify(params) },
     });
 };
 

+ 2 - 2
src/views/old_mini/monitor/subPages/plan copy.vue

@@ -584,7 +584,7 @@ const handleRowClick = (item) => {
         router.push({
             path: "/review_work",
             query: {
-                json: JSON.stringify({ id: item.id,goBack: true })
+                miniJson: JSON.stringify({ id: item.id,goBack: true })
             },
         });
     } else if (item.type !== "term" && item.status === "default") {
@@ -593,7 +593,7 @@ const handleRowClick = (item) => {
         router.push({
             path: "/completed_work",
             query: {
-                json: JSON.stringify({ id: item.id })
+                miniJson: JSON.stringify({ id: item.id })
             },
         });
         // router.push({

+ 2 - 2
src/views/old_mini/monitor/subPages/plan.vue

@@ -243,7 +243,7 @@ const handleRowClick = (item) => {
         router.push({
             path: "/review_work",
             query: {
-                json: JSON.stringify({ id: item.farmWorkRecordId,goBack: true }),
+                miniJson: JSON.stringify({ id: item.farmWorkRecordId,goBack: true }),
             },
         });
     } else if (item.flowStatus === null) {
@@ -252,7 +252,7 @@ const handleRowClick = (item) => {
         router.push({
             path: "/completed_work",
             query: {
-                json: JSON.stringify({ id: item.farmWorkRecordId }),
+                miniJson: JSON.stringify({ id: item.farmWorkRecordId }),
             },
         });
     }

+ 1 - 1
src/views/old_mini/monitor/subPages/reviewResults.vue

@@ -138,7 +138,7 @@ const handleClick = (section) => {
     router.push({
         path: "/review_work",
         query: {
-            json: JSON.stringify({ id: section.id,goBack: true }),
+            miniJson: JSON.stringify({ id: section.id,goBack: true }),
         },
     });
 };

+ 6 - 6
src/views/old_mini/report_detail/index.vue

@@ -130,13 +130,12 @@ const route = useRoute();
 const farmId = ref(null);
 const isMiniPage = ref(false);
 onMounted(() => {
-    if(route.query.farmId){
-        farmId.value = route.query.farmId;
+    const pageParams = route.query.miniJson ? JSON.parse(route.query.miniJson) : {};
+    if(pageParams.farmId){
+        farmId.value = pageParams.farmId;
     }
-    if(route.query.json){
+    if(pageParams.goBack){
         isMiniPage.value = true;
-        const json = JSON.parse(route.query.json);
-        farmId.value = json.farmId;
     }
     getFarmSpeakInfo();
     getFarmWorkList();
@@ -196,7 +195,7 @@ const handleClick = (section) => {
     router.push({
         path: "/review_work",
         query: {
-            json: JSON.stringify({ id: section.id, goBack: true }),
+            miniJson: JSON.stringify({ id: section.id, goBack: true }),
         },
     });
 };
@@ -207,6 +206,7 @@ const shareReport = () => {
         shareText: "我分享了农场报告,快来查看吧~",
         farmId: farmId.value,
         targetUrl: `farm_report`,
+        goBack: true,
         imageUrl: 'https://birdseye-img.sysuimars.com/birdseye-look-mini/share-lz-bg.png',
     };
     wx.miniProgram.navigateTo({

+ 1 - 1
src/views/old_mini/task_condition/components/task.vue

@@ -432,7 +432,7 @@ function toDetail(item) {
     } else {
         router.push({
             path: "/completed_work",
-            query: { json: JSON.stringify({ id: item.id }) },
+            query: { miniJson: JSON.stringify({ id: item.id }) },
         });
     }
 }

+ 10 - 1
src/views/old_mini/user/farmDetails.vue

@@ -90,7 +90,7 @@
                 <tab title="农场报告" class="tab-item">
                     <common-box title="农场报告">
                         <template #right>
-                            <span @click="handleDetail('farm_report')">查看详情</span>
+                            <span @click="handleShareReport()">查看详情</span>
                         </template>
                         <span class="report-content"
                             >果园面积共XX亩,共有XX棵生产树。果园面积共XX亩,共有XX棵生产树。果园面积共XX亩,共有XX棵生产树。果园面积共XX亩,共有XX棵生产树。果园面积共XX亩,共有XX棵生产树。果园面积共XX亩,共有XX棵生产树。</span
@@ -225,6 +225,15 @@ const handleDetail = (path) => {
     router.push(`/${path}?farmId=${farmIdVal.value}`);
 };
 
+const handleShareReport = () => {
+    router.push({
+        path: "/farm_report",
+        query: {
+            miniJson: JSON.stringify({ farmId: farmIdVal.value }),
+        },
+    });
+};
+
 
 const showShare = ref(false);
 const handleShareFarm = () => {