dever 6 years ago
parent
commit
d95e2d8ade
4 changed files with 39 additions and 13 deletions
  1. 25 3
      product/database/info.php
  2. 4 1
      product/database/order.php
  3. 8 7
      product/src/Api.php
  4. 2 2
      product/src/Base.php

+ 25 - 3
product/database/info.php

@@ -1,4 +1,15 @@
 <?php
+
+$share = function()
+{
+	$array = array();
+	$info = Dever::load('poster/template-state');
+	if($info)
+	{
+		$array += $info;
+	}
+	return $array;
+};
 return array
 (
 	# 表名
@@ -89,15 +100,26 @@ return array
 		'focus'		=> array
 		(
 			'type' 		=> 'text-255',
-			'name' 		=> '产品轮播图-可为空,图片大小:750px*390px',
+			'name' 		=> '产品焦点图',
 			'default' 	=> '',
-			'desc' 		=> '产品轮播图',
+			'desc' 		=> '产品焦点图',
 			'match' 	=> 'option',
-			'update'	=> 'images',
+			//'update'	=> 'images',
 			'key' 		=> '1',
 			'place'		=> '150',
 		),
 
+		'share'		=> array
+		(
+			'type' 		=> 'text-255',
+			'name' 		=> '产品分享海报',
+			'default' 	=> '',
+			'desc' 		=> '产品分享海报',
+			'match' 	=> 'option',
+			'update'	=> 'checkbox',
+			'option'	=> $share,
+		),
+
 		/*
 		'share_pic'		=> array
 		(

+ 4 - 1
product/database/order.php

@@ -256,7 +256,10 @@ return array
 		'edit' => false,
 		'insert' => false,
 
-		'edit' => array('发货', 'fastatus,order_id,status_desc', '{status} > 1'),
+		'list_button' => array
+		(
+			'edit' => array('发货', 'fastatus,order_id,fa_desc', '{status} > 1'),
+		)
 	),
 
 	'request' => array

+ 8 - 7
product/src/Api.php

@@ -54,27 +54,28 @@ class Api extends Base
     }
 
     # 海报
-    public function  poster() {
+    public function poster() 
+    {
         $id = Dever::input('product_id');
         $template = Dever::input('template', 'share');
         $path = Dever::input('path', 'template/home/index');
         $info = Dever::db('product/info')->one($id);
-        //文件名
-        $filename = $this->data['uid'] . ',' . $id;
+        $scene = $this->data['uid'] . ',' . $id;
 
         $send['project'] = Dever::input('project', 1);
-        $send['send'] = $filename;
+        $send['send'] = $scene;
         $send['width'] = 152;
         $send['path'] = $path;
-        $logo = Dever::load('wechat_applet/code.get', $send);
+        //$logo = Dever::load('wechat_applet/code.get', $send);
 
         $model = array
         (
             //'pic' => Dever::local($info['pic']),
             //'name' => $info['name'],
-            'logo' => Dever::local($logo),
+            //'logo' => Dever::local($logo),
         );
-        $img = Dever::load('poster/api')->get($filename, $template, $model);
+        $template = $info['share'];
+        $img = Dever::load('poster/api')->get($scene, $template, $model);
         return $img;
     }
 

+ 2 - 2
product/src/Base.php

@@ -9,8 +9,8 @@ class Base
     public function __construct()
     {
     	# 获取用户信息
-        $this->data['uid'] = Dever::load('passport/applet')->check();
-        //$this->data['uid'] = 1;
+        //$this->data['uid'] = Dever::load('passport/applet')->check();
+        $this->data['uid'] = 1;
 
         # 获取基本配置
         $this->data['config'] = Dever::db('main/config')->one();