ソースを参照

feat:wx超级订阅购买、续费、升级

yangfeng 4 年 前
コミット
b97a026fa1

+ 1 - 0
src/jfw/modules/app/src/web/staticres/jyapp/vipsubscribe/js/vip_index_new.js

@@ -870,6 +870,7 @@ $(function () {
         $('[data-update-tips]').hide()
         if (state.buyset.areacount == -1) {
           $('*[data-bind-update]').hide()
+          $('button[data-bind-renew]').css("margin-right", 0)
         }
       }
   }

+ 1 - 0
src/jfw/modules/app/src/web/staticres/jyapp/vipsubscribe/js/vip_renew.js

@@ -540,6 +540,7 @@ function clearSessionStorage() {
     sessionStorage.removeItem("liveActiveCode_new");
     // 清除商品规格当前选择
     sessionStorage.removeItem("vip-cur-select-size")
+    sessionStorage.removeItem("$select-coupon")
 }
 function showToast(text) {
     weui.toast(text, {

+ 4 - 0
src/jfw/modules/app/src/web/staticres/jyapp/vipsubscribe/js/vip_upgrade.js

@@ -586,6 +586,10 @@ $(function () {
       if (r.success) {
         try {
           clearSessionStorage()
+          // if (param.price == 0) {
+          //   window.location.replace("/jyapp/vipsubscribe/toOrderDetailPage?orderCode=" + r.data.code)
+          //   return
+          // }
           history.replaceState({}, '', '/jyapp/vipsubscribe/toOrderDetailPage?orderCode=' + r.data.code);
           window.location.href = "/jyapp/pay/checkout_subvip?orderCode=" + r.data.code + "&t=2&from=buy"
         } catch (e) {

+ 26 - 0
src/web/staticres/js/superSearch.js

@@ -1156,4 +1156,30 @@ function toastFn (text) {
 	setTimeout(function(){
 		$(".custom-toast").fadeOut();
 	},1000)
+}
+
+// 是否有权限
+// isPower()
+function isPower () {
+  $.ajax({
+    type:'post',
+    url:'/publicapply/bidcoll/power?t=' + Date.now(),
+    success: function(r){
+      if (r.data) {
+        var entniche = r.data.entniche
+        var member = r.data.member
+        var vip = r.data.vip
+        if (entniche || member || vip > 0) {
+          console.log('true')
+          return 'true'
+        } else {
+          console.log('false')
+          return 'false'
+        }
+      } else {
+        console.log('false')
+        return 'false'
+      }
+    }
+  })
 }

+ 1 - 0
src/web/staticres/vipsubscribe/js/vip_renew.js

@@ -532,6 +532,7 @@ function clearSessionStorage() {
     sessionStorage.removeItem("liveActiveCode_new");
     // 清除商品规格当前选择
     sessionStorage.removeItem("vip-cur-select-size")
+    sessionStorage.removeItem("$select-coupon")
 }
 function showToast(text) {
     weui.toast(text, {

+ 22 - 16
src/web/staticres/vipsubscribe/js/vip_upgrade.js

@@ -142,20 +142,23 @@ var purchase = {
   showArea: function () {
     if (!$.isEmptyObject(this.areaSelect) && !this.areaSelect["一个省"]) { //有选择
       if (this.nowBuyset.areacount === -1 || this.nowBuyset.areacount >= 16) {
-        $(".area-result .item-r").text("全国");
+        // $(".area-result .item-r").text("全国");
+        $(".selected-area").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);
+        // 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);
+        tipTxt = Object.keys(this.areaSelect).length
+        $(".selected-area").text(tipTxt);
       }
     } else {
       $(".area-result .item-r").text("");
@@ -233,8 +236,11 @@ var purchase = {
       purchase.areaSelect = {}
     }
     obj.areacount = Object.keys(purchase.areaSelect).length == 0 ? -1 : Object.keys(purchase.areaSelect).length
-    var price = Calculation.GetUpgradeDetail(new Buyset(obj.areacount,[],obj.buyerclasscount,1), time)
-    var givePrice = Calculation.GetUpgradeDetail(new Buyset(obj.areacount,[],obj.buyerclasscount,1), [time[1] === 1 ? 1 : time[0], time[1]])
+    // var price = Calculation.GetUpgradeDetail(new Buyset(obj.areacount,[],obj.buyerclasscount,1), time)
+    // var givePrice = Calculation.GetUpgradeDetail(new Buyset(obj.areacount,[],obj.buyerclasscount,1), [time[1] === 1 ? 1 : time[0], time[1]])
+    /* 超级订阅2.1版本 升级不再自动增加1个月周期,如需增加使用上面注释代码传入周期即可 */
+    var price = Calculation.GetUpgradeDetail(new Buyset(obj.areacount,[],obj.buyerclasscount,1))
+    var givePrice = Calculation.GetUpgradeDetail(new Buyset(obj.areacount,[],obj.buyerclasscount,1))
     price = Number(price[0] / 100) < 0 ? 0 : Number(price[0] / 100)
 
     var showPrice = formatMoney(price);
@@ -578,8 +584,8 @@ $(function () {
       "area": flag ? JSON.stringify(area) : '',
       'area_count': flag ? 0 : areaCount,
       // "industry": industry.join(","),
-      'price': parseInt(coupon.initPrice*100),
-      "time": purchase.timeValue.trim(),
+      'price': parseInt(coupon.initPrice*10000/100),
+      // "time": purchase.timeValue.trim(),
       // "orderType": 5,
       "activeCode": activeCodes,
       "disWord":GetQueryString("disWord"),

+ 23 - 8
src/web/templates/weixin/vipsubscribe/vip_UpgradePage.html

@@ -35,6 +35,17 @@
       font-size: .24rem;
       color:#FE737A;
     }
+    .area_result{
+      display: flex;
+      align-items: center;
+      margin-left: .16rem;
+      background-color: #2ABED1;
+      color: #fff;
+      font-size: .22rem;
+      text-align: center;
+      padding: 0 .16rem;
+      border-radius: .41rem;
+    }
   </style>
 </head>
 
@@ -47,18 +58,22 @@
           <li class="body-item area-industry">
             <a class="item-container" href="/front/vipsubscribe/toChooseArea?header=upgrade">
               <div class="item area">
-                <span class="item-l">省份数量</span>
-                <span class="iconfont icon-arrow"></span>
+                <span class="item-l" style="display: flex;align-items: center;">
+                  <span class="item-label">省份数量</span>
+                  <div class="area_result">
+                    <span>已选:</span>
+                    <span class="selected-area"></span>
+                  </div>
+                </span>
+                <span class="item-r" style="width: auto;">
+                  <span style="color: #9b9ca3;">选择</span>
+                  <span class="iconfont icon-arrow"></span>
+                </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> -->
               <p class="error-update-tips">选择省份数量低于原套餐数,无法升级,请增加省份数量</p>
             </a>
           </li>
-          <li class="body-item select_cycle">
+          <li class="body-item select_cycle" style="display: none;">
             <a class="item-container" href="javascript:;">
               <div class="item">
                 <span class="item-l">