Browse Source

fix: 修复微信端页面地址错误

zhangyuhan 2 years ago
parent
commit
3152083127

+ 10 - 2
src/web/staticres/common-module/big-member/js/client_portrayal.js

@@ -335,7 +335,11 @@ var vNode = {
         }, 20)
         }, 20)
       },
       },
       goEntInfo: function(item) {
       goEntInfo: function(item) {
+        if (utils.isWeiXinBrowser) {
+          location.href = "/weixin/frontPage/collection/sess/ent_portrait?eId=" + encodeURIComponent(item.id)
+        } else {
           location.href = './ent_portrait?eId=' + encodeURIComponent(item.id)
           location.href = './ent_portrait?eId=' + encodeURIComponent(item.id)
+        }
       },
       },
       // 是否认领和关注企业
       // 是否认领和关注企业
       getActionState (names, str) {
       getActionState (names, str) {
@@ -1568,7 +1572,7 @@ var vNode = {
             //   console.log(error)
             //   console.log(error)
             // }
             // }
             location.href = '/big/wx/page/customer'
             location.href = '/big/wx/page/customer'
-            
+
           } else if (btnText == '前往升级') {
           } else if (btnText == '前往升级') {
             //跳转清除旧套餐缓存,防止计算价格出错
             //跳转清除旧套餐缓存,防止计算价格出错
             sessionStorage.removeItem('vipSub_oldBuySet')
             sessionStorage.removeItem('vipSub_oldBuySet')
@@ -1627,7 +1631,11 @@ var vNode = {
       },
       },
       goHighSet: function() {
       goHighSet: function() {
         sessionStorage.setItem('is-click-set', 1)
         sessionStorage.setItem('is-click-set', 1)
-        location.href = './client_high_set?header=采购单位高级分析设置&entName=' + decodeURIComponent(utils.getParam('entName'))
+        if (utils.isWeiXinBrowser) {
+          location.href = './free_high_set?header=采购单位高级分析设置&entName=' + decodeURIComponent(utils.getParam('entName'))
+        } else {
+          location.href = './client_high_set?header=采购单位高级分析设置&entName=' + decodeURIComponent(utils.getParam('entName'))
+        }
       },
       },
       //免费赠送采购单位全景分析体验 去解锁
       //免费赠送采购单位全景分析体验 去解锁
       goGiveAnalysis: function(){
       goGiveAnalysis: function(){

+ 30 - 18
src/web/staticres/common-module/report-analysis/js/report_analysis.js

@@ -311,7 +311,7 @@ var vm = new Vue({
       this.rid = decodeURIComponent(id)
       this.rid = decodeURIComponent(id)
       this.filtersPageShow = false
       this.filtersPageShow = false
     }
     }
-    
+
   },
   },
   mounted: function () {
   mounted: function () {
     setTimeout(() => {
     setTimeout(() => {
@@ -333,13 +333,13 @@ var vm = new Vue({
   methods: {
   methods: {
     gotable () {
     gotable () {
       this.saveState()
       this.saveState()
-       if(this.isWeiXinBrower()){
+       if(utils.$envs.inWX){
         window.location.href='/big/wx/page/report_table?source=analysis'+'&flag=3'+'&rid='+this.rid+'&header=客户类型分布详情'
         window.location.href='/big/wx/page/report_table?source=analysis'+'&flag=3'+'&rid='+this.rid+'&header=客户类型分布详情'
        } else {
        } else {
         window.location.href='/jyapp/big/page/report_table?source=analysis'+'&flag=3'+'&rid='+this.rid+'&header=客户类型分布详情'
         window.location.href='/jyapp/big/page/report_table?source=analysis'+'&flag=3'+'&rid='+this.rid+'&header=客户类型分布详情'
 
 
        }
        }
-     
+
     },
     },
     isWeiXinBrower() {
     isWeiXinBrower() {
       var ua = navigator.userAgent.toLowerCase();
       var ua = navigator.userAgent.toLowerCase();
@@ -392,7 +392,7 @@ var vm = new Vue({
         }
         }
         item.top = offsetTop
         item.top = offsetTop
       })
       })
-    
+
     },
     },
     addEventListeners: function () {
     addEventListeners: function () {
       this.scrollToTop()
       this.scrollToTop()
@@ -419,10 +419,10 @@ var vm = new Vue({
       var i = 0
       var i = 0
       if (scrollTop >= anchorTopList[1] && scrollTop < anchorTopList[2]) {
       if (scrollTop >= anchorTopList[1] && scrollTop < anchorTopList[2]) {
         i = 1
         i = 1
-        
+
       } else if (scrollTop > anchorTopList[2] && scrollTop > anchorTopList[1] && scrollTop > anchorTopList[0]) { //逻辑上多余判断条件 ,为了处理高度还没有计算出起始的 anchorTopList[2]为0 tab回显错误问题
       } else if (scrollTop > anchorTopList[2] && scrollTop > anchorTopList[1] && scrollTop > anchorTopList[0]) { //逻辑上多余判断条件 ,为了处理高度还没有计算出起始的 anchorTopList[2]为0 tab回显错误问题
         i = 2
         i = 2
-      
+
       } else if (scrollTop < anchorTopList[1]) {
       } else if (scrollTop < anchorTopList[1]) {
         i = 0
         i = 0
 
 
@@ -660,7 +660,7 @@ var vm = new Vue({
       } else if (key === 'buyerclass') {
       } else if (key === 'buyerclass') {
         filters.buyerclass = e.data
         filters.buyerclass = e.data
         console.log(e.data)
         console.log(e.data)
-      } 
+      }
       dialog[key] = false
       dialog[key] = false
     },
     },
     dateTimeSelectorConfirm () {
     dateTimeSelectorConfirm () {
@@ -834,19 +834,19 @@ var vm = new Vue({
       if (!query.rid) {
       if (!query.rid) {
         return
         return
       }
       }
-      
+
       $.ajax({
       $.ajax({
         type: 'POST',
         type: 'POST',
         url: '/bigmember/marketAnalysis/getAnalysisResult',
         url: '/bigmember/marketAnalysis/getAnalysisResult',
         data: query,
         data: query,
         success: function (res) {
         success: function (res) {
-          if (res && res.error_code === 0 && res.data) {  
+          if (res && res.error_code === 0 && res.data) {
             if(flag==3){
             if(flag==3){
               sessionStorage.setItem('getAnalysisResult_',JSON.stringify(res))
               sessionStorage.setItem('getAnalysisResult_',JSON.stringify(res))
             }
             }
             this.formatterData(flag, res.data)
             this.formatterData(flag, res.data)
-          
-            
+
+
           } else {
           } else {
             this.$toast('请求失败')
             this.$toast('请求失败')
           }
           }
@@ -933,7 +933,7 @@ var vm = new Vue({
           this.filters.rangeTime.end = new Date(timeString).getTime()
           this.filters.rangeTime.end = new Date(timeString).getTime()
         }
         }
       }
       }
-      
+
       this.$refs.dateSelector.setState(this.filters.rangeTime)
       this.$refs.dateSelector.setState(this.filters.rangeTime)
       if (data.area && data.area !== '{}') {
       if (data.area && data.area !== '{}') {
         this.reportFilters.area = JSON.parse(data.area)
         this.reportFilters.area = JSON.parse(data.area)
@@ -1477,7 +1477,7 @@ var vm = new Vue({
 
 
         this.sections.market.refine.dataAlready = true
         this.sections.market.refine.dataAlready = true
       }
       }
-      
+
       this.sortRefineTop3(data)
       this.sortRefineTop3(data)
     },
     },
     sortRefineTop3 (data) {
     sortRefineTop3 (data) {
@@ -1582,7 +1582,7 @@ var vm = new Vue({
 
 
         this.sections.buyerclass.dataAlready = true
         this.sections.buyerclass.dataAlready = true
       }
       }
-      
+
       this.sortBuyerclassTableData(data)
       this.sortBuyerclassTableData(data)
     },
     },
     sortBuyerclassTableData (data) {
     sortBuyerclassTableData (data) {
@@ -1841,7 +1841,7 @@ var vm = new Vue({
       } else {
       } else {
         rootlink = 'f'
         rootlink = 'f'
       }
       }
-      if(this.isWeixin) {
+      if(utils.$envs.inWX) {
         location.href = '/front/vipsubscribe/toSetKeyWordPage?vSwitch=' + rootlink
         location.href = '/front/vipsubscribe/toSetKeyWordPage?vSwitch=' + rootlink
       } else {
       } else {
         location.href = '/jyapp/vipsubscribe/toSetKeyWordPage?vSwitch=' + rootlink
         location.href = '/jyapp/vipsubscribe/toSetKeyWordPage?vSwitch=' + rootlink
@@ -1849,15 +1849,27 @@ var vm = new Vue({
     },
     },
     toArticleContent (item) {
     toArticleContent (item) {
       this.saveState()
       this.saveState()
-      location.href = `/jyapp/article/content/${item._id}.html`
+      if (utils.$envs.inWX) {
+        location.href = `/article/content/${item._id}.html`
+      } else {
+        location.href = `/jyapp/article/content/${item._id}.html`
+      }
     },
     },
     toPortrait (id, type) {
     toPortrait (id, type) {
       if (!type || !id) return
       if (!type || !id) return
       this.saveState()
       this.saveState()
       if (type === 'winner') {
       if (type === 'winner') {
-        location.href = `./ent_portrait?eId=${id}`
+        if (utils.$envs.inWX) {
+          location.href = `/weixin/frontPage/collection/sess/ent_portrait?eId=${id}`
+        } else {
+          location.href = `./ent_portrait?eId=${id}`
+        }
       } else if (type === 'buyer') {
       } else if (type === 'buyer') {
-        location.href = `./unit_portrayal?entName=${id}`
+        if (utils.$envs.inWX) {
+          location.href = `/big/wx/page/unit_portrayal?entName=${id}`
+        } else {
+          location.href = `./unit_portrayal?entName=${id}`
+        }
       }
       }
     }
     }
   }
   }