소스 검색

feat: 落地页新增情报管理权限判断以及跳转

cuiyalong 1 개월 전
부모
커밋
0f39cb6e3f

+ 3 - 1
src/web/staticres/bid-fileinter/css/product-introduce.css

@@ -23,7 +23,9 @@
 .u-button.u-bg-purpose-blue {
   /* background: linear-gradient(90deg, #8186F3 0%, #0055FF 100%); */
   background: linear-gradient(90deg, #8186F3 0%, #0055FF 95.34%);
-
+}
+.u-button.u-bg-deep-purpose-blue {
+  background: linear-gradient(90deg, #9A49FE 0%, #2B19FF 95.34%);
 }
 .u-button.u-bg-cyan-blue {
   background: linear-gradient(90deg, #6CEFCA 0%, #4342FF 100%);

+ 2 - 2
src/web/staticres/bid-fileinter/js/product-introduce-config.js

@@ -169,7 +169,7 @@ var __page_config = {
       },
     ],
     descModule: {
-      title: '实施步骤(商机全流程管理',
+      title: '商机全流程管理',
       stepList: [
         {
           tabName: '商机规则定制',
@@ -339,7 +339,7 @@ var __page_config = {
         title: '客户细分 高效转化',
         subtitle: '通过多维度客户画像,进行高价值客户细分。实现精<br />准营销、个性化产品/服务推荐,提升转化率和客户<br />忠诚度。',
         buttonText: '立即体验',
-        buttonClass: 'u-bg-purpose-blue',
+        buttonClass: 'u-bg-deep-purpose-blue',
         source: 'industry_experience',
         bannerImageSrc: '/bid-fileinter/image/hydc/banner-bg3@2x.png'
       },

+ 39 - 11
src/web/staticres/bid-fileinter/js/product-introduce.js

@@ -1,7 +1,20 @@
 $(function() {
   var __page = {
     powerList: [],
-    needPower: ['yyszb'],
+    powerMap: {
+      yyszb: {
+        powerKey: 'bi_sj_yyszs',
+        redirectFnName: 'goToYYSZBPage',
+      },
+      qbgl: {
+        powerKey: 'bi_yx',
+        redirectFnName: 'goToYingXiao',
+      },
+      yxgl: {
+        powerKey: 'bi_yx',
+        redirectFnName: 'goToYingXiao',
+      },
+    },
     data: {},
     imageViewer: null,
     lastScrollCall: null,
@@ -25,7 +38,7 @@ $(function() {
         this.code = code
         this.data = __page_config[code] || __page_config.yxgl
         $('.page--product--introduce').addClass('style-' + code)
-        if (this.needPower.indexOf(code) !== -1) {
+        if (Object.keys(this.powerMap).indexOf(code) !== -1) {
           this.getPowerList()
         }
         return true
@@ -55,15 +68,15 @@ $(function() {
         $('.desc-module-nav-tabs .desc-module-nav-tab:eq(' + tab + ')').trigger('click')
       }
     },
-    checkHasPower: function(c) {
+    checkHasPower: function() {
       var code = this.code
-      if (this.needPower.indexOf(code) !== -1) {
-        return this.powerList.indexOf(c) > -1
+      var conf = this.powerMap[code] || {}
+      var powerKey = conf.powerKey || ''
+      var needPower = Object.keys(this.powerMap)
+      if (needPower.indexOf(code) !== -1) {
+        return this.powerList.indexOf(powerKey) > -1
       }
     },
-    checkHasYYSZBPower: function() {
-      return this.checkHasPower('bi_sj_yyszs')
-    },
     getPowerList: function() {
       var _this = this
       $.ajax({
@@ -72,7 +85,7 @@ $(function() {
         success: function(res) {
           if (res && Array.isArray(res.data)) {
             _this.powerList = res.data
-            if (_this.checkHasYYSZBPower()) {
+            if (_this.checkHasPower()) {
               $('.experience-button').text('立即使用')
             }
           }
@@ -224,17 +237,32 @@ $(function() {
       var options = options || {}
       simpleLeaveSource.doLeaveInfo(source, options)
     },
+    redirectToPage: function() {
+      var code = this.code
+      var conf = this.powerMap[code] || {}
+      var redirectFnName = conf.redirectFnName || ''
+      if (redirectFnName && typeof this[redirectFnName] === 'function') {
+        this[redirectFnName]()
+      } else {
+        console.warn('未定义的跳转方法: ' + redirectFnName)
+      }
+    },
     goToYYSZBPage: function() {
       var iframeUrl = location.origin + '/succbi/yyssjdz/app/sjdz.app/sjqd.spg'
       var workUrl = '/page_workDesktop/work-bench/page?link=' + encodeURIComponent(iframeUrl)
       window.open(workUrl)
     },
+    goToYingXiao: function() {
+      var iframeUrl = location.origin + '/succbi/crm_system/app/crm.app/一级菜单/potential_business_opportunity.spg'
+      var workUrl = '/page_workDesktop/work-bench/page?link=' + encodeURIComponent(iframeUrl)
+      window.open(workUrl)
+    },
     initEvents: function() {
       var _this = this
       $('.experience-button').on('click', function() {
         var source = $(this).attr('data-source')
-        if (_this.checkHasYYSZBPower()) {
-          _this.goToYYSZBPage()
+        if (_this.checkHasPower()) {
+          _this.redirectToPage()
         } else {
           _this.doLeaveInfo(source)
         }