瀏覽代碼

提交 留资弹框 判断

wenmenghao 3 年之前
父節點
當前提交
ba00b2a4e9
共有 2 個文件被更改,包括 12 次插入3 次删除
  1. 8 2
      src/web/staticres/js/pc-collect-user-info.js
  2. 4 1
      src/web/staticres/public-pc/js/article-content.js

+ 8 - 2
src/web/staticres/js/pc-collect-user-info.js

@@ -561,7 +561,7 @@ var vm = new Vue({
       this.$refs['ruleForm'].clearValidate(['job','otherJob']);
     },
     // 是否留资
-    isNeedSubmit: function(source, callback, dom,infoid) {
+    isNeedSubmit: function(source, callback, dom,infoid,type) {
       /*
         三级页-阅读原文	article_original
         三级页-收藏	article_collection
@@ -579,7 +579,13 @@ var vm = new Vue({
         },
         success:function (res) {
           // 判断当前信息否在其他页面留资  如果全部留资 直接弹窗提交成功
-          var checkKeys = ['name', 'phone','companyType', 'company', 'branch', 'position']
+          if(type=='free-download'){
+            var checkKeys = ['name', 'phone','companyType', 'company', 'branch', 'position']
+          }else{
+            var checkKeys = ['name', 'phone','companyType', 'company', 'branch', 'position']
+
+          }
+          
           var sourceList = ['article_collection', 'article_original', 'jyarticle_see3_plus_app', 'jyarticle_see3_plus_pc', 'jyarticle_see3_plus_wx', 'jypush_see10_plus_app', 'jypush_see10_plus_wx']
           var isCollect = sourceList.includes(source)
           if (infoid != ""){

+ 4 - 1
src/web/staticres/public-pc/js/article-content.js

@@ -2523,7 +2523,10 @@ $(function() {
   $('.free-download').click(function() {
     // 弹窗留资弹框,第一个参数为source,第二个是留资成功后是否需要刷新页面 可不传,不传即为不刷新
     // 不需要再调是否留资接口 只要isAdd接口里返回得对应参数值为0 即为需要留资 直接调noCallApiFn方法弹出弹框即可
-    vm.noCallApiFn('article_attach_freeuser', true)
+    // vm.noCallApiFn('article_attach_freeuser', true)
+    vm.isNeedSubmit('article_attach_freeuser', function() {
+      vm.showSuccess = true
+    },null,null,'free-download')
   })
   // 控制正文下table里没有内容 但有标签时取消其样式
   $('.com-detail table').each(function(){