Browse Source

弹窗组件逻辑联调

wenmenghao321 1 năm trước cách đây
mục cha
commit
dc3205ca3e

+ 1 - 1
src/jfw/modules/app/src/web/staticres/jyapp/big-member/js/ent_portrait.js

@@ -540,7 +540,7 @@ var vNode = {
     },
     //数据导出
     onExport (type) {
-      if(this.topProject.count > 20000 && type !== 'popupClick'){
+      if(this.topProject.count > 20000 && type !== 'popupClick' && this.$refs.popup_dataExport.isPrompt){
         this.$refs.popup_dataExport.show = true
         return
       }

+ 1 - 1
src/jfw/modules/app/src/web/staticres/jyapp/big-member/js/unit_portrayal.js

@@ -596,7 +596,7 @@ var vNode = {
         window.location.href = "/jyapp/free/login?to=back";
         return
       }
-      if(this.dt.pageCount > 20000 && type !== 'popupClick'){
+      if(this.dt.pageCount > 20000 && type !== 'popupClick' && this.$refs.popup_dataExport.isPrompt){
         this.$refs.popup_dataExport.show = true
         return
       }

+ 8 - 1
src/jfw/modules/app/src/web/templates/dataExport/dataExport.html

@@ -517,6 +517,11 @@
                 window.location.reload();
             }
         });
+        if(GetQueryString('from') != 'filterList'){
+            //接口回显逻辑
+            
+        }
+        localStorage.setItem('index','-1') 
         //
         var scrollTop = 0;
         //
@@ -905,6 +910,7 @@
 
                     $(".confirm").hide();
                     $(".resetOne").show();
+                    localStorage.removeItem("date"); 
                     // localStorage.removeItem("date"); // 重新选择日期不在移除date 重新访问页面以提交的时间为准回显
                     localStorage.removeItem("index");
                 }
@@ -973,6 +979,7 @@
 
                     $(".confirm").hide();
                     $(".resetOne").show();
+                    localStorage.removeItem("date"); 
                     // localStorage.removeItem("date");  // 重新选择日期不在移除date 重新访问页面以提交的时间为准回显
                     localStorage.removeItem("index");
                 }
@@ -1045,7 +1052,7 @@
         }
         //
         if (localStorage.date !== undefined && localStorage.date !== "") {
-            localStorage.setItem('index','-1') // 存在提交的date直接回显时间至具体时间组件
+            // localStorage.setItem('index','-1') // 存在提交的date直接回显时间至具体时间组件
             if (localStorage.index !== "-1") {
                 $(".chooseTime ul li.active").removeClass("active");
                 $(".chooseTime ul li").eq(localStorage.index).addClass("active");

+ 3 - 0
src/jfw/modules/app/src/web/templates/frontRouter/collection/sess/index.html

@@ -12,6 +12,7 @@
     <link rel="stylesheet" href=//cdn-common.jianyu360.com/cdn/lib/vant/2.12.24/lib/icon/local.css />
     <link rel="stylesheet" href='{{Cdns .Host "seo" "cdn"|SafeUrl}}/common-module/collection/css/index.css?v={{Msg "seo" "version"}}' />
     <link rel="stylesheet" href='{{Cdns .Host "seo" "cdn"|SafeUrl}}/common-module/bidstatus-update/css/bid-status-update.css?v={{Msg "seo" "version"}}'></link>
+    <link rel="stylesheet" type="text/css" href='{{Cdns .Host "seo" "cdn"|SafeUrl}}/common-module/dataExport/css/popup-data-export.css?v={{Msg "seo" "version"}}'/>
 </head>
 <style>
   .list-mian{
@@ -157,6 +158,7 @@
       <van-popup class="j-container" :style="popupHeight" v-model="showBidStatus" round position="bottom">
         <bid-status-node @cancel-update="cancelUpdate" @save-success="saveSuccess" :project-cell-info="projectCellInfo" @set-height="setHeight"></bid-status-node>
       </van-popup>
+      <popup-data-export ref="popup_dataExport" @next="next_export"></popup-data-export>
     </div>
   </div>
   <!--S-当前页面的资源-->
@@ -173,6 +175,7 @@
   <script src='{{Cdns .Host "seo" "cdn"|SafeUrl}}/common-module/collection/js/visited.js?v={{Msg "seo" "version"}}'></script>
   <script src='{{Cdns .Host "seo" "cdn"|SafeUrl}}/common-module/bidstatus-update/js/bid-status-update.js?v={{Msg "seo" "version"}}'></script>
   <script src='{{Cdns .Host "seo" "cdn"|SafeUrl}}/common-module/collection/js/index.js?v={{Msg "seo" "version"}}'></script>
+  <script src='{{Cdns .Host "seo" "cdn"|SafeUrl}}/common-module/dataExport/components/popup-data-export.js?v={{Msg "seo" "version"}}'></script>
   {{include "/common/baiducc.html"}}
 </body>
 

+ 2 - 2
src/web/staticres/big-member/js/unit_portrayal.js

@@ -547,9 +547,9 @@ var vNode = {
           this.onExport('popupClick')
         },
         //数据导出
-        onExport(){
+        onExport(type){
           var _this = this
-          if(this.dt.pageCount > 20000 && type !== 'popupClick'){
+          if(this.dt.pageCount > 20000 && type !== 'popupClick' && this.$refs.popup_dataExport.isPrompt){
             this.$refs.popup_dataExport.show = true
             return
           }

+ 1 - 1
src/web/staticres/common-module/collection/js/ent_portrait.js

@@ -544,7 +544,7 @@ var vNode = {
     
     //数据导出
     onExport(type){
-      if(this.topProject.count > 20000 && type !== 'popupClick'){
+      if(this.topProject.count > 20000 && type !== 'popupClick' && this.$refs.popup_dataExport.isPrompt){
         this.$refs.popup_dataExport.show = true
         return
       }

+ 13 - 3
src/web/staticres/common-module/collection/js/index-wx.js

@@ -265,6 +265,7 @@ var vNode = {
           }
           if (res.error_code == 0) {
             if (res.data && res.data.res && $.isArray(res.data.res)) {
+              _this.listState.total = res.data.count
               try {
                 res.data.res.forEach(function (item) {
                     item.isCB = {
@@ -343,6 +344,7 @@ var vNode = {
       })
     },
     getCBProject: function(arr) {
+      let _this = this
       let idArr = arr.map(item => item._id)
       if (idArr.length > 0) {
         idArr = idArr.join(',')
@@ -370,8 +372,8 @@ var vNode = {
             }
           }
         },
-        error: function(){
-          _this.$toast(res.error_msg)
+        error: function(err){
+          // _this.$toast(err.error_msg)
         }
       })
     },
@@ -591,11 +593,19 @@ var vNode = {
         }
       })
     },
+    next_export (obj){
+      console.log(obj)
+      this.dataReport('popupClick')
+    },
     // 数据导出
-    dataReport: function() {
+    dataReport: function(type) {
       if(this.listState.list.length == 0) {
         this.$toast('暂无数据')
       } else {
+        if(this.listState.total> 20000 && type !== 'popupClick' && this.$refs.popup_dataExport.isPrompt){
+          this.$refs.popup_dataExport.show = true
+          return
+        }
         $.ajax({
           url: '/publicapply/dataexpoet/bycollection',
           type: 'POST',

+ 13 - 3
src/web/staticres/common-module/collection/js/index.js

@@ -267,6 +267,7 @@ var vNode = {
           }
           if (res.error_code == 0) {
             if (res.data && res.data.res && $.isArray(res.data.res)) {
+              _this.listState.total = res.data.count
               try {
                 res.data.res.forEach(function (item) {
                     item.isCB = {
@@ -345,6 +346,7 @@ var vNode = {
       })
     },
     getCBProject: function(arr) {
+      let _this = this
       let idArr = arr.map(item => item._id)
       if (idArr.length > 0) {
         idArr = idArr.join(',')
@@ -372,8 +374,8 @@ var vNode = {
             }
           }
         },
-        error: function(){
-          _this.$toast(res.error_msg)
+        error: function(err){
+          // _this.$toast(err.error_msg)
         }
       })
     },
@@ -594,11 +596,19 @@ var vNode = {
         }
       })
     },
+    next_export (obj){
+      console.log(obj)
+      this.dataReport('popupClick')
+    },
     // 数据导出
-    dataReport: function() {
+    dataReport: function(type) {
       if(this.listState.list.length == 0) {
         this.$toast('暂无数据')
       }else {
+        if(this.listState.total> 20000 && type !== 'popupClick' && this.$refs.popup_dataExport.isPrompt){
+          this.$refs.popup_dataExport.show = true
+          return
+        }
         $.ajax({
           url: '/publicapply/dataexpoet/bycollection',
           type: 'POST',

+ 25 - 3
src/web/staticres/common-module/dataExport/components/popup-data-export.js

@@ -31,13 +31,23 @@ Vue.component('popup-data-export', {
     return {
       show: false,
       choose:false,
-      img:''
+      img:'',
+      isPrompt:true
 
     }
   } ,
   created (){
     this.getqr()
-
+    $.ajax({
+      type: 'POST',
+      url: '/front/dataExport/getDontPromptAgain',
+      success: function (res) { 
+        if(!res){return}
+        this.isPrompt = res.isPrompt
+       },
+      error: function (error) {
+      }
+    })
   },
   mounted () {
 
@@ -74,7 +84,19 @@ Vue.component('popup-data-export', {
       this.choose = !this.choose
     },
     next(){
-        this.$emit('next',{choose:this.choose})
+      if(this.choose){
+        $.ajax({
+          type: 'POST',
+          url: '/front/dataExport/setDontPromptAgain',
+          data: {status:1},
+          contentType: 'application/x-www-form-urlencoded',
+          success: function (res) { 
+           },
+          error: function (error) {
+          }
+        })
+      }
+      this.$emit('next',{choose:this.choose})
     },
     callPhone: function (tel) {
       if (navigator.userAgent.toLowerCase().indexOf('micromessenger') !== -1) { // 微信

+ 3 - 0
src/web/templates/frontRouter/wx/collection/sess/index.html

@@ -24,6 +24,7 @@
     <link rel="stylesheet" href='{{Msg "seo" "cdn"}}/big-member/css/j-icons.css?v={{Msg "seo" "version"}}'>
     <link rel="stylesheet" href='{{Msg "seo" "cdn"}}/common-module/collection/css/index.css?v={{Msg "seo" "version"}}' />
     <link rel="stylesheet" href='{{Msg "seo" "cdn"}}/common-module/bidstatus-update/css/bid-status-update.css?v={{Msg "seo" "version"}}'></link>
+    <link rel="stylesheet" type="text/css" href='{{Msg "seo" "cdn"}}/common-module/dataExport/css/popup-data-export.css?v={{Msg "seo" "version"}}'/>
 </head>
 <style>
   .list-mian{
@@ -180,6 +181,7 @@
       <van-popup class="j-container" :style="popupHeight" v-model="showBidStatus" round position="bottom">
         <bid-status-node @cancel-update="cancelUpdate" @save-success="saveSuccess" :project-cell-info="projectCellInfo" @set-height="setHeight"></bid-status-node>
       </van-popup>
+      <popup-data-export ref="popup_dataExport" @next="next_export"></popup-data-export>
     </div>
   </div>
   <!--S-当前页面的资源-->
@@ -196,6 +198,7 @@
   <script src='{{Msg "seo" "cdn"}}/common-module/collection/js/visited.js?v={{Msg "seo" "version"}}'></script>
   <script src='{{Msg "seo" "cdn"}}/common-module/bidstatus-update/js/bid-status-update.js?v={{Msg "seo" "version"}}'></script>
   <script src='{{Msg "seo" "cdn"}}/common-module/collection/js/index-wx.js?v={{Msg "seo" "version"}}'></script>
+  <script src='{{Msg "seo" "cdn"}}/common-module/dataExport/components/popup-data-export.js?v={{Msg "seo" "version"}}'></script>
   <script>
     // 数据包默认选中企业需请求默认企业接口
     try {

+ 8 - 1
src/web/templates/weixin/dataExport/dataExport.html

@@ -537,6 +537,11 @@
             }
         });
         //
+        if(GetQueryString('from') != 'filterList'){
+            //接口回显逻辑
+            
+        }
+        localStorage.setItem('index','-1') 
         $('.match').click(function () {
              //单选原有逻辑
             // $('.match_way').slideDown('slow');
@@ -929,6 +934,7 @@
 
                     $(".confirm").hide();
                     $(".resetOne").show();
+                    // localStorage.removeItem("date"); // 重新选择日期不在移除date 重新访问页面以提交的时间为准回显
                     localStorage.removeItem("date");
                     localStorage.removeItem("index");
                 }
@@ -994,6 +1000,7 @@
 
                     $(".confirm").hide();
                     $(".resetOne").show();
+                    // localStorage.removeItem("date"); // 重新选择日期不在移除date 重新访问页面以提交的时间为准回显
                     localStorage.removeItem("date");
                     localStorage.removeItem("index");
                 }
@@ -1064,7 +1071,7 @@
         }
         //
         if(localStorage.date!==undefined && localStorage.date!==""){
-            localStorage.setItem('index','-1') // 存在提交的date直接回显时间至具体时间组件
+            // localStorage.setItem('index','-1') // 存在提交的date直接回显时间至具体时间组件
             if(localStorage.index !== "-1"){
                 $(".chooseTime ul li.active").removeClass("active");
                 $(".chooseTime ul li").eq(localStorage.index).addClass("active");