Explorar o código

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

zhangxinlei1996 %!s(int64=3) %!d(string=hai) anos
pai
achega
0ff4c9fa72

+ 1 - 1
src/jfw/modules/app/src/app/front/wxkeyset.go

@@ -27,7 +27,7 @@ func (m *Front) WxKeyset(tpl string) error {
 	//到新订阅设置
 	vipMsg := jy.GetBigVipUserBaseMsg(userid, public.Mysql, public.MQFW)
 	if vipMsg.IsUpgrade {
-		return m.Redirect("/front/vipsubscribe/toSubVipSetPage")
+		return m.Redirect("/jyapp/vipsubscribe/toSubVipSetPage")
 	}
 	if tpl == "seniorset" {
 		data, ok := mongodb.FindById("user", userid, `{"o_jy":1}`)

+ 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))

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

@@ -437,6 +437,7 @@ var vNode = {
             try {
                 onChange && onChange(selectedCity)
             } catch (error) {
+                console.warn(error)
                 console.warn(arguments.callee.name + '必须定义为函数')
             }
         },
@@ -445,6 +446,7 @@ var vNode = {
             try {
                 onReset && onReset(this.initCityMap)
             } catch (error) {
+                console.log(error)
                 console.error(arguments.callee.name + '必须定义为函数')
             }
         },
@@ -453,6 +455,7 @@ var vNode = {
             try {
                 onConfirm && onConfirm(selectedCity)
             } catch (error) {
+                console.log(error)
                 console.error(arguments.callee.name + '必须定义为函数')
             }
         }

+ 5 - 12
src/jfw/modules/app/src/web/staticres/jyapp/vipsubscribe/js/vip_index_new.js

@@ -359,19 +359,12 @@ $(function () {
   }
   var resObj = {}
   // 每次请求接口
-  console.log(document.referrer)
-  let subUrl
-  if (subNode.vSwitch === 'v') {
-    subUrl = '/subscribepay/vipsubscribe/getSubBuyMsg'
-  } else if (subNode.vSwitch === 'm') {
-    subUrl = '/bigmember/use/info?t=' + new Date().getTime()
-  } else {
-    subUrl = '/publicapply/free/subscribe'
-  }
+    let subUrl = '/subscribepay/vipsubscribe/getSubBuyMsg'
     $DoPost(subUrl, {}, function(sum) {
-        console.info('sum',sum)
-        resObj = sum
-        getDataWitXHR()
+        if(sum.success) {
+            resObj = sum
+            getDataWitXHR()
+        }
     })
 
   // 设置已选择的区域和行业

+ 190 - 150
src/jfw/modules/app/src/web/templates/areaPack/page_set_area.html

@@ -36,7 +36,6 @@
             font-weight: 500;
             color: #FA483C;
             box-sizing: border-box;
-            display: none;
         }
         .selectChange {
             font-size: 0.24rem;
@@ -119,191 +118,232 @@
     <div id="set-header-template" v-cloak>
         <div class="wrapper-header" id="thisAreaTips">
             <div class="content">
-                <div class="selectNumMax">可选择<span class="numColor" id="canSelect">1个省</span></div>
+                <div class="selectNumMax">可选择<span class="numColor" id="canSelect">${ maxSelectText }</span></div>
                 <div class="string"></div>
                 <div class="selectNumList">
-                    <span>已选择<span class="numColor" id="thisSelect">1个省</span></span>
-                    <span class="moreTips">超出可订阅省份数量,前往购买省份订阅包 ></span>
+                    <span>已选择<span class="numColor" id="thisSelect">${ selectedAreaText }</span></span>
+                    <span class="moreTips" v-show="moreThanSubCount">超出可订阅省份数量,前往${ buyType }省份订阅包 &gt;</span>
                 </div>
                 <div class="selectChange"></div>
             </div>
-            <div class="popup-wrap" v-show="popupType">
+            <div class="popup-wrap" v-show="popupTip">
                 <div class="popup-content">
-                    <div class="popup-text" id="tips-text">您当前仅可订阅1个省,如需增加请购买【省份订阅包】</div>
+                    <div class="popup-text" id="tips-text">您当前仅可订阅${ maxSelectText },如需增加请${ buyType }【省份订阅包】</div>
                     <div class="popup-btnWrap">
-                        <div class="popup-btn" id="cancel" @click="hiddenTips">取消</div>
+                        <div class="popup-btn" id="cancel" @click="hideTips">取消</div>
                         <div class="popup-line"></div>
-                        <div class="popup-btn levelUp" id="btn-text" @click="toPay">去购买</div>
+                        <div class="popup-btn levelUp" id="btn-text" @click="toPay">去${ buyType }</div>
                     </div>
                 </div>
             </div>
         </div>
     </div>
     <script>
-        var setAreaFn = {
-            conf: {
-                sKey: 'sub_free_state'
-            },
-            buyPageInfo: {},
-            init: function () {
-                // 恢复页面状态
-                var pageInfo = sessionStorage.getItem(this.conf.sKey)
-                if (pageInfo) {
-                    this.buyPageInfo = JSON.parse(pageInfo)
-                    var areaInfo = this.buyPageInfo.area
-                    if (this.buyPageInfo && areaInfo && Object.keys(areaInfo).length !== 0) {
-                        vNode.data.initCityMap = areaInfo
-                        vueComponent.setCitySelected(areaInfo)
-                    }
-                }
-            },
-            saveToSessionStorage: function (data) {
-                sessionStorage.setItem(this.conf.sKey, JSON.stringify(data))
-            }
-        }
-        setAreaFn.init()
         var vm = new Vue({
             delimiters: ['${', '}'],
             el: '#set-header',
             template: '#set-header-template',
             data: {
-                popupType: false,
-                popupText: '您当前仅可订阅1个省,如需增加请购买【省份订阅包】',
-                popupPayBtn: '去购买'
+                sessKey: 'sub_free_set_area',
+                selectedArea: '',
+                userSubInfo: {
+                    area: '',
+                    areanum: 0, // 可修改次数
+                    basenum: 1,
+                    provincenum: 0, // 购买的省份数量
+                },
+                popupTip: false
             },
-            created: function () {},
-            methods: {
-                hiddenTips: function () {
-                    this.popupType = false
+            computed: {
+                moreThanSubCount: function () {
+                    var max = this.maxSelectCount
+                    var sel = this.selectedAreaCount
+                    if (max === -1) return false
+                    if (sel === -1) return true
+                    if (sel > max) return true
                 },
-                toPay: function () {
-                    this.popupType = false
-                    if (userType) {
-                        // /jyapp/areaPack/page/buy?type=buy&area= + encodeURIComponent(JSON.stringify())
-                        location.href = '/jyapp/areaPack/page/buy?type=renew&area=' +  encodeURIComponent(JSON.stringify(thisData))
+                maxSelectCount: function () {
+                    var baseNum = this.userSubInfo.basenum || 1
+                    var provincenum = this.userSubInfo.provincenum
+                    if (provincenum === -1) {
+                        return provincenum
                     } else {
-                        location.href = '/jyapp/areaPack/page/buy?type=buy&area=' +  encodeURIComponent(JSON.stringify(thisData))
+                        return provincenum + baseNum
                     }
                 },
-                
-            }
-        })
-        var maxSelect = 1
-        var thisSelectNum = 0
-        var userType = true // 用户是否购买过省份包
-        var vSwitch = 'f' // 用户版本,''免费版,m大会员,v超级订阅
-        // 获取用户权限
-        function getUserMsg() {
-            $.ajax({
-                url: '/bigmember/use/isAdd',
-                type: 'POST',
-                success: function (res) {
-                    if (res.data.memberStatus > 0 && res.data.vipStatus <= 0) {
-                        vSwitch = 'm'
-                        $('#thisAreaTips').hide()
-                    } else if (res.data.memberStatus <= 0 && res.data.vipStatus > 0) {
-                        vSwitch = 'v'
-                        $('#thisAreaTips').hide()
-                    } else if (res.data.memberStatus <= 0 && res.data.vipStatus <= 0) {
-                        vSwitch = 'f'
-                        $('#thisAreaTips').show()
+                maxSelectText: function () {
+                    if (this.maxSelectCount === -1) {
+                        return '全国'
+                    } else {
+                        return this.maxSelectCount + '个省'
                     }
-                }
-            })
-        }
-        getUserMsg()
-        // 获取用户购买省份包信息
-        function getUserSubscribe() {
-            $.ajax({
-                url: '/publicapply/free/subscribe',
-                type: 'POST',
-                success: function (res) {
-                    let freeArea = JSON.stringify(res.data)
-                    sessionStorage.setItem('sub_free_state', freeArea)
-                    setAreaFn.init()
-                    onChange(res.data.area)
-                    userType = res.data.provincenum === 0 ? false : true
-                    maxSelect = res.data.provincenum + res.data.basenum
-                    // _this.$emit('UserSubscribe',res)
-                    if (maxSelect === -1) {
-                        $('#canSelect').text(`全国`)
-                    } else if (res.data.provincenum === 0 && res.data.areanum === 1) {
-                        vueComponent.provinceListMap['#'][0].selectedState = ''
+                },
+                selectedAreaCount: function () {
+                    var area = this.selectedArea
+                    if (area) {
+                        var keys = Object.keys(area)
+                        if (keys.length === 0) {
+                            return -1
+                        } else {
+                            return keys.length
+                        }
                     } else {
-                        $('#canSelect').text(`${maxSelect}个省`)
+                        return 0
                     }
-                }
-            })
-        }
-        getUserSubscribe()
-        function userUpdate(obj) {
-            let _this = this
-            $.ajax({
-                url: '/publicapply/subscribe/update',
-                type: 'POST',
-                data: {
-                    vSwitch: vSwitch,
-                    area:obj
                 },
-                success: function (res) {
-                    console.info(res)  
-                    window.history.back()           
+                selectedAreaText: function () {
+                    if (this.selectedAreaCount === -1) {
+                        return '全国'
+                    } else {
+                        return this.selectedAreaCount + '个省'
+                    }
+                },
+                // 是否购买了省份订阅包
+                userType: function () {
+                    if (this.userSubInfo.provincenum === -1) return true
+                    return this.userSubInfo.provincenum !== 0
+                },
+                buyType: function () {
+                    return this.userType ? '升级' : '购买'
+                },
+            },
+            mounted: function () {
+                var type = utils.getParam('type')
+                var restore = this.restoreState()
+
+                if (restore) {
+                    this.initPageInfo()
+                } else {
+                    if (type === 'new') {
+                        this.setAreaAllNotSelected()
+                    } else {
+                        this.getUserSubscribe()
+                    } 
                 }
-            })
-        }
-        $('#thisSelect').text(`${thisSelectNum}个省`)
-        $('#canSelect').text(`${maxSelect}个省`)
-        // 以下均为示例:具体使用时候请删除
-        // 定义重置方法:方法名必须为onReset/onConfirm
-        // 参数,是被初始化的数据
+            },
+            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 = ''
+                    $('#set-area .j-button-confirm').prop('disabled', true)
+                },
+                // 获取用户订阅信息
+                getUserSubscribe: function () {
+                    var _this = this
+                    $.ajax({
+                        url: '/publicapply/free/subscribe',
+                        type: 'POST',
+                        success: function (res) {
+                            if (res && res.error_code === 0) {
+                                if (res.data) {
+                                    if (res.data.area === null || res.data.area === undefined) {
+                                        _this.setAreaAllNotSelected()
+                                    } else {
+                                        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 {
+                                if (res.error_msg) {
+                                    _this.$toast(res.error_msg)
+                                }
+                            }
+                        }
+                    })
+                },
+                userUpdate: function (area) {
+                    var _this = this
+                    $.ajax({
+                        url: '/publicapply/subscribe/update',
+                        type: 'POST',
+                        data: {
+                            vSwitch: 'f',
+                            area: JSON.stringify(area)
+                        },
+                        success: function (res) {
+                            if (res && res.success) {
+                                history.back()           
+                            } else {
+                                if (res.errMsg) {
+                                    _this.$toast(res.errMsg)
+                                }
+                            }
+                        }
+                    })
+                },
+                confirmed: function (area) {
+                    this.setAreaSelected(area)
+                    if (this.moreThanSubCount) {
+                        this.popupTip = true
+                    } else {
+                        this.userUpdate(area)
+                    }
+                },
+                hideTips: function () {
+                    this.popupTip = false
+                },
+                toPay: function () {
+                    this.popupTip = false
+                    var area = this.selectedArea
+                    var urlBase = '/jyapp/areaPack/page/buy'
+                    var areaJSON = encodeURIComponent(JSON.stringify(area))
+                    this.savePageState()
+                    if (this.userType) {
+                        location.href = urlBase + '?type=upgrade&area=' +  areaJSON
+                    } else {
+                        location.href = urlBase +  '?type=buy&area=' +  areaJSON
+                    }
+                },
+                restoreState: function () {
+                    var $data = sessionStorage.getItem(this.sessKey)
+                    if ($data) {
+                        $data = JSON.parse($data)
+
+                        this.selectedArea = $data.selectedArea
+                        Object.assign(this.userSubInfo, $data.userSubInfo)
+
+                        sessionStorage.removeItem(this.sessKey)
+                    }
+                    return !!$data
+                },
+                savePageState: function () {
+                    var data = {
+                        selectedArea: this.selectedArea,
+                        userSubInfo: this.userSubInfo
+                    }
+                    sessionStorage.setItem(this.sessKey, JSON.stringify(data))
+                },
+            }
+        })
+
         function onReset (initData) {
-            $('.selectChange').text('')
-            $('#thisSelect').text(`${thisSelectNum}个省`)
-            $('.moreTips').hide()
+            vm.setAreaSelected(initData)
         }
         // 被选中的数据
         function onConfirm (selectedData) {
-            var selectDataList = []
-            for (const key in selectedData) {
-                selectDataList.push(key)
-            }
-            if (selectDataList.length > maxSelect && maxSelect !== -1 && vSwitch === 'f') {
-                vm.popupType = true
-                if (!userType) {
-                    $('#tips-text').text('您当前仅可订阅1个省,如需增加请购买【省份订阅包】')
-                    $('#btn-text').text('去购买')
-                } else {
-                    $('#tips-text').text('已超出您可订阅的省份数量,是否升级【省份订阅包】')
-                    $('#btn-text').text('去升级')
-                }
-            } else {
-                var areaData = {}
-                selectDataList.forEach(function (item, index) {
-                    areaData[item] = []
-                })
-                areaData = JSON.stringify(areaData)
-                userUpdate(areaData)
-                sessionStorage.setItem('sub_vip_state', areaData)
-                
-            }
+            vm.confirmed(selectedData)
         }
-        var thisData = []
         // 页面选中状态改变时触发
         function onChange (selectedData) {
-            thisData = selectedData
-            var selectDataList = []
-            for (const key in selectedData) {
-                selectDataList.push(key)
-            }
-            var arr = selectDataList.join('、')
-            $('.selectChange').text(`${arr}`)
-            thisSelectNum = selectDataList.length
-            $('#thisSelect').text(`${selectDataList.length}个省`)
-            if (thisSelectNum > maxSelect) {
-                $('.moreTips').show()
-            } else {
-                $('.moreTips').hide()
-            }
+            vm.setAreaSelected(selectedData)
+            $('#set-area .j-button-confirm').prop('disabled', false)
         }
     </script>
 </body>

+ 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>

+ 5 - 1
src/jfw/modules/app/src/web/templates/commonPay/areaPack/orderDetail.html

@@ -89,6 +89,10 @@
                         class="j-button-confirm buy-again"
                         v-if="orderStateMap[orderInfo.state].bottomButtonShow.buyAgain"
                         @click="buyAgain">再次购买</button>
+                    <button
+                            class="j-button-confirm renew"
+                            v-if="orderStateMap[orderInfo.state].bottomButtonShow.renew"
+                            @click="renew">续费</button>
                 </div>
             </div>
         </div>
@@ -110,4 +114,4 @@
     {{include "/common/baiducc.html"}}
 </body>
 
-</html>
+</html>

+ 4 - 3
src/jfw/modules/bigmember/src/entity/analysis.go

@@ -43,7 +43,7 @@ func (this *AnalysisDec) DecQueryNewSimilarMsgByBW() (qstr string) {
 	bools := []string{}
 	musts := []string{}
 	shoulds := []string{}
-	var BWExists = 1
+	var BWExists = 0
 	//中标单位 类似项目合作历史||采购单位类似项目
 	if this.Winner != "" {
 		BWExists += 1
@@ -70,8 +70,9 @@ func (this *AnalysisDec) DecQueryNewSimilarMsgByBW() (qstr string) {
 		buyerterms += `]}}`
 		musts = append(musts, buyerterms)
 	}
-	if BWExists > 1 && this.SearchType == 3 {
-		this.SearchType = 1
+	//searchType ==1; buyer & winner 不能为空
+	if BWExists < 2 && this.SearchType == 1 {
+		this.SearchType = 0
 	}
 	//省份
 	areaCity := []string{}

+ 6 - 5
src/jfw/modules/bigmember/src/entity/analysisEntName.go

@@ -188,7 +188,7 @@ type AnalysisDec struct {
 	MobileModel      string                 //手机型号
 	AppVersion       string                 //app版本号
 	Winner           string                 //中标企业
-	SearchType       int                    //默认0;1:中标企业||采购单位-类似项目明细;2:中标企业和采购单位类似项目明细;3:中标企业和采购单位其他项目明细
+	SearchType       int                    //默认0:中标企业||采购单位||(中标企业&&采购单位)-类似项目明细;1:中标企业和采购单位其他项目明细
 	UserId           string                 //用户id
 	IsPower          bool                   //是否有权限
 	UserLock         sync.Mutex             //用户锁
@@ -225,17 +225,18 @@ func (this *AnalysisDec) GetProjectInfoByBW() (res []map[string]interface{}) {
 	this.BuyerContent = BuyerContentStruct(this.BuyerContent)
 	//中标企业和采购单位类似项目明细
 	decQuery := this.DecQueryNewSimilarMsgByBW()
+	// log.Println("decQuery:", decQuery)
 	similarMsg, _idMap := this.GetAllMsgByBW(decQuery)
-	// log.Println(decQuery)
+	// log.Println(len(similarMsg), _idMap, "ti--:", this.SearchType)
 	//其他项目明细
 	switch this.SearchType {
-	case 1, 2:
+	case 0:
 		res = similarMsg
-	case 3:
+	case 1:
 		//中标企业和采购单位 所有项目明细
 		allQuery := this.GetAllBWQueryByBW()
 		allMsg, _ := this.GetAllMsgByBW(allQuery)
-		// log.Println(allQuery)
+		// log.Println(allQuery, "----", len(allMsg))
 		if len(allMsg) > 0 {
 			for _, v := range allMsg {
 				id := qutil.ObjToString(v["_id"])

+ 3 - 0
src/web/staticres/big-member/js/set_area.js

@@ -437,6 +437,7 @@ var vNode = {
             try {
                 onChange && onChange(selectedCity)
             } catch (error) {
+                console.log(error)
                 console.warn(arguments.callee.name + '必须定义为函数')
             }
         },
@@ -445,6 +446,7 @@ var vNode = {
             try {
                 onReset && onReset(this.initCityMap)
             } catch (error) {
+                console.log(error)
                 console.error(arguments.callee.name + '必须定义为函数')
             }
         },
@@ -453,6 +455,7 @@ var vNode = {
             try {
                 onConfirm && onConfirm(selectedCity)
             } catch (error) {
+                console.log(error)
                 console.error(arguments.callee.name + '必须定义为函数')
             }
         }

+ 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
+    }
   }
 }

+ 48 - 1
src/web/staticres/common-module/order-list/js/order-detail.js

@@ -45,7 +45,8 @@ var vm = new Vue({
           bottomButtonShow: {
             pay: false,
             invoke: true,
-            buyAgain: false
+            buyAgain: false,
+            renew: false
           }
         },
         '-2': {
@@ -237,6 +238,27 @@ var vm = new Vue({
 
       this.orderInfo.productInfoList = this.getProductInfoList(info)
       this.orderInfo.orderInfoList = this.getOrderInfoListList(info)
+      this.getOrderBottomButton(info.order)
+    },
+    getOrderBottomButton (order) {
+      switch (order.product_type) {
+        case '省份订阅包': {
+          // 续费升级的判断(再次购买按钮值修改)
+          // i_pp_status : -1 到期  0未购买 1已购买
+          this.orderStateMap[1].bottomButtonShow.buyAgain = false
+          this.orderStateMap[1].bottomButtonShow.renew = false
+          var vipStatus =  order.i_pp_status
+          if (order.lastbuy_code) {
+            if (vipStatus === -1 && order.pay_money > 0) {
+              this.orderStateMap[1].bottomButtonShow.buyAgain = true
+            }
+            if (vipStatus === 1) {
+              this.orderStateMap[1].bottomButtonShow.renew = true
+            }
+          }
+          break
+        }
+      }
     },
     getHeaderImg: function (order) {
       var productType = order.product_type
@@ -406,6 +428,24 @@ var vm = new Vue({
         }
       }
     },
+    renew: function () {
+      var order = this.reqOrder
+      var orderCode = order.order_code
+      var productType = order.product_type
+      var platform = this.platform
+      switch (productType) {
+        case '省份订阅包': {
+            var href = assetsConf.areaPackLink.renew[platform]
+            if (href) {
+              this.goToLink(`${href}&orderCode=${orderCode}`)
+            }
+            break
+        }
+        default: {
+          break
+        }
+      }
+    },
     buyAgain: function () {
       var _this = this
       var order = this.reqOrder
@@ -421,6 +461,13 @@ var vm = new Vue({
           }
           break
         }
+        case '省份订阅包': {
+          var href = assetsConf.areaPackLink.buyAgain[platform]
+          if (href) {
+            this.goToLink(`${href}&orderCode=${orderCode}`)
+          }
+          break
+        }
         default: {
           break
         }

+ 9 - 7
src/web/staticres/common-module/vipsubscribe/js/vip-subscribe-set-template.js

@@ -775,9 +775,9 @@ var subComponent = {
     // 跳转地区选择
     gotoArea: function () {
       if (location.href.indexOf('front') !== -1) {
-        location.href = '/areaPack/wx/page/set_area'
+        location.href = '/areaPack/wx/page/set_area?type=new'
       } else {
-        location.href = '/jyapp/areaPack/page/set_area'
+        location.href = '/jyapp/areaPack/page/set_area?type=new'
       }
     },
     // 获取用户权限
@@ -819,11 +819,13 @@ var subComponent = {
               // _this.info.area = '已选:' + proStr
 
               let areaArr = []
-              if (res.data.area === {} || res.data.provincenum === 0) {
-                _this.noAreaFreeType = true
-              } else {
-                for (const key in res.data.area) {
-                  areaArr.push(key)
+              if (res.data) {
+                if (!res.data.area || res.data.provincenum === 0) {
+                  _this.noAreaFreeType = true
+                } else {
+                  for (const key in res.data.area) {
+                    areaArr.push(key)
+                  }
                 }
               }
               $('#menuArea').text('已选:'+ areaArr.join('、'))

+ 190 - 144
src/web/templates/areaPack/wx/page_set_area.html

@@ -36,7 +36,6 @@
             font-weight: 500;
             color: #FA483C;
             box-sizing: border-box;
-            display: none;
         }
         .selectChange {
             font-size: 0.24rem;
@@ -119,185 +118,232 @@
     <div id="set-header-template" v-cloak>
         <div class="wrapper-header" id="thisAreaTips">
             <div class="content">
-                <div class="selectNumMax">可选择<span class="numColor" id="canSelect">1个省</span></div>
+                <div class="selectNumMax">可选择<span class="numColor" id="canSelect">${ maxSelectText }</span></div>
                 <div class="string"></div>
                 <div class="selectNumList">
-                    <span>已选择<span class="numColor" id="thisSelect">1个省</span></span>
-                    <span class="moreTips">超出可订阅省份数量,前往购买省份订阅包 ></span>
+                    <span>已选择<span class="numColor" id="thisSelect">${ selectedAreaText }</span></span>
+                    <span class="moreTips" v-show="moreThanSubCount">超出可订阅省份数量,前往${ buyType }省份订阅包 &gt;</span>
                 </div>
                 <div class="selectChange"></div>
             </div>
-            <div class="popup-wrap" v-show="popupType">
+            <div class="popup-wrap" v-show="popupTip">
                 <div class="popup-content">
-                    <div class="popup-text" id="tips-text">您当前仅可订阅1个省,如需增加请购买【省份订阅包】</div>
+                    <div class="popup-text" id="tips-text">您当前仅可订阅${ maxSelectText },如需增加请${ buyType }【省份订阅包】</div>
                     <div class="popup-btnWrap">
-                        <div class="popup-btn" id="cancel" @click="hiddenTips">取消</div>
+                        <div class="popup-btn" id="cancel" @click="hideTips">取消</div>
                         <div class="popup-line"></div>
-                        <div class="popup-btn levelUp" id="btn-text" @click="toPay">去购买</div>
+                        <div class="popup-btn levelUp" id="btn-text" @click="toPay">去${ buyType }</div>
                     </div>
                 </div>
             </div>
         </div>
     </div>
     <script>
-        var setAreaFn = {
-            conf: {
-                sKey: 'sub_free_state'
-            },
-            buyPageInfo: {},
-            init: function () {
-                // 恢复页面状态
-                var pageInfo = sessionStorage.getItem(this.conf.sKey)
-                if (pageInfo) {
-                    this.buyPageInfo = JSON.parse(pageInfo)
-                    var areaInfo = this.buyPageInfo.area
-                    if (this.buyPageInfo && areaInfo && Object.keys(areaInfo).length !== 0) {
-                        vNode.data.initCityMap = areaInfo
-                        vueComponent.setCitySelected(areaInfo)
-                    }
-                }
-            },
-            saveToSessionStorage: function (data) {
-                sessionStorage.setItem(this.conf.sKey, JSON.stringify(data))
-            }
-        }
-       var vm = new Vue({
+        var vm = new Vue({
             delimiters: ['${', '}'],
             el: '#set-header',
             template: '#set-header-template',
             data: {
-                popupType: false,
-                popupText: '您当前仅可订阅1个省,如需增加请购买【省份订阅包】',
-                popupPayBtn: '去购买'
+                sessKey: 'sub_free_set_area',
+                selectedArea: '',
+                userSubInfo: {
+                    area: '',
+                    areanum: 0, // 可修改次数
+                    basenum: 1,
+                    provincenum: 0, // 购买的省份数量
+                },
+                popupTip: false
             },
-            created: function () {},
-            methods: {
-                hiddenTips: function () {
-                    this.popupType = false
+            computed: {
+                moreThanSubCount: function () {
+                    var max = this.maxSelectCount
+                    var sel = this.selectedAreaCount
+                    if (max === -1) return false
+                    if (sel === -1) return true
+                    if (sel > max) return true
                 },
-                toPay: function () {
-                    if (userType) {
-                        location.href = '/areaPack/wx/page/buy?type=renew&area=' +  encodeURIComponent(JSON.stringify(thisData))
+                maxSelectCount: function () {
+                    var baseNum = this.userSubInfo.basenum || 1
+                    var provincenum = this.userSubInfo.provincenum
+                    if (provincenum === -1) {
+                        return provincenum
                     } else {
-                        location.href = '/areaPack/wx/page/buy?type=buy&area=' +  encodeURIComponent(JSON.stringify(thisData))
+                        return provincenum + baseNum
                     }
                 },
-                
-            }
-        })
-        var maxSelect = 1
-        var thisSelectNum = 0
-        var userType = true // 用户是否购买过省份包
-        var vSwitch = 'f' // 用户版本,'f'免费版,m大会员,v超级订阅
-        // 获取用户权限
-        function getUserMsg() {
-            $.ajax({
-                url: '/bigmember/use/isAdd',
-                type: 'POST',
-                success: function (res) {
-                    if (res.data.vipStatus <= 0) {
-                        vSwitch = 'f'
-                        $('#thisAreaTips').show()
+                maxSelectText: function () {
+                    if (this.maxSelectCount === -1) {
+                        return '全国'
                     } else {
-                        vSwitch = 'v'
-                        $('#thisAreaTips').hide()
+                        return this.maxSelectCount + '个省'
                     }
-                }
-            })
-        }
-        getUserMsg()
-        // 获取用户购买省份包信息
-        function getUserSubscribe() {
-            $.ajax({
-                url: '/publicapply/free/subscribe',
-                type: 'POST',
-                success: function (res) {
-                    let freeArea = JSON.stringify(res.data)
-                    sessionStorage.setItem('sub_free_state', freeArea)
-                    setAreaFn.init()
-                    onChange(res.data.area)
-                    userType = res.data.provincenum === 0 ? false : true
-                    maxSelect = res.data.provincenum  + res.data.basenum
-                    // _this.$emit('UserSubscribe',res)
-                    if (maxSelect === -1) {
-                        $('#canSelect').text(`全国`)
-                    } else if (res.data.provincenum === 0 && res.data.areanum === 1) {
-                        vueComponent.provinceListMap['#'][0].selectedState = ''
+                },
+                selectedAreaCount: function () {
+                    var area = this.selectedArea
+                    if (area) {
+                        var keys = Object.keys(area)
+                        if (keys.length === 0) {
+                            return -1
+                        } else {
+                            return keys.length
+                        }
                     } else {
-                        $('#canSelect').text(`${maxSelect}个省`)
+                        return 0
+                    }
+                },
+                selectedAreaText: function () {
+                    if (this.selectedAreaCount === -1) {
+                        return '全国'
+                    } else {
+                        return this.selectedAreaCount + '个省'
                     }
-                    
-                }
-            })
-        }
-        getUserSubscribe()
-        function userUpdate(obj) {
-            let _this = this
-            console.info(obj)
-            $.ajax({
-                url: '/publicapply/subscribe/update',
-                type: 'POST',
-                data: {
-                    vSwitch: vSwitch,
-                    area:obj
                 },
-                success: function (res) {
-                    console.info(res)  
-                    window.history.back()           
+                // 是否购买了省份订阅包
+                userType: function () {
+                    if (this.userSubInfo.provincenum === -1) return true
+                    return this.userSubInfo.provincenum !== 0
+                },
+                buyType: function () {
+                    return this.userType ? '升级' : '购买'
+                },
+            },
+            mounted: function () {
+                var type = utils.getParam('type')
+                var restore = this.restoreState()
+
+                if (restore) {
+                    this.initPageInfo()
+                } else {
+                    if (type === 'new') {
+                        this.setAreaAllNotSelected()
+                    } else {
+                        this.getUserSubscribe()
+                    } 
                 }
-            })
-        }
-        $('#thisSelect').text(`${thisSelectNum}个省`)
-        $('#canSelect').text(`${maxSelect}个省`)
-        // 以下均为示例:具体使用时候请删除
-        // 定义重置方法:方法名必须为onReset/onConfirm
-        // 参数,是被初始化的数据
+            },
+            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 = ''
+                    $('#set-area .j-button-confirm').prop('disabled', true)
+                },
+                // 获取用户订阅信息
+                getUserSubscribe: function () {
+                    var _this = this
+                    $.ajax({
+                        url: '/publicapply/free/subscribe',
+                        type: 'POST',
+                        success: function (res) {
+                            if (res && res.error_code === 0) {
+                                if (res.data) {
+                                    if (res.data.area === null || res.data.area === undefined) {
+                                        _this.setAreaAllNotSelected()
+                                    } else {
+                                        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 {
+                                if (res.error_msg) {
+                                    _this.$toast(res.error_msg)
+                                }
+                            }
+                        }
+                    })
+                },
+                userUpdate: function (area) {
+                    var _this = this
+                    $.ajax({
+                        url: '/publicapply/subscribe/update',
+                        type: 'POST',
+                        data: {
+                            vSwitch: 'f',
+                            area: JSON.stringify(area)
+                        },
+                        success: function (res) {
+                            if (res && res.success) {
+                                history.back()           
+                            } else {
+                                if (res.errMsg) {
+                                    _this.$toast(res.errMsg)
+                                }
+                            }
+                        }
+                    })
+                },
+                confirmed: function (area) {
+                    this.setAreaSelected(area)
+                    if (this.moreThanSubCount) {
+                        this.popupTip = true
+                    } else {
+                        this.userUpdate(area)
+                    }
+                },
+                hideTips: function () {
+                    this.popupTip = false
+                },
+                toPay: function () {
+                    this.popupTip = false
+                    var area = this.selectedArea
+                    var urlBase = '/jyapp/areaPack/page/buy'
+                    var areaJSON = encodeURIComponent(JSON.stringify(area))
+                    this.savePageState()
+                    if (this.userType) {
+                        location.href = urlBase + '?type=upgrade&area=' +  areaJSON
+                    } else {
+                        location.href = urlBase +  '?type=buy&area=' +  areaJSON
+                    }
+                },
+                restoreState: function () {
+                    var $data = sessionStorage.getItem(this.sessKey)
+                    if ($data) {
+                        $data = JSON.parse($data)
+
+                        this.selectedArea = $data.selectedArea
+                        Object.assign(this.userSubInfo, $data.userSubInfo)
+
+                        sessionStorage.removeItem(this.sessKey)
+                    }
+                    return !!$data
+                },
+                savePageState: function () {
+                    var data = {
+                        selectedArea: this.selectedArea,
+                        userSubInfo: this.userSubInfo
+                    }
+                    sessionStorage.setItem(this.sessKey, JSON.stringify(data))
+                },
+            }
+        })
+
         function onReset (initData) {
-            $('.selectChange').text('')
-            $('#thisSelect').text(`${thisSelectNum}个省`)
-            $('.moreTips').hide()
+            vm.setAreaSelected(initData)
         }
         // 被选中的数据
         function onConfirm (selectedData) {
-            var selectDataList = []
-            for (const key in selectedData) {
-                selectDataList.push(key)
-            }
-            if (selectDataList.length > maxSelect && maxSelect !== -1 && vSwitch === 'f') {
-                vm.popupType = true
-                if (!userType) {
-                    $('#tips-text').text('您当前仅可订阅1个省,如需增加请购买【省份订阅包】')
-                    $('#btn-text').text('去购买')
-                } else {
-                    $('#tips-text').text('已超出您可订阅的省份数量,是否升级【省份订阅包】')
-                    $('#btn-text').text('去升级')
-                }
-            } else {
-                var areaData = {}
-                selectDataList.forEach(function (item, index) {
-                    areaData[item] = []
-                })
-                areaData = JSON.stringify(areaData)
-                userUpdate(areaData)
-            }
+            vm.confirmed(selectedData)
         }
-        var thisData = []
         // 页面选中状态改变时触发
         function onChange (selectedData) {
-            thisData = selectedData
-            var selectDataList = []
-            for (const key in selectedData) {
-                selectDataList.push(key)
-            }
-            var arr = selectDataList.join('、')
-            $('.selectChange').text(`${arr}`)
-            thisSelectNum = selectDataList.length
-            $('#thisSelect').text(`${selectDataList.length}个省`)
-            if (thisSelectNum > maxSelect) {
-                $('.moreTips').show()
-            } else {
-                $('.moreTips').hide()
-            }
+            vm.setAreaSelected(selectedData)
+            $('#set-area .j-button-confirm').prop('disabled', false)
         }
     </script>
 </body>

+ 4 - 0
src/web/templates/weixin/commonPay/areaPack/orderDetail.html

@@ -92,6 +92,10 @@
                         class="j-button-confirm buy-again"
                         v-if="orderStateMap[orderInfo.state].bottomButtonShow.buyAgain"
                         @click="buyAgain">再次购买</button>
+                    <button
+                            class="j-button-confirm renew"
+                            v-if="orderStateMap[orderInfo.state].bottomButtonShow.renew"
+                            @click="renew">续费</button>
                 </div>
             </div>
         </div>