Răsfoiți Sursa

fix: 订阅设置跳转问题&支付成功逻辑调整

cuiyalong 3 ani în urmă
părinte
comite
00e14148e3

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

@@ -85,7 +85,6 @@ var subNode = new Vue({
                         }
                         this.linkObj = {
                             area: '/jyapp/big/page/set_area?callback=setting_save',
-                            // area: '/jyapp/areaPack/set_area',
                             industry: '/jyapp/big/page/set_cate?header=采购单位类型&callback=setting_save',
                             keyword: '/jyapp/vipsubscribe/toSetKeyWordPage',
                             infotype: '/jyapp/big/page/set_infotype?callback=setting_save',

+ 34 - 29
src/jfw/modules/app/src/web/templates/commonPay/paySuccess.html

@@ -138,35 +138,7 @@
                 }
                 $('.info-box .info-item').text('数据流量包:+' + allTotal)
             } else if (productType === 'areaPack') {
-                // https://showdoc.jydev.jianyu360.com/web/#/67?page_id=891
-                // {
-                //     num: 0, // 购买的数量 -1全国
-                //     ordertype: 1, // 1正常购买 2升级 3续费
-                //     cycleunit: 0, // 日期单位 1月 2季 3年
-                //     OldNum: 0, // 升级前购买的省份数量
-                // }
-                var titleMap = {
-                    1: '购买',
-                    2: '升级',
-                    3: '续费'
-                }
-                setHeaderTitle(titleMap[orderFilter.ordertype] + $('.header-title').text())
-                var cycleType = ' 个月'
-                if (orderFilter.cycleunit == 2) {
-                    cycleType = ' 季'
-                } else if (orderFilter.cycleunit == 3) {
-                    cycleType = ' 年'
-                }
-
-                var html = `${titleMap[orderFilter.ordertype]}省份数量:<span class="highlight-text">${orderFilter.num === -1 ? '全国' : orderFilter.num}</span>${orderFilter.num === -1 ? '' : ' 个省'}`
-                html += `&nbsp;&nbsp;&nbsp;&nbsp;|&nbsp;&nbsp;&nbsp;&nbsp;`
-                html += `订阅周期:`
-                if (orderFilter.ordertype == 2) {
-                    html += `不延期`
-                } else {
-                    html += `<span class="highlight-text">1</span>${ cycleType }`
-                }
-                $('.info-box .info-item').html(html)
+                setAreaPackInfo(orderFilter)
             }
         }
 
@@ -198,6 +170,39 @@
         }
     })
 
+    function setAreaPackInfo (orderFilter) {
+        // https://showdoc.jydev.jianyu360.com/web/#/67?page_id=891
+        // {
+        //     num: 0, // 购买的数量 -1全国
+        //     ordertype: 1, // 1正常购买 2升级 3续费
+        //     cycleunit: 0, // 日期单位 1月 2季 3年
+        //     OldNum: 0, // 升级前购买的省份数量
+        // }
+        var titleMap = {
+            1: '购买',
+            2: '升级',
+            3: '续费'
+        }
+        setHeaderTitle(titleMap[orderFilter.ordertype] + $('.header-title').text())
+        var cycleType = ' 个月'
+        if (orderFilter.cycleunit == 2) {
+            cycleType = ' 季'
+        } else if (orderFilter.cycleunit == 3) {
+            cycleType = ' 年'
+        }
+
+        var upgradeText = orderFilter.num === -1 ? '全国' : (orderFilter.num - orderFilter.OldNum)
+        var html = `${titleMap[orderFilter.ordertype]}省份数量:<span class="highlight-text">${upgradeText}</span>${orderFilter.num === -1 ? '' : ' 个省'}`
+        html += `&nbsp;&nbsp;&nbsp;&nbsp;|&nbsp;&nbsp;&nbsp;&nbsp;`
+        html += `订阅周期:`
+        if (orderFilter.ordertype == 2) {
+            html += `不延期`
+        } else {
+            html += `<span class="highlight-text">1</span>${ cycleType }`
+        }
+        $('.info-box .info-item').html(html)
+    }
+
     function setHeaderTitle (title) {
         if (!title) return
         document.title = title

+ 8 - 17
src/web/staticres/common-module/vipsubscribe/js/vip-subscribe-set-template.js

@@ -20,7 +20,7 @@ var subScribeTemplate = `
     </div>
     </li>
     <li class="body-item industry">
-    <a class="item-container" :href="linkobj.industry" @click="userNoIndustry">
+    <a class="item-container" :href="linkobj.industry" @click="userNoIndustry($event)">
       <div class="item">
         <span class="item-l">
           <span class="leading jy-icon-industry"></span>
@@ -63,7 +63,7 @@ var subScribeTemplate = `
     </a>
     </li>
     <li class="body-item info-type">
-    <a class="item-container" href="javascript:;" :thisHref="linkobj.infotype" @click="openInfoType">
+    <a class="item-container" :href="linkobj.infotype" @click="openInfoType($event)">
       <div class="item">
         <span class="item-l">
           <span class="leading jy-icon-info-type"></span>
@@ -637,23 +637,21 @@ var subComponent = {
           }]
       });
     },
-    // 用户未购买修改采购单位类型功能
     userNoIndustry: function () {
-      if (this.vSwitch !== 'f') {
-        var href = '/jyapp/vipsubscribe/toChangeIndustry?header=save'
-      } else {
+      if (this.vSwitch === 'f') {
         if (location.href.indexOf('front') !== -1) {
           var href = '/front/vipsubscribe/introducePage'
         } else {
           var href = '/jyapp/vipsubscribe/introducePage'
         }
+        this.linkobj.industry = href
       }
-      this.linkobj.industry = href
     },
     // 修改地区无次数点击事件
     userNumOver: function () {
       var _this = this
       if (this.vSwitch === 'f' && this.userAreaNum === 0) {
+        // 免费用户修改href跳转
         this.linkobj.area = 'javascript:;'
         if (this.userAreaAllNum > 0) {
           var str = `对不起,您当月修改区域的机会(${this.userAreaAllNum}次)已消耗完毕,无法再次修改~可前往升级省份订阅包增加订阅省份和修改次数`
@@ -686,8 +684,7 @@ var subComponent = {
               }
             }]
         });
-      }
-      else {
+      } else {
         // this.linkobj.area = '/jyapp/big/page/set_area?callback=setting_save'
         if (this.vSwitch === 'f') {
           if (location.href.indexOf('front') !== -1) {
@@ -714,16 +711,10 @@ var subComponent = {
       });
     },
     // 打开信息类型
-    openInfoType: function () {
+    openInfoType: function (e) {
       if (this.vSwitch === 'f') {
+        e.preventDefault()
         this.infoTypeMenu = true
-      } else {
-        if (location.href.indexOf('front') !== -1) {
-          location.href = '/front/vipsubscribe/toSetInfoTypePage'
-        } else {
-          location.href = '/jyapp/vipsubscribe/toSetInfoTypePage'
-        }
-
       }
     },
     // 重置信息类型

+ 33 - 29
src/web/templates/weixin/commonPay/paySuccess.html

@@ -111,35 +111,7 @@
                 }
                 $('.info-box .info-item').text('数据流量包:+' + allTotal)
             } else if (productType === 'areaPack') {
-                // https://showdoc.jydev.jianyu360.com/web/#/67?page_id=891
-                // {
-                //     num: 0, // 购买的数量 -1全国
-                //     ordertype: 1, // 1正常购买 2升级 3续费
-                //     cycleunit: 0, // 日期单位 1月 2季 3年
-                //     OldNum: 0, // 升级前购买的省份数量
-                // }
-                var titleMap = {
-                    1: '购买',
-                    2: '升级',
-                    3: '续费'
-                }
-                setHeaderTitle(titleMap[orderFilter.ordertype] + $('.header-title').text())
-                var cycleType = ' 个月'
-                if (orderFilter.cycleunit == 2) {
-                    cycleType = ' 季'
-                } else if (orderFilter.cycleunit == 3) {
-                    cycleType = ' 年'
-                }
-
-                var html = `${titleMap[orderFilter.ordertype]}省份数量:<span class="highlight-text">${orderFilter.num === -1 ? '全国' : orderFilter.num}</span>${orderFilter.num === -1 ? '' : ' 个省'}`
-                html += `&nbsp;&nbsp;&nbsp;&nbsp;|&nbsp;&nbsp;&nbsp;&nbsp;`
-                html += `订阅周期:`
-                if (orderFilter.ordertype == 2) {
-                    html += `不延期`
-                } else {
-                    html += `<span class="highlight-text">1</span>${ cycleType }`
-                }
-                $('.info-box .info-item').html(html)
+                setAreaPackInfo(orderFilter)
             }
         }
 
@@ -165,6 +137,38 @@
         }
     })
 
+    function setAreaPackInfo (orderFilter) {
+        // https://showdoc.jydev.jianyu360.com/web/#/67?page_id=891
+        // {
+        //     num: 0, // 购买的数量 -1全国
+        //     ordertype: 1, // 1正常购买 2升级 3续费
+        //     cycleunit: 0, // 日期单位 1月 2季 3年
+        //     OldNum: 0, // 升级前购买的省份数量
+        // }
+        var titleMap = {
+            1: '购买',
+            2: '升级',
+            3: '续费'
+        }
+        setHeaderTitle(titleMap[orderFilter.ordertype] + $('.header-title').text())
+        var cycleType = ' 个月'
+        if (orderFilter.cycleunit == 2) {
+            cycleType = ' 季'
+        } else if (orderFilter.cycleunit == 3) {
+            cycleType = ' 年'
+        }
+
+        var html = `${titleMap[orderFilter.ordertype]}省份数量:<span class="highlight-text">${orderFilter.num === -1 ? '全国' : orderFilter.num}</span>${orderFilter.num === -1 ? '' : ' 个省'}`
+        html += `&nbsp;&nbsp;&nbsp;&nbsp;|&nbsp;&nbsp;&nbsp;&nbsp;`
+        html += `订阅周期:`
+        if (orderFilter.ordertype == 2) {
+            html += `不延期`
+        } else {
+            html += `<span class="highlight-text">1</span>${ cycleType }`
+        }
+        $('.info-box .info-item').html(html)
+    }
+
     function setHeaderTitle (title) {
         if (!title) return
         document.title = title