Browse Source

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

wangshan 3 năm trước cách đây
mục cha
commit
77462d2296

+ 1 - 0
src/jfw/front/login.go

@@ -120,6 +120,7 @@ func (l *Login) Login() error {
 							"l_modifydate": time.Now().Unix(),
 						},
 						"s_regsource": "pc",
+						"s_platform":  "pc",
 					}
 					source := l.GetString("source") //用户手机号用户记录百度统计
 					if ck, err := l.GetCookie("source"); err == nil && ck.Value != "" {

+ 4 - 1
src/jfw/modules/app/src/app/front/login.go

@@ -209,6 +209,7 @@ func (l *Login) Login() error {
 							"i_newfree":    1, //新免费用户=>新订阅设置页面 20211122
 							"l_modifydate": time.Now().Unix(),
 						},
+						"s_platform": "app",
 					}
 					data["s_regsource"] = isAndroidOrIOS(l.Header("User-Agent"))
 					_id := mongodb.Save("user", data)
@@ -467,6 +468,7 @@ func (l *Login) Register() error {
 						"l_modifydate": time.Now().Unix(),
 					}
 					data["s_regsource"] = isAndroidOrIOS(l.Header("User-Agent"))
+					data["s_platform"] = "app"
 					saveid = mongodb.Save("user", data)
 					saveSuccess = saveid != ""
 				}
@@ -610,8 +612,9 @@ func (l *Login) WxLogin() {
 					"i_newfree":    1, //新免费用户=>新订阅设置页面 20211122
 					"l_modifydate": time.Now().Unix(),
 				},
+				"s_platform": "app", //用户注册平台 app 微信 pc
 			}
-			newUser["s_regsource"] = isAndroidOrIOS(l.Header("User-Agent"))
+			newUser["s_regsource"] = isAndroidOrIOS(l.Header("User-Agent")) //用户注册终端 ios 安卓 pc
 			if _id := mongodb.Save("user", newUser); _id != "" {
 				returnSign = afterLogin(newUser, l.Session(), rid, oid, phoneType, channel, deviceId, 2, true, l.ResponseWriter)
 				if disWord != "" {

+ 58 - 33
src/jfw/modules/app/src/web/staticres/jyapp/big-member/js/analysis_result.js

@@ -1,5 +1,3 @@
-var hotChart = null;
-var pieChart = null;
 var vNode = {
     delimiters: ['${', '}'],
     el: '#analysis-result',
@@ -103,7 +101,9 @@ var vNode = {
             winnerVal: '',
             buyerVal: '',
             scrollTop: 0,
-            defaultProjectDetail: []
+            defaultProjectDetail: [],
+            hotChartRef: null,
+            pieChartRef: null
         }
     },
     computed: {
@@ -117,6 +117,34 @@ var vNode = {
             return 320 - 22*this.minusRows  + 'px'
         }
     },
+    watch: {
+      active: function(newVal) {
+        // 监听切换到类似项目明细 页面滚动到筛选条件位置
+        if (newVal == 1) {
+          this.$nextTick(function() {
+            if (this.$refs.detailFilter) {
+              this.$refs.detailFilter.scrollIntoView()
+            }
+          })
+        }
+      },
+      // 监听热力图
+      hotChartRef: function (newVal) {
+        // console.log(newVal, chartOptions.hotChart, '热力图')
+        if (newVal) {
+          newVal.setOption(chartOptions.hotChart);
+          newVal.resize()
+        }
+      },
+      // 监听饼图
+      pieChartRef: function (newVal) {
+        // console.log(newVal, chartOptions.deformPieChart, '饼图')
+        if (newVal) {
+          newVal.setOption(chartOptions.deformPieChart);
+          newVal.resize()
+        }
+      }
+    },
     created () {
         try {
             this.mobileModel = JyObj.getPhoneBrand();
@@ -144,7 +172,6 @@ var vNode = {
             this.currentVal.buyerClass = prevState.currentVal.buyerClass;
         }
         this.isFollowProject();
-        this.init();
         var restore = this.restoreData()
         if (!restore) {
             this.getChartData();
@@ -153,18 +180,19 @@ var vNode = {
     },
     beforeDestroy() {
         window.removeEventListener("resize", this.init,20);
-        if(hotChart) {
-            hotChart.dispose();
-        }
-        if(pieChart) {
-            pieChart.dispose();
-        }
+        // if(hotChart) {
+        //     hotChart.dispose();
+        // }
+        // if(pieChart) {
+        //     pieChart.dispose();
+        // }
     },
     mounted() {
         this.year = new Date().getFullYear() - 2;
         // 动态调整sticky距离顶部的高度
         this.getStickyTop()
         window.addEventListener('scroll', this.handleScroll, true);
+        this.init();
     },
     methods: {
         showLoading: function () {
@@ -190,13 +218,11 @@ var vNode = {
         // resize 屏幕尺寸
         init: function(){
             var that = this
-            setTimeout(function() {
-                window.addEventListener('resize', function() {
-                    hotChart.resize();
-                    pieChart.resize();
-                    that.screenWidth = document.body.clientWidth
-                })
-            }, 20)
+            window.addEventListener('resize', function() {
+              that.hotChartRef.resize();
+              that.pieChartRef.resize();
+              that.screenWidth = document.body.clientWidth || window.screen.width
+          })
         },
         // 跳企业画像
         goEntImg:function(name) {
@@ -253,7 +279,6 @@ var vNode = {
         },
         getStickyTop: function () {
             this.stickyTop = $('.jy-app-header').height() - 1;
-            console.log(this.stickyTop)
         },
         // 取消关注
         cancelFollow:function(){
@@ -690,30 +715,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.hotChartRef = echarts.init(ref,null,{renderer: "svg"});
+                that.hotChartRef.setOption(chartOptions.hotChart);
                 setTimeout(function(){
                     // 默认展示某一个
-                    hotChart.dispatchAction({
+                    that.hotChartRef.dispatchAction({
                         type: 'highlight',
                         seriesIndex: 0,  // 显示第几个series
                         dataIndex: that.getMaxProjectCount(data) // 最大值所在数组的索引
                     });
                 },20)
-                hotChart.on("mouseover", function(e) {
+                that.hotChartRef.on("mouseover", function(e) {
                     index = that.getMaxProjectCount(data)
                     if (e.dataIndex != index) {
-                        hotChart.dispatchAction({
+                      that.hotChartRef.dispatchAction({
                             type: "downplay",
                             seriesIndex: 0,
                             dataIndex: index
                         });
                     }
                 });
-                hotChart.on("mouseout", function(e) {
+                that.hotChartRef.on("mouseout", function(e) {
                     index = that.getMaxProjectCount(data)
                     if (e.dataIndex != index) {
-                        hotChart.dispatchAction({
+                      that.hotChartRef.dispatchAction({
                             type: "highlight",
                             seriesIndex: 0,
                             dataIndex: that.getMaxProjectCount(data)
@@ -762,7 +787,7 @@ var vNode = {
             }
             var maxNum = Math.max.apply(null,arr);
             var curIndex = this.getArrayIndex(arr,maxNum,'count')
-            console.log('最大值:'+ maxNum + ',索引:' + curIndex)
+            // console.log('最大值:'+ maxNum + ',索引:' + curIndex)
             setTimeout(function(){
                 $event.dispatchAction({
                     type: 'showTip',
@@ -828,12 +853,12 @@ var vNode = {
             var curIndex = that.getArrayIndex(data,true,'pie'); // 当前项目采购类型在饼图数组中的坐标
             that.$nextTick(function(){
                 var ref = that.$refs.pieChart;
-                pieChart = echarts.init(ref);
-                pieChart.setOption(chartOptions.deformPieChart);
-                pieChart.resize();
+                that.pieChartRef = echarts.init(ref);
+                that.pieChartRef.setOption(chartOptions.deformPieChart);
+                that.pieChartRef.resize();
                 if(curIndex) {
                     setTimeout(function(){
-                        pieChart.dispatchAction({
+                        that.pieChartRef.dispatchAction({
                             type: 'showTip',
                             seriesIndex:0,
                             dataIndex: curIndex
@@ -979,9 +1004,9 @@ var vNode = {
           this.buyerVal = buyer ? buyer : ''
           this.scrollTop = this.$refs.wrapper.scrollTop
           if (buyer) {
-            this.getProjectDetail(2, winner, buyer)
+            this.getProjectDetail(0, winner, buyer)
           } else {
-            this.getProjectDetail(1, winner)
+            this.getProjectDetail(0, winner)
           }
         },
         onTabClick (page) {
@@ -1029,7 +1054,7 @@ var vNode = {
             appVersion: this.appVersion,
             // 以下为新增
             winner: winner,
-            searchType: 3
+            searchType: 1
           }
           if (winner || buyer) {
             sessionStorage.setItem('analysis_other_project', JSON.stringify(data))

+ 26 - 9
src/jfw/modules/app/src/web/templates/areaPack/page_set_area.html

@@ -212,7 +212,7 @@
                 var restore = this.restoreState()
 
                 if (restore) {
-                    
+                    this.initPageInfo()
                 } else {
                     if (type === 'new') {
                         this.setAreaAllNotSelected()
@@ -222,6 +222,17 @@
                 }
             },
             methods: {
+                initPageInfo: function () {
+                    var area = this.selectedArea
+                    this.setComponentState(area)
+                },
+                setAreaSelected: function (area) {
+                    this.$set(this, 'selectedArea', area)
+                },
+                setComponentState: function (area) {
+                    vNode.data.initCityMap = area
+                    vueComponent.setCitySelected(area)
+                },
                 setAreaAllNotSelected: function () {
                     vueComponent.setCitySelected()
                     vueComponent.provinceListMap['#'][0].selectedState = ''
@@ -239,7 +250,14 @@
                                     if (res.data.area === null || res.data.area === undefined) {
                                         _this.setAreaAllNotSelected()
                                     } else {
-                                        Object.assign(_this.userSubInfo, res.data)
+                                        if (res.data.area) {
+                                            // 赋值默认已选
+                                            _this.setAreaSelected(res.data.area)
+                                        }
+                                        for (var key in res.data) {
+                                            _this.$set(_this.userSubInfo, key, res.data[key])
+                                        }
+                                        _this.initPageInfo()
                                     }
                                 }
                             } else {
@@ -270,9 +288,6 @@
                         }
                     })
                 },
-                setAreaSelected: function (area) {
-                    this.$set(this, 'selectedArea', area)
-                },
                 confirmed: function (area) {
                     this.setAreaSelected(area)
                     if (this.moreThanSubCount) {
@@ -301,16 +316,18 @@
                     if ($data) {
                         $data = JSON.parse($data)
 
-                        for (var key in $data) {
-                            Object.assign(this.$data[key], $data[key])
-                        }
+                        this.selectedArea = $data.selectedArea
+                        Object.assign(this.userSubInfo, $data.userSubInfo)
 
                         sessionStorage.removeItem(this.sessKey)
                     }
                     return !!$data
                 },
                 savePageState: function () {
-                    var data = JSON.stringify(this.$data)
+                    var data = {
+                        selectedArea: this.selectedArea,
+                        userSubInfo: this.userSubInfo
+                    }
                     sessionStorage.setItem(this.sessKey, JSON.stringify(data))
                 },
             }

+ 1 - 1
src/jfw/modules/app/src/web/templates/big-member/page_analysis_result.html

@@ -232,7 +232,7 @@
                             </div>
                         </van-tab>
                         <van-tab title="类似项目明细">
-                            <div class="detail-filter">
+                            <div class="detail-filter" ref="detailFilter">
                               <van-collapse v-model="activeNames">
                                 <van-collapse-item title="筛选条件" name="1">
                                   <van-field class="filter-input" v-model="winnerVal" label="中标企业" placeholder="输入中标企业名称" maxlength="50"></van-field>

+ 11 - 1
src/web/staticres/common-module/collection/js/history-project.js

@@ -17,7 +17,7 @@ var historyProTemplate = `
                           <div class="contactlabel">联系人:</div>
                           <div class="contact-name">{{data[Object.keys(data)] || '--'}}</div>
                       </div>
-                      <a :href="'tel:'+Object.keys(data)[0]" class="contact-bot" v-if="Object.keys(data)[0]!==''" @click="telPhoneClick($event,Object.keys(data)[0])">
+                      <a :href="'tel:'+formatTel(Object.keys(data)[0])" class="contact-bot" v-if="Object.keys(data)[0]!==''" @click="telPhoneClick($event,Object.keys(data)[0])">
                           <div class="con-left">
                               <div class="contact-phonelabel">联系方式:</div>
                               <div class="contact-phone">{{Object.keys(data)[0]}}</div>
@@ -153,6 +153,9 @@ var hisproComponent = {
       if(!utils.isWeiXinBrowser) {
         e.preventDefault()
         try {
+          if(tel.indexOf('、') > -1) {
+            tel = tel.split('、')[0]
+          }
           JyObj.callPhone(tel);
         } catch (error) {
           
@@ -167,5 +170,12 @@ var hisproComponent = {
       })
       return loading
     },
+    // 联系方式取第一个
+    formatTel: function (tel) {
+      if(tel.indexOf('、') > -1) {
+        tel = tel.split('、')[0]
+      }
+      return tel
+    }
   }
 }

+ 26 - 9
src/web/templates/areaPack/wx/page_set_area.html

@@ -212,7 +212,7 @@
                 var restore = this.restoreState()
 
                 if (restore) {
-                    
+                    this.initPageInfo()
                 } else {
                     if (type === 'new') {
                         this.setAreaAllNotSelected()
@@ -222,6 +222,17 @@
                 }
             },
             methods: {
+                initPageInfo: function () {
+                    var area = this.selectedArea
+                    this.setComponentState(area)
+                },
+                setAreaSelected: function (area) {
+                    this.$set(this, 'selectedArea', area)
+                },
+                setComponentState: function (area) {
+                    vNode.data.initCityMap = area
+                    vueComponent.setCitySelected(area)
+                },
                 setAreaAllNotSelected: function () {
                     vueComponent.setCitySelected()
                     vueComponent.provinceListMap['#'][0].selectedState = ''
@@ -239,7 +250,14 @@
                                     if (res.data.area === null || res.data.area === undefined) {
                                         _this.setAreaAllNotSelected()
                                     } else {
-                                        Object.assign(_this.userSubInfo, res.data)
+                                        if (res.data.area) {
+                                            // 赋值默认已选
+                                            _this.setAreaSelected(res.data.area)
+                                        }
+                                        for (var key in res.data) {
+                                            _this.$set(_this.userSubInfo, key, res.data[key])
+                                        }
+                                        _this.initPageInfo()
                                     }
                                 }
                             } else {
@@ -270,9 +288,6 @@
                         }
                     })
                 },
-                setAreaSelected: function (area) {
-                    this.$set(this, 'selectedArea', area)
-                },
                 confirmed: function (area) {
                     this.setAreaSelected(area)
                     if (this.moreThanSubCount) {
@@ -301,16 +316,18 @@
                     if ($data) {
                         $data = JSON.parse($data)
 
-                        for (var key in $data) {
-                            Object.assign(this.$data[key], $data[key])
-                        }
+                        this.selectedArea = $data.selectedArea
+                        Object.assign(this.userSubInfo, $data.userSubInfo)
 
                         sessionStorage.removeItem(this.sessKey)
                     }
                     return !!$data
                 },
                 savePageState: function () {
-                    var data = JSON.stringify(this.$data)
+                    var data = {
+                        selectedArea: this.selectedArea,
+                        userSubInfo: this.userSubInfo
+                    }
                     sessionStorage.setItem(this.sessKey, JSON.stringify(data))
                 },
             }