dever hace 5 años
padre
commit
b4b0b59334

+ 5 - 4
app/collection/database/function.php

@@ -10,6 +10,7 @@ $type = array
     //'befall' 	=> '降临',
     //'music' 	=> '音乐',
     //'ranking' 	=> '排行',
+    'my'    => '我的',
 );
 
 $status = array
@@ -119,18 +120,18 @@ return array
         'width'      => array
         (
             'type'      => 'varchar-10',
-            'name'      => '页面展开的宽度',
-            'default'   => '86%',
+            'name'      => '页面展开的宽度-宽度是百分比,直接输入百分比的值,如80',
+            'default'   => '86',
             'desc'      => '页面展开的宽度',
             'match'     => 'is_string',
-            'update'    => 'text',
+            //'update'    => 'text',
         ),
 
         'direction'      => array
         (
             'type'      => 'varchar-10',
             'name'      => '页面展开方式',
-            'default'   => 'left',
+            'default'   => 'down',
             'desc'      => '页面展开方式',
             'match'     => 'is_string',
             'update'    => 'radio',

+ 16 - 5
app/collection/database/product.php

@@ -47,10 +47,10 @@ return array
         'name'      => array
         (
             'type'      => 'varchar-180',
-            'name'      => '商品标题-可以为空,不填写自动获取原商品标题',
+            'name'      => '商品标题',
             'default'   => '',
             'desc'      => '商品标题',
-            'match'     => 'option',
+            'match'     => 'is_string',
             'update'    => 'text',
             'search'    => 'fulltext',
             'list'      => true,
@@ -59,13 +59,24 @@ return array
         'pic_cover'     => array
         (
             'type'      => 'varchar-150',
-            'name'      => '商品图片-图片尺寸随意或等比尺寸,建议尺寸750*1386px,上传大小不能超过2M,支持JPG、PNG、GIF格式,建议上传JPG格式,不传则自动获取原商品图片',
+            'name'      => '商品图片-图片尺寸随意或等比尺寸,建议尺寸660*660px,上传大小不能超过2M,支持JPG、PNG、GIF格式,建议上传JPG格式',
             'default'   => '',
             'desc'      => '商品图片',
-            'match'     => 'option',
+            'match'     => 'is_string',
             'update'    => 'image',
             'key'       => '1',
-            'place'     => '750*1386',
+            'place'     => '660*660',
+        ),
+
+        'price'     => array
+        (
+            'type'      => 'varchar-50',
+            'name'      => '售价-只是用来展示,可以带上单位',
+            'default'   => '',
+            'desc'      => '售价',
+            'match'     => 'is_string',
+            'update'    => 'text',
+            'list'      => true,
         ),
 
         'reorder'       => array

+ 115 - 0
app/collection/database/user_car.php

@@ -0,0 +1,115 @@
+<?php
+
+return array
+(
+    # 表名
+    'name' => 'user_car',
+    # 显示给用户看的名称
+    'lang' => '用户购买记录',
+    'menu' => false,
+    # 数据结构
+    'struct' => array
+    (
+    
+        'id'        => array
+        (
+            'type'      => 'int-11',
+            'name'      => 'ID',
+            'default'   => '',
+            'desc'      => '',
+            'match'     => 'is_numeric',
+            'search'    => 'order',
+            'update'    => 'hidden',
+            //'list'        => true,
+        ),
+
+        'uid'       => array
+        (
+            'type'      => 'int-11',
+            'name'      => '用户名',
+            'default'   => '0',
+            'desc'      => '请选择用户',
+            'match'     => 'is_numeric',
+            'update'    => 'text',
+            //'search'  => 'select',
+            'search'    => array
+            (
+                'api' => 'passport/user-all',
+                'col' => 'username',
+                'result' => 'id',
+            ),
+            'list'      => '{uid} > 0 ? Dever::load("passport/user-one#username", {uid}) : "匿名用户"',
+        ),
+
+        'info_id'      => array
+        (
+            'type'      => 'int-11',
+            'name'      => '合集',
+            'default'   => '',
+            'desc'      => '合集',
+            'match'     => 'is_numeric',
+            'update'    => 'text',
+        ),
+
+        'product_id'      => array
+        (
+            'type'      => 'int-11',
+            'name'      => '父级章节id',
+            'default'   => '',
+            'desc'      => '章节id',
+            'match'     => 'is_numeric',
+            'update'    => 'text',
+        ),
+
+        'goods_id'      => array
+        (
+            'type'      => 'int-11',
+            'name'      => '章节id',
+            'default'   => '',
+            'desc'      => '章节id',
+            'match'     => 'is_numeric',
+            'update'    => 'text',
+        ),
+
+        'content_id'      => array
+        (
+            'type'      => 'int-11',
+            'name'      => '内容id',
+            'default'   => '',
+            'desc'      => '内容id',
+            'match'     => 'is_numeric',
+            'update'    => 'text',
+        ),
+
+        'state'     => array
+        (
+            'type'      => 'tinyint-1',
+            'name'      => '状态',
+            'default'   => '1',
+            'desc'      => '请选择状态',
+            'match'     => 'is_numeric',
+        ),
+        
+        'cdate'     => array
+        (
+            'type'      => 'int-11',
+            'name'      => '操作时间',
+            'match'     => array('is_numeric', time()),
+            'desc'      => '',
+            # 只有insert时才生效
+            //'insert'    => true,
+            'search'    => 'date',
+            'list'      => 'date("Y-m-d H:i:s", {cdate})',
+        ),
+    ),
+
+    'manage' => array
+    (
+        
+    ),
+
+    'request' => array
+    (
+        
+    ),
+);

+ 37 - 3
app/collection/src/Api.php

@@ -21,6 +21,22 @@ class Api extends Core
         return Dever::db('collection/info')->state();
     }
 
+    # 获取用户信息
+    public function getUser()
+    {
+        $data['user'] = $this->user;
+
+        $data['num'] = array
+        (
+            array('¥199', '', '钱包'),
+            array('200', '', '金币'),
+            array('10', '', '好友'),
+            array('30', '', '动态'),
+        );
+
+        return $data;
+    }
+
     # 获取合集内容
     public function getInfo()
     {
@@ -131,8 +147,20 @@ class Api extends Core
     {
         $where['info_id'] = $this->id;
         $data['product'] = Dever::db('collection/product')->getAll($where);
-        if ($data['product']) {
-            
+
+        return $data;
+    }
+
+    # 获取某一个商品详情
+    public function getProductOne()
+    {
+        $where['id'] = Dever::input('product_id');
+        $table = Dever::input('table');
+        $data['product'] = Dever::db($table)->one($where);
+
+        if ($data['product'] && isset($data['product']['goods_id']) && $data['product']['goods_id'] > 0) {
+            $data['product']['goods'] = Dever::load('goods/lib/info')->getInfo($data['product']['goods_id']);
+            $data['product']['goods'] = Dever::load('collection/lib/content')->getContent($data['product']['goods']);
         }
 
         return $data;
@@ -284,13 +312,19 @@ class Api extends Core
         $result = array();
         if ($func) {
             foreach ($func as $k => $v) {
+                $v['direction'] = strtolower($v['direction']);
+                if ($v['direction'] == 'left') {
+                    $v['width'] = '86';
+                } else {
+                    $v['width'] = '100';
+                }
                 $result[$v['type']] = array
                 (
                     'show' => false,
                     'index' => 5,
                     'top' => 0,
                     'padding' => '0rpx',
-                    'width' => $v['width'],
+                    'width' => $v['width'] . '%',
                     'direction' => strtolower($v['direction']),
                     'param' => array(),
                     'button' => array