Sfoglia il codice sorgente

Merge branch 'dev4.6.2.1' of http://192.168.3.207:8080/qmx/jy into dev4.6.2.1

zhangyuhan 3 anni fa
parent
commit
72e7a2ab9b

+ 13 - 9
src/jfw/modules/app/src/web/staticres/jyapp/big-member/js/analysis_result.js

@@ -180,12 +180,12 @@ var vNode = {
     },
     beforeDestroy() {
         window.removeEventListener("resize", this.init,20);
-        // if(hotChart) {
-        //     hotChart.dispose();
-        // }
-        // if(pieChart) {
-        //     pieChart.dispose();
-        // }
+        if(this.hotChartRef) {
+          this.hotChartRef.dispose();
+        }
+        if(this.pieChartRef) {
+          this.pieChartRef.dispose();
+        }
     },
     mounted() {
         this.year = new Date().getFullYear() - 2;
@@ -217,11 +217,15 @@ var vNode = {
         },
         // resize 屏幕尺寸
         init: function(){
-            var that = this
-            window.addEventListener('resize', function() {
+          var that = this
+          window.addEventListener('resize', function() {
+            if (that.hotChartRef) {
               that.hotChartRef.resize();
+            }
+            if (that.pieChartRef) {
               that.pieChartRef.resize();
-              that.screenWidth = document.body.clientWidth || window.screen.width
+            }
+            that.screenWidth = document.body.clientWidth || window.screen.width
           })
         },
         // 跳企业画像

+ 3 - 3
src/jfw/modules/app/src/web/staticres/jyapp/big-member/js/ent_portrait.js

@@ -390,7 +390,7 @@ var vNode = {
           }
         },
         error: function (error) {
-          _this.$toast('请求失败')
+          // _this.$toast('请求失败')
         }
       })
     },
@@ -469,11 +469,11 @@ var vNode = {
               _this.topProject.list = res.data.list
             }
           } else {
-            _this.$toast(res.error_msg)
+            // _this.$toast(res.error_msg)
           }
         },
         error: function (error) {
-          _this.$toast('请求失败')
+          // _this.$toast('请求失败')
         }
       })
     },

+ 54 - 32
src/jfw/modules/app/src/web/staticres/jyapp/big-member/js/unit_portrayal.js

@@ -1,5 +1,5 @@
-var hotChart = null;
-var pieChart = null;
+// var hotChart = null;
+// var pieChart = null;
 var vNode = {
     delimiters: ['${', '}'],
     el: '#unit_portrayal',
@@ -42,7 +42,6 @@ var vNode = {
                 showLine: ['项目金额'],
                 axisSite: { right: ['项目金额'] }
             },
-            // hotChart: null,
             isShow:{
                 showDynamic: false,
                 showYearData: false,
@@ -117,7 +116,9 @@ var vNode = {
             },
             bigStatus: 0,
             encryptId: '', // 首次埋点返回的加密id 用于点击去开通传参
-            power: []
+            power: [],
+            hotChart: null,
+            pieChart: null
         }
     },
     computed: {
@@ -157,9 +158,26 @@ var vNode = {
           return this.power.indexOf(5)  == -1 // power == 5
         },
     },
+    watch: {
+      // 监听热力图
+      hotChart: function (newVal) {
+        // console.log(newVal, chartOptions.hotChart, '热力图')
+        if (newVal) {
+          newVal.setOption(chartOptions.hotChart);
+          newVal.resize()
+        }
+      },
+      // 监听饼图
+      pieChart: function (newVal) {
+        // console.log(newVal, chartOptions.deformPieChart, '饼图')
+        if (newVal) {
+          newVal.setOption(chartOptions.deformPieChart);
+          newVal.resize()
+        }
+      }
+    },
     created () {
       this.getPowerInfo()
-      this.init();
     },
     mounted: function () {
         this.buyer.name = decodeURIComponent(utils.getParam('entName'))
@@ -170,20 +188,19 @@ var vNode = {
           sessionStorage.removeItem('buyer_high_set')
           sessionStorage.removeItem('buyer_high_name')
         }
-        // var storageSet = JSON.parse(sessionStorage.getItem('buyer_high_set'))
-        // if (storageSet && this.getStatus) {
-          this.getNewMsg(); // 中标动态
-          this.getChartData(); // 企业画像
-        // }
+        
+        this.getNewMsg(); // 中标动态
+        this.getChartData(); // 企业画像
+        this.init();
     },
     beforeDestroy() {
-        window.removeEventListener("resize", this.init,20);
-        if(hotChart) {
-            hotChart.dispose();
-        }
-        if(pieChart) {
-            pieChart.dispose();
-        }
+      window.removeEventListener("resize", this.init,20);
+      if(this.hotChart) {
+        this.hotChart.dispose();
+      }
+      if(this.pieChart) {
+        this.pieChart.dispose();
+      }
     },
     methods: {
         // 获取权限信息
@@ -279,11 +296,16 @@ var vNode = {
           })
         },
         init() {
-            setTimeout(function() {
-                window.addEventListener('resize', function() {
-                    hotChart.resize();
-                })
-            }, 20)
+          setTimeout(function() {
+            window.addEventListener('resize', function() {
+              if (this.hotChart) {
+                this.hotChart.resize();
+              }
+              if (this.pieChart) {
+                this.pieChart.resize();
+              }
+            })
+          }, 20)
         },
         goEntInfo: function(item) {
             location.href = './ent_portrait?eId=' + encodeURIComponent(item.entId)
@@ -975,30 +997,30 @@ var vNode = {
             var index;
             that.$nextTick(function(){
                 var ref = that.$refs.hotChart;
-                hotChart = echarts.init(ref,null,{renderer: "svg"});
-                hotChart.setOption(chartOptions.hotChart);
+                that.hotChart = echarts.init(ref,null,{renderer: "svg"});
+                that.hotChart.setOption(chartOptions.hotChart);
                 setTimeout(function(){
                     // 默认展示某一个tooltip
-                    hotChart.dispatchAction({
+                    that.hotChart.dispatchAction({
                         type: 'highlight',
                         seriesIndex: 0,  // 显示第几个series
                         dataIndex: that.getMaxProjectCount(data) // 显示第几个数据
                     });
                 },20)
-                hotChart.on("mouseover", function(e) {
+                that.hotChart.on("mouseover", function(e) {
                     index = that.getMaxProjectCount(data)
                     if (e.dataIndex != index) {
-                        hotChart.dispatchAction({
+                      that.hotChart.dispatchAction({
                             type: "downplay",
                             seriesIndex: 0,
                             dataIndex: index
                         });
                     }
                 });
-                hotChart.on("mouseout", function(e) {
+                that.hotChart.on("mouseout", function(e) {
                     index = that.getMaxProjectCount(data)
                     if (e.dataIndex != index) {
-                        hotChart.dispatchAction({
+                      that.hotChart.dispatchAction({
                             type: "highlight",
                             seriesIndex: 0,
                             dataIndex: that.getMaxProjectCount(data)
@@ -1080,9 +1102,9 @@ var vNode = {
             }
             that.$nextTick(function(){
                 var ref = that.$refs.pieChart;
-                pieChart = echarts.init(ref,null,{renderer: "svg"});
-                pieChart.setOption(chartOptions.deformPieChart);
-                pieChart.resize();
+                that.pieChart = echarts.init(ref,null,{renderer: "svg"});
+                that.pieChart.setOption(chartOptions.deformPieChart);
+                that.pieChart.resize();
             })
         },
         arrTrans: function(num, arr) { // 一维数组转换为二维数组

+ 1 - 1
src/jfw/modules/app/src/web/templates/weixin/historypush.html

@@ -1612,7 +1612,7 @@ function hasNoData() {
   //
   function appendList(content) {
       content.children(".tslist").on("click", function (event) {
-        if (!window.userNewType) {
+        if (!window.userNewType&&!(vm.rootInfo.vipStatus>0||vm.rootInfo.memberStatus>0)) {
             $('#tipsType').show()
           } else {
             $('#tipsType').hide()

+ 1 - 0
src/jfw/modules/bigmember/src/service/use/use.go

@@ -612,6 +612,7 @@ func (u *Use) IsAdd() {
 		d["viper"] = bigPower.Vip_BuySet.Upgrade == 1
 		d["isSubCount"] = bigPower.Pid != ""
 		d["is_member_trial"] = bigPower.HasTrial
+		d["entniche"] = false                       //是否是商机管理用户
 		d["freeEntPort"] = bigPower.FreeEntPort     //免费用户可查看企业画像次数
 		d["freeBuyerPort"] = bigPower.FreeBuyerPort //免费用户可查看采购单位画像次数
 		d["freeFile"] = bigPower.FreeFile           //免费用户可以进行附件下载次数

+ 6 - 6
src/jfw/modules/common/src/qfw/util/jy/switchService.go

@@ -32,16 +32,16 @@ func (s *switchService) Get(session *httpsession.Session, m MongodbSim) string {
 	v, _ := session.Get(s.SessionKey).(string)
 	u, ok := m.FindById("user", userId, `{"i_member_status":1,"i_vip_status":1}`)
 	if ok && u != nil {
-		if i_member_status := util.IntAll((*u)["i_member_status"]); v == s.Member && i_member_status > 0 {
-			return s.Member
-		} else if i_vip_status := util.IntAll((*u)["i_vip_status"]); v == s.Vip && i_vip_status > 0 {
+		if i_vip_status := util.IntAll((*u)["i_vip_status"]); v == s.Vip && i_vip_status > 0 {
 			return s.Vip
-		} else if i_member_status > 0 {
-			session.Set(s.SessionKey, s.Member)
-			return s.Member
 		} else if i_vip_status > 0 {
 			session.Set(s.SessionKey, s.Vip)
 			return s.Vip
+		} else if i_member_status := util.IntAll((*u)["i_member_status"]); v == s.Member && i_member_status > 0 {
+			return s.Member
+		} else if i_member_status > 0 {
+			session.Set(s.SessionKey, s.Member)
+			return s.Member
 		}
 	}
 	session.Del(s.SessionKey)

+ 4 - 1
src/jfw/modules/publicapply/src/subscribe/entity/entity.go

@@ -63,7 +63,10 @@ func (this *ParamInfo) SetAreaByOneProvince() (b bool) {
 			"o_jy.i_newfree": 1, //老免费用户=>新订阅设置页面 20211122
 		}
 		if len(areas) == 1 {
-			setMap["o_jy.o_area"] = areas //设置地区
+			//设置地区
+			setMap["o_jy.o_area"] = map[string]interface{}{
+				areas[0]: []string{},
+			}
 		}
 		if db.Mgo.UpdateById("user", this.UserId, map[string]interface{}{"$set": setMap}) {
 			jy.ClearBigVipUserPower(this.UserId)

+ 10 - 2
src/jfw/modules/publicapply/src/subscribePush/entity/setting.go

@@ -129,14 +129,22 @@ func IsCanSet(userId string, areamap map[string]interface{}) (bool, bool, int) {
 		areacount = qutil.IntAll(o_buyset_p["areacount"]) //-1 全国无限制
 		myareamap = *qutil.ObjToMap(o_jy["o_area_p"])
 	}
+	myareabool := map[string]bool{}
+	areasize := 0
+	//库中地区
 	for oak, _ := range myareamap {
+		myareabool[oak] = true
 		myarea = append(myarea, oak)
 	}
+	//参数地区
 	for sak, _ := range areamap {
+		if myareabool[sak] {
+			areasize += 1
+		}
 		setarea = append(setarea, sak)
 	}
-	if areaSort(setarea) == areaSort(myarea) {
-		log.Println(setarea, "-地区选择前后一致-", myarea)
+	if areaSort(setarea) == areaSort(myarea) || areasize == len(setarea) {
+		log.Println(setarea, "-地区选择前后一致或地区调整在已选择地区范围内-", myarea)
 		return true, qutil.IntAll(o_jy["i_ppstatus"]) > 0, areacount
 	}
 	// log.Println(areaSort(setarea) == areaSort(myarea), "---areacount:", areacount)

+ 50 - 31
src/web/staticres/big-member/js/unit_portrayal.js

@@ -1,5 +1,3 @@
-var hotChart = null;
-var pieChart = null;
 var vNode = {
     delimiters: ['${', '}'],
     el: '#unit_portrayal',
@@ -117,7 +115,9 @@ var vNode = {
             },
             bigStatus: 0,
             encryptId: '', // 首次埋点返回的加密id 用于点击去开通传参
-            power: []
+            power: [],
+            hotChart: null,
+            pieChart: null
         }
     },
     computed: {
@@ -157,9 +157,24 @@ var vNode = {
           return this.power.indexOf(5)  == -1 // power == 5
         },
     },
+    watch: {
+      // 监听热力图
+      hotChart: function (newVal) {
+        if (newVal) {
+          newVal.setOption(chartOptions.hotChart);
+          newVal.resize()
+        }
+      },
+      // 监听饼图
+      pieChart: function (newVal) {
+        if (newVal) {
+          newVal.setOption(chartOptions.deformPieChart);
+          newVal.resize()
+        }
+      }
+    },
     created () {
       this.getPowerInfo()
-        this.init();
     },
     mounted: function () {
         this.buyer.name = decodeURIComponent(utils.getParam('entName'));
@@ -169,20 +184,19 @@ var vNode = {
           sessionStorage.removeItem('buyer_high_set')
           sessionStorage.removeItem('buyer_high_name')
         }
-        // var storageSet = JSON.parse(sessionStorage.getItem('buyer_high_set'))
-        // if (storageSet && !this.getStatus) {
-          this.getNewMsg(); // 中标动态
-          this.getChartData(); // 企业画像
-        // }
+      
+        this.getNewMsg(); // 中标动态
+        this.getChartData(); // 企业画像
+        this.init();
     },
     beforeDestroy() {
-        window.removeEventListener("resize", this.init,20);
-        if(hotChart) {
-            hotChart.dispose();
-        }
-        if(pieChart) {
-            pieChart.dispose();
-        }
+      window.removeEventListener("resize", this.init,20);
+      if(this.hotChart) {
+        this.hotChart.dispose();
+      }
+      if(this.pieChart) {
+        this.pieChart.dispose();
+      }
     },
     methods: {
         // 获取权限信息
@@ -278,11 +292,16 @@ var vNode = {
           })
         },
         init() {
-            setTimeout(function() {
-                window.addEventListener('resize', function() {
-                    hotChart.resize();
-                })
-            }, 20)
+          setTimeout(function() {
+            window.addEventListener('resize', function() {
+              if (this.hotChart) {
+                this.hotChart.resize();
+              }
+              if (this.pieChart) {
+                this.pieChart.resize();
+              }
+            })
+          }, 20)
         },
         goEntInfo: function(item) {
             location.href = "/weixin/frontPage/collection/sess/ent_portrait?eId=" + encodeURIComponent(item.entId)
@@ -975,30 +994,30 @@ var vNode = {
             var index;
             that.$nextTick(function(){
                 var ref = that.$refs.hotChart;
-                hotChart = echarts.init(ref,null,{renderer: "svg"});
-                hotChart.setOption(chartOptions.hotChart);
+                that.hotChart = echarts.init(ref,null,{renderer: "svg"});
+                that.hotChart.setOption(chartOptions.hotChart);
                 setTimeout(function(){
                     // 默认展示某一个tooltip
-                    hotChart.dispatchAction({
+                    that.hotChart.dispatchAction({
                         type: 'highlight',
                         seriesIndex: 0,  // 显示第几个series
                         dataIndex: that.getMaxProjectCount(data) // 显示第几个数据
                     });
                 },20)
-                hotChart.on("mouseover", function(e) {
+                that.hotChart.on("mouseover", function(e) {
                     index = that.getMaxProjectCount(data)
                     if (e.dataIndex != index) {
-                        hotChart.dispatchAction({
+                      that.hotChart.dispatchAction({
                             type: "downplay",
                             seriesIndex: 0,
                             dataIndex: index
                         });
                     }
                 });
-                hotChart.on("mouseout", function(e) {
+                that.hotChart.on("mouseout", function(e) {
                     index = that.getMaxProjectCount(data)
                     if (e.dataIndex != index) {
-                        hotChart.dispatchAction({
+                      that.hotChart.dispatchAction({
                             type: "highlight",
                             seriesIndex: 0,
                             dataIndex: that.getMaxProjectCount(data)
@@ -1080,9 +1099,9 @@ var vNode = {
             }
             that.$nextTick(function(){
                 var ref = that.$refs.pieChart;
-                pieChart = echarts.init(ref,null,{renderer: "svg"});
-                pieChart.setOption(chartOptions.deformPieChart);
-                pieChart.resize();
+                that.pieChart = echarts.init(ref,null,{renderer: "svg"});
+                that.pieChart.setOption(chartOptions.deformPieChart);
+                that.pieChart.resize();
             })
         },
         arrTrans: function(num, arr) { // 一维数组转换为二维数组

+ 3 - 3
src/web/staticres/common-module/big-member/css/high_set.css

@@ -67,10 +67,10 @@
   border-radius: 4px;
 }
 .match-item.active{
-  background: url(../image/item-checked.png) no-repeat center center #fff;
-  background-size: 100% 100%;
+  background: url(../image/item-checked.png) no-repeat center center;
+  background-size: contain;
   border: 0;
-  overflow: hidden;
+  box-sizing: border-box;
 }
 .match-item .match-value{
   color: #171826;

+ 3 - 3
src/web/staticres/common-module/collection/js/ent_portrait.js

@@ -395,7 +395,7 @@ var vNode = {
           }
         },
         error: function (error) {
-          _this.$toast('请求失败')
+          // _this.$toast('请求失败')
         }
       })
     },
@@ -471,11 +471,11 @@ var vNode = {
               _this.topProject.list = res.data.list
             }
           } else {
-            _this.$toast(res.error_msg)
+            // _this.$toast(res.error_msg)
           }
         },
         error: function (error) {
-          _this.$toast('请求失败')
+          // _this.$toast('请求失败')
         }
       })
     },

+ 1 - 1
src/web/templates/weixin/historypush.html

@@ -1762,7 +1762,7 @@
       //
       function appendList(content) {
           content.children(".tslist").on("click", function () {
-            if (!userNewType) {
+            if (!userNewType&&window.isFreeUserStatus) {
                 $('#tipsType').show()
             } else {
                 $('#tipsType').hide()