小程序首页配置

This commit is contained in:
liu
2026-08-14 12:41:18 +08:00
parent 889f987f17
commit 8b3cef5af0
21 changed files with 1350 additions and 3 deletions
@@ -0,0 +1,76 @@
<?php
use Illuminate\Database\Migrations\Migration;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Support\Facades\DB;
use Illuminate\Support\Facades\Schema;
return new class extends Migration
{
/**
* Run the migrations.
* 小程序首页配置:轮播图 / 宫格导航 / 促销推荐卡片(后台维护图片、名称、跳转链接)
*/
public function up(): void
{
if (! Schema::hasTable('mini_home_banner')) {
Schema::create('mini_home_banner', function (Blueprint $table) {
$table->increments('id')->comment('轮播图ID');
$table->string('title', 50)->nullable()->comment('标题');
$table->integer('image_id')->nullable()->default(0)->comment('轮播图片(sys_file ID');
$table->string('link', 255)->nullable()->default('')->comment('小程序跳转链接(如 /pages/goods/detail?id=1');
$table->integer('sort')->default(0)->comment('排序(越小越靠前)');
$table->integer('status')->default(1)->comment('状态(1正常 0停用)');
$table->timestamps();
$table->comment('小程序首页轮播图');
});
}
if (! Schema::hasTable('mini_home_nav')) {
Schema::create('mini_home_nav', function (Blueprint $table) {
$table->increments('id')->comment('导航ID');
$table->string('name', 50)->nullable()->comment('导航名称');
$table->integer('image_id')->nullable()->default(0)->comment('导航图标(sys_file ID');
$table->string('link', 255)->nullable()->default('')->comment('小程序跳转链接');
$table->integer('sort')->default(0)->comment('排序(越小越靠前)');
$table->integer('status')->default(1)->comment('状态(1正常 0停用)');
$table->timestamps();
$table->comment('小程序首页宫格导航');
});
}
if (! Schema::hasTable('mini_home_promo')) {
Schema::create('mini_home_promo', function (Blueprint $table) {
$table->increments('id')->comment('卡片ID');
$table->string('title', 50)->nullable()->comment('卡片标题');
$table->string('sub_title', 100)->nullable()->default('')->comment('副标题/促销文案');
$table->integer('image_id')->nullable()->default(0)->comment('卡片图片(sys_file ID');
$table->string('link', 255)->nullable()->default('')->comment('小程序跳转链接');
$table->integer('sort')->default(0)->comment('排序(越小越靠前)');
$table->integer('status')->default(1)->comment('状态(1正常 0停用)');
$table->timestamps();
$table->comment('小程序首页促销推荐卡片');
});
}
// 文件分组:客户端配置图片(幂等,已有库补充分组记录)
DB::table('sys_file_group')->insertOrIgnore([
'id' => 12,
'name' => '客户端配置',
'sort' => 11,
'describe' => '小程序首页轮播图/宫格导航/促销卡片图片',
'created_at' => now(),
'updated_at' => now(),
]);
}
/**
* Reverse the migrations.
*/
public function down(): void
{
Schema::dropIfExists('mini_home_promo');
Schema::dropIfExists('mini_home_nav');
Schema::dropIfExists('mini_home_banner');
}
};
+44
View File
@@ -264,6 +264,50 @@ class PermissionSeeder extends Seeder
],
],
],
[
'type' => 'menu',
'key' => 'procurement.client',
'name' => '客户端配置',
'icon' => 'MobileOutlined',
'children' => [
[
'type' => 'route',
'key' => 'client.banner',
'name' => '首页轮播图',
'path' => '/client/banner',
'children' => [
['type' => 'rule', 'key' => 'client.banner.query', 'name' => '查询'],
['type' => 'rule', 'key' => 'client.banner.create', 'name' => '新增'],
['type' => 'rule', 'key' => 'client.banner.update', 'name' => '编辑'],
['type' => 'rule', 'key' => 'client.banner.delete', 'name' => '删除'],
],
],
[
'type' => 'route',
'key' => 'client.nav',
'name' => '宫格导航',
'path' => '/client/nav',
'children' => [
['type' => 'rule', 'key' => 'client.nav.query', 'name' => '查询'],
['type' => 'rule', 'key' => 'client.nav.create', 'name' => '新增'],
['type' => 'rule', 'key' => 'client.nav.update', 'name' => '编辑'],
['type' => 'rule', 'key' => 'client.nav.delete', 'name' => '删除'],
],
],
[
'type' => 'route',
'key' => 'client.promo',
'name' => '促销推荐卡片',
'path' => '/client/promo',
'children' => [
['type' => 'rule', 'key' => 'client.promo.query', 'name' => '查询'],
['type' => 'rule', 'key' => 'client.promo.create', 'name' => '新增'],
['type' => 'rule', 'key' => 'client.promo.update', 'name' => '编辑'],
['type' => 'rule', 'key' => 'client.promo.delete', 'name' => '删除'],
],
],
],
],
[
'type' => 'menu',
'name' => 'AI',
+1
View File
@@ -70,6 +70,7 @@ class SysDataSeeder extends Seeder
['id' => 9, 'name' => '分类图片', 'sort' => 8, 'describe' => '存放商品分类图标', 'created_at' => $date, 'updated_at' => $date],
['id' => 10, 'name' => '商品封面图片', 'sort' => 9, 'describe' => '存放商品封面图片', 'created_at' => $date, 'updated_at' => $date],
['id' => 11, 'name' => '商品详情图片', 'sort' => 10, 'describe' => '存放商品详情图片', 'created_at' => $date, 'updated_at' => $date],
['id' => 12, 'name' => '客户端配置', 'sort' => 11, 'describe' => '小程序首页轮播图/宫格导航/促销卡片图片', 'created_at' => $date, 'updated_at' => $date],
]);
}
}