Răsfoiți Sursa

Merge branch 'main' into feature/v1.0.45

lianbingjie 1 an în urmă
părinte
comite
c096e220e8

+ 16 - 4
apps/bigmember_pc/src/components/crm-info/crmAction.vue

@@ -30,6 +30,7 @@
 
 <script>
 import iframeDialog from '@/components/crm-info/IframeDialog.vue'
+import { getParam } from '@/utils/'
 import {
   ajaxIgnoreOperate,
   ajaxEmployOperate,
@@ -91,14 +92,17 @@ export default {
       employInfo: [],
       setShowDialog: false,
       iframeSrc: '',
-      lock: false
+      lock: false,
+      property: getParam('property') === 'BIProperty',
+      employId: getParam('employId')
     }
   },
   computed: {
     getList() {
-      if (this.list[0].active === 0) {
+      if (this.list[0].active === 0 && !this.property) {
         return this.list.slice(0, 1)
       } else {
+        let arrList = []
         if (this.entInfo.niche_dis === 1 || this.entInfo.niche_dis === 2) {
           const arr = []
           this.list.forEach((v) => {
@@ -106,10 +110,15 @@ export default {
               arr.push(v)
             }
           })
-          return arr
+          arrList = arr
         } else {
-          return this.list
+          arrList = this.list
         }
+        // 如果是物业版,则不显示收录
+        if (this.property) {
+          arrList = arrList.filter((v) => v.class !== 'employ')
+        }
+        return arrList
       }
     }
   },
@@ -149,6 +158,9 @@ export default {
       if (employInfoItem) {
         employId = employInfoItem.employId
       }
+      if (this.property) {
+        employId = this.employId
+      }
       switch (item.class) {
         case 'employ':
           this.setEmployEvent(item)

+ 1 - 0
apps/bigmember_pc/src/views/article-content/components/ContentHeader.vue

@@ -321,6 +321,7 @@ const openTagLink = (event, url) => {
     font-weight: 400;
     line-height: 18px;
     text-decoration: none;
+    user-select: unset;
     &:not([href]),
     &[href*='javascript'] {
       cursor: unset;

+ 22 - 6
apps/bigmember_pc/src/views/article-content/components/Nps.vue

@@ -1,10 +1,5 @@
 <template>
-  <div
-    id="npsMain"
-    class="npsMain npsPc"
-    v-show="showModule"
-    @mousemove="getIsView"
-  >
+  <div id="npsMain" class="npsMain npsPc" v-show="showModule">
     <div class="gray-div"></div>
     <div class="nps-content">
       <div class="nps-head">
@@ -48,6 +43,7 @@
 
 <script>
 import { getNpsData, getSeeNps, collectionNps } from '@/api/modules/nps'
+import { isElementInScrollArea } from '@jy/util'
 
 export default {
   data() {
@@ -77,14 +73,34 @@ export default {
   created() {
     this.getNpsData()
   },
+  beforeDestroy() {
+    this.removeScrollEvent()
+  },
   methods: {
     getNpsData() {
       getNpsData().then((res) => {
         if (res && res.data) {
           this.showModule = res.data.isShowNps
+          this.bindScrollEvent()
         }
       })
     },
+    bindScrollEvent(){
+      window.addEventListener('scroll', this.onPageScroll)
+    },
+    removeScrollEvent() {
+      window.removeEventListener('scroll', this.onPageScroll)
+    },
+    checkNpsView() {
+      const target = this.$el
+      const visible = isElementInScrollArea(target)
+      if (visible) {
+        this.getIsView()
+      }
+    },
+    onPageScroll() {
+      this.checkNpsView()
+    },
     // emoji表情转为字符
     utf16toEntities(str) {
       const patt = /[\ud800-\udbff][\udc00-\udfff]/g // 检测utf16字符正则

+ 2 - 2
apps/bigmember_pc/src/views/article-content/pages/Article.vue

@@ -509,6 +509,8 @@ function doClickFreeView() {
                 </div>
               </div>
             </div>
+            <!--  nps评分  -->
+            <Nps></Nps>
             <!--  投标服务  -->
             <div
               class="content-card watch-tab-content"
@@ -554,8 +556,6 @@ function doClickFreeView() {
               />
             </div>
           </div>
-          <!--  评分  -->
-          <Nps></Nps>
           <!--  内容底部广告  -->
           <div class="article-content-footer-container">
             <adsense code="jy-pccontent-bottom"></adsense>

+ 1 - 1
apps/mobile/src/views/article/content.vue

@@ -49,6 +49,7 @@
                 class="tab-module"
                 :beforeLeavePage="beforeLeavePage"
               />
+              <NpsCard class="nps-module" ref="npsCard" v-if="canRead" />
             </van-tab>
             <!-- 进度 -->
             <van-tab
@@ -95,7 +96,6 @@
               />
             </van-tab>
           </van-tabs>
-          <NpsCard class="nps-module" ref="npsCard" v-if="canRead" />
 
           <template v-if="!canRead">
             <FreeUserAdvancedMask

+ 9 - 12
apps/mobile/src/views/invoice/Invoicing.vue

@@ -576,14 +576,14 @@ export default {
         const { status } = await ajaxInvoiceAavailable({
           order_code: this.order_code
         })
-        if (status === 0) {
-          // 不支持开票
-          if (this.$envs.inWX) {
-            window.location.replace('/front/invoice/cantInvoice?f=upgrade')
-          } else {
-            window.location.replace('/jyapp/front/cantInvoice?f=upgrade')
-          }
-        }
+        // if (status === 0) {
+        //   // 不支持开票
+        //   if (this.$envs.inWX) {
+        //     window.location.replace('/front/invoice/cantInvoice?f=upgrade')
+        //   } else {
+        //     window.location.replace('/jyapp/front/cantInvoice?f=upgrade')
+        //   }
+        // }
         this.infoMap.code = this.order_code
         const res = await ajaxInvoiceNewshow({
           stype: 1,
@@ -1133,10 +1133,7 @@ export default {
       }
     },
     checkPhone(val) {
-      return (
-        /^1[3-9]\d{9}$/.test(val) ||
-        /^(?:(?:\d{3}-)?\d{8}|^(?:\d{4}-)?\d{7,8})(?:-\d+)?$/.test(val)
-      )
+      return /^(1[3|4|5|6|7|8|9])\d{9}$|^0\d{2,3}-?\d{7,8}$|^400[016789]\d{6}$|^400-[016789]\d{2}-\d{4}$/.test(val)
     },
     highlightText(value, keyStr) {
       return replaceKeyword(

+ 20 - 9
packages/util/modules/dom/scroll.js

@@ -1,16 +1,27 @@
 /**
- * 判断元素是否在滚动区域内
+ * 判断某个元素是否在滚动区域的视口中(和视口重叠)
  * element: 目标元素dom
- * scrollContainer: 滚动区域
+ * scrollContainer: 滚动区域(如果是body滚动,则此参数不传)
  */
 export function isElementInScrollArea(element, scrollContainer) {
   const elementRect = element.getBoundingClientRect()
-  const containerRect = scrollContainer.getBoundingClientRect()
+  if (scrollContainer) {
+    const containerRect = scrollContainer.getBoundingClientRect()
 
-  // 判断元素的上边界和下边界是否在滚动容器的上边界和下边界之间
-  const isElementAboveContainer = elementRect.bottom < containerRect.top
-  const isElementBelowContainer = elementRect.top > containerRect.bottom
+    // 判断元素的上边界和下边界是否在滚动容器的上边界和下边界之间
+    const isElementAboveContainer = elementRect.bottom < containerRect.top
+    const isElementBelowContainer = elementRect.top > containerRect.bottom
 
-  // 如果元素在滚动容器的上下边界之间,则认为它在滚动区域内
-  return !(isElementAboveContainer || isElementBelowContainer)
-}
+    // 如果元素在滚动容器的上下边界之间,则认为它在滚动区域内
+    return !(isElementAboveContainer || isElementBelowContainer)
+  } else {
+    const viewportWidth = window.innerWidth || document.documentElement.clientWidth
+    const viewportHeight = window.innerHeight || document.documentElement.clientHeight
+    return (
+      elementRect.top < viewportHeight &&
+      elementRect.bottom > 0 &&
+      elementRect.left < viewportWidth &&
+      elementRect.right > 0
+    )
+  }
+}