Selaa lähdekoodia

Merge remote-tracking branch 'origin/feature/v4.8.70' into dev/v4.8.70_dx

duxin 1 vuosi sitten
vanhempi
commit
f1d2ebf588

+ 0 - 1
src/jfw/front/dataExport.go

@@ -873,7 +873,6 @@ func (d *DataExport) SetDontPromptAgain() {
 func (d *DataExport) GetDontPromptAgain() {
 	isPrompt := true
 	userId := d.GetSession("mgoUserId").(string)
-	fmt.Println("userId", userId)
 	user, ok := public.MQFW.FindById("user", userId, `{"i_export_promptAgain":1}`)
 	if ok && user != nil && len(*user) > 0 {
 		if util.IntAll((*user)["i_export_promptAgain"]) == 1 {

+ 0 - 1
src/jfw/modules/app/src/app/front/dataExport.go

@@ -276,7 +276,6 @@ func (w *WxDataExport) SetDontPromptAgain() {
 func (w *WxDataExport) GetDontPromptAgain() {
 	isPrompt := true
 	userId := w.GetSession("mgoUserId").(string)
-	fmt.Println("userId", userId)
 	user, ok := public.MQFW.FindById("user", userId, `{"i_export_promptAgain":1}`)
 	if ok && user != nil && len(*user) > 0 {
 		if util.IntAll((*user)["i_export_promptAgain"]) == 1 {

+ 55 - 7
src/web/staticres/common-module/dataExport/components/popup-data-export.js

@@ -37,13 +37,14 @@ Vue.component('popup-data-export', {
     }
   } ,
   created (){
+    let this_ = this
     this.getqr()
     $.ajax({
       type: 'POST',
-      url: '/front/dataExport/getDontPromptAgain',
+      url:this_.isWX ? '/front/dataExport/getDontPromptAgain' : '/jyapp/front/dataExport/getDontPromptAgain',
       success: function (res) { 
         if(!res){return}
-        this.isPrompt = res.isPrompt
+        this_.isPrompt = res.isPrompt
        },
       error: function (error) {
       }
@@ -53,6 +54,14 @@ Vue.component('popup-data-export', {
 
   },
   computed: {
+    isWX () {
+      if (navigator.userAgent.toLowerCase().indexOf('micromessenger') !== -1) { 
+        return true
+
+      }else{
+        return false
+      }
+    }
 
   },
   methods: {
@@ -82,22 +91,40 @@ Vue.component('popup-data-export', {
     },
     btnClick(){
       this.choose = !this.choose
+      this.setDontPrompt()
     },
     next(){
+      this.$emit('next',{choose:this.choose})
+    },
+    setDontPrompt: debounce_(function(){
+      let this_ = this
+      let url_ = this.isWX ? '/front/dataExport/setDontPromptAgain' : '/jyapp/front/dataExport/setDontPromptAgain'
       if(this.choose){
         $.ajax({
           type: 'POST',
-          url: '/front/dataExport/setDontPromptAgain',
+          url: url_,
           data: {status:1},
           contentType: 'application/x-www-form-urlencoded',
           success: function (res) { 
+            this_.isPrompt = true
+           },
+          error: function (error) {
+          }
+        })
+      }else{
+        $.ajax({
+          type: 'POST',
+          url: url_,
+          data: {status:0},
+          contentType: 'application/x-www-form-urlencoded',
+          success: function (res) { 
+            this_.isPrompt = false
            },
           error: function (error) {
           }
         })
       }
-      this.$emit('next',{choose:this.choose})
-    },
+    },300),
     callPhone: function (tel) {
       if (navigator.userAgent.toLowerCase().indexOf('micromessenger') !== -1) { // 微信
         location.href = 'tel:' + tel
@@ -109,6 +136,27 @@ Vue.component('popup-data-export', {
         }
       }
     },
-   
   }
-})
+})
+function debounce_ (func, delay, immediate){
+  var timer = null;
+  delay = delay || 200
+  return function() {
+      var context = this;
+      var args = arguments;
+      if(timer) clearTimeout(timer);
+      if(immediate){
+          var doNow = !timer;
+          timer = setTimeout(function(){
+              timer = null;
+          },delay);
+          if(doNow){
+              func.apply(context,args);
+          }
+      }else{
+          timer = setTimeout(function(){
+              func.apply(context,args);
+          },delay);
+      }
+  }
+}

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

@@ -580,7 +580,6 @@ function clearup(rp){
   if(projectName){
     dtcontent = keyWordHighlight(dtcontent,projectName,"<span class='keyword' style=\"border-bottom:1px solid #2cb7ca\">$1</span>");
     dttitlecopy = keyWordHighlight(dttitlecopy,projectName,"<span class='keyword' id='hst'  style=\"border-bottom:1px solid #2cb7ca;cursor: pointer;\">$1</span>");
-
   }
   if(dataCode=="winner"&&rp=="P"){
     s_winner=$.trim($("#pop-textarea").val());