Browse Source

fix: 微信端超级订阅关键词模式选择

zhangyuhan 5 years ago
parent
commit
218ee77d45

+ 5 - 1
src/web/staticres/vipsubscribe/css/vip_index_new.css

@@ -1162,6 +1162,7 @@
 }
 #iosActionsheet .weui-actionsheet__title{
   border-radius: 8px 8px 0 0;
+  padding: 0 0.28rem;
   height: 64px;
   display: flex;
   justify-content: space-between;
@@ -1172,8 +1173,11 @@
   font-size: .4rem;
   color: #171826;
 }
+#iosActionsheet .weui-icon-clear:before{
+    margin-right: 0;
+}
 #iosActionsheet .weui-icon-clear{
-  font-size: .5rem;
+    font-size: .4rem;
 }
 #iosActionsheet .weui-actionsheet__cell{
   text-align: left;

+ 40 - 6
src/web/staticres/vipsubscribe/js/vip_index_new.js

@@ -15,6 +15,15 @@ $(function () {
         }
     }
 
+    function setMatchway (index) {
+        $.post("/subscribepay/afterPay/setUserInfo", {pageType: "saveSeniorset", matchtype: index}, function (r) {
+            if (r.flag) {
+                reqData.matchway = index;
+                sessionStorage.setItem('sub_vip_state', JSON.stringify(reqData))
+            }
+        })
+    }
+
     var checkedflag_other =true; //其他采购单位开关
     function setotherbuyerclass(index) {
         if (checkedflag_other) {
@@ -295,8 +304,23 @@ $(function () {
       $(this).addClass('active').siblings().removeClass('active');
       $iosActionsheet.removeClass('weui-actionsheet_toggle');
       $iosMask.fadeOut(200);
-      console.log($(this).children('.cell_title').text())
       $('.match-way-value').text($(this).children('.cell_title').text())
+      var nowMode = $(this).children('.cell_title').text()
+      var ModeArr = ['按标题匹配', '按全文匹配']
+      var nowIndex = ModeArr.indexOf(nowMode)
+      if (nowIndex !== -1) {
+          setMatchway(ModeArr.indexOf(nowMode) + 1)
+      } else {
+          $(this).removeClass('active').siblings().addClass('active');
+          $('.match-way-value').text($(this).siblings().children('.cell_title').text())
+          weui.toast('关键词匹配方式修改失败', {
+              duration: 1500,
+              className: 'jy-toast',
+              callback: function () {
+                  console.log('close')
+              }
+          });
+      }
     })
 
     $('body').on('click', '.jy-dialog .weui-mask', function () {
@@ -649,6 +673,15 @@ $(function () {
             $('.body-item.info-type .info-type-text').text(state.infotype.join('、'))
         }
 
+        if (state.matchway) {
+            var ModeArr = ['按标题匹配', '按全文匹配']
+            var nowMode = ModeArr[state.matchway - 1] || '按标题匹配'
+            $(".body-item.match-way .keywords-text.match-way-value").text(nowMode)
+            var popDom = $("#iosActionsheet .weui-actionsheet__cell.active")
+            if (popDom.find('.cell_title').text() !== nowMode) {
+                popDom.removeClass('active').siblings().addClass('active');
+            }
+        }
         // 推送设置初始化
         var pushSettingMap = {
             1: '实时推送',
@@ -717,7 +750,8 @@ $(function () {
         if (status[0] === -1) {
             //直接修改
             $(".vip-footer.modify").show();
-            initBack(1);
+            doSubmit()
+            // initBack(1);
             return
         }
 
@@ -863,7 +897,7 @@ $(function () {
 		if (activeCode.toLowerCase() === 'jianyu360' && $('.coupon-code-tx .keywords-text').text() === '支付成功赠送30天订阅周期'){
 			activeCodes = 'jianyu360';
 		}
-		
+
         $DoPost('/subscribepay/vipsubscribe/saveChange', {
             "area": reqData.area["全国"] ? '{}' : JSON.stringify(reqData.area),
             "industry": reqData.industry.join(","),
@@ -880,8 +914,8 @@ $(function () {
                 } else {
                     //订阅修改
                     if (r.data.doSuccess) {
-                        clearSessionStorage();
-                        window.location.reload();
+                        // clearSessionStorage();
+                        // window.location.reload();
                     } else {
                         weui.toast('修改保存失败', {
                             duration: 1500,
@@ -907,7 +941,7 @@ $(function () {
         } else {
           return
         }
-        
+
         var input = $('.coupon-picker .weui-input')
         var confirmButton = $('.coupon-picker .weui-picker__btn')
         var cancelButton = $('.coupon-picker .cancel')