Переглянути джерело

feat:前端框架,后台功能

Zhou Jianjia 2 роки тому
батько
коміт
b055b2eaff

+ 24 - 0
mini/.gitignore

xqd
@@ -0,0 +1,24 @@
+.DS_Store
+node_modules/
+npm-debug.log*
+yarn-debug.log*
+yarn-error.log*
+**/*.log
+
+tests/**/coverage/
+tests/e2e/reports
+selenium-debug.log
+
+# Editor directories and files
+.idea
+.vscode
+*.suo
+*.ntvs*
+*.njsproj
+*.sln
+*.local
+.hbuilderx
+/unpackage
+
+package-lock.json
+yarn.lock

+ 4 - 3
mini/manifest.json

xqd xqd
@@ -1,6 +1,6 @@
 {
-    "name" : "mini",
-    "appid" : "",
+    "name" : "张四爷抖音小程序",
+    "appid" : "__UNI__1D9A013",
     "description" : "",
     "versionName" : "1.0.0",
     "versionCode" : "100",
@@ -63,7 +63,8 @@
         "usingComponents" : true
     },
     "mp-toutiao" : {
-        "usingComponents" : true
+        "usingComponents" : true,
+        "appid" : "tt5b312d8cc40f46b701"
     },
     "uniStatistics" : {
         "enable" : false

+ 1 - 1
mini/pages/index/index.vue

xqd
@@ -11,7 +11,7 @@
 	export default {
 		data() {
 			return {
-				title: 'Hello'
+				title: 'Hello1'
 			}
 		},
 		onLoad() {

+ 74 - 0
server/app/Admin/Controllers/VipComboController.php

xqd
@@ -0,0 +1,74 @@
+<?php
+
+namespace App\Admin\Controllers;
+
+use App\Admin\Repositories\VipCombo;
+use Dcat\Admin\Form;
+use Dcat\Admin\Grid;
+use Dcat\Admin\Show;
+use Dcat\Admin\Http\Controllers\AdminController;
+
+class VipComboController extends AdminController
+{
+    /**
+     * Make a grid builder.
+     *
+     * @return Grid
+     */
+    protected function grid()
+    {
+        return Grid::make(new VipCombo(), function (Grid $grid) {
+            $grid->column('id')->sortable();
+            $grid->column('name');
+            $grid->column('price');
+            $grid->column('valid_day');
+            $grid->column('desc');
+            $grid->column('created_at');
+            $grid->column('updated_at')->sortable();
+        
+            $grid->filter(function (Grid\Filter $filter) {
+                $filter->equal('id');
+        
+            });
+        });
+    }
+
+    /**
+     * Make a show builder.
+     *
+     * @param mixed $id
+     *
+     * @return Show
+     */
+    protected function detail($id)
+    {
+        return Show::make($id, new VipCombo(), function (Show $show) {
+            $show->field('id');
+            $show->field('name');
+            $show->field('price');
+            $show->field('valid_day');
+            $show->field('desc');
+            $show->field('created_at');
+            $show->field('updated_at');
+        });
+    }
+
+    /**
+     * Make a form builder.
+     *
+     * @return Form
+     */
+    protected function form()
+    {
+        return Form::make(new VipCombo(), function (Form $form) {
+            $form->display('id');
+            $form->text('name');
+            $form->text('price');
+            $form->text('valid_day');
+            $form->text('desc');
+        
+            $form->display('created_at');
+            $form->display('updated_at');
+        });
+    }
+}

+ 16 - 0
server/app/Admin/Repositories/VipCombo.php

xqd
@@ -0,0 +1,16 @@
+<?php
+
+namespace App\Admin\Repositories;
+
+use App\Models\VipCombo as Model;
+use Dcat\Admin\Repositories\EloquentRepository;
+
+class VipCombo extends EloquentRepository
+{
+    /**
+     * Model.
+     *
+     * @var string
+     */
+    protected $eloquentClass = Model::class;
+}

+ 15 - 0
server/resources/lang/zh_CN/vip-combo.php

xqd
@@ -0,0 +1,15 @@
+<?php 
+return [
+    'labels' => [
+        'VipCombo' => 'VipCombo',
+        'vip-combo' => 'VipCombo',
+    ],
+    'fields' => [
+        'name' => '名称',
+        'price' => '价格',
+        'valid_day' => '有效天数',
+        'desc' => '描述',
+    ],
+    'options' => [
+    ],
+];