dev01 3 kuukautta sitten
vanhempi
commit
e018bad9f9

+ 1 - 1
src/components/common/imagePicker/index.jsx

@@ -65,7 +65,7 @@ class ImagePicker extends Component {
                 _this.setState({
                   loading: false
                 })
-                Taro.reLaunch({
+                Taro.redirectTo({
                   url: '/pages/login/index'
                 })
               }

+ 8 - 20
src/pages/customerProfile/index.jsx

@@ -64,39 +64,27 @@ class CustomerProfile extends Component {
 
   componentDidMount() {
     this.queryByUidAll();
+    if (!this.isLogin()) {
+      Taro.setStorageSync('currentPage', `/pages/customerProfile/index?id=${this.$instance.router.params.id}&signBills=${this.$instance.router.params.signBills}`)
+    }
   }
 
   componentDidShow() {
 
   }
 
+  isLogin() {
+    return !!Taro.getStorageSync('userInfor');
+  }
+
   onShareAppMessage() {
     this.limitUser();
     return {
       title: "客户档案",
-      path: "pages/customerProfile/index?id=" + this.$instance.router.params.id + "&signBills=" + this.$instance.router.params.signBills,
+      path: "/pages/customerProfile/index?id=" + this.$instance.router.params.id + "&signBills=" + this.$instance.router.params.signBills,
     };
   }
 
-  // onShareAppMessage() {
-  //   this.limitUser();
-  //   if (!this.isLogin()) {
-  //     return {
-  //       title: '登录',
-  //       path: '/pages/login/index', // 登录页面的路径
-  //     }
-  //   } else {
-  //     return {
-  //       title: '客户档案',
-  //       path: "pages/customerProfile/index?id=" + this.$instance.router.params.id + "&signBills=" + this.$instance.router.params.signBills + "&scene=1007", // 假设的分享路径
-  //     }
-  //   }
-  // }
-
-  isLogin() {
-    return !!Taro.getStorageSync('userInfor');
-  }
-
   // 客户档案详情
   queryByUidAll() {
     queryByUidAll({

+ 7 - 0
src/pages/egressDetails/index.jsx

@@ -80,6 +80,13 @@ class EgressDetails extends Component {
       sonType: this.$instance.router.params.sonType || "",
     });
     this.getReleasetDails();
+    if (!this.isLogin()) {
+      Taro.setStorageSync('currentPage', `/pages/egressDetails/index?id=${this.$instance.router.params.id}`)
+    }
+  }
+  
+  isLogin() {
+    return !!Taro.getStorageSync('userInfor');
   }
 
   componentDidShow() {

+ 13 - 3
src/pages/login/index.jsx

@@ -189,9 +189,19 @@ class Login extends Component {
         let obj = Taro.getStorageSync('userInfor');
         obj.workTimeInfor = msg.data;
         Taro.setStorageSync('userInfor', obj);
-        Taro.switchTab({
-          url: '/pages/punchClock/index',
-        })
+
+        const currentPage = Taro.getStorageSync('currentPage')
+        if (currentPage) {
+          Taro.setStorageSync('currentPage', "")
+          Taro.reLaunch({
+            url: currentPage
+          })
+        } else {
+          Taro.switchTab({
+            url: '/pages/punchClock/index',
+          })
+        }
+
       } else {
         Taro.showToast({ title: msg.error[0].message, icon: 'none' })
       }

+ 15 - 8
src/pages/situation/index.jsx

@@ -45,12 +45,27 @@ class CustomerProfile extends Component {
 
   componentDidMount() {
     this.getPublicList();
+    if (!this.isLogin()) {
+      Taro.setStorageSync('currentPage', `/pages/situation/index?id=${this.$instance.router.params.id}&signBills=${this.$instance.router.params.signBills}&nickname=${this.$instance.router.params.nickname}`)
+    }
   }
 
   componentDidShow() {
 
   }
 
+  isLogin() {
+    return !!Taro.getStorageSync('userInfor');
+  }
+
+  onShareAppMessage() {
+    this.limitUser();
+    return {
+      title: "面谈记录",
+      path: "/pages/situation/index?id=" + this.$instance.router.params.id + "&signBills=" + this.$instance.router.params.signBills + "&nickname=" + this.$instance.router.params.nickname,
+    };
+  }
+
   getPublicList() {
     this.setState({
       loading: true
@@ -104,14 +119,6 @@ class CustomerProfile extends Component {
     })
   }
 
-  onShareAppMessage() {
-    this.limitUser();
-    return {
-      title: "面谈记录",
-      path: "pages/situation/index?id=" + this.$instance.router.params.id + "&signBills=" + this.$instance.router.params.signBills + "&nickname=" + this.$instance.router.params.nickname,
-    };
-  }
-
   // 公出补充
   addSupplement() {
     const { type, id, opinion, text } = this.state

+ 1 - 1
src/utils/servers/utils.js

@@ -12,7 +12,7 @@ export const getCurrentPageUrl = () => {
 
 export const pageToLogin = async () => {
   Taro.closeSocket();
-  Taro.reLaunch({
+  Taro.redirectTo({
     url: '/pages/login/index'
   })