zhujindu 11 月之前
父節點
當前提交
de41ebc338
共有 3 個文件被更改,包括 54 次插入33 次删除
  1. 40 31
      public/index.html
  2. 1 0
      src/main.js
  3. 13 2
      src/views/home/index.vue

+ 40 - 31
public/index.html

@@ -1,38 +1,47 @@
 <!DOCTYPE html>
 <html lang="">
-<head>
-    <meta charset="utf-8">
-    <meta http-equiv="X-UA-Compatible" content="IE=edge">
+  <head>
+    <meta charset="utf-8" />
+    <meta http-equiv="X-UA-Compatible" content="IE=edge" />
     <meta
-            name="viewport"
-            content="width=device-width, initial-scale=1.0, maximum-scale=1.0, minimum-scale=1.0, user-scalable=no"
-    />
-    <meta http-equiv="Cache-Control" content="no-cache, no-store, must-revalidate"/>
-    <link rel="icon" href="<%= BASE_URL %>favicon.ico">
+      name="viewport"
+      content="width=device-width, initial-scale=1.0, maximum-scale=1.0, minimum-scale=1.0, user-scalable=no" />
+    <meta http-equiv="Cache-Control" content="no-cache, no-store, must-revalidate" />
+    <link rel="icon" href="<%= BASE_URL %>favicon.ico" />
     <title><%= webpackConfig.name %></title>
-</head>
-<body class="bgcolor">
-<noscript>
-    <strong>We're sorry but <%= htmlWebpackPlugin.options.title %> doesn't work properly without JavaScript enabled. Please enable it to continue.</strong>
-</noscript>
-<div id="app"></div>
-<script>
-    if (GetQueryValue("loginName") != null) {
-        localStorage.removeItem('loginType')
-        localStorage.setItem('loginName', GetQueryValue("loginName"));
-        location.href=location.href.split("?")[0]+"?v="+new Date().getTime();
-    }
-    function GetQueryValue(queryName) {
+  </head>
+  <body class="bgcolor">
+    <noscript>
+      <strong
+        >We're sorry but <%= htmlWebpackPlugin.options.title %> doesn't work properly without
+        JavaScript enabled. Please enable it to continue.</strong
+      >
+    </noscript>
+    <div id="app"></div>
+    <script>
+      if (GetQueryValue('loginName') != null) {
+        localStorage.removeItem('loginType');
+        localStorage.setItem('loginName', GetQueryValue('loginName'));
+        location.href = location.href.split('?')[0] + '?v=' + new Date().getTime();
+      }
+      function GetQueryValue(queryName) {
         var query = decodeURI(window.location.search.substring(1));
-        var vars = query.split("&");
-        for (var i = 0; i < vars.length; i++) {var pair = vars[i].split("=");if (pair[0] == queryName) {return pair[1];}}
+        var vars = query.split('&');
+        for (var i = 0; i < vars.length; i++) {
+          var pair = vars[i].split('=');
+          if (pair[0] == queryName) {
+            return pair[1];
+          }
+        }
         return null;
-    }
-</script>
-<script src="//res.wx.qq.com/open/js/jweixin-1.2.0.js"></script>
-<script src="https://open.work.weixin.qq.com/wwopen/js/jwxwork-1.0.0.js"></script>
-<!--生产、uat-->
-<script charset="utf-8" src="https://map.qq.com/api/gljs?v=1.exp&libraries=service,tools&key=Y7SBZ-PI5K5-FOJIT-ILHLY-PN66T-HKB4A"></script>
-</body>
+      }
+    </script>
+    <script src="//res.wx.qq.com/open/js/jweixin-1.2.0.js"></script>
+    <script src="https://open.work.weixin.qq.com/wwopen/js/jwxwork-1.0.0.js"></script>
+    <script src="https://wwcdn.weixin.qq.com/node/open/js/wecom-jssdk-2.0.2.js"></script>
+    <!--生产、uat-->
+    <script
+      charset="utf-8"
+      src="https://map.qq.com/api/gljs?v=1.exp&libraries=service,tools&key=Y7SBZ-PI5K5-FOJIT-ILHLY-PN66T-HKB4A"></script>
+  </body>
 </html>
-

+ 1 - 0
src/main.js

@@ -49,6 +49,7 @@ Vue.prototype.CJ02BD = CJ02BD;
 Vue.prototype.gcj02BD = gcj02BD;
 Vue.prototype.twoPointSum = twoPointSum;
 Vue.prototype.wx = wx;
+Vue.prototype.ww = ww;
 Vue.prototype.parseTimeParagraph = parseTimeParagraph;
 Vue.prototype.Micrometer = Micrometer;
 Vue.prototype.verifyStoreType = verifyStoreType;

+ 13 - 2
src/views/home/index.vue

@@ -76,8 +76,19 @@ export default {
     }
   },
   created() {
-    this.wx.hideOptionMenu();
-    getTicketFun(['onMenuShareAppMessage'], 'agentConfig').then((res) => {
+    this.ww.onMenuShareAppMessage({
+      title: '企业微信',
+      desc: '让每个企业都有自己的微信',
+      link: 'https://work.weixin.qq.com/',
+      imgUrl: 'https://res.mail.qq.com/node/ww/wwmng/style/images/index_share_logo$13c64306.png',
+      success() {
+        // 用户确认分享后回调
+      },
+      cancel() {
+        // 用户取消分享后回调
+      },
+    });
+    getTicketFun(['onMenuShareAppMessage']).then((res) => {
       this.wx.ready(() => {
         console.log('this.wx.ready');
         console.log(this.wx);