Переглянути джерело

Merge branch 'release/v5.4.0' of Software/android-cloud-H5 into master

zengzhixiang 2 роки тому
батько
коміт
5172c49b90
1 змінених файлів з 11 додано та 23 видалено
  1. 11 23
      pages/customer-service.vue

+ 11 - 23
pages/customer-service.vue

@@ -66,6 +66,16 @@ export default {
         },
       ];
     },
+    ysfConfig() {
+      return {
+        uid: String(this.$auth.user.id),
+        name: this.$auth.user.userName,
+        mobile: this.$auth.user.phone,
+        email: this.$auth.user.email,
+        data: JSON.stringify(this.ysfConfigData),
+        language: 'zh-cn',
+      };
+    },
   },
   mounted() {},
   methods: {
@@ -79,29 +89,7 @@ export default {
 
       await new Promise((resolve, reject) => {
         ysf('config', {
-          uid: String(this.$auth.user.id),
-          name: this.$auth.user.userName,
-          mobile: this.$auth.user.phone,
-          email: this.$auth.user.email,
-          data: JSON.stringify([
-            { key: 'real_name', value: this.$auth.user.userName },
-            { key: 'mobile_phone', hidden: true, value: this.$auth.user.phone },
-            { key: 'email', value: this.$auth.user.email },
-            {
-              key: 'avatar',
-              label: '头像',
-              value:
-                this.$auth.user.headImgFileId &&
-                fileKeyToUrl(this.$auth.user.headImgFileId),
-            }, // 访客头像
-            {
-              index: 0,
-              key: 'account',
-              label: '账号',
-              value: this.$auth.user.phone,
-            },
-          ]),
-          language: 'zh-cn',
+          ...this.ysfConfig,
           success: resolve,
           error: reject,
         });