dever 4 years ago
parent
commit
d73d1d75ae
2 changed files with 28 additions and 1 deletions
  1. 27 0
      main/src/Content.php
  2. 1 1
      main/template/xuniren/inc/head.php

+ 27 - 0
main/src/Content.php

@@ -18,6 +18,33 @@ class Content
         return $data;
     }
 
+
+    # 分享js配置
+    public function share()
+    {
+        $title = '';
+        $pic = '';
+
+        
+        $ralateUid = '';
+        $appkey = '';
+        $url = Dever::url();
+        $config = Dever::load('main/content.config');
+        $share = 'config.wbshare = {
+            title: "'.$title.'",
+            url: "'.$url.'",
+            pic: "'.$pic.'",
+            ralateUid: "'.$ralateUid.'",
+            appkey: "'.$appkey.'"
+        };';
+
+
+        $share .= 'config.ins="'.$config['ins'].'"';
+
+
+        return $share;
+    }
+
     # 获取菜单
     public function menu()
     {

+ 1 - 1
main/template/xuniren/inc/head.php

@@ -70,5 +70,5 @@ $view
     )
 )
 
-->append('head',    '<script><{Dever::script()}></script>');
+->append('head',    '<script><{Dever::script()}><{Dever::load("main/content.share")}></script>');
 //->append('head',    '<script><{Dever::script()}>config.uid=<{Dever::load("passport/user.data") ? Dever::load("passport/user.data#id") : -1}></script>');