Browse Source

fix: pc产品页面未登录客服二维码获取逻辑修改

cuiyalong 2 years ago
parent
commit
3565b2f521
1 changed files with 22 additions and 9 deletions
  1. 22 9
      src/web/staticres/serviceSystem/js/serviceSystem.js

+ 22 - 9
src/web/staticres/serviceSystem/js/serviceSystem.js

@@ -27,6 +27,7 @@ var vm = new Vue({
             this.tabs = this.getUrlKey('serviceType')
         }
         this.getcode()
+        this.getImage()
     },
     methods: {
         getstates(callback) {
@@ -50,15 +51,6 @@ var vm = new Vue({
                             this_.isbuy_big = false
 
                         }
-                        // 客服二维码
-                        let customers = res.data.customers
-                        customers.forEach(ele => {
-                            if (ele.vip) {
-                              this_.vip_img = ele.wxer
-                            } else  {
-                              this_.img = ele.wxer
-                            }
-                        });
                         callback(res.data)
                     }
                 }
@@ -77,6 +69,27 @@ var vm = new Vue({
             })
 
         },
+        getImage () {
+            var this_ = this
+            // 此接口未登录也能获取客服信息
+            $.ajax({
+                type: 'POST',
+                url: '/bigmember/use/equity',
+                success: function (res) {
+                    if (res.data) {
+                        // 客服二维码
+                        var customers = res.data.customers
+                        customers.forEach(ele => {
+                            if (ele.vip) {
+                              this_.vip_img = ele.wxer
+                            } else  {
+                              this_.img = ele.wxer
+                            }
+                        });
+                    }
+                }
+            })
+        },
         close(val) {
             this[val] = false