Pārlūkot izejas kodu

Merge branch 'master' of ssh://git.9026.com:2212/xiansin/zhangsiye

xiansin 2 gadi atpakaļ
vecāks
revīzija
abdad9ed57

+ 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() {

+ 10 - 16
server/app/Admin/Controllers/EpisodesCategoryController.php

xqd xqd xqd
@@ -2,7 +2,7 @@
 
 namespace App\Admin\Controllers;
 
-use App\Admin\Repositories\EpisodesCategory;
+use App\Models\EpisodesCategory;
 use Dcat\Admin\Form;
 use Dcat\Admin\Grid;
 use Dcat\Admin\Show;
@@ -20,16 +20,11 @@ class EpisodesCategoryController extends AdminController
         return Grid::make(new EpisodesCategory(), function (Grid $grid) {
             $grid->column('id')->sortable();
             $grid->column('name');
-            $grid->column('pid');
-            $grid->column('path');
-            $grid->column('sort');
+            $grid->column('pid','父分类')->display(function () {
+                /* @var EpisodesCategory $this*/
+                return $this->parent ?$this->parent->name : '';
+            });;
             $grid->column('created_at');
-            $grid->column('updated_at')->sortable();
-        
-            $grid->filter(function (Grid\Filter $filter) {
-                $filter->equal('id');
-        
-            });
         });
     }
 
@@ -61,14 +56,13 @@ class EpisodesCategoryController extends AdminController
     protected function form()
     {
         return Form::make(new EpisodesCategory(), function (Form $form) {
+            $categoryModel = app(\App\Models\EpisodesCategory::class);
+            $options = $categoryModel::select(['id','name'])->where('pid',0)->get()->toArray();
+            array_unshift($options,['id' => 0, 'name' => '顶级分类']);
+            $options = array_column($options,'name','id');
             $form->display('id');
+            $form->select('pid')->options($options);
             $form->text('name');
-            $form->text('pid');
-            $form->text('path');
-            $form->text('sort');
-        
-            $form->display('created_at');
-            $form->display('updated_at');
         });
     }
 }

+ 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');
+        });
+    }
+}

+ 2 - 0
server/app/Admin/Repositories/EpisodesCategory.php

xqd
@@ -13,4 +13,6 @@ class EpisodesCategory extends EloquentRepository
      * @var string
      */
     protected $eloquentClass = Model::class;
+
+
 }

+ 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;
+}

+ 34 - 1
server/app/Models/EpisodesCategory.php

xqd
@@ -6,11 +6,44 @@ use Dcat\Admin\Traits\HasDateTimeFormatter;
 use Illuminate\Database\Eloquent\SoftDeletes;
 use Illuminate\Database\Eloquent\Model;
 
+/**
+ * App\Models\EpisodesCategory
+ *
+ * @property int $id
+ * @property string $name 名称
+ * @property int $pid 父id
+ * @property string|null $path 路径
+ * @property int $sort 排序越大越靠前
+ * @property \Illuminate\Support\Carbon|null $updated_at
+ * @property \Illuminate\Support\Carbon|null $deleted_at
+ * @property \Illuminate\Support\Carbon|null $created_at
+ * @method static \Illuminate\Database\Eloquent\Builder|EpisodesCategory newModelQuery()
+ * @method static \Illuminate\Database\Eloquent\Builder|EpisodesCategory newQuery()
+ * @method static \Illuminate\Database\Query\Builder|EpisodesCategory onlyTrashed()
+ * @method static \Illuminate\Database\Eloquent\Builder|EpisodesCategory query()
+ * @method static \Illuminate\Database\Eloquent\Builder|EpisodesCategory whereCreatedAt($value)
+ * @method static \Illuminate\Database\Eloquent\Builder|EpisodesCategory whereDeletedAt($value)
+ * @method static \Illuminate\Database\Eloquent\Builder|EpisodesCategory whereId($value)
+ * @method static \Illuminate\Database\Eloquent\Builder|EpisodesCategory whereName($value)
+ * @method static \Illuminate\Database\Eloquent\Builder|EpisodesCategory wherePath($value)
+ * @method static \Illuminate\Database\Eloquent\Builder|EpisodesCategory wherePid($value)
+ * @method static \Illuminate\Database\Eloquent\Builder|EpisodesCategory whereSort($value)
+ * @method static \Illuminate\Database\Eloquent\Builder|EpisodesCategory whereUpdatedAt($value)
+ * @method static \Illuminate\Database\Query\Builder|EpisodesCategory withTrashed()
+ * @method static \Illuminate\Database\Query\Builder|EpisodesCategory withoutTrashed()
+ * @mixin \Eloquent
+ * @property-read EpisodesCategory|null $parent
+ */
 class EpisodesCategory extends Model
 {
 	use HasDateTimeFormatter;
     use SoftDeletes;
 
     protected $table = 'episodes_category';
-    
+
+
+    public function parent()
+    {
+        return $this->belongsTo(EpisodesCategory::class,'pid','id');
+    }
 }

+ 1 - 1
server/config/app.php

xqd
@@ -83,7 +83,7 @@ return [
     */
 
     'locale' => env('APP_LOCALE', 'en'),
-    'locales' => ['cn', 'en', 'zh-CN', 'zh_CN', 'zh_TW'],  //包含的语言种类
+    //'locales' => ['cn', 'en', 'zh','zh-CN', 'zh_CN', 'zh_TW'],  //包含的语言种类
 
     /*
     |--------------------------------------------------------------------------

+ 20 - 0
server/resources/lang/zh/episode.php

xqd
@@ -0,0 +1,20 @@
+<?php
+return [
+    'labels' => [
+        'Episode' => '剧集',
+        'episode' => '剧集',
+    ],
+    'fields' => [
+        'name' => '名称',
+        'cover_img' => '名称',
+        'status' => '状态', //  0-更新中 1-已完结
+        'is_opend' => '上架状态', //  0-下架 1-上架
+        'sort' => '排序',
+        'is_vip_watch' => '是否限定VIP观看',
+        'free_episodes' => '免费集数',
+        'paid_episodes' => '付费集数',
+        'episodes_price' => '单集价格设置',
+    ],
+    'options' => [
+    ],
+];

+ 16 - 0
server/resources/lang/zh/episodes-category.php

xqd
@@ -0,0 +1,16 @@
+<?php
+return [
+    'labels' => [
+        'EpisodesCategory' => '剧集分类',
+        'episodes' => '剧集',
+        'category' => '分类',
+    ],
+    'fields' => [
+        'name' => '名称',
+        'pid' => '父分类',
+        'path' => '路径',
+        'sort' => '排序越大越靠前',
+    ],
+    'options' => [
+    ],
+];

+ 17 - 0
server/resources/lang/zh/user-consume-record.php

xqd
@@ -0,0 +1,17 @@
+<?php 
+return [
+    'labels' => [
+        'UserConsumeRecord' => 'UserConsumeRecord',
+        'user-consume-record' => 'UserConsumeRecord',
+    ],
+    'fields' => [
+        'user_id' => 'user_id',
+        'before' => '消费后记录',
+        'change' => '消费金币',
+        'current' => '消费后金币',
+        'remark' => '备注',
+        'order_id' => '订单',
+    ],
+    'options' => [
+    ],
+];

+ 16 - 0
server/resources/lang/zh/user-episodes-record.php

xqd
@@ -0,0 +1,16 @@
+<?php 
+return [
+    'labels' => [
+        'UserEpisodesRecord' => 'UserEpisodesRecord',
+        'user-episodes-record' => 'UserEpisodesRecord',
+    ],
+    'fields' => [
+        'user_id' => 'user_id',
+        'episodes_id' => '剧集ID',
+        'list_id' => '具体多少集集ID',
+        'price' => '支付金额 1:1 金币',
+        'discount' => '折扣金币',
+    ],
+    'options' => [
+    ],
+];

+ 16 - 0
server/resources/lang/zh/user-recharge-record.php

xqd
@@ -0,0 +1,16 @@
+<?php 
+return [
+    'labels' => [
+        'UserRechargeRecord' => 'UserRechargeRecord',
+        'user-recharge-record' => 'UserRechargeRecord',
+    ],
+    'fields' => [
+        'user_id' => 'user_id',
+        'combo_id' => '套餐ID',
+        'price' => '支付金额 1:1 金币',
+        'gift' => '赠送金币',
+        'pay_id' => '支付ID',
+    ],
+    'options' => [
+    ],
+];

+ 21 - 0
server/resources/lang/zh/user.php

xqd
@@ -0,0 +1,21 @@
+<?php 
+return [
+    'labels' => [
+        'User' => 'User',
+        'user' => 'User',
+    ],
+    'fields' => [
+        'nickname' => 'nickname',
+        'avatar' => 'avatar',
+        'password' => 'password',
+        'email' => 'email',
+        'mobile' => 'mobile',
+        'open_id' => 'open_id',
+        'union_id' => 'union_id',
+        'status' => 'status',
+        'email_verified_at' => 'email_verified_at',
+        'remember_token' => 'remember_token',
+    ],
+    'options' => [
+    ],
+];

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

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

+ 97 - 0
server/resources/lang/zh_CN/api.php

xqd
@@ -0,0 +1,97 @@
+<?php
+
+return [
+
+    /*
+    |--------------------------------------------------------------------------
+    | Api Language Lines
+    |--------------------------------------------------------------------------
+    */
+
+    'SUCCESS' => '操作成功',
+    'FAIL' => '操作失败',
+    'UPLOAD_SUCCESS' => '上传成功',
+    'REQUESTS_TOO_FREQUENTLY' => '请求太频繁',
+    'NOT_LOGIN' => '用户未登录',
+    'NOT_EXIST' => '用户不存在',
+    'PARAMS_ERROR' => '参数异常',
+    'SAVE_ERROR' => '保存失败',
+    'FEED_NOT_EXIST' => '动态不存在',
+    'COMMENT_NOT_EXIST' => '评论不存在',
+    'USER_NOT_EXIST' => '用户不存在',
+    'CONTENT_NOT_NULL' => '内容不能为空',
+    'WECHAT_CONFIG_LACK' => '微信参数未配置',
+    'GET_OPENID_FALSE' => 'openId获取失败',
+    'REGISTER_FALSE' => '注册失败',
+    'REGISTER_CONFIRM_FALSE' => '用户验证失败',
+    'DATA_SAVE_FALSE' => '数据保存失败',
+    'MODULE_IS_NOT_USE' => '模块未安装,请检查后台配置',
+    'CONFIGURE_SMS_TEMPLATE' => '请先配置短信模板',
+    'SMS_AUTH_FAILED' => '短信授权错误',
+    'SMS_RETURN_ERROR' => '短信返回错误',
+    'NEED_CONFIGURE' => '请先至后台配置',
+    'USER_IN_BLACK_LIST' => '用户被拉入黑名单',
+    'USER_NO_AUTH' => '用户无权限',
+    'CONFIG_ALI_PRODUCT_KEY_NEED' => '请在后台配置阿里云物联网产品key',
+    'DEVICE_NOT_FOUND' => '设备不存在',
+    'DEVICE_INFO_ERROR' => '设备信息异常',
+    'DEVICE_NORMAL_ERROR' => '设备故障请联系客服!',
+    'ORDER_CREATE_ERROR' => '订单创建失败',
+    'RECHARGE_WECHAT_FAILURE' => '微信充值创建订单失败',
+    'DATA_NOT_FOUND' => '数据不存在',
+    'CASH_NEED_CONFIG' => '请先填写提现配置',
+    'CASH_METHOD_NOT_ALLOW' => '无效的提现方式',
+    'CASH_MONEY_FEW' => '提现金额必须大于最小设置金额',
+    'CASH_TIMES_OUT' => '当日提现次数达到上限',
+    'CASH_MONEY_NO_ENOUGH' => '余额不足',
+    'DATA_DECODE_FAILURE' => '解密失败',
+    'MOBILE_CODE_FALSE' => '请先获取验证码',
+    'VERIFY_CODE_FALSE' => '验证码错误',
+    'SESSION_KEY_INVALID' => 'sessionKey无效',
+    'ILLEGAL_OPERATION' => '非法操作',
+    'USER_IDENTIFY_NOT_ALLOW' => '请先通过身份审核!',
+    'USER_FREEZE_ERROR' => '用户被冻结!',
+    'USER_IS_APPLY' => '用户加盟审核中!',
+    'USER_ACCOUNT_NOT_ENOUGH' => '用户余额不足!',
+    'DEVICE_NET_ERROR' => '设备无网络!',
+    'USER_TRANSPORT_NO_AUTH' => '用户无收运权限!',
+    'CASH_MONEY_MAX' => '系统当日提现金额达到上限!',
+    'MOBILE_HAD_EXIST' => '该手机号已被使用!',
+    'MOBILE_NO_REGISTER' => '手机号未注册',
+    'PASSWORD_ERROR' => '密码错误',
+    'EMAIL_NO_BIND'  => '请先绑定邮箱才可以解绑手机',
+    'MOBILE_NO_BIND' => '请先绑定手机才可以解绑邮箱',
+    'USER_HAD_JOIN'  => '用户已申请或已加入',
+    'PASSWORD_NOT_SET'  => '您尚未设置密码',
+    'APPLY_ADD_FRIEND'  => '申请添加你为好友',
+    'ALREADY_FRIEND'  => '已经是好友',
+    'OPPOSITE_ACCOUNT_ERROR'  => '对方账户错误',
+    'ADD_FRIEND_ERROR'  => '添加好友失败',
+    'NOT_ON_YOUR_BLACKLIST'  => '对方不在你的黑名单中',
+    'YOU_CANT_BLACK_YOURSELF'  => '不能拉黑自己',
+    'GROUP_CHAT_DOES_NOT_EXIST'  => '群聊不存在',
+    'GROUP_NAME_NOT_NULL'  => '群名称不能为空',
+    'TENCENT_IM_USER_ID_NULL'  => '用户 tencent_im_user_id 不存在',
+    'UNAUTHORIZED_OPERATION'  => '无权操作',
+
+    'ATTACHMENT_UPLOAD_INVALID'=>'文件上传失败',
+    'ATTACHMENT_SAVE_ERROR'=>'文件保存失败',
+    'ATTACHMENT_MAKE_FOLDER_ERROR'=>'文件夹创建失败',
+    'ATTACHMENT_TYPE_ERROR'=>'文件类型错误',
+    'ATTACHMENT_SIZE_EXCEEDED'=>'文件大小超出',
+    'ATTACHMENT_FILE_NULL'=>'请上传文件',
+
+    'PLEASE_ENTER_MOBILE_PHONE_NUMBER'=>'请输入手机号',
+    'MOBILE_PHONE_NUMBER_FORMAT_ERROR'=>'手机号码格式错误',
+    'VERIFICATION_CODE_NOT_NULL'=>'验证码必须',
+    'TYPE_NOT_NULL'=>'类型必须',
+    'KEY_NOT_NULL'=>'密钥必须',
+    'PLEASE_ENTER_EMAIL'=>'请输入邮箱',
+    'MAILBOX_FORMAT_ERROR'=>'邮箱格式错误',
+    'VERIFICATION_CODE_ERROR' => '验证码错误',
+    'MAILBOX_VALIDATION_NOTIFICATION' => '邮箱验证通知',
+    'VERIFICATION_CODE_THIS_TIME' => '您本次的验证码是',
+    'VALID_FOR_5_MINUTES' => '有效期 5 分钟',
+    'HAS_BIND_WEIXIN' => '该账户已经绑定了微信',
+    'HAS_BIND_FACEBOOK' => '该账户已经绑定了facebook',
+];

+ 2 - 1
server/resources/lang/zh_CN/episodes-category.php

xqd
@@ -1,5 +1,6 @@
-<?php 
+<?php
 return [
+    'title' => '剧集分类',
     'labels' => [
         'EpisodesCategory' => 'EpisodesCategory',
         'episodes-category' => 'EpisodesCategory',

+ 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' => [
+    ],
+];