dever 6 年之前
父节点
当前提交
27b2d6138c

+ 1 - 1
applet/config/wechat.php

@@ -113,7 +113,7 @@ $config['code'] = array
 		'access_token' => 'token',
 		'scene' => 'param',
 		'page' => 'path',
-		'width' => 400,
+		'width' => 'width',
 	),
 	//针对一些返回的名称,做转换
 	'response' => array

+ 2 - 1
applet/src/Code.php

@@ -16,9 +16,10 @@ class Code
         $project = Dever::input('project');
         $param['path'] = Dever::input('path', 'pages/index/index');
         $param['param'] = Dever::input('send');
+        $param['width'] = Dever::input('width', 200);
         $update = Dever::input('update', 2);
 
-        $file = Dever::pathDay('upload/applet/code', false) . $project . '_' . md5($param['path'] . '_' . $param['param']) . '.jpg';
+        $file = Dever::pathDay('upload/applet/code', false) . $project . '_' . md5($param['path'] . '_' . $param['param'] . '_' . $param['width']) . '.jpg';
 
         if (!is_file($file) || $update == 1) {
             $wechat = new Wechat($project, 'applet');

+ 33 - 5
component/applet/database/page.php

@@ -58,15 +58,15 @@ return array
 
 		'template_id'		=> array
 		(
-			'type' 		=> 'int-11',
+			'type' 		=> 'varchar-500',
 			'name' 		=> '小程序模板',
-			'default' 	=> '1',
+			'default' 	=> '',
 			'desc' 		=> '小程序模板',
-			'match' 	=> 'is_numeric',
-			'update'	=> 'select',
+			'match' 	=> 'is_string',
+			'update'	=> 'checkbox',
 			'search'	=> 'select',
 			'option'	=> $template,
-			//'list'		=> true,
+			'list'		=> true,
 		),
 
 		'pagepath'		=> array
@@ -115,10 +115,38 @@ return array
 		),
 	),
 
+	# 更新表结构
+	'alter' => array
+	(
+		2 => array
+		(
+			array('update', 'template_id', 'template_id', 'varchar-500 1 小程序模板'),
+			//array('add', 'config', 'config', 'int-11 1 配置'),
+		),
+		'version' => 2,
+	),
+
 	'top' => Dever::config('base', 'component')->top,
 
 	'manage' => array
 	(
 		
 	),
+
+	# request 请求接口定义
+	'request' => array
+	(
+		'getAll' => array
+		(
+			# 匹配的正则或函数 选填项
+			'option' => array
+			(
+				'template_id' => array('yes', 'like'),
+				'state' => 1,
+			),
+			'type' => 'all',
+			'order' => array('reorder' => 'desc', 'cdate' => 'desc'),
+			'col' => '*',
+		),
+	)
 );

+ 4 - 0
component/applet/database/tabbar.php

@@ -76,9 +76,11 @@ return array
 			'desc' 		=> '小程序模板',
 			'match' 	=> 'is_numeric',
 			'update'	=> 'select',
+			'search'	=> 'select',
 			'option'	=> $template,
 			'list'		=> true,
 			'edit'		=> true,
+			'control'	=> 'template_id',
 		),
 
 		/*
@@ -102,9 +104,11 @@ return array
 			'desc' 		=> '菜单页面',
 			'match' 	=> 'is_numeric',
 			'update'	=> 'select',
+			'search'	=> 'select',
 			'option'	=> $page,
 			'list'		=> true,
 			'edit'		=> true,
+			'show'	=> 'template_id=component/Core.getPageByTemplate?template=',
 		),
 
 		'iconpath'		=> array

+ 10 - 2
component/applet/src/Version.php

@@ -14,6 +14,14 @@ class Version extends Core
 {
 	public $table = 'component_applet/version';
 
+
+	public function getPage($id)
+	{
+		$page = Dever::db('component/page')->getAll(array('template_id' => $id));
+
+		return $page;
+	}
+	
 	public function handle($oauth, $info, $delete, $user, $wechat)
 	{
 		$template = Dever::db('component_applet/template')->one($info['template_id']);
@@ -25,9 +33,9 @@ class Version extends Core
 		$project = Dever::db('main/project')->one($info['project_id']);
 		$user = Dever::db('component/user')->one($user);
 
-		//$pageInfo = Dever::db('component_applet/page')->state(array('option_template_id' => $template['id']));
+		$pageInfo = Dever::db('component/page')->getAll(array('option_template_id' => $template['id']));
 
-		$pageInfo = Dever::db('component_applet/page')->state();
+		//$pageInfo = Dever::db('component/page')->state();
 
 		$page = array();
 

+ 7 - 0
component/src/Core.php

@@ -11,6 +11,13 @@ use Main\Lib\Wechat;
 
 class Core
 {
+	public function getPageByTemplate()
+	{
+		$template = Dever::input('template');
+    	$data = Dever::db('component_applet/page')->getAll(array('template_id' => $template));
+    	return Dever::load('manage/database')->getAjax($data);
+	}
+
 	public function update($id, $data, $param = array())
 	{
 		$delete = false;