Pārlūkot izejas kodu

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

wangshan 3 gadi atpakaļ
vecāks
revīzija
b1a8ea696e

+ 30 - 2
src/jfw/modules/app/src/web/staticres/jyapp/vipsubscribe/js/change_industry.js

@@ -360,6 +360,9 @@ $(function () {
         } else {
           areaParams = data.data.industry.join(',')
         }
+        if (vSwitch === 'm') {
+          data.data.area = bigmemberArea
+        }
         var params = {
           area: JSON.stringify(data.data.area),
           industry: areaParams
@@ -413,8 +416,33 @@ $(function () {
           history.back()
         }
     })
-
-
+    var vSwitch = ''
+    var bigmemberArea = {}
+    function getBigmemberMsg() {
+      $.ajax({
+          type: 'POST',
+          url: '/bigmember/use/info?t=' + new Date().getTime(),
+          data: {
+          },
+          success: function(res) {
+            bigmemberArea = res.data.member_jy.o_area
+          }
+      })
+    }
+    getBigmemberMsg()
+    function switehAjax(data) {
+      $.ajax({
+          type: 'POST',
+          url: '/publicapply/subscribe/vipSwitch',
+          data: {
+              vt:data || ''
+          },
+          success: function(res) {
+            vSwitch = res.data.vt || 'f'
+          }
+      })
+    }
+    switehAjax()
     function getDataWitXHR() {
         $DoPost('/subscribepay/vipsubscribe/getSubBuyMsg', {}, function (res) {
             if (!res.success) return;

+ 29 - 11
src/jfw/modules/app/src/web/staticres/jyapp/vipsubscribe/js/vip_index_new.js

@@ -22,7 +22,8 @@ var subNode = new Vue({
             userAreaNum: 1, // 用户修改地区剩余次数
             userType: false, // 用户是否为付费用户
             userAreaAllNum: 1, // 用户可修改地区总次数
-            subscribeTime: '' // 用户订阅的时间
+            subscribeTime: '', // 用户订阅的时间
+            vSwitch: 'f' // 用户权限
         }
     },
     created () {
@@ -39,6 +40,15 @@ var subNode = new Vue({
         // this.userAreaAllNum = 1
     },
     methods: {
+        // 省份订阅包续费 
+        renewBtn: function () {
+            location.href = '/jyapp/areaPack/page/buy?type=renew'
+        },
+        // 省份订阅包升级 
+        updateBtn: function () {
+            location.href = '/jyapp/areaPack/page/buy?type=upgrade'
+        },
+        // 得到用户是否购买省份包
         getUserSubscribe: function () {
             let _this = this
             $.ajax({
@@ -63,17 +73,18 @@ var subNode = new Vue({
                     if(num && num > 0) {
                         $('.update_renew').hide()
                         if(num == 1) {
-                            // $('.custom-header-title').html('<span class="title-text"><em class="title_icon icon_zj"></em>订阅管理-免费订阅</span>')
-                            $('.custom-header-title').html('<span class="title-text"></em>订阅管理-免费订阅</span>')
+                            $('.custom-header-title').html('<span class="title-text"><em class="title_icon icon_zj"></em>订阅管理-大会员</span>')
+ 
                         } else if(num == 2) {
-                            // $('.custom-header-title').html('<span class="title-text"><em class="title_icon icon_zh"></em>订阅管理-免费订阅</span>')
-                            $('.custom-header-title').html('<span class="title-text"></em>订阅管理-免费订阅</span>')
+                            $('.custom-header-title').html('<span class="title-text"><em class="title_icon icon_zh"></em>订阅管理-大会员</span>')
+
                         } else if(num == 3) {
-                            // $('.custom-header-title').html('<span class="title-text"><em class="title_icon icon_sj"></em>订阅管理-免费订阅</span>')
+                            $('.custom-header-title').html('<span class="title-text"><em class="title_icon icon_sj"></em>订阅管理-大会员</span>')
+
+                        } else if(num <= 0) {
                             $('.custom-header-title').html('<span class="title-text"></em>订阅管理-免费订阅</span>')
                         } else {
-                            // $('.custom-header-title').html('<span class="title-text"><em class="title_icon icon_zj"></em>订阅管理-免费订阅</span>')
-                            $('.custom-header-title').html('<span class="title-text"></em>订阅管理-免费订阅</span>')
+                            $('.custom-header-title').html('<span class="title-text"><em class="title_icon icon_zj"></em>订阅管理-大会员</span>')
                         }
                         this.linkObj = {
                             area: '/jyapp/big/page/set_area?callback=setting_save',
@@ -127,16 +138,21 @@ var subNode = new Vue({
                 success: function(res) {
                     console.log(res)
                     if(res.data) {
+                        _this.vSwitch = res.data.vt || 'f'
                         if(res.data.vt == 'm') {
                             _this.vipLink = 'javascript:;'
                             _this.arrowShow = false
                             sessionStorage.setItem('switch-product','bigmember')
                             _this.subInfoAjax = '/bigmember/use/info?t=' + new Date().getTime()
-                        } else {
+                        } else if (res.data.vt == 'v') {
                             _this.vipLink = '/jyapp/vipsubscribe/vipsubscribe_renew'
                             _this.arrowShow = true
                             sessionStorage.setItem('switch-product','supervip')
                             _this.subInfoAjax = '/subscribepay/vipsubscribe/getSubBuyMsg?t=' + new Date().getTime()
+                        } else {
+                            _this.vipLink = 'javascript:;'
+                            _this.arrowShow = false
+                            _this.subInfoAjax = '/publicapply/free/subscribe'
                         }
                         let bms = sessionStorage.getItem('big_member_status')
                         _this.initPage(bms)
@@ -149,8 +165,10 @@ var subNode = new Vue({
         },
         // 点击广告跳转超级订阅落地页
         toPaySupSub: function() {
-            var href = '/jyapp/vipsubscribe/introducePage'
-            location.href = href
+            if (this.vSwitch === 'f') {
+                var href = '/jyapp/vipsubscribe/introducePage'
+                location.href = href
+            }
         }
     }
 })

+ 17 - 8
src/jfw/modules/app/src/web/templates/areaPack/page_set_area.html

@@ -117,7 +117,7 @@
     {{include "/big-member/component_set_area.html"}}
     <!-- 自定义set-header内容 -->
     <div id="set-header-template" v-cloak>
-        <div class="wrapper-header">
+        <div class="wrapper-header" id="thisAreaTips">
             <div class="content">
                 <div class="selectNumMax">可选择<span class="numColor" id="canSelect">1个省</span></div>
                 <div class="string"></div>
@@ -156,6 +156,11 @@
                 },
                 toPay: function () {
                     this.popupType = false
+                    if (userType) {
+                        location.href = '/jyapp/areaPack/page/buy?type=renew'
+                    } else {
+                        location.href = '/jyapp/areaPack/page/buy?type=buy'
+                    }
                 },
                 
             }
@@ -163,19 +168,22 @@
         var maxSelect = 1
         var thisSelectNum = 0
         var userType = true // 用户是否购买过省份包
-        var vSwitch = 'f' // 用户版本,f免费版,m大会员,v超级订阅
+        var vSwitch = 'f' // 用户版本,''免费版,m大会员,v超级订阅
         // 获取用户权限
         function getUserMsg() {
             $.ajax({
                 url: '/bigmember/use/isAdd',
                 type: 'POST',
                 success: function (res) {
-                    if (res.memberStatus > 0 && res.vipStatus < 0) {
+                    if (res.data.memberStatus > 0 && res.data.vipStatus <= 0) {
                         vSwitch = 'm'
-                    } else if (res.memberStatus < 0 && res.vipStatus > 0) {
+                        $('#thisAreaTips').hide()
+                    } else if (res.data.memberStatus <= 0 && res.data.vipStatus > 0) {
                         vSwitch = 'v'
-                    } else if (res.memberStatus < 0 && res.vipStatus < 0) {
+                        $('#thisAreaTips').hide()
+                    } else if (res.data.memberStatus <= 0 && res.data.vipStatus <= 0) {
                         vSwitch = 'f'
+                        $('#thisAreaTips').show()
                     }
                 }
             })
@@ -191,7 +199,7 @@
                     maxSelect = res.data.areanum !== -1 ? res.data.areanum + res.data.provincenum : res.data.areanum
                     // _this.$emit('UserSubscribe',res)
                     if (maxSelect === -1) {
-                        $('#canSelect').text(`无限制`)
+                        $('#canSelect').text(`全国`)
                     } else {
                         $('#canSelect').text(`${maxSelect}个省`)
                     }
@@ -202,7 +210,6 @@
         getUserSubscribe()
         function userUpdate(obj) {
             let _this = this
-            console.info(obj)
             $.ajax({
                 url: '/publicapply/subscribe/update',
                 type: 'POST',
@@ -231,7 +238,7 @@
             for (const key in selectedData) {
                 selectDataList.push(key)
             }
-            if (selectDataList.length > maxSelect && maxSelect !== -1) {
+            if (selectDataList.length > maxSelect && maxSelect !== -1 && vSwitch === 'f') {
                 vm.popupType = true
                 if (!userType) {
                     $('#tips-text').text('您当前仅可订阅1个省,如需增加请购买【省份订阅包】')
@@ -248,7 +255,9 @@
                 })
                 areaData = JSON.stringify(areaData)
                 userUpdate(areaData)
+                sessionStorage.setItem('sub_vip_state', areaData)
             }
+            window.history.back()
         }
         // 页面选中状态改变时触发
         function onChange (selectedData) {

+ 6 - 6
src/jfw/modules/app/src/web/templates/vipsubscribe/vip_index_new.html

@@ -266,8 +266,8 @@
                 <i class="iconfont icon-arrow"></i>
               </div>
             </a>
-            <ul class="sub-info go_to_levelup" @click="toPaySupSub">
-              <!-- <li class="cycle">
+            <ul class="sub-info" :class="vSwitch !== 'm' && vSwitch !== 'v' ? 'go_to_levelup' : ''" @click="toPaySupSub">
+              <li class="cycle">
                 <a class="item-container" :href="vipLink">
                   <div class="item">
                     <span class="item-l">
@@ -288,10 +288,10 @@
                     </span>
                   </div>
                 </a>
-              </li> -->
+              </li>
             </ul>
           </li>
-          <sub-component :linkobj="linkObj" :initdata="initData"></sub-component>
+          <sub-component :linkobj="linkObj" :initdata="initData" :v-switch="vSwitch"></sub-component>
           <div class="provincePayWarp" v-show="userType">
             <span class="provincePayTips">省份订阅包</span>
             <div class="provincePay">
@@ -300,8 +300,8 @@
                 省份数量:<span class="provincePay-num">&nbsp;<span v-html="userAreaAllNum"></span>&nbsp;</span>个
               </div>
               <div class="provincePay-btnWrap">
-                <div class="privincePay-btn">续费</div>
-                <div class="privincePay-btn updateColor">升级</div>
+                <div class="privincePay-btn"  @click="renewBtn">续费</div>
+                <div class="privincePay-btn updateColor" @click="updateBtn">升级</div>
               </div>
             </div>
           </div>

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

@@ -723,7 +723,7 @@
         $("#sub_manager").click(function() {
             sessionStorage.setItem(vm.sessStorageKey, JSON.stringify(vm.$data))
             if(vm.rootInfo.memberStatus > 0) {
-                location.href = '/jyapp/vipsubscribe/toSubVipSetPage?vSwitch=m'
+                location.href = '/jyapp/vipsubscribe/toSubVipSetPage'
             } else {
                 tokeyset()
             }
@@ -748,7 +748,7 @@
             console.log(vm.rootInfo, 'vmrootInfo')
             sessionStorage.setItem(vm.sessStorageKey, JSON.stringify(vm.$data))
             if(vm.selectPro) {
-                location.href = '/jyapp/vipsubscribe/toSubVipSetPage?vSwitch=m'
+                location.href = '/jyapp/vipsubscribe/toSubVipSetPage'
             } else {
                 tosetpage()
             }

+ 7 - 4
src/jfw/modules/bigmember/src/entity/portraitBuyerSearch.go

@@ -84,12 +84,13 @@ func BuyerPortraitSearch(screen *PortraitScreen) (map[string]interface{}, error)
 		},
 	}
 	var wg sync.WaitGroup
+	baseMsg := map[string]interface{}{}
 	go func() {
 		wg.Add(1)
 		city, province, buyerclass := GetBuyerMsg(screen.Ent) //获取采购单位地区行业信息
-		returnData["city"] = city
-		returnData["province"] = province
-		returnData["buyerclass"] = buyerclass
+		baseMsg["city"] = city
+		baseMsg["province"] = province
+		baseMsg["buyerclass"] = buyerclass
 		wg.Done()
 	}()
 
@@ -423,7 +424,9 @@ func BuyerPortraitSearch(screen *PortraitScreen) (map[string]interface{}, error)
 		}
 		returnData["rate"] = rataMap
 	}
-
+	for k, v := range baseMsg {
+		returnData[k] = v
+	}
 	go func() {
 		fmt.Printf("BuyerPortraitSearch: %s spend time %fs\n	doSearchSql: %s\n", screen.Ent, time.Since(tBegin).Seconds(), doSearchSql)
 	}()

+ 1 - 1
src/jfw/modules/bigmember/src/service/portrait/subvipPortraitAction.go

@@ -137,7 +137,7 @@ func (this *SubVipPortrait) SubVipPortrait() {
 			return nil, err
 		}
 		rData, err := cepm.WinnerPortraitData(&entity.PortraitScreen{
-			Ent:        util.DecodeId(entId),
+			Ent:        entId,
 			Match:      this.GetString("match"),
 			ExactMatch: this.GetString("exactMatch") == "1",
 			MatchRange: this.GetString("matchRange"),

+ 72 - 36
src/web/staticres/common-module/vipsubscribe/js/vip-subscribe-set-template.js

@@ -14,7 +14,7 @@ var subScribeTemplate = `
         </span>
       </div>
     </a>
-    <div class="amendmentNum">
+    <div class="amendmentNum" v-show="vSwitch === 'f'">
       当年剩余可修改次数:<span class="numColor" v-show="userAreaNum != -1">{{userAreaNum}}&nbsp;</span><span v-show="userAreaNum != -1">次</span><span v-show="userAreaNum === -1">无限制</span>
       <i class="iconfont icon-bangzhu" @click="amendmentNumNotice"></i>
     </div>
@@ -25,7 +25,7 @@ var subScribeTemplate = `
         <span class="item-l">
           <span class="leading jy-icon-industry"></span>
           <span class="item-label">采购单位类型</span>
-          <span class="openVip">开通</span>
+          <span class="openVip" v-show="vSwitch === 'f'">开通</span>
         </span>
         <span class="item-r">
           <span class="keywords-text ellipsis">{{info.industry}}</span>
@@ -84,7 +84,7 @@ var subScribeTemplate = `
           <span class="item-label matching">
             <span class="label-text">项目匹配</span>
             <i class="iconfont icon-bangzhu" @click="projectNotice"></i>
-            <span class="openVip">开通</span>
+            <span class="openVip" v-show="vSwitch === 'f'">开通</span>
           </span>
         </span>
         <span class="item-r media_switch">
@@ -142,7 +142,7 @@ var subScribeTemplate = `
           <p class="cell_title">按标题匹配</p>
         </div>
         <div class="weui-actionsheet__cell allMacth" :class="{active:active==2}" @click="actionSheet('按全文匹配', 2)">
-          <p class="cell_title">按全文匹配<span class="openVip-keywords">开通</span></p>
+          <p class="cell_title">按全文匹配<span class="openVip-keywords" v-show="vSwitch === 'f'">开通</span></p>
           <p class="small-title">会产生无效信息,请根据需要选择</p>
         </div>
       </div>
@@ -192,9 +192,11 @@ var subComponent = {
     },
     "type": {
       type: String,
-      default: function() {
-        return ''
-      }
+      default: ''
+    },
+    vSwitch: {
+      type: String,
+      default: 'f'
     }
   },
   data: function() {
@@ -245,7 +247,7 @@ var subComponent = {
       infoTypeMenu: false, // 信息类型弹窗状态
       infoTypeData: ['全部'], // 信息类型选择列表
       isChange: false, // 信息类型是否做过更改
-      conf: {} // 信息类型数据
+      conf: {}, // 信息类型数据
     }
   },
   mounted () {
@@ -259,7 +261,6 @@ var subComponent = {
     }
     this.getData()
     this.$emit('mounted')
-    this.getUserSubscribe()
   },
   watch: {
     initdata: function(newVal, oldVal) {
@@ -268,6 +269,11 @@ var subComponent = {
         this.getData()
         this.setIosData()
       }
+    },
+    vSwitch: function (val) {
+      if (val === 'f') {
+        this.getUserSubscribe()
+      }
     }
   },
   methods: {
@@ -280,10 +286,11 @@ var subComponent = {
       this.getProjectMatch()
       this.iosBackRefresh()
     },
+    // 判断用户权限
+    
     // 设置区域
     setArea: function() {
       let _this = this
-      console.info(this.initdata)
       if(this.initdata.area) {
         if(_this.accStatus == 2) {
           sessionStorage.setItem('big-setArea', JSON.stringify(this.initdata.area))
@@ -417,10 +424,14 @@ var subComponent = {
     },
     switchs: function() {
       // 用户未购买项目匹配功能
-      if (!this.userType) {
+      if (this.vSwitch === 'f') {
         $('.switch').removeClass('checked')
         this.checkedflag = false
-        var href = '/jyapp/vipsubscribe/introducePage'
+        if (location.href.indexOf('front') !== -1) {
+          var href = '/front/vipsubscribe/introducePage'
+        } else {
+          var href = '/jyapp/vipsubscribe/introducePage'
+        }
         location.href = href
       } else {
         // switch点击切换
@@ -514,8 +525,14 @@ var subComponent = {
     actionSheet: function(title, index) {
       let _this = this
       let vswitch = 'v'
-      if (index === 2) {
-        location.href = '/jyapp/vipsubscribe/introducePage'
+      var href = ''
+      if (index === 2 && this.vSwitch === 'f') {
+        if (location.href.indexOf('front') !== -1) {
+          href = '/front/vipsubscribe/introducePage'
+        } else {
+          href = '/jyapp/vipsubscribe/introducePage'
+        }
+        location.href = href
       } else {
         if(_this.accStatus == 2) {
           vswitch = 'm'
@@ -593,19 +610,23 @@ var subComponent = {
     },
     // 用户未购买修改采购单位类型功能
     userNoIndustry: function () {
-      if (this.userType) {
+      if (this.vSwitch !== 'f') {
         var href = '/jyapp/vipsubscribe/toChangeIndustry?header=save'
       } else {
-        var href = '/jyapp/vipsubscribe/introducePage'
+        if (location.href.indexOf('front') !== -1) {
+          var href = '/front/vipsubscribe/introducePage'
+        } else {
+          var href = '/jyapp/vipsubscribe/introducePage'
+        }
       }
       this.linkobj.industry = href
     },
     // 修改地区无次数点击事件
     userNumOver: function () {
-      if (this.userAreaNum === 0) {
+      if (this.vSwitch === 'f' && this.userAreaNum === 0) {
         this.linkobj.area = 'javascript:;'
-        if (this.userType) {
-          var str = `对不起,您当月修改区域的机会(${this.userAreaAllNum}次)已消耗完毕,无法再次修改~可前往升级省份订阅包增加订阅省份和修改次数`
+        if (this.userAreaAllNum > 0) {
+          var str = `对不起,您当月修改区域的机会(${this.userAreaAllNum + this.userAreaNum}次)已消耗完毕,无法再次修改~可前往升级省份订阅包增加订阅省份和修改次数`
         } else {
           var str = `对不起,您今年修改免费订阅区域的机会(1次)已消耗完毕,无法再次修改~可前往购买省份订阅包增加订阅省份`
         }
@@ -616,9 +637,23 @@ var subComponent = {
                 label: '取消',
                 type: 'default'
             },{
-              label:'去购买',
+              label: this.userType ? '去升级' : '去购买',
               onClick: function(){
+                if (this.userType) {
+                  if (location.href.indexOf('front') !== -1) {
+                    var href = '/areaPack/wx/page/buy?type=upgrade'
+                  } else {
+                    var href = '/jyapp/areaPack/page/buy?type=upgrade'
+                  }
+                } else {
+                  if (location.href.indexOf('front') !== -1) {
+                    var href = '/areaPack/wx/page/buy?type=buy'
+                  } else {
+                    var href = '/jyapp/areaPack/page/buy?type=buy'
+                  }
+                }
                 
+                location.href = href
               }
             }]
         });
@@ -626,15 +661,15 @@ var subComponent = {
       else {
         // this.linkobj.area = '/jyapp/big/page/set_area?callback=setting_save'
         if (location.href.indexOf('front') !== -1) {
-          
+          this.linkobj.area = '/areaPack/wx/page/set_area'
         } else {
-          this.linkobj.area = '/jyapp/areaPack/set_area'
+          this.linkobj.area = '/jyapp/areaPack/page/set_area'
         }
       }
     },
     // 修改地区剩余次数问号点击事件
     amendmentNumNotice: function () {
-      if (this.userType) {
+      if (this.userAreaAllNum > 0) {
         var str = '每月可修改次数=可订阅省份数量,即每增加购买1个省份,可增加1次修改机会,次月清零重新计算,购买全国不限制每月修改次数。'
       } else {
         var str = '免费用户每年享有 1 次修改区域的机会'
@@ -707,10 +742,9 @@ var subComponent = {
           url: '/publicapply/free/subscribe',
           type: 'POST',
           success: function (res) {
-              console.info(res)             
               _this.userAreaNum = res.data.areanum
               _this.userType = res.data.provincenum === 0 ? false : true
-              _this.userAreaAllNum = res.data.areanum + res.data.provincenum
+              _this.userAreaAllNum = res.data.provincenum
               // _this.$emit('UserSubscribe',res)
               let areaArr = []
               for (const key in res.data.area) {
@@ -735,16 +769,18 @@ var subComponent = {
           vt = 'v'
         }
       }
-      this.initdata.items.forEach(function(item) {
-        item.a_key.forEach(function(r) {
-          keyArr.push(r.key[0])
-          if(r.notkey) {
-            r.notkey.forEach(function(nok) {
-              notKeyArr.push(nok)
-            })
-          }
+      if (this.initdata.items) {
+        this.initdata.items.forEach(function(item) {
+          item.a_key.forEach(function(r) {
+            keyArr.push(r.key[0])
+            if(r.notkey) {
+              r.notkey.forEach(function(nok) {
+                notKeyArr.push(nok)
+              })
+            }
+          })
         })
-      })
+      }
       let _this = this
       $.ajax({
         type: 'POST',
@@ -800,8 +836,8 @@ var setInfoTypeFn = {
       if (initData) {
           initData = JSON.parse(initData)
           console.log(initData)
-          vNode.data.initInfoType = initData
-          vueComponent.setInfoTypeState(vNode.data.initInfoType)
+          // vNode.data.initInfoType = initData
+          // vueComponent.setInfoTypeState(vNode.data.initInfoType)
       }
   },
   saveToSessionStorage: function (data) {

+ 117 - 0
src/web/staticres/vipsubscribe/css/vip_index_new.css

@@ -113,6 +113,7 @@
 }
 
 .sub-info{
+  min-height: 1.48rem;
   border-radius: 8px;
   background: linear-gradient(270deg, #F1D090 0%, #FAE7CA 100%);
   box-shadow: 0px 12px 16px rgba(250, 231, 202, 0.32);
@@ -1256,3 +1257,119 @@
   left: .32rem;
   right: -16px;
 }
+
+.switchicon {
+  display: flex;
+  width: .48rem;
+  height: .48rem;
+  background: url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAADAAAAAwCAYAAABXAvmHAAAACXBIWXMAABYlAAAWJQFJUiTwAAAAAXNSR0IArs4c6QAAAARnQU1BAACxjwv8YQUAAACrSURBVHgB7dfRCcIwEIDhixPoBm5mV3AEJz03aDc4rxjQhzRgEXtn/w9CC6GQvy+9igDArpjZxdfoS+d7yaYe/F2uiPr2LW2EH3awNiJ+iogoiIji6xH2+mJGsBhROgHql7PEMJVSTq2NQ+eho8QxLW30Aq6+7rK9+fA3AQDgExZnFlJjFtre6lkogvWzkPGnFAQRURARxT9HjJJJI0Ilmxqh9hz8BgGAXXkA6eITzq1YSq8AAAAASUVORK5CYII=) no-repeat;
+  background-size: contain;
+}
+.go_to_levelup {
+  background: url('../image/gotolevelup.png') no-repeat;
+  background-size: cover;
+  border: 0;
+}
+.amendmentNum {
+  font-size: 0.2rem;
+  font-weight: 500;
+  color: #9B9BA3;
+  margin-left: 0.75rem;
+  display: flex;
+  justify-content: flex-start;
+  align-items: center;
+}
+.numColor {
+  color: #2ABDD1;
+}
+.amendmentNum .icon-bangzhu {
+  margin-left: 0.18rem;
+  color: #2cb7ca;
+  font-size: 0.36rem;
+}
+.area-alert .weui-dialog__bd {
+  font-size: 0.29rem;
+  line-height: 0.43rem;
+  font-weight: 500;
+  color: #161826;
+  text-align: left;
+  margin: 0.43rem 0.54rem 0.39rem;
+}
+.openVip {
+  border-radius: 0.14rem 0.14rem 0.14rem 0.14rem;
+  border: 0.02rem solid #FA483C;
+  font-size: 0.18rem;
+  font-weight: 500;
+  color: #FA483C;
+  width: 0.57rem;
+  text-align: center;
+  height: 0.29rem;
+  line-height: 0.29rem;
+  margin-left: 0.29rem;
+}
+.matching {
+  display: flex;
+  align-items: center;
+}
+.area-noNum .weui-dialog__bd {
+  text-align: left;
+  font-size: 0.29rem;
+  font-weight: 500;
+  color: #161826;
+  line-height: 0.43rem;
+  margin: 0.43rem 0.54rem 0.39rem;
+}
+.provincePayWarp {
+  padding: 0 0.21rem;
+  margin-top: 0.11rem;
+}
+.provincePayTips {
+  font-size: 0.21rem;
+  font-weight: 500;
+  color: #9B9BA3;
+}
+.provincePay {
+  margin-top: 0.14rem;
+  width: 100%;
+  height: 2.5rem;
+  background: #FFFFFF;
+  box-shadow: 0rem 0.04rem 0.14rem 0.02rem rgba(54, 147, 179, 0.050999999046325684);
+  border-radius: 0.14rem 0.14rem 0.14rem 0.14rem;
+  padding: 0.28rem 0;
+}
+.provincePay-text {
+  font-size: 0.2rem;
+  font-weight: 500;
+  color: #9B9BA3;
+  text-align: center;
+}
+.provincePay-num {
+  font-size: 0.32rem;
+  font-weight: bold;
+  color: #2ABDD1;
+}
+.provincePay-numText {
+  padding-top: 0.14rem;
+  padding-bottom: 0.2rem;
+}
+.provincePay-btnWrap {
+  display: flex;
+  justify-content: center;
+  align-items: center;
+}
+.privincePay-btn {
+  width: 2.14rem;
+  height: 0.71rem;
+  background: #EDEEF2;
+  border-radius: 0.07rem 0.07rem 0.07rem 0.07rem;
+  font-size: 0.29rem;
+  font-weight: 500;
+  color: #161826;
+  text-align: center;
+  line-height: 0.71rem;
+}
+.updateColor {
+  background: #2ABDD1;
+  color: #fff;
+  margin-left: 0.36rem;
+}

BIN
src/web/staticres/vipsubscribe/image/gotolevelup.png


+ 5 - 1
src/web/staticres/vipsubscribe/js/common.js

@@ -83,7 +83,11 @@ function SortArr(arr) {
 //获取选择
 function getSelectBuyset(area, industry) {
     if (industry[0] === "全部行业") industry = [];
-    if (area["全国"]) area = {};
+    if (area) {
+        if (area["全国"]) area = {};
+    } else {
+        area = {}
+    }
     //计算地区数量
     var buyset = {
         "areacount": -1,  //省份数量

+ 60 - 1
src/web/staticres/vipsubscribe/js/vip_index_new.js

@@ -14,12 +14,71 @@ var subNode = new Vue({
                 resultview: '/front/vipsubscribe/toVIPViewPage',
                 pushsetting: '/front/setting/push_detail?header=超级订阅推送设置&type=super_subscribe'
             },
-            initData: {}
+            initData: {},
+            userAreaNum: 1, // 用户修改地区剩余次数
+            userType: false, // 用户是否为付费用户
+            userAreaAllNum: 1, // 用户可修改地区总次数
+            subscribeTime: '', // 用户订阅的时间
+            vSwitch:'', // 用户版本权限
         }
     },
+    created () {
+        this.getUserSubscribe()
+        this.getUserType()
+    },
     methods: {
         superOrderTemplateMounted () {
             $('#pushResultPreview').attr('data-cl-event', 'c_wx_preview_buttonclick')
+        },
+        // 点击广告跳转超级订阅落地页
+        toPaySupSub: function() {
+            if (this.vSwitch !== 'v') {
+                var href = '/front/vipsubscribe/introducePage'
+                location.href = href
+            }
+            
+        },
+        // 得到用户是否购买省份包
+        getUserSubscribe: function () {
+            let _this = this
+            $.ajax({
+                url: '/publicapply/free/subscribe',
+                type: 'POST',
+                success: function (res) {
+                    _this.userAreaNum = res.data.areanum
+                    _this.userType = res.data.provincenum === 0 ? false : true
+                    _this.userAreaAllNum = res.data.areanum + res.data.provincenum
+                    // _this.$emit('UserSubscribe',res)
+                    _this.subscribeTime = new Date(res.data.ppstart * 1000).pattern('yyyy年MM月dd日') + "-" + new Date(res.data.ppend * 1000).pattern('yyyy年MM月dd日')
+                    _this.initdata = res.data
+                }
+            })
+        },
+        // 省份订阅包续费 
+        renewBtn: function () {
+            location.href = '/areaPack/wx/page/buy?type=renew'
+        },
+        // 省份订阅包升级 
+        updateBtn: function () {
+            location.href = '/areaPack/wx/page/buy?type=upgrade'
+        },
+        // 判断用户权限版本
+        getUserType: function (data) {
+            let  _this = this
+            $.ajax({
+                type: 'POST',
+                url: '/publicapply/subscribe/vipSwitch',
+                data: {
+                    vt:data || ''
+                },
+                success: function(res) {
+                    if (res.data.vt !== 'v' ) {
+                        _this.vSwitch = 'f'
+                    } else {
+                        _this.vSwitch = 'v'
+                    }
+                }
+            })
         }
     }
 })

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

@@ -5,6 +5,107 @@
 
     <!--引入公共资源头部-->
     {{include "/big-member/wx/meta.html"}}
+    <style>
+        .wrapper-header > .content {
+            width: 100%;
+            height: 2.2rem;
+            padding: 0 0.32rem;
+            background: #FFFFFF;
+            box-shadow: 0rem 0.04rem 0.16rem 0.02rem rgba(54, 147, 179, 0.05);
+        }
+        .wrapper-header .selectNumMax {
+            height: 0.84rem;
+            line-height: 0.84rem;
+            font-size: 0.26rem;
+            font-weight: 500;
+            color: #161826;
+        }
+        .wrapper-header .selectNumList {
+            line-height: 0.84rem;
+            font-size: 0.26rem;
+            font-weight: 500;
+            color: #161826;
+        }
+        .moreTips {
+            width: 4.72rem;
+            height: 0.4rem;
+            background: rgba(250,72,60,0.1);
+            border-radius: 0.2rem 0.2rem 0.2rem 0.2rem;
+            padding: 0.02rem 0.16rem;
+            font-size: 0.22rem;
+            font-weight: 500;
+            color: #FA483C;
+            box-sizing: border-box;
+            display: none;
+        }
+        .selectChange {
+            font-size: 0.24rem;
+            font-weight: 500;
+            color: #2ABDD1;
+            margin-left: 1.02rem;
+        }
+        .numColor {
+            color: #5E5E64;
+            padding-left: 0.24rem;
+        }
+        .string {
+            width: 100%;
+            height: 0.01rem;
+            background: rgba(0, 0, 0, 0.05);
+        }
+        .popup-wrap {
+            position: fixed;
+            top: 0;
+            left: 0;
+            right: 0;
+            bottom: 0;
+            z-index: 99999;
+            background-color:rgba(0, 0, 0, 0.7);
+        }
+        .popup-content {
+            width: 6.06rem;
+            height: 2.8rem;
+            background: #FFFFFF;
+            border-radius: 0.16rem 0.16rem 0.16rem 0.16rem;
+            position: fixed;
+            top: 50%;
+            left: 50%;
+            transform: translateX(-50%) translateY(-50%);
+            z-index: 100;
+        }
+        .popup-text{
+            text-align: left;
+            padding: 0.48rem 0.6rem 0.42rem;
+            line-height: 0.48rem;
+            font-size: 0.32rem;
+            font-weight: 500;
+            color: #161826;
+        }
+        .popup-btnWrap{
+            display: flex;
+            justify-content: center;
+            align-items: center;
+            border-top:0.02rem solid rgba(0, 0, 0, 0.1) ;
+        }
+        .popup-btn{
+            font-size: 0.36rem;
+            font-weight: 500;
+            color: #161826;
+            width: 50%;
+            height: 0.92rem;
+            line-height: 0.92rem;
+            text-align: center;
+            cursor: pointer;
+        }
+        .popup-line{
+            height: 0.92rem;
+            width: 0.02rem;
+            background-color: rgba(0, 0, 0, 0.1);
+        }
+        .levelUp {
+            color: #2ABDD1;
+        }
+    </style>
 </head>
 <body>
     <script>
@@ -16,29 +117,160 @@
     {{include "/big-member/wx/component_set_area.html"}}
     <!-- 自定义set-header内容 -->
     <div id="set-header-template" v-cloak>
-        <div class="wrapper-header">
-            <div class="content">content</div>
+        <div class="wrapper-header" id="thisAreaTips">
+            <div class="content">
+                <div class="selectNumMax">可选择<span class="numColor" id="canSelect">1个省</span></div>
+                <div class="string"></div>
+                <div class="selectNumList">
+                    <span>已选择<span class="numColor" id="thisSelect">1个省</span></span>
+                    <span class="moreTips">超出可订阅省份数量,前往购买省份订阅包 ></span>
+                </div>
+                <div class="selectChange"></div>
+            </div>
+            <div class="popup-wrap" v-show="popupType">
+                <div class="popup-content">
+                    <div class="popup-text" id="tips-text">您当前仅可订阅1个省,如需增加请购买【省份订阅包】</div>
+                    <div class="popup-btnWrap">
+                        <div class="popup-btn" id="cancel" @click="hiddenTips">取消</div>
+                        <div class="popup-line"></div>
+                        <div class="popup-btn levelUp" id="btn-text" @click="toPay">去购买</div>
+                    </div>
+                </div>
+            </div>
         </div>
     </div>
     <script>
-        var vm = new Vue({
+       var vm = new Vue({
             delimiters: ['${', '}'],
             el: '#set-header',
             template: '#set-header-template',
-            data: {},
+            data: {
+                popupType: false,
+                popupText: '您当前仅可订阅1个省,如需增加请购买【省份订阅包】',
+                popupPayBtn: '去购买'
+            },
             created: function () {},
-            methods: function () {}
+            methods: {
+                hiddenTips: function () {
+                    this.popupType = false
+                },
+                toPay: function () {
+                    this.popupType = false
+                    if (userType) {
+                        location.href = '/jyapp/areaPack/page/buy?type=renew'
+                    } else {
+                        location.href = '/jyapp/areaPack/page/buy?type=buy'
+                    }
+                },
+                
+            }
         })
-
+        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()
+                    } else {
+                        vSwitch = 'v'
+                        $('#thisAreaTips').hide()
+                    }
+                }
+            })
+        }
+        getUserMsg()
+        // 获取用户购买省份包信息
+        function getUserSubscribe() {
+            $.ajax({
+                url: '/publicapply/free/subscribe',
+                type: 'POST',
+                success: function (res) {
+                    userType = res.data.provincenum === 0 ? false : true
+                    maxSelect = res.data.areanum !== -1 ? res.data.areanum + res.data.provincenum : res.data.areanum
+                    // _this.$emit('UserSubscribe',res)
+                    if (maxSelect === -1) {
+                        $('#canSelect').text(`全国`)
+                    } else {
+                        $('#canSelect').text(`${maxSelect}个省`)
+                    }
+                    
+                }
+            })
+        }
+        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)             
+                }
+            })
+        }
+        $('#thisSelect').text(`${thisSelectNum}个省`)
+        $('#canSelect').text(`${maxSelect}个省`)
         // 以下均为示例:具体使用时候请删除
         // 定义重置方法:方法名必须为onReset/onConfirm
         // 参数,是被初始化的数据
-        function onReset (initData) {}
+        function onReset (initData) {
+            $('.selectChange').text('')
+            $('#thisSelect').text(`0个省`)
+            $('.moreTips').hide()
+        }
         // 被选中的数据
-        function onConfirm (selectedData) {}
+        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) {
+                    console.info(index, item)
+                    areaData[item] = []
+                })
+                areaData = JSON.stringify(areaData)
+                userUpdate(areaData)
+            }
+            window.history.back()
+        }
         // 页面选中状态改变时触发
         function onChange (selectedData) {
-            console.log(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()
+            }
         }
     </script>
 </body>

+ 20 - 6
src/web/templates/weixin/vipsubscribe/vip_index_new.html

@@ -80,6 +80,7 @@
     .j-button-confirm:nth-child(1){
       margin-right: .16rem;
     }
+    
     </style>
 </head>
 
@@ -116,7 +117,8 @@
                 <i class="iconfont icon-arrow"></i>
             </div>
           </a>
-          <ul class="sub-info">
+          <ul class="sub-info"  @click="toPaySupSub"
+          :class="vSwitch !== 'v' ? 'go_to_levelup' : ''">
             <!-- <li class="area">
               <a class="item-container" href="/front/vipsubscribe/toChangeArea?header=save">
                   <div class="item">
@@ -161,7 +163,7 @@
                     </div>
                 </a>
             </li> -->
-            <li class="cycle" data-bind-renew data-cl-event="c_wx_buy_buttonclick">
+            <li class="cycle" data-bind-renew data-cl-event="c_wx_buy_buttonclick" v-show="vSwitch === 'v'">
                 <a class="item-container" href="/front/vipsubscribe/vipsubscribe_renew">
                     <div class="item">
                       <span class="item-l">
@@ -176,7 +178,6 @@
                       <span class="buy-cycle text ellipsis">0</span>
                     </div>
                     <div class="sub-item">
-                        <!-- 此处空span占位 -->
                         <span class="sub-l"></span>
                         <span class="sub-r">
                           <span class=""></span>
@@ -186,7 +187,20 @@
             </li>
           </ul>
         </li>
-        <sub-component :linkobj="linkObj" :initdata="initData" @mounted="superOrderTemplateMounted"></sub-component>
+        <sub-component :linkobj="linkObj" :initdata="initData" @mounted="superOrderTemplateMounted" :v-switch="vSwitch"></sub-component>
+        <div class="provincePayWarp" v-show="userType">
+            <span class="provincePayTips">省份订阅包</span>
+            <div class="provincePay">
+              <div class="provincePay-text">订阅周期:${subscribeTime}</div>
+              <div class="provincePay-text provincePay-numText">
+                省份数量:<span class="provincePay-num">&nbsp;<span v-html="userAreaAllNum"></span>&nbsp;</span>个
+              </div>
+              <div class="provincePay-btnWrap">
+                <div class="privincePay-btn" @click="renewBtn">续费</div>
+                <div class="privincePay-btn updateColor" @click="updateBtn">升级</div>
+              </div>
+            </div>
+        </div>
         <!-- <li class="body-item keywords">
             <a class="item-container" href="/front/vipsubscribe/toSetKeyWordPage">
                 <div class="item">
@@ -399,7 +413,7 @@
     </div> -->
 </div>
 <!-- 匹配方式 -->
-<div class="match-keywords-actionsheet">
+<!-- <div class="match-keywords-actionsheet">
   <div class="weui-mask" id="iosMask" style="opacity: 1;display: none;"></div>
   <div class="weui-actionsheet" id="iosActionsheet">
       <div class="weui-actionsheet__title">
@@ -416,7 +430,7 @@
           </div>
       </div>
   </div>
-</div>
+</div> -->
         <!-- 优惠明细 -->
         <div class="j-picker adaption discount-details" style="display:none;">
             <div class="weui-mask"></div>