浏览代码

Merge branch 'dev4.4' of http://192.168.3.207:10080/qmx/jy into dev4.4

TANGSHIZHE 4 年之前
父节点
当前提交
e187fd015b
共有 21 个文件被更改,包括 2452 次插入480 次删除
  1. 9 0
      src/jfw/modules/app/src/web/staticres/jyapp/vipsubscribe/css/vip_renew.css
  2. 6 2
      src/jfw/modules/app/src/web/staticres/jyapp/vipsubscribe/js/choose_area.js
  3. 330 330
      src/jfw/modules/app/src/web/staticres/jyapp/vipsubscribe/js/common.js
  4. 312 0
      src/jfw/modules/app/src/web/staticres/jyapp/vipsubscribe/js/price.js
  5. 6 7
      src/jfw/modules/app/src/web/staticres/jyapp/vipsubscribe/js/vip_renew.js
  6. 17 11
      src/jfw/modules/app/src/web/staticres/jyapp/vipsubscribe/js/vip_upgrade.js
  7. 58 0
      src/jfw/modules/app/src/web/templates/vipsubscribe/vip_UpgradeDetail.html
  8. 36 6
      src/jfw/modules/app/src/web/templates/vipsubscribe/vip_UpgradePage.html
  9. 9 2
      src/jfw/modules/app/src/web/templates/vipsubscribe/vip_index_new.html
  10. 12 54
      src/jfw/modules/app/src/web/templates/vipsubscribe/vip_renew.html
  11. 1 2
      src/jfw/modules/subscribepay/src/entity/subscribeVip.go
  12. 1 2
      src/jfw/modules/subscribepay/src/service/vipSubscribeChange.go
  13. 17 8
      src/jfw/modules/subscribepay/src/service/vipSubscribePay.go
  14. 9 0
      src/web/staticres/vipsubscribe/css/vip_renew.css
  15. 433 0
      src/web/staticres/vipsubscribe/css/vip_upgrade.css
  16. 3 0
      src/web/staticres/vipsubscribe/js/choose_area.js
  17. 1 1
      src/web/staticres/vipsubscribe/js/common.js
  18. 673 0
      src/web/staticres/vipsubscribe/js/vip_upgrade.js
  19. 50 0
      src/web/templates/weixin/vipsubscribe/vip_UpgradeDetail.html
  20. 430 0
      src/web/templates/weixin/vipsubscribe/vip_UpgradePage.html
  21. 39 55
      src/web/templates/weixin/vipsubscribe/vip_renew.html

+ 9 - 0
src/jfw/modules/app/src/web/staticres/jyapp/vipsubscribe/css/vip_renew.css

@@ -697,3 +697,12 @@
 .billing-price-container .yen {
   font-size: .32rem;
 }
+
+.area-industry .item-container .item {
+  justify-content: flex-start;
+}
+.area-industry .item-container .item .item-r {
+  width: unset;
+  flex: 1;
+  justify-content: flex-start;
+}

+ 6 - 2
src/jfw/modules/app/src/web/staticres/jyapp/vipsubscribe/js/choose_area.js

@@ -457,12 +457,16 @@ $(function () {
   AreaChoose.isOpen();
   AreaChoose.inintData(); //初始化 已选择和已购买数据
   AreaChoose.inintPage(); //初始化城市数据
-
   //AreaChoose.getNationwide();//默认选中全国
   AreaChoose.showSelected(true);//回显已选择
   /* 判断已购买的城市 在不在 全部城市里面,在,将按钮置灰,不可点击 */
-
   AreaChoose.getResult("", true);
   AreaChoose.inintClick();
   sessionStorage.setItem("pay_read_cache", "1");
+  // 判断如果是从升级页面跳转来的,则解绑省份下拉事件,不让选择城市
+  // if (getParam('header') === 'upgrade') {
+  //   console.log('升级页面来的')
+    $(".select-area-box .tab:not(.municipality)").unbind('click')
+    $('.tab_content').unbind('click')
+  // }
 })

+ 330 - 330
src/jfw/modules/app/src/web/staticres/jyapp/vipsubscribe/js/common.js

@@ -1,149 +1,149 @@
 //请求同意调用
-function $DoPost(url) {
-    var param = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};
-    var callback = arguments.length > 2 ? arguments[2] : undefined;
-    var async = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : true;
-    $.ajax({
-        url: url + "?t=" + new Date().getTime(),
-        type: "POST",
-        data: param,
-        async: async,
-        dataType: "json",
-        success: function success(r) {
-            callback(r);
+function $DoPost (url) {
+  var param = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};
+  var callback = arguments.length > 2 ? arguments[2] : undefined;
+  var async = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : true;
+  $.ajax({
+    url: url + "?t=" + new Date().getTime(),
+    type: "POST",
+    data: param,
+    async: async,
+    dataType: "json",
+    success: function success (r) {
+      callback(r);
 
-            if (r.error || r.errMsg) {
-                var errTip = r.error || r.errMsg;
-                weui.toast(errTip, {
-                    duration: 2000,
-                    className: 'custom-toast'
-                });
-            }
-        }
-    });
+      if (r.error || r.errMsg) {
+        var errTip = r.error || r.errMsg;
+        weui.toast(errTip, {
+          duration: 2000,
+          className: 'custom-toast'
+        });
+      }
+    }
+  });
 }
 
 //获取url参数
-function getParam(name) {
-    var reg = new RegExp("(^|&)" + name + "=([^&]*)(&|$)", "i");
-    var r = window.location.search.substr(1).match(reg); //获取url中"?"符后的字符串并正则匹配
-    var context = "";
-    if (r != null)
-        context = r[2];
-    reg = null;
-    r = null;
-    return context == null || context == "" || context == "undefined" ? "" : context;
+function getParam (name) {
+  var reg = new RegExp("(^|&)" + name + "=([^&]*)(&|$)", "i");
+  var r = window.location.search.substr(1).match(reg); //获取url中"?"符后的字符串并正则匹配
+  var context = "";
+  if (r != null)
+    context = r[2];
+  reg = null;
+  r = null;
+  return context == null || context == "" || context == "undefined" ? "" : context;
 }
 
 //省份 城市 分类
-function getAreaClassArr_index(area) {
-    var cityArr = [];//城市
-    var provinceArr = [];//省份
-    for (var i in area) {
-        var citys = area[i]
-        if (citys.length > 0) {
-            cityArr = cityArr.concat(citys);
-            provinceArr.push(i + "(" + cityArr.join("、") + ")")
-        } else {
-            if (i == "全国") {
-                continue
-            }
-            provinceArr.push(i)
-        }
+function getAreaClassArr_index (area) {
+  var cityArr = [];//城市
+  var provinceArr = [];//省份
+  for (var i in area) {
+    var citys = area[i]
+    if (citys.length > 0) {
+      cityArr = cityArr.concat(citys);
+      provinceArr.push(i + "(" + cityArr.join("、") + ")")
+    } else {
+      if (i == "全国") {
+        continue
+      }
+      provinceArr.push(i)
     }
-    return SortArr(provinceArr)
+  }
+  return SortArr(provinceArr)
 }
 
 //省份 城市 分类
-function getAreaClassArr(area) {
-    var cityArr = [];//城市
-    var provinceArr = [];//省份
-    for (var i in area) {
-        var citys = area[i]
-        if (citys.length > 0) {
-            cityArr = cityArr.concat(citys);
-        } else {
-            if (i == "全国") {
-                continue
-            }
-            provinceArr.push(i)
-        }
+function getAreaClassArr (area) {
+  var cityArr = [];//城市
+  var provinceArr = [];//省份
+  for (var i in area) {
+    var citys = area[i]
+    if (citys.length > 0) {
+      cityArr = cityArr.concat(citys);
+    } else {
+      if (i == "全国") {
+        continue
+      }
+      provinceArr.push(i)
     }
-    return [SortArr(provinceArr), SortArr(cityArr)]
+  }
+  return [SortArr(provinceArr), SortArr(cityArr)]
 }
 
 //对数组进行排序(拼音)
-function SortArr(arr) {
-    arr = arr.sort(function compareFunction(item1, item2) {
-        return item1.localeCompare(item2);
-    });
-    return arr
+function SortArr (arr) {
+  arr = arr.sort(function compareFunction (item1, item2) {
+    return item1.localeCompare(item2);
+  });
+  return arr
 }
 
 //获取选择
-function getSelectBuyset(area, industry) {
-    if (industry[0] === "全部行业") industry = [];
-    if (area["全国"]) area = {};
-    //计算地区数量
-    var buyset = {
-        "areacount": -1,  //省份数量
-        "buyerclasscount": -1,
-        "citys": [] //购买省份中城市数量
-    };
-    //行业
-    if (industry.length != 0) {
-        buyset.buyerclasscount = industry.length
-    }
-    //地区
-    if (!$.isEmptyObject(area)) {
-        buyset.areacount = 0;
-        for (var i in area) {
-            var citys = area[i];
-            var thisLen = citys.length;
-            if (thisLen === 0) {
-                buyset.areacount++
-            } else {
-                buyset.citys.push(thisLen)
-            }
-        }
+function getSelectBuyset (area, industry) {
+  if (industry[0] === "全部行业") industry = [];
+  if (area["全国"]) area = {};
+  //计算地区数量
+  var buyset = {
+    "areacount": -1,  //省份数量
+    "buyerclasscount": -1,
+    "citys": [] //购买省份中城市数量
+  };
+  //行业
+  if (industry.length != 0) {
+    buyset.buyerclasscount = industry.length
+  }
+  //地区
+  if (!$.isEmptyObject(area)) {
+    buyset.areacount = 0;
+    for (var i in area) {
+      var citys = area[i];
+      var thisLen = citys.length;
+      if (thisLen === 0) {
+        buyset.areacount++
+      } else {
+        buyset.citys.push(thisLen)
+      }
     }
-    return buyset
+  }
+  return buyset
 }
 
 
 //购买设置 area map
-function getBuySet(area, industry, price) {
-    price = checkPrice(price);
-    if (industry[0] === "全部行业") industry = [];
-    if (area["全国"]) area = {};
-    //计算地区数量
-    var buyset = {
-        "areacount": -1,  //省份数量
-        "buyerclasscount": -1,
-        "citys": [] //购买省份中城市数量
-    };
-    //行业
-    if (industry.length != 0 && industry.length <= price.buyerClassMaxCount) {
-        buyset.buyerclasscount = industry.length
-    }
-    //地区
-    if (!$.isEmptyObject(area)) {
-        buyset.areacount = 0;
-        for (var i in area) {
-            var citys = area[i];
-            var thisLen = citys.length;
-            if (thisLen === 0 || thisLen > price.cityMaxCount) {
-                buyset.areacount++
-            } else {
-                buyset.citys.push(thisLen)
-            }
-        }
-    }
-    if (buyset.areacount > price.provinceMaxCount) {
-        buyset.areacount = -1;
-        buyset.citys = [];
+function getBuySet (area, industry, price) {
+  price = checkPrice(price);
+  if (industry[0] === "全部行业") industry = [];
+  if (area["全国"]) area = {};
+  //计算地区数量
+  var buyset = {
+    "areacount": -1,  //省份数量
+    "buyerclasscount": -1,
+    "citys": [] //购买省份中城市数量
+  };
+  //行业
+  if (industry.length != 0 && industry.length <= price.buyerClassMaxCount) {
+    buyset.buyerclasscount = industry.length
+  }
+  //地区
+  if (!$.isEmptyObject(area)) {
+    buyset.areacount = 0;
+    for (var i in area) {
+      var citys = area[i];
+      var thisLen = citys.length;
+      if (thisLen === 0 || thisLen > price.cityMaxCount) {
+        buyset.areacount++
+      } else {
+        buyset.citys.push(thisLen)
+      }
     }
-    return buyset
+  }
+  if (buyset.areacount > price.provinceMaxCount) {
+    buyset.areacount = -1;
+    buyset.citys = [];
+  }
+  return buyset
 }
 
 /* vip订阅价格
@@ -155,257 +155,257 @@ function getBuySet(area, industry, price) {
 */
 var priceData;
 
-function getsubVipOrderPrice(area, industry, t, price) {
-    price = checkPrice(price);
-    return getsubVipOrderPriceBybuyset(getBuySet(area, industry, price), t, price)
+function getsubVipOrderPrice (area, industry, t, price) {
+  price = checkPrice(price);
+  return getsubVipOrderPriceBybuyset(getBuySet(area, industry, price), t, price)
 }
 
-function checkPrice(price) {
-    if (!price) {
-        if (priceData) {
-            price = priceData
+function checkPrice (price) {
+  if (!price) {
+    if (priceData) {
+      price = priceData
+    } else {
+      $DoPost("/subscribepay/vipsubscribe/getPrice", {}, function (r) {
+        if (r.new) {
+          price = r.new;
+          priceData = price;
         } else {
-            $DoPost("/subscribepay/vipsubscribe/getPrice", {}, function (r) {
-                if (r) {
-                    price = r;
-                    priceData = price;
-                } else {
-                    weui.toast("加载价格异常", {
-                        duration: 2000,
-                        className: 'custom-toast',
-                    });
-                }
-            }, false)
+          weui.toast("加载价格异常", {
+            duration: 2000,
+            className: 'custom-toast',
+          });
         }
-    } else {
-        priceData = price
+      }, false)
     }
-    return price
+  } else {
+    priceData = price
+  }
+  return price
 }
 
 //新旧buyset
-function getMergeNewBuyset(buyset, price) {
-    price = checkPrice(price);
-    if (buyset["newcitys"]) { //新buyset
-        return {
-            "areacount": buyset.areacount,  //省份数量
-            "buyerclasscount": buyset.buyerclasscount,
-            "citys": buyset.newcitys //购买省份中城市数量
-        }
-    } else { //旧buyset
-        var areaCount = buyset.areacount;
-        var buyerclasscount = buyset.buyerclasscount;
-        var oldCitys = buyset.citys;
-        var newCitys = [];
+function getMergeNewBuyset (buyset, price) {
+  price = checkPrice(price);
+  if (buyset["newcitys"]) { //新buyset
+    return {
+      "areacount": buyset.areacount,  //省份数量
+      "buyerclasscount": buyset.buyerclasscount,
+      "citys": buyset.newcitys //购买省份中城市数量
+    }
+  } else { //旧buyset
+    var areaCount = buyset.areacount;
+    var buyerclasscount = buyset.buyerclasscount;
+    var oldCitys = buyset.citys;
+    var newCitys = [];
 
-        if (!$.isEmptyObject(oldCitys)) {
-            for (var i in oldCitys) {
-                var thisLen = oldCitys[i];
-                if (thisLen === 0 || thisLen > price.cityMaxCount) {
-                    areaCount++
-                } else {
-                    newCitys.push(thisLen)
-                }
-            }
+    if (!$.isEmptyObject(oldCitys)) {
+      for (var i in oldCitys) {
+        var thisLen = oldCitys[i];
+        if (thisLen === 0 || thisLen > price.cityMaxCount) {
+          areaCount++
+        } else {
+          newCitys.push(thisLen)
         }
+      }
+    }
 
-        //省份数量自动转换全国
-        if (areaCount > price.provinceMaxCount) {
-            areaCount = -1;
-            newCitys = [];
-        }
-        //行业数量自动转换全行业
-        if (buyerclasscount > price.buyerClassMaxCount) {
-            buyerclasscount = -1
-        }
-        return {
-            "areacount": areaCount,  //省份数量
-            "buyerclasscount": buyerclasscount,
-            "citys": newCitys //购买省份中城市数量
-        }
+    //省份数量自动转换全国
+    if (areaCount > price.provinceMaxCount) {
+      areaCount = -1;
+      newCitys = [];
     }
+    //行业数量自动转换全行业
+    if (buyerclasscount > price.buyerClassMaxCount) {
+      buyerclasscount = -1
+    }
+    return {
+      "areacount": areaCount,  //省份数量
+      "buyerclasscount": buyerclasscount,
+      "citys": newCitys //购买省份中城市数量
+    }
+  }
 }
 
 //根据购买设置 获取支付金额
-function getsubVipOrderPriceBybuyset(buyset, t, price) {
-    //console.log("getsubVipOrderPriceBybuyset",buyset, t)
-    price = checkPrice(price);
-    var vipbuyset = JSON.parse(JSON.stringify(buyset));
-    if (t[0] > price.monthMaxCount && t[1] === 2) t[0] = 10;//月份十个月以上价格一样
+function getsubVipOrderPriceBybuyset (buyset, t, price) {
+  //console.log("getsubVipOrderPriceBybuyset",buyset, t)
+  price = checkPrice(price);
+  var vipbuyset = JSON.parse(JSON.stringify(buyset));
+  if (t[0] > price.monthMaxCount && t[1] === 2) t[0] = 16;//月份十个月以上价格一样
 
-    if (vipbuyset.areacount === -1) {//计算全国套餐价格
-        if (vipbuyset.buyerclasscount === 1) return getSetMealPrice(0, 1, t[1], price) * t[0] / 100; //全国1行业套餐
-        if (vipbuyset.buyerclasscount === 0) return getSetMealPrice(0, 0, t[1], price) * t[0] / 100; //全国全行业套餐
-        return getSetMealPrice(0, vipbuyset.buyerclasscount, t[1], price) * t[0] / 100 //全国多行业套餐
-    }
+  if (vipbuyset.areacount === -1) {//计算全国套餐价格
+    if (vipbuyset.buyerclasscount === 1) return getSetMealPrice(0, 1, t[1], price) * t[0] / 100; //全国1行业套餐
+    if (vipbuyset.buyerclasscount === 0) return getSetMealPrice(0, 0, t[1], price) * t[0] / 100; //全国全行业套餐
+    return getSetMealPrice(0, vipbuyset.buyerclasscount, t[1], price) * t[0] / 100 //全国多行业套餐
+  }
 
-    //var final_price = vipbuyset.areacount * getSetMealPrice(1, vipbuyset.buyerclasscount, t[1], price) * t[0];//计算省份价格
-    var final_price = 0;//计算省份价格
+  //var final_price = vipbuyset.areacount * getSetMealPrice(1, vipbuyset.buyerclasscount, t[1], price) * t[0];//计算省份价格
+  var final_price = 0;//计算省份价格
 
-    for (var i in vipbuyset.citys) {
-        var thisPrice = 0;
-        if (vipbuyset.citys[i] === 1) {//单城市
-            thisPrice = getSetMealPrice(2, vipbuyset.buyerclasscount, t[1], price) * t[0];
-        } else {//多城市
-            if (vipbuyset.buyerclasscount === 0 || vipbuyset.buyerclasscount === 1) {//多城市 单行业
-                if (vipbuyset.citys[i] > price.cityMaxCount) {
-                    vipbuyset.areacount++;
-                } else {
-                    thisPrice = vipbuyset.citys[i] * getSetMealPrice(2, vipbuyset.buyerclasscount, t[1], price) * t[0];
-                }
-            } else {//多城市 多行业
-                //var industry_Price = price.buyerClassPrice * vipbuyset.buyerclasscount;
-                //var city_Price = price.cityPrice * vipbuyset.citys[i];
-                //thisPrice = (industry_Price + city_Price) * t[0];
-                if (vipbuyset.citys[i] > price.cityMaxCount) {
-                    vipbuyset.areacount++;
-                } else {
-                    thisPrice = getSetMealPrice(2, vipbuyset.buyerclasscount, t[1], price) * vipbuyset.citys[i] * t[0];
-                    // if (t[1] === 1) thisPrice *= 10 //年的价格是月价格的10倍
-                }
-            }
+  for (var i in vipbuyset.citys) {
+    var thisPrice = 0;
+    if (vipbuyset.citys[i] === 1) {//单城市
+      thisPrice = getSetMealPrice(2, vipbuyset.buyerclasscount, t[1], price) * t[0];
+    } else {//多城市
+      if (vipbuyset.buyerclasscount === 0 || vipbuyset.buyerclasscount === 1) {//多城市 单行业
+        if (vipbuyset.citys[i] > price.cityMaxCount) {
+          vipbuyset.areacount++;
+        } else {
+          thisPrice = vipbuyset.citys[i] * getSetMealPrice(2, vipbuyset.buyerclasscount, t[1], price) * t[0];
+        }
+      } else {//多城市 多行业
+        //var industry_Price = price.buyerClassPrice * vipbuyset.buyerclasscount;
+        //var city_Price = price.cityPrice * vipbuyset.citys[i];
+        //thisPrice = (industry_Price + city_Price) * t[0];
+        if (vipbuyset.citys[i] > price.cityMaxCount) {
+          vipbuyset.areacount++;
+        } else {
+          thisPrice = getSetMealPrice(2, vipbuyset.buyerclasscount, t[1], price) * vipbuyset.citys[i] * t[0];
+          // if (t[1] === 1) thisPrice *= 10 //年的价格是月价格的10倍
         }
-        final_price += thisPrice;
+      }
     }
-    final_price += vipbuyset.areacount * getSetMealPrice(1, vipbuyset.buyerclasscount, t[1], price) * t[0];
-    //console.log("getsubVipOrderPriceBybuyset-final_price",final_price)
-    return final_price / 100
+    final_price += thisPrice;
+  }
+  final_price += vipbuyset.areacount * getSetMealPrice(1, vipbuyset.buyerclasscount, t[1], price) * t[0];
+  //console.log("getsubVipOrderPriceBybuyset-final_price",final_price)
+  return final_price / 100
 }
 
 //获取套餐价格
 //c(city) 全国:0 省:1 市:2
 //iCount(industry) 全行业:-1 其他:多个行业
 //u(unit) 年:1 月:2
-function getSetMealPrice(c, iCount, u, price) {
-    var t = u === 2; //是否是月单位
-    switch (c) {
-        case 0:
-            if (iCount === -1) {
-                if (t) return price.month.allProvince_allBuyerClass;  //1月全国全行业
-                return price.year.allProvince_allBuyerClass; //1年全国全行业
-            } else {
-                if (t) return price.month.allProvince_oneBuyerClass * iCount; //1月全国icount个行业
-                return price.year.allProvince_oneBuyerClass * iCount;	//1年全国icount个行业
-            }
-        case 1:
-            if (iCount === -1) {
-                if (t) return price.month.oneProvince_allBuyerClass;  //1月1省全行业
-                return price.year.oneProvince_allBuyerClass	//1年1省全行业
-            } else {
-                if (t) return price.month.oneProvince_oneBuyerClass * iCount; //1月1省icount个行业
-                return price.year.oneProvince_oneBuyerClass * iCount	//1年1省icount个行业
-            }
-        default:
-            if (iCount === -1) {
-                if (t) return price.month.oneCity_allBuyerClass;  //1月1市全行业
-                return price.year.oneCity_allBuyerClass	//1年1市全行业
-            } else {
-                if (t) return price.month.oneCity_oneBuyerClass * iCount; //1月1市icount个行业
-                return price.year.oneCity_oneBuyerClass * iCount	//1年1市icount个行业
-            }
-    }
+function getSetMealPrice (c, iCount, u, price) {
+  var t = u === 2; //是否是月单位
+  switch (c) {
+    case 0:
+      if (iCount === -1) {
+        if (t) return price.month.allProvince_allBuyerClass;  //1月全国全行业
+        return price.year.allProvince_allBuyerClass; //1年全国全行业
+      } else {
+        if (t) return price.month.allProvince_oneBuyerClass * iCount; //1月全国icount个行业
+        return price.year.allProvince_oneBuyerClass * iCount;	//1年全国icount个行业
+      }
+    case 1:
+      if (iCount === -1) {
+        if (t) return price.month.oneProvince_allBuyerClass;  //1月1省全行业
+        return price.year.oneProvince_allBuyerClass	//1年1省全行业
+      } else {
+        if (t) return price.month.oneProvince_oneBuyerClass * iCount; //1月1省icount个行业
+        return price.year.oneProvince_oneBuyerClass * iCount	//1年1省icount个行业
+      }
+    default:
+      if (iCount === -1) {
+        if (t) return price.month.oneCity_allBuyerClass;  //1月1市全行业
+        return price.year.oneCity_allBuyerClass	//1年1市全行业
+      } else {
+        if (t) return price.month.oneCity_oneBuyerClass * iCount; //1月1市icount个行业
+        return price.year.oneCity_oneBuyerClass * iCount	//1年1市icount个行业
+      }
+  }
 }
 
 // 时间格式化
 Date.prototype.pattern = function (fmt) {
-    var o = {
-        "y+": this.getFullYear(),
-        "M+": this.getMonth() + 1, //月份
-        "d+": this.getDate(), //日
-        "h+": this.getHours() % 12 == 0 ? 12 : this.getHours() % 12, //小时
-        "H+": this.getHours(), //小时
-        "m+": this.getMinutes(), //分
-        "s+": this.getSeconds(), //秒
-        "q+": Math.floor((this.getMonth() + 3) / 3), //季度
-        "S": this.getMilliseconds() //毫秒
-    };
-    var week = {
-        "0": "日",
-        "1": "一",
-        "2": "二",
-        "3": "三",
-        "4": "四",
-        "5": "五",
-        "6": "六"
-    };
-    if (/(y+)/.test(fmt)) {
-        fmt = fmt.replace(RegExp.$1, (this.getFullYear() + "").substr(4 - RegExp.$1.length));
-    }
-    if (/(E+)/.test(fmt)) {
-        fmt = fmt.replace(RegExp.$1, ((RegExp.$1.length > 1) ? (RegExp.$1.length > 2 ? "星期" : "周") : "") + week[this.getDay() + ""]);
+  var o = {
+    "y+": this.getFullYear(),
+    "M+": this.getMonth() + 1, //月份
+    "d+": this.getDate(), //日
+    "h+": this.getHours() % 12 == 0 ? 12 : this.getHours() % 12, //小时
+    "H+": this.getHours(), //小时
+    "m+": this.getMinutes(), //分
+    "s+": this.getSeconds(), //秒
+    "q+": Math.floor((this.getMonth() + 3) / 3), //季度
+    "S": this.getMilliseconds() //毫秒
+  };
+  var week = {
+    "0": "日",
+    "1": "一",
+    "2": "二",
+    "3": "三",
+    "4": "四",
+    "5": "五",
+    "6": "六"
+  };
+  if (/(y+)/.test(fmt)) {
+    fmt = fmt.replace(RegExp.$1, (this.getFullYear() + "").substr(4 - RegExp.$1.length));
+  }
+  if (/(E+)/.test(fmt)) {
+    fmt = fmt.replace(RegExp.$1, ((RegExp.$1.length > 1) ? (RegExp.$1.length > 2 ? "星期" : "周") : "") + week[this.getDay() + ""]);
+  }
+  for (var k in o) {
+    if (new RegExp("(" + k + ")").test(fmt)) {
+      fmt = fmt.replace(RegExp.$1, (RegExp.$1.length == 1) ? (o[k]) : (("00" + o[k]).substr(("" + o[k]).length)));
     }
-    for (var k in o) {
-        if (new RegExp("(" + k + ")").test(fmt)) {
-            fmt = fmt.replace(RegExp.$1, (RegExp.$1.length == 1) ? (o[k]) : (("00" + o[k]).substr(("" + o[k]).length)));
-        }
-    }
-    return fmt;
+  }
+  return fmt;
 }
 
 //value ;flag 1:年 2:月 endtime 结束时间
-function getVipEndDate(flag, value, endtime) {
-    var EndTime = new Date(endtime * 1000);
-    var startDay = EndTime.getDate();
-    var yearNum = EndTime.getFullYear();
-    var monthNum = EndTime.getMonth();
-    if (flag === 1) {//将年转换成月
-        //年
-        yearNum += value;
-    } else {
-        //月
-        if (monthNum + value > 11) {
-            monthNum = monthNum + value - 12;
-            yearNum++
-        } else {
-            monthNum += value
-        }
-    }
-    //获取当月最后一天
-    var lastDay = new Date(yearNum, monthNum + 1, 0).getDate();
-    if (startDay < lastDay) {
-        return new Date(yearNum, monthNum, startDay, 23, 59, 59).getTime() / 1000;
+function getVipEndDate (flag, value, endtime) {
+  var EndTime = new Date(endtime * 1000);
+  var startDay = EndTime.getDate();
+  var yearNum = EndTime.getFullYear();
+  var monthNum = EndTime.getMonth();
+  if (flag === 1) {//将年转换成月
+    //年
+    yearNum += value;
+  } else {
+    //月
+    if (monthNum + value > 11) {
+      monthNum = monthNum + value - 12;
+      yearNum++
     } else {
-        return new Date(yearNum, monthNum, lastDay, 23, 59, 59).getTime() / 1000;
+      monthNum += value
     }
+  }
+  //获取当月最后一天
+  var lastDay = new Date(yearNum, monthNum + 1, 0).getDate();
+  if (startDay < lastDay) {
+    return new Date(yearNum, monthNum, startDay, 23, 59, 59).getTime() / 1000;
+  } else {
+    return new Date(yearNum, monthNum, lastDay, 23, 59, 59).getTime() / 1000;
+  }
 }
 // 格式化金钱的函数
 // s: 金额(number) 必传
 // n: 保留小数的位数(int:0-100)
-function formatMoney(s, n) {
-    if (n === undefined) {
-        n = -1
+function formatMoney (s, n) {
+  if (n === undefined) {
+    n = -1
+  } else {
+    n = n > 0 && n <= 20 ? n : 2;
+  }
+  var intS = parseInt(s)
+  var point = '.'
+  var left;
+  var right;
+  s = parseFloat((s + '').replace(/[^\d\.-]/g, ''))
+  // 没传n,默认(如果为整数,则不保留小数。如果为浮点数,则保留两位小数)
+  if (n === -1) {
+    if (s === intS) {
+      n = 0
+      right = ''
+      point = ''
     } else {
-        n = n > 0 && n <= 20 ? n : 2;
-    }
-    var intS = parseInt(s)
-    var point = '.'
-    var left;
-    var right;
-    s = parseFloat((s + '').replace(/[^\d\.-]/g, ''))
-    // 没传n,默认(如果为整数,则不保留小数。如果为浮点数,则保留两位小数)
-    if (n === -1) {
-        if (s === intS) {
-            n = 0
-            right = ''
-            point = ''
-        } else {
-            n = 2
-            s = s.toFixed(n);
-            right = s.split('.')[1];
-        }
-        s = s + ''
-        left = s.split('.')[0].split("").reverse();
-    } else {
-        s = parseFloat((s + '').replace(/[^\d\.-]/g, '')).toFixed(n) + '';
-        left = s.split('.')[0].split('').reverse();
-        right = s.split('.')[1];
+      n = 2
+      s = s.toFixed(n);
+      right = s.split('.')[1];
     }
+    s = s + ''
+    left = s.split('.')[0].split("").reverse();
+  } else {
+    s = parseFloat((s + '').replace(/[^\d\.-]/g, '')).toFixed(n) + '';
+    left = s.split('.')[0].split('').reverse();
+    right = s.split('.')[1];
+  }
 
-    t = "";
-    for (i = 0; i < left.length; i++) {
-        t += left[i] + ((i + 1) % 3 == 0 && (i + 1) != left.length ? ',' : '');
-    }
+  t = "";
+  for (i = 0; i < left.length; i++) {
+    t += left[i] + ((i + 1) % 3 == 0 && (i + 1) != left.length ? ',' : '');
+  }
 
-    var money = t.split('').reverse().join('') + point + right;
-    return money;
+  var money = t.split('').reverse().join('') + point + right;
+  return money;
 }

+ 312 - 0
src/jfw/modules/app/src/web/staticres/jyapp/vipsubscribe/js/price.js

@@ -0,0 +1,312 @@
+//超级订阅价格计算
+class Buyset {
+    constructor(areacount, cityArr = [], buyerCount, upgrade) {
+        this.areacount = areacount; //省份数量 -1 全国
+        this.citys = cityArr; //购买的城市数组
+        this.buyerclasscount = buyerCount; //行业数量
+        this.upgrade = upgrade; //是否是升级版的超级订阅
+    }
+}
+
+var Calculation = {
+    PriceRule: {
+        "old": {
+            "month": {
+                "oneCity_oneBuyerClass": 580,
+                "oneCity_allBuyerClass": 1800,
+                "oneProvince_oneBuyerClass": 1180,
+                "oneProvince_allBuyerClass": 3800,
+                "allProvince_oneBuyerClass": 11800,
+                "allProvince_allBuyerClass": 38800
+            },
+            "year": {
+                "oneCity_oneBuyerClass": 5800,
+                "oneCity_allBuyerClass": 18000,
+                "oneProvince_oneBuyerClass": 11800,
+                "oneProvince_allBuyerClass": 38000,
+                "allProvince_oneBuyerClass": 118000,
+                "allProvince_allBuyerClass": 388000
+            },
+            "cityPrice": 580,
+            "provincePrice": 1180,
+            "buyerClassPrice": 580,
+            "cityMaxCount": 2,
+            "provinceMaxCount": 9,
+            "buyerClassMaxCount": 3,
+            "monthMaxCount": 9
+        },
+        "new": {
+            "month": {
+                "oneProvince_allBuyerClass": 3800,
+                "allProvince_allBuyerClass": 59900
+            },
+            "year": {
+                "oneProvince_allBuyerClass": 38800,
+                "allProvince_allBuyerClass": 599900
+            },
+            "provincePrice": 3800,
+            "provinceMaxCount": 15,
+            "monthMaxCount": 9
+        },
+        "discount": 1
+    }, //套餐价格表
+    IsTrial: true, //是否时试用用户
+    OldBuyset: new Buyset(),//用户之前套餐
+    EndTime: 0, //会员到期时间
+    RenewList: [],
+    Init: (isTrial, oldBuyset, renewList, price, endTime) => { //首次购买时oldBuyset传入undefined
+        this.IsTrial = isTrial;
+        this.OldBuyset = oldBuyset;
+        this.RenewList = renewList;
+        this.EndTime = endTime;
+        this.PriceRule = price;
+    },
+    Check: (tmpBuyset, oldBuyset) => { //校验是否合法
+        if (!oldBuyset) {
+            oldBuyset = this.OldBuyset;
+        }
+        if (!oldBuyset) {
+            return true
+        }
+        if (oldBuyset.upgrade === 1) { //升级后省份数量必须大于升级前的
+            return tmpBuyset.areacount > oldBuyset.areacount;
+        } else {
+            return tmpBuyset.areacount >= oldBuyset.areacount + oldBuyset.citys.length;
+        }
+    },
+    //首次购买
+    //续费 newBuyset 传入undefined
+    GetTotal: (newBuyset, buyTime = [1, 2]) => { //newBuyset 用户选择的套餐;time[数量,单位(1:年,2月)]
+        if (newBuyset) {//首次购买
+            return this.getBuysetPrice(newBuyset, t)
+        }
+        return this.getBuysetPrice(this.OldBuyset, t)   //续费
+    },
+    GetUpgradeDetail: (newBuyset = new Buyset(), buyTime = [1, 2]) => { //升级计价
+        let subtotail = []; //计价清单
+        let final_price = 0; //最终计算价格
+        let nowEndTime = this.EndTime;
+        //续费升级价格
+        if (this.renewList.length > 0) {
+            for (var i = renewList.length - 1; i >= 0; i--) {
+                let thisBuyset = renewList[i].o_buyset;
+                let thisStartTime = renewList[i].l_validtime;
+                let old = new Buyset(thisBuyset.areacount, thisBuyset.newcitys, thisBuyset.buyerclasscount, this.upgrade || 0)
+                var this_price = this.GetSubPrice(old, newBuyset, thisStartTime, nowEndTime);
+                if (this_price < 0) {
+                    return [-2, []]
+                }
+                //清单数组
+                subtotail.push({
+                    "buyset": old,
+                    "startTime": thisStartTime,
+                    "endTime": nowEndTime,
+                    "price": this_price,
+                    "type": 1
+                });
+                final_price = this.numAdd(final_price, this_price);
+                nowEndTime = thisStartTime;
+            }
+        }
+        //现在使用升级价格
+        var now_price = this.GetSubPrice(this.OldBuyset, newBuyset, new Date().getTime() / 1000, nowEndTime);
+        if (now_price < 0) {
+            return [-2, []]
+        }
+        //清单数组
+        subtotail.push({
+            "buyset": oldBuyset,
+            "startTime": new Date().getTime() / 1000,
+            "endTime": nowEndTime,
+            "price": now_price,
+            "type": 0
+        });
+        final_price = this.numAdd(final_price, now_price);
+        //新增续费升级价格
+        if (buyTime.length !== 0) {
+            var thisPrice = this.getBuysetPrice(newBuyset, t);
+            if (thisPrice < 0) {
+                return [-2, []]
+            }
+            console.log(newBuyset, t, "额外升级费用", thisPrice);
+            final_price = this.numAdd(final_price, thisPrice);
+            //清单数组
+            subtotail.push({
+                "buyset": newBuyset,
+                "startTime": endUnix,//xxx
+                "endTime": getVipEndDate(t[1], t[0], endUnix),
+                "price": thisPrice,
+                "type": 2
+            });
+        }
+        return [final_price, subtotail]
+    },
+    GetSubPrice: (oldBuyset, newBuyset, start, end) => { //升级-计算套餐差价
+        if (this.check(newBuyset, oldBuyset)) {
+            return -1
+        }
+        let beforePrice = 0;
+        let newPrice = 0;
+        let t = this.getDateSub(start, end);
+
+        if (t[1] !== 0) {//月
+            beforePrice = this.numAdd(beforePrice, this.getBuysetPrice(oldBuyset, [t[1], 2]))
+            newPrice = this.numAdd(newPrice, this.getBuysetPrice(newBuyset, [t[1], 2]))
+        }
+        if (t[0] !== 0) {//年
+            beforePrice = this.numAdd(beforePrice, this.getBuysetPrice(oldBuyset, [t[0], 1]))
+            newPrice = this.numAdd(newPrice, this.getBuysetPrice(newBuyset, [t[0], 1]))
+        }
+        console.log("old ", oldBuyset, " \n new ", newBuyset, " \n 相差", t[0], "年 ", t[1], "个月\n price:", newPrice, "-", beforePrice, "=", (newPrice * 10000 - beforePrice * 10000) / 10000);
+        return (newPrice * 10000 - beforePrice * 10000) / 10000
+    },
+    getBuysetPrice: (vipbuyset = new Buyset(), t) => { //获取套餐价格
+        if (t.length !== 2) {
+            return -1
+        }
+        if (vipbuyset.upgrade === 0) { //旧版大会员价格计算
+            if (t[0] > this.PriceRule.old.monthMaxCount && t[1] === 2) t[0] = 10;//月份十个月以上价格一样
+            if (vipbuyset.areacount === -1) {//计算全国套餐价格
+                if (vipbuyset.buyerclasscount === 1) return this.getSetMealPrice_old(0, 1, t[1]) * t[0] / 100; //全国1行业套餐
+                if (vipbuyset.buyerclasscount === 0) return this.getSetMealPrice_old(0, 0, t[1]) * t[0] / 100; //全国全行业套餐
+                return this.getSetMealPrice_old(0, vipbuyset.buyerclasscount, t[1]) * t[0] / 100 //全国多行业套餐
+            }
+            let final_price = 0;//计算省份价格
+            for (var i in vipbuyset.citys) {
+                var thisPrice = 0;
+                if (vipbuyset.citys[i] === 1) {//单城市
+                    thisPrice = this.getSetMealPrice_old(2, vipbuyset.buyerclasscount, t[1]) * t[0];
+                } else {//多城市
+                    if (vipbuyset.buyerclasscount === 0 || vipbuyset.buyerclasscount === 1) {//多城市 单行业
+                        if (vipbuyset.citys[i] > this.PriceRule.old.cityMaxCount) {
+                            vipbuyset.areacount++;
+                        } else {
+                            thisPrice = vipbuyset.citys[i] * this.getSetMealPrice_old(2, vipbuyset.buyerclasscount, t[1]) * t[0];
+                        }
+                    } else {//多城市 多行业
+                        if (vipbuyset.citys[i] > this.PriceRule.old.cityMaxCount) {
+                            vipbuyset.areacount++;
+                        } else {
+                            thisPrice = this.getSetMealPrice_old(2, vipbuyset.buyerclasscount, t[1]) * vipbuyset.citys[i] * t[0];
+                        }
+                    }
+                }
+                final_price += thisPrice;
+            }
+            final_price += vipbuyset.areacount * this.getSetMealPrice_old(1, vipbuyset.buyerclasscount, t[1]) * t[0];
+            return final_price / 100
+        } else {//新版大会员价格计算
+            pCount = vipbuyset.areacount
+            if (pCount > this.PriceRule.new.provinceMaxCount) {
+                pCount = -1
+            }
+            if (pCount === -1) {
+                pCount = 0
+            }
+            //当选择月份大于  按照全年计算
+            if (t[0] > this.PriceRule.new.monthMaxCount && t[1] === 2) { //月份十个月以上价格一样
+                count = 10
+            }
+            return this.getSetMealPrice_new(pCount, unit) * count //全国1行业套餐
+        }
+    },
+    getSetMealPrice_old: (c, iCount, u) => { //旧套餐价格计算
+        var t = u === 2; //是否是月单位
+        switch (c) {
+            case 0:
+                if (iCount === -1) {
+                    if (t) return this.PriceRule.old.month.allProvince_allBuyerClass;  //1月全国全行业
+                    return this.PriceRule.old.year.allProvince_allBuyerClass; //1年全国全行业
+                } else {
+                    if (t) return this.PriceRule.old.month.allProvince_oneBuyerClass * iCount; //1月全国icount个行业
+                    return this.PriceRule.old.year.allProvince_oneBuyerClass * iCount;	//1年全国icount个行业
+                }
+            case 1:
+                if (iCount === -1) {
+                    if (t) return this.PriceRule.old.month.oneProvince_allBuyerClass;  //1月1省全行业
+                    return this.PriceRule.old.year.oneProvince_allBuyerClass	//1年1省全行业
+                } else {
+                    if (t) return this.PriceRule.old.month.oneProvince_oneBuyerClass * iCount; //1月1省icount个行业
+                    return this.PriceRule.old.year.oneProvince_oneBuyerClass * iCount	//1年1省icount个行业
+                }
+            default:
+                if (iCount === -1) {
+                    if (t) return this.PriceRule.old.month.oneCity_allBuyerClass;  //1月1市全行业
+                    return this.PriceRule.old.year.oneCity_allBuyerClass	//1年1市全行业
+                } else {
+                    if (t) return this.PriceRule.old.month.oneCity_oneBuyerClass * iCount; //1月1市icount个行业
+                    return this.PriceRule.old.year.oneCity_oneBuyerClass * iCount	//1年1市icount个行业
+                }
+        }
+    },
+    getSetMealPrice_new: (p, u) => { //新套餐价格计算 p省份格式,u时间单位
+        var t = u === 2 //是否是月单位
+        switch (p) {
+            case 0:
+                if (t) {
+                    return this.PriceRule.new.month.allProvince_allBuyerClass // 1月全国全行业
+                }
+                return this.PriceRule.new.year.allProvince_allBuyerClass //1年全国全行业
+            case 1:
+                if (t) {
+                    return this.PriceRule.new.month.oneProvince_allBuyerClass //1月1省全行业
+                }
+                return this.PriceRule.new.year.oneProvince_allBuyerClass //1年1省全行业
+        }
+        return -1
+    },
+    getDateSub: (start, end) => { //计算时间间隔差 [年个数, 月个数]
+        var startTime = new Date(start * 1000);
+        var endTime = new Date(end * 1000);
+
+        var startYear = startTime.getFullYear();
+        var startMonth = startTime.getMonth();
+        var startDay = startTime.getDate();
+
+        var endYear = endTime.getFullYear();
+        var endMonth = endTime.getMonth();
+        var endDay = endTime.getDate();
+
+        var finalMonthNum = 0;
+        var finalYearNum = 0;
+        if (startYear === endYear) {
+            if (startMonth === endMonth) {
+                finalMonthNum = 1;
+            } else {
+                if (endDay > startDay) {
+                    finalMonthNum = endMonth - startMonth + 1;
+                } else {
+                    finalMonthNum = endMonth - startMonth;
+                }
+            }
+        } else {
+            if (startMonth === endMonth) {
+                if (endDay <= startDay) {
+                    finalMonthNum = (endYear - startYear) * 12;
+                } else {
+                    finalMonthNum = (endYear - startYear) * 12 + 1;
+                }
+            } else if (endMonth > startMonth) {
+                if (endDay <= startDay) {
+                    finalMonthNum = (endYear - startYear) * 12 + (endMonth - startMonth);
+                } else {
+                    finalMonthNum = (endYear - startYear) * 12 + (endMonth - startMonth) + 1;
+                }
+            } else {
+                if (endDay <= startDay) {
+                    finalMonthNum = (endYear - startYear - 1) * 12 + (12 - startMonth + endMonth);
+                } else {
+                    finalMonthNum = (endYear - startYear - 1) * 12 + (12 - startMonth + endMonth) + 1;
+                }
+            }
+            finalYearNum = Math.floor(finalMonthNum / 12);
+            if (finalYearNum > 0) {
+                finalMonthNum = finalMonthNum - finalYearNum * 12
+            }
+        }
+        return [finalYearNum, finalMonthNum]
+    },
+    numAdd: (num1, num2) => {
+        return (num1 * 10000 + num2 * 10000) / 10000
+    }
+}

+ 6 - 7
src/jfw/modules/app/src/web/staticres/jyapp/vipsubscribe/js/vip_renew.js

@@ -14,7 +14,6 @@ var purchase = {
         //已选择
         try {
             //即将到期 回显已购买
-            console.log(sessionStorage.getItem("pay_read_cache"))
             if (!sessionStorage.getItem("pay_read_cache")) {
                 $DoPost("/subscribepay/vipsubscribe/getSubBuyMsg", {}, function (r) {
                     if (r.success) {
@@ -96,7 +95,7 @@ var purchase = {
     showArea: function () {
         if (!$.isEmptyObject(this.areaSelect) && !this.areaSelect["一个省"]) { //有选择
             if (this.nowBuyset.areacount === -1) {
-                $(".selected-area").text("全国");
+                $(".area .item-r").text("全国");
             } else {
                 var tipTxt = "";
                 if (this.nowBuyset.areacount > 0) tipTxt += this.nowBuyset.areacount + " 个省";
@@ -109,10 +108,10 @@ var purchase = {
                     tipTxt += count + " 个市";
                     if (this.nowBuyset.citys.length > 1) tipTxt += "(分布在" + this.nowBuyset.citys.length + "个省内)"
                 }
-                $(".selected-area").text(tipTxt);
+                $(".area .item-r").text(tipTxt);
             }
         } else {
-            $(".selected-area").text("");
+            $(".area .item-r").text("");
         }
     },
     showPrice: function () {
@@ -133,13 +132,13 @@ var purchase = {
     showIndustry: function () {
         if (this.industrySelect.length > 0 && this.industrySelect[0] !== "一个行业") { //选择有行业信息
             if (this.nowBuyset.buyerclasscount === -1) {
-                $(".selected-industry-count").text("全部行业");
+                $(".industry .item-r").text("全部行业");
             } else {
                 var tipTxt = "";
-                $(".selected-industry-count").text(tipTxt + this.nowBuyset.buyerclasscount + " 个行业");
+                $(".industry .item-r").text(tipTxt + this.nowBuyset.buyerclasscount + " 个行业");
             }
         } else {
-            $(".selected-industry-count").text("");
+            $(".industry .item-r").text("");
         }
     },
     showTime: function () {

+ 17 - 11
src/jfw/modules/app/src/web/staticres/jyapp/vipsubscribe/js/vip_upgrade.js

@@ -10,6 +10,7 @@ var purchase = {
   nowBuyset: {},
   timeCheckOk: false,
   payWay: "wx_app",
+  isUpdate: 0, // 0未升级到新套餐 1已升级到新套餐
   initData: function () {
     //已选择
     try {
@@ -18,6 +19,7 @@ var purchase = {
       if (!sessionStorage.getItem("pay_read_cache")) {
         $DoPost("/subscribepay/vipsubscribe/getSubBuyMsg", {}, function (r) {
           if (r.success) {
+            purchase.isUpdate = r.data.buyset.upgrade
             if (!$.isEmptyObject(r.data.area)) {
               purchase.areaSelect = r.data.area
             } else {
@@ -37,6 +39,8 @@ var purchase = {
             sessionStorage.setItem("vipSubSelectIndustry", JSON.stringify(purchase.industrySelect));
             sessionStorage.setItem("endTime", JSON.stringify(purchase.endTime))
             sessionStorage.setItem("vipSub_read", true);
+            // 缓存是否升级到新套餐
+            sessionStorage.setItem('vipSub_is_upgrade', r.data.buyset.upgrade)
           }
         }, false)
       } else {
@@ -61,8 +65,9 @@ var purchase = {
       }
       //加载价格
       $DoPost("/subscribepay/vipsubscribe/getPrice", {}, function (r) {
-        if (r) {
-          purchase.price = r;
+        // r.new 新套餐价格 r.old旧套餐价格
+        if (r.new) {
+          purchase.price = r.new;
           purchase.can1111 = r.isActiving && r.isWritten === 0
           if (purchase.can1111) {
             if (!sessionStorage.getItem("vipSubSelectTime")) {
@@ -116,18 +121,18 @@ var purchase = {
     }
   },
   showPrice: function () {
-    $('.monthly span:eq(0)').text(purchase.price.month.oneCity_oneBuyerClass / 100);
-    $('.monthly span:eq(1)').text(purchase.price.month.oneCity_allBuyerClass / 100);
-    $('.monthly span:eq(2)').text(purchase.price.month.oneProvince_oneBuyerClass / 100);
+    // $('.monthly span:eq(0)').text(purchase.price.month.oneCity_oneBuyerClass / 100);
+    // $('.monthly span:eq(1)').text(purchase.price.month.oneCity_allBuyerClass / 100);
+    // $('.monthly span:eq(2)').text(purchase.price.month.oneProvince_oneBuyerClass / 100);
     $('.monthly span:eq(3)').text(purchase.price.month.oneProvince_allBuyerClass / 100);
-    $('.monthly span:eq(4)').text(purchase.price.month.allProvince_oneBuyerClass / 100);
+    // $('.monthly span:eq(4)').text(purchase.price.month.allProvince_oneBuyerClass / 100);
     $('.monthly span:eq(5)').text(purchase.price.month.allProvince_allBuyerClass / 100);
 
-    $('.yearly span:eq(0)').text(purchase.price.year.oneCity_oneBuyerClass / 100);
-    $('.yearly span:eq(1)').text(purchase.price.year.oneCity_allBuyerClass / 100);
-    $('.yearly span:eq(2)').text(purchase.price.year.oneProvince_oneBuyerClass / 100);
+    // $('.yearly span:eq(0)').text(purchase.price.year.oneCity_oneBuyerClass / 100);
+    // $('.yearly span:eq(1)').text(purchase.price.year.oneCity_allBuyerClass / 100);
+    // $('.yearly span:eq(2)').text(purchase.price.year.oneProvince_oneBuyerClass / 100);
     $('.yearly span:eq(3)').text(purchase.price.year.oneProvince_allBuyerClass / 100);
-    $('.yearly span:eq(4)').text(purchase.price.year.allProvince_oneBuyerClass / 100);
+    // $('.yearly span:eq(4)').text(purchase.price.year.allProvince_oneBuyerClass / 100);
     $('.yearly span:eq(5)').text(purchase.price.year.allProvince_allBuyerClass / 100);
   },
   showIndustry: function () {
@@ -191,6 +196,7 @@ var purchase = {
       $('.computed_price').html(showPrice);
     }
     this.flushSelectTime(times, flag === undefined ? 1 : flag);
+    console.log(givePrice,price,showPrice)
     coupon.updatePrice(price)
   },
   flushSelectTime (thisValue, flag) {
@@ -261,7 +267,7 @@ var purchase = {
 $(function () {
   purchase.initData();
   purchase.showArea();
-  purchase.showIndustry();
+  // purchase.showIndustry(); // 新套餐不展示行业(2021/5/19)
   purchase.showPrice();
   purchase.showTime();
   purchase.showTip();

+ 58 - 0
src/jfw/modules/app/src/web/templates/vipsubscribe/vip_UpgradeDetail.html

@@ -0,0 +1,58 @@
+<!DOCTYPE html>
+<html lang="zh-CN">
+
+<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>
+    <meta name="apple-mobile-web-app-capable" content="yes">
+    <meta name="apple-mobile-web-app-status-bar-style" content="black">
+    <script src='{{Cdns .Host "seo" "cdn"|SafeUrl}}/jyapp/local/rem.js'></script>
+    <link rel="stylesheet" type="text/css" href='{{Cdns .Host "seo" "cdn"|SafeUrl}}/jyapp/local/weui.min.css'/>
+    <link rel="stylesheet" type="text/css" href='{{Cdns .Host "seo" "cdn"|SafeUrl}}/jyapp/vipsubscribe/css/base2.css?v={{Msg "seo" "version"}}'/>
+    <link rel="stylesheet" type="text/css" href='{{Cdns .Host "seo" "cdn"|SafeUrl}}/jyapp/vipsubscribe/iconfont/iconfont.css?v={{Msg "seo" "version"}}'/>
+	<link rel="stylesheet" type="text/css" href='{{Cdns .Host "seo" "cdn"|SafeUrl}}/jyapp/vipsubscribe/css/public_.css?v={{Msg "seo" "version"}}'/>
+    <link rel="stylesheet" type="text/css" href='{{Cdns .Host "seo" "cdn"|SafeUrl}}/jyapp/local/layout.css'/>
+    <link rel="stylesheet" type="text/css" href='{{Cdns .Host "seo" "cdn"|SafeUrl}}/jyapp/css/font.css?v={{Msg "seo" "version"}}'/>
+    <style>
+        .content {
+            height: 100%;
+            display: flex;
+            align-items: center;
+            justify-content: center;
+        }
+    </style>
+</head>
+<body class="no-touch"  data-weui-theme="light">
+<div class="app-layout-header jy-app-header" style="z-index: 8;">
+    <span class="app-back jyapp-icon jyapp-icon-zuojiantou"></span>
+    <span>超级订阅升级</span>
+    <span></span>
+</div>
+<div class="app-layout-content-b">
+	<div class="j-container">
+        <div class="j-body">
+            <div class="content">超级订阅升级版介绍</div>
+        </div>
+        <div class="footer j-button-group">
+            <button class="j-button-confirm">升级</button>
+        </div>
+    </div>
+</div>
+<script src="{{Cdns .Host "seo" "cdn"|SafeUrl}}/jyapp/local/jquery.min.js"></script>
+<script src='{{Cdns .Host "seo" "cdn"|SafeUrl}}/jyapp/vipsubscribe/js/common.js?v={{Msg "seo" "version"}}'></script>
+<script src='{{Cdns .Host "seo" "cdn"|SafeUrl}}/jyapp/js/common.js?v={{Msg "seo" "mod_version"}}'></script>
+{{include "/common/iosJS.html"}}
+<script>
+$(function () {
+    $('.j-button-confirm').on('click', function () {
+        location.href = '/jyapp/vipsubscribe/upgradePage'
+    })
+})
+</script>
+{{include "/common/baiducc.html"}}
+</body>
+
+</html>

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

@@ -42,14 +42,11 @@
   </div>
   <div class="app-layout-content-b">
     <div class="vip-upgrade live-20200707">
-      <!-- <div class="vip-header">
-        <span class="header-left">提示:</span>
-        <span class="header-right">您的超级订阅服务即将到期,为不影响您的使用。请立即续费</span>
-      </div> -->
+      <!-- <div class="vip-header"></div> -->
       <div class="vip-body">
         <ul style="padding: .16rem .24rem;">
           <li class="body-item area">
-            <a class="item-container" href="/jyapp/vipsubscribe/toChooseArea">
+            <a class="item-container" href="/jyapp/vipsubscribe/toChooseArea?header=upgrade">
               <div class="item">
                 <span class="item-l">
                   <span class="item-label">省份数量</span>
@@ -95,10 +92,43 @@
           </div>
         </div>
       </div>
-      <!-- vue组件 -->
+      <!-- vue组件 现带优惠券的订单提交(与原订单提交事件绑定,原订单提交不可删除) -->
       <div class="vip-footer" id="coupon-vue">
         <pay-order-template ref="couponRef" :config="$data" @update="updateS" @save="saveEvent"></pay-order-template>
       </div>
+      <!-- 原订单提交 -->
+      <div class="vip-footer renew" style="display: none;">
+        <div class="footer-preview-container">
+          <div class="price-preview">
+            <span class="preview-label">合计:</span>
+            <span class="preview-content">
+              <span class="billing-list-btn"></span>
+              <span class="billing-price-container">
+                <span class="yen">&yen;</span>
+                <span class="billing-price"></span>
+              </span>
+            </span>
+          </div>
+          <div class="origin-price" style="display: none">
+            <span class="discount-button">
+              <span>优惠明细</span>
+              <span class="iconfont icon-arrow"></span>
+            </span>
+            <span class="price-label">原价:</span>
+            <div class="price-container">
+              <span class="currency-type">&yen;</span>
+              <span class="price-num"></span>
+            </div>
+          </div>
+          <div class="clause-box">
+            <span class="checkbox"></span>
+            <span class="clause-read">我已阅读,理解并接受<a onclick="toRead()">《剑鱼标讯线上购买与服务条款》</a></span>
+          </div>
+        </div>
+        <div class="footer-button-group j-button-group">
+          <button data-need-bind-phone style="height: 0.92rem!important;line-height: 0.92rem;" class="button-r confirm j-button-confirm" disabled>提交订单</button>
+        </div>
+      </div>
     </div>
   </div>
   <!-- 选择订阅周期picker -->

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

@@ -363,6 +363,13 @@
             </div>
             <a href="/jyapp/vipsubscribe/vipsubscribe_new" class="renew-r">去购买</a>
           </div>
+          <div class="header-renew renew" style="display: none">
+            <div class="renew-l">
+              <div class="vip-logo"></div>
+              <div class="vip-text">超级订阅服务</div>
+            </div>
+            <a href="/jyapp/vipsubscribe/vipsubscribe_renew" class="renew-r">续费</a>
+          </div>
           <div class="expire-remind" style="display: none">
             <i class="j-icon icon-chahao red close-expire-remind"></i>
             <span class="remind-text">超级订阅服务试用即将过期,请及时购买!</span>
@@ -685,9 +692,9 @@
       $('*[data-bind-renew]').on('click',function() {
         location.href = '/jyapp/vipsubscribe/vipsubscribe_renew'
       })
-      // 跳转到升级页面
+      // 跳转到权益页,有权益页跳转到升级页面
       $('*[data-bind-update]').on('click',function() {
-        location.href = '/jyapp/vipsubscribe/vipsubscribe_update'
+        location.href = '/jyapp/vipsubscribe/upgradeDetail'
       })
     </script>
     <script src='{{Cdns .Host "seo" "cdn"|SafeUrl}}/jyapp/vipsubscribe/js/UpgradePrice.js?v={{Msg "seo" "version"}}'></script>

+ 12 - 54
src/jfw/modules/app/src/web/templates/vipsubscribe/vip_renew.html

@@ -39,8 +39,9 @@
 <body class="no-touch"  data-weui-theme="light">
 <div class="app-layout-header jy-app-header" style="z-index: 8;">
     <span class="app-back jyapp-icon jyapp-icon-zuojiantou"></span>
-    超级订阅续费
-<span></span></div>
+    <span>超级订阅续费</span>
+    <span></span>
+</div>
 <div class="app-layout-content-b">
 	{{if not .T.isLiveActive}}
 	<div class="vip-renew">
@@ -54,33 +55,17 @@
         <div class="vip-body">
             <div class="j-notice-bar bar-red vip-bar" style="text-align: center;">限时续费,3个月起,续多久送多久!</div>
             <ul style="padding: .16rem .24rem;">
-                <li class="body-item area">
-                    <a class="item-container" href="/jyapp/vipsubscribe/toChooseArea">
-                        <div class="item">
-                        <span class="item-l">
-                            <span class="item-label">区域</span>
-                        </span>
-                            <span class="item-r">
-                            <span class="selected-area-name ellipsis"></span>
-                            <span class="iconfont icon-arrow"></span>
-                        </span>
+                <li class="body-item area-industry">
+                    <div class="item-container">
+                        <div class="item area">
+                            <span class="item-l">区域:</span>
+                            <span class="item-r"></span>
                         </div>
-                        <div class="sub-item text selected-area"></div>
-                    </a>
-                </li>
-                <li class="body-item industry">
-                    <a class="item-container" href="/jyapp/vipsubscribe/toChooseIndustry">
-                        <div class="item">
-                        <span class="item-l">
-                            <span class="item-label">采购单位行业</span>
-                        </span>
-                            <span class="item-r">
-                            <span class="selected-industry-name industry-text ellipsis"></span>
-                            <span class="iconfont icon-arrow"></span>
-                        </span>
+                        <div class="item industry">
+                            <span class="item-l">行业:</span>
+                            <span class="item-r"></span>
                         </div>
-                        <div class="sub-item text selected-industry-count"></div>
-                    </a>
+                    </div>
                 </li>
                 <li class="body-item select_cycle">
                     <a class="item-container" href="javascript:;">
@@ -103,33 +88,6 @@
                         </div>
                     </a>
                 </li>
-                <!-- <li class="body-item pay-mode">
-                    <a class="item-container" href="javascript:;">
-                        <div class="item">
-                            <span class="item-l">
-                                <span class="leading"></span>
-                                <span class="item-label">支付方式</span>
-                            </span>
-                            <span class="item-r">
-                                <span class="pay-mode-text">微信支付</span>
-                                <span class="iconfont icon-arrow"></span>
-                            </span>
-                        </div>
-                    </a>
-                </li> -->
-                <!--			<li class="body-item coupon-code-tx" style="display: none">-->
-                <!--			    <a class="item-container" href="javascript:;">-->
-                <!--			        <div class="item">-->
-                <!--			            <span class="item-l">-->
-                <!--			                <span class="item-label">优惠码</span>-->
-                <!--			            </span>-->
-                <!--			            <span class="item-r">-->
-                <!--			                <span class="keywords-text">输入优惠码</span>-->
-                <!--			                <span class="iconfont icon-arrow"></span>-->
-                <!--			            </span>-->
-                <!--			        </div>-->
-                <!--			    </a>-->
-                <!--			</li>-->
             </ul>
             <ul style="padding: 0 .24rem;display: none;" id="giveTimeBox">
                 <li class="body-item select_cycle">

+ 1 - 2
src/jfw/modules/subscribepay/src/entity/subscribeVip.go

@@ -52,7 +52,7 @@ type subVipPrice struct {
 		ProvinceMaxCount   int `json:"provinceMaxCount"`   //所有地区中省份可计价最大数量
 		BuyerClassMaxCount int `json:"buyerClassMaxCount"` //行业价格可计价最大数量
 		MonthMaxCount      int `json:"monthMaxCount"`      //月份可计价最大数量
-	} `json:"Old"`
+	} `json:"old"`
 	New struct {
 		Month struct {
 			OneProvince_allBuyerClass int `json:"oneProvince_allBuyerClass"` //一个省份全部行业
@@ -566,7 +566,6 @@ func (this *vipSubscribeStruct) GetSubVipPriceByBuySet(buySet *SubvipBuySet, cou
 			}
 			finalPrice += pCount * getSetMealPrice_old(1, industryNum, unit) * count
 		} else { //升级版超级订阅计价规则
-			industryNum = 0 //全行业
 			if pCount > SubVipPrice.New.ProvinceMaxCount {
 				pCount = -1
 			}

+ 1 - 2
src/jfw/modules/subscribepay/src/service/vipSubscribeChange.go

@@ -22,7 +22,7 @@ import (
 type SubscribeChange struct {
 	*xweb.Action
 	getSubBuyMsg  xweb.Mapper `xweb:"/vipsubscribe/getSubBuyMsg"`  //获取vip订阅详情
-	saveChange    xweb.Mapper `xweb:"/vipsubscribe/saveChange"`    //订阅修改 or 升级
+	saveChange    xweb.Mapper `xweb:"/vipsubscribe/saveChange"`    //订阅修改
 	mergeIndustry xweb.Mapper `xweb:"/vipsubscribe/mergeIndustry"` //行业合并
 }
 
@@ -98,7 +98,6 @@ func (this *SubscribeChange) SaveChange() {
 		}
 		return &entity.FuncResult{true, nil, map[string]interface{}{
 			"doSuccess": true,
-			"needPay":   false,
 		}}
 	}()
 	if r.Err != nil {

+ 17 - 8
src/jfw/modules/subscribepay/src/service/vipSubscribePay.go

@@ -67,6 +67,7 @@ func (this *SubVipPayOrder) CreateOrder() {
 		orderType, _ := this.GetInteger("orderType") //1 简单付费,5 升降级续费
 		openId := qutil.ObjToString(this.GetSession("s_m_openid"))
 		disWord := this.GetString("disWord")
+		req_price, _ := this.GetInteger("price")     //前端展示金额
 		order_phone := this.GetString("order_phone") //p19.3用户信息采集 手机号
 
 		if disWord == "" {
@@ -122,17 +123,20 @@ func (this *SubVipPayOrder) CreateOrder() {
 		}
 		//计算价格
 		totalfee := entity.JyVipSubStruct.GetSubVipPrice(buyset, date_count, date_unit)
+		if req_price != totalfee {
+			log.Println(userId+" 前台计算", req_price, "后台计算", totalfee)
+			return &entity.FuncResult{false, errors.New(fmt.Sprintf("金额校验异常[%d,%d]", totalfee, req_price)), nil}
+		}
 		//原价
 		original_price := totalfee
 		log.Printf("最终选择 地区:%+v   行业:%v\n 价格%d", filter.Area, filter.Industry, totalfee)
 		ordercode := pay.GetOrderCode(userId)
-		//用户当前使用卡卷
-		userLotteryId := ""
-		full_price, reduce_price := 0, 0
+
 		//卡卷信息的id
 		lotteryId := this.GetString("lotteryId")
-		discount_price := 0
+		discount_price, userLotteryId := 0, ""
 		if lotteryId != "" {
+			full_price, reduce_price := 0, 0
 			full_price, reduce_price, userLotteryId = util.GetCouponInfo(userId, lotteryId, config.CouponConfig.Products["超级订阅"])
 			if full_price <= totalfee {
 				totalfee = totalfee - reduce_price
@@ -209,6 +213,7 @@ func (this *SubVipPayOrder) Renew() {
 	r := func() *entity.FuncResult {
 		disWord := this.GetString("disWord")
 		openId := qutil.ObjToString(this.GetSession("s_m_openid"))
+		req_price, _ := this.GetInteger("price") //前端展示金额
 		if disWord == "" {
 			start_time := TimeProcessing(time.Now().Format(DateFullLayout), -config.Config.TermValidity).Format(DateFullLayout)
 			stop_time := TimeProcessing(time.Now().Format(DateFullLayout), config.Config.TermValidity).Format(DateFullLayout)
@@ -227,6 +232,10 @@ func (this *SubVipPayOrder) Renew() {
 			return &entity.FuncResult{false, errors.New("请求异常,非vip状态"), nil}
 		}
 		totalfee := entity.JyVipSubStruct.GetSubVipPriceByBuySet(buyset, date_count, date_unit, false)
+		if req_price != totalfee {
+			log.Println(userId+" 前台计算", req_price, "后台计算", totalfee)
+			return &entity.FuncResult{false, errors.New(fmt.Sprintf("金额校验异常[%d,%d]", totalfee, req_price)), nil}
+		}
 		filter := entity.VipSimpleMsg{
 			Area:       nil,
 			Industry:   nil,
@@ -242,13 +251,13 @@ func (this *SubVipPayOrder) Renew() {
 		}
 		//原价
 		original_price := totalfee
-		//用户当前使用卡卷
-		userLotteryId := ""
-		full_price, reduce_price := 0, 0
+
 		//卡卷信息的id
 		lotteryId := this.GetString("lotteryId")
-		discount_price := 0
+		userLotteryId, discount_price := "", 0
 		if lotteryId != "" {
+			//用户当前使用卡卷
+			full_price, reduce_price := 0, 0
 			full_price, reduce_price, userLotteryId = util.GetCouponInfo(userId, lotteryId, config.CouponConfig.Products["超级订阅"])
 			if full_price <= totalfee {
 				totalfee = totalfee - reduce_price

+ 9 - 0
src/web/staticres/vipsubscribe/css/vip_renew.css

@@ -707,3 +707,12 @@
 .origin-price .price-num {
   text-decoration: line-through;
 }
+
+.area-industry .item-container .item {
+  justify-content: flex-start;
+}
+.area-industry .item-container .item .item-r {
+  width: unset;
+  flex: 1;
+  justify-content: flex-start;
+}

+ 433 - 0
src/web/staticres/vipsubscribe/css/vip_upgrade.css

@@ -0,0 +1,433 @@
+.no-touch {
+  -webkit-touch-callout: none;
+  -webkit-user-select: none;
+  -khtml-user-select: none;
+  -moz-user-select: none;
+  -ms-user-select: none;
+  user-select: none;
+}
+
+.vip-upgrade {
+  display: flex;
+  flex-direction: column;
+  width: 100%;
+  height: 100%;
+}
+
+.vip-upgrade .vip-body {
+  display: flex;
+  flex-direction: column;
+  flex: 1;
+  overflow-y: scroll;
+}
+
+.vip-upgrade .vip-body .body-item {
+  position: relative;
+  padding: 0.33rem 0.31rem;
+}
+
+.vip-upgrade .vip-body .body-item::after {
+  position: absolute;
+  content: '';
+  left: .32rem;
+  right: .32rem;
+  bottom: 0;
+  border-bottom: 1px solid rgba(0, 0, 0, 0.05);
+}
+
+.vip-upgrade .vip-body ul>.body-item:first-child {
+  border-top-left-radius: 8px;
+  border-top-right-radius: 8px;
+}
+
+.vip-upgrade .vip-body ul>.body-item:last-child::after {
+  content: none;
+}
+.vip-upgrade .area-result{
+  font-size: .24rem;
+  color: #5f5e64;
+  line-height: .36rem;
+}
+
+.vip-upgrade .vip-footer {
+  width: 100%;
+}
+
+.vip-body {
+  padding-bottom: 0.32rem;
+}
+
+.vip-body .vertical-center {
+  display: flex;
+  align-items: center;
+}
+
+.vip-body .body-item {
+  background-color: #fff;
+}
+
+.vip-body .body-item.area {
+  border-radius: 8px 8px 0 0;
+}
+
+.vip-body .body-item.select_cycle {
+  border-radius: 0 0 8px 8px;
+}
+
+.vip-body .body-item .item-container {
+  display: block;
+  width: 100%;
+}
+
+.vip-body .body-item .item,
+.vip-body .body-item .sub-item {
+  display: flex;
+  align-items: center;
+  justify-content: space-between;
+  color: #686868;
+  font-size: 0.32rem;
+}
+
+.vip-body .body-item .item .item-l,
+.vip-body .body-item .item .item-r,
+.vip-body .body-item .sub-item .item-l,
+.vip-body .body-item .sub-item .item-r {
+  display: flex;
+  align-items: center;
+  justify-content: flex-end;
+  flex-wrap: nowrap;
+}
+
+.vip-body .body-item .text {
+  font-size: 0.24rem;
+}
+
+.vip-body .body-item .item .item-l {
+  font-size: 0.32rem;
+  color: #1d1d1d;
+}
+
+.vip-body .body-item .item .item-r {
+  font-size: 0.28rem;
+  width: 65%;
+}
+
+.vip-body .body-item .item .item-r .ellipsis {
+  display: none;
+}
+
+.vip-body .body-item .item .iconfont {
+  margin-left: 0.12rem;
+  color: #c2c2c2;
+  font-size: 0.24rem;
+}
+
+.vip-body .body-item .sub-item {
+  margin-top: 0.04rem;
+  justify-content: flex-start;
+}
+
+.vip-body .body-item .sub-item .sub-r {
+  flex: 1;
+  display: flex;
+  align-items: center;
+  justify-content: space-between;
+}
+
+.vip-body .body-item .sub-item .sub-r .tip {
+  display: none;
+  color: #fe737a;
+}
+
+.checkbox {
+  display: inline-block;
+  width: 0.36rem;
+  height: 0.36rem;
+  border: 1px solid #ddd;
+  border-radius: 50%;
+  margin-right: 0.2rem;
+  -webkit-appearance: none;
+  background: #fff;
+}
+
+.checkbox.checked {
+  border: 0;
+  background: url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAADAAAAAwCAYAAABXAvmHAAACpElEQVRogc1asa2DMBBlhIyQMpKNxAiMwAiMwAhswAgZgQrOHSVwLhiBERghvwCSwMdgOzYG6aQUhLw7v3u+Z+J5Bq4g724U6pCUTeIznlGGHQHsKcOBAPbT544yntOiTSnUoYnf/Rm0X7YRAXxShgMFfCkH4zkBjE8HTos21QYtCJ/xzDpwAhgTwN4k8OWK4GBlRYK8u1HGc2vA/yfSPaC+GwFPoQ6tVn1vNQoMfgJPyiYxzXXl3ijbSA88YOwa/BzKfUEKDK4C/hOSe8cD6vv1wOOLMhykGvtUtVFPotunDmDsHORBCPth1PoLUmeDStvUKdrUObgxqinE9xRt+q/6TjarZWW79cZFGXaiVQjy7va+0S/byDX4LYUhZZOIvrPoBafKw7BbVFOW1ozn7pt3B/xe9ed4QH33KNSho+pXv4CngC9SNon0zVcDTwFHNTqb/wTwqcX5TQry3KNHmmswfMYzEXif8Uz5mQwHT1r/55MGC+AJ4FPruVIJrJwRhToUbjA74LeATxuoHvg5gSMJFf24bO9YAy+7AgTwuQVAirfrmeULvBHxYDhINTEpm0SYhGgMsQ1+LG4v3f17B09rCyqa2Y0fzzCeq8pXJUpiPB/F6jTwc1GVJ1GNQ6dp3lJSLqkEyjbSG+YYDrKnBA+o77a8xruQunK219yeN/aGNaM0j9NTAvpmXqA2VsHDSigMWMrFdDnt1vY8xtpSep4hUz+qTGXbIG1K+iWMvW7137x1Y27UQtBzHyqd6A80qi/00AsqXfKETuWFh0OjLwSv/KLjSkkcbZjXTYLhoA3eeRI6tBFd86h8Inhzr1m/L+v7xESZQ6m8XCJnARckoketca+paNGmVuiievllG032tKKjtezf1f36u43PeEYAY1PV/gMeU6lGAhyHxgAAAABJRU5ErkJggg==) no-repeat center center;
+  background-size: 100% 100%;
+}
+
+.jy_icon {
+  position: relative;
+  width: 100%;
+  height: 100%;
+}
+
+.jy_icon.decrease:before,
+.jy_icon.increase:before,
+.jy_icon.increase:after {
+  position: absolute;
+  left: 50%;
+  top: 50%;
+  content: "";
+  width: 0.4rem;
+  height: 0.04rem;
+  background-color: #686868;
+  transform: translate(-50%, -50%);
+}
+
+.jy_icon.increase:after {
+  transform: translate(-50%, -50%) rotate(90deg);
+}
+
+
+.js_dialog .box {
+  position: fixed;
+  bottom: 0;
+  left: 0;
+  width: 100%;
+  height: 4.8rem;
+  background: #fff;
+  z-index: 9999;
+}
+
+.js_dialog .box .box_hd {
+  display: flex;
+  justify-content: space-between;
+  align-items: center;
+  padding: .44rem .32rem .24rem;
+}
+
+.js_dialog .box .box_hd h3 {
+  color: #1d1d1d;
+  font-size: 0.32rem;
+  font-weight: normal;
+}
+
+.js_dialog .box .box_hd .cancel {
+  color: #2cb7ca;
+  font-size: 0.32rem;
+}
+
+.js_dialog .box .box_bd .weui-cells:after {
+  border: 0;
+}
+
+.js_dialog .box .box_bd .weui-cells:before {
+  border: 0;
+}
+
+.js_dialog .box .box_bd .weui-cell:before {
+  border: 0;
+}
+
+.weui-icon-checked{
+width: 20px;
+height: 20px;
+}
+.js_dialog .box .box_bd .weui-check:checked + .weui-icon-checked:before {
+  color: #2cb7ca;
+}
+
+.js_dialog .box .box_bd .choose-form {
+  margin: 0;
+}
+
+.js_dialog .box .box_bd .tips {
+  display: none;
+}
+
+.js_dialog .box .box_bd p {
+  font-size: 0.32rem;
+}
+
+.js_dialog .box .box_bd .weui-check:checked + .weui-icon-checked:before {
+  color: #2cb7ca;
+}
+
+.js_dialog .form-btn {
+  display: flex;
+  align-items: center;
+}
+
+.js_dialog .form-btn .enter {
+  background: #2cb7ca;
+  color: #fff;
+}
+
+.js_dialog .form-btn .btn {
+  flex: 1;
+  height: 0.94rem;
+  line-height: 0.94rem;
+  text-align: center;
+  font-size: 0.36rem;
+}
+
+.time_cycle .box {
+  display: flex;
+  flex-direction: column;
+  justify-content: space-between;
+  height: auto;
+}
+
+.time_cycle .box .tips {
+  height: 0.64rem;
+  line-height: 0.64rem;
+  font-size: 0.26rem;
+  color: #fff;
+  background-color: #ffb901;
+  text-align: center;
+}
+
+.time_cycle .box_bd {
+  width: 100%;
+}
+
+.time_cycle .box_bd .monthly_label,
+.time_cycle .box_bd .yearly_label {
+  padding: 0;
+}
+
+.time_cycle .box_bd .computed_price {
+  padding: 0.4rem 0.36rem 0.24rem;
+  font-size: 0.4rem;
+  border-bottom: 1px solid #e0e0e0;
+}
+
+.time_cycle .box_bd .bd_select {
+  padding: 0.62rem 0.4rem 0.64rem;
+}
+
+.time_cycle .box_bd .bd_select .choose-form {
+  display: flex;
+  flex-direction: column;
+  justify-content: space-between;
+  box-sizing: border-box;
+}
+
+.time_cycle .box_bd .bd_select .choose-form .number_box {
+  margin-top: 0.3rem;
+}
+
+.time_cycle .box_bd .bd_select .choose-form:nth-child(2) {
+  padding-top: 0.56rem;
+}
+
+.time_cycle .number_box {
+  display: flex;
+  justify-content: space-between;
+  align-items: center;
+  height: 0.8rem;
+  border: 1px solid #f5f4f9;
+  text-align: center;
+}
+
+.time_cycle .number_box.active {
+  color: #2cb7ca;
+}
+
+.time_cycle .number_box.active .jy_icon.decrease:before,
+.time_cycle .number_box.active .jy_icon.increase:before,
+.time_cycle .number_box.active .jy_icon.increase:after {
+  background-color: #2cb7ca;
+}
+
+.time_cycle .number_box button[disabled] {
+  opacity: 0.2;
+}
+
+.time_cycle .number_box .weui-btn_plain-default {
+  width: 1.6rem;
+  height: 100%;
+  line-height: normal;
+  border-color: transparent;
+  border-radius: 0;
+  background-color: #f5f4f9;
+}
+
+.time_cycle .number_box span.month_number {
+  flex: 1;
+  font-size: 0.4rem;
+}
+
+.time_cycle .number_box span.year_number {
+  width: 2rem;
+  height: 0.8rem;
+  line-height: 0.8rem;
+  background-color: #f5f4f9;
+  border: 1px solid #e0e0e0;
+}
+
+.time_cycle .number_box span.year_number.active {
+  color: #2ABED1!important;
+  background-color: #E8FAFD;
+}
+
+.jy-toast .weui-toast {
+  font-size: 0.28rem;
+  padding: 0.2rem;
+  width: auto;
+  height: auto;
+  max-width: 6rem;
+  min-height: 0;
+  top: 50%;
+  left: 50%;
+  margin-left: 0;
+  margin-top: -0.47rem;
+  transform: translateX(-50%) translateY(-50%);
+}
+
+.jy-toast .weui-icon_toast {
+  display: none;
+}
+
+.jy-toast .weui-toast__content {
+  margin: 0;
+}
+
+.pay-mode {
+  margin-top: .3rem;
+}
+
+/* 2.10.9 直播优惠码新增 */
+.coupon-code-tx,
+.coupon-picker,
+.vip-bar {
+  display: none;
+}
+
+.live-20200707 .j-notice-bar,
+.live-20200707 .origin-price {
+  display: flex;
+}
+
+.live-20200707 .coupon-code-tx {
+  display: block;
+}
+
+.coupon-code-tx {
+  margin-top: .32rem;
+}
+
+.text-red {
+  color: #FB483D;
+}
+/* 专属权益 */
+.vip-upgrade .rights{
+  padding: 0 .32rem;
+}
+.vip-upgrade .rights-title{
+  padding: .36rem 0 .16rem;
+  display: flex;
+  align-items: center;
+  color: #171826;
+  line-height: .44rem;
+  font-size: .3rem;
+}
+.rights-title .title-line{
+  display: inline-block;
+  width: 3px;
+  height: .32rem;
+  border-radius: .22rem;
+  background-color: #2abed1;
+  margin-right: .16rem;
+}

+ 3 - 0
src/web/staticres/vipsubscribe/js/choose_area.js

@@ -438,4 +438,7 @@ $(function () {
 
   AreaChoose.getResult("", true);
   AreaChoose.inintClick();
+  // 升级  解绑下拉选择城市事件
+  $(".select-area-box .tab:not(.municipality)").unbind('click')
+  $('.tab_content').unbind('click')
 })

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

@@ -167,7 +167,7 @@ function checkPrice(price) {
         } else {
             $DoPost("/subscribepay/vipsubscribe/getPrice", {}, function (r) {
                 if (r) {
-                    price = r;
+                    price = r.new;
                     priceData = price;
                 } else {
                     weui.toast("加载价格异常", {

+ 673 - 0
src/web/staticres/vipsubscribe/js/vip_upgrade.js

@@ -0,0 +1,673 @@
+var purchase = {
+  areaSelect: {"一个省": ["一个市"]}, // 已选择地区 {"一个省":["一个市"]} 计算价格临时变量
+  industrySelect: ["一个行业"], // 已选择行业 一个行业(计算价格临时变量)
+  timeSelect: [1, 2], // 已选择时间 timeSelect[0]时长  timeSelect[1] 1:年 2:月
+  timeValue: "一个月",
+  endTime: "",
+  price: {}, // 价格
+  nowBuyset: {},
+  timeCheckOk: false,
+  payWay: "wx_js",
+  initData: function () {
+    //已选择
+    try {
+      if (sessionStorage.getItem("vipSubSelectArea")) {
+        this.areaSelect = JSON.parse(sessionStorage.getItem("vipSubSelectArea"));
+      }
+      if (sessionStorage.getItem("vipSubSelectIndustry")) {
+        this.industrySelect = JSON.parse(sessionStorage.getItem("vipSubSelectIndustry"));
+      }
+      if (sessionStorage.getItem("endTime")) {
+        this.endTime = parseInt(sessionStorage.getItem("endTime"))
+      }
+      if (sessionStorage.liveActiveCode_renew === "jianyu360") {
+        $('.coupon-code-tx .keywords-text').text("支付成功赠送30天订阅周期");
+        $('.coupon-picker .weui-input').val("jianyu360");
+        $('.coupon-code-tx').off('click');
+      }
+      //即将到期 回显已购买
+      if (!sessionStorage.getItem("vipSubSelectArea") || !sessionStorage.getItem("vipSubSelectIndustry")) {
+        $DoPost("/subscribepay/vipsubscribe/getSubBuyMsg", {}, function (r) {
+          if (r.success) {
+            if (!$.isEmptyObject(r.data.area)) {
+              purchase.areaSelect = r.data.area
+            } else {
+              purchase.areaSelect = {"全国": []}
+            }
+            if (r.data.industry.length != 0) {
+              purchase.industrySelect = r.data.industry
+            } else {
+              purchase.industrySelect = ["全部行业"]
+            }
+            if (r.data.endTime) {
+              purchase.endTime = r.data.endTime;
+            }
+            sessionStorage.setItem("vipSubSelectArea", JSON.stringify(purchase.areaSelect));
+            sessionStorage.setItem("vipSubSelectIndustry", JSON.stringify(purchase.industrySelect));
+            sessionStorage.setItem("endTime", JSON.stringify(purchase.endTime))
+            sessionStorage.setItem("vipSub_read", true);
+          }
+        }, false)
+      }
+      if (sessionStorage.getItem("vipSubSelectTime")) {
+        // console.log("ggggg", sessionStorage.getItem("vipSubSelectTime"))
+        this.timeSelect = JSON.parse(sessionStorage.getItem("vipSubSelectTime"));
+      }
+
+      //加载价格
+      $DoPost("/subscribepay/vipsubscribe/getPrice", {}, function (r) {
+        if (r) {
+          purchase.price = r.new;
+          purchase.can1111 = r.isActiving && r.isWritten === 0
+          if (purchase.can1111) {
+            if (!sessionStorage.getItem("vipSubSelectTime")) {
+              purchase.timeValue = "1年";
+              purchase.timeSelect_tmp = [1,1]
+              purchase.timeSelect = purchase.timeSelect_tmp;
+              purchase.showTime();
+              purchase.flushPrice(purchase.timeSelect, 1);
+              sessionStorage.setItem("vipSubSelectTime", JSON.stringify(purchase.timeSelect));
+            }
+            showGiveStatus(true)
+          } else {
+            showGiveStatus(false)
+          }
+        }
+      }, false)
+      var areaSelect = JSON.parse(sessionStorage.getItem('vipSubSelectArea'))
+      var industrySelect = JSON.parse(sessionStorage.getItem('vipSubSelectIndustry'))
+      var endTime = sessionStorage.getItem('endTime')
+      var readSelect = sessionStorage.getItem('vipSub_read') === 'true' ? true : false
+      if (readSelect) {
+        coupon.checkboxStatus = true
+      }
+      console.log(areaSelect && industrySelect && readSelect,'22222',coupon.$refs.couponRef.submitStatus)
+      if (areaSelect && industrySelect && readSelect) {
+        coupon.$refs.couponRef.submitStatus = false
+        console.log(coupon.$refs.couponRef.submitStatus)
+      } else {
+        coupon.$refs.couponRef.submitStatus = true
+      }
+    } catch (e) {
+      console.log(e)
+    }
+    this.nowBuyset = getBuySet(purchase.areaSelect, purchase.industrySelect, this.price);
+  },
+  showArea: function () {
+    if (!$.isEmptyObject(this.areaSelect) && !this.areaSelect["一个省"]) { //有选择
+      if (this.nowBuyset.areacount === -1) {
+        $(".area-result .item-r").text("全国");
+      } else {
+        var tipTxt = "";
+        if (this.nowBuyset.areacount > 0) tipTxt += this.nowBuyset.areacount + " 个省";
+        var count = 0;
+        this.nowBuyset.citys.forEach(function (item, index) {
+          count += item;
+        });
+        if (count > 0) {
+          if (this.nowBuyset.areacount > 0) tipTxt += "、";
+          tipTxt += count + " 个市";
+          if (this.nowBuyset.citys.length > 1) tipTxt += "(分布在" + this.nowBuyset.citys.length + "个省内)"
+        }
+        $(".area-result .item-r").text(tipTxt);
+      }
+    } else {
+      $(".area-result .item-r").text("");
+    }
+  },
+  showPrice: function () {
+    $('.monthly span:eq(0)').text(purchase.price.month.oneCity_oneBuyerClass / 100);
+    $('.monthly span:eq(1)').text(purchase.price.month.oneCity_allBuyerClass / 100);
+    $('.monthly span:eq(2)').text(purchase.price.month.oneProvince_oneBuyerClass / 100);
+    $('.monthly span:eq(3)').text(purchase.price.month.oneProvince_allBuyerClass / 100);
+    $('.monthly span:eq(4)').text(purchase.price.month.allProvince_oneBuyerClass / 100);
+    $('.monthly span:eq(5)').text(purchase.price.month.allProvince_allBuyerClass / 100);
+
+    $('.yearly span:eq(0)').text(purchase.price.year.oneCity_oneBuyerClass / 100);
+    $('.yearly span:eq(1)').text(purchase.price.year.oneCity_allBuyerClass / 100);
+    $('.yearly span:eq(2)').text(purchase.price.year.oneProvince_oneBuyerClass / 100);
+    $('.yearly span:eq(3)').text(purchase.price.year.oneProvince_allBuyerClass / 100);
+    $('.yearly span:eq(4)').text(purchase.price.year.allProvince_oneBuyerClass / 100);
+    $('.yearly span:eq(5)').text(purchase.price.year.allProvince_allBuyerClass / 100);
+  },
+  showIndustry: function () {
+    if (this.industrySelect.length > 0 && this.industrySelect[0] != "一个行业") { //选择有行业信息
+      if (this.nowBuyset.buyerclasscount == -1) {
+        $(".industry .item-r").text("全部行业");
+      } else {
+        var tipTxt = "";
+        $(".industry .item-r").text(tipTxt + this.nowBuyset.buyerclasscount + " 个行业");
+      }
+    } else {
+      $(".industry .item-r").text("");
+    }
+  },
+  showTime: function () {
+    var tmp = this.timeSelect[0];
+    if (this.timeSelect[1] === 1) {
+      tmp += "年";
+      $("#yearly").prop('checked', true);
+      //$('.year_number:eq(' + (this.timeSelect[0] - 1) + ')').trigger("click");
+      $('.year_number:eq(' + (this.timeSelect[0] - 1) + ')').addClass("active")
+      //$(".number_box:eq(1)").addClass("active");
+    } else {
+      tmp += "个月";
+      $("#monthly").prop('checked', true);
+      $(".number_box:eq(0)").addClass("active");
+      $("#number_box_month .month_number").text(this.timeSelect[0]);
+      //if (this.timeSelect[0] >= 10) {
+      //    $('.profit_tips').text("已选择" + this.timeSelect[0] + "个月,建议“按年订阅”").show();
+      //}
+      if (this.timeSelect[0] === 1) {
+        $('#number_box_month button:eq(0)').attr("disabled", "disabled");
+      } else {
+        $('#number_box_month button:eq(0)').removeAttr("disabled");
+      }
+    }
+    this.timeValue = tmp;
+  },
+  flushPrice: function (time, flag) {
+    //var price = getsubVipOrderPrice(this.areaSelect, this.industrySelect, time, this.price);
+    var times = [time[0], time[1]];
+    var price = getsubVipOrderPriceBybuyset(this.nowBuyset, time);
+    var givePrice = getsubVipOrderPriceBybuyset(this.nowBuyset, [time[1] === 1 ? 1 :time[0], time[1]]);
+    var showPrice = formatMoney(price);
+    var nowTime = new Date().getTime();
+    var startTime = live20200707.startTime;
+    var endTime = live20200707.endTime;
+    var activeDiscount = parseFloat(live20200707.activeDiscount);
+    var startTimes = parseInt(startTime) * 1000;
+    var endTimes = parseInt(endTime) * 1000;
+    if (nowTime >= startTimes && nowTime < endTimes) {
+      if (flag !== 2) {
+        $(".price-num").text(showPrice);
+        var activePrice = formatMoney(parseFloat(price) - parseFloat(price) * activeDiscount);
+        $(".reduce-price").text(formatMoney(activePrice));
+      }
+      showPrice = formatMoney(parseFloat(price) * activeDiscount);
+    }
+    if (flag === 1) {
+      $('.billing-price').text(showPrice);
+      $('.origin-price .price-num').text(formatMoney(parseFloat(price + givePrice)));
+      // 优惠明细
+      $('.discount-price .dis-price').text(formatMoney(givePrice))
+      $('.now-price .dis-price').text(formatMoney(price));
+
+    } else if (flag === 2) {
+      $('.computed_price').html(showPrice);
+    } else {
+      $('.billing-price').text(showPrice);
+      $('.origin-price .price-num').text(formatMoney(parseFloat(price + givePrice)));
+
+      $('.computed_price').html(showPrice);
+      // 优惠明细
+      $('.discount-price .dis-price').text(formatMoney(givePrice))
+      $('.now-price .dis-price').text(formatMoney(price));
+    }
+    this.flushSelectTime(times, flag === undefined ? 1 : flag);
+    coupon.updatePrice(price)
+  },
+  flushSelectTime(thisValue, flag) {
+    if (this.endTime) {
+      var time1 = new Date(this.endTime * 1000).pattern('yyyy年MM月dd日');
+      var end = getVipEndDate(thisValue[1], thisValue[0], this.endTime);
+      var time2 = new Date(end * 1000).pattern('yyyy年MM月dd日');
+
+      if (flag === 1) {
+        $(".select_cycle .month").text(this.timeValue);
+        var giveTime = this.timeValue
+        if (this.timeValue.indexOf('年') !== -1) {
+          giveTime = '1年'
+        }
+        $(".select_cycle #giveTime").text(giveTime);
+
+        $(".select_cycle .duration").text(time1 + "-" + time2);
+        $(".select_cycle .duration").show();
+        // @NewYearMarketing 2021/1/25
+        checkMonth() 
+      }
+
+      //是否超过三年
+      var now = Math.floor(new Date().getTime() / 1000);
+      var MaxEnd = getVipEndDate(1, 3, now);
+      if (!purchase.can1111 && end > MaxEnd) {
+        var timeShow = getDateSub(now, this.endTime);
+        var showTipText = "<div style='white-space: nowrap;'>最长订阅周期不可超过3年</div>剩余周期:";
+        if (timeShow[0] !== 0) {
+          showTipText += timeShow[0] + "年"
+        }
+        if (timeShow[1] !== 0) {
+          showTipText += timeShow[1] + "个月"
+        }
+        weui.toast(showTipText, {
+          duration: 3000,
+          className: 'jy-toast',
+        });
+        if (flag === 1) this.timeCheckOk = false;
+        if (flag === 2) $("#enter_period").prop("disabled", true);
+      } else {
+        if (flag === 1) this.timeCheckOk = true;
+        if (flag === 2) $("#enter_period").prop("disabled", false);
+      }
+      this.flushSubmit();
+    } else {
+      $(".select_cycle .duration").hide();
+    }
+  },
+  showTip() {//是否展示即将到期
+    var timeSub = this.endTime * 1000 - new Date().getTime();
+    if (timeSub > 0 && timeSub < 60 * 60 * 24 * 1000 * 3) {
+      $(".vip-header").show();
+    }
+  },
+  flushSubmit() {//是否可提交
+    if (this.timeCheckOk && sessionStorage.getItem("vipSub_read") === "true") {
+      $('.vip-footer.renew .confirm').prop('disabled', false)
+    } else {
+      $('.vip-footer.renew .confirm').prop('disabled', true)
+    }
+  }
+};
+
+$(function () {
+  purchase.initData();
+  purchase.showArea();
+  purchase.showIndustry();
+  purchase.showPrice();
+  purchase.showTime();
+  // purchase.showTip(); // 2021-5-20
+  purchase.flushPrice(purchase.timeSelect);
+  purchase.flushSubmit();
+  var time_limit;//定义一个周期变量
+  /*------ 关闭弹窗事件  点击取消或遮罩层 -----*/
+  $('.weui-mask').click(hideDialog);
+  $('.cancel').click(hideDialog);
+
+  /* -----  订阅周期、支付方式弹窗弹出事件 -------*/
+  // 选择订阅周期
+  $('.select_cycle a').click(function (e) {
+      $('#time_cycle').show(200);
+  });
+
+  /* -----  选择完支付方式、订阅周期 回显到页面 -------*/
+  $('.vip-body .pay-mode').on('click', function () {
+      pickerShow('#pay_way', true)
+  })
+
+  $('#pay_way input:radio[name="way"]').click(function () {
+      var checkValue = $('input:radio[name="way"]:checked').val();
+      pickerShow('#pay_way', false)
+      $('.vip-body .pay-mode .pay-mode-text').text(checkValue);
+      if (checkValue === "微信支付") {
+          purchase.payWay = "wx_app"
+      } else {
+          purchase.payWay = "ali_app"
+      }
+  });
+
+  // 对订阅时间选择的input绑定点击事件
+  $('#time_cycle input:radio[name="time"]').on('click', function (e) {
+    // 解除确认按钮的锁定
+    if ($(e.target).hasClass('monthly') !== $('#number_box_month').hasClass('active')) {
+      $('#time_cycle .form-btn button').removeAttr('disabled');
+    }
+    if ($(e.target).hasClass('monthly')) {
+      // 按月订阅
+      $('#number_box_month').addClass('active');
+      $('#number_box_year span').removeClass('active');
+    } else {
+      // 按年订阅
+      $('#number_box_month').removeClass('active');
+      // $('#number_box_year span:eq(0)').addClass('active').siblings().removeClass('active');
+    }
+  });
+
+  /* --------控制月份number_box的事件  点击加减号触发的事件------- */
+  $('#number_box_month').on('click', 'button', function (e) {
+    // 点击加减号让input radio选中
+    $('#monthly').prop('checked', true);
+    $('#yearly').prop('checked', false);
+    $('.number_box span').removeClass('active');
+    $('#number_box_month').addClass('active');
+
+    var $number = $('#number_box_month span.month_number');
+    var $monthlyInput = $('#monthly');
+    // 未整理的data数组,里面的值都是字符串
+    var preData = e.delegateTarget.dataset;
+    var currentNum = parseInt($number.text());
+    var data = {};
+    // 把字符串转换成数字
+    for (var i in preData) {
+        data[i] = preData[i] - 0
+    }
+
+    if (!$monthlyInput.prop('checked')) {
+      return
+    }
+    // 判断是点击的是+ 还是-
+    if ($(e.target).hasClass('add') || $(e.currentTarget).hasClass('add')) {
+      if (currentNum == 11) { //12个月自动跳转1年
+        $("#number_box_year .year_number:eq(0)").trigger("click");
+        return
+      }
+      // 点的+
+      currentNum = currentNum >= data.numboxMax ? data.numboxMax : (currentNum + data.numboxStep);
+    } else {
+      // 点的-
+      currentNum = currentNum <= data.numboxMin ? data.numboxMin : (currentNum - data.numboxStep);
+    }
+    $number.text(currentNum);
+    purchase.timeSelect_tmp = [Number(currentNum), 2];
+    purchase.flushPrice(purchase.timeSelect_tmp, 2);
+    //var price = (5.8 * currentNum).toFixed(1);
+    //$('.computed_price').html('¥' + price)
+    var firstButton = $('#number_box_month button:first');
+    var lastButton = $('#number_box_month button:last');
+    /*if (currentNum >= 10) {
+        $('.profit_tips').text("已选择" + currentNum + "个月,建议“按年订阅”").show();
+    } else {
+        $('.profit_tips').hide();
+    }*/
+    // 如果为操作后的结果为1,则锁定减号按钮
+    if (currentNum === data.numboxMin) {
+      firstButton.attr('disabled', true)
+    } else {
+      firstButton.removeAttr('disabled')
+    }
+    // 如果为操作后的结果为12,则锁定加号按钮
+    if (currentNum === data.numboxMax) {
+      lastButton.attr('disabled', true)
+    } else {
+      lastButton.removeAttr('disabled')
+    }
+  });
+
+  /* -------- 控制年份number_box的事件  点击1年 2年 3年触发的事件------- */
+  $('#number_box_year').on('click', 'span', function (e) {
+    // console.log(e.target.dataset.id);
+    $('#number_box_month').removeClass('active');
+    var id = e.target.dataset.id;
+    //$('.profit_tips').hide();
+    $(this).addClass('active').siblings().removeClass('active');
+    $('#yearly').prop('checked', true);
+    $("#monthly").prop('checked', false);
+
+    // 渲染结果 保留一位小数
+    //var result = (Number(id) * 58).toFixed(1);
+    //$('.computed_price').html('¥' + result)
+    purchase.timeSelect_tmp = [Number(id), 1];
+    purchase.flushPrice(purchase.timeSelect_tmp, 2);
+  });
+
+  /* -------- 选择按月订阅  radio触发的事件------- */
+  $('#monthly').on('change', function (e) {
+    var isChecked = $(this).is(':checked');
+    var val = $('.month_number').text();
+    /*if (val >= 10) {
+        $('.profit_tips').show()
+    }*/
+    if (!isChecked) {
+        $('#number_box_month button').attr('disabled', true)
+    }
+    //var result = (Number(val) * 5.8).toFixed(1);
+    //$('.computed_price').html('¥' + result);
+    purchase.timeSelect_tmp = [Number(val), 2];
+    purchase.flushPrice(purchase.timeSelect_tmp, 2);
+  });
+  //计价清单
+  // $('.billing-list-btn').on('click', function () {
+  //     pickerShow('.billing-list-container', true)
+  // })
+  // 计算标准隐藏
+  $('.billing-list-container .dialog_hd__close').on('click', function () {
+    pickerShow('.billing-list-container', false)
+  })
+
+  $('.checkbox').on('click', function () {
+    $(this).toggleClass('checked');
+    var state = $(this).hasClass('checked');
+    sessionStorage.setItem("vipSub_read", state);
+    purchase.flushSubmit();
+    //$('.vip-footer.renew .confirm').prop('disabled', !state)
+  });
+  //是否点击已读
+  if (sessionStorage.getItem("vipSub_read") === "true") {
+    $('.checkbox').addClass("checked");
+  }
+
+  /* -------- 选择按年订阅  radio触发的事件------- */
+  $('#yearly').on('change', function (e) {
+    //$('.profit_tips').hide();
+    // console.log($(this).is(':checked'))
+    var isChecked = $(this).is(':checked');
+    // 按年订阅默认选择1年
+    var val = 1;
+    //$('.computed_price').html('¥' + Number(val) * 58)
+    if (isChecked) {
+      $('#number_box_year span:eq(0)').addClass('active').siblings().removeClass('active')
+    }
+    purchase.timeSelect_tmp = [Number(val), 1];
+    purchase.flushPrice(purchase.timeSelect_tmp, 2);
+  });
+
+  // 确认订阅周期
+  $('#enter_period').on('click', function () {
+    var val;
+    var selectedDOM = $('#time_cycle input[name=time]:checked');
+    if (selectedDOM.val() === 'year') {
+      val = $('#number_box_year .year_number.active').attr('data-id');
+      purchase.timeSelect_tmp = [parseInt(val), 1];
+      $('#time_cycle').hide(function () {
+        purchase.timeValue = val + "年";
+      });
+    } else if (selectedDOM.val() === 'month') {
+      val = $('#number_box_month .month_number').text();
+      purchase.timeSelect_tmp = [parseInt(val), 2];
+      $('#time_cycle').hide(function () {
+        purchase.timeValue = val + "个月";
+      });
+    }
+
+    purchase.timeSelect = purchase.timeSelect_tmp;
+    purchase.showTime();
+    purchase.flushPrice(purchase.timeSelect, 1);
+    sessionStorage.setItem("vipSubSelectTime", JSON.stringify(purchase.timeSelect));
+  });
+  $('.vip-footer.renew .confirm').click(function () {
+    $('.vip-footer.renew .confirm').attr("disabled", "disabled");
+    //支付请求
+    var area = purchase.areaSelect;
+    var industry = purchase.industrySelect;
+    if (area["全国"]) {
+        area = {};
+    }
+    if (industry.length === 1 && industry[0] === "全部行业") {
+        industry = [];
+    }
+    //优惠码
+    var activeCode = $('.coupon-picker .weui-input').val();
+    var activeCodes = "";
+    if (activeCode.toLowerCase() === couponInfo.code && $('.coupon-code-tx .keywords-text').text() === couponInfo.successTip) {
+        activeCodes = couponInfo.code;
+    }
+    //付费用户
+    var param = {
+      "userLotteryId":coupon.$refs.couponRef.coupon.userLotteryId,
+      "lotteryId": coupon.$refs.couponRef.coupon.lotteryId,
+      "area": JSON.stringify(area),
+      "industry": industry.join(","),
+      "time": purchase.timeValue.trim(),
+      "orderType": 5,
+      "activeCode": activeCodes,
+      "disWord":GetQueryString("disWord"),
+    };
+    $DoPost("/subscribepay/vipsubscribe/createOrder", param, function (r) {
+      if (r.success) {
+        clearSessionStorage();
+        history.replaceState({}, '', '/front/vipsubscribe/toOrderDetailPage?orderCode=' + r.data.code);
+        window.location.href = "/weixin/pay/checkout_subvip?t=1&orderCode=" + r.data.code;
+      } else {
+        $('.vip-footer.renew .confirm').removeAttr("disabled");
+      }
+    }, false);
+  })
+});
+//获取url中"?"符后的字符串并正则匹配
+function GetQueryString(name) {
+  var reg = new RegExp("(^|&)" + name + "=([^&]*)(&|$)", "i");
+  var r = window.location.search.substr(1).match(reg);
+  var context = "";
+  if (r != null)
+      context = r[2];
+  reg = null;
+  r = null;
+  return context == null || context == "" || context == "undefined" ? "" : context;
+}
+
+// 隐藏dialog选择框
+function hideDialog() {
+  $('#pay_way').hide(200);
+  $('#time_cycle').hide(200);
+  $('.j-picker').hide();
+  $('.discount-details').hide()
+  $('.discount-button .icon-arrow').removeClass('up')
+}
+
+function clearSessionStorage() {
+  sessionStorage.removeItem("vipSubSelectArea");
+  sessionStorage.removeItem("vipSubSelectIndustry");
+  sessionStorage.removeItem("vipSubSelectTime");
+  sessionStorage.removeItem("vipSub_read");
+  sessionStorage.removeItem("historypushDataCache");
+  sessionStorage.removeItem("endTime");
+  sessionStorage.To_introducePage = 2;
+  //订阅首页
+  sessionStorage.removeItem("sub_vip_state");
+  sessionStorage.removeItem("vip_index_read");
+  sessionStorage.removeItem("vip_change_time");
+  sessionStorage.removeItem("liveActiveCode_renew");
+  sessionStorage.removeItem("liveActiveCode_new");
+}
+
+function pickerShow(selector, f) {
+  if (f) {
+    // 添加进场动画,并显示
+    $(selector).find('.weui-mask').removeClass('weui-animate-fade-out').addClass('weui-animate-fade-in')
+    $(selector).find('.weui-picker').removeClass('weui-animate-slide-down').addClass('weui-animate-slide-up')
+    $(selector).show(300);
+  } else {
+    // 添加离场动画,并隐藏
+    $(selector).find('.weui-mask').removeClass('weui-animate-fade-in').addClass('weui-animate-fade-out')
+    $(selector).find('.weui-picker').removeClass('weui-animate-slide-up').addClass('weui-animate-slide-down')
+    $(selector).hide(300);
+  }
+}
+
+// 活动事件绑定
+var couponInfo = {
+  code: 'jianyu360',
+  successTip: '支付成功赠送30天订阅周期'
+}
+$('.coupon-code-tx').on('click', function () {
+  if ($('.vip-renew').hasClass('live-20200707')) {
+    $('.coupon-picker').show()
+  } else {
+    return
+  }
+  var input = $('.coupon-picker .weui-input')
+  var confirmButton = $('.coupon-picker .weui-picker__btn')
+  var cancelButton = $('.coupon-picker .cancel')
+  var value = input.val()
+  input.focus().on('input', function () {
+    value = this.value
+    confirmButton.prop('disabled', (value === '' || value === undefined))
+  })
+
+  confirmButton.on('click', function () {
+    if (value.toLowerCase() !== couponInfo.code) {
+      weui.toast('优惠码输入错误', {
+        className: 'j-toast',
+        duration: 1500
+      })
+      return
+    }
+    if (value.length === couponInfo.code.length && value.toLowerCase() === couponInfo.code) {
+      $('.coupon-code-tx .keywords-text').text(couponInfo.successTip)
+      sessionStorage.liveActiveCode_renew = "jianyu360";
+      $('.coupon-code-tx').off('click')
+      cancelButton.trigger('click')
+    }
+  })
+})
+
+document.body.addEventListener("focusout", function () {
+  //软键盘收起的事件处理
+  setTimeout(function () {
+    const scrollHeight = document.documentElement.scrollTop || document.body.scrollTop || 0;
+    window.scrollTo(0, Math.max(scrollHeight - 1, 0));
+  }, 100);
+})
+
+/* vue 代码 start */
+var coupon = new Vue({ 
+  el: '#coupon-vue',
+  data: function () {
+    return {
+      type: 'vip',
+      initPrice: 0, // 原价
+      realPrice: 0, // 实付价
+      checkboxStatus: false, // checkbox状态
+      submitStatus: true,  // 提交按钮状态
+      links: [
+        {
+          text: '《剑鱼标讯线上购买与服务条款》',
+          url: '/front/staticPage/wx-serviceterms.html',
+          event: this.readEvent
+        }
+      ],
+      buttons: {
+        submit: this.submitOrder
+      },
+    }
+  },
+  mounted () {
+    this.init()
+  }, 
+  methods: {
+    // 更新价格相关
+    updatePrice: function (before) {
+      console.log( '原价:' + before)
+      this.initPrice = before;
+      // 调用子组件查询最优卡券
+      this.$refs.couponRef.getCoupon();
+    },
+    // 初始化及回显相关
+    init: function () {},
+    // 勾选阅读协议
+    updateS: function(data) {
+      data.callback(this.checkSubmitStatus(data.check))
+    },
+    // 校验checkbox
+    checkSubmitStatus: function (checkStatus) {
+      sessionStorage.setItem("vipSub_read", checkStatus);
+      var areaSelect = JSON.parse(sessionStorage.getItem('vipSubSelectArea'))
+      var industrySelect = JSON.parse(sessionStorage.getItem('vipSubSelectIndustry'))
+      var endTime = sessionStorage.getItem('endTime')
+      var readSelect = sessionStorage.getItem('vipSub_read') === 'true' ? true : false
+      purchase.flushSubmit();
+      return Object.keys(areaSelect).length > 0 && industrySelect.length > 0 && readSelect
+    },
+    saveEvent: function() {
+      // sessionStorage.setItem("vipSub_read", 0)
+    },
+    // 阅读协议点击事件
+    readEvent: function () {},
+    // 订单提交事件
+    submitOrder: function () {
+      this.$refs.couponRef.submitStatus = true
+      $('.vip-footer.renew .confirm').trigger('click')
+      this.$refs.couponRef.submitStatus = false
+    }
+  }
+})
+/* vue 代码 end */

+ 50 - 0
src/web/templates/weixin/vipsubscribe/vip_UpgradeDetail.html

@@ -0,0 +1,50 @@
+<!DOCTYPE html>
+<html lang="zh-CN">
+
+<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>
+    <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"></script>
+    <link rel="stylesheet" type="text/css" href="/vipsubscribe/css/weui.min.css?v={{Msg "seo" "version"}}"/>
+    <link rel="stylesheet" type="text/css" href="/vipsubscribe/css/base2.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" type="text/css" href='/local/layout.css'/>
+    <link rel="stylesheet" type="text/css" href='/css/font.css?v={{Msg "seo" "version"}}'/>
+    <style>
+        .content {
+            height: 100%;
+            display: flex;
+            align-items: center;
+            justify-content: center;
+        }
+    </style>
+</head>
+<body class="no-touch"  data-weui-theme="light">
+    <div class="j-container">
+        <div class="j-body">
+            <div class="content">超级订阅升级版介绍</div>
+        </div>
+        <div class="footer j-button-group">
+            <button class="j-button-confirm">升级</button>
+        </div>
+    </div>
+<script src="/local/jquery.min.js"></script>
+<script src='/vipsubscribe/js/common.js?v={{Msg "seo" "version"}}'></script>
+<script src='/js/common.js?v={{Msg "seo" "mod_version"}}'></script>
+<script>
+$(function () {
+    $('.j-button-confirm').on('click', function () {
+        location.href = '/front/vipsubscribe/upgradePage'
+    })
+})
+</script>
+{{include "/common/baiducc.html"}}
+</body>
+
+</html>

+ 430 - 0
src/web/templates/weixin/vipsubscribe/vip_UpgradePage.html

@@ -0,0 +1,430 @@
+<!DOCTYPE html>
+<html lang="zh-CN">
+
+<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>
+  <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" href='/vipsubscribe/css/base2.css?v={{Msg "seo" "version"}}'/>
+  <link rel="stylesheet" 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='/css/wxbutton.css?v={{Msg "seo" "version"}}'>
+  <link rel="stylesheet" href='/vipsubscribe/css/vip_upgrade.css?v={{Msg "seo" "version"}}'>
+  <link rel="stylesheet" href='{{Msg "seo" "cdn"}}/common-module/coupon/css/pay-order-template.css?v={{Msg "seo" "version"}}' />
+  <style>
+    .vip-header {
+      display: none;
+      padding: .26rem .3rem;
+      font-size: .26rem;
+      color: #FE737A;
+    }
+    .weui-toast {
+      z-index: 999999;
+    }
+    button[disabled] {
+      opacity: .5;
+    }
+  </style>
+</head>
+
+<body class="no-touch"  data-weui-theme="light">
+  <div class="vip-upgrade">
+    <div class="vip-header"></div>
+    <div class="vip-body">
+      <div class="j-notice-bar bar-red vip-bar" style="text-align: center;">限时续费,3个月起,续多久送多久!</div>
+      <ul style="padding: .16rem .24rem;">
+          <li class="body-item area-industry">
+            <a class="item-container" href="/front/vipsubscribe/toChooseArea">
+              <div class="item area">
+                <span class="item-l">省份数量</span>
+                <span class="iconfont icon-arrow"></span>
+              </div>
+              <div class="area-result">已选择 <span class="item-r"></span></div>
+              <!-- <div class="item industry">
+                <span class="item-l">行业:</span>
+                <span class="item-r"></span>
+              </div> -->
+            </a>
+          </li>
+          <li class="body-item select_cycle">
+            <a class="item-container" href="javascript:;">
+              <div class="item">
+                <span class="item-l">
+                  <span class="item-label">延长订阅周期</span>
+                </span>
+                <span class="item-r">
+                  <span class="buy-cycle text ellipsis">6个月</span>
+                  <span class="iconfont icon-arrow"></span>
+                </span>
+              </div>
+              <div class="sub-item text">
+                <span class="sub-l">有效日期:</span>
+                <span class="sub-r">
+                  <span class="ellipsis">
+                    (<span class="month">3个月</span>)<span class="duration"></span>
+                  </span>
+                </span>
+              </div>
+            </a>
+          </li>
+      </ul>
+      <ul style="padding: 0 .24rem;display: none;" id="giveTimeBox">
+        <li class="body-item select_cycle">
+          <div class="item-container" href="javascript:;">
+            <div class="item">
+            <span class="item-l">
+              <span class="item-label">赠送周期</span>
+            </span>
+              <span class="item-r">
+              <span id="giveTime" class="buy-cycle text" style="font-size: 14px;color: #9B9CA3;">6个月</span>
+            </span>
+            </div>
+          </div>
+        </li>
+      </ul>
+      <!-- 超级订阅专属权益 -->
+      <div class="rights">
+        <div class="rights-title">
+          <span class="title-line"></span>
+          <span>超级订阅专属权益</span>
+        </div>
+      </div>
+    </div>
+    <!-- vue组件 -->
+    <div class="vip-footer renew" id="coupon-vue">
+      <pay-order-template ref="couponRef" :config="$data" @update="updateS" @save="saveEvent"></pay-order-template>
+    </div>
+    <div class="vip-footer renew" style="display: none;">
+      <div class="footer-preview-container">
+        <div class="price-preview">
+          <span class="preview-label"></span>
+          <span class="preview-content">
+          <span class="billing-list-btn">合计:</span>
+            <div class="billing-list-price">
+              <span class="billing-mon">¥</span>
+              <span class="billing-price"></span>
+            </div>
+          </span>
+        </div>
+        <div class="origin-price">
+          <span class="discount-button">
+            <span>优惠明细</span>
+            <span class="iconfont icon-arrow"></span>
+          </span>
+          <span class="price-label">原价:</span>
+          <div class="price-container">
+            <span class="currency-type">&yen;</span>
+            <span class="price-num">5.80</span>
+          </div>
+        </div>
+        <div class="clause-box">
+          <span class="checkbox"></span>
+          <span class="clause-read">我已阅读,理解并接受<a href="/front/staticPage/wx-serviceterms.html">《剑鱼标讯线上购买与服务条款》</a>
+          </span>
+        </div>
+      </div>
+      <div class="footer-button-group j-footer">
+        <!--<button class="button-l reset">取消</button>-->
+        <button data-need-bind-phone class="button-r confirm j-button" disabled>确认支付</button>
+      </div>
+    </div>
+  </div>
+  <!-- 优惠明细 -->
+  <div class="j-picker adaption discount-details" style="display:none;">
+    <div class="weui-mask"></div>
+    <div class="weui-half-screen-dialog weui-picker">
+      <div class="weui-half-screen-dialog__hd">
+        <div class="weui-half-screen-dialog__hd__main">
+          <strong class="weui-half-screen-dialog__title">优惠明细</strong>
+        </div>
+        <span class="j-icon icon-del-grey cancel"></span>
+      </div>
+      <div class="weui-half-screen-dialog__bd" style="padding-bottom: 0;">
+        <div class="weui-picker__bd">
+          <div class="details-bd-item origin-price">
+            <div class="d-b-left">原价</div>
+            <div class="d-b-right">
+              <span class="dis-mon">&yen;</span>
+              <span class="dis-price price-num">0</span>
+            </div>
+          </div>
+          <div class="details-bd-item discount-price">
+            <div class="d-b-left">限时优惠</div>
+            <div class="d-b-right text-red">
+              <span class="dis-mon">-&yen;</span>
+              <span class="dis-price">0</span>
+            </div>
+          </div>
+          <div class="details-bd-item now-price">
+            <div class="d-b-left">实付</div>
+            <div class="d-b-right text-red">
+              <span class="dis-mon">&yen;</span>
+              <span class="dis-price">0</span>
+            </div>
+          </div>
+        </div>
+      </div>
+    </div>
+  </div>
+  <!-- 计费清单picker -->
+  <div class="billing-list-container p13" style="display: none;">
+    <div class="weui-mask weui-animate-fade-in"></div>
+    <div class="weui-half-screen-dialog weui-picker weui-animate-slide-up">
+      <div class="weui-half-screen-dialog__hd">
+        <div class="dialog_hd__title">计算标准</div>
+        <div class="dialog_hd__close j-icon icon-del-grey"></div>
+      </div>
+      <div class="weui-half-screen-dialog__bd">
+        <div class="vip_prise_table">
+          <table class="monthly">
+            <div class="table_title">
+              <div class="line"></div>
+              <div class="title">超级订阅价格</div>
+              <div class="line"></div>
+            </div>
+            <tr>
+              <td colspan="2">按月购买</td>
+            </tr>
+            <tr>
+              <td>5.8元 月/市/行业</td>
+              <td>18元 月/市/全行业</td>
+            </tr>
+            <tr>
+              <td>11.8元 月/省/行业</td>
+              <td>38元 月/省/全行业</td>
+            </tr>
+            <tr>
+              <td>118元 月/全国/行业</td>
+              <td>388元 月/全国/全行业</td>
+            </tr>
+          </table>
+          <table class="yearly">
+            <tr>
+              <td colspan="2">按年购买</td>
+            </tr>
+            <tr>
+              <td>58元 年/市/行业</td>
+              <td>180元 年/市/全行业</td>
+            </tr>
+            <tr>
+              <td>118元 年/省/行业</td>
+              <td>380元 年/省/全行业</td>
+            </tr>
+            <tr>
+              <td>1180元 年/全国/行业</td>
+              <td>3880元 年/全国/全行业</td>
+            </tr>
+          </table>
+          <div class="tips">
+            <dt>购买须知:</dt>
+            <dd>套餐周期内,不支持套餐降级,续费可降级;</dd>
+            <dd>用户最多购买/续费3年套餐;</dd>
+            <dd>支持套餐升级,补差价(按月进行补差价,不足一个月按一个月计算)。</dd>
+            <dd>3个市及以上即为全省,10个省及以上即为全国。4个行业及以上即为全行业。</dd>
+            <dd>购买的采购单位行业与地域为个数,购买后可不限次数进行更换。</dd>
+          </div>
+        </div>
+      </div>
+      <div class="weui-half-screen-dialog__ft"></div>
+    </div>
+  </div>
+  <!-- 选择订阅周期picker -->
+  <div class="js_dialog time_cycle p13" id="time_cycle" style="display: none;">
+    <div class="weui-mask"></div>
+    <div class="box">
+      <div class="box_hd">
+        <h3>订阅周期</h3>
+        <span class="cancel">
+        <span class="j-icon icon-del-grey"></span>
+      </span>
+      </div>
+      <div class="box_bd">
+        <!--<div class="tips profit_tips">已选择10个月,建议“按年订阅”更换算哦~</div>-->
+        <div class="computed">
+          <span class="computed_mon">¥</span>
+          <div class="computed_price"></div>
+        </div>
+        <div class="bd_select">
+          <div class="weui-cells weui-cells_checkbox choose-form">
+            <label class="weui-cell weui-check__label monthly_label" for="monthly">
+              <div class="weui-cell__hd">
+                <input type="radio" class="weui-check monthly" name="time" value="month" id="monthly" checked/>
+                <i class="weui-icon-checked"></i>
+              </div>
+              <div class="weui-cell__bd">
+                <p>按月订阅</p>
+              </div>
+            </label>
+            <div class="number_box active" id="number_box_month" data-numbox-step="1" data-numbox-min="1"
+                data-numbox-max="12">
+              <button class="weui-btn weui-btn_plain-default" type="button" disabled>
+                <div class="jy_icon decrease"></div>
+              </button>
+              <span class="month_number">1</span>
+              <button class="weui-btn weui-btn_plain-default add" type="button">
+                <div class="jy_icon increase"></div>
+              </button>
+            </div>
+          </div>
+          <div class="weui-cells weui-cells_checkbox choose-form">
+            <label class="weui-cell weui-check__label yearly_label" for="yearly">
+              <div class="weui-cell__hd">
+                <input type="radio" class="weui-check yearly" name="time" value="year" id="yearly"/>
+                <i class="weui-icon-checked"></i>
+              </div>
+              <div class="weui-cell__bd">
+                <p>按年订阅</p>
+              </div>
+            </label>
+            <div class="number_box" id="number_box_year" style="border: 0;">
+              <span class="year_number j-button-select" data-id="1">1年</span>
+              <span class="year_number j-button-select" data-id="2">2年</span>
+              <span class="year_number j-button-select" data-id="3">3年</span>
+            </div>
+          </div>
+        </div>
+      </div>
+      <div class="form-btn j-footer">
+        <button class="btn enter j-button" id="enter_period">确认</button>
+      </div>
+    </div>
+  </div>
+  <!-- 选择支付方式 -->
+  <div class="js_dialog pay_way" id="pay_way" style="display: none;">
+    <div class="weui-mask"></div>
+    <div class="box">
+      <div class="box_hd">
+        <span></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 wx_label" for="wx">
+            <div class="weui-cell__bd read">
+              <i class="icon-wx"></i>
+              <p>微信支付</p>
+            </div>
+            <div class="weui-cell__hd">
+              <input type="radio" class="weui-check" name="way" value="微信支付" id="wx" checked/>
+              <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">
+              <i class="icon-zfb"></i>
+              <p>支付宝支付</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>
+  </div>
+  <!-- 优惠码弹窗 -->
+  <div class="j-picker adaption coupon-picker">
+    <div class="weui-mask weui-animate-fade-in"></div>
+    <div class="weui-half-screen-dialog weui-picker weui-animate-slide-up">
+      <div class="weui-half-screen-dialog__hd">
+        <div class="weui-half-screen-dialog__hd__main">
+          <strong class="weui-half-screen-dialog__title">优惠码</strong>
+        </div>
+        <span class="j-icon icon-del-grey cancel"></span>
+      </div>
+      <div class="weui-half-screen-dialog__bd">
+        <div class="weui-picker__bd">
+          <div class="weui-picker__group">
+            <input type="text" class="weui-input" maxlength="9" placeholder="输入优惠码,即可赠送30天订阅周期">
+          </div>
+        </div>
+      </div>
+      <div class="weui-half-screen-dialog__ft">
+        <button disabled class="weui-btn weui-btn_primary weui-picker__btn" data-action="select">确定
+        </button>
+      </div>
+    </div>
+  </div>
+  
+  <script src="/vipsubscribe/js/jquery-2.1.4.js?v={{Msg "seo" "version"}}"></script>
+  <!--<script src='{{Msg "seo" "cdn"}}/js/check-bind-phone.js?v={{Msg "seo" "version"}}'></script>-->
+  <script src=//cdn.jsdelivr.net/npm/vue@2.6.11/dist/vue.min.js></script>
+  <script src="/vipsubscribe/js/weui.min.js?v={{Msg "seo" "version"}}"></script>
+  <script src="/vipsubscribe/js/common.js?v={{Msg "seo" "version"}}"></script>
+  <script src="/vipsubscribe/js/UpgradePrice.js?v={{Msg "seo" "version"}}"></script>
+  <script src='{{Msg "seo" "cdn"}}/common-module/coupon/js/pay-order-template.js?v={{Msg "seo" "version"}}'></script>
+  {{include "/common/weixin.html"}}
+  <script>
+    // @NewYearMarketing 2021/1/25
+    // getNewYearMarketing()
+    function getNewYearMarketing () {
+      $.ajax({
+        url: '/getJson/NewYearMarketing?t=' + new Date().getTime(),
+        success: function (r) {
+          if (r && r.status) {
+            showGiveStatus(true)
+          }
+        }
+      })
+    }
+
+    function checkMonth (temp) {
+      if ($("#giveTimeBox").is('[data-new-year]')) {
+        var tempTime = temp || $(".select_cycle #giveTime").text().trim()
+        if (tempTime.indexOf('个月') === 1 && tempTime.slice(0, -2) < 3) {
+          $("#giveTimeBox").hide()
+        } else {
+          $("#giveTimeBox").show()
+        }
+      }
+    }
+
+    function showGiveStatus (t) {
+      if (t) {
+        // @NewYearMarketing 2021/1/25
+        $(".vip-bar").show()
+        $("#giveTimeBox").show()
+        $("#giveTimeBox").attr('data-new-year', 'true')
+        checkMonth()
+        // $(".origin-price").css('display', 'flex')
+        // $(".discount-details .weui-picker").css('bottom', $(".vip-footer.renew").height() + 'px')
+        // $('.discount-button').show().on('click', function () {
+        //   var details = $('.discount-details')
+        //   if (details.is(':hidden')) {
+        //     $('.discount-details').show()
+        //     $(this).children('.icon-arrow').addClass('up')
+        //   } else {
+        //     $('.discount-details').hide()
+        //     $(this).children('.icon-arrow').removeClass('up')
+        //   }
+        // })
+      } else {
+        $(".vip-bar").hide()
+        $("#giveTimeBox").hide()
+        // $(".origin-price").hide()
+      }
+    }
+
+    $(window).bind("pageshow", function (event) {
+      if (event.originalEvent.persisted) {
+        window.location.reload();
+      }
+    });
+    var live20200707 = {
+      startTime: {{.T.liveActiveStartTime}},
+      endTime: {{.T.liveActiveEndTime}},
+      activeDiscount: {{.T.activeDiscount}}
+    }
+  </script>
+  <script src="/vipsubscribe/js/vip_upgrade.js?v={{Msg "seo" "version"}}"></script>
+  {{include "/common/baiducc.html"}}
+</body>
+
+</html>

+ 39 - 55
src/web/templates/weixin/vipsubscribe/vip_renew.html

@@ -47,58 +47,42 @@
             <span class="header-right">您的超级订阅服务即将到期,为不影响您的使用。请立即续费</span>
         </div>
         <div class="vip-body">
-             <div class="j-notice-bar bar-red vip-bar" style="text-align: center;">限时续费,3个月起,续多久送多久!</div>
+            <div class="j-notice-bar bar-red vip-bar" style="text-align: center;">限时续费,3个月起,续多久送多久!</div>
             <ul style="padding: .16rem .24rem;">
-                <li class="body-item area">
-                    <a class="item-container" href="/front/vipsubscribe/toChooseArea">
-                        <div class="item">
-                        <span class="item-l">
-                            <span class="item-label">区域</span>
-                        </span>
-                        <span class="item-r">
-                            <span class="selected-area-name ellipsis"></span>
-                            <span class="iconfont icon-arrow"></span>
-                        </span>
-                    </div>
-                    <div class="sub-item text selected-area"></div>
-                </a>
-            </li>
-            <li class="body-item industry">
-                <a class="item-container" href="/front/vipsubscribe/toChooseIndustry">
-                    <div class="item">
-                        <span class="item-l">
-                            <span class="item-label">采购单位行业</span>
-                        </span>
-                        <span class="item-r">
-                            <span class="selected-industry-name industry-text ellipsis"></span>
-                            <span class="iconfont icon-arrow"></span>
-                        </span>
-                    </div>
-                    <div class="sub-item text selected-industry-count"></div>
-                </a>
-            </li>
-            <li class="body-item select_cycle">
-                <a class="item-container" href="javascript:;">
-                    <div class="item">
-                        <span class="item-l">
-                            <span class="item-label">延长订阅周期</span>
-                        </span>
-                        <span class="item-r">
-                            <span class="buy-cycle text ellipsis">6个月</span>
-                            <span class="iconfont icon-arrow"></span>
-                        </span>
+                <li class="body-item area-industry">
+                    <div class="item-container">
+                        <div class="item area">
+                            <span class="item-l">区域:</span>
+                            <span class="item-r"></span>
+                        </div>
+                        <div class="item industry">
+                            <span class="item-l">行业:</span>
+                            <span class="item-r"></span>
+                        </div>
                     </div>
-                    <div class="sub-item text">
-                        <span class="sub-l">有效日期:</span>
-                        <span class="sub-r">
-                            <span class="ellipsis">
-                                (<span class="month">3个月</span>)<span class="duration"></span>
+                </li>
+                <li class="body-item select_cycle">
+                    <a class="item-container" href="javascript:;">
+                        <div class="item">
+                            <span class="item-l">
+                                <span class="item-label">延长订阅周期</span>
                             </span>
-                        </span>
-                    </div>
-                </a>
-            </li>
-        </ul>
+                            <span class="item-r">
+                                <span class="buy-cycle text ellipsis">6个月</span>
+                                <span class="iconfont icon-arrow"></span>
+                            </span>
+                        </div>
+                        <div class="sub-item text">
+                            <span class="sub-l">有效日期:</span>
+                            <span class="sub-r">
+                                <span class="ellipsis">
+                                    (<span class="month">3个月</span>)<span class="duration"></span>
+                                </span>
+                            </span>
+                        </div>
+                    </a>
+                </li>
+            </ul>
         <ul style="padding: 0 .24rem;display: none;" id="giveTimeBox">
                 <li class="body-item select_cycle">
                     <div class="item-container" href="javascript:;">
@@ -547,7 +531,7 @@
             showArea: function () {
                 if (!$.isEmptyObject(this.areaSelect) && !this.areaSelect["一个省"]) { //有选择
                     if (this.nowBuyset.areacount === -1) {
-                        $(".selected-area").text("全国");
+                        $(".area .item-r").text("全国");
                     } else {
                         var tipTxt = "";
                         if (this.nowBuyset.areacount > 0) tipTxt += this.nowBuyset.areacount + " 个省";
@@ -560,10 +544,10 @@
                             tipTxt += count + " 个市";
                             if (this.nowBuyset.citys.length > 1) tipTxt += "(分布在" + this.nowBuyset.citys.length + "个省内)"
                         }
-                        $(".selected-area").text(tipTxt);
+                        $(".area .item-r").text(tipTxt);
                     }
                 } else {
-                    $(".selected-area").text("");
+                    $(".area .item-r").text("");
                 }
             },
             showPrice: function () {
@@ -584,13 +568,13 @@
             showIndustry: function () {
                 if (this.industrySelect.length > 0 && this.industrySelect[0] != "一个行业") { //选择有行业信息
                     if (this.nowBuyset.buyerclasscount == -1) {
-                        $(".selected-industry-count").text("全部行业");
+                        $(".industry .item-r").text("全部行业");
                     } else {
                         var tipTxt = "";
-                        $(".selected-industry-count").text(tipTxt + this.nowBuyset.buyerclasscount + " 个行业");
+                        $(".industry .item-r").text(tipTxt + this.nowBuyset.buyerclasscount + " 个行业");
                     }
                 } else {
-                    $(".selected-industry-count").text("");
+                    $(".industry .item-r").text("");
                 }
             },
             showTime: function () {