|
@@ -18,6 +18,64 @@ class Content
|
|
|
return $data;
|
|
|
}
|
|
|
|
|
|
+
|
|
|
+
|
|
|
+ public function share()
|
|
|
+ {
|
|
|
+ $title = '';
|
|
|
+ $pic = '';
|
|
|
+
|
|
|
+ $uri = Uri::$value;
|
|
|
+
|
|
|
+ $id = Dever::input('id');
|
|
|
+ $config = Dever::load('main/content.config');
|
|
|
+ if ($id) {
|
|
|
+ if ($uri == 'xnr-detail') {
|
|
|
+ $data = Dever::db('content/xuniren')->one($id);
|
|
|
+ } elseif ($uri == 'zwz-detail') {
|
|
|
+ $data = Dever::db('content/creater')->one($id);
|
|
|
+ $data['pic'] = $data['logo'];
|
|
|
+ } else {
|
|
|
+ $data = Dever::db('content/news')->one($id);
|
|
|
+ }
|
|
|
+
|
|
|
+ if (isset($data['share_title']) && $data['share_title']) {
|
|
|
+ $title = $data['share_title'];
|
|
|
+ } else {
|
|
|
+ $title = $data['name'];
|
|
|
+ }
|
|
|
+
|
|
|
+ if (isset($data['share_pic']) && $data['share_pic']) {
|
|
|
+ $pic = $data['share_pic'];
|
|
|
+ } else {
|
|
|
+ $pic = $data['pic'];
|
|
|
+ }
|
|
|
+ } else {
|
|
|
+ $title = $config['name'];
|
|
|
+ $pic = $config['logo'];
|
|
|
+ }
|
|
|
+
|
|
|
+
|
|
|
+ $ralateUid = '';
|
|
|
+ $appkey = '';
|
|
|
+ $url = Dever::url();
|
|
|
+
|
|
|
+ $share = 'config.wbshare = {
|
|
|
+ title: "'.$title.'",
|
|
|
+ url: "'.$url.'",
|
|
|
+ pic: "'.$pic.'",
|
|
|
+ ralateUid: "'.$ralateUid.'",
|
|
|
+ appkey: "'.$appkey.'"
|
|
|
+ }';
|
|
|
+
|
|
|
+
|
|
|
+ $share .= ';config.ins="'.$config['ins'].'"';
|
|
|
+ $share .= ';config.douyin="'.$config['douyin_qrcode'].'"';
|
|
|
+ $share .= ';config.bili="'.$config['bilibili'].'"';
|
|
|
+
|
|
|
+ return $share;
|
|
|
+ }
|
|
|
+
|
|
|
|
|
|
public function menu()
|
|
|
{
|