ソースを参照

Merge branch 'dev2.8.5' of http://192.168.3.207:10080/qmx/jy into dev2.8.5

wangkaiyue 5 年 前
コミット
d3b64bd964
71 ファイル変更4073 行追加2374 行削除
  1. 3 2
      src/config.json
  2. 5 0
      src/jfw/front/laboratory.go
  3. 7 2
      src/jfw/front/wxMyOrder.go
  4. 59 24
      src/jfw/modules/app/src/web/staticres/jyapp/vipsubscribe/css/choose_area.css
  5. BIN
      src/jfw/modules/app/src/web/staticres/jyapp/vipsubscribe/image/banxuan_disabled.png
  6. 723 0
      src/jfw/modules/app/src/web/staticres/jyapp/vipsubscribe/js/updateArea.js
  7. 17 487
      src/jfw/modules/app/src/web/templates/vipsubscribe/choose_area_upgrade.html
  8. 39 23
      src/jfw/modules/app/src/web/templates/vipsubscribe/choose_industry_upgrade.html
  9. 18 4
      src/jfw/modules/app/src/web/templates/vipsubscribe/renew_notice.html
  10. 13 25
      src/jfw/modules/app/src/web/templates/vipsubscribe/renew_pay.html
  11. 166 366
      src/jfw/modules/app/src/web/templates/vipsubscribe/vip_upgrade.html
  12. 9 7
      src/jfw/modules/subscribepay/src/entity/dataExportSearch.go
  13. 19 41
      src/jfw/modules/subscribepay/src/entity/dataexport.go
  14. 9 7
      src/jfw/modules/subscribepay/src/entity/subscribeVip.go
  15. 3 0
      src/jfw/modules/subscribepay/src/service/orderListDetails.go
  16. 38 52
      src/jfw/modules/subscribepay/src/service/vipRenewUpgrade.go
  17. 2 0
      src/jfw/modules/subscribepay/src/service/vipSubscribePay.go
  18. 2 0
      src/jfw/modules/subscribepay/src/service/vipSubscribeTrial.go
  19. 6 3
      src/jfw/modules/subscribepay/src/util/msgremind.go
  20. 1 1
      src/jfw/modules/weixin/src/config.json
  21. 6 2
      src/jfw/modules/weixin/src/wx/wx.go
  22. 102 0
      src/web/staticres/css/wx/base.css
  23. 237 0
      src/web/staticres/css/wx/home.css
  24. 165 0
      src/web/staticres/css/wx/personal.css
  25. 112 0
      src/web/staticres/css/wx/treasure_box.css
  26. 3 3
      src/web/staticres/css/wxsearch.css
  27. BIN
      src/web/staticres/images/search/banner_1.png
  28. BIN
      src/web/staticres/images/search/banner_2.png
  29. BIN
      src/web/staticres/images/search/banner_3.png
  30. BIN
      src/web/staticres/images/search/home_question.png
  31. BIN
      src/web/staticres/images/search/home_search.png
  32. BIN
      src/web/staticres/images/search/home_tab_1.png
  33. BIN
      src/web/staticres/images/search/home_tab_2.png
  34. BIN
      src/web/staticres/images/search/home_tab_3.png
  35. BIN
      src/web/staticres/images/search/home_tab_4.png
  36. BIN
      src/web/staticres/images/search/nothing.png
  37. BIN
      src/web/staticres/images/syzindex/treasure_bg.png
  38. BIN
      src/web/staticres/images/syzindex/treasure_data.png
  39. BIN
      src/web/staticres/images/syzindex/treasure_vip.png
  40. BIN
      src/web/staticres/images/wx/persional/my_arrow_right.png
  41. BIN
      src/web/staticres/images/wx/persional/my_data_export.png
  42. BIN
      src/web/staticres/images/wx/persional/my_head.png
  43. BIN
      src/web/staticres/images/wx/persional/my_list_1.png
  44. BIN
      src/web/staticres/images/wx/persional/my_list_2.png
  45. BIN
      src/web/staticres/images/wx/persional/my_list_3.png
  46. BIN
      src/web/staticres/images/wx/persional/my_list_4.png
  47. BIN
      src/web/staticres/images/wx/persional/my_list_5.png
  48. BIN
      src/web/staticres/images/wx/persional/my_list_6.png
  49. BIN
      src/web/staticres/images/wx/persional/my_order_1.png
  50. BIN
      src/web/staticres/images/wx/persional/my_order_2.png
  51. BIN
      src/web/staticres/images/wx/persional/my_order_3.png
  52. BIN
      src/web/staticres/images/wx/persional/my_order_4.png
  53. BIN
      src/web/staticres/images/wx/persional/my_vip.png
  54. 3 0
      src/web/staticres/js/wxSupersearch.js
  55. 59 24
      src/web/staticres/vipsubscribe/css/choose_area.css
  56. 2 2
      src/web/staticres/vipsubscribe/css/keyWord.css
  57. BIN
      src/web/staticres/vipsubscribe/image/banxuan_disabled.png
  58. 723 0
      src/web/staticres/vipsubscribe/js/updateArea.js
  59. 18 1
      src/web/staticres/wxswordfish/share.js
  60. 26 37
      src/web/templates/weixin/dataExport/dataExport_toMyOrder.html
  61. 151 211
      src/web/templates/weixin/my.html
  62. 137 20
      src/web/templates/weixin/search/mainSearch.html
  63. 99 0
      src/web/templates/weixin/treasure_box.html
  64. 15 497
      src/web/templates/weixin/vipsubscribe/choose_area_upgrade.html
  65. 881 0
      src/web/templates/weixin/vipsubscribe/choose_area_upgrades.html
  66. 0 1
      src/web/templates/weixin/vipsubscribe/choose_industry_upgrade.html
  67. 2 2
      src/web/templates/weixin/vipsubscribe/keyWord.html
  68. 4 4
      src/web/templates/weixin/vipsubscribe/renew_notice.html
  69. 10 29
      src/web/templates/weixin/vipsubscribe/renew_pay.html
  70. 59 79
      src/web/templates/weixin/vipsubscribe/vip_order_detail.html
  71. 120 418
      src/web/templates/weixin/vipsubscribe/vip_upgrade.html

+ 3 - 2
src/config.json

@@ -32,7 +32,7 @@
         }
     },
     "agreement": "http",
-    "webdomain": "http://web-jydev-wcj.jianyu360.cn",
+    "webdomain": "http://web-jydev-zxl.jianyu360.cn",
     "redirect": {
         "searchinfo": "/jylab/mainSearch",
         "rssset": "/swordfish/historypush",
@@ -64,7 +64,8 @@
         "followEntDetail": "/jylab/followent/detail/%s",
         "mymenu": "/front/wxMyOrder/myMenu",
 		"historypush": "/swordfish/historypush?times=%s",
-		"expireTip": "/front/vipsubscribe/renewPage/%s?orderId=%s&startTime=%s&endTime=%s"
+		"msgremind": "/front/vipsubscribe/msgremind?%s",
+		"treasurebox":"/jyTreasureBox/treasureBox"
     },
     "jy_activeset": {
         "activitystartcode": "3201000000",

+ 5 - 0
src/jfw/front/laboratory.go

@@ -20,6 +20,8 @@ type Lab struct {
 	index          xweb.Mapper `xweb:"/jylab/index"`        //实验室首页
 	qrToLab        xweb.Mapper `xweb:"/jylab/qrToLab/(.*)"` //pc端扫码进入实验室首页
 	qrToLabSubpage xweb.Mapper `xweb:"/jylab/qr/(.*)"`      //pc端扫码进入实验室子页
+	/*******************剑鱼标讯百宝箱dev2.8.5*************************/
+	treasureBox xweb.Mapper `xweb:"/jyTreasureBox/treasureBox"` //剑鱼百宝箱
 }
 
 //
@@ -93,3 +95,6 @@ func (l *Lab) QrToLabSubpage(t string) error {
 		return l.Redirect("/jylab/index")
 	}
 }
+func (l *Lab) TreasureBox() error {
+	return l.Render("/weixin/treasure_box.html", &l.T)
+}

+ 7 - 2
src/jfw/front/wxMyOrder.go

@@ -177,14 +177,19 @@ func (w *WxMyOrder) MyMenu() error {
 			w.T["isVip"] = true
 		}
 	}
+	tmp, ok := mongodb.FindById("user", util.ObjToString(w.GetSession("userId")), `{"s_headimage":1,"s_nickname":1}`)
+	if !ok || tmp == nil || len(*tmp) == 0 {
+		return nil
+	}
 	//分享
 	w.T["signature"] = wx.SignJSSDK(w.Site() + w.Url())
 	myopenid, _ := w.Session().Get("s_m_openid").(string)
 	w.T["openid"] = se.EncodeString(myopenid)
 	mynickname, _ := w.Session().Get("s_nickname").(string)
-	myavatar, _ := w.Session().Get("s_avatar").(string)
+	//myavatar, _ := w.Session().Get("s_avatar").(string)
 	w.T["nickname"] = mynickname
-	w.T["avatar"] = myavatar
+	//w.T["avatar"] = myavatar
+	w.T["avatar"] = (*tmp)["s_headimage"]
 	w.T["userId"] = util.ObjToString(w.GetSession("userId"))
 	return w.Render("weixin/my.html", &w.T)
 }

+ 59 - 24
src/jfw/modules/app/src/web/staticres/jyapp/vipsubscribe/css/choose_area.css

@@ -63,13 +63,11 @@
 }
 
 .tips_btn {
-    display: flex;
-    flex-direction: column;
-    align-items: center;
-    justify-content: space-between;
-    position: fixed;
-    width: 100%;
-    bottom: 0;
+  display: flex;
+  position: relative;
+  flex-direction: column;
+  align-items: center;
+  justify-content: space-between;
 }
 
 .tips_btn .tips_discount {
@@ -111,7 +109,6 @@
   line-height: .94rem;
   color: #fff;
   font-size: .34rem;
-  background-color: #fff;
 }
 
 .tips_btn .btns .save-btn,
@@ -382,6 +379,38 @@
   margin: 0;
 }
 
+.jymobile-tab-triangle {
+  position: relative;
+}
+
+.jymobile-tab-triangle:after {
+  content: '';
+  position: absolute;
+  top: 50%;
+  right: 0;
+  width: 0;
+  height: 0;
+  font-size: 0;
+  line-height: 0;
+  border-style: solid;
+  border-width: .1rem;
+  border-color: #aaa transparent transparent transparent;
+  transform: translate(140%, -30%);
+}
+
+.jymobile-tab-triangle.active:after {
+  border-color: transparent transparent #2cb7ca transparent;
+  transform: translate(140%, -70%);
+}
+
+.jymobile-tab-triangle.current {
+  color: #2cb7ca;
+}
+
+.jymobile-tab-triangle.current:after {
+  border-color: #2cb7ca transparent transparent transparent;
+}
+
 #choose_area {
   display: flex;
   justify-content: space-between;
@@ -395,36 +424,29 @@
   overflow-y: scroll;
 }
 
-#choose_area .optional_count {
+#choose_area .optional_count, #choose_area .all_area {
   background: #fff;
   height: .88rem;
   line-height: .88rem;
   padding: 0 .3rem;
   font-size: .3rem;
   color: #1d1d1d;
-  position: fixed;
-  top: 0;
-  width: 100%;
-  z-index:999;
 }
 
-#choose_area .optional_count em {
+#choose_area .optional_count em, #choose_area .all_area em {
   color: #2cb7ca;
 }
 
 #choose_area .result {
-  position: fixed;
+  position: relative;
   padding: .2rem .3rem;
   font-size: .26rem;
   text-align: justify;
-  width:100%;
-  background:rgba(245,244,249,1);
-  z-index:999;
 }
 
 #choose_area .result .result_text {
   position: relative;
-  min-height: 0.38rem;
+  min-height: 19px;
 }
 
 #choose_area .result .line_two {
@@ -462,7 +484,7 @@
 }
 
 #choose_area .select-area-box {
-  padding-bottom: 1.44rem;
+  padding-bottom: .94rem;
 }
 
 #choose_area .select-area-box .tab {
@@ -498,18 +520,30 @@
   background-size: 100% 100%;
 }
 
-#choose_area .select-area-box .tab .province .checkbox[disabled] {
+#choose_area .select-area-box .tab .province .checkbox:checked[disabled] {
   border: 0;
   background: url(/jyapp/vipsubscribe/image/active_disabled.png) no-repeat center center;
   background-size: 100% 100%;
 }
 
-#choose_area .select-area-box .tab .province .checkbox.half:checked {
+#choose_area .select-area-box .tab .province .checkbox.half {
   border: 0 !important;
   background: url(/jyapp/vipsubscribe/image/banxuan.png) no-repeat center center !important;
   background-size: cover !important;
 }
 
+#choose_area .select-area-box .tab .province .checkbox.half[disabled] {
+  border: 0 !important;
+  background: url(/jyapp/vipsubscribe/image/banxuan.png) no-repeat center center;
+  background-size: cover !important;
+}
+
+#choose_area .select-area-box .tab .optional {
+  color: #2CB7CA;
+  font-size: 0.28rem;
+  margin-left: -2.8rem;
+}
+
 #choose_area .select-area-box label::after {
   font-size: 14px;
   float: right;
@@ -537,10 +571,10 @@
   color: #fff;
 }
 
-/*#choose_area .select-area-box .tab_content .active[disabled] {
+#choose_area .select-area-box .tab_content .active[disabled] {
   background: #BFBFC3;
   color: #fff;
-}*/
+}
 
 #choose_area .select-area-box .tab_content .city[disabled] {
   background: #BFBFC3;
@@ -571,5 +605,6 @@
 }
 
 #choose_area .slide a {
+  width: 100%;
   margin-bottom: .1rem;
 }

BIN
src/jfw/modules/app/src/web/staticres/jyapp/vipsubscribe/image/banxuan_disabled.png


+ 723 - 0
src/jfw/modules/app/src/web/staticres/jyapp/vipsubscribe/js/updateArea.js

@@ -0,0 +1,723 @@
+$(function () {
+    // 后端数据结构
+//  var areaData = {
+//      'data': {
+//          // 选择的数量
+//          'area': {
+//              '北京': [],
+//              '河南': [
+//                  '洛阳市',
+//                  '驻马店市',
+//                  '周口市',
+//                  '郑州市'
+//              ],
+//              '湖南':['长沙市'],
+//              '澳门': [],
+//              '甘肃': []
+//          },
+//          'buyset': {
+//              // 购买的全省的数量(不带市)
+//              'areacount': 7,
+//              'buyerclasscount': 11,
+//              // 购买的城市
+//              'citys': {
+//                  '河南': 4,
+//                  '湖南': 3,
+//                  '吉林': 2
+//              }
+//          }
+//      },
+//      'errMsg': '',
+//      'success': true
+//  };
+    var areaData = {
+        'data': {
+            // 选择的数量
+            'area': {},
+            'buyset': {
+                // 购买的全省的数量(不带市)
+                'areacount': 7,
+                'buyerclasscount': 11,
+                // 购买的城市
+                'citys': {}
+            }
+        },
+        'errMsg': '',
+        'success': true
+    };
+    
+
+    // 已经购买过的城市数量
+    let alreadyBuy = {
+        province: {
+            totalCount: 0,
+            selectedCount: 0
+        },
+        city: {
+            totalCount: 0,
+            selectedCount: 0
+        }
+    }
+    // 新增城市数量(排除修改的数量)
+    let newlyAdded = {
+        province: 0,
+        city: 0
+    }
+	
+    // ----------------- 以下定义功能函数 ----------------------------
+    function createMoreCity(arr) {
+        var tempHtml = arr.map(function (v) {
+            return '<button class="city">' + v.name + '</button>'
+        }).join('')
+        return tempHtml
+    }
+
+    // 新增求值 ---- 统计数量,不做视图操作
+    function getResult(callback) {
+        if (areaData.data.buyset.areacount === -1) {
+            $('.result_text.add_new .added-info').hide()
+            return
+        }
+        // 升级新增清空
+        $('.result_text.add_new .added-info').text('')
+
+        let isWholeSelected = $('.tab.whole input').is(':checked')
+        let isWholeDisabled = $('.tab.whole input').prop('disabled')
+        
+        // 已购买省份改变的数量
+        let dBuySetProvinceCount = 0
+        // 已购买省份改变的数量
+        let dAddedProvinceCount = 0
+        
+        // 已购买城市改变的数量
+        let dBuySetCityCount = 0
+        // 新增城市的数量
+        let dAddedCityCount = 0
+        $('.area-list li:not(.index)').each(function(i, dom){
+            if ($(dom).children('.tab').hasClass('whole')) return true
+            // 统计非全国的数量
+            // 没有'data-buy-city-count'属性的 $(dom).attr('data-buy-city-count') 为undefined
+            if ($(dom).attr('data-buy-city-count')) {
+                /********  此处判断的是已购买的城市下的  ********************/
+                // 获取购买城市的数量
+                let buyCount = $(dom).attr('data-buy-city-count') - 0   // 隐式转换成Number
+                // 获取城市不可点击的数量
+                let alreadySelectedCount = $(dom).find('button[disabled]').length
+                // 选择城市的数量(包括不可点击的)
+                let hasActiveCount = $(dom).find('button.active').length
+
+                if (hasActiveCount > buyCount) {
+                    dBuySetCityCount += buyCount
+                    dAddedCityCount += (hasActiveCount - buyCount)
+                } else {
+                    // 操作已购买的数量
+                    dBuySetCityCount += hasActiveCount
+                }
+            } else {
+                // 是不是直辖市或自治区,在有data-buy-count没必要判断
+                let hasCities = $(dom).find('.tab').hasClass('municipality')
+                // 是否购买过该省份(还需要判断该省份下面的城市是否全部disabled --- 同时满足才算购买过全省)
+                let provinceInput = $(dom).find('input')
+                // 循环着的当前的省份是否可选 和 是否被选中
+                let isBoughtProvince = provinceInput.prop('disabled')
+                let isChecked = provinceInput.is(':checked')
+
+                // 可得到已经购买的省份的数量(循环完成后可得到,循环过程中的值可能不全)
+
+                // 判断是否为购买过的城市
+                if (isBoughtProvince) {
+                    // 将已购买(选中但不能单击的)城市选中
+                    if (isChecked) {
+                        dBuySetProvinceCount ++
+                    }
+                } else {
+                    // 判断是否是直辖市或自治区(省份下面没有城市的和有城市的分开计算)
+                    if (hasCities) {
+                        // 直辖市、自治区 -----直接进行省份的操作
+                        // 并且没有购买过该省的,并且选中的
+                        if (isChecked) {
+                            dAddedProvinceCount ++
+                        }
+                    } else {
+                        // 带有市的省份城市(该省份下以前没有购买过任何城市)
+                        // 两种情况:1. 全选    2. 不全选
+                        let allCityLength = $(dom).find('button').length
+                        let otherTotalAddCount = $(dom).find('button.active').length
+
+                        if (allCityLength === otherTotalAddCount && isChecked) {
+                            // 选中了省份下的所有城市
+                            dAddedProvinceCount ++
+                        } else {
+                            // 对城市做新增操作
+                            dAddedCityCount += otherTotalAddCount
+                        }
+                    }
+                }
+            }
+        })
+
+        // 循环完成判断已经选择的省份数量 是否 大于购买过的数量
+        if (dBuySetProvinceCount + dAddedProvinceCount > alreadyBuy.province.totalCount) {
+            // 如果已选择的数量和新增的数量大于已购买过的数量,说明我有购买新的城市
+            dAddedProvinceCount -= (alreadyBuy.province.totalCount - dBuySetProvinceCount)
+            dBuySetProvinceCount = alreadyBuy.province.totalCount
+        } else {
+            dBuySetProvinceCount += dAddedProvinceCount
+            dAddedProvinceCount = 0
+        }
+
+        // 已购买城市下选项改变,状态更新
+        alreadyBuy.city.selectedCount = dBuySetCityCount
+        newlyAdded.city = dAddedCityCount
+
+        alreadyBuy.province.selectedCount = dBuySetProvinceCount
+        newlyAdded.province = dAddedProvinceCount
+
+        callback && callback()
+
+        setDataInResult()
+
+        // 全国被选中了
+        if (isWholeSelected && !isWholeDisabled) {
+            $('.result_text.add_new .added-info').text('全国')
+            $('.result_text.add_new').show()
+            isLockedTipButtons(false)
+        }
+    }
+
+    function setDataInResult() {
+        let buySetInfo = {
+            p: `省级区域${alreadyBuy.province.selectedCount}/${alreadyBuy.province.totalCount}、`,
+            c: `地市${alreadyBuy.city.selectedCount}/${alreadyBuy.city.totalCount}`
+        }
+        let addedInfo = {
+            p: `省级区域 ${newlyAdded.province}、`,
+            c: `地市 ${newlyAdded.city}`
+        }
+
+        // 修改数量并进行重新赋值
+        $('.result_text.already .buy-set-info').text(buySetInfo.p + buySetInfo.c)
+        // 升级新增赋值
+        $('.result_text.add_new .added-info').text(addedInfo.p + addedInfo.c)
+
+        if (newlyAdded.province !== 0 || newlyAdded.city !== 0) {
+            $('.result_text.add_new').show()
+            isLockedTipButtons(false)
+        } else {
+            $('.result_text.add_new').hide()
+            isLockedTipButtons(true)
+        }
+    }
+
+    // 求需要M的数量
+    function getResultWithMCount() {
+        let added = {
+            country: 0,
+            province: 0,
+            city: {
+                // '河南': 1,
+                // '吉林': 1
+            }
+        }
+        // 购买过的省份数量
+        let buySetProvinceCount = $('.area-list').attr('data-buy-province-count') - 0  // 隐式转换成Number
+        
+        $('.area-list li:not(.index)').each(function(i, dom) {
+            if ($(dom).children('.tab').hasClass('whole')) {
+                // 判断是否被选中
+                if ($(dom).find('input.other').is(':checked')) {
+                    added.country = -1
+                    added.province = 0
+                    added.city = {}
+                    return false
+                }
+            } else {
+                added.country = 0
+                let pName = $(dom).find('.province').text().replace(/\s+ | [\r\n]/g, '')
+                // 获取当前dom下有几个按钮有active样式
+                let activeButtonLength = $(dom).find('button.active').length
+
+                // 判断该省是否有购买过的城市
+                if ($(dom).attr('data-buy-city-count')) {
+                    let buyCityCount = $(dom).attr('data-buy-city-count') - 0
+                    let aCityCount = activeButtonLength - buyCityCount
+                    if (aCityCount > 0) {
+                        added.city[pName] = aCityCount
+                    } else {
+                        // 选不到购买的个数
+                    }
+                } else {
+                    // 判断是否是直辖市
+                    let isMunicipality = $(dom).find('.tab').hasClass('municipality')
+                    let allCitylength = $(dom).find('button').length
+
+                    if (isMunicipality) {
+                        if ($(dom).find('input').is(':checked')) {
+                            added.province ++
+                        }
+                    } else {
+                        if (activeButtonLength === allCitylength) {
+                            added.province ++
+                        } else {
+                            if (activeButtonLength !== 0) added.city[pName] = activeButtonLength
+                        }
+                    }
+                }
+            }
+        })
+
+        // 循环完成判断计算省份
+        let aProvinceCount = added.province - buySetProvinceCount
+        if (aProvinceCount > 0) {
+            added.province = aProvinceCount
+        } else {
+            added.province = 0
+        }
+        return added
+    }
+
+    // 点亮的城市数量详情(需要省和城市名称)
+    function getActiveCityDetail(state = '') {
+        let isWholeCountry = $('.tab.whole input').is(':checked')
+        if (isWholeCountry) {
+            // 选择全国
+            let str = $('.area-list li .tab.whole .province').text().replace(/\s+ | [\r\n]/g, '')
+            let obj = {}
+            obj[str] = []
+            return obj
+        } else {
+            let arr = []
+            $('.area-list li:not(.index)').each(function(i, dom) {
+                if ($(dom).children('.tab').hasClass('whole')) return
+                let isMunicipality = $(dom).find('.tab').hasClass('municipality')
+                let pName = $(dom).find('.province').text().replace(/\s+ | [\r\n]/g, '')
+                let selectedObj = {
+                    name: pName,
+                    children: []
+                }
+                
+                // 是否是直辖市或自治区
+                if (isMunicipality) {
+                    if ($(dom).find('input:not([disabled])').is(':checked')) {
+                        arr.push(selectedObj)
+                    }
+                } else {
+                    let allCitylength = $(dom).find('button').length
+
+                    if (state === 'disabled') {
+                        // 判断是否全省被选中
+                        if ($(dom).find('button.active').length === allCitylength) {
+                            // 判断省下有没有不可点击的按钮
+                            if ($(dom).attr('data-buy-city-count')) {
+                                $(dom).find('button.active').each(function(c, dom) {
+                                    let cName = $(dom).text().replace(/\s+ | [\r\n]/g, '')
+                                    selectedObj.children.push(cName)
+                                })
+                                if (selectedObj.children.length) {
+                                    arr.push(selectedObj)
+                                }
+                            } else {
+                                arr.push(selectedObj)
+                            }
+                        } else {
+                            $(dom).find('button.active').each(function(c, dom) {
+                                let cName = $(dom).text().replace(/\s+ | [\r\n]/g, '')
+                                selectedObj.children.push(cName)
+                            })
+                            if (selectedObj.children.length) {
+                                arr.push(selectedObj)
+                            }
+                        }
+                    } else {
+                        // 判断是否全省被选中
+                        if ($(dom).find('button.active:not([disabled])').length === allCitylength) {
+                            arr.push(selectedObj)
+                        } else {
+                            $(dom).find('button.active:not([disabled])').each(function(c, dom) {
+                                let cName = $(dom).text().replace(/\s+ | [\r\n]/g, '')
+                                selectedObj.children.push(cName)
+                            })
+                            if (selectedObj.children.length) {
+                                arr.push(selectedObj)
+                            }
+                        }
+                    }
+                }
+            })
+
+            // 处理arr
+            // [
+            //     {
+            //         name: '安徽',
+            //         children: ["合肥市", "蚌埠市", "阜阳市"]
+            //     },
+            //     {
+            //         name: '海南',
+            //         children: ["三亚市", "文昌市"]
+            //     },
+            //     {
+            //         name: '河南',
+            //         children: ["郑州市", "信阳市"]
+            //     }
+            // ]
+            let selectedCityDetail = {}
+            arr.forEach(function(item, i) {
+                selectedCityDetail[item.name] = item.children
+            })
+            return selectedCityDetail
+        }
+    }
+
+    // 初始选择的城市恢复,根据传入的p恢复为Disabled灰色按钮
+    function renderSelectedCityDisabled(p = {}) {
+        for (const k in p) {
+            if (p[k].length == 0) {
+                // 购买的省份
+                $('.province').each(function () {
+                    let t = $(this).text().trim();
+                    if (k == t) {
+                        $(this).children('.checkbox').prop('checked',true).attr('disabled',true);
+                        $(this).parents('li').children('.tab_content').find('.city').addClass('active').attr('disabled',true);
+                    }
+                })
+            } else {
+                $('.city').each(function () {
+                    let t = $(this).text().trim();
+                    p[k].forEach(v =>{
+                        if(v !== t) return
+                        // let that = $(this).parents('li').find('.tab:not(.municipality)');
+                        // 改变状态按钮
+                        $(this).addClass('active').attr('disabled',true).parent().siblings('.tab').find('input').addClass('half').attr('disabled',true);
+                    })
+                })
+            }
+        }
+    }
+
+    // 初始选择的城市恢复,根据传入的p恢复为Active蓝色按钮
+    // 需要放到init之后
+    function renderSelectedCityActive(p = {}) {
+        for (const k in p) {
+            if (k === '全国') {
+                $('.area-list li:not(.index):eq(0)').find('input').trigger('click')
+                return
+            }
+            
+            if (p[k].length == 0) {
+                // 购买的省份
+                $('.province').each(function () {
+                    let t = $(this).text().trim();
+                    if (k == t && p[k].length == 0) {
+                        $(this).parent().siblings().find('.city').trigger('click')
+                    }
+                })
+            } else {
+                $('.city').each(function () {
+                    let t = $(this).text().trim();
+                    p[k].forEach(v =>{
+                        if(v !== t) return
+                        // let that = $(this).parents('li').find('.tab:not(.municipality)');
+                        // 改变状态按钮
+                        $(this).trigger('click')
+                    })
+                })
+            }
+        }
+        getResult()
+    }
+
+    function isLockedTipButtons(f) {
+        $('.tips_btn button').prop('disabled', f)
+    }
+
+    // 根据数据进行求总数 --- 上方提示数据信息的初始化
+    function initAlreadyBuy(p, buyset, citys) {
+        // 此处在数据返回后根据数据进行求值
+        if (buyset.areacount === -1) {
+            $('.result_text.already .buy-set-info').text('全国')
+            $('.result_text.add_new .added-info').hide().text('')
+        }
+
+        // 选择的省和市的数量
+        for (let a in p) {
+            if (p[a].length) {
+                // 已经选择的市的数量
+                alreadyBuy.city.selectedCount += p[a].length
+            } else {
+                // 已经选择的省的数量
+                alreadyBuy.province.selectedCount ++
+            }
+        }
+
+        // 购买的全省的数量(不包含市)
+        alreadyBuy.province.totalCount = buyset.areacount;
+        // 购买的城市数量
+        for (const c in citys) {
+            alreadyBuy.city.totalCount += citys[c]
+        }
+        // console.log(alreadyBuy)
+        let buySetInfo = {
+            p: `省级区域${alreadyBuy.province.selectedCount}/${alreadyBuy.province.totalCount}、`,
+            c: `地市${alreadyBuy.city.selectedCount}/${alreadyBuy.city.totalCount}`
+        }
+        $('.result_text.already .buy-set-info').text(buySetInfo.p + buySetInfo.c)
+        $('.result_text.add_new .added-info').text('')
+    }
+
+    // 初始化方法
+    function init() {
+        let data = areaData.data
+        let buyset = data.buyset;
+        let citys = buyset.citys;
+        initAlreadyBuy(data.area, buyset, citys)
+        // 1.根据返回数据进行渲染
+        if (buyset.areacount === -1) {
+            // 购买全国
+            if (Object.keys(data.area).length === 0) {
+                // 选中全国
+                // 不能操作
+                $('.checkbox.other').prop('disabled', true).prop('checked', true)
+                $('.checkbox:not(.other)').prop('disabled', true)
+                $('.city').attr('disabled', true)
+            } else {
+                renderSelectedCityDisabled(data.area)
+            }
+            isLockedTipButtons(true)
+            $('.result_text.already .buy-set-info').text('全国')
+        } else {
+            // 购买的非全国
+            renderSelectedCityDisabled(data.area)
+        }
+        // 2.根据数据绑定data-buy-count,并赋值
+        // area-list上绑定购买的省份数量
+        $('.area-list').attr('data-buy-province-count', buyset.areacount)
+        $('.area-list li:not(.index)').each(function(i, dom){
+            if ($(dom).children('.tab').hasClass('whole')) return
+            // 获取省的名字,并去空格.回车.换行
+            let provinceName = $(dom).find('.province').text().replace(/\s+ | [\r\n]/g, '')
+            for (let c in citys) {
+                if (c === provinceName) {
+                    $(dom).attr('data-buy-city-count', citys[c])
+                }
+            }
+        })
+        $('.add_new').hide()
+        getResult()
+    }
+
+    // ----------------- 以下绑定事件 ----------------------------
+    // 0.渲染城市列表
+    $(".select-area-box ul li:not('.index')").each(function () {
+        var text = $(this).find(".province").text().trim()
+        var data = null
+        chinaMapJSON.some(function (v) {
+            data = v
+            return v.name.indexOf(text) !== -1
+        })
+        var box = $(this).find('div.tab_content')
+        var html = createMoreCity(data.city)
+        box.html(html)
+    })
+    // fastClick初始化: https://github.com/ftlabs/fastclick
+	//  FastClick.attach(document.body)
+    // 1.省下拉市
+    let isAnimating = false
+    $(".select-area-box .tab:not(.municipality)").on('click', function (event) {
+        if (isAnimating) return
+        isAnimating = true
+        if ($(this).next('.tab_content:not(:animated)').css("display") == "block") {
+            $(this).children().children('i').css({
+                "display": "inline-block",
+                "transform": "rotate(0)"
+            })
+        } else {
+            $(this).children().children('i').css({
+                "display": "inline-block",
+                "transform": "rotate(-180deg)"
+            })
+        }
+        $(this).toggleClass('selected').next('.tab_content:not(:animated)').slideToggle(500)
+        $(this).parent().siblings().children('.tab').removeClass('selected');
+        setTimeout(() => {
+            isAnimating = false
+        }, 500)
+    })
+    // 2.点击全国按钮onchange事件;
+    $('.checkbox.other').on('change', function () {
+        let isChecked = $(this).is(':checked')
+        if(isChecked){
+            $(this).prop('checked',true);
+            $('.checkbox:not(.other):not([disabled])').prop('checked',false).removeClass('half');
+            $('.city:not([disabled])').removeClass('active');
+            $('.tab_content').slideUp();
+        }
+        getResult()
+    })
+    // 3.点击非全国按钮onchange事件
+    $('.checkbox:not(.other)').on('change', function () {
+        $('.checkbox.other').prop('checked',false);
+        let isChecked = $(this).is(':checked');
+        if(isChecked){
+            $(this).prop('checked',true).removeClass('half');
+            $(this).parents('li').find('.city').addClass('active');
+            // 控制点击checkbox时候是否展开下方的城市列表
+            // $(this).parent().parent('.tab:not(.municipality)').siblings('.tab_content').slideDown();
+        }else{
+            $(this).prop('checked',false);
+            $(this).parents('li').find('.city').removeClass('active');
+        }
+        showOther();
+        getResult();
+    })
+    // 4.点击半选按钮触发的事件
+//  $('.checkbox.half').on('change', function () {
+//      $('.checkbox.other').prop('checked', false)
+//      let isChecked = $(this).is(':checked')
+//      $(this).prop('checked', isChecked).removeClass('half')
+//      console.log("!1")
+//      getResult();
+//  })
+    // 5.点击城市按钮触发的事件
+    $('.tab_content').on('click', '.city', function () {
+        // 全国取消选中
+        $('.checkbox.other').prop('checked',false);
+        $(this).toggleClass('active')
+        // 省下所有选中的地市数量
+        let activeCityLength = $(this).parent().find('.city.active').length;
+        // 省下一共有几个城市
+        let cityLength = $(this).parent().find('.city').length;
+        let oInput = $(this).parents('li').find('input.checkbox')
+        
+        if (activeCityLength === cityLength) {//当选中的城市数量等于该省下所有城市总数时,即为全选
+            if ($(this).siblings('.city[disabled]').length === 0) {
+                oInput.removeClass('half').prop('checked', true)
+            }
+        } else if (activeCityLength === 0){
+            oInput.prop('checked', false).removeClass('half')
+        } else {//半选
+            oInput.prop("checked",false).addClass('half')
+        }
+        showCityTips(this)
+        getResult();
+    })
+    // 6. 重置按钮点击事件
+    $('.reset-btn').on('click', function() {
+        // alreadyBuy = {
+        //     province: {
+        //         totalCount: 0,
+        //         selectedCount: 0
+        //     },
+        //     city: {
+        //         totalCount: 0,
+        //         selectedCount: 0
+        //     }
+        // }
+        // newlyAdded = {
+        //     province: 0,
+        //     city: 0
+        // }
+
+        // 数组置0,在重新从数据中计算初始状态结果并返回
+        for (let i in alreadyBuy) {
+            for(let ii in alreadyBuy[i]) {
+                alreadyBuy[i][ii] = 0
+            }
+        }
+        for (let j in newlyAdded) {
+            newlyAdded[j] = 0
+        }
+        $(".select-area-box .tab:not(.municipality) .icon").css({
+            "display": "inline-block",
+            "transform": "rotate(0)"
+        });
+
+        $('.checkbox').prop('checked', false).removeAttr('disabled');
+        $('.city').removeClass('active');
+        $('input').removeClass('half')
+        $('.tab_content').slideUp();
+        $('.optional').remove()
+        init();
+        $(".tips_d_text").hide();
+    })
+
+    // 7.锚点跳转
+    $("body").on('click', '.slide a', function () {
+        var s = $(this).html()
+        if (s == '#') {
+            return;
+        }
+        document.querySelector('#' + s).scrollIntoView({
+            block: 'center'
+        });
+    })
+    // 阻止input checkbox选中取消 触发父元素下拉事件
+    $('.checkbox').click(function (e) {  
+        e.stopPropagation();
+    })
+
+	function showCityTips(dom){
+		let activeCityLength = $(dom).parent().find('.city.active').length;
+		let selectedCityLength = $(dom).parent().find('.city.active:not([disabled])').length;
+		let cityLength = $(dom).parent().find('.city').length;
+		if(selectedCityLength > 2){
+			$(".tips_d_text").text("已选择"+selectedCityLength+"个市,建议购买“全省”");
+			$(".tips_d_text").show();
+		}else{
+			$(".tips_d_text").hide();
+		}
+		if(selectedCityLength === cityLength){
+			showOther();
+		}
+	}
+	
+	function showOther(){
+		let provinceLength = $(".area-list .checkbox:not(.other):not([disabled]):checked").length;
+		if(provinceLength > 9){
+			$(".tips_d_text").text("已选择"+provinceLength+"个省,建议购买“全国”")
+			$(".tips_d_text").show();
+		}else{
+			$(".tips_d_text").hide();
+		}
+	}
+
+    // ----------------------- 以下数据交互 ------------------
+    $DoPost("/subscribepay/renewUpgrade/getBuyMsg", {}, function (data) {
+    	if(data){
+        	areaData["data"] = {
+        		"area" : data.area,
+        		"buyset" : data.buyset, 
+        	}
+        	init();
+    	}
+    }, false);
+    // 确认按钮事件
+    $('.save-btn').on('click', function(){
+        // 获取added城市详情
+        var activeCityDetail = getActiveCityDetail()
+        let areaCount = getResultWithMCount()
+//      console.log("111",areaCount)
+//      console.log(JSON.stringify(activeCityDetail))
+//      console.log(activeCityDetail)
+//      console.log(areaData)
+//      console.log(alreadyBuy)
+        sessionStorage.vipAddCount = JSON.stringify(newlyAdded);
+        sessionStorage.vipSubSelectCity = newlyAdded.city;
+        sessionStorage.vipSubSelectAreaUpgrade = JSON.stringify(activeCityDetail);
+        sessionStorage.vipSubSelectAreaAdd = JSON.stringify(areaCount);
+        history.go(-1);
+    })
+	//
+	if(sessionStorage.vipSubSelectAreaUpgrade!==undefined&&sessionStorage.vipSubSelectAreaUpgrade!==""){
+		let areaObj = JSON.parse(sessionStorage.vipSubSelectAreaUpgrade);
+		renderSelectedCityActive(areaObj);
+	}
+    // 求需要M的城市数量
+    // getResultWithMCount()
+    // 获取点亮的城市的列表详情(带省名和城市名)
+    // getActiveCityDetail()
+
+    // 回显为蓝色激活样式
+    // renderSelectedCityActive()
+    // 回显为灰色不可点击样式
+    // renderSelectedCityDisabled()
+})

+ 17 - 487
src/jfw/modules/app/src/web/templates/vipsubscribe/choose_area_upgrade.html

@@ -12,7 +12,7 @@
     <link rel="stylesheet" type="text/css" href="/jyapp/vipsubscribe/css/base.css?v={{Msg "seo" "version"}}" />
     <link rel="stylesheet" type="text/css" href="/jyapp/vipsubscribe/iconfont/iconfont.css?v={{Msg "seo" "version"}}" />
     <link rel="stylesheet" href="/jyapp/vipsubscribe/css/public.css?v={{Msg "seo" "version"}}">
-    <link rel="stylesheet" href="/jyapp/vipsubscribe/css/choose_area.css?v={{Msg "seo" "version"}}4">
+    <link rel="stylesheet" href="/jyapp/vipsubscribe/css/choose_area.css?v={{Msg "seo" "version"}}">
 	<link rel="stylesheet" type="text/css" href="/jyapp/css/layout.css?v={{Msg "seo" "version"}}"/>
 	<link rel="stylesheet" type="text/css" href="/jyapp/css/font.css?v={{Msg "seo" "version"}}"/>
 </head>
@@ -20,20 +20,23 @@
 	body,html {
 		height: 100%;
 	}
+	#choose_area .select-area-box .tab .province .checkbox.half[disabled]{
+        border: 0!important;
+        background: url(/jyapp/vipsubscribe/image/banxuan_disabled.png) no-repeat center center!important;
+        background-size:cover!important;
+    }
 </style>
 <body>
 	<div class="app-layout-header">
-        <span class="app-back jyapp-icon jyapp-icon-zuojiantou"></span>
-        区域选择
-    </div>
-    <div class="app-layout-content-b">
+	        <span class="app-back jyapp-icon jyapp-icon-zuojiantou"></span>
+	        行业选择
+	    </div>
+	<div class="app-layout-content-b">
     <div id="choose_area" >
         <div class="result">
             <!-- 首次购买 显示"已选择" -----  升级订阅显示"已新增" -->
-            <p class="result_text line_two"> 已新增:<span class="result_name"></span>
-                <a href="javascript:;" class="detail">详情</a>
-            </p>
-            <a href="javascript:;" class="packup" style="display: none;">收起</a>
+            <p class="result_text already"><span>已购买:</span><span class="buy-set-info"></span></p>
+            <p class="result_text add_new"><span>升级新增:</span><span class="added-info"></span></p>
         </div>
         <div class="form">
             <div class="select-area-box">
@@ -365,13 +368,12 @@
         </div>
         <div class="tips_btn">
             <div class="tips_discount">
-                <!--<div class="tips_d_money" style="display: block">&yen;38</div>-->
-                <div class="tips_d_text citys">已选择4个市,建议购买“全省”更划算哦~</div>
-                <div class="tips_d_text all">已选择10个省,建议购买“全国”更划算哦~</div>
+                <!--<div class="tips_d_money" style="display: block">&yen;1</div>-->
+                <div class="tips_d_text">已选择3个市,建议购买“全省”</div>
             </div>
             <div class="btns">
-                <button class="reset-btn">重置</button>
-                <button class="save-btn">确认</button>
+                <button class="reset-btn" disabled>重置</button>
+                <button class="save-btn" disabled>确认</button>
             </div>
         </div>
         <div class="slide">
@@ -395,482 +397,10 @@
     </div>
     </div>
     <script src="/jyapp/vipsubscribe/js/jquery-2.1.4.js?v={{Msg "seo" "version"}}"></script>
-    <!--<script src="/vipsubscribe/js/fastclick.js?v={{Msg "seo" "version"}}"></script>-->
     <script src="/jyapp/vipsubscribe/js/mapJSON.js?v={{Msg "seo" "version"}}"></script>
     <script src="/jyapp/vipsubscribe/js/common.js?v={{Msg "seo" "version"}}"></script>
     <script src="/jyapp/js/common.js?v={{Msg "seo" "version"}}"></script>
-    <script>
-    	//已购买
-    	var buystr = "";
-        $DoPost("/subscribepay/renewUpgrade/getBuyMsg", {}, function (data) {
-        	if(data){
-            	buystr = data.area;
-        	}
-        }, false);
-//      console.log(buystr)
-      var AreaChoose={
-        selectObj:{},//已选择,未购买城市;
-        buyObj:{},//已购买
-        selectedIndustryArr:["一个行业"],//计算价格临时变量
-        timeSelect:[1,2],//计算价格临时变量 timeSelect[0]时长  timeSelect[1] 1:年 2:月
-        vipSubisTrial:false,
-        inintData:function(){
-          //已选择
-          try{
-            let select =sessionStorage.getItem("vipSubSelectAreaUpgrade");
-            if(select){
-              this.selectObj=JSON.parse(select);
-            }
-            if(sessionStorage.getItem("vipSubSelectIndustryUpgrade")){
-              this.selectedIndustryArr=JSON.parse(sessionStorage.getItem("vipSubSelectIndustryUpgrade"));
-            }
-            if(sessionStorage.getItem("vipSubSelectTime")){
-              this.timeSelect=JSON.parse(sessionStorage.getItem("vipSubSelectTime"));
-            }
-            //
-            this.buyObj = buystr;
-            if(checkObj(buystr)){
-            	this.buyObj = {"全国":[]}
-            }
-//          console.log(this.buyObj)
-            //是否试用界面
-            if(sessionStorage.getItem("vipSubisTrial")) this.vipSubisTrial=true;
-          }catch(e){
-            console.log(e);
-            this.selectObj={};
-          }
-        },
-        inintPage:function(){//初始化省份城市选项   
-          $(".select-area-box ul li:not('.index')").each(function () {
-              var text = $(this).find(".province").text().trim()
-              var data = null
-              chinaMapJSON.some(function (v) {
-                  data = v
-                  return v.name.indexOf(text) !== -1
-              })
-              var box = $(this).find('div.tab_content')
-              var html = AreaChoose.createMoreCity(data.city)
-              box.html(html)
-          })
-        },
-        createMoreCity:function(arr){
-          var tempHtml = arr.map(function (v) {
-                return '<button class="city">' + v.name + '</button>'
-            }).join('')
-            return tempHtml
-        },
-        showSelected:function(canClick){ //回显已选择
-        	var ran = "";
-            if(canClick){
-            	ran = this.selectObj;
-            }else{
-            	ran = this.buyObj;
-            }    
-            for(var province in ran) {
-      			let citys=ran[province]
-	            if(citys.length>0){//地市
-	                this.selectCity(citys,canClick)
-	            }else{//省份
-	                this.selectProvince(province,canClick)
-	            }
-	        }
-        },
-        selectProvince:function(province,canClick){ //设置选中省份 province 省份
-          $($('.tab .province')).each(function (index, dom) {
-            if (province == $.trim($(dom).text())) {
-              $(".checkbox.other").attr("checked", false); //取消全国选中
-              $(dom).children('.checkbox').attr({"checked": true,"disabled":!canClick});//选中此省份
-              if(canClick){
-              	$(dom).parents().siblings('.tab_content').find(".city").addClass("active").attr({"disabled":!canClick});
-              }else{
-              	$(dom).parents().siblings('.tab_content').find(".city").attr({"disabled":!canClick});
-              }
-            }
-            if(!canClick){
-            	if(province === "全国"){
-	            	$('.tab .province').each(function(){
-	            		$(this).children('.checkbox').attr({"checked": true,"disabled":!canClick});//选中此省份
-	            	});
-	            	$('.tab_content .city').each(function(){
-	            		$(this).attr("disabled",!canClick);
-	            	});
-	            }
-            }
-          })
-        },
-        selectCity:function(citys,canClick){ //设置选中城市
-          citys.forEach(v => {
-            $($('.tab_content .city')).each(function (index, dom) {
-                if (v == $(dom).text()) {
-                    $(".checkbox.other").attr("checked", false); //取消全国选中
-                    if(canClick){
-                    	$(dom).addClass('active').attr('disabled', !canClick).parents().siblings('.tab')
-                        .addClass('selected').children('.province').children('.checkbox').attr({
-                            "checked": true
-                        })
-                    }else{
-                    	$(dom).attr('disabled', !canClick).parents().siblings('.tab')
-                        .addClass('selected').children('.province').children('.checkbox').attr({
-                            "checked": true,
-                            "disabled": "disabled"
-                        })
-                        $(dom).parents().slideDown(500);
-                    }
-                }
-            })
-          })
-        },
-        getResult:function(){   /* 选中结果 */
-          //如果选中所有,则转为全国
-          if($(".city").length==$(".city.active").length){
-            $(".checkbox.other").trigger("click");
-            return
-          }
-          this.selectObj = {};
-          $('.result_name').empty()
-          var data = []; //定义一个总数组
-          var cityArr =[]; //定义一个选中城市数组
-          var provincesArr = [];
-          var val = $('.other').parents('.province').text().trim();
-          if ($('.other').is(':checked')) {
-            // data.push(val)
-            data =[{name:val,children:[]}] //全国
-          }
-          $(".tab_content").find(".city.active:not('[disabled]')").each(function () {
-              var length = $(this).parent('.tab_content').find('.city').length; //省份下城市的length
-              var activeLeng = $(this).parent('.tab_content').find('.city.active').length; //省份下选中城市的length
-              let arr =[];
-              // 判断省份下的城市是否等于选中的城市长度,相等就是全部选中
-              if (length == activeLeng) {
-                  $('.tips_btn .tips_d_text.citys').hide()
-                  // data.push($(this).parent('.tab_content').siblings('.tab:not(.whole)').children('.province').text().trim())
-                  let province = $(this).parent('.tab_content').siblings('.tab:not(.whole)').children('.province').text().trim();
-                  data.push({
-                      name:province,
-                      children:[]
-                  });
-                  provincesArr.push(province);
-              } else { 
-                  let province = $(this).parent('.tab_content').siblings('.tab:not(.whole)').children('.province').text().trim();
-                  let city = $(this).html()
-                  arr.push({name:city,parent:province})
-                  for(let i =0;i<arr.length;i++){
-                      let obj ={};
-                      obj.name = arr[i].name;
-                      obj.parent = arr[i].parent;
-                      cityArr.push(obj)
-                  }
-                  data.push({
-                      name:province,
-                      children:cityArr
-                  })
-              }
-              if(activeLeng > 0){
-              	$(".tips_btn .btns .reset-btn").removeAttr("disabled");
-              	$(".tips_btn .btns .save-btn").removeAttr("disabled");
-              }
-          })
-          //数组对象去重
-          let obj = {};
-          data = data.reduce((cur,next) =>{
-              obj[next.name] ? "" : obj[next.name] = true && cur.push(next);
-              return cur
-          },[]);
-          
-          // 数组筛选
-          let result = data.map(v =>{
-              let filterArr = v.children.filter(s =>{
-                 return s.parent === v.name
-              })
-              return {
-                  name:v.name,
-                  children:filterArr
-              }
-          })
-          var html = '';
-          for (var i = 0; i < result.length; i++) {
-              let children = result[i].children;
-              if( children.length >0){
-                  // 判断每个省份下选中的城市长度,当大于等于4的时候 弹出"选择全省更划算的弹窗"
-                  let childrenArr=[];
-                  if (children.length >= 4 && !this.vipSubisTrial) {
-                      $('.tips_btn .tips_d_text.citys').text("已选择"+children.length+"个市,建议购买“全省”更划算哦~");
-                      $('.tips_btn .tips_d_text.citys').show();
-                  } 
-                  html += `${result[i].name}(`
-                  for(var j = 0;j < children.length;j++){
-                      childrenArr.push(children[j].name)
-                      if (j != children.length - 1) {
-                          html += `${children[j].name}、`
-                      } else {
-                          html += `${children[j].name}`
-                      }
-                  }
-                  if(i !=result.length -1){
-                      html += `)、`
-                  }else{
-                      html += `)`
-                  }
-                  this.selectObj[result[i].name]=childrenArr;//
-              }else{
-                  if(i !=result.length -1){
-                      html += `${result[i].name}、`
-                  }else{
-                      html += `${result[i].name}`
-                  }
-                  this.selectObj[result[i].name]=[];//
-              }
-          }
-          	for (var x = 0; x < provincesArr.length; x++) {
-	            for (var j =x+1; j <provincesArr.length; ) {
-	                if (provincesArr[x] === provincesArr[j]){
-	                    provincesArr.splice(j, 1);
-	                }
-	                else j++;
-	            }
-	        }
-          	if(provincesArr.length > 9){
-          		$('.tips_d_text.all').text("已选择"+provincesArr.length+"个省,建议购买“全国”更划算哦~");
-          		$('.tips_d_text.all').show();
-          		$('.tips_d_text.citys').hide();
-          	}else{
-          		$('.tips_d_text.all').hide();
-          	}
-//        console.log("this.selectObj:",this.selectObj)
-          $('.result_name').append(html)
-          AreaChoose.isOpen()
-        },
-        submitArea:function(){
-          let addCity = $('.result_name').text(); //新增的城市
-          sessionStorage.setItem("vipSubSelectAreaUpgrade",JSON.stringify(AreaChoose.selectObj));
-          history.go(-1);
-        },
-        isAllSelected:function(){
-          var _f = true
-          $($('.tab_content .city')).each(function (index, dom) {
-              if ($(dom).hasClass('active')) {
-                  _f = false
-                  $('.other').prop('checked', false);
-              }
-          })
-          // 如果循环结束仍为true说明 没有全部都被选中
-          if (_f) {
-//            $('.other').prop('checked', true);
-				$(".tips_btn .btns .reset-btn").attr("disabled","disabled");
-        		$(".tips_btn .btns .save-btn").attr("disabled","disabled");
-          }
-        },
-        isOpen:function(){
-          let pHeight = $('.result_text').height()
-          let minHeight = $('.result_text').css('min-height')
-          let rows = Math.round(Math.round(pHeight)/ parseFloat(minHeight));
-          $(".select-area-box .area-list").css("margin-top",$('.result_text').height()+20);
-//        console.log("高度:"+ pHeight,"最小高度"+ minHeight,"行数:" + rows)
-          if(rows == 1){
-              if(length >= 50){
-                  $('.detail').show()
-                  $('.packup').hide()
-              }else{
-                  $('.detail').hide()
-                  $('.packup').hide()
-              }
-          }else if(rows == 2){
-//            console.log($('.result_name').html().trim().length)
-              let length = $('.result_name').html().trim().length;
-              if(length >= 50){
-                  $('.detail').show()
-                  $('.packup').hide()
-              }else{
-                  $('.detail').hide()
-                  $('.packup').hide()
-              }
-              
-          } else{
-              $('.packup').show()
-              $('.detail').hide()
-          }
-        },
-        inintClick:function(){
-//      	$('.tab_content').each(function(){
-//        		AreaChoose.showSelected(false);
-//      	})
-          $('.detail').click(function () {  
-                $('.result_text').removeClass('line_two')
-                $(".result").css("padding-bottom","0.3rem")
-                $(this).hide();
-                $('.packup').show()
-                $(".select-area-box .area-list").css("margin-top",$('.result_text').height()+20);
-            })
-            $('.packup').click(function () { 
-                $(".result").css("padding-bottom","0.2rem")
-                $('.result_text').addClass('line_two')
-                $(this).hide();
-                $('.detail').show()
-                $(".select-area-box .area-list").css("margin-top",$('.result_text').height()+20);
-            })
-            $("body").on('click','.slide a',function(){
-                var s = $(this).html()
-                if(s == '#'){
-                    return;
-                }
-                document.querySelector('#' + s).scrollIntoView({block:'center'});
-            })
-          $(".select-area-box .tab:not(.municipality)").on('click', function (event) {
-                if($(this).next('.tab_content:not(:animated)').css("display") == "block"){
-                    $(this).children().children('i').css({
-                        "display":"inline-block",
-                        "transform":"rotate(0)"
-                    })
-                }else{
-                    $(this).children().children('i').css({
-                        "display":"inline-block",
-                        "transform":"rotate(-180deg)"
-                    })
-                }
-                $(this).toggleClass('selected').next('.tab_content:not(:animated)').stop(true, true).slideToggle()
-                $(this).parent().siblings().children('.tab').removeClass('selected');
-                
-            })
-            $('.checkbox').click(function (e) {  
-                e.stopPropagation();
-            })
-            $('.province .checkbox:not(.other)').on('change', function () {
-                var isCheckded = $(this).is(':checked')
-                if (isCheckded) {
-                    $(this).parents('.tab').siblings('.tab_content').find('.city').addClass('active')
-                    $(this).parents('.tab').siblings('.tab_content').find('.city[disabled]').removeClass('active')
-                    AreaChoose.isAllSelected()
-                    AreaChoose.getResult() 
-                    AreaChoose.showSelected(false);
-                } else {
-                    $(this).parents('.tab').siblings('.tab_content').find('.city').removeClass(
-                        'active')
-                    $(this).parents('.tab').siblings('.tab_content').find('.city').attr('disabled',false);    
-                    AreaChoose.isAllSelected()
-                    AreaChoose.getResult() 
-                    AreaChoose.showSelected(false);
-                }
-            })
-
-            //执行已购买城市函操作dom函数
-            $('.tab_content').on('click', '.city', function () {
-            	AreaChoose.showSelected(false);
-                $(this).toggleClass('active')
-                var isActive = $(this).parent().find('.city.active').length
-                if (isActive) {
-                    var input = $(this).parents('li').find('input.checkbox')
-                    window.input = input
-                    input.prop('checked', true)
-                    AreaChoose.isAllSelected()
-                    AreaChoose.getResult() 
-                } else {
-                    $(this).parent('div').siblings('.tab').children().children('.checkbox').prop(
-                        'checked', false)
-                    AreaChoose.isAllSelected()
-                    AreaChoose.getResult() 
-                }
-            })
-
-            $('.other').on('change', function () { //选择全国
-              	AreaChoose.reset();
-            })
-
-            $('.save-btn').click(function () {  // 提交
-                AreaChoose.submitArea();              
-            })
-            $('.reset-btn').click(function () {  //重置
-//            if(!$(".other").is(':checked')){
-//              $(".other").trigger("click");
-//            }
-				$('.tab:not(.whole):not(.tab[disabled])').removeClass('selected').children('.province').find(
-                    'input').prop({
-                    'checked': false,
-                    "disabled": false
-                });
-                $('.tab_content').find('.city:not(.city[disabled])').removeClass('active').attr({
-                    "disabled": false,
-                    "checked": false
-                })
-				AreaChoose.showSelected(false);
-				AreaChoose.getResult();
-				sessionStorage.removeItem("vipSubSelectAreaUpgrade");
-            })
-            //
-            if(sessionStorage.vipSubSelectAreaUpgrade!==undefined&&sessionStorage.vipSubSelectAreaUpgrade!==""){
-            	let areas = JSON.parse(sessionStorage.vipSubSelectAreaUpgrade);
-            	for(var province in areas){
-            		if(province === "全国"){
-            			$(".other").prop("checked",true);
-              			AreaChoose.reset();
-            		}
-            	}
-            }
-        },
-        reset:function(){
-           var checked = $(".other").is(':checked');
-            if (checked) {
-                $('.tab_content').slideUp(500)
-                $('.tab span i').css({
-                    "display":"inline-block",
-                    "transform":"rotate(0)"
-                })
-                $('.tab:not(.whole):not(.tab[disabled])').removeClass('selected').children('.province').find(
-                    'input').prop({
-                    'checked': false,
-                    "disabled": false
-                });
-                $('.tab_content').find('.city:not(.city[disabled])').removeClass('active').attr({
-                    "disabled": false,
-                    "checked": false
-                })
-                AreaChoose.getResult();
-                $(".tips_btn .btns .reset-btn").removeAttr("disabled");
-            	$(".tips_btn .btns .save-btn").removeAttr("disabled");
-            }else{
-            	AreaChoose.showSelected(false);
-                AreaChoose.getResult();
-                $(".tips_btn .btns .reset-btn").attr("disabled","disabled");
-            	$(".tips_btn .btns .save-btn").attr("disabled","disabled");
-            }
-        }
-      }
-      
-      $(function () {
-            AreaChoose.isOpen()
-            AreaChoose.inintData(); //初始化 已选择和已购买数据
-            AreaChoose.inintPage(); //初始化城市数据
-            AreaChoose.showSelected(false);
-            AreaChoose.showSelected(true);//回显已选择
-            /* 判断已购买的城市 在不在 全部城市里面,在,将按钮置灰,不可点击 */
-
-            AreaChoose.getResult();
-            AreaChoose.inintClick();
-        })
-      //
-        //
-	    function checkObj(obj) {
-		    //检验数组
-		    if (Array.prototype.isPrototypeOf(obj) && obj.length === 0) {
-		        return true;
-		    }
-		    //检验对象
-		    if (Object.prototype.isPrototypeOf(obj) && Object.keys(obj).length === 0) {
-		        return true;
-		    }
-		    return false;
-		}
-	    //
-	    if($(".result_name").text()===""){
-	    	$(".tips_btn .btns .reset-btn").attr("disabled","disabled");
-        	$(".tips_btn .btns .save-btn").attr("disabled","disabled");
-	    }
-	    
-	    if(sessionStorage.vipSubSelectAreaUpgrade!==undefined && sessionStorage.vipSubSelectAreaUpgrade!==""){
-	    	$(".tips_btn .btns .reset-btn").removeAttr("disabled");
-            $(".tips_btn .btns .save-btn").removeAttr("disabled");
-	    }
-
-    </script>
+    <script src="/jyapp/vipsubscribe/js/updateArea.js?v={{Msg "seo" "version"}}14"></script>
 </body>
 
 </html>

+ 39 - 23
src/jfw/modules/app/src/web/templates/vipsubscribe/choose_industry_upgrade.html

@@ -27,8 +27,8 @@
 	    <div class="app-layout-content-b">
         <main class="choose_industry main">
             <div class="result">
-                <span class="label">已新增:</span>
-                <span class="result_name">全部行业</span>
+                <span class="label buyset">已购买:2/3个行业</span><br>
+                <span style="display: none;" class="label addUpgrade">升级新增:2个行业</span>
             </div>
             <div class="form">
                 <div class="select-area-box">
@@ -254,12 +254,10 @@
         </main>
         </div>
         <script src="/jyapp/vipsubscribe/js/jquery-2.1.4.js?v={{Msg "seo" "version"}}"></script>
-        <!--<script src="/vipsubscribe/js/fastclick.js?v={{Msg "seo" "version"}}"></script>-->
         <script src="/jyapp/vipsubscribe/js/weui.min.js?v={{Msg "seo" "version"}}"></script>
         <script src="/jyapp/vipsubscribe/js/common.js?v={{Msg "seo" "version"}}"></script>
         <script src="/jyapp/js/common.js?v={{Msg "seo" "version"}}"></script>
-        <script>
-           //
+		<script>
            // 点击导航跳转
             $("body").on('click','.slide a',function(){
                 var s = $(this).html()
@@ -288,7 +286,10 @@
                 buttons.each(function(){
                     if ($(this).hasClass('active')) {
                         if($(this).attr("disabled")!="disabled"){
-                          selectedArr.push($(this).text())
+                        	if($(this).text() === "全部行业"){
+                        		
+                        	}
+                          	selectedArr.push($(this).text())
                         }
                     }
                 })
@@ -309,23 +310,29 @@
 							$(".tips_btn .btns .reset-btn").removeAttr("disabled");
 		            	}
                 	}else{
-                		let adds = buyIndustry.length + selectedArr.length
-                		$(".buyset").text("已购买:"+adds+"/"+buyset);
+                		if(selectedArr[0] === "全部行业"){
+                			$(".buyset").text("已购买:全部行业");
+                		}else{
+                			let adds = buyIndustry.length + selectedArr.length
+                			$(".buyset").text("已购买:"+buyset);
+                		}
                 	}
                 }else{
                 	if(buyset !== "全部行业"){
                 		$(".buyset").text("已购买:"+buyIndustryLen+"/"+buyset+"个行业")
                 	}else{
-                		$(".buyset").text("已购买:"+buyIndustryLen+"/"+buyset)
+                		$(".buyset").text("已购买:"+buyset)
                 	}
                 }
                 for(var i in selectedArr){
                 	if(selectedArr[i] === "全部行业"){
-                		$(".buyset").text("已购买:"+buyIndustry.length+"/"+buyset+"个行业");
-                		$(".addUpgrade").text("已新增:全部行业");
-                		$(".addUpgrade").show();
-                		$(".tips_btn .btns .save-btn").removeAttr("disabled");
-						$(".tips_btn .btns .reset-btn").removeAttr("disabled");
+                		if(buyset !== "全部行业"){
+                			$(".buyset").text("已购买:"+buyIndustry.length+"/"+buyset+"个行业");
+	                		$(".addUpgrade").text("已新增:全部行业");
+	                		$(".addUpgrade").show();
+	                		$(".tips_btn .btns .save-btn").removeAttr("disabled");
+							$(".tips_btn .btns .reset-btn").removeAttr("disabled");
+                		}
                 	}
                 }
                 // 显示隐藏优惠tips
@@ -353,7 +360,7 @@
                     // 除全部行业外所有按钮都被选中了
                     $('#all button').trigger('click');
                 }
-                $(".select-area-box .list").css("margin-top",$(".result").height()+20);
+//              $(".select-area-box .list").css("margin-top",$(".result").height()+20);
             }
                       
             function showSelect(arr,canclick){
@@ -408,13 +415,13 @@
                 findSelectedIndustry()
                 flushPrice()
             })
-
             // 重置按钮事件
             $('.reset-btn').on('click', function () {
 //            $("#all .industry_item").trigger("click");
 				$('.select-area-box .list button').removeClass('active');
                 showSelect(buyIndustry,false);
                 findSelectedIndustry();
+                sessionStorage.removeItem("vipSubSelectIndustryAdd");
                 sessionStorage.removeItem("vipSubSelectIndustryUpgrade");
                 $('.tips_btn .btns button').removeAttr('disabled');
             })
@@ -433,6 +440,8 @@
         				selectedIndustrysArr = selectedIndustryArr;
         			}
         		}
+        		sessionStorage.buyIndustry = $(".buyset").html();
+        		sessionStorage.addIndustry = $(".addUpgrade").html();
         		sessionStorage.setItem("vipSubSelectIndustryAdd",JSON.stringify(selectedIndustrysArr));
                 sessionStorage.setItem("vipSubSelectIndustryUpgrade",JSON.stringify(selectedIndustryArr));
                 history.go(-1);
@@ -466,13 +475,19 @@
 		            	buyLen = buyIndustry.length
 		            	buyIndustryLen = buyIndustry.length;
 		            	buyset = Number(data.buyset.buyerclasscount);
-		            	console.log(buyset)
-		            	if(buyset === -1){
-		            		buyset = "全部行业";
-		            		$(".buyset").text("已购买:"+buyLen+"/"+buyset);
-		            	}else{
-		            		$(".buyset").text("已购买:"+buyLen+"/"+buyset+"个行业");
-		            	}
+		            	if(sessionStorage.buyIndustry !== undefined){
+							$(".buyset").text(sessionStorage.buyIndustry);
+						}else{
+							if(buyset === -1){
+			            		buyset = "全部行业";
+			            		$(".buyset").text("已购买:/"+buyset);
+			            	}else{
+			            		$(".buyset").text("已购买:"+buyLen+"/"+buyset+"个行业");
+			            	}
+						}
+						if(sessionStorage.addIndustry !== undefined){
+							$(".addUpgrade").text(sessionStorage.addIndustry);
+						}
                 	}
                 },false);
                 if(checkObj(buyIndustry)){
@@ -502,6 +517,7 @@
 			    }
 			    return false;
 			}
+		
         </script>
     </body>
 </html>

+ 18 - 4
src/jfw/modules/app/src/web/templates/vipsubscribe/renew_notice.html

@@ -69,6 +69,7 @@
 			var orderId = {{.T.orderId}};
 			var starts = {{.T.startTime}};
 			var ends = {{.T.endTime}};
+			var orderCode = "";
 //			console.log("orderId",orderId)
 //			console.log("starts",starts)
 //			console.log("ends",ends)
@@ -80,6 +81,8 @@
 						var buyerclass = r.buyerclass
 						var exprie = {{.T.exprie}};
 						var vipStatus = Number(r.vipStatus);
+						orderCode = r.orderCode;
+						//
 						var areaHtml = "";
 					    var provinceArr = [];
 					    var cityArr = [];
@@ -143,16 +146,17 @@
 					  	  	$(".free_service").show();
 					    }
 					}
-				});
+				},false);
 			}else{
 				$DoPost("/subscribepay/renewUpgrade/getBuyMsg", {}, function (data) {
 					if(data){
-						var area = data.area;
-					    var buyerclass = data.buyerclass;
+						var area = data.allarea;
+					    var buyerclass = data.allindustry;
 					    var startTime = data.start;
 					    var endTime = data.end;
 					    var exprie = {{.T.exprie}};
 					    var vipStatus = Number(data.vipStatus);
+					    orderCode = data.orderCode;
 					    //
 					    var areaHtml = "";
 					    var provinceArr = [];
@@ -218,9 +222,19 @@
 					    	$(".free_service").show();
 					    }
 					}
-				});	
+				},false);	
 			}
 			
+			$(".renew_service").on("click",function(){
+				let flags = checkOrder();
+				if(flags){
+					return
+				};
+				window.location.replace("/weixin/pay/renewPayPage");
+			});
+			$(".aginBuy").on("click",function(){
+				window.location.replace("/weixin/pay/vipsubscribe_new?orderCode="+orderCode);
+			});
 	        //
 		    function checkObj(obj) {
 			    //检验数组

+ 13 - 25
src/jfw/modules/app/src/web/templates/vipsubscribe/renew_pay.html

@@ -527,8 +527,8 @@
         
         //
         var area = "";
+        var areas = "";
 	    var buyerclass = "";
-	    var areas = "";
 	    var industrys = "";
 	    var cycleunit = "";
 	    var cyclecount = "";
@@ -553,7 +553,6 @@
 			    monthPrice = getsubVipOrderPrice(areas, industrys, [1, 2]);
 			    yearPrice = getsubVipOrderPrice(areas, industrys, [1, 1]);
 			    //
-			    var areaArr = [];
 			    var areaHtml = "";
 			    var provinceArr = [];
 			    var cityArr = [];
@@ -561,47 +560,39 @@
 			    var buyerclassHtml = "";
 			    var dateName = "";
 			    var dateHtml = "";
-			    if (area !== "" && area !== undefined){
-			    	for(var province in area){
-			    		var citys = area[province]
+			    if (areas !== "" && areas !== undefined){
+			    	for(var province in areas){
+			    		var citys = areas[province]
 		//	    		console.log(citys);
 			    		if(citys.length===0){
-			    			areaArr.push(province);
 			    			provinceArr.push(province);
 			    		}else{
 			    			for(var i in citys){
 			    				var city = citys[i];
-			    				areaArr.push(city);
 			    				cityArr.push(city);
 			    			}
 			    		}
 			    	}
-			    	areaHtml = areaArr.toString().replace(/,/g, "、");
+			    	var provinceLen = provinceArr.length;
+			 		var cityLen = cityArr.length;
+			    	areaHtml = provinceLen+"个省级区域、"+cityLen+"个市";
 			    	
-					if(checkObj(area)){
+					if(checkObj(areas)){
 						areaHtml = "全国";
 					}
 			    	$(".item_area .label_for").text(areaHtml);
 			    }
-			    if(buyerclass !== "" && buyerclass !== undefined){
-			    	for(var i in buyerclass){
-			    		var industry = buyerclass[i];
+			    if(industrys !== "" && industrys !== undefined){
+			    	for(var i in industrys){
+			    		var industry = industrys[i];
 			    		buyerclassArr.push(industry);
-			    		buyerclassHtml = buyerclassArr.toString().replace(/,/g, "、");
+			    		buyerclassHtml = buyerclassArr.length+"个行业";
 			    	}
-			    	if(checkObj(buyerclass)){
+			    	if(checkObj(industrys)){
 			    		buyerclassHtml = "全行业";
 			    	}
 			    	$(".item_industry .label_for").text(buyerclassHtml);
 			    }
-//			    if(cycleunit !== "" && cycleunit !== undefined){
-//			    	if(cycleunit === 1){
-//			    		dateName = cyclecount + " 年";
-//			    	}else if(cycleunit === 2){
-//			    		dateName = cyclecount + " 个月";
-//			    	}
-//			    	$(".item_cycle .label_for").text(dateName);
-//			    }
 			    if(startTime !== "" && endTime !== "" && startTime !== undefined && endTime !== undefined){
 			    	console.log(startTime)
 			    	var start = startTime.replace(/-/g, ".");
@@ -655,9 +646,6 @@
 			 		$(".renew_update").hide();
 			 		$(".renew_upgrade").show();
 			 	}
-			 	//
-			 	var provinceLen = provinceArr.length;
-			 	var cityLen = cityArr.length;
 		    }
         }, false);
         //

+ 166 - 366
src/jfw/modules/app/src/web/templates/vipsubscribe/vip_upgrade.html

@@ -45,32 +45,16 @@
                 <li class="choose_item">
                     <a href="/jyapp/vipsubscribe/toChooseAreaUpgrade">
                         <span class="label">区域</span>
-                        <input type="text" id="area" value="" disabled placeholder="选择全国、省份、地市" class="info">
+                        <input type="text" id="area" value="" disabled placeholder="选择升级区域" class="info">
                         <i class="iconfont icon-arrow"></i>
                     </a>
-                    <p class="add_tips area-list" style="display: none;">已新增 1 个省级区域、4 个地市</p>
                 </li>
                 <li class="choose_item">
                     <a href="/jyapp/vipsubscribe/toChooseIndustryUpgrade">
                         <span class="label">行业</span>
-                        <input type="text" id="buyerclass" disabled value="" placeholder="选择采购单位行业" class="info">
+                        <input type="text" id="buyerclass" disabled value="" placeholder="选择升级行业" class="info">
                         <i class="iconfont icon-arrow"></i>
                     </a>
-                    <p class="add_tips industry-list" style="display: none;">已新增 2 个行业</p>
-                </li>
-                <!-- <li class="choose_item select_cycle">
-                    <a href="javascript:;">
-                        <span class="label">订阅周期</span>
-                        <input type="text" disabled value="" placeholder="选择年、月" class="info choose_time">
-                        <i class="iconfont icon-arrow choose_time"></i>
-                    </a>
-                </li> -->
-                <li class="choose_item choose_effect_date">
-                    <a href="javascript:;">
-                        <span class="label">生效日期</span>
-                        <span class="info" id="effect_date_name">立即生效,需支付当月费用差价</span>
-                        <i class="iconfont icon-arrow choose_time"></i>
-                    </a>
                 </li>
             </ul>
             <ul class="chooseList">
@@ -157,7 +141,6 @@
             <div class="price">
                 <label>需补差价:</label>
                 <p>
-                    <!--<span class="old_price">&yen;610.80</span>-->
                     <strong class="finally_price">&yen;0.00</strong>
                 </p> 
             </div>
@@ -237,41 +220,6 @@
                 </div>
             </div>
         </div>
-        <!-- 选择生效日期 -->
-        <div class="js_dialog effective_date" id="effective_date" style="display: none;">
-            <div class="weui-mask"></div>
-            <div class="box">
-                <div class="box_hd">
-                    <span style="font-size:0.32rem;">生效日期</span>
-                    <h3></h3>
-                    <span class="cancel">取消</span>
-                </div>
-                <div class="box_bd">
-                    <div class="weui-cells weui-cells_checkbox choose-form">
-                        <label class="weui-cell weui-check__label now_label" for="nowTime">
-                            <div class="weui-cell__bd read">
-                                <p class="effective_name now">立即生效,需支付当月费用差价</p>
-                                <p class="effective_time nownow">2019.08.23 - 2020.06.06</p>
-                            </div>
-                            <div class="weui-cell__hd">
-                                <input type="radio" class="weui-check" name="date" value="立即生效,需支付当月费用差价" id="nowTime" checked />
-                                <i class="weui-icon-checked"></i>
-                            </div>
-                        </label>
-                        <label class="weui-cell weui-check__label next_label effect_next" for="nextMonth">
-                            <div class="weui-cell__bd read">
-                                <p class="effective_name notnow"></p>
-                                <p class="effective_time notnownow">2019.09.01 - 2020.06.06</p>
-                            </div>
-                            <div class="weui-cell__hd">
-                                <input type="radio" class="weui-check" name="date" value="" id="nextMonth" />
-                                <i class="weui-icon-checked"></i>
-                            </div>
-                        </label>
-                    </div>
-                </div>
-            </div>
-        </div>
         <!-- 选择支付方式 -->
         <div class="js_dialog pay_way" id="pay_way" style="display: none;">
             <div class="weui-mask"></div>
@@ -308,7 +256,6 @@
     </div>
     </div>
     <script src="/jyapp/vipsubscribe/js/jquery-2.1.4.js"></script>
-    <!--<script src="/vipsubscribe/js/fastclick.js?v={{Msg "seo" "version"}}"></script>-->
     <script src="/jyapp/vipsubscribe/js/weui.min.js?v={{Msg "seo" "version"}}"></script>
     <script src="/jyapp/vipsubscribe/js/common.js?v={{Msg "seo" "version"}}3"></script>
     <script src="/jyapp/js/common.js?v={{Msg "seo" "version"}}"></script>
@@ -353,6 +300,16 @@
 	        	sessionStorage.removeItem("vipSubSelectIndustryUpgrade");
 	        }
         }
+        if(sessionStorage.vipSubSelectIndustryAdd!==undefined&&sessionStorage.vipSubSelectIndustryAdd!==""){
+        	if(checkObj(JSON.parse(sessionStorage.vipSubSelectIndustryAdd))){
+	        	sessionStorage.removeItem("vipSubSelectIndustryAdd");
+	        }
+        }
+        if(sessionStorage.vipSubSelectAreaAdd!==undefined&&sessionStorage.vipSubSelectAreaAdd!==""){
+        	if(checkObj(JSON.parse(sessionStorage.vipSubSelectAreaAdd))){
+	        	sessionStorage.removeItem("vipSubSelectAreaAdd");
+	        }
+        }
         //
 		var monthPrice = "";
         var yearPrice = "";
@@ -383,57 +340,7 @@
 //          console.log(checkValue);
             $('.pay_way').hide(200);
             $('.pay_mode .select_payment .choose_way.info').html(checkValue);
-        });
-         // 选择生效日期
-//      $('.choose_effect_date > a').click(function () {
-//          $('#effective_date').show(200);
-//			var nowMonths = new Date().getMonth()+1;
-//			var nowYears = new Date().getFullYear();
-//			var as = nowMonths +1;
-//			if(as > 12){
-//				as = as-12;
-//				nowYears = nowYears +1;
-//			}
-//			var bs = nowYears+"/"+as+"/1";
-//			var effects = new Date(bs).getTime() /1000;
-//			var a = nowYears+"."+as+".01";
-//			$(".notnownow").text(a + " - " + endTime.replace(/-/g, "."))
-//			if(ends < effects){
-//				$(".effect_next").hide();
-////				$(".box").css("height", "2.7rem");
-//			}
-//      })
-//      //
-//		var effectiveName = new Date().getMonth()+2;
-//		if(effectiveName > 12){
-//	    	effectiveName = effectiveName - 12
-//	   	}
-//		var effectiveNames = effectiveName+"月1日生效"
-//		$(".effective_name.notnow").text(effectiveNames);
-//		$('#nextMonth').val(effectiveNames);
-//		
-//      // 对生效日期方式选择的input绑定点击事件
-//      $('#effective_date input:radio[name="date"]').click(function () {
-//          var checkValue = $('input:radio[name="date"]:checked').val();
-////          console.log(checkValue);
-//          $('#effective_date').hide(200);
-//          var effective = "";
-//          var effectiveName = new Date().getMonth()+2;
-//          if(effectiveName > 12){
-//	    		effectiveName = effectiveName - 12
-//	    	}
-//          var effectiveNames = effectiveName+"月1日生效"
-//          if(checkValue === "立即生效,需支付当月费用差价"){
-//          	effective = "now";
-//          }else if(checkValue === effectiveNames){
-//          	effective = "notnow";
-//          }
-//          sessionStorage.effectiveDate = effective;
-//          $('#effect_date_name').html(checkValue);
-//          FinallyPrice();
-//      });
-        
-        
+       });
         // 选择周期
         $('.lengthen > a').click(function () {
         	if((nowRenew)>=36){
@@ -457,17 +364,11 @@
                 // 按月订阅
                 $('.computed_price').show()
                 // 显示隐藏tips提示
-                // $('#time_cycle .tips.monthly_tips').show();
-                // $('#time_cycle .tips.yearly_tips').hide();
-
                 $('#number_box_month').addClass('active');
                 $('#number_box_year span').removeClass('active');
             } else if($(e.target).hasClass('yearly')){
                 $('.computed_price').show()
                 // 按年订阅
-                // $('#time_cycle .tips.yearly_tips').show();
-                // $('#time_cycle .tips.monthly_tips').hide();
-
                 $('#number_box_month').removeClass('active');
             }else{
                 $('.computed_price').hide()
@@ -538,11 +439,6 @@
             $('.computed_price').html('¥' + price)
             var firstButton = $('#number_box_month button:first')
             var lastButton = $('#number_box_month button:last')
-//          if (currentNum >= 10) {
-//              $('.profit_tips').show()
-//          } else {
-//              $('.profit_tips').hide()
-//          }
             // 如果为操作后的结果为1,则锁定减号按钮
             if (currentNum === data.numboxMin) {
                 firstButton.attr('disabled', true)
@@ -697,43 +593,24 @@
         	$("#buy").prop("checked", bCheck);
         }
         //新增区域
-	    if(sessionStorage.vipSubSelectAreaUpgrade!==""&&sessionStorage.vipSubSelectAreaUpgrade!==undefined){
-			var vipSubSelectArea = JSON.parse(sessionStorage.vipSubSelectAreaUpgrade);
-			var provinceArr = [];
-			var cityArr = [];
-			var isAll = "";
-			$(".area-list").show();
-			for (var province in vipSubSelectArea){
-				if(vipSubSelectArea[province].length > 0){
-					var citys = vipSubSelectArea[province];
-					for (var i in citys){
-						var city = citys[i];
-						cityArr.push(city);
-					}
-				}else{
-					provinceArr.push(province);
-				}
-				if(province === "全国"){
-					isAll = "all";
-				}
-			}
-			var provinceLen = provinceArr.length;
-			var cityLen = cityArr.length;
-			if(isAll === ""){
-				$(".area-list").text("已新增 "+ provinceLen +" 个省级区域、"+ cityLen +" 个地市");
+	    if(sessionStorage.vipSubSelectAreaAdd!==""&&sessionStorage.vipSubSelectAreaAdd!==undefined&&sessionStorage.vipSubSelectCity!==undefined&&sessionStorage.vipSubSelectCity!==""){
+			var vipSubSelectArea = JSON.parse(sessionStorage.vipSubSelectAreaAdd);
+			let cityLen = sessionStorage.vipSubSelectCity;
+			if(vipSubSelectArea.country === -1){
+				areaHtml = "已新增全国";
+				$("#area").attr("placeholder", areaHtml);
 			}else{
-				$(".area-list").text("已新增为 : 全国");
-			}
-			if(provinceLen === 0 && cityLen === 0){
-				$(".area-list").hide();
+				areaHtml = "已新增 "+ vipSubSelectArea.province +" 个省级区域、"+ cityLen +" 个地市";
+				$("#area").attr("placeholder", areaHtml);
 			}
 	    }
 	    //新增行业
-	    if(sessionStorage.vipSubSelectIndustryUpgrade!==""&&sessionStorage.vipSubSelectIndustryUpgrade!==undefined){
-	    	var vipSubSelectIndustry = JSON.parse(sessionStorage.vipSubSelectIndustryUpgrade);
+	    if(sessionStorage.vipSubSelectIndustryAdd!==""&&sessionStorage.vipSubSelectIndustryAdd!==undefined){
+	    	var vipSubSelectIndustry = JSON.parse(sessionStorage.vipSubSelectIndustryAdd);
 	    	var industryArr = [];
 	    	var isAll = "";
-	    	$(".industry-list").show();
+	    	var industryHtml = "";
+//	    	$(".industry-list").show();
 	    	for(var i in vipSubSelectIndustry){
 	    		var industry = vipSubSelectIndustry[i];
 	    		industryArr.push(industry);
@@ -743,34 +620,17 @@
 	    	}
 	    	var industryLen = industryArr.length
 	    	if(isAll === ""){
-				$(".industry-list").text("已新增 "+ industryLen +" 个行业");
+	    		industryHtml = "已新增 "+ industryLen +" 个行业";
+				$("#buyerclass").attr("placeholder", industryHtml);
 			}else{
-				$(".industry-list").text("已新增为 : 全部行业");
+				industryHtml = "已新增全行业";
+				$("#buyerclass").attr("placeholder", industryHtml);
 			}
 			if(industryLen === 0){
-				$(".industry-list").hide();
+				industryHtml = "选择升级行业";
+				$("#buyerclass").attr("placeholder", industryHtml);
 			}
 	    }
-	    //生效时间
-//	    if(sessionStorage.effectiveDate !== ""&&sessionStorage.effectiveDate!==undefined){
-//	    	var effective = sessionStorage.effectiveDate;
-//	    	var effectiveHtml = "";
-//	    	if(effective === "now"){
-//	    		effectiveHtml = "立即生效,需支付当月费用差价";
-//	    	}else if(effective === "notnow"){
-//	    		var effectiveName = new Date().getMonth()+2;
-//	    		if(effectiveName > 12){
-//	    			effectiveName = effectiveName - 12
-//	    		}
-//	    		effectiveHtml = effectiveName+"月1日生效";
-//	    	}
-//	    	$(".effective_name").each(function(){
-//	    		if($(this).text() === effectiveHtml){
-//	    			$(this).parent().next().find("input").prop("checked", true);
-//	    		}
-//	    	})
-//	    	$('#effect_date_name').html(effectiveHtml);
-//	    }
         //支付方式
 	    if(sessionStorage.payType!==""&&sessionStorage.payType!==undefined){
 	    	var payType = sessionStorage.payType;
@@ -823,6 +683,8 @@
 	 	//
 	 	var area = "";
 	    var buyerclass = "";
+	    var buyArea = "";
+	    var buyIndustry = "";
 	    var cycleunit = "";
 	    var cyclecount = "";
 	 	var startTime = "";
@@ -831,57 +693,16 @@
 	    var ends = "";
 	 	$DoPost("/subscribepay/renewUpgrade/getBuyMsg", {}, function (data) {
             if (data) {
-                area = data.allarea;
-			    buyerclass = data.allindustry;
+                area = data.area;
+			    buyerclass = data.buyerclass;
+			    buyArea = data.allarea;
+			    buyIndustry = data.allindustry;
 			    cycleunit = data.cycleunit;
 			    cyclecount = data.cyclecount;
 			    startTime = data.start;
 			    starts = data.starttime;
 			    endTime = data.end;
 			    ends = data.endtime;
-			    //
-//			    var areaArr = [];
-//			    var areaHtml = "";
-//			    var buyerclassArr = [];
-//			    var buyerclassHtml = "";
-//		//	    var dateName = "";
-//		//	    var dateHtml = "";
-//			    if (area !== "" && area !== undefined){
-//			    	for(var province in area){
-//			    		var citys = area[province]
-//		//	    		console.log(citys);
-//			    		if(citys.length===0){
-//			    			areaArr.push(province);
-//			    		}else{
-//			    			for(var i in citys){
-//			    				areaArr.push(citys[i]);
-//			    			}
-//			    		}
-//			    	}
-//			    	areaHtml = areaArr.toString().replace(/,/g, " ");
-//		//	    	$(".item_area .label_for").text(areaHtml);
-//					if(checkObj(area)){
-//						areaHtml = "全国";
-//					}
-//			    	$('#area').attr("placeholder",areaHtml);
-//			    }
-//			    if(buyerclass !== "" && buyerclass !== undefined){
-//			    	for(var i in buyerclass){
-//			    		var industry = buyerclass[i];
-//			    		buyerclassArr.push(industry);
-//			    		buyerclassHtml = buyerclassArr.toString().replace(/,/g, " ");
-//			    	}
-//		//	    	$(".item_industry .label_for").text(buyerclassHtml);
-//					if(checkObj(buyerclass)){
-//						buyerclassHtml = "全行业";
-//					}
-//					$('#buyerclass').attr("placeholder",buyerclassHtml);
-//			    }
-			    //
-//			    var nowDate = data.now.replace(/-/g, ".");
-//			    var a = nowDate+ " - " +endTime;
-//			    $(".nownow").text(nowDate+ " - " +endTime.replace(/-/g, "."))
-			    
 			}
         },false);
         //
@@ -890,6 +711,7 @@
         var oldYearPrice = 0;
         var oldMonthPrice = 0;
         var areasArr = {};
+        var areas_arr = {};
 	    var industrysArr = [];
 	    var allArea = {};
 	    var allIndustry = [];
@@ -923,19 +745,16 @@
 				for(let province in vipArea){
 		    		let citys = vipArea[province];
 		    		if(citys.length===0){
-						areasArr[province] = [];
+						areas_arr[province] = [];
 		    		}else{
-		    			areasArr[province] = citys;
+		    			areas_arr[province] = citys;
 		    		}
 		    	}
 				for(let province in vipArea){
 		    		if(province === "全国"){
-						areasArr = {"全国":[]};
+						areas_arr = {"全国":[]};
 					}
 		    	}
-				if(buyCheck){
-					$(".save_upgrade").removeAttr("disabled");
-				}
 				if(area !== ""&&area !== undefined){
 					for(let province in area){
 			    		let citys = area[province];
@@ -974,11 +793,20 @@
 						}
 					}
 				}
+				if(sessionStorage.vipSubSelectAreaAdd!==""&&sessionStorage.vipSubSelectAreaAdd!==undefined){
+					areasArr = addAreaObj();
+				}else{
+					areasArr = null;
+				}
+				if(buyCheck){
+					$(".save_upgrade").removeAttr("disabled");
+				}
 			}else{
-				areasArr = null;
-				if(area !== ""&&area !== undefined){
-					for(let province in area){
-			    		let citys = area[province];
+				areas_arr = null
+				areasArr = null
+				if(buyArea !== ""&&buyArea !== undefined){
+					for(let province in buyArea){
+			    		let citys = buyArea[province];
 			    		if(citys.length===0){
 							allArea[province] = [];
 			    		}else{
@@ -987,63 +815,20 @@
 			    	}
 				}
 			}
-//			if(sessionStorage.vipSubSelectAreaUpgrade!==""&&sessionStorage.vipSubSelectAreaUpgrade!==undefined){
-//				var vipArea = JSON.parse(sessionStorage.vipSubSelectAreaUpgrade);
-//				if(area !== ""&&area !== undefined){
-//					for(let province in area){
-//			    		let citys = area[province];
-//			    		if(citys.length===0){
-//							areasArr[province] = [];
-//			    		}else{
-//			    			areasArr[province] = citys;
-//			    		}
-//			    	}
-//					for(let province in vipArea){
-//						let citys = vipArea[province];
-//						if(areasArr[province] === undefined){
-//							areasArr[province] = citys
-//						}else{
-//							let cityArr = [];
-//							for(let i in citys){
-//								cityArr.push(citys[i]);
-//							}
-//							for(let i in areasArr[province]){
-//								cityArr.push(areasArr[province][i]);
-//							}
-//							//
-//							for (var x = 0; x < cityArr.length; x++) {
-//					            for (var j =x+1; j <cityArr.length; ) {
-//					                if (cityArr[x] === cityArr[j]){
-//					                    cityArr.splice(j, 1);
-//					                }
-//					                else j++;
-//					            }
-//					       	}
-//							//
-//							areasArr[province] = cityArr;
-//						}
-//						if(province === "全国"){
-//							areasArr = {"全国":[]};
-//						}
-//					}
-//				}
-//				console.log($(".save_upgrade").attr("disabled"))
-//				if(buyCheck){
-//					$(".save_upgrade").removeAttr("disabled");
-//				}
-//			}else{
-//				if(area !== ""&&area !== undefined){
-//					for(let province in area){
-//			    		let citys = area[province];
-//			    		if(citys.length===0){
-//							areasArr[province] = [];
-//			    		}else{
-//			    			areasArr[province] = citys;
-//			    		}
-//			    	}
-//				}
-//			}
-
+			//
+			if(sessionStorage.vipSubSelectIndustryAdd!==""&&sessionStorage.vipSubSelectIndustryAdd!==undefined){
+				var vipIndustry = JSON.parse(sessionStorage.vipSubSelectIndustryAdd);
+				for(let i in vipIndustry){
+		    		let industry = vipIndustry[i];
+		    		industrysArr.push(industry);
+		        }
+				for(let i in vipIndustry){
+					if(industry === "全部行业"){
+						industrysArr = ["全部行业"];
+					}
+				}
+			}
+			//
 			console.log("areasArr",areasArr)
 			if(sessionStorage.vipSubSelectIndustryAdd!==""&&sessionStorage.vipSubSelectIndustryAdd!==undefined){
 				var vipIndustry = JSON.parse(sessionStorage.vipSubSelectIndustryAdd);
@@ -1056,6 +841,12 @@
 						industrysArr = ["全部行业"];
 					}
 				}
+			}else{
+				industrysArr = null;
+			}
+			
+			if(sessionStorage.vipSubSelectIndustryUpgrade!==""&&sessionStorage.vipSubSelectIndustryUpgrade!==undefined){
+				var vipIndustry = JSON.parse(sessionStorage.vipSubSelectIndustryUpgrade);
 				if(buyerclass!==""&&buyerclass!==undefined){
 					for(let i in buyerclass){
 			    		let industry = buyerclass[i];
@@ -1073,41 +864,14 @@
 					$(".save_upgrade").removeAttr("disabled");
 				}
 			}else{
-				industrysArr = null;
-				if(buyerclass!==""&&buyerclass!==undefined){
-					for(let i in buyerclass){
-			    		let industry = buyerclass[i];
+				if(buyIndustry!==""&&buyIndustry!==undefined){
+					for(let i in buyIndustry){
+			    		let industry = buyIndustry[i];
 			    		allIndustry.push(industry);
 			    	}
 			    }
 			}
-			
-//			if(sessionStorage.vipSubSelectIndustryUpgrade!==""&&sessionStorage.vipSubSelectIndustryUpgrade!==undefined){
-//				var vipIndustry = JSON.parse(sessionStorage.vipSubSelectIndustryUpgrade);
-//				if(buyerclass!==""&&buyerclass!==undefined){
-//					for(let i in buyerclass){
-//			    		let industry = buyerclass[i];
-//			    		industrysArr.push(industry);
-//			        }
-//					for(let i in vipIndustry){
-//						let industry = vipIndustry[i];
-//						industrysArr.push(industry);
-//						if(industry === "全部行业"){
-//							industrysArr = ["全部行业"];
-//						}
-//					}
-//				}
-//				if(buyCheck){
-//					$(".save_upgrade").removeAttr("disabled");
-//				}
-//			}else{
-//				if(buyerclass!==""&&buyerclass!==undefined){
-//					for(let i in buyerclass){
-//			    		let industry = buyerclass[i];
-//			    		industrysArr.push(industry);
-//			    	}
-//			    }
-//			}
+			//
 			if(industrysArr !== null){
 				for (var x = 0; x < industrysArr.length; x++) {
 		            for (var j =x+1; j <industrysArr.length; ) {
@@ -1128,16 +892,6 @@
 	       	}
 			
 			console.log("industrysArr",industrysArr);
-//			if(sessionStorage.effectiveDate !== ""&&sessionStorage.effectiveDate!==undefined){
-//				let eff = sessionStorage.effectiveDate;
-//				if(eff === "now"){
-//					effect = "now";
-//				}else{
-//					effect = "notnow";
-//				}
-//			}else{
-//				effect = "now";
-//			}
 			//
 			if(endYear === nowYear){
 				if(endMonth === nowMonth){
@@ -1173,14 +927,6 @@
 			nowRenew = nowUpgrade;
 			console.log("monthold",nowUpgrade)
 			//
-//			if(effect === "notnow"){
-//				nowUpgrade = nowUpgrade -1;
-//			}
-//			if(nowUpgrade == 0){
-//				nowUpgrade = 1;
-//			}
-			
-			//
 			var nowUpgradeYear = 0;
 			if(nowUpgrade >= 12 && nowUpgrade < 24){
 				nowUpgradeYear = Math.floor(nowUpgrade / 12);
@@ -1197,8 +943,8 @@
 			console.log("month",nowUpgrade)
 			//
 			if (nowUpgradeYear >= 1) {
-				let monthprice = getsubVipOrderPrice(area, buyerclass, [nowUpgrade, 2])
-				let yearprice = getsubVipOrderPrice(area, buyerclass, [nowUpgradeYear, 1])
+				let monthprice = getsubVipOrderPrice(buyArea, buyIndustry, [nowUpgrade, 2])
+				let yearprice = getsubVipOrderPrice(buyArea, buyIndustry, [nowUpgradeYear, 1])
 				oldPrice = yearprice + monthprice
 				if (monthprice == 0) {
 					oldMonthPrice = ((yearprice / nowUpgradeYear) / 10).toFixed(1);
@@ -1208,7 +954,7 @@
 					oldYearPrice = ((monthprice / nowUpgrade) * 10).toFixed(1);
 				}
 			} else {
-				oldPrice = getsubVipOrderPrice(area, buyerclass, [nowUpgrade, 2])
+				oldPrice = getsubVipOrderPrice(buyArea, buyIndustry, [nowUpgrade, 2])
 				oldMonthPrice = (oldPrice / nowUpgrade)
 				oldYearPrice = ((oldPrice / nowUpgrade) * 10).toFixed(1);
 			}
@@ -1228,12 +974,12 @@
 					addAreaPriceM = getsubVipOrderPrice(areasArr,industrysArr,[nowUpgrade,2]);
 				}
 				if(areasArr !== null){
-					oldAreaPriceY = getsubVipOrderPrice(areasArr,buyerclass,[nowUpgradeYear,1]);
-					oldAreaPriceM = getsubVipOrderPrice(areasArr,buyerclass,[nowUpgrade,2]);
+					oldAreaPriceY = getsubVipOrderPrice(areasArr,buyIndustry,[nowUpgradeYear,1]);
+					oldAreaPriceM = getsubVipOrderPrice(areasArr,buyIndustry,[nowUpgrade,2]);
 				}
 				if(industrysArr !== null){
-					addIndustryPriceY = getsubVipOrderPrice(area,industrysArr,[nowUpgradeYear,1]);
-					addIndustryPriceM = getsubVipOrderPrice(area,industrysArr,[nowUpgrade,2]);
+					addIndustryPriceY = getsubVipOrderPrice(buyArea,industrysArr,[nowUpgradeYear,1]);
+					addIndustryPriceM = getsubVipOrderPrice(buyArea,industrysArr,[nowUpgrade,2]);
 				}
 				let yearprice = getsubVipOrderPrice(allArea,allIndustry,[nowUpgradeYear,1]);
 				let monthprice = getsubVipOrderPrice(allArea,allIndustry,[nowUpgrade,2]);
@@ -1259,10 +1005,10 @@
 					addAreaPriceM = getsubVipOrderPrice(areasArr,industrysArr,[nowUpgrade,2]);
 				}
 				if(areasArr !== null){
-					oldAreaPriceM = getsubVipOrderPrice(areasArr,buyerclass,[nowUpgrade,2]);
+					oldAreaPriceM = getsubVipOrderPrice(areasArr,buyIndustry,[nowUpgrade,2]);
 				}
 				if(industrysArr !== null){
-					addIndustryPriceM = getsubVipOrderPrice(area,industrysArr,[nowUpgrade,2]);
+					addIndustryPriceM = getsubVipOrderPrice(buyArea,industrysArr,[nowUpgrade,2]);
 				}
 				let monthprice = getsubVipOrderPrice(allArea,allIndustry,[nowUpgrade,2]);
 //				price = getsubVipOrderPrice(areasArr,industrysArr,[nowUpgrade,2]);
@@ -1285,6 +1031,9 @@
 					sessionStorage.upgrade_price = "¥"+price;
 					sessionStorage.proPrice = price;
 				}else if(sessionStorage.upgrade_cycleunit === "2"){
+					if(Number(sessionStorage.upgrade_cyclecount)>10){
+						sessionStorage.upgrade_cyclecount = 10;
+					}
 					let price = (Number(sessionStorage.upgrade_cyclecount)*completeMonth).toFixed(1);
 					sessionStorage.upgrade_price = "¥"+price;
 					sessionStorage.proPrice = price;
@@ -1300,10 +1049,7 @@
 				console.log("proprice",proPrice);
 				cPrice = (Number(cPrice) + Number(proPrice)).toFixed(1);
 			}
-//			if(effect === "notnow"){
-//				cPrice = cPrice -(completeMonth - oldMonthPrice);
-//			}
-			if(cPrice < 0){
+			if(cPrice <= 0){
 				cPrice = 0;
 			}
 			$(".finally_price").html("¥"+cPrice);
@@ -1325,20 +1071,7 @@
         
         //
         $(".save_upgrade").on("click", function(){
-        	$(".save_upgrade").attr("disabled","disabled")
-//      	let effective = $("#effect_date_name").text();
-//      	var effect = "now";
-//      	if(effective !== "立即生效,需支付当月费用差价"){
-//				let nowMonth = new Date().getMonth()+1;
-//				let nowYear = new Date().getFullYear();
-//				let a = nowMonth +1
-//      		if(a > 12){
-//      			a = a-12;
-//      			nowYear = nowYear +1;
-//      		}
-//      		let b = nowYear+"/"+a+"/1";
-//      		effect = new Date(b).getTime() /1000;
-//      	}
+        	$(".save_upgrade").attr("disabled","disabled");
         	//
         	let areas = areasArr;
         	let industrys = null;
@@ -1363,9 +1096,18 @@
         	}else{
         		industryArr = "no";
         	}
+        	//
+        	if(areas_arr !== null){
+        		if(areas_arr["全国"]){
+	                areas_arr={};
+	            }
+        		areas_arr = JSON.stringify(areas_arr);
+        	}else{
+        		areas_arr = "no";
+        	}
             //
-            let areaarr = area;
-        	let industryarr = buyerclass;
+            let areaarr = buyArea;
+        	let industryarr = buyIndustry;
         	let allAreaArr = allArea;
         	let allIndustryArr = allIndustry;
         	if(allAreaArr["全国"]){
@@ -1381,6 +1123,19 @@
             	times = $('.choose_item.lengthen .info').text();
             }
             //
+            let vipCount = null;
+            if(sessionStorage.vipAddCount!==undefined&&sessionStorage.vipAddCount!==""){
+            	vipCount = JSON.stringify(JSON.parse(sessionStorage.vipAddCount));
+            }
+            let vipIndustry = 0
+            if(industrysArr!==null){
+            	if(industrysArr.length==1&&industrysArr[0]=="全部行业"){
+	                vipIndustry = -1;
+	            }else{
+	            	vipIndustry = industrysArr.length;
+	            }
+            }
+            //
             let payTypes = $(".weixin_pay").text();
             let payType = "wx_app";
             if(payTypes === "支付宝支付"){
@@ -1388,17 +1143,19 @@
             }
             //
 	    	var param = {
-	    		"area": areaArr,
+	    		"area": areas_arr,
 	    		"industry": industryArr,
 	    		"areas": JSON.stringify(areaarr),
+	    		"areas_arr": areaArr,
 	    		"industryarr": industryarr.join(","),
 	    		"allArea": JSON.stringify(allAreaArr),
 	    		"allIndustry": allIndustryArr.join(","),
-	    		"payWay": payType,
-//	    		"effect": effect,
+	    		"payWay": "wx_js",
 	    		"pay_source" : "Upgrade",
 	    		"time": times,
-//	    		"nowUp": Number(nowRenew),
+	    		"addCount":vipCount,
+	    		"addIndustryCount": vipIndustry,
+	    		"payWay": payType,
 	    	}
 	    	console.log(param)
 	    	$DoPost("/subscribepay/renewUpgrade/renewUpgradeCreateOrder", param, function (r) {
@@ -1432,7 +1189,9 @@
 	    	sessionStorage.removeItem("vipSubSelectAreaUpgrade");
 	    	sessionStorage.removeItem("vipSubSelectIndustryUpgrade");
 	    	sessionStorage.removeItem("vipSubSelectIndustryAdd");
-//	    	sessionStorage.removeItem("effectiveDate");
+	    	sessionStorage.removeItem("vipSubSelectAreaAdd");
+	    	sessionStorage.removeItem("vipAddCount");
+	    	sessionStorage.removeItem("vipSubSelectCity");
 	    	sessionStorage.removeItem("buyCheck");
 	    }
 	    //
@@ -1465,6 +1224,47 @@
 		    }
 		    return false;
 		}
+	    //
+	    function addAreaObj(){
+	    	let areaObj = JSON.parse(sessionStorage.vipSubSelectAreaUpgrade)
+	    	let buyset = JSON.parse(sessionStorage.vipSubSelectAreaAdd)
+	    	//
+	    	let provinceArr = [];
+	    	let areasObj = {};
+	    	if(buyset.country === -1){
+	    		areasObj["全国"] = [];
+	    	}else{
+	    		for(let province in areaObj){
+	//	    		console.log("666666",buyset.citys[province]);
+					let cityLen = areaObj[province].length
+		    		if(cityLen === 0){
+		    			provinceArr.push(province);
+		    		}else{
+		    			let citys = areaObj[province];
+		    			for(let i in buyset.city){
+		    				let cityCount = buyset.city[i];
+		    				if(province === i){
+		    					if(cityLen > cityCount){
+					    			let reduce = cityLen - cityCount;
+					    			areasObj[province] = citys.slice(0, -reduce);
+					    		}
+		    				}
+		    			}
+		    		}
+		    	}
+	    		if(provinceArr.length > buyset.province){
+	    			let reduce = provinceArr.length - buyset.province;
+	    			provinceArr = provinceArr.slice(0, -reduce);
+	    		}
+	    		console.log(provinceArr)
+	    		for(let a in provinceArr){
+	    			let province = provinceArr[a];
+	    			areasObj[province] = [];
+	    		}
+	    		console.log(areasObj)
+	    	}
+	    	return areasObj
+	    }
 	    
     </script>
 </body>

+ 9 - 7
src/jfw/modules/subscribepay/src/entity/dataExportSearch.go

@@ -47,13 +47,15 @@ type SieveCondition struct {
 
 //VIP订单
 type VipFilter struct {
-	Area        map[string]interface{} `json:"area"`     //地区
-	Industry    []string               `json:"industry"` //
-	Cyclecount  int                    `json:"cyclecount"`
-	Cycleunit   int                    `json:"cycleunit"`
-	Ordertype   int                    `json:"ordertype"`
-	Addarea     map[string]interface{} `json:"addarea"`     //新增地区
-	Addindustry []string               `json:"addindustry"` //新增行业
+	Area               map[string]interface{} `json:"area"`     //地区
+	Industry           []string               `json:"industry"` //
+	Cyclecount         int                    `json:"cyclecount"`
+	Cycleunit          int                    `json:"cycleunit"`
+	Ordertype          int                    `json:"ordertype"`
+	Addarea            map[string]interface{} `json:"addarea"`            //新增地区
+	Addindustry        []string               `json:"addindustry"`        //新增行业
+	Addareacount       map[string]interface{} `json:"addareacount"`       //新增地区数量
+	Addbuyerclasscount int                    `json:"addbuyerclasscount"` //新增地区数量
 }
 
 const (

+ 19 - 41
src/jfw/modules/subscribepay/src/entity/dataexport.go

@@ -342,7 +342,7 @@ func SendMailToBJFinance(order *map[string]interface{}, pay_time, transaction_id
 			//vip开发票内容
 			subscription_area, industry, subscription_cycle, effective_date, payment_number := "", "", "", "", ""
 			display_a, display_b, display_c := "none", "none", "none" //a:正常购买 b:续费 c:升级
-			city_count := 0
+			city_count, province_count := 0, 0
 			filter := qutil.ObjToString((*order)["filter"])
 			vip_starttime := qutil.ObjToString((*order)["vip_starttime"])
 			vip_endtime := qutil.ObjToString((*order)["vip_endtime"])
@@ -352,51 +352,30 @@ func SendMailToBJFinance(order *map[string]interface{}, pay_time, transaction_id
 			err := json.Unmarshal([]byte(filter), &vf)
 			if err == nil && vf != nil {
 				if vip_type == 2 { //升级查新订单
-					addarea := vf.Addarea         //区域
-					addindustry := vf.Addindustry //行业
-					log.Println(addarea)
-					//升级区域显示
-					if (addarea)["no"] != "no" {
-						addarea_upgrade := JyVipSubStruct.NewBuySet(&addarea, addindustry)
-						if addarea_upgrade != nil {
-							if addarea_upgrade.Citys != nil {
-								for _, v := range addarea_upgrade.Citys {
-									city_count += v.(int)
-								}
-							}
-							//订阅区域
-							if addarea_upgrade.AreaCount == -1 {
-								subscription_area = "全国"
-							} else {
-								if city_count != 0 && addarea_upgrade.AreaCount == 0 {
-									subscription_area = fmt.Sprintf("%d个地市", city_count)
-								} else if city_count == 0 && addarea_upgrade.AreaCount != 0 {
-									subscription_area = fmt.Sprintf("%d个省级区域", addarea_upgrade.AreaCount)
-								} else if city_count != 0 && addarea_upgrade.AreaCount != 0 {
-									subscription_area = fmt.Sprintf("%d个省级区域、%d个地市", addarea_upgrade.AreaCount, city_count)
-								}
-							}
+					addareacount := vf.Addareacount             //区域数量
+					addbuyerclasscount := vf.Addbuyerclasscount //行业数量
+					if len(addareacount) != 0 {
+						province_count = qutil.IntAll((addareacount)["province"])
+						city_count = qutil.IntAll((addareacount)["city"])
+						//升级区域显示
+						if city_count != 0 && province_count == 0 {
+							subscription_area = fmt.Sprintf("%d个地市", city_count)
+						} else if city_count == 0 && province_count != 0 {
+							subscription_area = fmt.Sprintf("%d个省级区域", province_count)
+						} else if city_count != 0 && province_count != 0 {
+							subscription_area = fmt.Sprintf("%d个省级区域、%d个地市", province_count, city_count)
+						} else if city_count == 0 && province_count == 0 {
+							subscription_area = "全国"
 						}
 					} else {
 						subscription_area = "无"
 					}
-
 					//升级行业显示
-					industry_upgrade := 0
-					if len(addindustry) != 0 {
-						if addindustry[0] != "no" { //等于no 为 无新增区域
-							industry_upgrade = len(addindustry)
-						} else {
-							industry_upgrade = -2 //无新增
-						}
-					} else {
-						industry_upgrade = -1 //全行业
-					}
-					if industry_upgrade != -1 && industry_upgrade != -2 {
-						industry = fmt.Sprintf("%d个行业", industry_upgrade)
-					} else if industry_upgrade == -2 {
+					industry = fmt.Sprintf("%d个行业", addbuyerclasscount)
+					if addbuyerclasscount == 0 {
 						industry = "无"
-					} else {
+					}
+					if addbuyerclasscount == -1 {
 						industry = "全行业"
 					}
 				} else { //非升级
@@ -465,7 +444,6 @@ func SendMailToBJFinance(order *map[string]interface{}, pay_time, transaction_id
 							subscription_cycle = fmt.Sprintf("%d年", year)
 						}
 					} else {
-						log.Println(vf.Cyclecount, "---", vf.Cycleunit)
 						if vf.Cycleunit == 1 {
 							subscription_cycle = fmt.Sprintf("%d年", vf.Cyclecount)
 						} else if vf.Cycleunit == 2 {

+ 9 - 7
src/jfw/modules/subscribepay/src/entity/subscribeVip.go

@@ -54,13 +54,15 @@ type subVipPrice struct {
 //订单简单信息
 type VipSimpleMsg struct {
 	//Id         string                  `json:"_id"`        //mgo id
-	Area        *map[string]interface{} `json:"area"`        //地区
-	Industry    []string                `json:"industry"`    //行业
-	Addarea     *map[string]interface{} `json:"addarea"`     //新增地区
-	Addindustry []string                `json:"addindustry"` //新增行业
-	Cyclecount  int                     `json:"cyclecount"`  //日期数量
-	Cycleunit   int                     `json:"cycleunit"`   //日期单位
-	OrderType   int                     `json:"ordertype"`   //类型 1:订单 2:续费 3:立即升级 4:下月升级 5:即将到期(升降级)6:升级订单未生效再次升级
+	Area               *map[string]interface{} `json:"area"`               //地区
+	Industry           []string                `json:"industry"`           //行业
+	Addarea            *map[string]interface{} `json:"addarea"`            //新增订阅地区
+	Addindustry        []string                `json:"addindustry"`        //新增订阅行业
+	Addareacount       *map[string]interface{} `json:"addareacount"`       //新增购买区域数量
+	Addbuyerclasscount int                     `json:"addbuyerclasscount"` //新增行业数量
+	Cyclecount         int                     `json:"cyclecount"`         //日期数量
+	Cycleunit          int                     `json:"cycleunit"`          //日期单位
+	OrderType          int                     `json:"ordertype"`          //类型 1:订单 2:续费 3:立即升级 4:下月升级 5:即将到期(升降级)6:升级订单未生效再次升级
 }
 
 //购买内容

+ 3 - 0
src/jfw/modules/subscribepay/src/service/orderListDetails.go

@@ -343,7 +343,10 @@ func (o *OrderListDetails) EmailOperation() {
 		if len(*res) > 0 && err {
 			if qutil.ObjToString((*res)["s_myemail"]) == "" {
 				bo = true
+			} else {
+				o.T["mail"] = qutil.ObjToString((*res)["s_myemail"])
 			}
+
 		}
 	}
 	o.T["success"] = bo

+ 38 - 52
src/jfw/modules/subscribepay/src/service/vipRenewUpgrade.go

@@ -44,7 +44,6 @@ func (this *RenewUpgrade) GetBuyMsg() {
 		now := time.Unix(time.Now().Unix(), 0).Format("2006-01-02")
 		vipStatus := (*data)["i_vip_status"]
 		buyset := vipjy["o_buyset"]
-		//		isvalidOk := true
 
 		orderdata := util.Mysql.FindOne("dataexport_order", map[string]interface{}{
 			"user_id":      userId,
@@ -86,12 +85,21 @@ func (this *RenewUpgrade) RenewUpgradeCreateOrder() {
 	areaArr := this.GetString("area")
 	var area *map[string]interface{}
 	if areaArr != "no" {
-		area = qutil.ObjToMap(this.GetString("area")) //新增区域
+		area = qutil.ObjToMap(this.GetString("area")) //新增订阅区域
 	} else {
 		area = &map[string]interface{}{
 			"no": "no",
 		}
 	}
+	areas_arr := this.GetString("areas_arr")
+	var addBuyArea *map[string]interface{}
+	if areas_arr != "no" {
+		addBuyArea = qutil.ObjToMap(this.GetString("areas_arr")) //新增购买区域
+	} else {
+		addBuyArea = &map[string]interface{}{
+			"no": "no",
+		}
+	}
 	industryArr := this.GetString("industry")
 	var industry []string
 	if industryArr != "no" {
@@ -105,12 +113,18 @@ func (this *RenewUpgrade) RenewUpgradeCreateOrder() {
 	allIndustry := strings.Split(this.GetString("allIndustry"), ",") //已购+新增行业
 	date := this.GetString("time")                                   //不延长时为空,正常为 年或月
 	payWay := this.GetString("payWay")                               //支付方式
-	log.Println("payWay", payWay)
-	//	effect := this.GetString("effect")         //升级 生效日期 立即生效-now  下月一号生效-下月一号的时间戳
-	pay_source := this.GetString("pay_source") //类型  续费-Renew or 升级-Upgrade
+	pay_source := this.GetString("pay_source")                       //类型  续费-Renew or 升级-Upgrade
+	addCount := this.GetString("addCount")
+	var vipBuyCount *map[string]interface{}
+	if addCount != "" {
+		vipBuyCount = qutil.ObjToMap(addCount) //新增购买区域数量
+	} else {
+		vipBuyCount = &map[string]interface{}{}
+	}
+	industryCount, _ := this.GetInteger("addIndustryCount")
+	log.Println("666", industryCount)
 	userId := qutil.ObjToString(this.GetSession("userId"))
 	openId := qutil.ObjToString(this.GetSession("s_m_openid"))
-	//	isvalidOk, _ := this.GetBool("isvalidOk")
 	r := func() *entity.FuncResult {
 		now := time.Now()
 		//数据校验
@@ -155,37 +169,15 @@ func (this *RenewUpgrade) RenewUpgradeCreateOrder() {
 		isRenew := true
 		if pay_source == "Upgrade" { //计算升级时间
 			isRenew = false
-			//			if effect == "now" { //立即生效
 			orderType = 3
 			startTime = time.Now()
-			//			} else { //下月生效
-			//				orderType = 4
-			//				startTime = time.Date(time.Now().Year(), time.Now().Month()+1, 1, 0, 0, 0, 0, time.Local)
-			//			}
-			//			if !isvalidOk {
-			//				orderType = 6
-			//			}
 		} else { //续费时间
 			orderType = 2 //续费操作
 			startTime = endTime
 		}
-		//		if date_unit == 1 { ///延长时间
-		//			endTime = endTime.AddDate(date_count, 0, 0)
-		//		} else if date_unit == 2 { //月
-		//			endTime = endTime.AddDate(0, date_count, 0)
-		//		}
 		if date_unit >= 1 {
 			endTime = util.GetDATE(date_unit, date_count, end)
 		}
-		//		if pay_source == "Renew" && now.Unix() > end { //到期后的续费从当前时间往后延长
-		//			startTime = now
-		//			//			if date_unit == 1 { ///延长时间
-		//			//				endTime = startTime.AddDate(date_count, 0, 0)
-		//			//			} else if date_unit == 2 { //月
-		//			//				endTime = startTime.AddDate(0, date_count, 0)
-		//			//			}
-		//			endTime = util.GetDATE(date_unit, date_count, startTime.Unix())
-		//		}
 		filter := entity.VipSimpleMsg{}
 		if pay_source == "Renew" {
 			vipjy := (*res)["o_vipjy"].(map[string]interface{})
@@ -194,6 +186,8 @@ func (this *RenewUpgrade) RenewUpgradeCreateOrder() {
 				qutil.ObjArrToStringArr(vipjy["a_buyerclass"].([]interface{})),
 				nil,
 				nil,
+				nil,
+				0,
 				date_count,
 				date_unit,
 				orderType,
@@ -204,6 +198,8 @@ func (this *RenewUpgrade) RenewUpgradeCreateOrder() {
 				allIndustry,
 				area,
 				industry,
+				vipBuyCount,
+				industryCount,
 				date_count,
 				date_unit,
 				orderType,
@@ -226,18 +222,12 @@ func (this *RenewUpgrade) RenewUpgradeCreateOrder() {
 			addIndustry := qutil.ObjArrToStringArr(vipjy["a_buyerclass"].([]interface{}))
 			buyerclasscount := vipjy["o_buyset"].(map[string]interface{})["buyerclasscount"]
 			if len(addIndustry) != 0 {
-				log.Println("buyerclasscount", buyerclasscount)
-				log.Println("addIndustry", addIndustry)
 				reduce := qutil.IntAll(buyerclasscount) - len(addIndustry)
-				log.Println("reduce", reduce)
 				if reduce > 0 {
-					log.Println("industry", industry)
 					Leng := len(industry) - reduce
 					if len(industry) > 0 {
 						if industry[0] != "no" {
-							log.Println("industry", industry)
 							industry = industry[0:Leng]
-							log.Println("industry", industry)
 						}
 					}
 				}
@@ -249,18 +239,18 @@ func (this *RenewUpgrade) RenewUpgradeCreateOrder() {
 			oldAreaM := 0
 			addIndustryY := 0
 			addIndustryM := 0
-			if (*area)["no"] != "no" && len(industry) > 0 {
+			if (*addBuyArea)["no"] != "no" && len(industry) > 0 {
 				if industry[0] != "no" {
-					addAreaY = entity.JyVipSubStruct.GetSubVipPrice(area, industry, upgradeYear, 1)
-					addAreaM = entity.JyVipSubStruct.GetSubVipPrice(area, industry, upgradeMonth, 2)
+					addAreaY = entity.JyVipSubStruct.GetSubVipPrice(addBuyArea, industry, upgradeYear, 1)
+					addAreaM = entity.JyVipSubStruct.GetSubVipPrice(addBuyArea, industry, upgradeMonth, 2)
 				}
-			} else if (*area)["no"] != "no" && len(industry) == 0 {
-				addAreaY = entity.JyVipSubStruct.GetSubVipPrice(area, industry, upgradeYear, 1)
-				addAreaM = entity.JyVipSubStruct.GetSubVipPrice(area, industry, upgradeMonth, 2)
+			} else if (*addBuyArea)["no"] != "no" && len(industry) == 0 {
+				addAreaY = entity.JyVipSubStruct.GetSubVipPrice(addBuyArea, industry, upgradeYear, 1)
+				addAreaM = entity.JyVipSubStruct.GetSubVipPrice(addBuyArea, industry, upgradeMonth, 2)
 			}
-			if (*area)["no"] != "no" {
-				oldAreaY = entity.JyVipSubStruct.GetSubVipPrice(area, industrys, upgradeYear, 1)
-				oldAreaM = entity.JyVipSubStruct.GetSubVipPrice(area, industrys, upgradeMonth, 2)
+			if (*addBuyArea)["no"] != "no" {
+				oldAreaY = entity.JyVipSubStruct.GetSubVipPrice(addBuyArea, industrys, upgradeYear, 1)
+				oldAreaM = entity.JyVipSubStruct.GetSubVipPrice(addBuyArea, industrys, upgradeMonth, 2)
 			}
 			if len(industry) > 0 {
 				if industry[0] != "no" {
@@ -271,15 +261,6 @@ func (this *RenewUpgrade) RenewUpgradeCreateOrder() {
 				addIndustryY = entity.JyVipSubStruct.GetSubVipPrice(areas, industry, upgradeYear, 1)
 				addIndustryM = entity.JyVipSubStruct.GetSubVipPrice(areas, industry, upgradeMonth, 2)
 			}
-			//			addY := entity.JyVipSubStruct.GetSubVipPrice(area, industry, upgradeYear, 1)  //已购+新增,以年为单位的价格
-			//			addM := entity.JyVipSubStruct.GetSubVipPrice(area, industry, upgradeMonth, 2) //已购+新增,以月为单位的价格
-			//			addPrice := addM + addY                                                       //已购+新增总价格
-			//			log.Println("1", addPrice)
-			//			nowY := entity.JyVipSubStruct.GetSubVipPrice(areas, industrys, upgradeYear, 1)  //已购,以年为单位的价格
-			//			nowM := entity.JyVipSubStruct.GetSubVipPrice(areas, industrys, upgradeMonth, 2) //已购,以月为单位的价格
-			//			nowPrice := nowM + nowY                                                         //已购总价格
-			//			log.Println("2", nowPrice)
-			//			totalfee = addPrice - nowPrice //已购+新增的总价格 - 已购总价格 = 升级差价
 			totalfee = addAreaY + addAreaM + oldAreaY + oldAreaM + addIndustryY + addIndustryM
 			if date_unit == 1 { //升级中的延长时间
 				lengPrice := entity.JyVipSubStruct.GetSubVipPrice(allArea, allIndustry, date_count, 1) //单位为年的已购+新增延长时间价格
@@ -362,6 +343,11 @@ func (this *RenewUpgrade) RenewUpgradeCreateOrder() {
 		if orderid == -1 {
 			return &entity.FuncResult{false, errors.New("数据库操作异常"), nil}
 		}
+		if isRenew {
+			util.MsgRemind.Add(qutil.IntAll(orderid), totalfee, 1, 0, ordercode, userId, now.Unix())
+		} else {
+			util.MsgRemind.Add(qutil.IntAll(orderid), totalfee, 2, 0, ordercode, userId, now.Unix())
+		}
 		return &entity.FuncResult{true, nil, map[string]interface{}{"code": ordercode, "res": payStr}}
 	}()
 	if r.Err != nil {

+ 2 - 0
src/jfw/modules/subscribepay/src/service/vipSubscribePay.go

@@ -65,6 +65,8 @@ func (this *SubVipPayOrder) CreateOrder() {
 			industry,
 			nil,
 			nil,
+			nil,
+			0,
 			date_count,
 			date_unit,
 			orderType,

+ 2 - 0
src/jfw/modules/subscribepay/src/service/vipSubscribeTrial.go

@@ -286,6 +286,8 @@ func (this *TrialOrder) TrialPay() {
 			industry,
 			nil,
 			nil,
+			nil,
+			0,
 			date_count,
 			date_unit,
 			0,

+ 6 - 3
src/jfw/modules/subscribepay/src/util/msgremind.go

@@ -131,9 +131,12 @@ func (m *msgRemind) getVipType(vipType int) string {
 }
 
 func (m *msgRemind) run() {
-	duration := time.Duration(TimeTaskConfig.UnpaidRemind.Duration) * time.Minute
-	log.Println("未支付订单定时任务run after", duration)
-	time.AfterFunc(duration, func() {
+	duration := TimeTaskConfig.UnpaidRemind.Duration
+	if duration == 0 {
+		duration = 10
+	}
+	log.Println("未支付订单定时任务run after", duration, "m")
+	time.AfterFunc(time.Duration(duration)*time.Minute, func() {
 		defer util.Catch()
 		m.unpaidOrders.Range(func(k interface{}, v interface{}) bool {
 			orderId, _ := k.(int)

+ 1 - 1
src/jfw/modules/weixin/src/config.json

@@ -56,7 +56,7 @@
         "project_repeat": "您已关注过此项目 “%s”。<a href='%s'>点击此处查看我关注的项目列表信息。</a>",
         "project_fail": "抱歉!无法添加项目“%s”,<a href='%s'>因为您关注的项目,达到了系统上限,您可以点击此处删除多余的项目,然后重新添加。</a>"
     },
-    "vipSubscribeReply": {
+	"vipSubscribeReply": {
         "href":"/front/vipsubscribe/introducePage",
         "content":"<a href='%s'>点击立即体验VIP订阅。</a>"
     },

+ 6 - 2
src/jfw/modules/weixin/src/wx/wx.go

@@ -1256,9 +1256,13 @@ func CreateMenu(rw http.ResponseWriter, r *http.Request) {
 	menu.Buttons[2].Name = "发现"
 	menu.Buttons[2].SubButtons = make([]MenuButton, 5)
 
-	menu.Buttons[2].SubButtons[0].Name = string(0x1F4A1) + "实验室!"
+	//	menu.Buttons[2].SubButtons[0].Name = string(0x1F4A1) + "实验室!"
+	//	menu.Buttons[2].SubButtons[0].Type = MenuButtonTypeUrl
+	//	menu.Buttons[2].SubButtons[0].Url = fmt.Sprintf(urlstr, "labindex")
+
+	menu.Buttons[2].SubButtons[0].Name = "\U0001F4BC百宝箱"
 	menu.Buttons[2].SubButtons[0].Type = MenuButtonTypeUrl
-	menu.Buttons[2].SubButtons[0].Url = fmt.Sprintf(urlstr, "labindex")
+	menu.Buttons[2].SubButtons[0].Url = fmt.Sprintf(urlstr, "treasurebox")
 
 	menu.Buttons[2].SubButtons[1].Name = string(0x1F4C1) + "我关注的项目"
 	menu.Buttons[2].SubButtons[1].Type = MenuButtonTypeUrl

+ 102 - 0
src/web/staticres/css/wx/base.css

@@ -0,0 +1,102 @@
+* {
+    -webkit-box-sizing: border-box;
+    box-sizing: border-box;
+    -webkit-overflow-scrolling: touch;
+    -webkit-tap-highlight-color:rgba(0,0,0,0);
+    -webkit-tap-highlight-color:transparent;
+}
+body, div, dl, dt, dd, ul, ol, li, h1, h2, h3, h4, h5, h6, pre, code, form, fieldset, legend, input, textarea, p, blockquote, th, td, hr, button, article, aside, details, figcaption, figure, footer, header, hgroup, menu, nav, section, sumary {
+    margin: 0;
+    padding: 0;
+}
+html,body {
+    /* max-width: 750px; */
+    -webkit-text-size-adjust: 100%;
+    margin: 0 auto;
+    height: 100%;
+    overflow-x: hidden;
+    -webkit-box-sizing: border-box;
+    box-sizing: border-box;
+    font-size: .24rem;
+    background:rgba(245,244,249,1);;
+    color: #3d3d3d;
+    font-family:  "Microsoft YaHei","Helvetica Neue", "Roboto", "Segoe UI", "PingFang SC", "Hiragino Sans GB", sans-serif;
+}
+
+ul,ol {
+    list-style: none;
+}
+/*清除输入框内阴影*/
+input,textarea,select,button{
+    outline: none;
+    border: 0;
+    -webkit-appearance: none;
+    appearance:none;
+}
+button,span,div{
+    -webkit-tap-highlight-color:rgba(0,0,0,0);
+	/* -webkit-user-modify:read-only; */
+}
+img {
+    border: 0;
+    vertical-align: middle;
+    max-width: 100%;
+    -webkit-tap-highlight-color: rgba(0, 0, 0, 0);
+}
+
+a {
+    text-decoration: none;
+    color: #3d3d3d;
+	-webkit-tap-highlight-color: rgba(255, 255, 255, 0);
+	-webkit-user-select: none;
+	-moz-user-focus: none;
+	-moz-user-select: none;
+}
+/*禁用长按页面时的弹出菜单(iOS下有效) ,img和a标签都要加*/
+img,a{
+    -webkit-touch-callout:none;
+}
+em,i{
+	font-style: normal;
+}
+/*兼容ios调取h5页面的头部*/
+.ios-head {
+    display: none;
+    position: fixed;
+    top: 0;
+    padding-top: 15px;
+    background: #18974b;
+    width: 100%;
+    z-index: 100;
+}
+/*base*/
+.clearfix{
+    zoom: 1;
+}
+.clearfix:after{
+    clear: both;
+    height: 0;
+    overflow: hidden;
+    display: block;
+    visibility: hidden;
+    content: "";
+}
+
+.left {
+    float: left;
+}
+
+.right {
+    float: right;
+}
+.ellipsis {
+    overflow:hidden;
+    text-overflow:ellipsis;
+    white-space:nowrap;
+}
+.show{
+	display: block;
+}
+.hide{
+	display: none;
+}

+ 237 - 0
src/web/staticres/css/wx/home.css

@@ -0,0 +1,237 @@
+.home {
+  min-height: 100%;
+  background: #F4F4F9;
+}
+
+.home .top {
+  width: 100%;
+  height: 5.06rem;
+  padding-top: .99rem;
+  background: linear-gradient(#31cbe0, white);
+}
+
+.home .top .home_search {
+  display: flex;
+  justify-content: space-between;
+  align-items: center;
+  height: .96rem;
+  margin: 0 .2rem;
+  padding: 0 .2rem 0 .24rem;
+  background: #fff;
+  border-radius: 0.06rem;
+}
+
+.home .top .home_search .home_search_left {
+  display: flex;
+  align-items: center;
+}
+
+.home .top .home_search .home_search_left span {
+  font-size: .32rem;
+  color: #888888;
+  margin-left: .16rem;
+}
+
+.home .top .home_search .home_search_right {
+  position: relative;
+  padding-left: .2rem;
+}
+
+.home .top .home_search .home_search_right:before {
+  position: absolute;
+  content: '';
+  top: 0;
+  left: 0;
+  width: 1px;
+  height: 100%;
+  background: #E0E0E0;
+  transform-origin: 0 0;
+  transform: scaleX(0.5);
+}
+
+.home .top .home_search .icon_search, .home .top .home_search .icon_question {
+  width: .48rem;
+  height: .48rem;
+}
+
+.home .top .home_banner {
+  margin-top: .36rem;
+  padding: 0 .3rem;
+}
+
+.home .top .home_banner .lunbo {
+  width: 100%;
+  height: 2.75rem;
+}
+
+.home .top .home_banner .lunbo .swiper-slide a {
+  display: block;
+  width: 100%;
+}
+
+.home .top .home_banner .lunbo .swiper-slide a img {
+  display: block;
+  margin: 0 auto;
+}
+
+.home .top .home_banner .lunbo .custorm_dot {
+  bottom: 0;
+}
+
+.home .top .home_banner .lunbo .custorm_dot .swiper-pagination-bullet {
+  width: 0.08rem;
+  height: 0.08rem;
+  background: #fff;
+  opacity: 0.6;
+}
+
+.home .top .home_banner .lunbo .custorm_dot .swiper-pagination-bullet-active {
+  background: #fff;
+  opacity: 1;
+}
+
+.home .home_tab {
+  padding: .5rem 0 .56rem;
+  border-bottom: 1px solid #F2F2F2;
+  background: #fff;
+}
+
+.home .home_tab .tab_container {
+  display: flex;
+  justify-content: space-between;
+  align-items: center;
+}
+
+.home .home_tab .tab_container .tab_item {
+  flex: 1;
+  display: flex;
+  flex-direction: column;
+  align-items: center;
+  text-align: center;
+}
+
+.home .home_tab .tab_container .tab_item img {
+  width: .96rem;
+  height: .96rem;
+}
+
+.home .home_tab .tab_container .tab_item span {
+  margin-top: .16rem;
+  font-size: .26rem;
+  color: #1D1D1D;
+}
+
+.home .home_data {
+  background: #fff;
+}
+
+.home .home_data .data_nav {
+  padding: .32rem .3rem 0.08rem;
+  font-size: .4rem;
+  color: #1D1D1D;
+font-weight: bold;
+}
+
+.home .home_data .data_list {
+  padding: 0 .3rem;
+}
+
+.home .home_data .data_list .list_item {
+  padding: .3rem 0 .36rem;
+  border-bottom: 1px solid #F2F2F2;
+}
+
+.home .home_data .data_list .list_title {
+  display: flex;
+  font-size: .32rem;
+  text-align: justify;
+}
+
+.home .home_data .data_list .list_info {
+  display: flex;
+  justify-content: space-between;
+  align-items: center;
+  margin-top: .36rem;
+}
+
+.home .home_data .data_list .tags {
+  display: flex;
+  align-items: center;
+  padding-left: .4rem;
+}
+
+.home .home_data .data_list .tags > div {
+  padding: 0 0.08rem;
+  height: .36rem;
+  line-height: .36rem;
+  text-align: center;
+  margin-right: .1rem;
+  border-radius: 0.04rem;
+  background: #F4F4F9;
+  color: #686868;
+  font-size: .24rem;
+}
+
+.home .home_data .data_list .timer {
+  color: #888888;
+  font-size: .24rem;
+}
+
+.home .no_data {
+  padding: .16rem 0;
+  text-align: center;
+}
+
+.home .no_data img {
+  width: 1.96rem;
+  height: 1.96rem;
+}
+
+.home .no_data p {
+  padding: .43rem 0 .24rem;
+  color: #686868;
+  font-size: .26rem;
+}
+
+.home .no_data a {
+  display: inline-block;
+  padding: 0 .32rem;
+  height: .64rem;
+  line-height: .64rem;
+  background: #2CB7CA;
+  color: #fff;
+  font-size: .28rem;
+  border-radius: 0.06rem;
+}
+
+.home .tips .tips_text {
+  padding: .48rem 0 .24rem;
+  color: #686868;
+  font-size: .26rem;
+  text-align: center;
+}
+
+.home .tips .tips_all {
+  padding: .26rem 0;
+  text-align: center;
+}
+
+.home .tips .tips_all a {
+  color: #2CB7CA;
+}
+
+.home .tips .tips_btn {
+  margin-bottom: .48rem;
+  text-align: center;
+}
+
+.home .tips .tips_btn a {
+  display: inline-block;
+  padding: 0 .32rem;
+  height: .64rem;
+  line-height: .64rem;
+  background: #2CB7CA;
+  color: #fff;
+  font-size: .28rem;
+  border-radius: 0.06rem;
+}

+ 165 - 0
src/web/staticres/css/wx/personal.css

@@ -0,0 +1,165 @@
+.personal {
+/*  padding-top: .88rem;*/
+}
+
+.personal .navbar {
+  position: fixed;
+  top: 0;
+  left: 0;
+  width: 100%;
+  height: .88rem;
+  padding: 0 .32rem;
+  display: flex;
+  justify-content: space-between;
+  align-items: center;
+  background: #fff;
+  z-index: 999;
+}
+
+.personal .navbar .navbar_left {
+  font-size: .4rem;
+  font-weight: bold;
+  color: #1D1D1D;
+}
+
+.personal .navbar .navbar_right {
+  display: flex;
+  align-items: center;
+}
+
+.personal .navbar .navbar_right img {
+  width: .48rem;
+  height: .48rem;
+  margin-left: .4rem;
+}
+
+.personal .user {
+  display: flex;
+  align-items: center;
+  padding: .4rem .42rem .56rem;
+  background: #fff;
+}
+
+.personal .user .user_img {
+  width: 1.2rem;
+  height: 1.2rem;
+  margin-right: .32rem;
+  border-radius: 50%;
+  border: 1px solid #2FC4D9;
+  overflow: hidden;
+  opacity: 0.8;
+}
+
+.personal .user .user_img img {
+  width: 100%;
+  height: 100%;
+}
+
+.personal .user .user_info {
+  display: flex;
+  flex-direction: column;
+}
+
+.personal .user .user_info .user_name {
+  font-size: .32rem;
+  color: #1D1D1D;
+}
+
+.personal .user .user_info .set_email, .personal .user .user_info .user_email {
+  width: auto;
+  height: .48rem;
+  display: flex;
+  justify-content: center;
+  align-items: center;
+  padding: 0 .2rem;
+  margin-top: .22rem;
+  background: #F5F4F9;
+  color: #686868;
+  font-size: .26rem;
+  border-radius: .24rem;
+  box-sizing: border-box;
+}
+
+.personal .user .user_info .set_email .icon-arrow, .personal .user .user_info .user_email .icon-arrow {
+  margin-left: .2rem;
+  color: #686868;
+  font-size: .14rem;
+}
+
+.personal .order {
+  padding: 0 .32rem;
+  background: #fff;
+}
+
+.personal .order .order_tab {
+  position: relative;
+  display: flex;
+  justify-content: space-between;
+  align-items: center;
+}
+
+.personal .order .order_tab .tab_list {
+  flex: 1;
+  display: flex;
+  flex-direction: column;
+  align-items: center;
+  padding: .32rem 0;
+}
+
+.personal .order .order_tab .tab_list img {
+  width: .72rem;
+  height: .72rem;
+}
+
+.personal .order .order_tab .tab_list span {
+  margin-top: 0.08rem;
+  font-size: .26rem;
+  color: #686868;
+}
+
+.personal .order .order_tab:before {
+  position: absolute;
+  content: '';
+  left: 0;
+  top: 0;
+  width: 100%;
+  height: 1px;
+  background-color: #E0E0E0;
+  transform-origin: 0 0;
+  transform: scaleY(0.5);
+}
+
+.personal .mgTop20 {
+  margin-top: .2rem;
+}
+
+.personal .menu {
+  margin-top: .2rem;
+}
+
+.personal .menu .menu_list {
+  display: flex;
+  align-items: center;
+  justify-content: space-between;
+  height: 1.1rem;
+  padding: 0 .2rem 0 .32rem;
+  background: #fff;
+}
+
+.personal .menu .menu_list .menu_list_left {
+  display: flex;
+  align-items: center;
+  font-size: .32rem;
+  color: #1D1D1D;
+}
+
+.personal .menu .menu_list .menu_list_left img {
+  width: .48rem;
+  height: .48rem;
+  margin-right: .32rem;
+}
+
+.personal .menu .menu_list .arrow_right {
+  width: .48rem;
+  height: .48rem;
+}

+ 112 - 0
src/web/staticres/css/wx/treasure_box.css

@@ -0,0 +1,112 @@
+.treasure .top {
+  width: 100%;
+  height: 4.15rem;
+  background: url(/images/syzindex/treasure_bg.png) no-repeat center center;
+  background-size: 100% 100%;
+}
+
+.treasure .top h2 {
+  padding-top: 1.12rem;
+  color: #fff;
+  text-align: center;
+  font-size: .44rem;
+}
+
+.treasure .top p {
+  padding-top: 0.08rem;
+  color: #fff;
+  font-size: .26rem;
+  opacity: 0.8;
+  text-align: center;
+}
+
+.treasure .main {
+  margin-top: -1.49rem;
+  padding: 0 .3rem;
+}
+
+.treasure .vip_subscribe, .treasure .data_export {
+  padding: 0 .3rem;
+  background: #fff;
+  box-shadow: 0px 0px 16px rgba(0, 0, 0, 0.08);
+  border-radius: 0.06rem;
+}
+
+.treasure .vip_subscribe .title, .treasure .data_export .title {
+  display: flex;
+  align-items: center;
+  padding: .28rem 0 .28rem;
+  border-bottom: 1px solid #EEEEEE;
+}
+
+.treasure .vip_subscribe .title img, .treasure .data_export .title img {
+  width: .56rem;
+  height: .56rem;
+  margin-right: .2rem;
+}
+
+.treasure .vip_subscribe .title a, .treasure .data_export .title a {
+  position: relative;
+  display: block;
+  width: 100%;
+}
+
+.treasure .vip_subscribe .title a h4, .treasure .data_export .title a h4 {
+  font-size: .32rem;
+  color: #1D1D1D;
+}
+
+.treasure .vip_subscribe .title a p, .treasure .data_export .title a p {
+  padding-top: 0.04rem;
+  color: #888888;
+  font-size: .26rem;
+}
+
+.treasure .vip_subscribe .title a:after, .treasure .data_export .title a:after {
+  content: "";
+  display: inline-block;
+  height: 6px;
+  width: 6px;
+  border-width: 1px 1px 0 0;
+  border-color: #C5C5C5;
+  border-style: solid;
+  -webkit-transform: matrix(0.71, 0.71, -0.71, 0.71, 0, 0);
+  transform: matrix(0.71, 0.71, -0.71, 0.71, 0, 0);
+  position: absolute;
+  top: 50%;
+  margin-top: -3px;
+  right: .14rem;
+}
+
+.treasure .vip_subscribe .info, .treasure .data_export .info {
+  padding: .1rem 0 .32rem;
+}
+
+.treasure .vip_subscribe .info .info_list, .treasure .data_export .info .info_list {
+  display: flex;
+  align-items: center;
+  padding-top: .18rem;
+}
+
+.treasure .vip_subscribe .info .info_list .info_list_left, .treasure .data_export .info .info_list .info_list_left {
+  width: 1.12rem;
+  height: .3rem;
+  display: flex;
+  align-items: center;
+  justify-content: center;
+  margin-right: .18rem;
+  font-size: .2rem;
+  color: #2CB7CA;
+  text-align: center;
+  border: 1px solid #2CB7CA;
+  border-radius: 0.06rem;
+  box-sizing: border-box;
+}
+
+.treasure .vip_subscribe .info .info_list .info_list_right, .treasure .data_export .info .info_list .info_list_right {
+  font-size: .2rem;
+}
+
+.treasure .data_export {
+  margin-top: .26rem;
+}

+ 3 - 3
src/web/staticres/css/wxsearch.css

@@ -386,12 +386,12 @@ form{
 }
 /**引导页**/
 .swiper-pagination{
-	top: 80px !important;
+/*	top: 80px !important;*/
 	transition: 0ms !important;
 	-webkit-transition: 0ms !important;
 }
 .swiper-pagination-bullet{
-	margin-bottom: 15px !important;
+	margin-bottom: 5px !important;
 }
 .swiper-slide{
 	text-align: center;
@@ -482,7 +482,7 @@ form{
 	height: 100%;
 }
 .swiper-pagination-bullet-active{
-	background-color: #35c5da !important;
+/*	background-color: #35c5da !important;*/
 }
 .swiper-pagination-bullet{
 	opacity: .1;

BIN
src/web/staticres/images/search/banner_1.png


BIN
src/web/staticres/images/search/banner_2.png


BIN
src/web/staticres/images/search/banner_3.png


BIN
src/web/staticres/images/search/home_question.png


BIN
src/web/staticres/images/search/home_search.png


BIN
src/web/staticres/images/search/home_tab_1.png


BIN
src/web/staticres/images/search/home_tab_2.png


BIN
src/web/staticres/images/search/home_tab_3.png


BIN
src/web/staticres/images/search/home_tab_4.png


BIN
src/web/staticres/images/search/nothing.png


BIN
src/web/staticres/images/syzindex/treasure_bg.png


BIN
src/web/staticres/images/syzindex/treasure_data.png


BIN
src/web/staticres/images/syzindex/treasure_vip.png


BIN
src/web/staticres/images/wx/persional/my_arrow_right.png


BIN
src/web/staticres/images/wx/persional/my_data_export.png


BIN
src/web/staticres/images/wx/persional/my_head.png


BIN
src/web/staticres/images/wx/persional/my_list_1.png


BIN
src/web/staticres/images/wx/persional/my_list_2.png


BIN
src/web/staticres/images/wx/persional/my_list_3.png


BIN
src/web/staticres/images/wx/persional/my_list_4.png


BIN
src/web/staticres/images/wx/persional/my_list_5.png


BIN
src/web/staticres/images/wx/persional/my_list_6.png


BIN
src/web/staticres/images/wx/persional/my_order_1.png


BIN
src/web/staticres/images/wx/persional/my_order_2.png


BIN
src/web/staticres/images/wx/persional/my_order_3.png


BIN
src/web/staticres/images/wx/persional/my_order_4.png


BIN
src/web/staticres/images/wx/persional/my_vip.png


+ 3 - 0
src/web/staticres/js/wxSupersearch.js

@@ -1929,5 +1929,8 @@ var SuperSearch = {
 			$("#wrapper").css("margin-bottom","52px");
 			$("#supersearchPage .resbm").addClass("hidden");
 		}
+	},
+	getHomeList:function(){
+		
 	}
 };

+ 59 - 24
src/web/staticres/vipsubscribe/css/choose_area.css

@@ -63,13 +63,11 @@
 }
 
 .tips_btn {
-    display: flex;
-    flex-direction: column;
-    align-items: center;
-    justify-content: space-between;
-    position: fixed;
-    width: 100%;
-    bottom: 0;
+  display: flex;
+  position: relative;
+  flex-direction: column;
+  align-items: center;
+  justify-content: space-between;
 }
 
 .tips_btn .tips_discount {
@@ -111,7 +109,6 @@
   line-height: .94rem;
   color: #fff;
   font-size: .34rem;
-  background-color: #fff;
 }
 
 .tips_btn .btns .save-btn,
@@ -382,6 +379,38 @@
   margin: 0;
 }
 
+.jymobile-tab-triangle {
+  position: relative;
+}
+
+.jymobile-tab-triangle:after {
+  content: '';
+  position: absolute;
+  top: 50%;
+  right: 0;
+  width: 0;
+  height: 0;
+  font-size: 0;
+  line-height: 0;
+  border-style: solid;
+  border-width: .1rem;
+  border-color: #aaa transparent transparent transparent;
+  transform: translate(140%, -30%);
+}
+
+.jymobile-tab-triangle.active:after {
+  border-color: transparent transparent #2cb7ca transparent;
+  transform: translate(140%, -70%);
+}
+
+.jymobile-tab-triangle.current {
+  color: #2cb7ca;
+}
+
+.jymobile-tab-triangle.current:after {
+  border-color: #2cb7ca transparent transparent transparent;
+}
+
 #choose_area {
   display: flex;
   justify-content: space-between;
@@ -395,36 +424,29 @@
   overflow-y: scroll;
 }
 
-#choose_area .optional_count {
+#choose_area .optional_count, #choose_area .all_area {
   background: #fff;
   height: .88rem;
   line-height: .88rem;
   padding: 0 .3rem;
   font-size: .3rem;
   color: #1d1d1d;
-  position: fixed;
-  top: 0;
-  width: 100%;
-  z-index:999;
 }
 
-#choose_area .optional_count em {
+#choose_area .optional_count em, #choose_area .all_area em {
   color: #2cb7ca;
 }
 
 #choose_area .result {
-  position: fixed;
+  position: relative;
   padding: .2rem .3rem;
   font-size: .26rem;
   text-align: justify;
-  width:100%;
-  background:rgba(245,244,249,1);
-  z-index:999;
 }
 
 #choose_area .result .result_text {
   position: relative;
-  min-height: 0.38rem;
+  min-height: 19px;
 }
 
 #choose_area .result .line_two {
@@ -462,7 +484,7 @@
 }
 
 #choose_area .select-area-box {
-  padding-bottom: 1.44rem;
+  padding-bottom: .94rem;
 }
 
 #choose_area .select-area-box .tab {
@@ -498,18 +520,30 @@
   background-size: 100% 100%;
 }
 
-#choose_area .select-area-box .tab .province .checkbox[disabled] {
+#choose_area .select-area-box .tab .province .checkbox:checked[disabled] {
   border: 0;
   background: url(/vipsubscribe/image/active_disabled.png) no-repeat center center;
   background-size: 100% 100%;
 }
 
-#choose_area .select-area-box .tab .province .checkbox.half:checked {
+#choose_area .select-area-box .tab .province .checkbox.half {
   border: 0 !important;
   background: url(/vipsubscribe/image/banxuan.png) no-repeat center center !important;
   background-size: cover !important;
 }
 
+#choose_area .select-area-box .tab .province .checkbox.half[disabled] {
+  border: 0 !important;
+  background: url(/vipsubscribe/image/banxuan.png) no-repeat center center;
+  background-size: cover !important;
+}
+
+#choose_area .select-area-box .tab .optional {
+  color: #2CB7CA;
+  font-size: 0.28rem;
+  margin-left: -2.8rem;
+}
+
 #choose_area .select-area-box label::after {
   font-size: 14px;
   float: right;
@@ -537,10 +571,10 @@
   color: #fff;
 }
 
-/*#choose_area .select-area-box .tab_content .active[disabled] {
+#choose_area .select-area-box .tab_content .active[disabled] {
   background: #BFBFC3;
   color: #fff;
-}*/
+}
 
 #choose_area .select-area-box .tab_content .city[disabled] {
   background: #BFBFC3;
@@ -571,5 +605,6 @@
 }
 
 #choose_area .slide a {
+  width: 100%;
   margin-bottom: .1rem;
 }

+ 2 - 2
src/web/staticres/vipsubscribe/css/keyWord.css

@@ -566,7 +566,7 @@ bottom:0px;
     width: 1.7rem;
     text-align: center;
     color: #2CB7CA;
-    font-size: 0.2rem;
+    font-size: 0.26rem;
     padding: 0rem 0rem 0.1rem;
     float: right;
 }
@@ -592,7 +592,7 @@ bottom:0px;
 }
 .classify-fast-pop .weui-dialog .weui-dialog__bd p {
         color: #888;
-    font-size: .2rem;
+    font-size: .26rem;
     margin-top: .2rem;
     letter-spacing: 0.01rem;
 }

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


+ 723 - 0
src/web/staticres/vipsubscribe/js/updateArea.js

@@ -0,0 +1,723 @@
+$(function () {
+    // 后端数据结构
+//  var areaData = {
+//      'data': {
+//          // 选择的数量
+//          'area': {
+//              '北京': [],
+//              '河南': [
+//                  '洛阳市',
+//                  '驻马店市',
+//                  '周口市',
+//                  '郑州市'
+//              ],
+//              '湖南':['长沙市'],
+//              '澳门': [],
+//              '甘肃': []
+//          },
+//          'buyset': {
+//              // 购买的全省的数量(不带市)
+//              'areacount': 7,
+//              'buyerclasscount': 11,
+//              // 购买的城市
+//              'citys': {
+//                  '河南': 4,
+//                  '湖南': 3,
+//                  '吉林': 2
+//              }
+//          }
+//      },
+//      'errMsg': '',
+//      'success': true
+//  };
+    var areaData = {
+        'data': {
+            // 选择的数量
+            'area': {},
+            'buyset': {
+                // 购买的全省的数量(不带市)
+                'areacount': 7,
+                'buyerclasscount': 11,
+                // 购买的城市
+                'citys': {}
+            }
+        },
+        'errMsg': '',
+        'success': true
+    };
+    
+
+    // 已经购买过的城市数量
+    let alreadyBuy = {
+        province: {
+            totalCount: 0,
+            selectedCount: 0
+        },
+        city: {
+            totalCount: 0,
+            selectedCount: 0
+        }
+    }
+    // 新增城市数量(排除修改的数量)
+    let newlyAdded = {
+        province: 0,
+        city: 0
+    }
+	
+    // ----------------- 以下定义功能函数 ----------------------------
+    function createMoreCity(arr) {
+        var tempHtml = arr.map(function (v) {
+            return '<button class="city">' + v.name + '</button>'
+        }).join('')
+        return tempHtml
+    }
+
+    // 新增求值 ---- 统计数量,不做视图操作
+    function getResult(callback) {
+        if (areaData.data.buyset.areacount === -1) {
+            $('.result_text.add_new .added-info').hide()
+            return
+        }
+        // 升级新增清空
+        $('.result_text.add_new .added-info').text('')
+
+        let isWholeSelected = $('.tab.whole input').is(':checked')
+        let isWholeDisabled = $('.tab.whole input').prop('disabled')
+        
+        // 已购买省份改变的数量
+        let dBuySetProvinceCount = 0
+        // 已购买省份改变的数量
+        let dAddedProvinceCount = 0
+        
+        // 已购买城市改变的数量
+        let dBuySetCityCount = 0
+        // 新增城市的数量
+        let dAddedCityCount = 0
+        $('.area-list li:not(.index)').each(function(i, dom){
+            if ($(dom).children('.tab').hasClass('whole')) return true
+            // 统计非全国的数量
+            // 没有'data-buy-city-count'属性的 $(dom).attr('data-buy-city-count') 为undefined
+            if ($(dom).attr('data-buy-city-count')) {
+                /********  此处判断的是已购买的城市下的  ********************/
+                // 获取购买城市的数量
+                let buyCount = $(dom).attr('data-buy-city-count') - 0   // 隐式转换成Number
+                // 获取城市不可点击的数量
+                let alreadySelectedCount = $(dom).find('button[disabled]').length
+                // 选择城市的数量(包括不可点击的)
+                let hasActiveCount = $(dom).find('button.active').length
+
+                if (hasActiveCount > buyCount) {
+                    dBuySetCityCount += buyCount
+                    dAddedCityCount += (hasActiveCount - buyCount)
+                } else {
+                    // 操作已购买的数量
+                    dBuySetCityCount += hasActiveCount
+                }
+            } else {
+                // 是不是直辖市或自治区,在有data-buy-count没必要判断
+                let hasCities = $(dom).find('.tab').hasClass('municipality')
+                // 是否购买过该省份(还需要判断该省份下面的城市是否全部disabled --- 同时满足才算购买过全省)
+                let provinceInput = $(dom).find('input')
+                // 循环着的当前的省份是否可选 和 是否被选中
+                let isBoughtProvince = provinceInput.prop('disabled')
+                let isChecked = provinceInput.is(':checked')
+
+                // 可得到已经购买的省份的数量(循环完成后可得到,循环过程中的值可能不全)
+
+                // 判断是否为购买过的城市
+                if (isBoughtProvince) {
+                    // 将已购买(选中但不能单击的)城市选中
+                    if (isChecked) {
+                        dBuySetProvinceCount ++
+                    }
+                } else {
+                    // 判断是否是直辖市或自治区(省份下面没有城市的和有城市的分开计算)
+                    if (hasCities) {
+                        // 直辖市、自治区 -----直接进行省份的操作
+                        // 并且没有购买过该省的,并且选中的
+                        if (isChecked) {
+                            dAddedProvinceCount ++
+                        }
+                    } else {
+                        // 带有市的省份城市(该省份下以前没有购买过任何城市)
+                        // 两种情况:1. 全选    2. 不全选
+                        let allCityLength = $(dom).find('button').length
+                        let otherTotalAddCount = $(dom).find('button.active').length
+
+                        if (allCityLength === otherTotalAddCount && isChecked) {
+                            // 选中了省份下的所有城市
+                            dAddedProvinceCount ++
+                        } else {
+                            // 对城市做新增操作
+                            dAddedCityCount += otherTotalAddCount
+                        }
+                    }
+                }
+            }
+        })
+
+        // 循环完成判断已经选择的省份数量 是否 大于购买过的数量
+        if (dBuySetProvinceCount + dAddedProvinceCount > alreadyBuy.province.totalCount) {
+            // 如果已选择的数量和新增的数量大于已购买过的数量,说明我有购买新的城市
+            dAddedProvinceCount -= (alreadyBuy.province.totalCount - dBuySetProvinceCount)
+            dBuySetProvinceCount = alreadyBuy.province.totalCount
+        } else {
+            dBuySetProvinceCount += dAddedProvinceCount
+            dAddedProvinceCount = 0
+        }
+
+        // 已购买城市下选项改变,状态更新
+        alreadyBuy.city.selectedCount = dBuySetCityCount
+        newlyAdded.city = dAddedCityCount
+
+        alreadyBuy.province.selectedCount = dBuySetProvinceCount
+        newlyAdded.province = dAddedProvinceCount
+
+        callback && callback()
+
+        setDataInResult()
+
+        // 全国被选中了
+        if (isWholeSelected && !isWholeDisabled) {
+            $('.result_text.add_new .added-info').text('全国')
+            $('.result_text.add_new').show()
+            isLockedTipButtons(false)
+        }
+    }
+
+    function setDataInResult() {
+        let buySetInfo = {
+            p: `省级区域${alreadyBuy.province.selectedCount}/${alreadyBuy.province.totalCount}、`,
+            c: `地市${alreadyBuy.city.selectedCount}/${alreadyBuy.city.totalCount}`
+        }
+        let addedInfo = {
+            p: `省级区域 ${newlyAdded.province}、`,
+            c: `地市 ${newlyAdded.city}`
+        }
+
+        // 修改数量并进行重新赋值
+        $('.result_text.already .buy-set-info').text(buySetInfo.p + buySetInfo.c)
+        // 升级新增赋值
+        $('.result_text.add_new .added-info').text(addedInfo.p + addedInfo.c)
+
+        if (newlyAdded.province !== 0 || newlyAdded.city !== 0) {
+            $('.result_text.add_new').show()
+            isLockedTipButtons(false)
+        } else {
+            $('.result_text.add_new').hide()
+            isLockedTipButtons(true)
+        }
+    }
+
+    // 求需要M的数量
+    function getResultWithMCount() {
+        let added = {
+            country: 0,
+            province: 0,
+            city: {
+                // '河南': 1,
+                // '吉林': 1
+            }
+        }
+        // 购买过的省份数量
+        let buySetProvinceCount = $('.area-list').attr('data-buy-province-count') - 0  // 隐式转换成Number
+        
+        $('.area-list li:not(.index)').each(function(i, dom) {
+            if ($(dom).children('.tab').hasClass('whole')) {
+                // 判断是否被选中
+                if ($(dom).find('input.other').is(':checked')) {
+                    added.country = -1
+                    added.province = 0
+                    added.city = {}
+                    return false
+                }
+            } else {
+                added.country = 0
+                let pName = $(dom).find('.province').text().replace(/\s+ | [\r\n]/g, '')
+                // 获取当前dom下有几个按钮有active样式
+                let activeButtonLength = $(dom).find('button.active').length
+
+                // 判断该省是否有购买过的城市
+                if ($(dom).attr('data-buy-city-count')) {
+                    let buyCityCount = $(dom).attr('data-buy-city-count') - 0
+                    let aCityCount = activeButtonLength - buyCityCount
+                    if (aCityCount > 0) {
+                        added.city[pName] = aCityCount
+                    } else {
+                        // 选不到购买的个数
+                    }
+                } else {
+                    // 判断是否是直辖市
+                    let isMunicipality = $(dom).find('.tab').hasClass('municipality')
+                    let allCitylength = $(dom).find('button').length
+
+                    if (isMunicipality) {
+                        if ($(dom).find('input').is(':checked')) {
+                            added.province ++
+                        }
+                    } else {
+                        if (activeButtonLength === allCitylength) {
+                            added.province ++
+                        } else {
+                            if (activeButtonLength !== 0) added.city[pName] = activeButtonLength
+                        }
+                    }
+                }
+            }
+        })
+
+        // 循环完成判断计算省份
+        let aProvinceCount = added.province - buySetProvinceCount
+        if (aProvinceCount > 0) {
+            added.province = aProvinceCount
+        } else {
+            added.province = 0
+        }
+        return added
+    }
+
+    // 点亮的城市数量详情(需要省和城市名称)
+    function getActiveCityDetail(state = '') {
+        let isWholeCountry = $('.tab.whole input').is(':checked')
+        if (isWholeCountry) {
+            // 选择全国
+            let str = $('.area-list li .tab.whole .province').text().replace(/\s+ | [\r\n]/g, '')
+            let obj = {}
+            obj[str] = []
+            return obj
+        } else {
+            let arr = []
+            $('.area-list li:not(.index)').each(function(i, dom) {
+                if ($(dom).children('.tab').hasClass('whole')) return
+                let isMunicipality = $(dom).find('.tab').hasClass('municipality')
+                let pName = $(dom).find('.province').text().replace(/\s+ | [\r\n]/g, '')
+                let selectedObj = {
+                    name: pName,
+                    children: []
+                }
+                
+                // 是否是直辖市或自治区
+                if (isMunicipality) {
+                    if ($(dom).find('input:not([disabled])').is(':checked')) {
+                        arr.push(selectedObj)
+                    }
+                } else {
+                    let allCitylength = $(dom).find('button').length
+
+                    if (state === 'disabled') {
+                        // 判断是否全省被选中
+                        if ($(dom).find('button.active').length === allCitylength) {
+                            // 判断省下有没有不可点击的按钮
+                            if ($(dom).attr('data-buy-city-count')) {
+                                $(dom).find('button.active').each(function(c, dom) {
+                                    let cName = $(dom).text().replace(/\s+ | [\r\n]/g, '')
+                                    selectedObj.children.push(cName)
+                                })
+                                if (selectedObj.children.length) {
+                                    arr.push(selectedObj)
+                                }
+                            } else {
+                                arr.push(selectedObj)
+                            }
+                        } else {
+                            $(dom).find('button.active').each(function(c, dom) {
+                                let cName = $(dom).text().replace(/\s+ | [\r\n]/g, '')
+                                selectedObj.children.push(cName)
+                            })
+                            if (selectedObj.children.length) {
+                                arr.push(selectedObj)
+                            }
+                        }
+                    } else {
+                        // 判断是否全省被选中
+                        if ($(dom).find('button.active:not([disabled])').length === allCitylength) {
+                            arr.push(selectedObj)
+                        } else {
+                            $(dom).find('button.active:not([disabled])').each(function(c, dom) {
+                                let cName = $(dom).text().replace(/\s+ | [\r\n]/g, '')
+                                selectedObj.children.push(cName)
+                            })
+                            if (selectedObj.children.length) {
+                                arr.push(selectedObj)
+                            }
+                        }
+                    }
+                }
+            })
+
+            // 处理arr
+            // [
+            //     {
+            //         name: '安徽',
+            //         children: ["合肥市", "蚌埠市", "阜阳市"]
+            //     },
+            //     {
+            //         name: '海南',
+            //         children: ["三亚市", "文昌市"]
+            //     },
+            //     {
+            //         name: '河南',
+            //         children: ["郑州市", "信阳市"]
+            //     }
+            // ]
+            let selectedCityDetail = {}
+            arr.forEach(function(item, i) {
+                selectedCityDetail[item.name] = item.children
+            })
+            return selectedCityDetail
+        }
+    }
+
+    // 初始选择的城市恢复,根据传入的p恢复为Disabled灰色按钮
+    function renderSelectedCityDisabled(p = {}) {
+        for (const k in p) {
+            if (p[k].length == 0) {
+                // 购买的省份
+                $('.province').each(function () {
+                    let t = $(this).text().trim();
+                    if (k == t) {
+                        $(this).children('.checkbox').prop('checked',true).attr('disabled',true);
+                        $(this).parents('li').children('.tab_content').find('.city').addClass('active').attr('disabled',true);
+                    }
+                })
+            } else {
+                $('.city').each(function () {
+                    let t = $(this).text().trim();
+                    p[k].forEach(v =>{
+                        if(v !== t) return
+                        // let that = $(this).parents('li').find('.tab:not(.municipality)');
+                        // 改变状态按钮
+                        $(this).addClass('active').attr('disabled',true).parent().siblings('.tab').find('input').addClass('half').attr('disabled',true);
+                    })
+                })
+            }
+        }
+    }
+
+    // 初始选择的城市恢复,根据传入的p恢复为Active蓝色按钮
+    // 需要放到init之后
+    function renderSelectedCityActive(p = {}) {
+        for (const k in p) {
+            if (k === '全国') {
+                $('.area-list li:not(.index):eq(0)').find('input').trigger('click')
+                return
+            }
+            
+            if (p[k].length == 0) {
+                // 购买的省份
+                $('.province').each(function () {
+                    let t = $(this).text().trim();
+                    if (k == t && p[k].length == 0) {
+                        $(this).parent().siblings().find('.city').trigger('click')
+                    }
+                })
+            } else {
+                $('.city').each(function () {
+                    let t = $(this).text().trim();
+                    p[k].forEach(v =>{
+                        if(v !== t) return
+                        // let that = $(this).parents('li').find('.tab:not(.municipality)');
+                        // 改变状态按钮
+                        $(this).trigger('click')
+                    })
+                })
+            }
+        }
+        getResult()
+    }
+
+    function isLockedTipButtons(f) {
+        $('.tips_btn button').prop('disabled', f)
+    }
+
+    // 根据数据进行求总数 --- 上方提示数据信息的初始化
+    function initAlreadyBuy(p, buyset, citys) {
+        // 此处在数据返回后根据数据进行求值
+        if (buyset.areacount === -1) {
+            $('.result_text.already .buy-set-info').text('全国')
+            $('.result_text.add_new .added-info').hide().text('')
+        }
+
+        // 选择的省和市的数量
+        for (let a in p) {
+            if (p[a].length) {
+                // 已经选择的市的数量
+                alreadyBuy.city.selectedCount += p[a].length
+            } else {
+                // 已经选择的省的数量
+                alreadyBuy.province.selectedCount ++
+            }
+        }
+
+        // 购买的全省的数量(不包含市)
+        alreadyBuy.province.totalCount = buyset.areacount;
+        // 购买的城市数量
+        for (const c in citys) {
+            alreadyBuy.city.totalCount += citys[c]
+        }
+        // console.log(alreadyBuy)
+        let buySetInfo = {
+            p: `省级区域${alreadyBuy.province.selectedCount}/${alreadyBuy.province.totalCount}、`,
+            c: `地市${alreadyBuy.city.selectedCount}/${alreadyBuy.city.totalCount}`
+        }
+        $('.result_text.already .buy-set-info').text(buySetInfo.p + buySetInfo.c)
+        $('.result_text.add_new .added-info').text('')
+    }
+
+    // 初始化方法
+    function init() {
+        let data = areaData.data
+        let buyset = data.buyset;
+        let citys = buyset.citys;
+        initAlreadyBuy(data.area, buyset, citys)
+        // 1.根据返回数据进行渲染
+        if (buyset.areacount === -1) {
+            // 购买全国
+            if (Object.keys(data.area).length === 0) {
+                // 选中全国
+                // 不能操作
+                $('.checkbox.other').prop('disabled', true).prop('checked', true)
+                $('.checkbox:not(.other)').prop('disabled', true)
+                $('.city').attr('disabled', true)
+            } else {
+                renderSelectedCityDisabled(data.area)
+            }
+            isLockedTipButtons(true)
+            $('.result_text.already .buy-set-info').text('全国')
+        } else {
+            // 购买的非全国
+            renderSelectedCityDisabled(data.area)
+        }
+        // 2.根据数据绑定data-buy-count,并赋值
+        // area-list上绑定购买的省份数量
+        $('.area-list').attr('data-buy-province-count', buyset.areacount)
+        $('.area-list li:not(.index)').each(function(i, dom){
+            if ($(dom).children('.tab').hasClass('whole')) return
+            // 获取省的名字,并去空格.回车.换行
+            let provinceName = $(dom).find('.province').text().replace(/\s+ | [\r\n]/g, '')
+            for (let c in citys) {
+                if (c === provinceName) {
+                    $(dom).attr('data-buy-city-count', citys[c])
+                }
+            }
+        })
+        $('.add_new').hide()
+        getResult()
+    }
+
+    // ----------------- 以下绑定事件 ----------------------------
+    // 0.渲染城市列表
+    $(".select-area-box ul li:not('.index')").each(function () {
+        var text = $(this).find(".province").text().trim()
+        var data = null
+        chinaMapJSON.some(function (v) {
+            data = v
+            return v.name.indexOf(text) !== -1
+        })
+        var box = $(this).find('div.tab_content')
+        var html = createMoreCity(data.city)
+        box.html(html)
+    })
+    // fastClick初始化: https://github.com/ftlabs/fastclick
+	//  FastClick.attach(document.body)
+    // 1.省下拉市
+    let isAnimating = false
+    $(".select-area-box .tab:not(.municipality)").on('click', function (event) {
+        if (isAnimating) return
+        isAnimating = true
+        if ($(this).next('.tab_content:not(:animated)').css("display") == "block") {
+            $(this).children().children('i').css({
+                "display": "inline-block",
+                "transform": "rotate(0)"
+            })
+        } else {
+            $(this).children().children('i').css({
+                "display": "inline-block",
+                "transform": "rotate(-180deg)"
+            })
+        }
+        $(this).toggleClass('selected').next('.tab_content:not(:animated)').slideToggle(500)
+        $(this).parent().siblings().children('.tab').removeClass('selected');
+        setTimeout(() => {
+            isAnimating = false
+        }, 500)
+    })
+    // 2.点击全国按钮onchange事件;
+    $('.checkbox.other').on('change', function () {
+        let isChecked = $(this).is(':checked')
+        if(isChecked){
+            $(this).prop('checked',true);
+            $('.checkbox:not(.other):not([disabled])').prop('checked',false).removeClass('half');
+            $('.city:not([disabled])').removeClass('active');
+            $('.tab_content').slideUp();
+        }
+        getResult()
+    })
+    // 3.点击非全国按钮onchange事件
+    $('.checkbox:not(.other)').on('change', function () {
+        $('.checkbox.other').prop('checked',false);
+        let isChecked = $(this).is(':checked');
+        if(isChecked){
+            $(this).prop('checked',true).removeClass('half');
+            $(this).parents('li').find('.city').addClass('active');
+            // 控制点击checkbox时候是否展开下方的城市列表
+            // $(this).parent().parent('.tab:not(.municipality)').siblings('.tab_content').slideDown();
+        }else{
+            $(this).prop('checked',false);
+            $(this).parents('li').find('.city').removeClass('active');
+        }
+        showOther();
+        getResult();
+    })
+    // 4.点击半选按钮触发的事件
+//  $('.checkbox.half').on('change', function () {
+//      $('.checkbox.other').prop('checked', false)
+//      let isChecked = $(this).is(':checked')
+//      $(this).prop('checked', isChecked).removeClass('half')
+//      console.log("!1")
+//      getResult();
+//  })
+    // 5.点击城市按钮触发的事件
+    $('.tab_content').on('click', '.city', function () {
+        // 全国取消选中
+        $('.checkbox.other').prop('checked',false);
+        $(this).toggleClass('active')
+        // 省下所有选中的地市数量
+        let activeCityLength = $(this).parent().find('.city.active').length;
+        // 省下一共有几个城市
+        let cityLength = $(this).parent().find('.city').length;
+        let oInput = $(this).parents('li').find('input.checkbox')
+        
+        if (activeCityLength === cityLength) {//当选中的城市数量等于该省下所有城市总数时,即为全选
+            if ($(this).siblings('.city[disabled]').length === 0) {
+                oInput.removeClass('half').prop('checked', true)
+            }
+        } else if (activeCityLength === 0){
+            oInput.prop('checked', false).removeClass('half')
+        } else {//半选
+            oInput.prop("checked",false).addClass('half')
+        }
+        showCityTips(this)
+        getResult();
+    })
+    // 6. 重置按钮点击事件
+    $('.reset-btn').on('click', function() {
+        // alreadyBuy = {
+        //     province: {
+        //         totalCount: 0,
+        //         selectedCount: 0
+        //     },
+        //     city: {
+        //         totalCount: 0,
+        //         selectedCount: 0
+        //     }
+        // }
+        // newlyAdded = {
+        //     province: 0,
+        //     city: 0
+        // }
+
+        // 数组置0,在重新从数据中计算初始状态结果并返回
+        for (let i in alreadyBuy) {
+            for(let ii in alreadyBuy[i]) {
+                alreadyBuy[i][ii] = 0
+            }
+        }
+        for (let j in newlyAdded) {
+            newlyAdded[j] = 0
+        }
+        $(".select-area-box .tab:not(.municipality) .icon").css({
+            "display": "inline-block",
+            "transform": "rotate(0)"
+        });
+
+        $('.checkbox').prop('checked', false).removeAttr('disabled');
+        $('.city').removeClass('active');
+        $('input').removeClass('half')
+        $('.tab_content').slideUp();
+        $('.optional').remove()
+        init();
+        $(".tips_d_text").hide();
+    })
+
+    // 7.锚点跳转
+    $("body").on('click', '.slide a', function () {
+        var s = $(this).html()
+        if (s == '#') {
+            return;
+        }
+        document.querySelector('#' + s).scrollIntoView({
+            block: 'center'
+        });
+    })
+    // 阻止input checkbox选中取消 触发父元素下拉事件
+    $('.checkbox').click(function (e) {  
+        e.stopPropagation();
+    })
+
+	function showCityTips(dom){
+		let activeCityLength = $(dom).parent().find('.city.active').length;
+		let selectedCityLength = $(dom).parent().find('.city.active:not([disabled])').length;
+		let cityLength = $(dom).parent().find('.city').length;
+		if(selectedCityLength > 2){
+			$(".tips_d_text").text("已选择"+selectedCityLength+"个市,建议购买“全省”");
+			$(".tips_d_text").show();
+		}else{
+			$(".tips_d_text").hide();
+		}
+		if(selectedCityLength === cityLength){
+			showOther();
+		}
+	}
+	
+	function showOther(){
+		let provinceLength = $(".area-list .checkbox:not(.other):not([disabled]):checked").length;
+		if(provinceLength > 9){
+			$(".tips_d_text").text("已选择"+provinceLength+"个省,建议购买“全国”")
+			$(".tips_d_text").show();
+		}else{
+			$(".tips_d_text").hide();
+		}
+	}
+
+    // ----------------------- 以下数据交互 ------------------
+    $DoPost("/subscribepay/renewUpgrade/getBuyMsg", {}, function (data) {
+    	if(data){
+        	areaData["data"] = {
+        		"area" : data.area,
+        		"buyset" : data.buyset, 
+        	}
+        	init();
+    	}
+    }, false);
+    // 确认按钮事件
+    $('.save-btn').on('click', function(){
+        // 获取added城市详情
+        var activeCityDetail = getActiveCityDetail()
+        let areaCount = getResultWithMCount()
+//      console.log("111",areaCount)
+//      console.log(JSON.stringify(activeCityDetail))
+//      console.log(activeCityDetail)
+//      console.log(areaData)
+//      console.log(alreadyBuy)
+        sessionStorage.vipAddCount = JSON.stringify(newlyAdded);
+        sessionStorage.vipSubSelectCity = newlyAdded.city;
+        sessionStorage.vipSubSelectAreaUpgrade = JSON.stringify(activeCityDetail);
+        sessionStorage.vipSubSelectAreaAdd = JSON.stringify(areaCount);
+        history.go(-1);
+    })
+	//
+	if(sessionStorage.vipSubSelectAreaUpgrade!==undefined&&sessionStorage.vipSubSelectAreaUpgrade!==""){
+		let areaObj = JSON.parse(sessionStorage.vipSubSelectAreaUpgrade);
+		renderSelectedCityActive(areaObj);
+	}
+    // 求需要M的城市数量
+    // getResultWithMCount()
+    // 获取点亮的城市的列表详情(带省名和城市名)
+    // getActiveCityDetail()
+
+    // 回显为蓝色激活样式
+    // renderSelectedCityActive()
+    // 回显为灰色不可点击样式
+    // renderSelectedCityDisabled()
+})

+ 18 - 1
src/web/staticres/wxswordfish/share.js

@@ -11,7 +11,7 @@ function initShare(signature,openid,isentry,activecode,nickname,avatar,id){
 	}
 	if(typeof(signature) != "undefined" && signature != null && signature.length == 4){
 		wx.config({
-		    debug: false, // 开启调试模式,调用的所有api的返回值会在客户端alert出来,若要查看传入的参数,可以在pc端打开,参数信息会通过log打出,仅在pc端时才会打印。
+		    debug: true, // 开启调试模式,调用的所有api的返回值会在客户端alert出来,若要查看传入的参数,可以在pc端打开,参数信息会通过log打出,仅在pc端时才会打印。
 		    appId: signature[0], // 必填,公众号的唯一标识
 		    timestamp:signature[1], // 必填,生成签名的时间戳
 		    nonceStr: signature[2], // 必填,生成签名的随机串
@@ -195,6 +195,23 @@ function initShare(signature,openid,isentry,activecode,nickname,avatar,id){
 					// 用户取消分享后执行的回调函数
 				}
 			});
+			wx.getLocation({
+			  	type: 'wgs84', // 默认为wgs84的gps坐标,如果要返回直接给openLocation用的火星坐标,可传入'gcj02'
+			  	success: function (res) {
+			    	var latitude = res.latitude; // 纬度,浮点数,范围为90 ~ -90
+			    	var longitude = res.longitude; // 经度,浮点数,范围为180 ~ -180。
+					//生成地理位置
+                    var fname = '';
+                    var point = new BMap.Point(longitude, latitude);
+                    var geoc = new BMap.Geocoder();
+                    geoc.getLocation(point, function(rs) {
+                        var addComp = rs.addressComponents;
+                        //alert(addComp.province + ", "+addComp.city + ", "+addComp.district + ", "+addComp.street + ", "+addComp.streetNumber);
+                        fname = addComp.district;
+                        alert('您现在所处位置:'+JSON.stringify(addComp));
+                    });
+			  }
+			});
 	    });
 		wx.error(function(res){
 		    // config信息验证失败会执行error函数,如签名过期导致验证失败,具体错误信息可以打开config的debug模式查看,也可以在返回的res参数中查看,对于SPA可以在这里更新签名。

+ 26 - 37
src/web/templates/weixin/dataExport/dataExport_toMyOrder.html

@@ -1117,48 +1117,37 @@
 			                        }
 							    }
 	                       }else{
+								//新增全部行业:-1  新增部分行业:123   		无新增:0
+								//新增全国{"province":0,"city":0}  无新增:{}
+	                       		//升级订单 单独处理
 	                       		//区域
 	                       		var filterObj =filter_vip;
 	                       		var region_vip ="";
-	                       		//升级订单 单独处理
-					         	if(!$.isEmptyObject(filterObj.addarea)){
-					              	var cityNum_u=0;
-					              	var provinceNum_u=0;
-						         	for(var i in filterObj.addarea) {
-						                let citys_u=filterObj.addarea[i];
-						                if (citys_u=="no"){
-						                	 region_vip="无"
-						                }else{
-						                	if (citys_u.length>0){
-							                	cityNum_u+=citys_u.length;
-							                }else{
-							                	provinceNum_u++;
-							                }
-						                }
-					                }
-					                if(provinceNum_u>0) region_vip= region_vip + provinceNum_u+"个省级区域";
-					                if(cityNum_u>0){
-					                	if(provinceNum_u>0) region_vip= region_vip+"、"
-					                	region_vip = region_vip+ cityNum_u+"个地市";
-					                }
-					         	}else {
-					         		region_vip="全国";
-					         	}
+								if(!$.isEmptyObject(filterObj.addareacount)){
+									if((filterObj.addareacount.province==0)&&(filterObj.addareacount.city==0)){
+										region_vip="全国";
+									}
+									if((filterObj.addareacount.province!=0)&&(filterObj.addareacount.city==0)){
+										region_vip=filterObj.addareacount.province+"个省级区域";
+									}
+									if((filterObj.addareacount.province==0)&&(filterObj.addareacount.city!=0)){
+										region_vip=filterObj.addareacount.city+"个地市";
+									}
+									if((filterObj.addareacount.province!=0)&&(filterObj.addareacount.city!=0)){
+										region_vip=filterObj.addareacount.province+"个省级区域、"+filterObj.addareacount.city+"个地市";
+									}
+								}else{
+									region_vip="无";
+								}
 					         	//行业
 					         	var industry_vip="";
-					         	if(!$.isEmptyObject(filterObj.addindustry)) {
-					         		if(filterObj.addindustry[0]=="no"){
-						         		industry_vip="无";
-						         	}else{
-						         		if(filterObj.addindustry.length==0){
-						         			industry_vip="全行业";
-						         		}else{
-						         			industry_vip=filterObj.addindustry.length+"个行业";
-						         		}
-						         	}
-					         	}else{
-				         			industry_vip="全行业";
-					         	}
+								industry_vip=filterObj.addbuyerclasscount+"个行业";
+								if(filterObj.addbuyerclasscount==0){
+									industry_vip="无";
+								}
+								if(filterObj.addbuyerclasscount==-1){
+									industry_vip="全行业";
+								}
 					         	//延长周期
 					         	var effectiveduration_vip="";
 					        	if(filterObj.cycleunit==1){

+ 151 - 211
src/web/templates/weixin/my.html

@@ -1,136 +1,147 @@
-<html lang="zh-cn">
-	<head>
-		<meta charset="UTF-8" />
-		<meta name="format-detection" content="telephone=no" />
-		<meta name="viewport" content="width=device-width, initial-scale=1, user-scalable=no">
-		{{include "/common/weixin.html"}}
-		<link href="{{Msg "seo" "cdn"}}/css/common.css?v={{Msg "seo" "version"}}" rel="stylesheet">
-		<script src="{{Msg "seo" "cdn"}}/js/jquery-3.2.1.min.js"></script>
-		<script src="{{Msg "seo" "cdn"}}/js/fastclick.js?v={{Msg "seo" "version"}}"></script>
-		<script src="{{Msg "seo" "cdn"}}/js/common.js?v={{Msg "seo" "version"}}"></script>
-		<script src="{{Msg "seo" "cdn"}}/wxswordfish/share.js?v={{Msg "seo" "version"}}"></script>
-		<title>我的</title>
-		
-		<style>
-			@font-face {
-			  font-family: 'iconfont';  /* project id 687854 */
-			  src: url('//at.alicdn.com/t/font_687854_s317iriqswc.eot');
-			  src: url('//at.alicdn.com/t/font_687854_s317iriqswc.eot?#iefix') format('embedded-opentype'),
-			  url('//at.alicdn.com/t/font_687854_s317iriqswc.woff2') format('woff2'),
-			  url('//at.alicdn.com/t/font_687854_s317iriqswc.woff') format('woff'),
-			  url('//at.alicdn.com/t/font_687854_s317iriqswc.ttf') format('truetype'),
-			  url('//at.alicdn.com/t/font_687854_s317iriqswc.svg#iconfont') format('svg');
-			}
-			.iconfont{
-			    font-family:"iconfont" !important;
-			    font-size:18px;font-style:normal;
-			    -webkit-font-smoothing: antialiased;
-			    -webkit-text-stroke-width: 0.2px;
-			    -moz-osx-font-smoothing: grayscale;
-			}
-			.myorderIcon{
-				color: #FFB901;
-				margin-left: 20px;
-				margin-right: 5px;
-			}
-			.fl{
-				float: left;
-			}
-			.fr{
-				float:right ;
-			}
-			.rightIcon{
-				margin-right: 20px;
-				color: #C2C2C2;
-			}
-			.threeIcon{
-				color: #45C0D0;
-				margin-left: 20px;
-				margin-right: 5px;
-			}
-			body{
-				background-color:#F5F4F9 ;
-			}
-			.lineBottom{
-				border-bottom: 1px solid  #F5F4F9;
-			}
-			.lineTop{
-				margin-top: 10px;
-				border-top: 1px solid  #F5F4F9;
-			}
-			.email{
-				border-top:0px #F5F4F9 solid;
-			}
-			.setEmail{
-				float:right;
-				color:#686868;
-				font:14px/47px '微软雅黑';
-				margin-right: 10px;
-			}
-			img{
-			    width: 22px;
-				margin-left: 17px;
-   				margin-right: 5px;
-			}
-			.myorder_margin{
-				margin-left: 18px;
-				margin-right: 7px;
-			}
-		</style>
-		
-		<script>
-			$(function () {    
-				var isPageHide = false;   
-				window.addEventListener('pageshow', function () {      
-				    if (isPageHide) {
-		                location.reload();
-				    }    
-				});    
-				window.addEventListener('pagehide', function () {
-				    isPageHide = true;
-				});  
-			});
-		
-			initShare({{.T.signature}},{{.T.openid}},2,"jy_wxmyorder",{{.T.nickname}},{{.T.avatar}});
-			$(function(){
-				var nowTimestamp= (new Date()).valueOf();
-				var userId={{.T.userId}}
-				
-				$(".vip").on("click",function(){
-					$.post("/subscribepay/orderListDetails/isVip?v="+nowTimestamp,{},function(data){
-						if (data.isvip){
-							window.location.href="/front/vipsubscribe/toSetPage";		//vip订阅入口  试用或正式vip
-						}else{
-							window.location.href="/front/vipsubscribe/introducePage";		//vip订阅入口  非vip
-						}
-					})
-		        })
-				
-		        $(".myorder").on("click",function(){
-		        	window.location.href="/weixin/pay/toMyWxOrder?v=01";
-		        })
-				$(".email").on("click",function(){
-					window.location.href="/front/wxMyOrder/myEmail";	//邮箱设置
-				})
-		        $(".feedback").on("click",function(){
-		        	window.location.href = "/swordfish/feedback";
-		        })
-		        $(".useHelp").on("click",function(){
-		        	 window.location.href = "http://mp.weixin.qq.com/mp/homepage?__biz=MzIyNTM1NDUyNw==&hid=3&sn=badf2d7da08654c58b58169e773f58f0#wechat_redirect";
-		        })
-		        $(".aboutJy").on("click",function(){
-		    		window.location.href='/swordfish/about?flag=1&come=1';
-		        })
-				$.post("/subscribepay/orderListDetails/emailOperation?v="+nowTimestamp,{},function(r){
-					if (r.success){
-						$(".setEmail").html("未设置");
+<!DOCTYPE html>
+<html lang="en">
+
+<head>
+    <meta charset="UTF-8">
+    <meta name="viewport"
+        content="width=device-width, initial-scale=1.0,minimum-scale=1.0, maximum-scale=1.0, user-scalable=no">
+    <meta http-equiv="X-UA-Compatible" content="ie=edge">
+    <title>我的</title>
+    <script src="/js/rem.js"></script>
+    <link rel="stylesheet" type="text/css" href="/css/wx/base.css" />
+    <link rel="stylesheet" href="/vipsubscribe/iconfont/iconfont.css" />
+    <link rel="stylesheet" href="/css/wx/personal.css" />
+</head>
+
+<body>
+    <div class="personal">
+        <!-- 账号信息 -->
+        <div class="user">
+            <div class="user_img">
+                <img id="head_img" src="/images/wx/persional/my_head.png" alt="" onerror="this.src='/images/wx/persional/my_head.png?v=2'" >
+            </div>
+            <div class="user_info">
+                <span class="user_name" >{{.T.nickname}}</span>
+                <!-- 无绑定邮箱显示邮箱设置 -->
+                 <a href="#" class="set_email" style="display:none">
+                    <span>邮箱设置</span>
+                    <i class="iconfont icon-arrow"></i>
+                </a> 
+                <a href="#" class="user_email" style="display:none">
+                    <span></span>
+                    <i class="iconfont icon-arrow"></i>
+                </a>
+            </div>
+        </div>
+        <!-- 订单 -->
+        <div class="order">
+            <div class="order_tab">
+                <a href="/weixin/pay/toMyWxOrder?active=1" class="tab_list">
+                    <img src="/images/wx/persional//my_order_1.png" alt="">
+                    <span>待付款</span>
+                </a>
+                <a href="/weixin/pay/toMyWxOrder?active=2" class="tab_list">
+                    <img src="/images/wx/persional//my_order_2.png" alt="">
+                    <span>已完成</span>
+                </a>
+                <a href="/weixin/pay/toMyWxOrder?active=3" class="tab_list">
+                    <img src="/images/wx/persional//my_order_3.png" alt="">
+                    <span>已取消</span>
+                </a>
+                <a href="/weixin/pay/toMyWxOrder?active=0" class="tab_list">
+                    <img src="/images/wx/persional//my_order_4.png" alt="">
+                    <span>全部订单</span>
+                </a>
+            </div>
+        </div>
+        <div class="menu">
+            <a href="#" class="menu_list vip">
+                <div class="menu_list_left">
+                    <img src="/images/wx/persional/my_vip.png" alt="">
+                    <span>VIP订阅</span>
+                </div>
+                <img class="arrow_right" src="/images/wx/persional/my_arrow_right.png" alt="">
+            </a>
+            <a href="#" class="menu_list toSieve">
+                <div class="menu_list_left">
+                    <img src="/images/wx/persional/my_data_export.png" alt="">
+                    <span>数据导出</span>
+                </div>
+                <img class="arrow_right" src="/images/wx/persional/my_arrow_right.png" alt="">
+            </a>
+        </div>
+        <div class="menu">
+            <a href="#" class="menu_list useHelp">
+                <div class="menu_list_left">
+                    <img src="/images/wx/persional/my_list_4.png" alt="">
+                    <span>使用帮助</span>
+                </div>
+                <img class="arrow_right" src="/images/wx/persional/my_arrow_right.png" alt="">
+            </a>
+            <a href="#" class="menu_list aboutJy">
+                <div class="menu_list_left">
+                    <img src="/images/wx/persional/my_list_5.png" alt="">
+                    <span>关于剑鱼标讯</span>
+                </div>
+                <img class="arrow_right" src="/images/wx/persional/my_arrow_right.png" alt="">
+            </a>
+            <a href="#" class="menu_list feedback">
+                <div class="menu_list_left">
+                    <img src="/images/wx/persional/my_list_6.png" alt="">
+                    <span>意见反馈</span>
+                </div>
+                <img class="arrow_right" src="/images/wx/persional/my_arrow_right.png" alt="">
+            </a>
+        </div>
+    </div>
+    <script src="/js/jquery-3.2.1.min.js"></script>
+    <script>
+        $(function () { 
+			var nowTimestamp= (new Date()).valueOf();
+			$(".vip").on("click",function(){
+				$.post("/subscribepay/orderListDetails/isVip?v="+nowTimestamp,{},function(data){
+					if (data.isvip){
+						window.location.href="/front/vipsubscribe/toSetPage";		//vip订阅入口  试用或正式vip
 					}else{
-						$(".setEmail").html("");
+						window.location.href="/front/vipsubscribe/introducePage";		//vip订阅入口  非vip
 					}
 				})
-			});
-			
-			function getParam(pname) {
+	        })
+			$(".toSieve").on("click",function(){
+				window.location.href="/front/wx_dataExport/toSieve";
+			})
+	        $(".myorder").on("click",function(){
+	        	window.location.href="/weixin/pay/toMyWxOrder?v=01";
+	        })
+			$(".set_email").on("click",function(){
+				window.location.href="/front/wxMyOrder/myEmail";	//邮箱设置_
+			})
+	        $(".feedback").on("click",function(){
+	        	window.location.href = "/swordfish/feedback";
+	        })
+	        $(".useHelp").on("click",function(){
+	        	 window.location.href = "http://mp.weixin.qq.com/mp/homepage?__biz=MzIyNTM1NDUyNw==&hid=3&sn=badf2d7da08654c58b58169e773f58f0#wechat_redirect";
+	        })
+	        $(".aboutJy").on("click",function(){
+	    		window.location.href='/swordfish/about?flag=1&come=1';
+	        })
+			$.post("/subscribepay/orderListDetails/emailOperation?v="+nowTimestamp,{},function(r){
+				if (r.success){
+					$(".set_email").show();
+					$(".user_email").hide();
+				}else{
+					$(".set_email").hide();
+					$(".user_email").show();
+					$(".user_email span").html(r.mail);
+				}
+			})
+			var img_head={{.T.avatar}};
+			if(img_head!=""){
+				$("#head_img").attr("src",img_head);
+			}
+        })
+		
+		function getParam(pname) {
 			    var params = location.search.substr(1);
 			    var ArrParam = params.split('&');
 			    if (ArrParam.length == 1) { 
@@ -146,87 +157,16 @@
 			    }
 			}
 			
-
-		</script>
-
-	</head>
-	<body>
-	
-<!--布局css-->
-	<style>
-		.vip{
-			display:flex;
-			align-items: center;
-			justify-content: space-between;
-			margin-bottom: 10px;
-			font:16px/50px "微软雅黑" ;
-			background-color:#FFFFFF ;
-		}
-		.myorderDiv{
-			font:16px/50px "微软雅黑" ;
-			background-color:#FFFFFF ;
-			display:flex;
-			align-items: center;
-			justify-content: space-between;
+		// 控制手机号中间四位显示星号
+		function user_phone_encryption(user_phone){
+			let userName =user_phone;
+            if(userName.length == 11){
+                userName = `${userName.substring(0,3)}****${userName.substring(7,11)}`
+                $('.user_name').text(userName)
+            }
 		}
-		.width_inlinblock{
-			width:87%;
-			display:inline-block;
-		}
-	</style>
-		<div id="" class="vip lineTop">
-				<img src="/images/wx/vip.svg"/>
-				<div class="width_inlinblock">
-					VIP订阅
-					<i class="iconfont fr rightIcon">&#xe642;</i>
-				</div>
-		</div>
-		
-		<div class="myorderDiv myorder">
-				<i class="iconfont myorderIcon myorder_margin">&#xe60f;</i>
-				<div  class="lineBottom width_inlinblock">
-					我的订单
-					<i class="iconfont fr rightIcon">&#xe642;</i>
-				</div>
-		</div>
-		<div class="myorderDiv email">
-			<img src="/images/wx/email.svg"/>
-			<div class="width_inlinblock">
-				邮箱地址
-				<i class="iconfont fr rightIcon">&#xe642;</i>
-				<span class="setEmail"></span>
-			</div>
-		</div>
-		
-		<div class="myorderDiv  lineTop feedback" >
-			<i class="iconfont threeIcon" style="">&#xe613;</i>
-			<div class="lineBottom width_inlinblock">
-				<div style="display:inline-block;">
-					意见反馈
-				</div>
-				<i class="iconfont fr rightIcon ">&#xe642;</i>
-			</div>
-		</div>
-		
-		<div class="myorderDiv  useHelp">
-			<i class="iconfont threeIcon ">&#xe60c;</i>
-			<div  class="lineBottom width_inlinblock">
-				<div style="display:inline-block;">
-					使用帮助
-				</div>
-				<i class="iconfont fr rightIcon ">&#xe642;</i>
-			</div>
-		</div>
-		
-		<div class="myorderDiv  aboutJy">
-			<i class="iconfont threeIcon">&#xe601;</i>
-			<div class="width_inlinblock">
-				关于剑鱼标讯
-				<i class="iconfont fr rightIcon">&#xe642;</i>
-			</div>
-		</div>
-
-<!--百度统计end-->
-{{include "/common/baiducc.html"}}
+			
+    </script>
 </body>
+
 </html>

+ 137 - 20
src/web/templates/weixin/search/mainSearch.html

@@ -19,15 +19,21 @@
 <script src="{{Msg "seo" "cdn"}}/js/rem.js?v={{Msg "seo" "version"}}"></script>
 <script src="{{Msg "seo" "cdn"}}/mobiscroll/mobiscroll.min.js"></script>
 {{include "/common/weixin.html"}}
-<script src="{{Msg "seo" "cdn"}}/wxswordfish/share.js?v={{Msg "seo" "version"}}"></script>
+<script type="text/javascript" src="http://api.map.baidu.com/api?v=2.0&ak=DD279b2a90afdf0ae7a3796787a0742e"></script>
+<script src="{{Msg "seo" "cdn"}}/wxswordfish/share.js?v={{Msg "seo" "version"}}1"></script>
 <script src="{{Msg "seo" "cdn"}}/js/dropload.js?v={{Msg "seo" "version"}}"></script>
 <script type="text/javascript" src="{{Msg "seo" "cdn"}}/js/wxEntsesearch.js?v={{Msg "seo" "version"}}"></script>
-<script type="text/javascript" src="{{Msg "seo" "cdn"}}/js/wxSupersearch.js?v={{Msg "seo" "version"}}1022"></script>
+<script type="text/javascript" src="{{Msg "seo" "cdn"}}/js/wxSupersearch.js?v={{Msg "seo" "version"}}112"></script>
 <!--2.8-->
 <link rel="stylesheet" href="{{Msg "seo" "cdn"}}/wx_dataExport/css/base_myorder.css?v={{Msg "seo" "version"}}1">
 <link rel="stylesheet" href="{{Msg "seo" "cdn"}}/wx_dataExport/iconfont/iconfont.css?v={{Msg "seo" "version"}}">
 <link rel="stylesheet" href="{{Msg "seo" "cdn"}}/wx_dataExport/css/search_tab.css?v={{Msg "seo" "version"}}">
 <link rel="stylesheet" href="{{Msg "seo" "cdn"}}/wx_dataExport/css/weui.min.css">
+<!--2.8.5-->
+<link rel="stylesheet" type="text/css" href="{{Msg "seo" "cdn"}}/css/wx/base.css?v={{Msg "seo" "version"}}" />
+<link rel="stylesheet" href="{{Msg "seo" "cdn"}}/swiper/swiper.min.css?v={{Msg "seo" "version"}}">
+<link rel="stylesheet" href="{{Msg "seo" "cdn"}}/css/wx/home.css?v={{Msg "seo" "version"}}">
+<script src="{{Msg "seo" "cdn"}}/swiper/swiper.min.js"></script>
 <title>搜索</title>
 <script type="text/javascript">
 	var s_openid = {{session "s_m_openid"}};
@@ -58,6 +64,14 @@
 		}
     }
 	$(function(){
+		//dev2.8.5
+        var swiper1 = new Swiper('#swiper1',{
+            autoplay: 3000,
+            effect: 'fade',
+            pagination: '.swiper-pagination',
+            paginationClickable: true,
+            loop: true,
+        });
         // 搜索选择的显示隐藏
         $('.selected-export .options').on('tap', 'span',function(e){
             var index = $(this).attr('index')  // index可以表示当前点击的是哪个按钮
@@ -264,22 +278,125 @@
 {{include "/weixin/vipsubscribe/modal.html"}}
 <!--主题内容-->
 <section id="searchIndex" class="hidden" style="transform: none;">
+	<!--2.8.5 start-->
+	<div class="home">
+        <div class="top">
+            <div class="home_search">
+                <div class="home_search_left inp-search">
+                    <img class="icon_search" src="/images/search/home_search.png" alt="">
+                    <span>示例:税务局 软件</span>
+                </div>
+                <div class="home_search_right">
+                    <img class="icon_question" src="/images/search/home_question.png" alt="">
+                </div>
+            </div>
+            <div class="home_banner">
+                <div class="swiper-container lunbo" id="swiper1">
+                    <div class="swiper-wrapper">
+						<!--轮播广告-->
+                    </div>
+                    <div class="swiper-pagination custorm_dot"></div>
+                </div>
+            </div>
+        </div>
+		{{$s_top:=(Ad "jy-wxsearch-home-top" -1)}}
+		<script>
+			$(function(){
+				SuperSearch.getHomeList()
+			})
+			var ADTopList={{$s_top}}
+			if (ADTopList!=null){
+				var adhtml = '';
+				for(var i=0;i<ADTopList.length;i++){
+					adhtml+='<div class="swiper-slide">'
+						+'<a href="'+ADTopList[i]["s_link"]+'">'
+						+'<img src="'+ADTopList[i]["s_pic"]+'" alt="">'
+						+'</a></div>'
+				}
+				if(adhtml!=""){
+					$(".home_banner .swiper-wrapper").html(adhtml);
+				}
+			}
+		</script>
+        <!-- 导航菜单 -->
+        <div class="home_tab">
+            <div class="tab_container">
+                <a class="tab_item">
+                    <img src="/images/search/home_tab_1.png" alt="">
+                    <span>搜中标企业</span>
+                </a>
+                <a class="tab_item">
+                    <img src="/images/search/home_tab_2.png" alt="">
+                    <span>数据导出</span>
+                </a>
+                <a class="tab_item">
+                    <img src="/images/search/home_tab_3.png" alt="">
+                    <span>标讯订阅</span>
+                </a>
+                <!-- 微信端展示APP下载 -->
+                <a class="tab_item">
+                    <img src="/images/search/home_tab_4.png" alt="">
+                    <span>APP下载</span>
+                </a> 
+            </div>
+        </div>
+        <!-- 最新标讯 -->
+        <div class="home_data">
+            <h3 class="data_nav">最新标讯</h3>
+            <div class="data_list">
+                <div class="list_item">
+                    <div class="list_title">
+                        <span class="serial_number">1. &nbsp;</span>
+                        <p>淮安市高级职业技术学校台式<em style="color: #2CB7CA;">电脑采购</em>项目招标公告</p>
+                    </div>
+                    <div class="list_info">
+                        <div class="tags">
+                            <div class="area">江苏</div>
+                            <div class="industry">建筑工程</div>
+                            <div class="course">招标</div>
+                            <div class="price">3.6亿</div>
+                        </div>
+                        <div class="timer">13小时前</div>
+                    </div>
+                </div>
+            </div>
+            <div class="no_data" style="display: none;">
+                <img src="/images/search/nothing.png" alt="">
+                <p>为了使您接收更多信息,可对关键词进行新增或修改。</p>
+                <a href="#" >去设置</a>
+            </div>
+        </div>
+        <div class="tips">
+            <p class="tips_text">设置订阅关键词,随时接收最新招标信息</p>
+            <p class="tips_text" style="display: none;">为了使您接收更多信息,可对关键词进行新增或修改。</p>
+            <p class="tips_text" style="display: none;">您未设置关键词,设置后接收信息更精准!</p>
+            <p class="tips_text" style="display: none;">本次推送信息已达上限,开通VIP订阅,获取更多订阅信息。</p>
+            <p class="tips_all" style="display: none;"><a href="#">查看全部</a></p>
+            <div class="tips_btn">
+                <a href="#" >去设置</a>
+            </div>
+            <div class="tips_btn" style="display: none;">
+                <a href="#" >了解详情</a>
+            </div>
+        </div>
+    </div>
+	<!--2.8.5  end-->
 	<!--<div onclick="window.location.href='/supportJy'" style="font-size:15px;background-color: #FFB900;line-height: 40px;z-index: 99;color: #fff;border-radius: 3px;bottom: 80px;right: 10px;left:10px;position: fixed;"><img src="/images/search/laba.png" style="width: 23px;margin:0px 10px;">好几天没有推送消息了,真相是......</div>-->
 	<!--头部-->
-		<div class="search-header">
+	<div class="search-header hide">
 		<!--搜索-->
-			<div class="search-tontrol">
-				<div>
-					<input class="inp-search" type="text" name="" value="" maxlength="50" placeholder="示例:税务局 软件" readonly/>
-				</div>
-				<!--点击关闭-->
-				<span id="seaClose" class="close"></span>
-				<a class="rightHref">
-				</a>
+		<div class="search-tontrol">
+			<div>
+				<input class="inp-search" type="text" name="" value="" maxlength="50" placeholder="示例:税务局 软件" readonly/>
 			</div>
+			<!--点击关闭-->
+			<span id="seaClose" class="close"></span>
+			<a class="rightHref">
+			</a>
 		</div>
+	</div>
 
-	<section class="content">
+	<section class="content hide">
 		<ul>
 			<li>
 				<a>
@@ -990,23 +1107,23 @@
             SuperSearch.init(true,true,true);
         });
 		//点击帮助
-	    $(".rightHref").click(function(){
+	    $(".home_search_right").click(function(){
 	        window.open("http://mp.weixin.qq.com/mp/homepage?__biz=MzIyNTM1NDUyNw==&hid=2&sn=379fc869080a36d9d0798a3d4fb9a63a#wechat_redirect");
 			event.stopPropagation();
 	    });
 	    //数据导出页面
-	    $(".content ul li a:eq(1)").on('click', function () {
+	    $(".tab_container  a:eq(1)").on('click', function () {
 			window.location.href='/front/wx_dataExport/toSieve';
 	    });
+	    //剑鱼标讯
+	    $(".tab_container a:eq(2)").on('click', function () {
+			window.location.href='/swordfish/historypush';
+	    });
 	    //APP下载跳转到关于剑鱼标讯
-	    $(".content ul li a:eq(2)").on('click', function () {
+	    $(".tab_container a:eq(3)").on('click', function () {
 			// window.location.href='https://www.jianyu360.com/jyapp/free/download/normal?source=weixinAutoRpl';
 			window.location.href='/swordfish/about?flag=1&come=1';
 	    });
-		//拉新 2019-10-21 拉新活动结束 注释
-	    //$(".content ul li a:eq(3)").on('click', function () {
-		//	window.location.href='https://mp.weixin.qq.com/s/ACvQRxKeLYl_DuPuvvqIXQ';
-	    //});
 	//});
 	function checkIsOpen(){
 		$(".content ul li a:eq(0)").unbind("tap");
@@ -1016,7 +1133,7 @@
 	    $.post("/jylab/supsearch/getstatus?t="+new Date().getTime(),function(result){
 			onceFlag_tablepro=result.tablepro;
 			//中标企业搜索跳转
-		    $(".content ul li a:eq(0)").on("tap",function(){
+		    $(".tab_container a:eq(0)").on("tap",function(){
 				EntSearch.clearSessionStorage();
 				EntSearch.init(true,true,true);
 		    });	  

+ 99 - 0
src/web/templates/weixin/treasure_box.html

@@ -0,0 +1,99 @@
+<!DOCTYPE html>
+<html lang="en">
+
+<head>
+    <meta charset="UTF-8">
+    <meta name="viewport"
+        content="width=device-width, initial-scale=1.0,minimum-scale=1.0, maximum-scale=1.0, user-scalable=no">
+    <meta http-equiv="X-UA-Compatible" content="ie=edge">
+    <title>百宝箱</title>
+    <script src="/js/rem.js"></script>
+    <link rel="stylesheet" type="text/css" href="/css/wx/base.css" />
+    <link rel="stylesheet" href="/css/wx/treasure_box.css">
+</head>
+
+<body>
+    <div class="treasure">
+        <div class="top">
+            <h2>百宝箱</h2>
+            <p>欢迎来到剑鱼标讯百宝箱</p>
+        </div>
+        <div class="main">
+            <div class="vip_subscribe">
+                <div class="title vip">
+                    <img src="/images/syzindex/treasure_vip.png" alt="">
+                    <a>
+                        <h4>VIP订阅</h4>
+                        <p>更多招标信息,重要项目不遗漏</p>
+                    </a>
+                </div>
+                <div class="info">
+                    <div class="info_list">
+                        <div class="info_list_left">项目匹配</div>
+                        <div class="info_list_right">根据你的订阅,为你推送所匹配项目后续的全面动态;</div>
+                    </div>
+                    <div class="info_list">
+                        <div class="info_list_left">行业订阅</div>
+                        <div class="info_list_right">完美接收所需行业动态,无需繁琐关键词设置;</div>
+                    </div>
+                    <div class="info_list">
+                        <div class="info_list_left">300组</div>
+                        <div class="info_list_right">大容量关键词设置,精准全面定位所需标讯动态;</div>
+                    </div>
+                    <div class="info_list">
+                        <div class="info_list_left">多匹配模式</div>
+                        <div class="info_list_right">标题匹配+全文匹配双模式,信息筛选更灵活;</div>
+                    </div>
+                    <div class="info_list">
+                        <div class="info_list_left">地域精准</div>
+                        <div class="info_list_right">准确定位到地级市,一切皆在你掌握之中。</div>
+                    </div>
+                </div>
+            </div>
+            <div class="data_export">
+                <div class="title toSieve">
+                    <img src="/images/syzindex/treasure_data.png" alt="">
+                    <a>
+                        <h4>数据导出</h4>
+                        <p>导出任意条件的招标数据,按条数付费</p>
+                    </a>
+                </div>
+                <div class="info">
+                    <div class="info_list">
+                        <div class="info_list_left">多条件</div>
+                        <div class="info_list_right">多种筛选条件,精准定位所需数据,节省又高效;</div>
+                    </div>
+                    <div class="info_list">
+                        <div class="info_list_left">多纬度</div>
+                        <div class="info_list_right">多达20个数据字段,覆盖面全而广,所想即所得;</div>
+                    </div>
+                    <div class="info_list">
+                        <div class="info_list_left">私家专属</div>
+                        <div class="info_list_right">多种筛选细度,丝丝合束,成就你的专属分析数据。</div>
+                    </div>
+                </div>
+            </div>
+        </div>
+    </div>
+    <script src="/js/jquery-3.2.1.min.js"></script>
+    <script>
+      	$(function(){
+			var nowTimestamp= (new Date()).valueOf();
+			$(".vip").on("click",function(){
+				$.post("/subscribepay/orderListDetails/isVip?v="+nowTimestamp,{},function(data){
+					if (data.isvip){
+						window.location.href="/front/vipsubscribe/toSetPage";		//vip订阅入口  试用或正式vip
+					}else{
+						window.location.href="/front/vipsubscribe/introducePage";		//vip订阅入口  非vip
+					}
+				})
+	        })
+			//
+			$(".toSieve").on("click",function(){
+				window.location.href="/front/wx_dataExport/toSieve";
+			})
+		})
+    </script>
+</body>
+
+</html>

+ 15 - 497
src/web/templates/weixin/vipsubscribe/choose_area_upgrade.html

@@ -7,32 +7,31 @@
     <meta name="viewport" content="initial-scale=1, maximum-scale=1">
     <meta name="apple-mobile-web-app-capable" content="yes">
     <meta name="apple-mobile-web-app-status-bar-style" content="black">
-    <script src="/vipsubscribe/js/rem.js?v={{Msg "seo" "version"}}"></script>
+    <script src="/vipsubscribe/js/rem.js"></script>
     <link rel="stylesheet" href="/vipsubscribe/css/weui.min.css?v={{Msg "seo" "version"}}">
     <link rel="stylesheet" type="text/css" href="/vipsubscribe/css/base.css?v={{Msg "seo" "version"}}" />
     <link rel="stylesheet" type="text/css" href="/vipsubscribe/iconfont/iconfont.css?v={{Msg "seo" "version"}}" />
     <link rel="stylesheet" href="/vipsubscribe/css/public.css?v={{Msg "seo" "version"}}">
-    <link rel="stylesheet" href="/vipsubscribe/css/choose_area.css?v={{Msg "seo" "version"}}4">
-	{{include "/common/weixin.html"}}
-	<!--<script src="{{Msg "seo" "cdn"}}/wxswordfish/share.js?v={{Msg "seo" "version"}}"></script>-->
+    <link rel="stylesheet" href="/vipsubscribe/css/choose_area.css?v={{Msg "seo" "version"}}">
+    {{include "/common/weixin.html"}}
 	<script src="/vipsubscribe/js/share.js?v={{Msg "seo" "version"}}"></script>
 </head>
 <style type="text/css">
 	body,html {
 		height: 100%;
 	}
+	#choose_area .select-area-box .tab .province .checkbox.half[disabled]{
+        border: 0!important;
+        background: url(/vipsubscribe/image/banxuan_disabled.png) no-repeat center center!important;
+        background-size:cover!important;
+    }
 </style>
 <body>
-	<script type="text/javascript">
-		initShare({{.T.signature}},{{.T.openid}},2,"jy_extend",{{.T.nickname}},{{.T.avatar}});
-	</script>
     <div id="choose_area" >
         <div class="result">
             <!-- 首次购买 显示"已选择" -----  升级订阅显示"已新增" -->
-            <p class="result_text line_two"> 已新增:<span class="result_name"></span>
-                <a href="javascript:;" class="detail">详情</a>
-            </p>
-            <a href="javascript:;" class="packup" style="display: none;">收起</a>
+            <p class="result_text already"><span>已购买:</span><span class="buy-set-info"></span></p>
+            <p class="result_text add_new"><span>升级新增:</span><span class="added-info"></span></p>
         </div>
         <div class="form">
             <div class="select-area-box">
@@ -364,13 +363,12 @@
         </div>
         <div class="tips_btn">
             <div class="tips_discount">
-                <!--<div class="tips_d_money" style="display: block">&yen;38</div>-->
-                <div class="tips_d_text citys">已选择4个市,建议购买“全省”。</div>
-                <div class="tips_d_text all">已选择10个省,建议购买“全国”。</div>
+                <!--<div class="tips_d_money" style="display: block">&yen;1</div>-->
+                <div class="tips_d_text">已选择3个市,建议购买“全省”</div>
             </div>
             <div class="btns">
-                <button class="reset-btn">重置</button>
-                <button class="save-btn">确认</button>
+                <button class="reset-btn" disabled>重置</button>
+                <button class="save-btn" disabled>确认</button>
             </div>
         </div>
         <div class="slide">
@@ -393,489 +391,9 @@
         </div>
     </div>
     <script src="/vipsubscribe/js/jquery-2.1.4.js?v={{Msg "seo" "version"}}"></script>
-    <!--<script src="/vipsubscribe/js/fastclick.js?v={{Msg "seo" "version"}}"></script>-->
     <script src="/vipsubscribe/js/mapJSON.js?v={{Msg "seo" "version"}}"></script>
     <script src="/vipsubscribe/js/common.js?v={{Msg "seo" "version"}}"></script>
-    <script>
-    	//已购买
-    	var buystr = "";
-    	var areaData = {};
-        $DoPost("/subscribepay/renewUpgrade/getBuyMsg", {}, function (data) {
-        	if(data){
-            	buystr = data.area;
-            	areaData["data"] = {
-            		"area" : data.area,
-            		"buyset" : data.buyset, 
-            	}
-            	console.log(areaData)
-        	}
-        }, false);
-//      console.log(buystr)
-      var AreaChoose={
-        selectObj:{},//已选择,未购买城市;
-        buyObj:{},//已购买
-        selectedIndustryArr:["一个行业"],//计算价格临时变量
-        timeSelect:[1,2],//计算价格临时变量 timeSelect[0]时长  timeSelect[1] 1:年 2:月
-        vipSubisTrial:false,
-        inintData:function(){
-          //已选择
-          try{
-            let select =sessionStorage.getItem("vipSubSelectAreaUpgrade");
-            if(select){
-              this.selectObj=JSON.parse(select);
-            }
-            if(sessionStorage.getItem("vipSubSelectIndustryUpgrade")){
-              this.selectedIndustryArr=JSON.parse(sessionStorage.getItem("vipSubSelectIndustryUpgrade"));
-            }
-            if(sessionStorage.getItem("vipSubSelectTime")){
-              this.timeSelect=JSON.parse(sessionStorage.getItem("vipSubSelectTime"));
-            }
-            //
-            this.buyObj = buystr;
-            if(checkObj(buystr)){
-            	this.buyObj = {"全国":[]}
-            }
-//          console.log(this.buyObj)
-            //是否试用界面
-            if(sessionStorage.getItem("vipSubisTrial")) this.vipSubisTrial=true;
-          }catch(e){
-            console.log(e);
-            this.selectObj={};
-          }
-        },
-        inintPage:function(){//初始化省份城市选项   
-          $(".select-area-box ul li:not('.index')").each(function () {
-              var text = $(this).find(".province").text().trim()
-              var data = null
-              chinaMapJSON.some(function (v) {
-                  data = v
-                  return v.name.indexOf(text) !== -1
-              })
-              var box = $(this).find('div.tab_content')
-              var html = AreaChoose.createMoreCity(data.city)
-              box.html(html)
-          })
-        },
-        createMoreCity:function(arr){
-          var tempHtml = arr.map(function (v) {
-                return '<button class="city">' + v.name + '</button>'
-            }).join('')
-            return tempHtml
-        },
-        showSelected:function(canClick){ //回显已选择
-        	var ran = "";
-            if(canClick){
-            	ran = this.selectObj;
-            }else{
-            	ran = this.buyObj;
-            }    
-            for(var province in ran) {
-      			let citys=ran[province]
-	            if(citys.length>0){//地市
-	                this.selectCity(citys,canClick)
-	            }else{//省份
-	                this.selectProvince(province,canClick)
-	            }
-	        }
-        },
-        selectProvince:function(province,canClick){ //设置选中省份 province 省份
-          $($('.tab .province')).each(function (index, dom) {
-            if (province == $.trim($(dom).text())) {
-              $(".checkbox.other").attr("checked", false); //取消全国选中
-              $(dom).children('.checkbox').attr({"checked": true,"disabled":!canClick});//选中此省份
-              if(canClick){
-              	$(dom).parents().siblings('.tab_content').find(".city").addClass("active").attr({"disabled":!canClick});
-              }else{
-              	$(dom).parents().siblings('.tab_content').find(".city").attr({"disabled":!canClick});
-              }
-            }
-            if(!canClick){
-            	if(province === "全国"){
-	            	$('.tab .province').each(function(){
-	            		$(this).children('.checkbox').attr({"checked": true,"disabled":!canClick});//选中此省份
-	            	});
-	            	$('.tab_content .city').each(function(){
-	            		$(this).attr("disabled",!canClick);
-	            	});
-	            }
-            }
-          })
-        },
-        selectCity:function(citys,canClick){ //设置选中城市
-          citys.forEach(v => {
-            $($('.tab_content .city')).each(function (index, dom) {
-                if (v == $(dom).text()) {
-                    $(".checkbox.other").attr("checked", false); //取消全国选中
-                    if(canClick){
-                    	$(dom).addClass('active').attr('disabled', !canClick).parents().siblings('.tab')
-                        .addClass('selected').children('.province').children('.checkbox').attr({
-                            "checked": true
-                        })
-                    }else{
-                    	$(dom).attr('disabled', !canClick).parents().siblings('.tab')
-                        .addClass('selected').children('.province').children('.checkbox').attr({
-                            "checked": true,
-                            "disabled": "disabled"
-                        })
-                        $(dom).parents().slideDown(500);
-                    }
-                }
-            })
-          })
-        },
-        getResult:function(){   /* 选中结果 */
-          //如果选中所有,则转为全国
-          if($(".city").length==$(".city.active").length){
-            $(".checkbox.other").trigger("click");
-            return
-          }
-          this.selectObj = {};
-          $('.result_name').empty()
-          var data = []; //定义一个总数组
-          var cityArr =[]; //定义一个选中城市数组
-          var provincesArr = [];
-          var val = $('.other').parents('.province').text().trim();
-          if ($('.other').is(':checked')) {
-            // data.push(val)
-            data =[{name:val,children:[]}] //全国
-          }
-          $(".tab_content").find(".city.active:not('[disabled]')").each(function () {
-              var length = $(this).parent('.tab_content').find('.city').length; //省份下城市的length
-              var activeLeng = $(this).parent('.tab_content').find('.city.active').length; //省份下选中城市的length
-              let arr =[];
-              // 判断省份下的城市是否等于选中的城市长度,相等就是全部选中
-              if (length == activeLeng) {
-                  $('.tips_btn .tips_d_text.citys').hide();
-                  // data.push($(this).parent('.tab_content').siblings('.tab:not(.whole)').children('.province').text().trim())
-                  let province = $(this).parent('.tab_content').siblings('.tab:not(.whole)').children('.province').text().trim();
-                  data.push({
-                      name:province,
-                      children:[]
-                  });
-                  provincesArr.push(province);
-              } else { 
-                  let province = $(this).parent('.tab_content').siblings('.tab:not(.whole)').children('.province').text().trim();
-                  let city = $(this).html()
-                  arr.push({name:city,parent:province})
-                  for(let i =0;i<arr.length;i++){
-                      let obj ={};
-                      obj.name = arr[i].name;
-                      obj.parent = arr[i].parent;
-                      cityArr.push(obj)
-                  }
-                  data.push({
-                      name:province,
-                      children:cityArr
-                  })
-              }
-              if(activeLeng > 0){
-              	$(".tips_btn .btns .reset-btn").removeAttr("disabled");
-              	$(".tips_btn .btns .save-btn").removeAttr("disabled");
-              }
-          })
-          //数组对象去重
-          let obj = {};
-          data = data.reduce((cur,next) =>{
-              obj[next.name] ? "" : obj[next.name] = true && cur.push(next);
-              return cur
-          },[]);
-          
-          // 数组筛选
-          let result = data.map(v =>{
-              let filterArr = v.children.filter(s =>{
-                 return s.parent === v.name
-              })
-              return {
-                  name:v.name,
-                  children:filterArr
-              }
-          })
-          var html = '';
-          for (var i = 0; i < result.length; i++) {
-              let children = result[i].children;
-              if( children.length >0){
-                  // 判断每个省份下选中的城市长度,当大于等于4的时候 弹出"选择全省更划算的弹窗"
-                  let childrenArr=[];
-                  if (children.length >= 3 && !this.vipSubisTrial) {
-                      $('.tips_btn .tips_d_text.citys').text("已选择"+children.length+"个市,建议购买“全省”");
-                      $('.tips_btn .tips_d_text.citys').show();
-                  }else{
-                  		$('.tips_btn .tips_d_text.citys').hide();
-                  }
-                  html += `${result[i].name}(`
-                  for(var j = 0;j < children.length;j++){
-                      childrenArr.push(children[j].name)
-                      if (j != children.length - 1) {
-                          html += `${children[j].name}、`
-                      } else {
-                          html += `${children[j].name}`
-                      }
-                  }
-                  if(i !=result.length -1){
-                      html += `)、`
-                  }else{
-                      html += `)`
-                  }
-                  this.selectObj[result[i].name]=childrenArr;//
-              }else{
-                  if(i !=result.length -1){
-                      html += `${result[i].name}、`
-                  }else{
-                      html += `${result[i].name}`
-                  }
-                  this.selectObj[result[i].name]=[];//
-              }
-          }
-          	for (var x = 0; x < provincesArr.length; x++) {
-	            for (var j =x+1; j <provincesArr.length; ) {
-	                if (provincesArr[x] === provincesArr[j]){
-	                    provincesArr.splice(j, 1);
-	                }
-	                else j++;
-	            }
-	        }
-          	if(provincesArr.length > 9){
-          		$('.tips_d_text.all').text("已选择"+provincesArr.length+"个省,建议购买“全国”");
-          		$('.tips_d_text.all').show();
-          		$('.tips_d_text.citys').hide();
-          	}else{
-          		$('.tips_d_text.all').hide();
-          	}
-//        console.log("this.selectObj:",this.selectObj)
-          $('.result_name').append(html)
-          AreaChoose.isOpen()
-        },
-        submitArea:function(){
-          let addCity = $('.result_name').text(); //新增的城市
-          sessionStorage.setItem("vipSubSelectAreaUpgrade",JSON.stringify(AreaChoose.selectObj));
-          history.go(-1);
-        },
-        isAllSelected:function(){
-          var _f = true
-          $($('.tab_content .city')).each(function (index, dom) {
-              if ($(dom).hasClass('active')) {
-                  _f = false
-                  $('.other').prop('checked', false);
-              }
-          })
-          // 如果循环结束仍为true说明 没有全部都被选中
-          if (_f) {
-//            $('.other').prop('checked', true);
-				$(".tips_btn .btns .reset-btn").attr("disabled","disabled");
-        		$(".tips_btn .btns .save-btn").attr("disabled","disabled");
-          }
-        },
-        isOpen:function(){
-          let pHeight = $('.result_text').height()
-          let minHeight = $('.result_text').css('min-height')
-          let rows = Math.round(Math.round(pHeight)/ parseFloat(minHeight));
-          $(".select-area-box .area-list").css("margin-top",$('.result_text').height()+20);
-//        console.log("高度:"+ pHeight,"最小高度"+ minHeight,"行数:" + rows)
-          if(rows == 1){
-              if(length >= 50){
-                  $('.detail').show()
-                  $('.packup').hide()
-              }else{
-                  $('.detail').hide()
-                  $('.packup').hide()
-              }
-          }else if(rows == 2){
-//            console.log($('.result_name').html().trim().length)
-              let length = $('.result_name').html().trim().length;
-              if(length >= 50){
-                  $('.detail').show()
-                  $('.packup').hide()
-              }else{
-                  $('.detail').hide()
-                  $('.packup').hide()
-              }
-              
-          } else{
-              $('.packup').show()
-              $('.detail').hide()
-          }
-        },
-        inintClick:function(){
-//      	$('.tab_content').each(function(){
-//        		AreaChoose.showSelected(false);
-//      	})
-          $('.detail').click(function () {  
-                $('.result_text').removeClass('line_two')
-                $(".result").css("padding-bottom","0.3rem")
-                $(this).hide();
-                $('.packup').show()
-                $(".select-area-box .area-list").css("margin-top",$('.result_text').height()+20);
-            })
-            $('.packup').click(function () { 
-                $(".result").css("padding-bottom","0.2rem")
-                $('.result_text').addClass('line_two')
-                $(this).hide();
-                $('.detail').show()
-                $(".select-area-box .area-list").css("margin-top",$('.result_text').height()+20);
-            })
-            $("body").on('click','.slide a',function(){
-                var s = $(this).html()
-                if(s == '#'){
-                    return;
-                }
-                document.querySelector('#' + s).scrollIntoView({block:'center'});
-            })
-          $(".select-area-box .tab:not(.municipality)").on('click', function (event) {
-                if($(this).next('.tab_content:not(:animated)').css("display") == "block"){
-                    $(this).children().children('i').css({
-                        "display":"inline-block",
-                        "transform":"rotate(0)"
-                    })
-                }else{
-                    $(this).children().children('i').css({
-                        "display":"inline-block",
-                        "transform":"rotate(-180deg)"
-                    })
-                }
-                $(this).toggleClass('selected').next('.tab_content:not(:animated)').stop(true, true).slideToggle()
-                $(this).parent().siblings().children('.tab').removeClass('selected');
-                
-            })
-            $('.checkbox').click(function (e) {  
-                e.stopPropagation();
-            })
-            $('.province .checkbox:not(.other)').on('change', function () {
-                var isCheckded = $(this).is(':checked')
-                if (isCheckded) {
-                    $(this).parents('.tab').siblings('.tab_content').find('.city').addClass('active')
-                    $(this).parents('.tab').siblings('.tab_content').find('.city[disabled]').removeClass('active')
-                    AreaChoose.isAllSelected()
-                    AreaChoose.getResult() 
-                    AreaChoose.showSelected(false);
-                } else {
-                    $(this).parents('.tab').siblings('.tab_content').find('.city').removeClass(
-                        'active')
-                    $(this).parents('.tab').siblings('.tab_content').find('.city').attr('disabled',false);    
-                    AreaChoose.isAllSelected()
-                    AreaChoose.getResult() 
-                    AreaChoose.showSelected(false);
-                }
-            })
-
-            //执行已购买城市函操作dom函数
-            $('.tab_content').on('click', '.city', function () {
-            	AreaChoose.showSelected(false);
-                $(this).toggleClass('active')
-                var isActive = $(this).parent().find('.city.active').length
-                if (isActive) {
-                    var input = $(this).parents('li').find('input.checkbox')
-                    window.input = input
-                    input.prop('checked', true)
-                    AreaChoose.isAllSelected()
-                    AreaChoose.getResult() 
-                } else {
-                    $(this).parent('div').siblings('.tab').children().children('.checkbox').prop(
-                        'checked', false)
-                    AreaChoose.isAllSelected()
-                    AreaChoose.getResult() 
-                }
-            })
-
-            $('.other').on('change', function () { //选择全国
-              	AreaChoose.reset();
-            })
-
-            $('.save-btn').click(function () {  // 提交
-                AreaChoose.submitArea();              
-            })
-            $('.reset-btn').click(function () {  //重置
-//            if(!$(".other").is(':checked')){
-//              $(".other").trigger("click");
-//            }
-				$('.tab:not(.whole):not(.tab[disabled])').removeClass('selected').children('.province').find(
-                    'input').prop({
-                    'checked': false,
-                    "disabled": false
-                });
-                $('.tab_content').find('.city:not(.city[disabled])').removeClass('active').attr({
-                    "disabled": false,
-                    "checked": false
-                })
-				AreaChoose.showSelected(false);
-				AreaChoose.getResult();
-				sessionStorage.removeItem("vipSubSelectAreaUpgrade");
-            })
-            //
-            if(sessionStorage.vipSubSelectAreaUpgrade!==undefined&&sessionStorage.vipSubSelectAreaUpgrade!==""){
-            	let areas = JSON.parse(sessionStorage.vipSubSelectAreaUpgrade);
-            	for(var province in areas){
-            		if(province === "全国"){
-              			$(".other").prop("checked",true);
-              			AreaChoose.reset();
-            		}
-            	}
-            }
-        },
-        reset:function(){
-           var checked = $(".other").is(':checked');
-            if (checked) {
-                $('.tab_content').slideUp(500)
-                $('.tab span i').css({
-                    "display":"inline-block",
-                    "transform":"rotate(0)"
-                })
-                $('.tab:not(.whole):not(.tab[disabled])').removeClass('selected').children('.province').find(
-                    'input').prop({
-                    'checked': false,
-                    "disabled": false
-                });
-                $('.tab_content').find('.city:not(.city[disabled])').removeClass('active').attr({
-                    "disabled": false,
-                    "checked": false
-                })
-                AreaChoose.getResult();
-                $(".tips_btn .btns .reset-btn").removeAttr("disabled");
-            	$(".tips_btn .btns .save-btn").removeAttr("disabled");
-            }else{
-            	AreaChoose.showSelected(false);
-                AreaChoose.getResult();
-                $(".tips_btn .btns .reset-btn").attr("disabled","disabled");
-            	$(".tips_btn .btns .save-btn").attr("disabled","disabled");
-            }
-        }
-      }
-      
-      $(function () {
-            AreaChoose.isOpen()
-            AreaChoose.inintData(); //初始化 已选择和已购买数据
-            AreaChoose.inintPage(); //初始化城市数据
-            AreaChoose.showSelected(false);
-            AreaChoose.showSelected(true);//回显已选择
-            /* 判断已购买的城市 在不在 全部城市里面,在,将按钮置灰,不可点击 */
-
-            AreaChoose.getResult();
-            AreaChoose.inintClick();
-        })
-      //
-        //
-	    function checkObj(obj) {
-		    //检验数组
-		    if (Array.prototype.isPrototypeOf(obj) && obj.length === 0) {
-		        return true;
-		    }
-		    //检验对象
-		    if (Object.prototype.isPrototypeOf(obj) && Object.keys(obj).length === 0) {
-		        return true;
-		    }
-		    return false;
-		}
-	    //
-	    if($(".result_name").text()===""){
-	    	$(".tips_btn .btns .reset-btn").attr("disabled","disabled");
-        	$(".tips_btn .btns .save-btn").attr("disabled","disabled");
-	    }
-	    
-	    if(sessionStorage.vipSubSelectAreaUpgrade!==undefined && sessionStorage.vipSubSelectAreaUpgrade!==""){
-	    	$(".tips_btn .btns .reset-btn").removeAttr("disabled");
-            $(".tips_btn .btns .save-btn").removeAttr("disabled");
-	    }
-
-    </script>
+    <script src="/vipsubscribe/js/updateArea.js?v={{Msg "seo" "version"}}14"></script>
 </body>
 
 </html>

+ 881 - 0
src/web/templates/weixin/vipsubscribe/choose_area_upgrades.html

@@ -0,0 +1,881 @@
+<!DOCTYPE html>
+<html>
+
+<head>
+    <meta charset="utf-8">
+    <title>区域选择</title>
+    <meta name="viewport" content="initial-scale=1, maximum-scale=1">
+    <meta name="apple-mobile-web-app-capable" content="yes">
+    <meta name="apple-mobile-web-app-status-bar-style" content="black">
+    <script src="/vipsubscribe/js/rem.js?v={{Msg "seo" "version"}}"></script>
+    <link rel="stylesheet" href="/vipsubscribe/css/weui.min.css?v={{Msg "seo" "version"}}">
+    <link rel="stylesheet" type="text/css" href="/vipsubscribe/css/base.css?v={{Msg "seo" "version"}}" />
+    <link rel="stylesheet" type="text/css" href="/vipsubscribe/iconfont/iconfont.css?v={{Msg "seo" "version"}}" />
+    <link rel="stylesheet" href="/vipsubscribe/css/public.css?v={{Msg "seo" "version"}}">
+    <link rel="stylesheet" href="/vipsubscribe/css/choose_area.css?v={{Msg "seo" "version"}}4">
+	{{include "/common/weixin.html"}}
+	<!--<script src="{{Msg "seo" "cdn"}}/wxswordfish/share.js?v={{Msg "seo" "version"}}"></script>-->
+	<script src="/vipsubscribe/js/share.js?v={{Msg "seo" "version"}}"></script>
+</head>
+<style type="text/css">
+	body,html {
+		height: 100%;
+	}
+</style>
+<body>
+	<script type="text/javascript">
+		initShare({{.T.signature}},{{.T.openid}},2,"jy_extend",{{.T.nickname}},{{.T.avatar}});
+	</script>
+    <div id="choose_area" >
+        <div class="result">
+            <!-- 首次购买 显示"已选择" -----  升级订阅显示"已新增" -->
+            <p class="result_text line_two"> 已新增:<span class="result_name"></span>
+                <a href="javascript:;" class="detail">详情</a>
+            </p>
+            <a href="javascript:;" class="packup" style="display: none;">收起</a>
+        </div>
+        <div class="form">
+            <div class="select-area-box">
+                <ul class="area-list">
+                    <li>
+                        <div class="tab whole">
+                            <div class="province">
+                                <input type="checkbox" class="checkbox other">全国
+                            </div>
+                        </div>
+                    </li>
+                    <li class="index" id="A">A</li>
+                    <li>
+                        <div class="tab">
+                            <div class="province">
+                                <input type="checkbox" class="checkbox">安徽
+                            </div>
+                            <span><i class="icon iconfont">&#xe600;</i></span>
+                        </div>
+                        <div class="tab_content clearfix"></div>
+                    </li>
+                    <li>
+                        <div class="tab municipality">
+                            <div class="province">
+                                <input type="checkbox" class="checkbox">澳门
+                            </div>
+                        </div>
+                        <div class="tab_content clearfix"></div>
+                    </li>
+                    <li class="index" id="B">B</li>
+                    <li>
+                        <div class="tab municipality">
+                            <div class="province">
+                                <input type="checkbox" class="checkbox">北京
+                            </div>
+                        </div>
+                        <div class="tab_content clearfix"></div>
+                    </li>
+                    <li class="index" id="C">C</li>
+                    <li>
+                        <div class="tab municipality">
+                            <div class="province">
+                                <input type="checkbox" class="checkbox">重庆
+                            </div>
+                        </div>
+                        <div class="tab_content clearfix"></div>
+                    </li>
+                    <li class="index" id="F">F</li>
+                    <li>
+                        <div class="tab">
+                            <div class="province">
+                                <input type="checkbox" class="checkbox">福建
+                            </div>
+                            <span><i class="icon iconfont">&#xe600;</i></span>
+                        </div>
+                        <div class="tab_content clearfix"></div>
+                    </li>
+                    <li class="index" id="G">G</li>
+                    <li>
+                        <div class="tab">
+                            <div class="province">
+                                <input type="checkbox" class="checkbox">广东
+                            </div>
+                            <span><i class="icon iconfont">&#xe600;</i></span>
+                        </div>
+                        <div class="tab_content clearfix"></div>
+                    </li>
+                    <li>
+                        <div class="tab">
+                            <div class="province">
+                                <input type="checkbox" class="checkbox">广西
+                            </div>
+                            <span><i class="icon iconfont">&#xe600;</i></span>
+                        </div>
+                        <div class="tab_content clearfix"></div>
+                    </li>
+                    <li>
+                        <div class="tab">
+                            <div class="province">
+                                <input type="checkbox" class="checkbox">贵州
+                            </div>
+                            <span><i class="icon iconfont">&#xe600;</i></span>
+                        </div>
+                        <div class="tab_content clearfix"></div>
+                    </li>
+                    <li>
+                        <div class="tab">
+                            <div class="province">
+                                <input type="checkbox" class="checkbox">甘肃
+                            </div>
+                            <span><i class="icon iconfont">&#xe600;</i></span>
+                        </div>
+                        <div class="tab_content clearfix"></div>
+                    </li>
+                    <li class="index" id="H">H</li>
+                    <li>
+                        <div class="tab">
+                            <div class="province">
+                                <input type="checkbox" class="checkbox">河北
+                            </div>
+                            <span><i class="icon iconfont">&#xe600;</i></span>
+                        </div>
+                        <div class="tab_content clearfix"></div>
+                    </li>
+                    <li>
+                        <div class="tab">
+                            <div class="province">
+                                <input type="checkbox" class="checkbox">湖北
+                            </div>
+                            <span><i class="icon iconfont">&#xe600;</i></span>
+                        </div>
+                        <div class="tab_content clearfix"></div>
+                    </li>
+                    <li>
+                        <div class="tab">
+                            <div class="province">
+                                <input type="checkbox" class="checkbox">黑龙江
+                            </div>
+                            <span><i class="icon iconfont">&#xe600;</i></span>
+                        </div>
+                        <div class="tab_content clearfix"></div>
+                    </li>
+                    <li>
+                        <div class="tab">
+                            <div class="province">
+                                <input type="checkbox" class="checkbox">海南
+                            </div>
+                            <span><i class="icon iconfont">&#xe600;</i></span>
+                        </div>
+                        <div class="tab_content clearfix"></div>
+                    </li>
+                    <li>
+                        <div class="tab">
+                            <div class="province">
+                                <input type="checkbox" class="checkbox">河南
+                            </div>
+                            <span><i class="icon iconfont">&#xe600;</i></span>
+                        </div>
+                        <div class="tab_content clearfix"></div>
+                    </li>
+                    <li>
+                        <div class="tab">
+                            <div class="province">
+                                <input type="checkbox" class="checkbox">湖南
+                            </div>
+                            <span><i class="icon iconfont">&#xe600;</i></span>
+                        </div>
+                        <div class="tab_content clearfix"></div>
+                    </li>
+                    <p class="index" id="J">J</p>
+                    <li>
+                        <div class="tab">
+                            <div class="province">
+                                <input type="checkbox" class="checkbox">吉林
+                            </div>
+                            <span><i class="icon iconfont">&#xe600;</i></span>
+                        </div>
+                        <div class="tab_content clearfix"></div>
+                    </li>
+                    <li>
+                        <div class="tab">
+                            <div class="province">
+                                <input type="checkbox" class="checkbox">江苏
+                            </div>
+                            <span><i class="icon iconfont">&#xe600;</i></span>
+                        </div>
+                        <div class="tab_content clearfix"></div>
+                    </li>
+                    <li>
+                        <div class="tab">
+                            <div class="province">
+                                <input type="checkbox" class="checkbox">江西
+                            </div>
+                            <span><i class="icon iconfont">&#xe600;</i></span>
+                        </div>
+                        <div class="tab_content clearfix"></div>
+                    </li>
+                    <li class="index" id="L">L</li>
+                    <li>
+                        <div class="tab">
+                            <div class="province">
+                                <input type="checkbox" class="checkbox">辽宁
+                            </div>
+                            <span><i class="icon iconfont">&#xe600;</i></span>
+                        </div>
+                        <div class="tab_content clearfix"></div>
+                    </li>
+                    <li class="index" id="N">N</li>
+                    <li>
+                        <div class="tab">
+                            <div class="province">
+                                <input type="checkbox" class="checkbox">内蒙古
+                            </div>
+                            <span><i class="icon iconfont">&#xe600;</i></span>
+                        </div>
+                        <div class="tab_content clearfix"></div>
+                    </li>
+                    <li>
+                        <div class="tab">
+                            <div class="province">
+                                <input type="checkbox" class="checkbox">宁夏
+                            </div>
+                            <span><i class="icon iconfont">&#xe600;</i></span>
+                        </div>
+                        <div class="tab_content clearfix"></div>
+                    </li>
+                    <li class="index" id="Q">Q</li>
+                    <li>
+                        <div class="tab">
+                            <div class="province">
+                                <input type="checkbox" class="checkbox">青海
+                            </div>
+                            <span><i class="icon iconfont">&#xe600;</i></span>
+                        </div>
+                        <div class="tab_content clearfix"></div>
+                    </li>
+                    <li class="index" id="S">S</li>
+                    <li>
+                        <div class="tab">
+                            <div class="province">
+                                <input type="checkbox" class="checkbox">山西
+                            </div>
+                            <span><i class="icon iconfont">&#xe600;</i></span>
+                        </div>
+                        <div class="tab_content clearfix"></div>
+                    </li>
+                    <li>
+                        <div class="tab">
+                            <div class="province">
+                                <input type="checkbox" class="checkbox">陕西
+                            </div>
+                            <span><i class="icon iconfont">&#xe600;</i></span>
+                        </div>
+                        <div class="tab_content clearfix"></div>
+                    </li>
+                    <li>
+                        <div class="tab municipality">
+                            <div class="province">
+                                <input type="checkbox" class="checkbox">上海
+                            </div>
+                        </div>
+                        <div class="tab_content clearfix"></div>
+                    </li>
+                    <li>
+                        <div class="tab">
+                            <div class="province">
+                                <input type="checkbox" class="checkbox">山东
+                            </div>
+                            <span><i class="icon iconfont">&#xe600;</i></span>
+                        </div>
+                        <div class="tab_content clearfix"></div>
+                    </li>
+                    <li>
+                        <div class="tab">
+                            <div class="province">
+                                <input type="checkbox" class="checkbox">四川
+                            </div>
+                            <span><i class="icon iconfont">&#xe600;</i></span>
+                        </div>
+                        <div class="tab_content clearfix"></div>
+                    </li>
+                    <li class="index" id="T">T</li>
+                    <li>
+                        <div class="tab municipality">
+                            <div class="province">
+                                <input type="checkbox" class="checkbox">天津
+                            </div>
+                        </div>
+                        <div class="tab_content clearfix"></div>
+                    </li>
+                    <li>
+                        <div class="tab municipality">
+                            <div class="province">
+                                <input type="checkbox" class="checkbox">台湾
+                            </div>
+                        </div>
+                        <div class="tab_content clearfix"></div>
+                    </li>
+                    <li class="index" id="X">X</li>
+                    <li>
+                        <div class="tab">
+                            <div class="province">
+                                <input type="checkbox" class="checkbox">西藏
+                            </div>
+                            <span><i class="icon iconfont">&#xe600;</i></span>
+                        </div>
+                        <div class="tab_content clearfix"></div>
+                    </li>
+                    <li>
+                        <div class="tab">
+                            <div class="province">
+                                <input type="checkbox" class="checkbox">新疆
+                            </div>
+                            <span><i class="icon iconfont">&#xe600;</i></span>
+                        </div>
+                        <div class="tab_content clearfix"></div>
+                    </li>
+                    <li>
+                        <div class="tab municipality">
+                            <div class="province">
+                                <input type="checkbox" class="checkbox">香港
+                            </div>
+                        </div>
+                        <div class="tab_content clearfix"></div>
+                    </li>
+                    <li class="index" id="Y">Y</li>
+                    <li>
+                        <div class="tab">
+                            <div class="province">
+                                <input type="checkbox" class="checkbox">云南
+                            </div>
+                            <span><i class="icon iconfont">&#xe600;</i></span>
+                        </div>
+                        <div class="tab_content clearfix"></div>
+                    </li>
+                    <li class="index" id="Z">Z</li>
+                    <li>
+                        <div class="tab">
+                            <div class="province">
+                                <input type="checkbox" class="checkbox">浙江
+                            </div>
+                            <span class="down-icon"><i class="icon iconfont">&#xe600;</i></span>
+                        </div>
+                        <div class="tab_content clearfix"></div>
+                    </li>
+                </ul>
+                
+            </div>
+        </div>
+        <div class="tips_btn">
+            <div class="tips_discount">
+                <!--<div class="tips_d_money" style="display: block">&yen;38</div>-->
+                <div class="tips_d_text citys">已选择4个市,建议购买“全省”。</div>
+                <div class="tips_d_text all">已选择10个省,建议购买“全国”。</div>
+            </div>
+            <div class="btns">
+                <button class="reset-btn">重置</button>
+                <button class="save-btn">确认</button>
+            </div>
+        </div>
+        <div class="slide">
+            <a href="javascript:;">#</a>
+            <a href="javascript:;">A</a>
+            <a href="javascript:;">B</a>
+            <a href="javascript:;">C</a>
+            <a href="javascript:;">F</a>
+            <a href="javascript:;">G</a>
+            <a href="javascript:;">H</a>
+            <a href="javascript:;">J</a>
+            <a href="javascript:;">L</a>
+            <a href="javascript:;">N</a>
+            <a href="javascript:;">Q</a>
+            <a href="javascript:;">S</a>
+            <a href="javascript:;">T</a>
+            <a href="javascript:;">X</a>
+            <a href="javascript:;">Y</a>
+            <a href="javascript:;">Z</a>
+        </div>
+    </div>
+    <script src="/vipsubscribe/js/jquery-2.1.4.js?v={{Msg "seo" "version"}}"></script>
+    <!--<script src="/vipsubscribe/js/fastclick.js?v={{Msg "seo" "version"}}"></script>-->
+    <script src="/vipsubscribe/js/mapJSON.js?v={{Msg "seo" "version"}}"></script>
+    <script src="/vipsubscribe/js/common.js?v={{Msg "seo" "version"}}"></script>
+    <script>
+    	//已购买
+    	var buystr = "";
+    	var areaData = {};
+        $DoPost("/subscribepay/renewUpgrade/getBuyMsg", {}, function (data) {
+        	if(data){
+            	buystr = data.area;
+            	areaData["data"] = {
+            		"area" : data.area,
+            		"buyset" : data.buyset, 
+            	}
+            	console.log(areaData)
+        	}
+        }, false);
+//      console.log(buystr)
+      var AreaChoose={
+        selectObj:{},//已选择,未购买城市;
+        buyObj:{},//已购买
+        selectedIndustryArr:["一个行业"],//计算价格临时变量
+        timeSelect:[1,2],//计算价格临时变量 timeSelect[0]时长  timeSelect[1] 1:年 2:月
+        vipSubisTrial:false,
+        inintData:function(){
+          //已选择
+          try{
+            let select =sessionStorage.getItem("vipSubSelectAreaUpgrade");
+            if(select){
+              this.selectObj=JSON.parse(select);
+            }
+            if(sessionStorage.getItem("vipSubSelectIndustryUpgrade")){
+              this.selectedIndustryArr=JSON.parse(sessionStorage.getItem("vipSubSelectIndustryUpgrade"));
+            }
+            if(sessionStorage.getItem("vipSubSelectTime")){
+              this.timeSelect=JSON.parse(sessionStorage.getItem("vipSubSelectTime"));
+            }
+            //
+            this.buyObj = buystr;
+            if(checkObj(buystr)){
+            	this.buyObj = {"全国":[]}
+            }
+//          console.log(this.buyObj)
+            //是否试用界面
+            if(sessionStorage.getItem("vipSubisTrial")) this.vipSubisTrial=true;
+          }catch(e){
+            console.log(e);
+            this.selectObj={};
+          }
+        },
+        inintPage:function(){//初始化省份城市选项   
+          $(".select-area-box ul li:not('.index')").each(function () {
+              var text = $(this).find(".province").text().trim()
+              var data = null
+              chinaMapJSON.some(function (v) {
+                  data = v
+                  return v.name.indexOf(text) !== -1
+              })
+              var box = $(this).find('div.tab_content')
+              var html = AreaChoose.createMoreCity(data.city)
+              box.html(html)
+          })
+        },
+        createMoreCity:function(arr){
+          var tempHtml = arr.map(function (v) {
+                return '<button class="city">' + v.name + '</button>'
+            }).join('')
+            return tempHtml
+        },
+        showSelected:function(canClick){ //回显已选择
+        	var ran = "";
+            if(canClick){
+            	ran = this.selectObj;
+            }else{
+            	ran = this.buyObj;
+            }    
+            for(var province in ran) {
+      			let citys=ran[province]
+	            if(citys.length>0){//地市
+	                this.selectCity(citys,canClick)
+	            }else{//省份
+	                this.selectProvince(province,canClick)
+	            }
+	        }
+        },
+        selectProvince:function(province,canClick){ //设置选中省份 province 省份
+          $($('.tab .province')).each(function (index, dom) {
+            if (province == $.trim($(dom).text())) {
+              $(".checkbox.other").attr("checked", false); //取消全国选中
+              $(dom).children('.checkbox').attr({"checked": true,"disabled":!canClick});//选中此省份
+              if(canClick){
+              	$(dom).parents().siblings('.tab_content').find(".city").addClass("active").attr({"disabled":!canClick});
+              }else{
+              	$(dom).parents().siblings('.tab_content').find(".city").attr({"disabled":!canClick});
+              }
+            }
+            if(!canClick){
+            	if(province === "全国"){
+	            	$('.tab .province').each(function(){
+	            		$(this).children('.checkbox').attr({"checked": true,"disabled":!canClick});//选中此省份
+	            	});
+	            	$('.tab_content .city').each(function(){
+	            		$(this).attr("disabled",!canClick);
+	            	});
+	            }
+            }
+          })
+        },
+        selectCity:function(citys,canClick){ //设置选中城市
+          citys.forEach(v => {
+            $($('.tab_content .city')).each(function (index, dom) {
+                if (v == $(dom).text()) {
+                    $(".checkbox.other").attr("checked", false); //取消全国选中
+                    if(canClick){
+                    	$(dom).addClass('active').attr('disabled', !canClick).parents().siblings('.tab')
+                        .addClass('selected').children('.province').children('.checkbox').attr({
+                            "checked": true
+                        })
+                    }else{
+                    	$(dom).attr('disabled', !canClick).parents().siblings('.tab')
+                        .addClass('selected').children('.province').children('.checkbox').attr({
+                            "checked": true,
+                            "disabled": "disabled"
+                        })
+                        $(dom).parents().slideDown(500);
+                    }
+                }
+            })
+          })
+        },
+        getResult:function(){   /* 选中结果 */
+          //如果选中所有,则转为全国
+          if($(".city").length==$(".city.active").length){
+            $(".checkbox.other").trigger("click");
+            return
+          }
+          this.selectObj = {};
+          $('.result_name').empty()
+          var data = []; //定义一个总数组
+          var cityArr =[]; //定义一个选中城市数组
+          var provincesArr = [];
+          var val = $('.other').parents('.province').text().trim();
+          if ($('.other').is(':checked')) {
+            // data.push(val)
+            data =[{name:val,children:[]}] //全国
+          }
+          $(".tab_content").find(".city.active:not('[disabled]')").each(function () {
+              var length = $(this).parent('.tab_content').find('.city').length; //省份下城市的length
+              var activeLeng = $(this).parent('.tab_content').find('.city.active').length; //省份下选中城市的length
+              let arr =[];
+              // 判断省份下的城市是否等于选中的城市长度,相等就是全部选中
+              if (length == activeLeng) {
+                  $('.tips_btn .tips_d_text.citys').hide();
+                  // data.push($(this).parent('.tab_content').siblings('.tab:not(.whole)').children('.province').text().trim())
+                  let province = $(this).parent('.tab_content').siblings('.tab:not(.whole)').children('.province').text().trim();
+                  data.push({
+                      name:province,
+                      children:[]
+                  });
+                  provincesArr.push(province);
+              } else { 
+                  let province = $(this).parent('.tab_content').siblings('.tab:not(.whole)').children('.province').text().trim();
+                  let city = $(this).html()
+                  arr.push({name:city,parent:province})
+                  for(let i =0;i<arr.length;i++){
+                      let obj ={};
+                      obj.name = arr[i].name;
+                      obj.parent = arr[i].parent;
+                      cityArr.push(obj)
+                  }
+                  data.push({
+                      name:province,
+                      children:cityArr
+                  })
+              }
+              if(activeLeng > 0){
+              	$(".tips_btn .btns .reset-btn").removeAttr("disabled");
+              	$(".tips_btn .btns .save-btn").removeAttr("disabled");
+              }
+          })
+          //数组对象去重
+          let obj = {};
+          data = data.reduce((cur,next) =>{
+              obj[next.name] ? "" : obj[next.name] = true && cur.push(next);
+              return cur
+          },[]);
+          
+          // 数组筛选
+          let result = data.map(v =>{
+              let filterArr = v.children.filter(s =>{
+                 return s.parent === v.name
+              })
+              return {
+                  name:v.name,
+                  children:filterArr
+              }
+          })
+          var html = '';
+          for (var i = 0; i < result.length; i++) {
+              let children = result[i].children;
+              if( children.length >0){
+                  // 判断每个省份下选中的城市长度,当大于等于4的时候 弹出"选择全省更划算的弹窗"
+                  let childrenArr=[];
+                  if (children.length >= 3 && !this.vipSubisTrial) {
+                      $('.tips_btn .tips_d_text.citys').text("已选择"+children.length+"个市,建议购买“全省”");
+                      $('.tips_btn .tips_d_text.citys').show();
+                  }else{
+                  		$('.tips_btn .tips_d_text.citys').hide();
+                  }
+                  html += `${result[i].name}(`
+                  for(var j = 0;j < children.length;j++){
+                      childrenArr.push(children[j].name)
+                      if (j != children.length - 1) {
+                          html += `${children[j].name}、`
+                      } else {
+                          html += `${children[j].name}`
+                      }
+                  }
+                  if(i !=result.length -1){
+                      html += `)、`
+                  }else{
+                      html += `)`
+                  }
+                  this.selectObj[result[i].name]=childrenArr;//
+              }else{
+                  if(i !=result.length -1){
+                      html += `${result[i].name}、`
+                  }else{
+                      html += `${result[i].name}`
+                  }
+                  this.selectObj[result[i].name]=[];//
+              }
+          }
+          	for (var x = 0; x < provincesArr.length; x++) {
+	            for (var j =x+1; j <provincesArr.length; ) {
+	                if (provincesArr[x] === provincesArr[j]){
+	                    provincesArr.splice(j, 1);
+	                }
+	                else j++;
+	            }
+	        }
+          	if(provincesArr.length > 9){
+          		$('.tips_d_text.all').text("已选择"+provincesArr.length+"个省,建议购买“全国”");
+          		$('.tips_d_text.all').show();
+          		$('.tips_d_text.citys').hide();
+          	}else{
+          		$('.tips_d_text.all').hide();
+          	}
+//        console.log("this.selectObj:",this.selectObj)
+          $('.result_name').append(html)
+          AreaChoose.isOpen()
+        },
+        submitArea:function(){
+          let addCity = $('.result_name').text(); //新增的城市
+          sessionStorage.setItem("vipSubSelectAreaUpgrade",JSON.stringify(AreaChoose.selectObj));
+          history.go(-1);
+        },
+        isAllSelected:function(){
+          var _f = true
+          $($('.tab_content .city')).each(function (index, dom) {
+              if ($(dom).hasClass('active')) {
+                  _f = false
+                  $('.other').prop('checked', false);
+              }
+          })
+          // 如果循环结束仍为true说明 没有全部都被选中
+          if (_f) {
+//            $('.other').prop('checked', true);
+				$(".tips_btn .btns .reset-btn").attr("disabled","disabled");
+        		$(".tips_btn .btns .save-btn").attr("disabled","disabled");
+          }
+        },
+        isOpen:function(){
+          let pHeight = $('.result_text').height()
+          let minHeight = $('.result_text').css('min-height')
+          let rows = Math.round(Math.round(pHeight)/ parseFloat(minHeight));
+          $(".select-area-box .area-list").css("margin-top",$('.result_text').height()+20);
+//        console.log("高度:"+ pHeight,"最小高度"+ minHeight,"行数:" + rows)
+          if(rows == 1){
+              if(length >= 50){
+                  $('.detail').show()
+                  $('.packup').hide()
+              }else{
+                  $('.detail').hide()
+                  $('.packup').hide()
+              }
+          }else if(rows == 2){
+//            console.log($('.result_name').html().trim().length)
+              let length = $('.result_name').html().trim().length;
+              if(length >= 50){
+                  $('.detail').show()
+                  $('.packup').hide()
+              }else{
+                  $('.detail').hide()
+                  $('.packup').hide()
+              }
+              
+          } else{
+              $('.packup').show()
+              $('.detail').hide()
+          }
+        },
+        inintClick:function(){
+//      	$('.tab_content').each(function(){
+//        		AreaChoose.showSelected(false);
+//      	})
+          $('.detail').click(function () {  
+                $('.result_text').removeClass('line_two')
+                $(".result").css("padding-bottom","0.3rem")
+                $(this).hide();
+                $('.packup').show()
+                $(".select-area-box .area-list").css("margin-top",$('.result_text').height()+20);
+            })
+            $('.packup').click(function () { 
+                $(".result").css("padding-bottom","0.2rem")
+                $('.result_text').addClass('line_two')
+                $(this).hide();
+                $('.detail').show()
+                $(".select-area-box .area-list").css("margin-top",$('.result_text').height()+20);
+            })
+            $("body").on('click','.slide a',function(){
+                var s = $(this).html()
+                if(s == '#'){
+                    return;
+                }
+                document.querySelector('#' + s).scrollIntoView({block:'center'});
+            })
+          $(".select-area-box .tab:not(.municipality)").on('click', function (event) {
+                if($(this).next('.tab_content:not(:animated)').css("display") == "block"){
+                    $(this).children().children('i').css({
+                        "display":"inline-block",
+                        "transform":"rotate(0)"
+                    })
+                }else{
+                    $(this).children().children('i').css({
+                        "display":"inline-block",
+                        "transform":"rotate(-180deg)"
+                    })
+                }
+                $(this).toggleClass('selected').next('.tab_content:not(:animated)').stop(true, true).slideToggle()
+                $(this).parent().siblings().children('.tab').removeClass('selected');
+                
+            })
+            $('.checkbox').click(function (e) {  
+                e.stopPropagation();
+            })
+            $('.province .checkbox:not(.other)').on('change', function () {
+                var isCheckded = $(this).is(':checked')
+                if (isCheckded) {
+                    $(this).parents('.tab').siblings('.tab_content').find('.city').addClass('active')
+                    $(this).parents('.tab').siblings('.tab_content').find('.city[disabled]').removeClass('active')
+                    AreaChoose.isAllSelected()
+                    AreaChoose.getResult() 
+                    AreaChoose.showSelected(false);
+                } else {
+                    $(this).parents('.tab').siblings('.tab_content').find('.city').removeClass(
+                        'active')
+                    $(this).parents('.tab').siblings('.tab_content').find('.city').attr('disabled',false);    
+                    AreaChoose.isAllSelected()
+                    AreaChoose.getResult() 
+                    AreaChoose.showSelected(false);
+                }
+            })
+
+            //执行已购买城市函操作dom函数
+            $('.tab_content').on('click', '.city', function () {
+            	AreaChoose.showSelected(false);
+                $(this).toggleClass('active')
+                var isActive = $(this).parent().find('.city.active').length
+                if (isActive) {
+                    var input = $(this).parents('li').find('input.checkbox')
+                    window.input = input
+                    input.prop('checked', true)
+                    AreaChoose.isAllSelected()
+                    AreaChoose.getResult() 
+                } else {
+                    $(this).parent('div').siblings('.tab').children().children('.checkbox').prop(
+                        'checked', false)
+                    AreaChoose.isAllSelected()
+                    AreaChoose.getResult() 
+                }
+            })
+
+            $('.other').on('change', function () { //选择全国
+              	AreaChoose.reset();
+            })
+
+            $('.save-btn').click(function () {  // 提交
+                AreaChoose.submitArea();              
+            })
+            $('.reset-btn').click(function () {  //重置
+//            if(!$(".other").is(':checked')){
+//              $(".other").trigger("click");
+//            }
+				$('.tab:not(.whole):not(.tab[disabled])').removeClass('selected').children('.province').find(
+                    'input').prop({
+                    'checked': false,
+                    "disabled": false
+                });
+                $('.tab_content').find('.city:not(.city[disabled])').removeClass('active').attr({
+                    "disabled": false,
+                    "checked": false
+                })
+				AreaChoose.showSelected(false);
+				AreaChoose.getResult();
+				sessionStorage.removeItem("vipSubSelectAreaUpgrade");
+            })
+            //
+            if(sessionStorage.vipSubSelectAreaUpgrade!==undefined&&sessionStorage.vipSubSelectAreaUpgrade!==""){
+            	let areas = JSON.parse(sessionStorage.vipSubSelectAreaUpgrade);
+            	for(var province in areas){
+            		if(province === "全国"){
+              			$(".other").prop("checked",true);
+              			AreaChoose.reset();
+            		}
+            	}
+            }
+        },
+        reset:function(){
+           var checked = $(".other").is(':checked');
+            if (checked) {
+                $('.tab_content').slideUp(500)
+                $('.tab span i').css({
+                    "display":"inline-block",
+                    "transform":"rotate(0)"
+                })
+                $('.tab:not(.whole):not(.tab[disabled])').removeClass('selected').children('.province').find(
+                    'input').prop({
+                    'checked': false,
+                    "disabled": false
+                });
+                $('.tab_content').find('.city:not(.city[disabled])').removeClass('active').attr({
+                    "disabled": false,
+                    "checked": false
+                })
+                AreaChoose.getResult();
+                $(".tips_btn .btns .reset-btn").removeAttr("disabled");
+            	$(".tips_btn .btns .save-btn").removeAttr("disabled");
+            }else{
+            	AreaChoose.showSelected(false);
+                AreaChoose.getResult();
+                $(".tips_btn .btns .reset-btn").attr("disabled","disabled");
+            	$(".tips_btn .btns .save-btn").attr("disabled","disabled");
+            }
+        }
+      }
+      
+      $(function () {
+            AreaChoose.isOpen()
+            AreaChoose.inintData(); //初始化 已选择和已购买数据
+            AreaChoose.inintPage(); //初始化城市数据
+            AreaChoose.showSelected(false);
+            AreaChoose.showSelected(true);//回显已选择
+            /* 判断已购买的城市 在不在 全部城市里面,在,将按钮置灰,不可点击 */
+
+            AreaChoose.getResult();
+            AreaChoose.inintClick();
+        })
+      //
+        //
+	    function checkObj(obj) {
+		    //检验数组
+		    if (Array.prototype.isPrototypeOf(obj) && obj.length === 0) {
+		        return true;
+		    }
+		    //检验对象
+		    if (Object.prototype.isPrototypeOf(obj) && Object.keys(obj).length === 0) {
+		        return true;
+		    }
+		    return false;
+		}
+	    //
+	    if($(".result_name").text()===""){
+	    	$(".tips_btn .btns .reset-btn").attr("disabled","disabled");
+        	$(".tips_btn .btns .save-btn").attr("disabled","disabled");
+	    }
+	    
+	    if(sessionStorage.vipSubSelectAreaUpgrade!==undefined && sessionStorage.vipSubSelectAreaUpgrade!==""){
+	    	$(".tips_btn .btns .reset-btn").removeAttr("disabled");
+            $(".tips_btn .btns .save-btn").removeAttr("disabled");
+	    }
+
+    </script>
+</body>
+
+</html>

+ 0 - 1
src/web/templates/weixin/vipsubscribe/choose_industry_upgrade.html

@@ -28,7 +28,6 @@
             <div class="result">
                 <span class="label buyset">已购买:2/3个行业</span><br>
                 <span style="display: none;" class="label addUpgrade">升级新增:2个行业</span>
-                <!--<span class="result_name">全部行业</span>-->
             </div>
             <div class="form">
                 <div class="select-area-box">

+ 2 - 2
src/web/templates/weixin/vipsubscribe/keyWord.html

@@ -138,7 +138,7 @@
                     <strong class="weui-dialog__title">快速导入</strong>
                 </div>
                 <div class="weui-dialog__bd">
-                    快速导入可将免费版招标订阅内所设置的关键词及其排除词一并导入至“未分类"关键词分类内,无需再次手动输入,简化您的订阅过程。
+                    快速导入可将免费版招标订阅内所设置的关键词及其排除词一并导入至“未分类"关键词分类内,无需再次手动输入,简化您的订阅过程。
 					<p style="color:#888;">注:地区与行业分类以VIP订阅设置内为准,不做导入。</p>
                 </div>
                 <div class="weui-dialog__ft">
@@ -722,7 +722,7 @@
 		    var agent = navigator.userAgent.toLowerCase();
 		    var dialog = $('.classify-fast-pop .weui-dialog')
 		    if( /iphone|ipod|ipad|ios/.test(agent) ){
-		        dialog.css({ 'top': '30%' })
+		        dialog.css({ 'top': '40%' })
 		    } else {
 		        dialog.css({ 'top': '50%' })
 		    }

+ 4 - 4
src/web/templates/weixin/vipsubscribe/renew_notice.html

@@ -154,8 +154,8 @@
 			}else{
 				$DoPost("/subscribepay/renewUpgrade/getBuyMsg", {}, function (data) {
 					if(data){
-						var area = data.area;
-					    var buyerclass = data.buyerclass;
+						var area = data.allarea;
+					    var buyerclass = data.allindustry;
 					    var startTime = data.start;
 					    var endTime = data.end;
 					    var exprie = {{.T.exprie}};
@@ -234,10 +234,10 @@
 				if(flags){
 					return
 				};
-				window.location.href = "/weixin/pay/renewPayPage";
+				window.location.replace("/weixin/pay/renewPayPage");
 			});
 			$(".aginBuy").on("click",function(){
-				window.location.href = "/weixin/pay/vipsubscribe_new?orderCode="+orderCode;
+				window.location.replace("/weixin/pay/vipsubscribe_new?orderCode="+orderCode);
 			});
 	        //
 		    function checkObj(obj) {

+ 10 - 29
src/web/templates/weixin/vipsubscribe/renew_pay.html

@@ -48,11 +48,11 @@
             <ul class="chooseList">
                 <li class="detail_item">
                         <div class="item_info item_area">
-                            <span class="label">已订阅区域:</span>
+                            <span class="label">已购买区域:</span>
                             <span class="label_for">河南省、郑州市、洛阳市、淮南市</span>
                         </div>
                         <div class="item_info item_industry">
-                            <span class="label">已订阅行业:</span>
+                            <span class="label">已购买行业:</span>
                             <span class="label_for">保监、城管保监</span>
                         </div>
                         <div class="item_info item_cycle">
@@ -314,17 +314,6 @@
 	    	}
             $('#time_cycle').show(200);
         })
-        // 选择支付方式
-//      $('.select_payment .choose_way').click(function () {
-//          $('#pay_way').show(200);
-//      })
-//      // 对支付方式选择的input绑定点击事件
-//      $('#pay_way input:radio[name="way"]').click(function () {
-//          var checkValue = $('input:radio[name="way"]:checked').val();
-//          console.log(checkValue);
-//          $('.pay_way').hide(200);
-//          $('.pay_mode .select_payment .choose_way.info').html(checkValue);
-//      });
         
         // 对订阅周期弹框的input绑定点击事件
         $('#time_cycle input:radio[name="time"]').on('click', function (e) {
@@ -607,9 +596,9 @@
 			    var buyerclassHtml = "";
 			    var dateName = "";
 			    var dateHtml = "";
-			    if (area !== "" && area !== undefined){
-			    	for(var province in area){
-			    		var citys = area[province]
+			    if (areas !== "" && areas !== undefined){
+			    	for(var province in areas){
+			    		var citys = areas[province]
 		//	    		console.log(citys);
 			    		if(citys.length===0){
 			    			provinceArr.push(province);
@@ -624,30 +613,22 @@
 			 		var cityLen = cityArr.length;
 			    	areaHtml = provinceLen+"个省级区域、"+cityLen+"个市";
 			    	
-					if(checkObj(area)){
+					if(checkObj(areas)){
 						areaHtml = "全国";
 					}
 			    	$(".item_area .label_for").text(areaHtml);
 			    }
-			    if(buyerclass !== "" && buyerclass !== undefined){
-			    	for(var i in buyerclass){
-			    		var industry = buyerclass[i];
+			    if(industrys !== "" && industrys !== undefined){
+			    	for(var i in industrys){
+			    		var industry = industrys[i];
 			    		buyerclassArr.push(industry);
 			    		buyerclassHtml = buyerclassArr.length+"个行业";
 			    	}
-			    	if(checkObj(buyerclass)){
+			    	if(checkObj(industrys)){
 			    		buyerclassHtml = "全行业";
 			    	}
 			    	$(".item_industry .label_for").text(buyerclassHtml);
 			    }
-//			    if(cycleunit !== "" && cycleunit !== undefined){
-//			    	if(cycleunit === 1){
-//			    		dateName = cyclecount + " 年";
-//			    	}else if(cycleunit === 2){
-//			    		dateName = cyclecount + " 个月";
-//			    	}
-//			    	$(".item_cycle .label_for").text(dateName);
-//			    }
 			    if(startTime !== "" && endTime !== "" && startTime !== undefined && endTime !== undefined){
 			    	console.log(startTime)
 			    	var start = startTime.replace(/-/g, ".");

+ 59 - 79
src/web/templates/weixin/vipsubscribe/vip_order_detail.html

@@ -231,85 +231,64 @@ try{
         if(r.data.order.filter){
             var filterObj=JSON.parse(r.data.order.filter);
         	if (r.data.order.vip_type!=2){
-            //省份数 城市数
-            if(!$.isEmptyObject(filterObj.area)){
-              var cityNum=0;
-              var provinceNum=0;
-              for(var i in filterObj.area) {
-                let citys=filterObj.area[i];
-                if(citys.length>0){
-                  cityNum+=citys.length;
-                }else{
-                  provinceNum++;
-                }
-              }
-              var areaText="";//1个省级区域、4个地市
-              if(provinceNum>0) areaText= areaText + provinceNum+"个省级区域";
-              if(cityNum>0){
-                if(provinceNum>0) areaText= areaText+"、"
-                areaText = areaText+ cityNum+"个地市";
-              }
-              $(".areaNum").text(areaText);
-            }else{
-              $(".areaNum").text("全国");
-            }
-            //行业数
-	        if(filterObj.industry.length!=0){
-	            $(".industryNum").text(filterObj.industry.length+"个行业");
+	            //省份数 城市数
+	            if(!$.isEmptyObject(filterObj.area)){
+	              	var cityNum=0;
+	              	var provinceNum=0;
+	              	for(var i in filterObj.area) {
+		                let citys=filterObj.area[i];
+		                if(citys.length>0){
+		                  cityNum+=citys.length;
+		                }else{
+		                  	provinceNum++;
+		                }
+	              	}
+	              	var areaText="";//1个省级区域、4个地市
+	              	if(provinceNum>0) areaText= areaText + provinceNum+"个省级区域";
+	              	if(cityNum>0){
+	                	if(provinceNum>0) areaText= areaText+"、"
+	                	areaText = areaText+ cityNum+"个地市";
+	            	}
+	              	$(".areaNum").text(areaText);
+	            }else{
+	            	$(".areaNum").text("全国");
+	            }
+	            //行业数
+		        if(filterObj.industry.length!=0){
+		            $(".industryNum").text(filterObj.industry.length+"个行业");
+		        }else{
+		            $(".industryNum").text("全行业");
+		        }
 	        }else{
-	            $(".industryNum").text("全行业");
+	         	//升级订单 单独处理
+				if(!$.isEmptyObject(filterObj.addareacount)){
+					if((filterObj.addareacount.province==0)&&(filterObj.addareacount.city==0)){
+						areaText="全国";
+					}
+					if((filterObj.addareacount.province!=0)&&(filterObj.addareacount.city==0)){
+						areaText=filterObj.addareacount.province+"个省级区域";
+					}
+					if((filterObj.addareacount.province==0)&&(filterObj.addareacount.city!=0)){
+						areaText=filterObj.addareacount.city+"个地市";
+					}
+					if((filterObj.addareacount.province!=0)&&(filterObj.addareacount.city!=0)){
+						areaText=filterObj.addareacount.province+"个省级区域、"+filterObj.addareacount.city+"个地市";
+					}
+				}else{
+					areaText="无";
+				}
+				$(".areaNum").text(areaText);
+	         	//行业
+	         	var industry_vip="";
+				industry_vip=filterObj.addbuyerclasscount+"个行业";
+				if(filterObj.addbuyerclasscount==0){
+					industry_vip="无";
+				}
+				if(filterObj.addbuyerclasscount==-1){
+					industry_vip="全行业";
+				}
+				$(".industryNum").text(industry_vip);
 	        }
-         }else{
-         	//升级订单 单独处理
-         	if(!$.isEmptyObject(filterObj.addarea)){
-              var cityNum_u=0;
-              var provinceNum_u=0;
-         	for(var i in filterObj.addarea) {
-                let citys_u=filterObj.addarea[i];
-                if (citys_u=="no"){
-                	$(".areaNum").text("无");
-                }else{
-                	 if (citys_u.length>0){
-	                	cityNum_u+=citys_u.length;
-	                }else{
-	                	provinceNum_u++;
-	                }
-	                var areaText_u="";//1个省级区域、4个地市
-	                if(provinceNum_u>0) areaText_u= areaText_u + provinceNum_u+"个省级区域";
-	                if(cityNum_u>0){
-	                  if(provinceNum_u>0) areaText_u= areaText_u+"、"
-	                  areaText_u = areaText_u+ cityNum_u+"个地市";
-	                }
-              		$(".areaNum").text(areaText_u);
-              	}
-              }
-         	}else {
-         		$(".areaNum").text("全国");
-         	}
-         	//行业
-         	if(filterObj.addindustry[0]=="no"){
-         		$(".industryNum").text("无");
-         	}else{
-         		if(filterObj.addindustry.length==0){
-         			$(".industryNum").text("全行业");
-         		}else{
-         			$(".industryNum").text(filterObj.addindustry.length+"个行业");
-         		}
-         	}
-
-//			if(filterObj.addindustry.length==0){
-//       		$(".industryNum").text("全行业");
-//          }else{
-//          	if(filterObj.addindustry[0]=="no"){
-//          		$(".industryNum").text("无");
-//          	}else{
-//          		$(".industryNum").text(filterObj.addindustry.length+"个行业");
-//          	}
-//          }
-         }
-          
-          
-          
         }
         
         //周期
@@ -347,8 +326,9 @@ try{
 	    		$(".cyclecount").text(year+"年");
 	    	}else if(year === 0&& month !==0){
 	    		$(".cyclecount").text(month+"个月");
-	    	}else {
-	    		$(".cyclecount").text("7天");
+	    	}
+			if(filterObj.cycleunit==3){
+	    		$(".cyclecount").text(filterObj.cyclecount+"天")
 	    	}
        }else{
        		//未支付

+ 120 - 418
src/web/templates/weixin/vipsubscribe/vip_upgrade.html

@@ -50,7 +50,6 @@
                         <input type="text" id="area" value="" disabled placeholder="选择升级区域" class="info">
                         <i class="iconfont icon-arrow"></i>
                     </a>
-                    <!--<p class="add_tips area-list" style="display: none;">已新增 1 个省级区域、4 个地市</p>-->
                 </li>
                 <li class="choose_item">
                     <a href="/front/vipsubscribe/toChooseIndustryUpgrade">
@@ -58,22 +57,7 @@
                         <input type="text" id="buyerclass" disabled value="" placeholder="选择升级行业" class="info">
                         <i class="iconfont icon-arrow"></i>
                     </a>
-                    <!--<p class="add_tips industry-list" style="display: none;">已新增 2 个行业</p>-->
                 </li>
-                <!-- <li class="choose_item select_cycle">
-                    <a href="javascript:;">
-                        <span class="label">订阅周期</span>
-                        <input type="text" disabled value="" placeholder="选择年、月" class="info choose_time">
-                        <i class="iconfont icon-arrow choose_time"></i>
-                    </a>
-                </li> -->
-                <!--<li class="choose_item choose_effect_date">
-                    <a href="javascript:;">
-                        <span class="label">生效日期</span>
-                        <span class="info" id="effect_date_name">立即生效,需支付当月费用差价</span>
-                        <i class="iconfont icon-arrow choose_time"></i>
-                    </a>
-                </li>-->
             </ul>
             <ul class="chooseList">
                 <li class="choose_item lengthen">
@@ -89,7 +73,6 @@
                     <a href="javascript:;">
                         <span class="label">支付方式</span>
                         <span class="info choose_way weixin_pay">微信支付</span>
-                        <!--<i class="iconfont icon-arrow choose_way"></i>-->
                     </a>
                 </div>
                 <div class="vip_rules">
@@ -158,7 +141,6 @@
             <div class="price">
                 <label>需补差价:</label>
                 <p>
-                    <!--<span class="old_price">&yen;610.80</span>-->
                     <strong class="finally_price">&yen;0.00</strong>
                 </p> 
             </div>
@@ -233,46 +215,10 @@
                     </div>
                 </div>
                 <div class="form-btn">
-                    <!-- <button class="btn enter" disabled id="enter_period">确认</button> -->
                     <button class="btn enter" id="enter_period">确认</button>
                 </div>
             </div>
         </div>
-        <!-- 选择生效日期 -->
-        <!--<div class="js_dialog effective_date" id="effective_date" style="display: none;">
-            <div class="weui-mask"></div>
-            <div class="box">
-                <div class="box_hd">
-                    <span style="font-size:0.32rem;">生效日期</span>
-                    <h3></h3>
-                    <span class="cancel">取消</span>
-                </div>
-                <div class="box_bd">
-                    <div class="weui-cells weui-cells_checkbox choose-form">
-                        <label class="weui-cell weui-check__label now_label effect_one" for="nowTime">
-                            <div class="weui-cell__bd read">
-                                <p class="effective_name now">立即生效,需支付当月费用差价</p>
-                                <p class="effective_time nownow">2019.08.23 - 2020.06.06</p>
-                            </div>
-                            <div class="weui-cell__hd">
-                                <input type="radio" class="weui-check" name="date" value="立即生效,需支付当月费用差价" id="nowTime" checked />
-                                <i class="weui-icon-checked"></i>
-                            </div>
-                        </label>
-                        <label class="weui-cell weui-check__label next_label effect_next" for="nextMonth">
-                            <div class="weui-cell__bd read">
-                                <p class="effective_name notnow"></p>
-                                <p class="effective_time notnownow">2019.09.01 - 2020.06.06</p>
-                            </div>
-                            <div class="weui-cell__hd">
-                                <input type="radio" class="weui-check" name="date" value="" id="nextMonth" />
-                                <i class="weui-icon-checked"></i>
-                            </div>
-                        </label>
-                    </div>
-                </div>
-            </div>
-        </div>-->
         <!-- 选择支付方式 -->
         <div class="js_dialog pay_way" id="pay_way" style="display: none;">
             <div class="weui-mask"></div>
@@ -293,15 +239,6 @@
                                 <i class="weui-icon-checked"></i>
                             </div>
                         </label>
-                        <!--<label class="weui-cell weui-check__label zfb_label" for="zfb">
-                            <div class="weui-cell__bd read">
-                                <p><img src="/vipsubscribe/image/zhifubao.png">支付宝支付</p>
-                            </div>
-                            <div class="weui-cell__hd">
-                                <input type="radio" class="weui-check" name="way" value="支付宝支付" id="zfb" />
-                                <i class="weui-icon-checked"></i>
-                            </div>
-                        </label>-->
                     </div>
                 </div>
             </div>
@@ -358,22 +295,6 @@
 						},500)*/
 						checkPaySuccess(ordercode);
 					}
-					
-//					}else if(r.err_msg == "get_brand_wcpay_request:cancel"){               
-////	                	alert("开发环境【支付跳转完成】")
-//		                try{
-////		  					window.location.replace("/front/vipsubscribe/toPaySuccessPage?orderCode="+ordercode);
-////		                	window.location.reload();
-//		                }catch(e){
-//		                  alert(e)
-//		                }
-//	  				}else{
-//	                	weui.toast("系统异常,请稍微再试",{
-//	                  		duration: 2000,
-//	                  		className: 'custom-toast',
-//	                	});
-//	  				}
-  				});
   			}   
 		}catch(e){
 		  console.log(e)
@@ -442,6 +363,11 @@
 	        	sessionStorage.removeItem("vipSubSelectIndustryAdd");
 	        }
         }
+        if(sessionStorage.vipSubSelectAreaAdd!==undefined&&sessionStorage.vipSubSelectAreaAdd!==""){
+        	if(checkObj(JSON.parse(sessionStorage.vipSubSelectAreaAdd))){
+	        	sessionStorage.removeItem("vipSubSelectAreaAdd");
+	        }
+        }
         //
 		var monthPrice = "";
         var yearPrice = "";
@@ -454,77 +380,6 @@
         }
         $('.weui-mask').click(hideDialog);
         $('.cancel').click(hideDialog);
-       
-        // 选择支付方式
-//      $('.select_payment .choose_way').click(function () {
-//          $('#pay_way').show(200);
-//      })
-//      // 对支付方式选择的input绑定点击事件
-//      $('#pay_way input:radio[name="way"]').click(function () {
-//          var checkValue = $('input:radio[name="way"]:checked').val();
-//          console.log(checkValue);
-//          $('.pay_way').hide(200);
-//          $('.pay_mode .select_payment .choose_way.info').html(checkValue);
-//      });
-         // 选择生效日期
-//      $('.choose_effect_date > a').click(function () {
-//          $('#effective_date').show(200);
-//			var nowMonths = new Date().getMonth()+1;
-//			var nowYears = new Date().getFullYear();
-//			var as = nowMonths +1;
-//			if(as > 12){
-//				as = as-12;
-//				nowYears = nowYears +1;
-//			}
-//			var bs = nowYears+"/"+as+"/1";
-//			var effects = new Date(bs).getTime() /1000;
-//			var a = nowYears+"."+as+".01";
-//			$(".notnownow").text(a + " - " + endTime.replace(/-/g, "."))
-//			if(ends < effects){
-//				$(".effect_next").hide();
-////				$(".box").css("height", "2.7rem");
-//			}
-//			if(!isvalidOk){
-//				console.log(isvalidOk)
-//				$(".effect_one").hide();
-//				$(".effective_name").each(function(){
-//		    		if($(this).text() === effectiveNames){
-//		    			$(this).parent().next().find("input").prop("checked", true);
-//		    		}
-//		    	})
-//			}
-//      })
-        //
-//		var effectiveName = new Date().getMonth()+2;
-//		if(effectiveName > 12){
-//	    	effectiveName = effectiveName - 12
-//	   	}
-//		var effectiveNames = effectiveName+"月1日生效"
-//		$(".effective_name.notnow").text(effectiveNames);
-//		$('#nextMonth').val(effectiveNames);
-		
-        // 对生效日期方式选择的input绑定点击事件
-//      $('#effective_date input:radio[name="date"]').click(function () {
-//          var checkValue = $('input:radio[name="date"]:checked').val();
-////          console.log(checkValue);
-//          $('#effective_date').hide(200);
-//          var effective = "";
-//          var effectiveName = new Date().getMonth()+2;
-//          if(effectiveName > 12){
-//	    		effectiveName = effectiveName - 12
-//	    	}
-//          var effectiveNames = effectiveName+"月1日生效"
-//          if(checkValue === "立即生效,需支付当月费用差价"){
-//          	effective = "now";
-//          }else if(checkValue === effectiveNames){
-//          	effective = "notnow";
-//          }
-//          sessionStorage.effectiveDate = effective;
-//          $('#effect_date_name').html(checkValue);
-//          FinallyPrice();
-//      });
-        
-        
         // 选择周期
         $('.lengthen > a').click(function () {
         	if((nowRenew)>=36){
@@ -548,17 +403,12 @@
                 // 按月订阅
                 $('.computed_price').show()
                 // 显示隐藏tips提示
-                // $('#time_cycle .tips.monthly_tips').show();
-                // $('#time_cycle .tips.yearly_tips').hide();
 
                 $('#number_box_month').addClass('active');
                 $('#number_box_year span').removeClass('active');
             } else if($(e.target).hasClass('yearly')){
                 $('.computed_price').show()
                 // 按年订阅
-                // $('#time_cycle .tips.yearly_tips').show();
-                // $('#time_cycle .tips.monthly_tips').hide();
-
                 $('#number_box_month').removeClass('active');
             }else{
                 $('.computed_price').hide()
@@ -629,11 +479,6 @@
             $('.computed_price').html('¥' + price)
             var firstButton = $('#number_box_month button:first')
             var lastButton = $('#number_box_month button:last')
-//          if (currentNum >= 10) {
-//              $('.profit_tips').show()
-//          } else {
-//              $('.profit_tips').hide()
-//          }
             // 如果为操作后的结果为1,则锁定减号按钮
             if (currentNum === data.numboxMin) {
                 firstButton.attr('disabled', true)
@@ -788,44 +633,20 @@
         	$("#buy").prop("checked", bCheck);
         }
         //新增区域
-	    if(sessionStorage.vipSubSelectAreaUpgrade!==""&&sessionStorage.vipSubSelectAreaUpgrade!==undefined){
-			var vipSubSelectArea = JSON.parse(sessionStorage.vipSubSelectAreaUpgrade);
-			var provinceArr = [];
-			var cityArr = [];
-			var isAll = "";
-			$(".area-list").show();
-			for (var province in vipSubSelectArea){
-				if(vipSubSelectArea[province].length > 0){
-					var citys = vipSubSelectArea[province];
-					for (var i in citys){
-						var city = citys[i];
-						cityArr.push(city);
-					}
-				}else{
-					provinceArr.push(province);
-				}
-				if(province === "全国"){
-					isAll = "all";
-				}
-			}
-			var provinceLen = provinceArr.length;
-			var cityLen = cityArr.length;
-			var areaHtml = "";
-			if(isAll === ""){
-				areaHtml = "已新增 "+ provinceLen +" 个省级区域、"+ cityLen +" 个地市";
-				$("#area").attr("placeholder", areaHtml);
-			}else{
+	    if(sessionStorage.vipSubSelectAreaAdd!==""&&sessionStorage.vipSubSelectAreaAdd!==undefined&&sessionStorage.vipSubSelectCity!==undefined&&sessionStorage.vipSubSelectCity!==""){
+			var vipSubSelectArea = JSON.parse(sessionStorage.vipSubSelectAreaAdd);
+			let cityLen = sessionStorage.vipSubSelectCity;
+			if(vipSubSelectArea.country === -1){
 				areaHtml = "已新增全国";
 				$("#area").attr("placeholder", areaHtml);
-			}
-			if(provinceLen === 0 && cityLen === 0){
-				areaHtml = "选择升级区域";
+			}else{
+				areaHtml = "已新增 "+ vipSubSelectArea.province +" 个省级区域、"+ cityLen +" 个地市";
 				$("#area").attr("placeholder", areaHtml);
 			}
 	    }
 	    //新增行业
-	    if(sessionStorage.vipSubSelectIndustryUpgrade!==""&&sessionStorage.vipSubSelectIndustryUpgrade!==undefined){
-	    	var vipSubSelectIndustry = JSON.parse(sessionStorage.vipSubSelectIndustryUpgrade);
+	    if(sessionStorage.vipSubSelectIndustryAdd!==""&&sessionStorage.vipSubSelectIndustryAdd!==undefined){
+	    	var vipSubSelectIndustry = JSON.parse(sessionStorage.vipSubSelectIndustryAdd);
 	    	var industryArr = [];
 	    	var isAll = "";
 	    	var industryHtml = "";
@@ -850,40 +671,7 @@
 				$("#buyerclass").attr("placeholder", industryHtml);
 			}
 	    }
-	    //生效时间
-//	    if(sessionStorage.effectiveDate !== ""&&sessionStorage.effectiveDate!==undefined){
-//	    	var effective = sessionStorage.effectiveDate;
-//	    	var effectiveHtml = "";
-//	    	if(effective === "now"){
-//	    		effectiveHtml = "立即生效,需支付当月费用差价";
-//	    	}else if(effective === "notnow"){
-//	    		var effectiveName = new Date().getMonth()+2;
-//	    		if(effectiveName > 12){
-//	    			effectiveName = effectiveName - 12
-//	    		}
-//	    		effectiveHtml = effectiveName+"月1日生效";
-//	    	}
-//	    	$(".effective_name").each(function(){
-//	    		if($(this).text() === effectiveHtml){
-//	    			$(this).parent().next().find("input").prop("checked", true);
-//	    		}
-//	    	})
-//	    	$('#effect_date_name').html(effectiveHtml);
-//	    }
-//	    //支付方式
-//	    if(sessionStorage.payType!==""&&sessionStorage.payType!==undefined){
-//	    	var payType = sessionStorage.payType;
-//	    	var payHtml = "";
-//	    	if(payType === "wx"){
-//	    		payHtml = "微信支付";
-//	    	}else if(payType === "alipy"){
-//	    		payHtml = "支付宝支付";
-//	    	}
-//	    	$('input:radio[name="way"]').val(payHtml);
-//	    	$('input:radio[name="way"]').prop("checked", true);
-//	    	$("#payType").text(payHtml);
-//	    }
-
+		//
 		if(sessionStorage.upgrade_cyclecount!==undefined&&sessionStorage.upgrade_cycleunit!==undefined){
 	 		var cycleunit = sessionStorage.upgrade_cycleunit;
 	 		var cyclecount = sessionStorage.upgrade_cyclecount;
@@ -913,9 +701,6 @@
 	 		$('.choose_item.lengthen .info').text("不延长");
 	 		$(".computed_price").hide();
 	 	}
-	 	
-//	 	if(sessionStorage.vipSubSelectArea!==""&&sessionStorage.vipSubSelectArea!==undefined&&)
-	 	
 	 	//
 	 	var area = "";
 	    var buyerclass = "";
@@ -927,7 +712,6 @@
 	    var starts = "";
 	    var endTime = "";
 	    var ends = "";
-//	    var isvalidOk = "";
 	 	$DoPost("/subscribepay/renewUpgrade/getBuyMsg", {}, function (data) {
             if (data) {
                 area = data.area;
@@ -940,61 +724,6 @@
 			    starts = data.starttime;
 			    endTime = data.end;
 			    ends = data.endtime;
-//			    isvalidOk = data.isvalidOk;
-			    //
-//			    var provinceArr = [];
-//			    var cityArr = [];
-//			    var areaHtml = "";
-//			    var buyerclassArr = [];
-//			    var buyerclassHtml = "";
-		//	    var dateName = "";
-		//	    var dateHtml = "";
-//			    if (area !== "" && area !== undefined){
-//			    	for(var province in area){
-//			    		var citys = area[province]
-//		//	    		console.log(citys);
-//			    		if(citys.length===0){
-//			    			provinceArr.push(province);
-//			    		}else{
-//			    			for(var i in citys){
-//			    				cityArr.push(citys[i]);
-//			    			}
-//			    		}
-//			    	}
-//			    	var provinceLen = provinceArr.length;
-//			 		var cityLen = cityArr.length;
-//			    	areaHtml = "已购买"+provinceLen+"个省级区域/"+cityLen+"个市";
-//		//	    	$(".item_area .label_for").text(areaHtml);
-//					if(checkObj(area)){
-//						areaHtml = "已购买全国";
-//					}
-//			    	$('#area').attr("placeholder",areaHtml);
-//			    }
-//			    if(buyerclass !== "" && buyerclass !== undefined){
-//			    	for(var i in buyerclass){
-//			    		var industry = buyerclass[i];
-//			    		buyerclassArr.push(industry);
-//			    		buyerclassHtml = "已购买"+buyerclassArr.length+"个行业";
-//			    	}
-//		//	    	$(".item_industry .label_for").text(buyerclassHtml);
-//					if(checkObj(buyerclass)){
-//						buyerclassHtml = "已购买全行业";
-//					}
-//					$('#buyerclass').attr("placeholder",buyerclassHtml);
-//			    }
-//			    //
-//			    var nowDate = data.now.replace(/-/g, ".");
-//			    var a = nowDate+ " - " +endTime;
-//			    $(".nownow").text(nowDate+ " - " +endTime.replace(/-/g, "."))
-			    //
-//			    if(!isvalidOk){
-//			    	var effectiveName = new Date().getMonth()+2;
-//		    		if(effectiveName > 12){
-//		    			effectiveName = effectiveName - 12
-//		    		}
-//		    		effectiveHtml = effectiveName+"月1日生效";
-//		    		$("#effect_date_name").text(effectiveHtml);
-//			    }
 			}
         },false);
         //
@@ -1003,6 +732,7 @@
         var oldYearPrice = 0;
         var oldMonthPrice = 0;
         var areasArr = {};
+        var areas_arr = {};
 	    var industrysArr = [];
 	    var allArea = {};
 	    var allIndustry = [];
@@ -1036,19 +766,16 @@
 				for(let province in vipArea){
 		    		let citys = vipArea[province];
 		    		if(citys.length===0){
-						areasArr[province] = [];
+						areas_arr[province] = [];
 		    		}else{
-		    			areasArr[province] = citys;
+		    			areas_arr[province] = citys;
 		    		}
 		    	}
 				for(let province in vipArea){
 		    		if(province === "全国"){
-						areasArr = {"全国":[]};
+						areas_arr = {"全国":[]};
 					}
 		    	}
-				if(buyCheck){
-					$(".save_upgrade").removeAttr("disabled");
-				}
 				if(area !== ""&&area !== undefined){
 					for(let province in area){
 			    		let citys = area[province];
@@ -1087,8 +814,17 @@
 						}
 					}
 				}
+				if(sessionStorage.vipSubSelectAreaAdd!==""&&sessionStorage.vipSubSelectAreaAdd!==undefined){
+					areasArr = addAreaObj();
+				}else{
+					areasArr = null;
+				}
+				if(buyCheck){
+					$(".save_upgrade").removeAttr("disabled");
+				}
 			}else{
-				areasArr = null;
+				areas_arr = null
+				areasArr = null
 				if(buyArea !== ""&&buyArea !== undefined){
 					for(let province in buyArea){
 			    		let citys = buyArea[province];
@@ -1100,63 +836,20 @@
 			    	}
 				}
 			}
-//			if(sessionStorage.vipSubSelectAreaUpgrade!==""&&sessionStorage.vipSubSelectAreaUpgrade!==undefined){
-//				var vipArea = JSON.parse(sessionStorage.vipSubSelectAreaUpgrade);
-//				if(area !== ""&&area !== undefined){
-//					for(let province in area){
-//			    		let citys = area[province];
-//			    		if(citys.length===0){
-//							areasArr[province] = [];
-//			    		}else{
-//			    			areasArr[province] = citys;
-//			    		}
-//			    	}
-//					for(let province in vipArea){
-//						let citys = vipArea[province];
-//						if(areasArr[province] === undefined){
-//							areasArr[province] = citys
-//						}else{
-//							let cityArr = [];
-//							for(let i in citys){
-//								cityArr.push(citys[i]);
-//							}
-//							for(let i in areasArr[province]){
-//								cityArr.push(areasArr[province][i]);
-//							}
-//							//
-//							for (var x = 0; x < cityArr.length; x++) {
-//					            for (var j =x+1; j <cityArr.length; ) {
-//					                if (cityArr[x] === cityArr[j]){
-//					                    cityArr.splice(j, 1);
-//					                }
-//					                else j++;
-//					            }
-//					       	}
-//							//
-//							areasArr[province] = cityArr;
-//						}
-//						if(province === "全国"){
-//							areasArr = {"全国":[]};
-//						}
-//					}
-//				}
-//				console.log($(".save_upgrade").attr("disabled"))
-//				if(buyCheck){
-//					$(".save_upgrade").removeAttr("disabled");
-//				}
-//			}else{
-//				if(area !== ""&&area !== undefined){
-//					for(let province in area){
-//			    		let citys = area[province];
-//			    		if(citys.length===0){
-//							areasArr[province] = [];
-//			    		}else{
-//			    			areasArr[province] = citys;
-//			    		}
-//			    	}
-//				}
-//			}
-
+			//
+			if(sessionStorage.vipSubSelectIndustryAdd!==""&&sessionStorage.vipSubSelectIndustryAdd!==undefined){
+				var vipIndustry = JSON.parse(sessionStorage.vipSubSelectIndustryAdd);
+				for(let i in vipIndustry){
+		    		let industry = vipIndustry[i];
+		    		industrysArr.push(industry);
+		        }
+				for(let i in vipIndustry){
+					if(industry === "全部行业"){
+						industrysArr = ["全部行业"];
+					}
+				}
+			}
+			//
 			console.log("areasArr",areasArr)
 			if(sessionStorage.vipSubSelectIndustryAdd!==""&&sessionStorage.vipSubSelectIndustryAdd!==undefined){
 				var vipIndustry = JSON.parse(sessionStorage.vipSubSelectIndustryAdd);
@@ -1169,6 +862,8 @@
 						industrysArr = ["全部行业"];
 					}
 				}
+			}else{
+				industrysArr = null;
 			}
 			
 			if(sessionStorage.vipSubSelectIndustryUpgrade!==""&&sessionStorage.vipSubSelectIndustryUpgrade!==undefined){
@@ -1190,7 +885,6 @@
 					$(".save_upgrade").removeAttr("disabled");
 				}
 			}else{
-				industrysArr = null;
 				if(buyIndustry!==""&&buyIndustry!==undefined){
 					for(let i in buyIndustry){
 			    		let industry = buyIndustry[i];
@@ -1198,33 +892,7 @@
 			    	}
 			    }
 			}
-			
-//			if(sessionStorage.vipSubSelectIndustryUpgrade!==""&&sessionStorage.vipSubSelectIndustryUpgrade!==undefined){
-//				var vipIndustry = JSON.parse(sessionStorage.vipSubSelectIndustryUpgrade);
-//				if(buyerclass!==""&&buyerclass!==undefined){
-//					for(let i in buyerclass){
-//			    		let industry = buyerclass[i];
-//			    		industrysArr.push(industry);
-//			        }
-//					for(let i in vipIndustry){
-//						let industry = vipIndustry[i];
-//						industrysArr.push(industry);
-//						if(industry === "全部行业"){
-//							industrysArr = ["全部行业"];
-//						}
-//					}
-//				}
-//				if(buyCheck){
-//					$(".save_upgrade").removeAttr("disabled");
-//				}
-//			}else{
-//				if(buyerclass!==""&&buyerclass!==undefined){
-//					for(let i in buyerclass){
-//			    		let industry = buyerclass[i];
-//			    		industrysArr.push(industry);
-//			    	}
-//			    }
-//			}
+			//
 			if(industrysArr !== null){
 				for (var x = 0; x < industrysArr.length; x++) {
 		            for (var j =x+1; j <industrysArr.length; ) {
@@ -1245,16 +913,6 @@
 	       	}
 			
 			console.log("industrysArr",industrysArr);
-//			if(sessionStorage.effectiveDate !== ""&&sessionStorage.effectiveDate!==undefined){
-//				let eff = sessionStorage.effectiveDate;
-//				if(eff === "now"){
-//					effect = "now";
-//				}else{
-//					effect = "notnow";
-//				}
-//			}else{
-//				effect = "now";
-//			}
 			//
 			if(endYear === nowYear){
 				if(endMonth === nowMonth){
@@ -1290,14 +948,6 @@
 			nowRenew = nowUpgrade;
 			console.log("monthold",nowUpgrade)
 			//
-//			if(effect === "notnow"){
-//				nowUpgrade = nowUpgrade -1;
-//			}
-//			if(nowUpgrade == 0){
-//				nowUpgrade = 1;
-//			}
-			
-			//
 			var nowUpgradeYear = 0;
 			if(nowUpgrade >= 12 && nowUpgrade < 24){
 				nowUpgradeYear = Math.floor(nowUpgrade / 12);
@@ -1402,6 +1052,9 @@
 					sessionStorage.upgrade_price = "¥"+price;
 					sessionStorage.proPrice = price;
 				}else if(sessionStorage.upgrade_cycleunit === "2"){
+					if(Number(sessionStorage.upgrade_cyclecount)>10){
+						sessionStorage.upgrade_cyclecount = 10;
+					}
 					let price = (Number(sessionStorage.upgrade_cyclecount)*completeMonth).toFixed(1);
 					sessionStorage.upgrade_price = "¥"+price;
 					sessionStorage.proPrice = price;
@@ -1417,10 +1070,7 @@
 				console.log("proprice",proPrice);
 				cPrice = (Number(cPrice) + Number(proPrice)).toFixed(1);
 			}
-//			if(effect === "notnow"){
-//				cPrice = cPrice -(completeMonth - oldMonthPrice);
-//			}
-			if(cPrice < 0){
+			if(cPrice <= 0){
 				cPrice = 0;
 			}
 			$(".finally_price").html("¥"+cPrice);
@@ -1442,20 +1092,7 @@
         
         //
         $(".save_upgrade").on("click", function(){
-        	$(".save_upgrade").attr("disabled","disabled")
-//      	let effective = $("#effect_date_name").text();
-//      	var effect = "now";
-//      	if(effective !== "立即生效,需支付当月费用差价"){
-//				let nowMonth = new Date().getMonth()+1;
-//				let nowYear = new Date().getFullYear();
-//				let a = nowMonth +1;
-//      		if(a > 12){
-//      			a = a-12;
-//      			nowYear = nowYear +1;
-//      		}
-//      		let b = nowYear+"/"+a+"/1";
-//      		effect = new Date(b).getTime() /1000;
-//      	}
+        	$(".save_upgrade").attr("disabled","disabled");
         	//
         	let areas = areasArr;
         	let industrys = null;
@@ -1480,6 +1117,15 @@
         	}else{
         		industryArr = "no";
         	}
+        	//
+        	if(areas_arr !== null){
+        		if(areas_arr["全国"]){
+	                areas_arr={};
+	            }
+        		areas_arr = JSON.stringify(areas_arr);
+        	}else{
+        		areas_arr = "no";
+        	}
             //
             let areaarr = buyArea;
         	let industryarr = buyIndustry;
@@ -1497,20 +1143,33 @@
             if(renew_time !== "不延长"){
             	times = $('.choose_item.lengthen .info').text();
             }
+            //
+            let vipCount = null;
+            if(sessionStorage.vipAddCount!==undefined&&sessionStorage.vipAddCount!==""){
+            	vipCount = JSON.stringify(JSON.parse(sessionStorage.vipAddCount));
+            }
+            let vipIndustry = 0
+            if(industrysArr!==null){
+            	if(industrysArr.length==1&&industrysArr[0]=="全部行业"){
+	                vipIndustry = -1;
+	            }else{
+	            	vipIndustry = industrysArr.length;
+	            }
+            }
             //
 	    	var param = {
-	    		"area": areaArr,
+	    		"area": areas_arr,
 	    		"industry": industryArr,
 	    		"areas": JSON.stringify(areaarr),
+	    		"areas_arr": areaArr,
 	    		"industryarr": industryarr.join(","),
 	    		"allArea": JSON.stringify(allAreaArr),
 	    		"allIndustry": allIndustryArr.join(","),
 	    		"payWay": "wx_js",
-//	    		"effect": effect,
 	    		"pay_source" : "Upgrade",
 	    		"time": times,
-//	    		"nowUp": Number(nowRenew),
-//	    		"isvalidOk" : isvalidOk,
+	    		"addCount":vipCount,
+	    		"addIndustryCount": vipIndustry,
 	    	}
 	    	console.log(param)
 	    	$DoPost("/subscribepay/renewUpgrade/renewUpgradeCreateOrder",param,function(r){
@@ -1530,7 +1189,9 @@
 	    	sessionStorage.removeItem("vipSubSelectAreaUpgrade");
 	    	sessionStorage.removeItem("vipSubSelectIndustryUpgrade");
 	    	sessionStorage.removeItem("vipSubSelectIndustryAdd");
-//	    	sessionStorage.removeItem("effectiveDate");
+	    	sessionStorage.removeItem("vipSubSelectAreaAdd");
+	    	sessionStorage.removeItem("vipAddCount");
+	    	sessionStorage.removeItem("vipSubSelectCity");
 	    	sessionStorage.removeItem("buyCheck");
 	    }
 	    
@@ -1547,6 +1208,47 @@
 		    }
 		    return false;
 		}
+	    //
+	    function addAreaObj(){
+	    	let areaObj = JSON.parse(sessionStorage.vipSubSelectAreaUpgrade)
+	    	let buyset = JSON.parse(sessionStorage.vipSubSelectAreaAdd)
+	    	//
+	    	let provinceArr = [];
+	    	let areasObj = {};
+	    	if(buyset.country === -1){
+	    		areasObj["全国"] = [];
+	    	}else{
+	    		for(let province in areaObj){
+	//	    		console.log("666666",buyset.citys[province]);
+					let cityLen = areaObj[province].length
+		    		if(cityLen === 0){
+		    			provinceArr.push(province);
+		    		}else{
+		    			let citys = areaObj[province];
+		    			for(let i in buyset.city){
+		    				let cityCount = buyset.city[i];
+		    				if(province === i){
+		    					if(cityLen > cityCount){
+					    			let reduce = cityLen - cityCount;
+					    			areasObj[province] = citys.slice(0, -reduce);
+					    		}
+		    				}
+		    			}
+		    		}
+		    	}
+	    		if(provinceArr.length > buyset.province){
+	    			let reduce = provinceArr.length - buyset.province;
+	    			provinceArr = provinceArr.slice(0, -reduce);
+	    		}
+	    		console.log(provinceArr)
+	    		for(let a in provinceArr){
+	    			let province = provinceArr[a];
+	    			areasObj[province] = [];
+	    		}
+	    		console.log(areasObj)
+	    	}
+	    	return areasObj
+	    }
 	    
     </script>
 </body>