فهرست منبع

微信分享链接不带中文名称,改为邀请页异步获取

ZhangWenQiang 6 سال پیش
والد
کامیت
27b80650fc
2فایلهای تغییر یافته به همراه17 افزوده شده و 4 حذف شده
  1. 2 2
      src/view/index/index.vue
  2. 15 2
      src/view/invitation/index.vue

+ 2 - 2
src/view/index/index.vue

@@ -336,7 +336,7 @@
                 wx.updateAppMessageShareData({
                     title: '体温打卡,中国加油!', // 分享标题
                     desc: getStore('role') === 'staff' ? '我正在' + that.enterprise_name + '体温打卡进行每日体温记录,你也快来试试吧!' : that.enterprise_name + '邀请你进行体温打卡', // 分享描述
-                    link: 'http://dk.hap-job.com/invitation?enterprise_id=' + that.enterprise_id + '&enterprise_name=' + that.enterprise_name, // 分享链接,该链接域名或路径必须与当前页面对应的公众号JS安全域名一致
+                    link: 'http://dk.hap-job.com/invitation?enterprise_id=' + that.enterprise_id , // 分享链接,该链接域名或路径必须与当前页面对应的公众号JS安全域名一致
                     imgUrl: 'https://hpjobtest.oss-cn-shanghai.aliyuncs.com/uploadfiles/banner/wx_share.png', // 分享图标
                     success: function () {
                         // 设置成功
@@ -350,7 +350,7 @@
                 var that = this;
                 wx.updateTimelineShareData({
                     title: getStore('role') === 'staff' ? '我正在' + that.enterprise_name + '体温打卡进行每日体温记录,你也快来试试吧!' : that.enterprise_name + '邀请你进行体温打卡', // 分享标题
-                    link: 'http://dk.hap-job.com/invitation?enterprise_id=' + that.enterprise_id + '&enterprise_name=' + that.enterprise_name, // 分享链接,该链接域名或路径必须与当前页面对应的公众号JS安全域名一致
+                    link: 'http://dk.hap-job.com/invitation?enterprise_id=' + that.enterprise_id , // 分享链接,该链接域名或路径必须与当前页面对应的公众号JS安全域名一致
                     imgUrl: 'https://hpjobtest.oss-cn-shanghai.aliyuncs.com/uploadfiles/banner/wx_share.png', // 分享图标
                     success: function () {
                         // 设置成功

+ 15 - 2
src/view/invitation/index.vue

@@ -86,7 +86,7 @@
 </template>
 
 <script>
-    import {postAction} from '@/api/manage'
+    import {postAction,getAction} from '@/api/manage'
     import {staffRegister} from '@/api/index'
     import {Button, Cell, CellGroup, Field, Toast, Col, Row, Dialog} from 'vant';
     import {getUrlParams} from '@/utils/util';
@@ -127,6 +127,7 @@
                 },
                 url: {
                     getSmsCaptcha: '/f/api/login/getAuthCode',
+                    getenterpriseName: '/f/api/punchClock/getEnterPriseName',
                 }
             };
         },
@@ -134,7 +135,8 @@
         created() {
             const str = decodeURIComponent(window.location.href);
             this.enterprise_id = getUrlParams(str).enterprise_id;
-            this.enterprise_name = getUrlParams(str).enterprise_name;
+            //获取企业名称
+            this.getName();
             //员工已登录,跳转员工首页
             if (getStore('staff')) {
                 setStore('role', 'staff');
@@ -238,6 +240,17 @@
             },
             join() {
                 this.$router.push({name: 'join'})
+            },
+            getName(){
+                let params = {};
+                params.enterprise_id = this.enterprise_id;
+                getAction(this.url.getenterpriseName,params)
+                    .then(data => {
+                        this.enterprise_name = data.data.dkEnterprise.enterpriseName;
+                    })
+                    .catch(() => {
+                        Toast('信息获取失败,请刷新后重试')
+                    });
             }
         }
     }