浏览代码

订阅设置组件修改

TANGSHIZHE 4 年之前
父节点
当前提交
75cefdd1c4

+ 3 - 0
src/jfw/modules/app/src/web/staticres/jyapp/vipsubscribe/css/vip_introduce.css

@@ -168,6 +168,9 @@ html,body {
   background-color: #1B1A2A;
   background-size: 100% 100%;
 }
+.jy-alert .weui-dialog {
+  left: .72rem;
+}
 
 .main .group {
   position: relative;

+ 9 - 1
src/jfw/modules/app/src/web/staticres/jyapp/vipsubscribe/js/change_industry.js

@@ -81,7 +81,11 @@ function resultCount() {
         $('.result_count').html('全部行业');
         result = [];
         if (buyCount != -1) {
-            $('.update_tips').show();
+            if(getParam('subvip') ==  'free') {
+              $('.update_tips').hide();
+            } else {
+              $('.update_tips').show();
+            }
         } else {
             $('.update_tips').hide();
         }
@@ -98,7 +102,11 @@ function resultCount() {
             }
         })
         if (count > buyCount && buyCount != -1) {
+          if(getParam('subvip') ==  'free') {
+            $('.update_tips').hide();
+          }else {
             $('.update_tips').show();
+          }
         } else {
             $('.update_tips').hide();
         }

+ 13 - 1
src/jfw/modules/app/src/web/templates/vipsubscribe/vip_introduce.html

@@ -220,6 +220,7 @@
         },
         created () {
           this.getUserInfo()  
+          this.iosBackRefresh()
         },
         methods: {
             getUserInfo: function() {
@@ -245,7 +246,18 @@
                         }
                     })
                 }
-            }
+            },
+            iosBackRefresh: function () {
+                var isPageHide = false;
+                window.addEventListener('pageshow', function () {
+                    if (isPageHide) {
+                        location.reload();
+                    }
+                });
+                window.addEventListener('pagehide', function () {
+                    isPageHide = true;
+                });
+            },
         }
     })
 </script>

+ 0 - 1
src/web/staticres/common-module/vipsubscribe/css/vip-subscribe-set-template.css

@@ -352,7 +352,6 @@
   /* left: .72rem;
   right: .72rem; */
   border-radius: .16rem;
-  left: .72rem;
 }
 
 .jy-alert .weui-dialog__hd .weui-dialog__title {

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

@@ -9,7 +9,7 @@ var subScribeTemplate = `
           <span class="item-label">区域</span>
         </span>
         <span class="item-r">
-          <span class="keywords-text ellipsis">已选:{{info.area}}</span>
+          <span class="keywords-text ellipsis">{{info.area}}</span>
           <span class="iconfont icon-arrow"></span>
         </span>
       </div>
@@ -23,7 +23,7 @@ var subScribeTemplate = `
           <span class="item-label">采购单位行业</span>
         </span>
         <span class="item-r">
-          <span class="keywords-text ellipsis">已选:{{info.industry}}</span>
+          <span class="keywords-text ellipsis">{{info.industry}}</span>
           <span class="iconfont icon-arrow"></span>
         </span>
       </div>
@@ -212,7 +212,7 @@ var subComponent = {
       let _this = this
       if(this.initdata.area) {
         if(JSON.stringify(this.initdata.area) == '{}') {
-          this.info.area = '全国'
+          this.info.area = '已选:全国'
         } else {
           let proStr = ''
           Object.keys(this.initdata.area).forEach(function(item,index) {
@@ -234,7 +234,7 @@ var subComponent = {
           if(proStr[proStr.length - 1] == '、') {
             proStr = proStr.substr(0,proStr.length - 1);
           }
-          _this.info.area = proStr
+          _this.info.area = '已选:' + proStr
         }
       } else {
         this.info.area = '请选择区域'
@@ -245,9 +245,9 @@ var subComponent = {
       let _this = this
       if(this.initdata.industry) {
         if(this.initdata.industry.length == 0) {
-          this.info.industry = '全部行业'
+          this.info.industry = '已选:全部行业'
         } else {
-          this.info.industry = this.initdata.industry.join('、')
+          this.info.industry = '已选:' + this.initdata.industry.join('、')
         }
       } else {
         this.info.industry = '请选择采购单位行业'
@@ -392,12 +392,14 @@ var subComponent = {
       }
     },
     setMatchway(index) {
+      let _this = this
       $.post("/subscribepay/afterPay/setUserInfo", {pageType: "saveSeniorset", matchtype: index}, function (r) {
           if (r.flag) {
             var subVipState = sessionStorage.getItem('sub_vip_state');
             var reqData = JSON.parse(subVipState);
             reqData.matchway = index;
             sessionStorage.setItem('sub_vip_state', JSON.stringify(reqData))
+            _this.getResultView()
           }
       })
     },

+ 0 - 49
src/web/staticres/vipsubscribe/js/vip_index_new.js

@@ -458,48 +458,6 @@ $(function () {
         $('.coupon-code-tx').off('click');
     }
 
-    // switch点击切换
-    $('.switch').on('click', function (e) {
-        var $this = $(this);
-        var hasChecked = $this.hasClass('checked');
-
-        if (!hasChecked) {
-            $this.addClass('checked');
-            setprojectmatch(1);
-        } else {
-            $this.removeClass('checked');
-            setprojectmatch(0);
-            weui.toast('项目匹配已关闭', {
-                duration: 1500,
-                className: 'jy-toast',
-                callback: function () {
-                    console.log('close')
-                }
-            });
-        }
-    })
-
-
-    // switch点击切换
-    $('.switch_other').on('click', function (e) {
-        var $this = $(this);
-        var hasChecked = $this.hasClass('checked');
-        if (!hasChecked) {
-            $this.addClass('checked');
-            setotherbuyerclass(1);
-        } else {
-            $this.removeClass('checked');
-            setotherbuyerclass(0);
-            weui.toast('“其它”采购单位已关闭', {
-                duration: 1500,
-                className: 'jy-toast other-buyerclass',
-                callback: function () {
-                    console.log('close')
-                }
-            });
-        }
-    })
-
     var $dialog;
 
     //保存取消提示 module 1 修改 2升级 3续费 4购买
@@ -810,13 +768,6 @@ $(function () {
         }
         $('.body-item.push-setting .push-setting-text').text(pushSettingMap[state.ratemode])
 
-        // 初始化项目匹配
-        if (state.projectmatch) {
-            $('.switch').addClass('checked')
-        } else {
-            $('.switch').removeClass('checked')
-        }
-
         // 初始化“其他"开关
         console.log(state.otherbuyerclass)
         if (state.otherbuyerclass == 1 || state.otherbuyerclass == null) {

+ 14 - 2
src/web/templates/weixin/vipsubscribe/vip_introduce.html

@@ -215,7 +215,8 @@
                 }
             },
             created () {
-              this.getUserInfo()  
+              this.getUserInfo()
+              this.iosBackRefresh()
             },
             methods: {
                 getUserInfo: function() {
@@ -251,7 +252,18 @@
                     reg = null;
                     r = null;
                     return context == null || context == "" || context == "undefined" ? "" : context;
-                }
+                },
+                iosBackRefresh: function () {
+                    var isPageHide = false;
+                    window.addEventListener('pageshow', function () {
+                        if (isPageHide) {
+                            location.reload();
+                        }
+                    });
+                    window.addEventListener('pagehide', function () {
+                        isPageHide = true;
+                    });
+                },
             }
         })
     </script>