Эх сурвалжийг харах

Merge branch 'main' into hotfix/v1.0.55.2

lianbingjie 1 жил өмнө
parent
commit
7a412cdc18

+ 37 - 1
apps/mobile/src/views/article/components/TabActions.vue

@@ -4,6 +4,7 @@
       class="tab-action"
       class="tab-action"
       :id="id"
       :id="id"
       @syncLabels="syncLabels"
       @syncLabels="syncLabels"
+      :beforeAction="beforeActionBindPhoneCheck"
       :beforeRedirect="beforeLeavePage"
       :beforeRedirect="beforeLeavePage"
     />
     />
     <QuickMonitor
     <QuickMonitor
@@ -13,11 +14,12 @@
       :cache="true"
       :cache="true"
       :auto="true"
       :auto="true"
       popover
       popover
+      :beforeAction="beforeActionBindPhoneCheck"
       :beforeLeavePage="beforeLeavePage"
       :beforeLeavePage="beforeLeavePage"
       @initd="afterMonitorFetch"
       @initd="afterMonitorFetch"
       @change="afterMonitorFetch"
       @change="afterMonitorFetch"
     />
     />
-    <ActionShareToWorkmate class="tab-action" :id="id" />
+    <ActionShareToWorkmate class="tab-action" :beforeAction="beforeShareToWorkMateAction" :id="id" />
     <ActionInBidding
     <ActionInBidding
       class="tab-action"
       class="tab-action"
       :id="id"
       :id="id"
@@ -31,6 +33,8 @@ import QuickMonitor from '@/composables/quick-monitor/component/QuickMonitor.vue
 import ActionShareToWorkmate from '@/views/article/components/ActionShareToWorkmate.vue'
 import ActionShareToWorkmate from '@/views/article/components/ActionShareToWorkmate.vue'
 import ActionInBidding from '@/views/article/components/ActionInBidding.vue'
 import ActionInBidding from '@/views/article/components/ActionInBidding.vue'
 import { mapState, mapMutations } from 'vuex'
 import { mapState, mapMutations } from 'vuex'
+import { openAppOrWxPage } from '@/utils'
+import { LINKS } from '@/data'
 
 
 export default {
 export default {
   name: 'TabActions',
   name: 'TabActions',
@@ -59,6 +63,7 @@ export default {
   },
   },
   computed: {
   computed: {
     ...mapState({
     ...mapState({
+      userSimpleInfo: (state) => state.user.userSimpleInfo,
       content: (state) => state.article.mainModel.content
       content: (state) => state.article.mainModel.content
     }),
     }),
     id() {
     id() {
@@ -106,6 +111,37 @@ export default {
         key: 'inBiddingPersonList',
         key: 'inBiddingPersonList',
         data: userNameList
         data: userNameList
       })
       })
+    },
+    toBindPhonePage() {
+      openAppOrWxPage(LINKS.绑定手机号, {
+        query: {
+          mode: 'mergeBind'
+        }
+      })
+    },
+    // mp标记短信邀请进入的详情页,需要判断手机号是否绑定
+    beforeActionBindPhoneCheck() {
+      const query = this.$route.query
+      if (query.mp) {
+        const { phone } = this.userSimpleInfo
+        if (phone) {
+          return true
+        } else {
+          this.toBindPhonePage()
+          return false
+        }
+      } else {
+        return true
+      }
+    },
+    beforeShareToWorkMateAction() {
+      const { phone } = this.userSimpleInfo
+      if (phone) {
+        return true
+      } else {
+        this.toBindPhonePage()
+        return false
+      }
     }
     }
   }
   }
 }
 }