瀏覽代碼

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

lxf 5 天之前
父節點
當前提交
199e644f61
共有 2 個文件被更改,包括 20 次插入5 次删除
  1. 15 1
      src/views/old_mini/agri_record/index.vue
  2. 5 4
      src/views/old_mini/create_farm/index.vue

+ 15 - 1
src/views/old_mini/agri_record/index.vue

@@ -15,7 +15,7 @@
         <!-- 作物档案 -->
         <div class="archives-time-line">
             <div class="archives-time-line-header">
-                <div class="line-title">农事记录</div>
+                <div class="line-title" @click="handleFarmInfoClick">农事记录</div>
                 <!-- <el-date-picker style="width: 110px" v-model="date" type="year" placeholder="全部日期" /> -->
             </div>
             <div class="archives-time-line-content">
@@ -45,6 +45,20 @@ import farmInfoPopup from "../home/components/farmInfoPopup.vue";
 import tipPopup from "@/components/popup/tipPopup.vue";
 import { ElMessage, ElMessageBox } from "element-plus";
 import ArchivesFarmTimeLine from "@/components/pageComponents/ArchivesFarmTimeLine.vue";
+import wx from "weixin-js-sdk";
+
+const handleFarmInfoClick = () =>{
+    const query = {
+        askInfo: { title: "农场认领", content: "是否分享该链接给好友" },
+        shareText: "我分享了农场认领链接,快来认领吧~",
+        targetUrl: `create_farm`,
+        paramsPage: JSON.stringify({isFarmer:true}),
+        imageUrl: 'https://birdseye-img-ali-cdn.sysuimars.com//container_phenology_interaction/example_images/0/0/1770021421822.jpg',
+    };
+    wx.miniProgram.navigateTo({
+        url: `/pages/subPages/share_page/index?pageParams=${JSON.stringify(query)}&type=sharePage`,
+    });
+}
 
 const showFarmPopup = ref(false); // 农场领取成功弹窗
 const date = ref(new Date());

+ 5 - 4
src/views/old_mini/create_farm/index.vue

@@ -282,11 +282,7 @@ onActivated(() => {
     getLocationName(`${arr[1]},${arr[0]}`);
     // 仅在携带 isReload 标记、且不是编辑/小程序回流场景时,认为是一次全新创建,重置表单和地块,
     // 避免破坏原有自动生成农场名称等逻辑
-    console.log('route.query.isReload', route.query.isReload)
-    console.log('paramsType.value', paramsType.value)
-    console.log('route.query.miniJson', route.query.miniJson)
     if (route.query.isReload && paramsType.value !== "edit" && !route.query.miniJson) {
-        console.log('重置表单和地块')
         // 重置表单字段到初始值
         ruleFormRef.value && ruleFormRef.value.resetFields();
         // 重置与地块绘制相关的内部状态
@@ -791,6 +787,11 @@ function backgToHome() {
                 url: `/pages/subPages/new_recognize/index?gardenData=${JSON.stringify(dropdownGardenItem.value)}`,
             });
         }
+        const paramsPage = JSON.parse(json.paramsPage);
+        if(paramsPage.isFarmer){
+            router.replace('/home');
+            return;
+        }
     } else {
         if (fromPage && fromPage !== "details") {
             if (route.query.type === "farmer") {