Explorar el Código

fix:修复免费用户进入地区选择地区默认没有选中的缺陷

熊啸云 hace 3 años
padre
commit
6e86c54154

+ 7 - 1
src/jfw/modules/app/src/web/templates/areaPack/page_set_area.html

@@ -142,7 +142,7 @@
     <script>
         var setAreaFn = {
             conf: {
-                sKey: 'sub_vip_state'
+                sKey: 'sub_free_state'
             },
             buyPageInfo: {},
             init: function () {
@@ -218,11 +218,17 @@
                 url: '/publicapply/free/subscribe',
                 type: 'POST',
                 success: function (res) {
+                    let freeArea = JSON.stringify(res.data)
+                    sessionStorage.setItem('sub_free_state', freeArea)
+                    setAreaFn.init()
+                    onChange(res.data.area)
                     userType = res.data.provincenum === 0 ? false : true
                     maxSelect = res.data.provincenum + res.data.basenum
                     // _this.$emit('UserSubscribe',res)
                     if (maxSelect === -1) {
                         $('#canSelect').text(`全国`)
+                    } else if (res.data.provincenum === 0 && res.data.areanum === 1) {
+                        vueComponent.provinceListMap['#'][0].selectedState = ''
                     } else {
                         $('#canSelect').text(`${maxSelect}个省`)
                     }

+ 18 - 7
src/web/staticres/common-module/vipsubscribe/js/vip-subscribe-set-template.js

@@ -670,7 +670,6 @@ var subComponent = {
                     var href = '/jyapp/areaPack/page/buy?type=buy'
                   }
                 }
-                
                 location.href = href
               }
             }]
@@ -678,10 +677,12 @@ var subComponent = {
       } 
       else {
         // this.linkobj.area = '/jyapp/big/page/set_area?callback=setting_save'
-        if (location.href.indexOf('front') !== -1) {
-          this.linkobj.area = '/areaPack/wx/page/set_area'
-        } else {
-          this.linkobj.area = '/jyapp/areaPack/page/set_area'
+        if (this.vSwitch === 'f') {
+          if (location.href.indexOf('front') !== -1) {
+            this.linkobj.area = '/areaPack/wx/page/set_area'
+          } else {
+            this.linkobj.area = '/jyapp/areaPack/page/set_area'
+          }
         }
       }
     },
@@ -702,7 +703,16 @@ var subComponent = {
     },
     // 打开信息类型
     openInfoType: function () {
-      this.infoTypeMenu = true
+      if (this.vSwitch === 'f') {
+        this.infoTypeMenu = true
+      } else {
+        if (location.href.indexOf('front') !== -1) {
+          location.href = '/front/vipsubscribe/toSetInfoTypePage'
+        } else {
+          location.href = '/jyapp/vipsubscribe/toSetInfoTypePage'
+        }
+        
+      }
     },
     // 重置信息类型
     reset: function () {
@@ -766,7 +776,8 @@ var subComponent = {
           url: '/publicapply/free/subscribe',
           type: 'POST',
           success: function (res) {
-            console.info(res)
+              let freeArea = JSON.stringify(res.data)
+              sessionStorage.setItem('sub_free_state', freeArea)
               _this.UserSubscribe = res
               _this.info.area = res.data.area
               _this.userAreaNum = res.data.areanum

+ 7 - 1
src/web/templates/areaPack/wx/page_set_area.html

@@ -142,7 +142,7 @@
     <script>
         var setAreaFn = {
             conf: {
-                sKey: 'sub_vip_state'
+                sKey: 'sub_free_state'
             },
             buyPageInfo: {},
             init: function () {
@@ -212,11 +212,17 @@
                 url: '/publicapply/free/subscribe',
                 type: 'POST',
                 success: function (res) {
+                    let freeArea = JSON.stringify(res.data)
+                    sessionStorage.setItem('sub_free_state', freeArea)
+                    setAreaFn.init()
+                    onChange(res.data.area)
                     userType = res.data.provincenum === 0 ? false : true
                     maxSelect = res.data.provincenum  + res.data.basenum
                     // _this.$emit('UserSubscribe',res)
                     if (maxSelect === -1) {
                         $('#canSelect').text(`全国`)
+                    } else if (res.data.provincenum === 0 && res.data.areanum === 1) {
+                        vueComponent.provinceListMap['#'][0].selectedState = ''
                     } else {
                         $('#canSelect').text(`${maxSelect}个省`)
                     }