From ac10986a65a16885e040e2ab123ddd5c04626cc0 Mon Sep 17 00:00:00 2001 From: wuhui_zzw <1760308791@qq.com> Date: Tue, 26 Sep 2023 15:21:31 +0800 Subject: [PATCH] =?UTF-8?q?=E6=B7=BB=E5=8A=A0=EF=BC=9A=E8=A7=86=E9=A2=91?= =?UTF-8?q?=E5=88=86=E4=BA=AB=E6=8F=92=E4=BB=B6?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- plugins/video-share/README.md | 1 + plugins/video-share/assets/css/comment.css | 101 ++ plugins/video-share/assets/css/index.css | 383 ++++ plugins/video-share/callbacks.php | 7 + ..._create_ims_yz_video_share_goods_table.php | 64 + ..._create_ims_yz_video_share_bonus_table.php | 60 + ...eate_ims_yz_video_share_like_log_table.php | 48 + ...umns_to_ims_yz_video_share_goods_table.php | 37 + ...umns_to_ims_yz_video_share_bonus_table.php | 38 + ...name_to_ims_yz_video_share_goods_table.php | 36 + ..._ims_yz_video_share_watch_record_table.php | 43 + ..._104255_create_yz_video_share_category.php | 41 + ...4_add_category_to_yz_video_share_goods.php | 40 + ...10_105651_create_yz_video_share_follow.php | 40 + ...reate_ims_yz_video_share_comment_table.php | 49 + ...ate_ims_yz_video_comment_support_table.php | 40 + ...ims_yz_video_share_goods_table20210817.php | 37 + ...ate_yz_video_share_goods_table20220124.php | 37 + ...deo_share_goods_add_column_yz_goods_id.php | 37 + plugins/video-share/package.json | 11 + plugins/video-share/src/PluginApplication.php | 581 ++++++ .../video-share/src/admin/BonusController.php | 89 + .../src/admin/CategoryController.php | 124 ++ .../src/admin/CenterController.php | 297 ++++ .../video-share/src/admin/SetController.php | 212 +++ .../src/admin/UploadController.php | 437 +++++ .../src/admin/VideoCommentsController.php | 159 ++ .../src/admin/VideoGoodsController.php | 320 ++++ .../video-share/src/admin/withdrawWidget.php | 19 + .../src/common/events/VideoPublishEvent.php | 22 + .../src/common/events/VideoWatchEvent.php | 29 + .../src/common/job/AllImportJob.php | 146 ++ .../common/listeners/OrderCreatedListener.php | 94 + .../common/listeners/OrderReceiveListener.php | 60 + .../common/listeners/VideoPublishListener.php | 26 + .../common/member/MemberCenterVideoShare.php | 41 + .../member/StoreMemberCenterVideoShare.php | 92 + .../video-share/src/common/model/Bonus.php | 115 ++ .../src/common/model/CategoryModel.php | 25 + .../video-share/src/common/model/Comment.php | 158 ++ .../video-share/src/common/model/Follow.php | 15 + .../video-share/src/common/model/Goods.php | 15 + .../video-share/src/common/model/LikeLog.php | 23 + .../video-share/src/common/model/Support.php | 17 + .../src/common/model/VideoShareGoods.php | 129 ++ .../common/model/VideoShareWatchRecord.php | 18 + .../src/common/pipe/GoodsCategoryProcess.php | 123 ++ .../common/service/CloudRequestService.php | 109 ++ .../src/common/service/GoodsImportService.php | 22 + .../src/common/service/IncomePageService.php | 149 ++ .../common/service/MemberCenterService.php | 49 + .../src/common/service/PermissionService.php | 122 ++ .../src/common/service/ShopService.php | 20 + .../common/service/TimedTaskImportService.php | 142 ++ .../src/common/service/TimedTaskService.php | 92 + .../src/common/service/YzGoodsService.php | 81 + .../src/frontend/BonusController.php | 87 + .../src/frontend/CommentController.php | 329 ++++ .../src/frontend/GoodsController.php | 96 + .../src/frontend/PermissionController.php | 29 + .../src/frontend/SetController.php | 78 + .../src/frontend/UploadController.php | 144 ++ .../src/frontend/VideoController.php | 584 ++++++ .../src/widgets/WithdrawWidget.php | 16 + .../video-share/views/bonus/list.blade.php | 190 ++ .../video-share/views/category/edit.blade.php | 122 ++ .../video-share/views/category/list.blade.php | 181 ++ .../video-share/views/center/index.blade.php | 1456 +++++++++++++++ .../comments/comments-category.blade.php | 141 ++ .../views/comments/view-comments.blade.php | 145 ++ .../views/componemts/videoCard.blade.php | 214 +++ plugins/video-share/views/set/index.blade.php | 1560 +++++++++++++++++ .../views/videoGoods/image.blade.php | 62 + .../views/videoGoods/list.blade.php | 601 +++++++ .../video-share/views/widget/set.blade.php | 61 + .../views/withdraw/index.blade.php | 61 + 76 files changed, 11479 insertions(+) create mode 100644 plugins/video-share/README.md create mode 100644 plugins/video-share/assets/css/comment.css create mode 100644 plugins/video-share/assets/css/index.css create mode 100644 plugins/video-share/callbacks.php create mode 100644 plugins/video-share/migrations/2019_07_20_222311_create_ims_yz_video_share_goods_table.php create mode 100644 plugins/video-share/migrations/2019_07_20_222313_create_ims_yz_video_share_bonus_table.php create mode 100644 plugins/video-share/migrations/2019_07_21_135433_create_ims_yz_video_share_like_log_table.php create mode 100644 plugins/video-share/migrations/2019_07_22_135434_add_columns_to_ims_yz_video_share_goods_table.php create mode 100644 plugins/video-share/migrations/2019_07_22_135435_add_columns_to_ims_yz_video_share_bonus_table.php create mode 100644 plugins/video-share/migrations/2019_12_23_160023_add_file_name_to_ims_yz_video_share_goods_table.php create mode 100644 plugins/video-share/migrations/2020_12_29_164305_create_ims_yz_video_share_watch_record_table.php create mode 100644 plugins/video-share/migrations/2021_04_12_104255_create_yz_video_share_category.php create mode 100644 plugins/video-share/migrations/2021_04_12_142244_add_category_to_yz_video_share_goods.php create mode 100644 plugins/video-share/migrations/2021_05_10_105651_create_yz_video_share_follow.php create mode 100644 plugins/video-share/migrations/2021_07_27_123426_create_ims_yz_video_share_comment_table.php create mode 100644 plugins/video-share/migrations/2021_07_28_092245_create_ims_yz_video_comment_support_table.php create mode 100644 plugins/video-share/migrations/2021_08_17_174637_update_ims_yz_video_share_goods_table20210817.php create mode 100644 plugins/video-share/migrations/2022_01_24_142507_update_yz_video_share_goods_table20220124.php create mode 100644 plugins/video-share/migrations/2023_04_27_161621_alter_table_yz_video_share_goods_add_column_yz_goods_id.php create mode 100644 plugins/video-share/package.json create mode 100644 plugins/video-share/src/PluginApplication.php create mode 100644 plugins/video-share/src/admin/BonusController.php create mode 100644 plugins/video-share/src/admin/CategoryController.php create mode 100644 plugins/video-share/src/admin/CenterController.php create mode 100644 plugins/video-share/src/admin/SetController.php create mode 100644 plugins/video-share/src/admin/UploadController.php create mode 100644 plugins/video-share/src/admin/VideoCommentsController.php create mode 100644 plugins/video-share/src/admin/VideoGoodsController.php create mode 100644 plugins/video-share/src/admin/withdrawWidget.php create mode 100644 plugins/video-share/src/common/events/VideoPublishEvent.php create mode 100644 plugins/video-share/src/common/events/VideoWatchEvent.php create mode 100644 plugins/video-share/src/common/job/AllImportJob.php create mode 100644 plugins/video-share/src/common/listeners/OrderCreatedListener.php create mode 100644 plugins/video-share/src/common/listeners/OrderReceiveListener.php create mode 100644 plugins/video-share/src/common/listeners/VideoPublishListener.php create mode 100644 plugins/video-share/src/common/member/MemberCenterVideoShare.php create mode 100644 plugins/video-share/src/common/member/StoreMemberCenterVideoShare.php create mode 100644 plugins/video-share/src/common/model/Bonus.php create mode 100644 plugins/video-share/src/common/model/CategoryModel.php create mode 100644 plugins/video-share/src/common/model/Comment.php create mode 100644 plugins/video-share/src/common/model/Follow.php create mode 100644 plugins/video-share/src/common/model/Goods.php create mode 100644 plugins/video-share/src/common/model/LikeLog.php create mode 100644 plugins/video-share/src/common/model/Support.php create mode 100644 plugins/video-share/src/common/model/VideoShareGoods.php create mode 100644 plugins/video-share/src/common/model/VideoShareWatchRecord.php create mode 100644 plugins/video-share/src/common/pipe/GoodsCategoryProcess.php create mode 100644 plugins/video-share/src/common/service/CloudRequestService.php create mode 100644 plugins/video-share/src/common/service/GoodsImportService.php create mode 100644 plugins/video-share/src/common/service/IncomePageService.php create mode 100644 plugins/video-share/src/common/service/MemberCenterService.php create mode 100644 plugins/video-share/src/common/service/PermissionService.php create mode 100644 plugins/video-share/src/common/service/ShopService.php create mode 100644 plugins/video-share/src/common/service/TimedTaskImportService.php create mode 100644 plugins/video-share/src/common/service/TimedTaskService.php create mode 100644 plugins/video-share/src/common/service/YzGoodsService.php create mode 100644 plugins/video-share/src/frontend/BonusController.php create mode 100644 plugins/video-share/src/frontend/CommentController.php create mode 100644 plugins/video-share/src/frontend/GoodsController.php create mode 100644 plugins/video-share/src/frontend/PermissionController.php create mode 100644 plugins/video-share/src/frontend/SetController.php create mode 100644 plugins/video-share/src/frontend/UploadController.php create mode 100644 plugins/video-share/src/frontend/VideoController.php create mode 100644 plugins/video-share/src/widgets/WithdrawWidget.php create mode 100644 plugins/video-share/views/bonus/list.blade.php create mode 100644 plugins/video-share/views/category/edit.blade.php create mode 100644 plugins/video-share/views/category/list.blade.php create mode 100644 plugins/video-share/views/center/index.blade.php create mode 100644 plugins/video-share/views/comments/comments-category.blade.php create mode 100644 plugins/video-share/views/comments/view-comments.blade.php create mode 100644 plugins/video-share/views/componemts/videoCard.blade.php create mode 100644 plugins/video-share/views/set/index.blade.php create mode 100644 plugins/video-share/views/videoGoods/image.blade.php create mode 100644 plugins/video-share/views/videoGoods/list.blade.php create mode 100644 plugins/video-share/views/widget/set.blade.php create mode 100644 plugins/video-share/views/withdraw/index.blade.php diff --git a/plugins/video-share/README.md b/plugins/video-share/README.md new file mode 100644 index 00000000..cdb8d0e6 --- /dev/null +++ b/plugins/video-share/README.md @@ -0,0 +1 @@ +init \ No newline at end of file diff --git a/plugins/video-share/assets/css/comment.css b/plugins/video-share/assets/css/comment.css new file mode 100644 index 00000000..46bbb718 --- /dev/null +++ b/plugins/video-share/assets/css/comment.css @@ -0,0 +1,101 @@ + +#app { + margin-bottom: 60px; +} + +.vue-page { + border-radius: 5px; + width: calc(100% - 266px); + float: right; + margin-right: 10px; + position: fixed; + bottom: 0; + right: 0; + padding: 15px 5% 15px 0; + background: #fff; + height: 60px; + z-index: 999; + margin-top: 0; + box-shadow: 0 2px 9px rgba(51, 51, 51, 0.1); +} + +.commit-title { + padding: 15px 0; + padding-bottom: 10px; + line-height: 30px; + border-bottom: solid 1px #eee; + color: #333; + margin-bottom: 25px; +} + +.video-style { + height: 60px; + width: 60px; + object-fit: fill; + border-radius: inherit; +} + +.img-style { + width: 50px; + height: 50px; + border-radius: 50%; +} + +.space-li { + color: #ff9b45; + margin-left: 20px; + cursor: pointer; +} + +.commit-title .el-button { + margin-left: 20px; +} + +.commit-box { + margin: 0 0 100px 80px; +} + +.commit-box .commit-detail .parent-text , .son-text { + display: flex; + margin-bottom: 10px; +} + +.son-text { + margin: 20px 50px; +} + +img { + height: 40px; + width: 40px; + border-radius: 50%; +} + +.right-text { + margin-left: 10px; +} + +.member-detail .el-icon-delete { + margin-left: 30px; +} + +.time { + margin: 5px 0; +} + +.color-bg { + color: #a4a4a4; + font-weight: 500; +} + +.stow { + margin: 10px 0; + cursor: pointer; +} + +.replay-name { + color: #3C4858; +} + +.parent-content { + margin-right: 40px; +} \ No newline at end of file diff --git a/plugins/video-share/assets/css/index.css b/plugins/video-share/assets/css/index.css new file mode 100644 index 00000000..9d47a8b6 --- /dev/null +++ b/plugins/video-share/assets/css/index.css @@ -0,0 +1,383 @@ +.main-panel > .content { + padding: 0; +} +.main-panel { + margin-top: 42px; +} +#app { + padding-bottom: 40px; +} +.rightlist #app .rightlist-head { + line-height: 50px; + padding: 0 0 15px 0; +} +.rightlist { + background: #eff3f6; + margin-top: 10px; + margin-bottom: 20px; + padding-bottom: 20px; +} + +.form-list { + padding-top: 30px; + background: #fff; + border-radius: 10px; + position: relative; + top: 10px; + margin-left: 10px; + width: calc(100% - 20px); +} +.table-list { + padding-top: 30px; + background: #fff; + border-radius: 10px; + margin-top: 20px; + margin-left: 10px; + width: calc(100% - 20px); +} +.table-option a { + font-size: 12px; + font-weight: 600; + color: #29ba9c; + padding: 10px 0; +} +/* .el-form-item__label{padding-right:30px;} */ +.tip { + font-size: 12px; + color: #999; + font-weight: 500; + line-height: 24px; +} +.rightlist-head-con { + padding-right: 20px; + font-size: 16px; + color: #888; +} +.el-tag { + /* font-weight: 700; + font-size: 15px; + margin-bottom: 30px; */ +} +/* 单选框边框颜色 */ +.el-radio__inner { + border: 1px solid #eff3f6; +} +.el-icon-edit { + font-size: 16px; + padding: 0 15px; + color: #409eff; + cursor: pointer; +} +/* 滑块选择小白点 */ +.el-switch.is-checked .el-switch__core::after { + left: 100%; + margin-left: -17px; +} +.el-switch__core::after { + content: ""; + position: absolute; + top: 1px; + left: 1px; + border-radius: 100%; + transition: all 0.3s; + width: 16px; + height: 16px; + background-color: #fff; +} + +.el-checkbox__label { + display: inline-block; + padding-left: 3px; +} +.el-checkbox.is-bordered + .el-checkbox.is-bordered { + margin-left: 0px; +} + +.vue-page { + border-radius: 5px; + width: calc(100% - 266px); + float: right; + margin-right: 10px; + position: fixed; + bottom: 0; + right: 0; + padding: 15px 5% 15px 0; + background: #fff; + height: 60px; + z-index: 999; + margin-top: 0; + box-shadow: 0 2px 9px rgba(51, 51, 51, 0.1); +} +.vue-center { + text-align: center; +} +.loading-height { + height: 500px; +} +.el-checkbox.is-bordered.el-checkbox--mini { + margin: 0 0; +} +[v-cloak] { + display: none; +} + +.all { + background: #eff3f6; + min-height: 100vh; + padding-top: 20px; +} +.vue-main { + background: #fff; + border-radius: 5px; + margin: 0 10px; + padding: 10px; + min-height: calc(100vh - 90px); +} +.vue-nav { + background: #fff; + border-radius: 5px; + margin: 0 10px; + padding: 10px; +} +.vue-head { + background: #fff; + border-radius: 5px; + margin: 0 10px; + padding: 10px; + margin-bottom: 15px; +} +.vue-crumbs { + margin: 0 20px; + font-size: 14px; + color: #333; + font-weight: 400; + padding-bottom: 10px; + line-height: 32px; +} +.vue-crumbs a { + color: #333; +} +.vue-crumbs a:hover { + color: #29ba9c; +} + +.vue-main-title { + display: flex; + margin: 5px 0; + line-height: 28px; + font-size: 14px; + color: #333; + font-weight: 700; +} +.vue-main-title-left { + width: 4px; + height: 14px; + margin-top: 6px; + background: #29ba9c; + display: inline-block; + margin-right: 10px; +} +.vue-main-title-content { + font-size: 14px; + flex: 1; +} +.vue-main-title-button { + text-align: right; + flex:1; +} +.vue-main-form { + margin-top: 20px; +} +.vue-category-title { + padding: 15px; + border-bottom: 1px solid #ccc; + margin-bottom: 15px; + font-weight: 600; + font-size: 15px; +} +.el-link-edit { + border-right: 1px solid; + line-height: 16px; +} +.el-link-edit-start { + border-right: 1px solid; + padding-right: 20px; + line-height: 16px; +} +.el-link-edit-middle { + border-right: 1px solid; + padding: 0 20px; + line-height: 16px; +} +.el-link-edit-end { + border-right: 0px; + padding-left: 20px; + line-height: 16px; +} + +/* 上传图片 */ +.avatar-uploader .el-upload { + margin-top: 15px; + border: 1px dashed #d9d9d9; + border-radius: 6px; + cursor: pointer; + position: relative; + overflow: hidden; +} +.avatar-uploader .el-upload:hover { + border-color: #29ba9c; +} +.avatar-uploader-icon { + font-size: 28px; + color: #8c939d; + width: 178px; + height: 178px; + line-height: 178px; + text-align: center; +} + +.avatar_box { + width: 80%; + height: 80%; + margin: 0 auto; +} +.avatar { + width: 50%; + height: 50%; + object-fit: cover; +} +.el-upload-tip { + width: 178px; + margin: 0; + padding: 0; + color: #999; + text-align: center; +} +input[type="file"] { + display: none; +} +.avatar-uploader-box { + position: relative; + margin-top: 20px; + width: 200px; +} +.el-icon-circle-close { + position: absolute; + top: 0; + right: 0; + color: #999; +} +/*弹窗上传图片*/ +#upload-img { +} +#upload-img .avatar { + width: 100px; + height: 100px; + display: block; +} +#upload-img .avatar-uploader-box { + position: relative; + margin: 20px 0 0 10px; + width: 110px; +} +#upload-img .el-icon-circle-close { + position: absolute; + top: -7px; + right: 1px; + color: #999; +} + +.imgList { + display: flex; + flex-wrap: wrap; + margin: 10px auto; +} +/* 辅助色 */ +.vue-assist-color, +.el-link-assist, +.el-link:hover { + color: #ff9b19 !important; +} + +/* 选中及未选图片样式 */ +.upload-box:hover { + border-color: #29ba9c; + color: #29ba9c; +} +.upload-box { + width: 150px; + height: 150px; + display: flex; + cursor: pointer; + border: 1px dashed #dde2ee; + justify-content: center; + align-items: center; + border-radius: 5px; +} +.upload-boxed { + width: 150px; + height: 150px; + position: relative; + border-radius: 5px; + display: inline-block; +} +.upload-boxed-text { + position: absolute; + bottom: 0; + line-height: 32px; + color: #fff; + text-align: center; + width: 100%; + background: #000; + opacity: 0.7; + border-radius: 0px 0px 5px 5px; +} +.upload-boxed-text-clear { + position: absolute; + bottom: 0; + right:-70px; + cursor: pointer; + line-height: 32px; + color: #ee3939; +} +.upload-boxed-list { + display: flex; + position: relative; + border-radius: 5px; + flex-wrap: wrap; +} +.upload-boxed-list-a { + width: 150px; + height: 170px; + margin: 0 10px 5px 0; + position: relative; +} +.upload-boxed-list-a .el-icon-close { + position: absolute; + top: -5px; + right: -5px; + color: #fff; + background: #333; + border-radius: 50%; + cursor: pointer; +} + +.vue-main-title-content a { + color: #333; +} +.vue-main-title-content a:hover { + color: #29ba9c; +} +.vue-ellipsis { + overflow: hidden; + text-overflow: ellipsis; + white-space: nowrap; +} +.black { + color: #333; +} +.upload-box-member { + text-align: center; + font-weight: 600; + font-size: 16px; +} diff --git a/plugins/video-share/callbacks.php b/plugins/video-share/callbacks.php new file mode 100644 index 00000000..1e355574 --- /dev/null +++ b/plugins/video-share/callbacks.php @@ -0,0 +1,7 @@ + function ($plugins) { + \Artisan::call('migrate',['--path'=>'plugins/video-share/migrations','--force'=>true]); + } +]; \ No newline at end of file diff --git a/plugins/video-share/migrations/2019_07_20_222311_create_ims_yz_video_share_goods_table.php b/plugins/video-share/migrations/2019_07_20_222311_create_ims_yz_video_share_goods_table.php new file mode 100644 index 00000000..b159e572 --- /dev/null +++ b/plugins/video-share/migrations/2019_07_20_222311_create_ims_yz_video_share_goods_table.php @@ -0,0 +1,64 @@ +increments('id'); + $table->integer('uniacid') + ->nullable(); + $table->integer('uid') + ->nullable()->comment('会员ID'); + $table->integer('goods_id') + ->nullable()->comment('商品ID'); + $table->text('title', 65535) + ->nullable()->comment('发现标题'); + $table->text('cover', 65535) + ->nullable()->comment('发现视频封面地址'); + $table->text('video', 65535) + ->nullable()->comment('发现视频地址'); + $table->integer('share_num') + ->nullable()->comment('分享次数'); + $table->integer('like_num') + ->nullable()->comment('点赞次数'); + $table->integer('status') + ->nullable()->comment('显示状态:1显示,0不显示'); + $table->decimal('order_price', 10) + ->nullable()->comment('转化订单金额'); + $table->decimal('amount_total', 10) + ->nullable()->comment('奖励金额'); + $table->integer('created_at') + ->nullable(); + $table->integer('updated_at') + ->nullable(); + $table->integer('deleted_at') + ->nullable(); + }); + \Illuminate\Support\Facades\DB::statement("ALTER TABLE `" . app('db')->getTablePrefix() . "yz_video_share_goods` comment '视频分享--发现管理表'"); + } + } + + + /** + * Reverse the migrations. + * + * @return void + */ + public function down() + { + Schema::drop('yz_video_share_goods'); + } + +} diff --git a/plugins/video-share/migrations/2019_07_20_222313_create_ims_yz_video_share_bonus_table.php b/plugins/video-share/migrations/2019_07_20_222313_create_ims_yz_video_share_bonus_table.php new file mode 100644 index 00000000..3b355c3e --- /dev/null +++ b/plugins/video-share/migrations/2019_07_20_222313_create_ims_yz_video_share_bonus_table.php @@ -0,0 +1,60 @@ +increments('id'); + $table->integer('uniacid') + ->nullable(); + $table->integer('uid') + ->nullable()->comment('会员ID'); + $table->integer('vid') + ->nullable()->comment('发现管理ID'); + $table->integer('order_id') + ->nullable()->comment('订单ID'); + $table->decimal('ratio', 10) + ->nullable()->comment('奖励比例'); + $table->decimal('order_price', 10) + ->nullable()->comment('订单金额'); + $table->decimal('amount', 10) + ->nullable()->comment('奖励金额'); + $table->integer('status') + ->nullable()->comment('结算状态:1已结算,0未结算'); + $table->string('create_month') + ->nullable()->comment('奖励生成月份'); + $table->integer('created_at') + ->nullable(); + $table->integer('updated_at') + ->nullable(); + $table->integer('deleted_at') + ->nullable(); + }); + \Illuminate\Support\Facades\DB::statement("ALTER TABLE `" . app('db')->getTablePrefix() . "yz_video_share_bonus` comment '视频分享--分红记录表'"); + } + } + + + /** + * Reverse the migrations. + * + * @return void + */ + public function down() + { + Schema::drop('yz_video_share_bonus'); + } + +} diff --git a/plugins/video-share/migrations/2019_07_21_135433_create_ims_yz_video_share_like_log_table.php b/plugins/video-share/migrations/2019_07_21_135433_create_ims_yz_video_share_like_log_table.php new file mode 100644 index 00000000..6090e934 --- /dev/null +++ b/plugins/video-share/migrations/2019_07_21_135433_create_ims_yz_video_share_like_log_table.php @@ -0,0 +1,48 @@ +increments('id'); + $table->integer('uniacid') + ->nullable(); + $table->integer('uid') + ->nullable()->comment('会员ID'); + $table->integer('vid') + ->nullable()->comment('发现管理ID'); + $table->integer('created_at') + ->nullable(); + $table->integer('updated_at') + ->nullable(); + $table->integer('deleted_at') + ->nullable(); + }); + \Illuminate\Support\Facades\DB::statement("ALTER TABLE `" . app('db')->getTablePrefix() . "yz_video_share_like_log` comment '视频分享--点赞记录表'"); + } + } + + + /** + * Reverse the migrations. + * + * @return void + */ + public function down() + { + Schema::drop('yz_video_share_like_log'); + } + +} diff --git a/plugins/video-share/migrations/2019_07_22_135434_add_columns_to_ims_yz_video_share_goods_table.php b/plugins/video-share/migrations/2019_07_22_135434_add_columns_to_ims_yz_video_share_goods_table.php new file mode 100644 index 00000000..e363ec6a --- /dev/null +++ b/plugins/video-share/migrations/2019_07_22_135434_add_columns_to_ims_yz_video_share_goods_table.php @@ -0,0 +1,37 @@ +integer('uniacid')->nullable(); + } + }); + } + } + + /** + * Reverse the migrations. + * + * @return void + */ + public function down() + { + Schema::table('yz_video_share_goods', function (Blueprint $table) { + $table->dropColumn('uniacid'); + }); + } +} diff --git a/plugins/video-share/migrations/2019_07_22_135435_add_columns_to_ims_yz_video_share_bonus_table.php b/plugins/video-share/migrations/2019_07_22_135435_add_columns_to_ims_yz_video_share_bonus_table.php new file mode 100644 index 00000000..5debea02 --- /dev/null +++ b/plugins/video-share/migrations/2019_07_22_135435_add_columns_to_ims_yz_video_share_bonus_table.php @@ -0,0 +1,38 @@ +decimal('order_price', 10) + ->nullable(); + } + }); + } + } + + /** + * Reverse the migrations. + * + * @return void + */ + public function down() + { + Schema::table('yz_video_share_bonus', function (Blueprint $table) { + $table->dropColumn('order_price'); + }); + } +} diff --git a/plugins/video-share/migrations/2019_12_23_160023_add_file_name_to_ims_yz_video_share_goods_table.php b/plugins/video-share/migrations/2019_12_23_160023_add_file_name_to_ims_yz_video_share_goods_table.php new file mode 100644 index 00000000..feef9e98 --- /dev/null +++ b/plugins/video-share/migrations/2019_12_23_160023_add_file_name_to_ims_yz_video_share_goods_table.php @@ -0,0 +1,36 @@ +string('file_name')->nullable(); + } + }); + } + } + + /** + * Reverse the migrations. + * + * @return void + */ + public function down() + { + Schema::table('yz_video_share_goods', function (Blueprint $table) { + $table->dropColumn('file_name'); + }); + } +} diff --git a/plugins/video-share/migrations/2020_12_29_164305_create_ims_yz_video_share_watch_record_table.php b/plugins/video-share/migrations/2020_12_29_164305_create_ims_yz_video_share_watch_record_table.php new file mode 100644 index 00000000..42abbc0f --- /dev/null +++ b/plugins/video-share/migrations/2020_12_29_164305_create_ims_yz_video_share_watch_record_table.php @@ -0,0 +1,43 @@ +integer('id', true); + $table->integer('member_id')->nullable()->index('memberid')->comment('观看会员ID'); + $table->integer('video_id')->nullable()->comment('发现管理ID'); + $table->integer('created_at')->nullable(); + $table->integer('updated_at')->nullable(); + $table->integer('deleted_at')->nullable(); + }); + \Illuminate\Support\Facades\DB::statement("ALTER TABLE `" . app('db')->getTablePrefix() . "yz_video_share_watch_record` comment '视频分享--观看记录表'"); + } + } + + + /** + * Reverse the migrations. + * + * @return void + */ + public function down() + { + if (Schema::hasTable('yz_video_share_watch_record')) { + + Schema::drop('yz_video_share_watch_record'); + } + } + +} diff --git a/plugins/video-share/migrations/2021_04_12_104255_create_yz_video_share_category.php b/plugins/video-share/migrations/2021_04_12_104255_create_yz_video_share_category.php new file mode 100644 index 00000000..db97197a --- /dev/null +++ b/plugins/video-share/migrations/2021_04_12_104255_create_yz_video_share_category.php @@ -0,0 +1,41 @@ +increments('id'); + $table->integer('uniacid')->nullable(); + $table->integer('sort')->nullable()->comment("排序"); + $table->string('name')->nullable()->comment("名称"); + $table->tinyInteger("is_show")->nullable()->comment("是否显示 1-显示 2-隐藏"); + $table->integer('created_at')->nullable(); + $table->integer('updated_at')->nullable(); + $table->integer('deleted_at')->nullable(); + }); + } + \Illuminate\Support\Facades\DB::statement("ALTER TABLE `".app('db')->getTablePrefix()."yz_video_share_category` comment '视频分享--分类'"); + } + + /** + * Reverse the migrations. + * + * @return void + */ + public function down() + { + Schema::dropIfExists('yz_video_share_category'); + } +} diff --git a/plugins/video-share/migrations/2021_04_12_142244_add_category_to_yz_video_share_goods.php b/plugins/video-share/migrations/2021_04_12_142244_add_category_to_yz_video_share_goods.php new file mode 100644 index 00000000..9b63932b --- /dev/null +++ b/plugins/video-share/migrations/2021_04_12_142244_add_category_to_yz_video_share_goods.php @@ -0,0 +1,40 @@ +integer('category_id')->nullable()->comment("分类ID"); + } + + if (!Schema::hasColumn('yz_video_share_goods', 'is_recommend')) { + $table->integer('is_recommend')->nullable()->comment("推荐 0-关闭 1-开启"); + } + }); + } + } + + /** + * Reverse the migrations. + * + * @return void + */ + public function down() + { + // + } +} diff --git a/plugins/video-share/migrations/2021_05_10_105651_create_yz_video_share_follow.php b/plugins/video-share/migrations/2021_05_10_105651_create_yz_video_share_follow.php new file mode 100644 index 00000000..fe5fbe7c --- /dev/null +++ b/plugins/video-share/migrations/2021_05_10_105651_create_yz_video_share_follow.php @@ -0,0 +1,40 @@ +increments('id'); + $table->integer('uniacid')->nullable(); + $table->integer('member_id')->nullable()->comment("被关注的用户ID"); + $table->integer('follow_member_id')->nullable()->comment("关注者的用户ID"); + $table->integer('created_at')->nullable(); + $table->integer('updated_at')->nullable(); + $table->integer('deleted_at')->nullable(); + }); + } + \Illuminate\Support\Facades\DB::statement("ALTER TABLE `".app('db')->getTablePrefix()."yz_video_share_follow` comment '视频分享--关注'"); + } + + /** + * Reverse the migrations. + * + * @return void + */ + public function down() + { + Schema::dropIfExists('yz_video_share_follow'); + } +} diff --git a/plugins/video-share/migrations/2021_07_27_123426_create_ims_yz_video_share_comment_table.php b/plugins/video-share/migrations/2021_07_27_123426_create_ims_yz_video_share_comment_table.php new file mode 100644 index 00000000..b9b5382d --- /dev/null +++ b/plugins/video-share/migrations/2021_07_27_123426_create_ims_yz_video_share_comment_table.php @@ -0,0 +1,49 @@ +integer('id', true); + $table->integer('uniacid')->comment('公众号id'); + $table->integer('video_id')->default(0)->index('idx_videoid'); + $table->integer('uid')->default(0)->comment('会员id'); + $table->string('nick_name', 50)->nullable()->comment('评论昵称'); + $table->string('head_img_url')->nullable()->comment('评论头像'); + $table->string('content')->default('')->comment('内容'); + $table->text('images', 65535)->nullable()->comment('图片'); + $table->integer('comment_id')->default(0)->comment('评论ID'); + $table->integer('reply_id')->nullable()->comment('回答哪个会员ID'); + $table->integer('reply_comment_id')->nullable()->comment('回答哪个评论'); + $table->string('reply_name', 50)->nullable()->comment('回答哪个昵称'); + $table->integer('support_num')->default(0)->comment('点赞数'); + $table->tinyInteger('type')->default(2); + $table->integer('created_at')->nullable(); + $table->integer('updated_at')->nullable(); + }); + } + DB::statement("ALTER TABLE `" . app('db')->getTablePrefix() . "yz_video_share_comment` comment '视频分享--评论表'"); + } + + /** + * Reverse the migrations. + * + * @return void + */ + public function down() + { + Schema::dropIfExists('yz_video_share_comment'); + } +} diff --git a/plugins/video-share/migrations/2021_07_28_092245_create_ims_yz_video_comment_support_table.php b/plugins/video-share/migrations/2021_07_28_092245_create_ims_yz_video_comment_support_table.php new file mode 100644 index 00000000..f25ebc3f --- /dev/null +++ b/plugins/video-share/migrations/2021_07_28_092245_create_ims_yz_video_comment_support_table.php @@ -0,0 +1,40 @@ +integer('id', true); + $table->integer('uniacid')->comment('公众号id'); + $table->integer('comment_id')->default(0)->index('idx_commentid'); + $table->integer('member_id'); + $table->tinyInteger('status')->default(1)->comment('-1:不点赞,1:点赞'); + $table->integer('created_at')->nullable(); + $table->integer('updated_at')->nullable(); + }); + } + DB::statement("ALTER TABLE `" . app('db')->getTablePrefix() . "yz_video_comment_support` comment '视频分享--评论点赞表'"); + } + + /** + * Reverse the migrations. + * + * @return void + */ + public function down() + { + Schema::dropIfExists('yz_video_comment_support'); + } +} diff --git a/plugins/video-share/migrations/2021_08_17_174637_update_ims_yz_video_share_goods_table20210817.php b/plugins/video-share/migrations/2021_08_17_174637_update_ims_yz_video_share_goods_table20210817.php new file mode 100644 index 00000000..181d68bf --- /dev/null +++ b/plugins/video-share/migrations/2021_08_17_174637_update_ims_yz_video_share_goods_table20210817.php @@ -0,0 +1,37 @@ +integer('store_id')->default(0)->comment('门店id'); + } + + }); + } + } + + /** + * Reverse the migrations. + * + * @return void + */ + public function down() + { + Schema::table('yz_video_share_goods', function (Blueprint $table) { + $table->dropColumn('store_id'); + }); + } +} diff --git a/plugins/video-share/migrations/2022_01_24_142507_update_yz_video_share_goods_table20220124.php b/plugins/video-share/migrations/2022_01_24_142507_update_yz_video_share_goods_table20220124.php new file mode 100644 index 00000000..9040adc2 --- /dev/null +++ b/plugins/video-share/migrations/2022_01_24_142507_update_yz_video_share_goods_table20220124.php @@ -0,0 +1,37 @@ +tinyInteger('is_crm')->default(0)->comment("是否crm推送,0否1是"); + } + + }); + } + } + + /** + * Reverse the migrations. + * + * @return void + */ + public function down() + { + Schema::table('yz_video_share_goods', function (Blueprint $table) { + $table->dropColumn('is_crm'); + }); + } +} diff --git a/plugins/video-share/migrations/2023_04_27_161621_alter_table_yz_video_share_goods_add_column_yz_goods_id.php b/plugins/video-share/migrations/2023_04_27_161621_alter_table_yz_video_share_goods_add_column_yz_goods_id.php new file mode 100644 index 00000000..fc110610 --- /dev/null +++ b/plugins/video-share/migrations/2023_04_27_161621_alter_table_yz_video_share_goods_add_column_yz_goods_id.php @@ -0,0 +1,37 @@ +tinyInteger('mid_ground_video_id')->default(0)->comment("中台视频id"); + } + if (!Schema::hasColumn('yz_video_share_goods', 'mid_ground_config_id')) { + $table->tinyInteger('mid_ground_config_id')->default(0)->comment("中台配置id"); + } + }); + } + } + + /** + * Reverse the migrations. + * + * @return void + */ + public function down() + { + // + } +} diff --git a/plugins/video-share/package.json b/plugins/video-share/package.json new file mode 100644 index 00000000..858c7c12 --- /dev/null +++ b/plugins/video-share/package.json @@ -0,0 +1,11 @@ +{ + "name": "video-share", + "terminal": "wechat|min|wap", + "version": "1.0.118", + "title": "视频分享", + "description": "短视频营销,带货传播更便捷。", + "author": "", + "url": "", + "namespace": "Yunshop\\VideoShare", + "config": "config.tpl" +} \ No newline at end of file diff --git a/plugins/video-share/src/PluginApplication.php b/plugins/video-share/src/PluginApplication.php new file mode 100644 index 00000000..5c8c4f0d --- /dev/null +++ b/plugins/video-share/src/PluginApplication.php @@ -0,0 +1,581 @@ +push('plugin_data',[ + 'code' => 'video-share', + 'name' => '发现视频', + 'sort' => 5, + 'class' => '\Yunshop\VideoShare\common\member\MemberCenterVideoShare' + ]); + } + + public function storeAloneTempConfig() + { + \Yunshop\StoreAloneTemp\common\StoreAloneTempConfig::current()->push('navs',[ + 'sort' => 3, + 'code' => 'video_share', + 'name' => '发现视频', + 'class' => '\Yunshop\VideoShare\common\member\StoreMemberCenterVideoShare', + ]); + $set = \Setting::get('plugin.video-share'); + if ($set['is_open']) { + \Yunshop\StoreAloneTemp\common\StoreAloneTempConfig::current()->push('plugins',[ + 'name' => 'video-share', + 'title' => '发现视频', + 'class' => 'icon-extension_video', + 'url' => $set['list_style'] == 2 ? 'VideoDetail' : 'VideoList', + 'image' => 'member_a(73).png', + 'mini_url' => $set['list_style'] == 2 ? '/packageC/video_goods/VideoDetail/VideoDetail' : '/packageC/video_goods/VideoList/VideoList', + ]); + } + } + + public function getIncomePageItems() + { + return [ + 'video_share_income' => [ + 'class' => \Yunshop\VideoShare\common\service\IncomePageService::class, + 'type' => 'marketing' + ] + ]; + } + + protected function setConfig() + { + \Config::set('widget.withdraw.tab_video_share', [ + 'title' => '发现视频', + 'class' => \Yunshop\VideoShare\admin\withdrawWidget::class + ]); + + \app\common\modules\shop\ShopConfig::current()->set('get_video_access', [ + 'class' => 'Yunshop\VideoShare\common\service\ShopService', + 'function' => 'getAccess' + ]); + } + + public function getIncomeItems() + { + return ['video_share' => [ + 'title' => '发现视频', + 'type' => 'video_share_withdraw', + 'class' => \Yunshop\VideoShare\common\model\Bonus::class, + 'order_class' => '', + ]]; + } + + public function getWidgetItems() + { + return ['withdraw.tab_video_share' => [ + 'title' => '视频分享', + 'class' => 'Yunshop\VideoShare\widgets\WithdrawWidget' + ]]; + } + + protected function setMenuConfig() + { + \app\backend\modules\menu\Menu::current()->setPluginMenu('video_share', [ + 'name' => '视频分享', + 'type' => 'marketing', + 'url' => 'plugin.video-share.admin.videoGoods.index', + 'url_params' => '', + 'permit' => 1, + 'menu' => 1, + 'top_show' => 0, + 'left_first_show' => 0, + 'left_second_show' => 1, + 'icon' => 'fa-list', + 'list_icon' => 'share-chain', + 'item' => 'video_share', + 'parents' => [], + 'child' => [ + 'video_goods_manage' => [ + 'name' => '发现管理', + 'url' => 'plugin.video-share.admin.videoGoods.index', + 'url_params' => '', + 'permit' => 1, + 'menu' => 1, + 'icon' => '', + 'item' => 'video_goods_manage', + 'parents' => ['video_share'], + 'child' => [ + 'video_goods_search' => [ + 'name' => '搜索', + 'url' => 'plugin.video-share.admin.video-goods.search', + 'url_params' => '', + 'permit' => 1, + 'menu' => 1, + 'icon' => '', + 'item' => 'video_goods_search', + 'parents' => ['video_share','video_goods_manage'], + 'child' => [] + ], + 'video_goods_del' => [ + 'name' => '分红记录', + 'url' => 'plugin.video-share.admin.video-goods.del', + 'url_params' => '', + 'permit' => 1, + 'menu' => 1, + 'icon' => '', + 'item' => 'video_goods_del', + 'parents' => ['video_share','video_goods_manage'], + 'child' => [] + ], + 'video_goods_get_images' => [ + 'name' => '获取图片', + 'url' => 'plugin.video-share.admin.set.get-images', + 'url_params' => '', + 'permit' => 1, + 'menu' => 1, + 'icon' => '', + 'item' => 'video_goods_get_images', + 'parents' => ['video_share','video_goods_manage'], + 'child' => [] + ], + 'video_goods_preview' => [ + 'name' => '视频预览', + 'url' => 'plugin.video-share.admin.video-goods.video', + 'url_params' => '', + 'permit' => 1, + 'menu' => 1, + 'icon' => '', + 'item' => 'video_goods_preview', + 'parents' => ['video_share'], + 'child' => [] + ], + 'video_goods_change_status' => [ + 'name' => '审核', + 'url' => 'plugin.video-share.admin.video-goods.changeStatus', + 'url_params' => '', + 'permit' => 1, + 'menu' => 1, + 'icon' => '', + 'item' => 'video_goods_change_status', + 'parents' => ['video_share','video_goods_manage'], + 'child' => [] + ], + 'video_goods_video' => [ + 'name' => '预览视频', + 'url' => 'plugin.video-share.admin.video-goods.video', + 'url_params' => '', + 'permit' => 1, + 'menu' => 1, + 'icon' => '', + 'item' => 'video_goods_video', + 'parents' => ['video_share','video_goods_manage'], + 'child' => [] + ], + 'video_goods_change_recommend' => [ + 'name' => '推荐修改', + 'url' => 'plugin.video-share.admin.video-goods.changeRecommend', + 'url_params' => '', + 'permit' => 1, + 'menu' => 1, + 'icon' => '', + 'item' => 'video_goods_change_recommend', + 'parents' => ['video_share','video_goods_manage'], + 'child' => [] + ], + 'video_goods_change_category' => [ + 'name' => '分类修改', + 'url' => 'plugin.video-share.admin.video-goods.changeCategory', + 'url_params' => '', + 'permit' => 1, + 'menu' => 1, + 'icon' => '', + 'item' => 'video_goods_change_category', + 'parents' => ['video_share','video_goods_manage'], + 'child' => [] + ], + 'video_goods_change_title' => [ + 'name' => '标题修改', + 'url' => 'plugin.video-share.admin.video-goods.edit-title', + 'url_params' => '', + 'permit' => 1, + 'menu' => 1, + 'icon' => '', + 'item' => 'video_goods_change_title', + 'parents' => ['video_share','video_goods_manage'], + 'child' => [] + ], + 'video_goods_change_getGoodList' => [ + 'name' => '商品修改', + 'url' => 'plugin.video-share.admin.video-goods.get-goods-list', + 'url_params' => '', + 'permit' => 1, + 'menu' => 1, + 'icon' => '', + 'item' => 'video_goods_change_getGoodList', + 'parents' => ['video_share','video_goods_manage'], + 'child' => [] + ], + 'video_goods_change_good_video' => [ + 'name' => '更换视频', + 'url' => 'plugin.video-share.admin.video-goods.upload-audio', + 'url_params' => '', + 'permit' => 1, + 'menu' => 1, + 'icon' => '', + 'item' => 'video_goods_change_good_video', + 'parents' => ['video_share','video_goods_manage'], + 'child' => [] + ], + 'video_goods_change_url' => [ + 'name' => '更换视频地址', + 'url' => 'plugin.video-share.admin.video-goods.change-url', + 'url_params' => '', + 'permit' => 1, + 'menu' => 1, + 'icon' => '', + 'item' => 'video_goods_change_good_video', + 'parents' => ['video_share','video_goods_manage'], + 'child' => [] + ], + ] + ], + 'video_goods_bonus' => [ + 'name' => '分红记录', + 'url' => 'plugin.video-share.admin.bonus.index', + 'url_params' => '', + 'permit' => 1, + 'menu' => 1, + 'icon' => '', + 'item' => 'video_goods_bonus', + 'parents' => ['video_share'], + 'child' => [ + 'video_goods_getListBySearch' => [ + 'name' => '搜索', + 'url' => 'plugin.video-share.admin.bonus.getListBySearch', + 'url_params' => '', + 'permit' => 1, + 'menu' => 1, + 'icon' => '', + 'item' => 'video_goods_getListBySearch', + 'parents' => ['video_share','video_goods_bonus'], + 'child' => [] + ], + ] + ], + /*'diy_queue_log' => [ + 'name' => '奖励记录', + 'url' => 'plugin.diy-queue.admin.diy-queue.award-log', + 'url_params' => '', + 'permit' => 1, + 'menu' => 1, + 'icon' => '', + 'item' => 'diy_queue_log', + 'parents' => ['diy_queue'], + 'child' => [ + + ] + ], + 'diy_queue_manage' => [ + 'name' => '队列管理', + 'url' => 'plugin.diy-queue.admin.diy-queue-manage.manage', + 'url_params' => '', + 'permit' => 1, + 'menu' => 1, + 'icon' => '', + 'item' => 'diy_queue_manage', + 'parents' => ['diy_queue'], + 'child' => [ + 'diy_queue_add' => [ + 'name' => '添加', + 'url' => 'plugin.diy-queue.admin.diy-queue-manage.add', + 'url_params' => '', + 'permit' => 1, + 'menu' => 0, + 'icon' => '', + 'item' => 'diy_queue_add', + 'parents' => ['diy_queue', 'diy_queue_manage'], + 'child' => [] + ], + 'diy_queue_edit' => [ + 'name' => '修改', + 'url' => 'plugin.diy-queue.admin.diy-queue-manage.edit', + 'url_params' => '', + 'permit' => 1, + 'menu' => 0, + 'icon' => '', + 'item' => 'diy_queue_edit', + 'parents' => ['diy_queue', 'diy_queue_manage'], + 'child' => [] + ], + ] + ],*/ + 'video_goods_set' => [ + 'name' => '基础设置', + 'url' => 'plugin.video-share.admin.set.index', + 'url_params' => '', + 'permit' => 1, + 'menu' => 1, + 'icon' => '', + 'item' => 'video_goods_set', + 'parents' => ['video_share'], + 'child' => [ + 'video_members_search' => [ + 'name' => '会员搜索', + 'url' => 'plugin.video-share.admin.set.get-member', + 'url_params' => '', + 'permit' => 1, + 'menu' => 1, + 'icon' => '', + 'item' => 'video_goods_set', + 'parents' => ['video_share','video_goods_set'], + 'child' => [] + ], + 'videoShareGetImages' => [ + 'name' => '获取图片', + 'url' => 'plugin.video-share.admin.set.get-images', + 'url_params' => '', + 'permit' => 0, + 'menu' => 0, + 'icon' => '', + 'item' => 'videoShareGetImages', + 'parents' => ['video_share', 'video_goods_set'], + ], + 'video_goods_pic' => [ + 'name' => '获取图片', + 'url' => 'upload.uploadImage.getImage', + 'url_params' => '', + 'permit' => 1, + 'menu' => 1, + 'icon' => '', + 'item' => 'video_goods_pic', + 'parents' => ['video_share', 'video_goods_set'], + ], + + 'video_goods_sub' => [ + 'name' => '保存数据', + 'url' => 'plugin.video-share.admin.set.sub', + 'url_params' => '', + 'permit' => 1, + 'menu' => 1, + 'icon' => '', + 'item' => 'video_goods_sub', + 'parents' => ['video_share', 'video_goods_set'], + 'child' => [] + ], + ] + ], + 'video_goods_category' => [ + 'name' => '分类管理', + 'url' => 'plugin.video-share.admin.category.index', + 'url_params' => '', + 'permit' => 1, + 'menu' => 1, + 'icon' => '', + 'item' => 'video_goods_category', + 'parents' => ['video_share'], + 'child' => [ + 'video_goods_category_search' => [ + 'name' => '分类搜索', + 'url' => 'plugin.video-share.admin.category.search', + 'url_params' => '', + 'permit' => 0, + 'menu' => 0, + 'icon' => '', + 'item' => 'video_goods_category_search', + 'parents' => ['video_share', 'video_goods_category'], + ], + 'video_goods_category_edit' => [ + 'name' => '分类编辑', + 'url' => 'plugin.video-share.admin.category.edit', + 'url_params' => '', + 'permit' => 1, + 'menu' => 1, + 'icon' => '', + 'item' => 'video_goods_category_edit', + 'parents' => ['video_share', 'video_goods_category'], + ], + + 'video_goods_category_del' => [ + 'name' => '分类删除', + 'url' => 'plugin.video-share.admin.category.del', + 'url_params' => '', + 'permit' => 1, + 'menu' => 1, + 'icon' => '', + 'item' => 'video_goods_category_del', + 'parents' => ['video_share', 'video_goods_category'], + 'child' => [] + ], + + 'video_goods_category_change' => [ + 'name' => '分类上下架', + 'url' => 'plugin.video-share.admin.category.changeStatus', + 'url_params' => '', + 'permit' => 1, + 'menu' => 1, + 'icon' => '', + 'item' => 'video_goods_category_change', + 'parents' => ['video_share', 'video_goods_category'], + 'child' => [] + ], + ] + ], + 'video_comments_category' => [ + 'name' => '评论管理', + 'url' => 'plugin.video-share.admin.video-comments.index', + 'url_params' => '', + 'permit' => 1, + 'menu' => 1, + 'icon' => '', + 'item' => 'video_comments_category', + 'parents' => ['video_share'], + 'child' => [ + 'video_comments_search' => [ + 'name' => '评论列表', + 'url' => 'plugin.video-share.admin.video-comments.get-comments-category-list', + 'url_params' => '', + 'permit' => 1, + 'menu' => 1, + 'icon' => '', + 'item' => 'video_comments_search', + 'parents' => ['video_share', 'video_comments_category'], + ], + 'video_goods_category_del' => [ + 'name' => '评论删除', + 'url' => 'plugin.video-share.admin.video-comments.del', + 'url_params' => '', + 'permit' => 1, + 'menu' => 1, + 'icon' => '', + 'item' => 'video_goods_category_del', + 'parents' => ['video_share', 'video_comments_category'], + 'child' => [] + ], + 'video_goods_display_comments' => [ + 'name' => '查看评论', + 'url' => 'plugin.video-share.admin.video-comments.display-comments', + 'url_params' => '', + 'permit' => 1, + 'menu' => 1, + 'icon' => '', + 'item' => 'video_goods_display_comments', + 'parents' => ['video_share','video_comments_category'], + 'child' => [] + ], + 'video_goods_get_display_comments_list' => [ + 'name' => '评论列表', + 'url' => 'plugin.video-share.admin.video-comments.get-display-comments-list', + 'url_params' => '', + 'permit' => 1, + 'menu' => 1, + 'icon' => '', + 'item' => 'video_goods_get_display_comments_list', + 'parents' => ['video_share','video_comments_category'], + 'child' => [] + ], + ] + ], + 'video_goods_center' => [ + 'name' => '短视频中心', + 'url' => 'plugin.video-share.admin.center.index', + 'url_params' => '', + 'permit' => 1, + 'menu' => 1, + 'icon' => '', + 'item' => 'video_goods_center', + 'parents' => ['video_share'], + 'child' => [ + 'video_goods_center_goods_list' => [ + 'name' => '获取中台商品列表', + 'url' => 'plugin.video-share.admin.center.goods-list', + 'url_params' => '', + 'permit' =>0, + 'menu' => 0, + 'icon' => '', + 'item' => 'video_goods_center_goods_list', + 'parents' => ['video_share','video_goods_center'], + 'child' => [] + ], + 'video_goods_center_member_list' => [ + 'name' => '获取会员列表', + 'url' => 'plugin.video-share.admin.center.getMemberList', + 'url_params' => '', + 'permit' =>0, + 'menu' => 0, + 'icon' => '', + 'item' => 'video_goods_center_member_list', + 'parents' => ['video_share','video_goods_center'], + 'child' => [] + ], + 'video_goods_center_import' => [ + 'name' => '导入', + 'url' => 'plugin.video-share.admin.center.select', + 'url_params' => '', + 'permit' =>1, + 'menu' => 1, + 'icon' => '', + 'item' => 'video_goods_center_import', + 'parents' => ['video_share','video_goods_center'], + 'child' => [] + ], + 'video_goods_center_all_import' => [ + 'name' => '全部导入', + 'url' => 'plugin.video-share.admin.center.all-select', + 'url_params' => '', + 'permit' =>1, + 'menu' => 1, + 'icon' => '', + 'item' => 'video_goods_center_all_import', + 'parents' => ['video_share','video_goods_center'], + 'child' => [] + ], + ] + ], + ] + ]); + } + + public function getFrontendWidgetConfig(): array + { + return [ + 'member_center.video-share' => MemberCenterService::class, + ]; + } + + public function boot() + { + + + $events = app('events'); + // 监听下单 + $events->subscribe(\Yunshop\VideoShare\common\listeners\OrderCreatedListener::class); + + // 监听完成 + $events->subscribe(\Yunshop\VideoShare\common\listeners\OrderReceiveListener::class); + + $events->subscribe(\Yunshop\VideoShare\common\listeners\VideoPublishListener::class); + + //定时同步中台短视频 + + } + + public function cronConfig() + { + \Event::listen('cron.collectJobs', function () { + \Cron::add('video-share-middle-update', '15 2 * * *', function () { + (new TimedTaskService())->handle(); + }); + \Cron::add('video-share-middle-insert', '0 0 * * *', function () { + (new TimedTaskImportService())->handle(); + }); + }); + + } +} diff --git a/plugins/video-share/src/admin/BonusController.php b/plugins/video-share/src/admin/BonusController.php new file mode 100644 index 00000000..88bf025e --- /dev/null +++ b/plugins/video-share/src/admin/BonusController.php @@ -0,0 +1,89 @@ +search; + + $statistic = $this->getStatistic($search); + + $list = Bonus::getList($search) + ->orderBy('id', 'desc') + ->paginate(); + + $list = $this->processData($list); + + return view('Yunshop\VideoShare::bonus.list', [ + 'list' => json_encode($list), + 'statistic' => json_encode($statistic) + ])->render(); + } + + // 分红列表搜索 + public function getListBySearch() + { + $search = request()->search; + + $statistic = $this->getStatistic($search); + + $list = Bonus::getList($search) + ->orderBy('id', 'desc') + ->paginate(); + + $list = $this->processData($list); + + return $this->successJson('成功', [ + 'list' => $list, + 'statistic' => $statistic + ]); + } + + private function getStatistic($search) + { + $order_price = Bonus::getList($search)->sum('order_price'); + $amount = Bonus::getList($search)->sum('amount'); + $finish_order_price = Bonus::getList($search)->where('status', 1)->sum('order_price'); + $wait_amount = Bonus::getList($search)->where('status', 1)->sum('amount'); + + return [ + 'order_price' => $order_price, + 'amount' => $amount, + 'finish_order_price' => $finish_order_price, + 'wait_amount' => $wait_amount, + ]; + } + + /** + * 数据过滤 + */ + private function processData($obj='') + { + /*************************修复视频被删除后无法显示记录*************************/ + if (is_array($obj)) + { + $list = $obj; + }else{ + $list = $obj->toArray(); + } + + foreach ($list['data'] as $key => $value) + { + if ($value['video'] == null) + { + $list['data'][$key]['video'] = ['id'=>'视频被删除','title'=>'视频被删除']; + } + } + + return $list; + /*************************修复视频被删除后无法显示记录end*************************/ + } +} \ No newline at end of file diff --git a/plugins/video-share/src/admin/CategoryController.php b/plugins/video-share/src/admin/CategoryController.php new file mode 100644 index 00000000..ade9dcf5 --- /dev/null +++ b/plugins/video-share/src/admin/CategoryController.php @@ -0,0 +1,124 @@ +search; + + $list = CategoryModel::uniacid()->search($search)->orderBy("id","desc")->paginate(15); + $list = empty($list) ? [] : $list->toArray(); + + if (!empty($list['data'])) { + foreach ($list['data'] as $kk=>$vv) { + $amount_total = VideoShareGoods::uniacid()->where("category_id",$vv['id'])->count(); + $list['data'][$kk]['amount_total'] = $amount_total; + } + } + return view('Yunshop\VideoShare::category.list',[ + 'list' => json_encode($list), + 'search' => json_encode($search) + ])->render(); + } + + public function edit() + { + $cate_id = request()->get("cate_id"); + + $cate_data = request()->cate_data; + + $cate = []; + + if (!empty($cate_data)) { + if ($cate_id) { + $category = CategoryModel::uniacid()->where("id",$cate_id)->first(); + } else { + $category = new CategoryModel(); + } + + $data = [ + "uniacid" => \YunShop::app()->uniacid, + "name" => $cate_data['name'], + "sort" => $cate_data['sort'], + "is_show" => $cate_data['is_show'] + ]; + + $category->fill($data); + + if ($category->save()) { + return $this->successJson("编辑成功"); + } + + return $this->errorJson("编辑失败"); + } + + if ($cate_id) { + $cate = CategoryModel::uniacid()->where("id",$cate_id)->first(); + $cate = empty($cate) ? [] : $cate->toArray(); + } + + return view('Yunshop\VideoShare::category.edit',[ + "cate" => $cate + ])->render(); + } + + public function search() + { + $search = request()->search; + + $list = CategoryModel::uniacid()->search($search)->paginate(15); + $list = empty($list) ? [] : $list->toArray(); + + if (!empty($list['data'])) { + foreach ($list['data'] as $kk=>$vv) { + $amount_total = VideoShareGoods::uniacid()->where("category_id",$vv['id'])->count(); + $list['data'][$kk]['amount_total'] = $amount_total; + } + } + + return $this->successJson("",["list"=>$list]); + } + + public function del() + { + $id = request()->get("id"); + + $cate = CategoryModel::uniacid()->where("id",$id)->first(); + + if (empty($cate)) { + return $this->errorJson("分类不存在"); + } + + $rel = CategoryModel::uniacid()->where("id",$id)->delete(); + + if ($rel) { + return $this->successJson("删除成功"); + } else { + return $this->errorJson("删除失败"); + } + } + + public function changeStatus() + { + $id = request()->get("id"); + + $cate = CategoryModel::uniacid()->where("id",$id)->first(); + + if (empty($cate)) { + return $this->errorJson("分类不存在"); + } + + $cate->is_show = ($cate->is_show == 1) ? 2 : 1; + $cate->save(); + return $this->successJson('成功', []); + } + +} \ No newline at end of file diff --git a/plugins/video-share/src/admin/CenterController.php b/plugins/video-share/src/admin/CenterController.php new file mode 100644 index 00000000..7be3fa22 --- /dev/null +++ b/plugins/video-share/src/admin/CenterController.php @@ -0,0 +1,297 @@ +isEnabled('yz-supply')){ + throw new ShopException('请先开启供应链插件!'); + } + $category_list = $this->shopCategory(); + $video_category_list=$this->getVideoCate(); + $import = $this->_getImportRedis(); + return view('Yunshop\VideoShare::center.index', [ + 'category_level' => \Setting::get('shop.category.cat_level') ?: 2, + 'category_list' => json_encode($category_list), + 'video_category_list'=>json_encode($video_category_list), + 'create_category' => 1, + 'import' => json_encode($import), + 'topic_id' => request()->topicId ?: 0, + ])->render(); + } + + public function _getImportRedis() + { + $uniacid = \YunShop::app()->uniacid; + $redis_key = 'yz_supply_import'; + $redis_import = $uniacid . '_import'; + $all_page_import = $uniacid . '_import_page'; + $now_page_import = $uniacid . '_import_now_page'; + $total_import = $uniacid . '_import_total'; + $import_status = Redis::hget($redis_key, $redis_import); + if ($import_status == '0') { + //导入进度 + $import['import_process'] = number_format(Redis::hget($redis_key, $now_page_import) / Redis::hget($redis_key, $all_page_import) * 100, 2); + $import['import_total'] = Redis::hget($redis_key, $total_import); + $import['import_exits'] = Redis::hget($redis_key, $now_page_import) * $this->importSize; + $import['import_status'] = 1; + } else { + $import['import_status'] = 0; + } + + return $import; + } + + + + /** + * 选择会员 + * @return \Illuminate\Http\JsonResponse + */ + public function getMemberList() + { + $kwd = request()->keyword; + $members = []; + if ($kwd) { + $members = \app\backend\modules\member\models\Member::select(['uid', 'nickname', 'avatar', 'mobile', 'realname'])->join('yz_member', function ($join) { + $join->on('mc_members.uid', 'yz_member.member_id')->whereNull('yz_member.deleted_at'); + })->uniacid()->searchLike($kwd)->paginate(10)->toArray(); + } + + return $this->successJson('', $members); + } + + protected function shopCategory() + { + $set = \Setting::get('shop.category'); + $list = Category::getCategorys(0)->select('id', 'name', 'enabled')->pluginId()->get(); + $list->map(function ($category) use ($set) { + $childrens = Category::getChildrenCategorys($category->id, $set)->select('id', 'name', 'enabled')->get()->toArray(); + foreach ($childrens as $key => &$children) { + + if ($set['cat_level'] == 3 && $children['has_many_children']) { + $children['childrens'] = $children['has_many_children']; + } else { + $children['childrens'] = []; + } + } + $category->childrens = $childrens; + + }); + + return $list; + } + + + + public function select() + { + + //中台商品处理 + $categorySearch = array_filter(request()->category, function ($item) { + return is_array($item) ? !empty($item[0]) : !empty($item); + }); + $set = \Setting::get('plugin.video-share'); + + if(!$categorySearch['video_id']){ + throw new AppException('请选择要导入的短视频分类'); + } + $videoId=$categorySearch['video_id']; + unset($categorySearch['video_id']); + if($categorySearch['member_id']<=0&&$set['default_member_id']<=0){ + throw new AppException('请选择关联用户,或者到基础设置里设置默认用户!'); + } + $memberId=$categorySearch['member_id']; + unset($categorySearch['member_id']); + $all_yz_goods_ids =array_column(request()->goods_ids,'product_id'); + $middleground_configuration_id =request()->middleground_configuration_id; + $extra['f_value_id'] = intval(request()->f_value_id); + $set = \Setting::get('plugin.yz_supply'); + if ($set['create_category'] != 1) { + if (!$categorySearch) { + throw new AppException('请选择要导入的分类'); + } + if (!$categorySearch['parentid']) { + throw new AppException('请选择一级分类'); + } + if (!$categorySearch['childid']) { + throw new AppException('请选择二级分类'); + } + if (\Setting::get('shop.category')['cat_level'] == 3 && !$categorySearch['thirdid']) { + throw new AppException('请选择三级分类'); + } + } + if (!$all_yz_goods_ids) { + throw new AppException('请选择至少一件商品'); + } + $errorGoodsIds = GoodsImportService::beforeImport($all_yz_goods_ids, $categorySearch, $extra,$middleground_configuration_id); + if ($errorGoodsIds) { + $string_error = implode(',', $errorGoodsIds); + return $this->errorJson('商品导入供应链选品库失败ID:' . $string_error, []); + } + //短视频处理 + $videoData=[]; + $set = \Setting::get('plugin.video-share'); + $memberId=$memberId>0?$memberId:$set['default_member_id']; + $shopGoodsIds=YzGoods::uniacid()->whereIn('yz_goods_id',$all_yz_goods_ids)->pluck('goods_id','yz_goods_id')->toArray(); + foreach (request()->goods_ids as $val) { + $exist=VideoShareGoods::uniacid()->where(['mid_ground_video_id'=>$val['id'],'mid_ground_config_id'=>request()->middleground_configuration_id])->first(); + if($exist){ + $exist->update([ + 'goods_id' => $shopGoodsIds[$val['product_id']], + 'uid' => $memberId, + 'title' => $val['origin_title'], + 'video' => $val['video_url'] ?: '', + 'file_name' => '', + 'cover' => $val['cover_url'] ?: '', + 'status' => 1, + 'category_id' => $videoId?:0, + 'updated_at'=>time() + ]); + }else{ + $videoData[] = [ + 'goods_id' => $shopGoodsIds[$val['product_id']], + 'uniacid' => \YunShop::app()->uniacid, + 'uid' => $memberId, + 'title' => $val['origin_title'], + 'video' => $val['video_url'] ?: '', + 'file_name' => '', + 'cover' => $val['cover_url'] ?: '', + 'share_num' => 0, + 'like_num' => 0, + 'order_price' => 0, + 'amount_total' => 0, + 'status' => 1, + 'category_id' => $videoId?:0, + 'created_at'=>time(), + 'updated_at'=>time(), + 'mid_ground_video_id'=>$val['id'], + 'mid_ground_config_id'=>request()->middleground_configuration_id + ]; + } + } + VideoShareGoods::insert($videoData); + (new CloudRequestService(request()->middleground_configuration_id))->addVideoStorage(array_column(request()->goods_ids,'id')); + return $this->successJson('导入成功!'); + } + + public function goodsList() + { + + $page = request()->input('page', 1); + $search = request()->input('search', []); + $page_size = intval($search['goods_page_size'] ?: 20); + $search['page'] = $page; + $search['pageSize'] = $page_size; + try { + + $list = (new CloudRequestService(request()->middleground_configuration_id))->goodsList($search,true); + } catch (\Exception $e) { + return $this->errorJson($e->getMessage()); + } + + return $this->successJson('success', $list['data']); + } + + + + public function allSelect() + { + $categorySearch = array_filter(request()->category, function ($item) { + return is_array($item) ? !empty($item[0]) : !empty($item); + }); + $set = \Setting::get('plugin.video-share'); + + if(!$categorySearch['video_id']){ + throw new AppException('请选择要导入的短视频分类'); + } + if(!$categorySearch['member_id']&&!$set['default_member_id']){ + throw new AppException('请选择关联用户,或者到基础设置里设置默认用户!'); + } + $middleground_configuration_id = request()->middleground_configuration_id; + + $extra['f_value_id'] = intval(request()->f_value_id); + $set = \Setting::get('plugin.yz_supply'); + if ($set['create_category'] != 1) { + if (!$categorySearch) { + throw new AppException('请选择要导入的分类'); + } + if (!$categorySearch['parentid']) { + throw new AppException('请选择一级分类'); + } + if (!$categorySearch['childid']) { + throw new AppException('请选择二级分类'); + } + if (\Setting::get('shop.category')['cat_level'] == 3 && !$categorySearch['thirdid']) { + throw new AppException('请选择三级分类'); + } + } else { + if ($categorySearch && !$categorySearch['childid']) { + throw new AppException('请选择二级分类'); + } + if ($categorySearch && \Setting::get('shop.category')['cat_level'] == 3 && !$categorySearch['thirdid']) { + throw new AppException('请选择三级分类'); + } + } + $list = (new \Yunshop\VideoShare\common\service\CloudRequestService($middleground_configuration_id))->goodsList([]); + $count = $list['data']['total']; + if($count>2000) $count = 2000;//固定最大值2000 + $all_page = (int)ceil($count / 10); + + $uniacid = \YunShop::app()->uniacid; + for ($page = 1; $page <= $all_page; $page++) { + usleep(50000); //延迟尽量避免同时请求中台 造成中台不返回数据 + $this->dispatch(new AllImportJob($categorySearch, $page, [], $uniacid, $extra,$middleground_configuration_id)); + } + $redis_key = 'yz_supply_video_import'; + $redis_import = $uniacid . '_video_import'; + $all_page_import = $uniacid . '_video_import_page'; + $now_page_import = $uniacid . '_video_import_now_page'; + $total_import = $uniacid . '_video_import_total'; + Redis::hset($redis_key, $redis_import, 0); + Redis::hset($redis_key, $all_page_import, $all_page); + Redis::hset($redis_key, $now_page_import, 0); + Redis::hset($redis_key, $total_import, $count); + return $this->successJson('短视频导入请求成功', []); + } + + public function getVideoCate(){ + $list=CategoryModel::uniacid()->get()->toArray(); + return $list; + } + + public function getMidGroundList(){ + if(!app('plugins')->isEnabled('yz-supply')){ + return $this->successJson('success',[]); + } + $where[] = ['status',1]; + $data = MiddlegroundConfiguration::uniacid()->where($where)->orderBy('sort','desc')->orderBy('id','desc')->get(); + return $this->successJson("success",$data); + } + + public function manual(){ + (new TimedTaskImportService())->handle(); + return $this->successJson('success'); + } +} \ No newline at end of file diff --git a/plugins/video-share/src/admin/SetController.php b/plugins/video-share/src/admin/SetController.php new file mode 100644 index 00000000..f833588c --- /dev/null +++ b/plugins/video-share/src/admin/SetController.php @@ -0,0 +1,212 @@ + request()->getSchemeAndHttpHost().'/addons/yun_shop'.\Storage::disk('audios')->url('1565339320858506.mp4') + ])->render();*/ + + $url = uploadUrl('new'); + $set = \Setting::get('plugin.video-share'); + if(!empty($set['releaserMember'])){ + $member = Member::select('uid', 'nickname', 'avatar', 'mobile')->uniacid()->whereIn('uid', $set['releaserMember'])->get(); + } + $type = 0; + if (config('app.framework') == 'platform') { + $type = 1; + } + if($set['default_member_id']){ + $defaultMember = Member::select('uid', 'nickname', 'avatar', 'mobile')->uniacid()->where('uid', $set['default_member_id'])->first(); + } + $set['page'] = yzAppFullUrl('VideoList'); + $set['mini_page'] = '/packageC/video_goods/VideoList/VideoList'; + $category = CategoryModel::uniacid()->select("id","name")->where("is_show",1)->orderBy('sort','desc')->get(); + $category = empty($category) ? [] : $category->toArray(); + + return view('Yunshop\VideoShare::set.index', [ + 'url' => json_encode($url), + 'set' => json_encode($set), + 'type' => json_encode($type), + 'choosedStore'=>json_encode($defaultMember?:[]), + 'category' => json_encode($category), + 'releaserMember' => json_encode($member ? $member : []), + 'pluginStatus' => json_encode($this->getPluginStatus()), + ])->render(); + } + + public function getImages() + { + $thumb = CoreAttach::uniacid()->where('type', 1); + if (request()->year != '不限') { + $search['year'] = request()->year; + } + if(request()->month != '不限') { + $search['month'] = request()->month; + } + $thumb = $thumb->orderBy('id', 'desc'); + if ($search) { + $thumb = $thumb->search($search); + } + $url = $thumb->paginate()->toArray(); + $url['data'] = collect($url['data'])->map(function ($thumb) { + $collection = collect($thumb)->put('url', yz_tomedia($thumb['attachment'])); + return $collection; + }); + $url['data'] = $url['data']->toArray(); + return $this->successJson('获取成功', $url); + } + + public function sub() + { + $setdata = request()->setdata; + + if ($setdata) { + if (\Setting::set('plugin.video-share', $setdata)) { + return $this->successJson('保存成功'); + } + } else { + return $this->errorJson('参数错误'); + } + } + + public function getReleaser() + { + $releaser = [ + 'member' => '会员', + 'agent' => '推广员', + 'appoint_member' => '指定会员' + ]; + + $teamDividend = app('plugins')->isEnabled('team-dividend'); + if ($teamDividend) { + $releaser['team_dividend'] = '经销商'; + } + + $store = app('plugins')->isEnabled('store-cashier'); + if ($store) { + $releaser['store'] = '门店店长/店员'; + } + + $hotel = app('plugins')->isEnabled('hotel'); + if ($hotel) { + $releaser['hotel'] = '酒店店长/店员'; + } + + $supplier = app('plugins')->isEnabled('supplier'); + if ($supplier) { + $releaser['supplier'] = '供应商'; + } + + return $this->successJson('获取发布者成功', [ + 'releaser' => $releaser + ]); + } + + public function getUploadUrl() + { + $thumb = new CoreAttach(); + + if (request()->year != '不限') { + $search['year'] = request()->year; + } + + if(request()->month != '不限') { + $search['month'] = request()->month; + } + + $thumb = $thumb->where('uniacid', \YunShop::app()->uniacid)->orderBy('id', 'desc'); + + if ($search) { + $thumb = $thumb->search($search); + } + + $list = $thumb->paginate()->toArray(); + + $list['data'] = collect($list['data'])->map(function ($thumb) { + $thumb['thumb'] = yz_tomedia($thumb['thumb'], true); + return $thumb; + }); + + $list['data'] = $list['data']->toArray(); + + return $this->successJson('获取成功', [ + 'list' => $list, + ]); + } + + public function getMember() + { + $keyword = request()->keyword; + $member = Member::select('uid', 'nickname', 'avatar', 'mobile')->uniacid()->searchLike($keyword)->get(); + return $this->successJson('获取成功',$member); + + } + + //获取插件状态 + protected function getPluginStatus() + { + $result = [ + 'member' => true, + 'agent' => true,//推广员 + 'appoint_member' => true,//指定会员 + 'team_dividend'=>false,//经销商 + 'store'=>false,//门店店长/店员 + 'hotel'=>false,//酒店 + 'supplier'=>false//供应商 + ]; + + $teamDividend = app('plugins')->isEnabled('team-dividend'); + if ($teamDividend) { + $result['team_dividend'] = true; + } + + $store = app('plugins')->isEnabled('store-cashier'); + if ($store) { + $result['store'] = true; + } + + $hotel = app('plugins')->isEnabled('hotel'); + if ($hotel) { + $result['hotel'] = true; + } + + $supplier = app('plugins')->isEnabled('supplier'); + if ($supplier) { + $result['supplier'] = true; + } + + return $result; + } + + + public function getVideoCate(){ + $list=CategoryModel::uniacid()->get()->toArray(); + return $this->successJson('success',$list); + } + + public function getMidGroundList(){ + if(!app('plugins')->isEnabled('yz-supply')){ + return $this->successJson('success',[]); + } + $where[] = ['status',1]; + $data = MiddlegroundConfiguration::uniacid()->where($where)->orderBy('sort','desc')->orderBy('id','desc')->get(); + return $this->successJson("success",$data); + } + +} \ No newline at end of file diff --git a/plugins/video-share/src/admin/UploadController.php b/plugins/video-share/src/admin/UploadController.php new file mode 100644 index 00000000..9f05e609 --- /dev/null +++ b/plugins/video-share/src/admin/UploadController.php @@ -0,0 +1,437 @@ +global = SystemSetting::settingLoad('global', 'system_global'); + $this->remote = SystemSetting::settingLoad('remote', 'system_remote'); + $this->common = $this->common(); + $this->uniacid = \YunShop::app()->uniacid; + } + + public function upload() + { + if (!$_FILES['file']['name']) { + return $this->errorJson('上传失败, 请选择要上传的文件!'); + } + if ($_FILES['file']['error'] != 0) { + return $this->errorJson('上传失败, 请重试.'); + } + + $ext = pathinfo($_FILES['file']['name'], PATHINFO_EXTENSION); + $ext = strtolower($ext); + $originname = $_FILES['file']['name']; + $filename = file_random_name(base_path() . '/static/upload' . $this->common['folder'], $ext); + + $file = $this->file_upload($_FILES['file'], $this->common['type'], $this->common['folder'] . $filename, true); + if (is_error($file)) { + return $this->errorJson($file['message']); + } + + $pathname = $file['path']; + $fullname = base_path() . '/static/upload/' . $pathname; + + return $this->saveData($this->common['type'], $fullname, $originname, $ext, $filename, $this->common['module_upload_dir'], $pathname, $this->common['option']); + } + + public function file_upload($file, $type = 'image', $name = '', $compress = false) + { + $harmtype = array('asp', 'php', 'jsp', 'js', 'css', 'php3', 'php4', 'php5', 'ashx', 'aspx', 'exe', 'cgi'); + + if (!$file) { + return error(-1, '没有上传内容'); + } + if (!in_array($type, array('image', 'thumb', 'voice', 'video', 'audio'))) { + return error(-2, '未知的上传类型'); + } + $ext = pathinfo($file['name'], PATHINFO_EXTENSION); + $ext = strtolower($ext); + switch ($type) { + case 'image': + //$allowExt = $this->global['image_extentions']; + $allowExt = ['bmp','jpg','png','tif','gif','pcx','tga','exif','fpx','svg','psd','cdr','pcd','dxf']; + $limit = $this->global['image_limit']; + break; + case 'thumb': + case 'voice': + case 'audio': + $allowExt = $this->global['audio_extentions']; + $limit = $this->global['audio_limit']; + break; + case 'video': + $allowExt = $this->global['audio_extentions']; + $limit = $this->global['audio_limit']; + break; + } + $setting = $this->global[$type.'_extentions']; + if ($setting) { + $allowExt = array_merge($setting, $allowExt); + } + if (!in_array(strtolower($ext), $allowExt) || in_array(strtolower($ext), $harmtype)) { + return error(-3, '不允许上传此类文件'); + } + /*if ($limit && $limit * 1024 < filesize($file['tmp_name'])) { + return error(-4, "上传的文件超过大小限制,请上传小于 {$limit}k 的文件"); + }*/ + + $result = array(); + if (!$name || $name == 'auto') { + $path = "/{$type}s/{$this->uniacid}" . '/'.date('Y/m/'); + Utils::mkdirs(base_path() . '/static/upload' . $path); + $filename = file_random_name(base_path() . '/' . $path, $ext); + $result['path'] = $path . $filename; + } else { + Utils::mkdirs(dirname(base_path() . '/static/upload/' . $name)); + if (!strexists($name, $ext)) { + $name .= '.' . $ext; + } + $result['path'] = $name; + } + + $save_path = base_path() . '/static/upload/' . $result['path']; + if (!file_move($file['tmp_name'], $save_path)) { + return error(-1, '保存上传文件失败'); + } + + if ($type == 'image' && $compress) { + file_image_quality($save_path, $save_path, $ext, $this->global); + } + + $result['success'] = true; + return $result; + } + + public function saveData($type, $fullname, $originname, $ext, $filename, $module_upload_dir, $pathname, $option) + { + if ($type == 'image') { + $thumb = !$this->global['thumb'] ? 0 : 1; + $width = intval($this->global['thumb_width']); + if (isset($option['thumb'])) { + $thumb = !$option['thumb'] ? 0 : 1; + } + if (isset($option['width']) && $option['width']) { + $width = intval($option['width']); + } + if ($thumb == 1 && $width > 0) { + $thumbnail = file_image_thumb($fullname, '', $width, $this->global); + if ($thumbnail == 1) { + return $this->errorJson('创建目录失败'); + } elseif ($thumbnail == 2) { + return $this->errorJson('目录无法写入'); + } + @unlink($fullname); + if (is_error($thumbnail)) { + return $this->successJson($thumbnail['message']); + } else { + $filename = pathinfo($thumbnail, PATHINFO_BASENAME); + $pathname = $thumbnail; + $fullname = base_path() . '/static/upload' . $pathname; + } + } + } + + $info = array( + 'name' => $originname, + 'ext' => $ext, + 'filename' => $pathname, + 'attachment' => $pathname, + 'url' => yz_tomedia($pathname), + 'is_image' => $type == 'image' ? 1 : 0, + 'filesize' => filesize($fullname), + 'group_id' => intval(request()->group_id) + ); + if ($type == 'image') { + $size = getimagesize($fullname); + $info['width'] = $size[0]; + $info['height'] = $size[1]; + } else { + $size = filesize($fullname); + $info['size'] = sizecount($size); + } + if ($this->remote['type']) { + $remotestatus = file_remote_upload($pathname, true, $this->remote); + if (is_error($remotestatus)) { + file_delete($pathname); + return $this->errorJson('远程附件上传失败,请检查配置并重新上传'.$remotestatus['message']); + } else { + file_delete($pathname); + $info['url'] = yz_tomedia($pathname, false, $this->remote['type']); + } + } + + $core_attach = CoreAttach::create([ + 'uniacid' => $this->uniacid, + //'uid' => \Auth::guard('admin')->user()->uid, + 'uid' => 0, + 'filename' => safe_gpc_html(htmlspecialchars_decode($originname, ENT_QUOTES)), + 'attachment' => $pathname ? : '', + 'type' => $type == 'image' ? 1 : ($type == 'audio'||$type == 'voice' ? 2 : 3), + 'module_upload_dir' => $module_upload_dir, + 'group_id' => intval(request()->group_id), + 'upload_type' => $this->remote['type'] + ]); + + \Log::info('----------上传附件----------', json_encode($info)); + if ($core_attach) { + $info['state'] = 'SUCCESS'; + $info['state'] = 'SUCCESS'; + return $this->successJson('成功', $info); + } else { + return $this->errorJson('失败'); + } + } + + public function image() + { + $year = request()->year; + $month = intval(request()->month); + $page = max(1, intval(request()->page)); + $groupid = intval(request()->groupid); + $page_size = 24; + $is_local_image = $this->common['islocal'] == 'local' ? true : false; + if ($page<=1) { + $page = 0; + $offset = ($page)*$page_size; + } else { + $offset = ($page-1)*$page_size; + } + + if(!$is_local_image) { + $core_attach = new WechatAttachment(); + } else { + $core_attach = new CoreAttach; + } + $core_attach = $core_attach->where('uniacid', $this->uniacid)->where('module_upload_dir', $this->common['module_upload_dir']); + + if (!$this->uniacid) { + $core_attach = $core_attach->where('uid', \Auth::guard('admin')->user()->uid); + } + if ($groupid > 0) { + $core_attach = $core_attach->where('group_id', $groupid); + } + if ($groupid == 0) { + $core_attach = $core_attach->where('group_id', -1); + } + if ($year || $month) { + $start_time = $month ? strtotime("{$year}-{$month}-01") : strtotime("{$year}-1-01"); + $end_time = $month ? strtotime('+1 month', $start_time) : strtotime('+12 month', $start_time); + $core_attach = $core_attach->where('created_at', '>=', $start_time)->where('created_at', '<=', $end_time); + } + if ($this->common['islocal']) { + $core_attach = $core_attach->where('type', 1); + } else { + $core_attach = $core_attach->where('type', 'image'); + } + + $core_attach = $core_attach->orderby('created_at', 'desc'); + $count = $core_attach->count(); + $core_attach = $core_attach->offset($offset)->limit($page_size)->get(); + + foreach ($core_attach as &$meterial) { + if ($this->common['islocal']) { + $meterial['url'] = yz_tomedia($meterial['attachment']); + unset($meterial['uid']); + } else { + $meterial['attach'] = yz_tomedia($meterial['attachment'], true); + $meterial['url'] = $meterial['attach']; + } + } + + $pager = pagination($count, $page, $page_size,'',$context = array('before' => 5, 'after' => 4, 'isajax' => '1')); + $result = array('items' => $core_attach, 'pager' => $pager); + + $array = [ + 'message' => [ + 'erron' => 0, + 'message' => $result + ], + 'redirect' => '', + 'type' => 'ajax' + ]; + + return \GuzzleHttp\json_encode($array); + } + + public function fetch() + { + $url = trim(request()->url); + $size = intval($_FILES['file']['size']); + $resp = ihttp_get($url); + if (!$resp) { + return $this->errorJson('提取文件失败'); + } + if ($this->common['type'] == 'image') { + switch ($resp['headers']['Content-Type']) { + case 'application/x-jpg': + case 'image/jpeg': + $ext = 'jpg'; + break; + case 'image/png': + $ext = 'png'; + break; + case 'image/gif': + $ext = 'gif'; + break; + default: + return $this->errorJson('提取资源失败, 资源文件类型错误.'); + break; + } + } else { + return $this->errorJson('提取资源失败, 仅支持图片提取.'); + } + + if (intval($resp['headers']['Content-Length']) > $this->global[$this->common['type'].'_limit'] * 1024) { + return $this->errorJson('上传的媒体文件过大(' . sizecount($size) . ' > ' . sizecount($this->global[$this->common['type'].'_limit'] * 1024)); + } + + $originname = pathinfo($url, PATHINFO_BASENAME); + $filename = file_random_name(base_path() . '/static/upload/' . $this->common['folder'], $ext); + $pathname = $this->common['folder'] . $filename; + $fullname = base_path() . '/static/upload/' . $pathname; + + if (file_put_contents($fullname, $resp['content']) == false) { + return $this->errorJson('提取失败'); + } + + return $this->saveData($this->common['type'], $fullname, $originname, $ext, $filename, $this->common['module_upload_dir'], $pathname, $this->common['option']); + } + + public function common() + { + $dest_dir = request()->dest_dir; + $type = in_array(request()->upload_type, array('image','audio','video')) ? request()->upload_type : 'image'; + $option = array_elements(array('uploadtype', 'global', 'dest_dir'), $_POST); + $option['width'] = intval($option['width']); + $option['global'] = request()->global; + $islocal = request()->local == 'local'; + + if (preg_match('/^[a-zA-Z0-9_\/]{0,50}$/', $dest_dir, $out)) { + $dest_dir = trim($dest_dir, '/'); + $pieces = explode('/', $dest_dir); + if(count($pieces) > 3){ + $dest_dir = ''; + } + } else { + $dest_dir = ''; + } + + $module_upload_dir = ''; + if($dest_dir != '') { + $module_upload_dir = sha1($dest_dir); + } + + if ($option['global']) { + $folder = "{$type}s/global/"; + if ($dest_dir) { + $folder .= '' . $dest_dir . '/'; + } + } else { + $folder = "{$type}s/{$this->uniacid}"; + if (!$dest_dir) { + $folder .= '/' . date('Y/m/'); + } else { + $folder .= '/' . $dest_dir . '/'; + } + } + + return [ + 'dest_dir' => $dest_dir, + 'module_upload_dir' => $module_upload_dir, + 'type' => $type, + 'options' => $option, + 'folder' => $folder, + 'islocal' => $islocal + ]; + } + + public function delete() + { + $uid = \Auth::guard('admin')->user()->uid; + $is_founder = $uid == '1' ? 1 : 0; + $role = AppUser::where('uid', $uid)->first()['role']; + if (!$is_founder && $role != 'manager' && $role != 'owner') { + return $this->errorJson('您没有权限删除文件'); + } + $id = request()->id; + if (!is_array($id)) { + $id = array(intval($id)); + } + $id = safe_gpc_array($id); + + $core_attach = CoreAttach::where('id', $id); + + if (!$this->uniacid) { + $core_attach = $core_attach->where('uid', $uid); + } else { + $core_attach = $core_attach->where('uniacid', $this->uniacid); + } + $core_attach = $core_attach->first(); + + if ($core_attach['upload_type']) { + $status = file_remote_delete($core_attach['attachment'], $core_attach['upload_type'], $this->remote); + } else { + $status = file_delete($core_attach['attachment']); + } + if (is_error($status)) { + return $this->errorJson($status['message']); + } + + $core_attach->delete(); + if ($core_attach->trashed()) { + return $this->successJson('删除成功'); + } else { + return $this->errorJson('删除数据表数据失败'); + } + } + + public function video() + { + $server = $this->common['islocal'] ? 'local' : 'perm'; + $page_index = max(1, request()->page); + $page_size = 5; + if ($page_index<=1) { + $page_index = 0; + $offset = ($page_index)*$page_size; + } else { + $offset = ($page_index-1)*$page_size; + } + + $material_news_list = material_list('video', $server, array('page_index' => $page_index, 'page_size' => $page_size), $this->uniacid, $offset); + $material_list = $material_news_list['material_list']; + $pager = $material_news_list['page']; + foreach ($material_list as &$item) { + $item['createtime'] = $item['created_at']->timestamp; + $item['url'] = yz_tomedia($item['attachment']); + unset($item['uid']); + } + $result = array('items' => $material_list, 'pager' => $pager); + $array = [ + 'message' => [ + 'erron' => 0, + 'message' => $result + ], + 'redirect' => '', + 'type' => 'ajax' + ]; + + return \GuzzleHttp\json_encode($array); + } + +} \ No newline at end of file diff --git a/plugins/video-share/src/admin/VideoCommentsController.php b/plugins/video-share/src/admin/VideoCommentsController.php new file mode 100644 index 00000000..f4a1d77d --- /dev/null +++ b/plugins/video-share/src/admin/VideoCommentsController.php @@ -0,0 +1,159 @@ +render(); + } + + public function getCommentsCategoryList() + { + $search = request()->input('search'); + $commentsList = Comment::uniacid(); + + if (isset($search['video_title'])) { + $commentsList = $commentsList->whereHas('video', function ($query) use ($search) { + $query->where('title', 'like', '%' . $search['video_title'] . '%'); + }); + } + + if (isset($search['member_id'])) { + $commentsList = $commentsList->where('uid', 'like', '%' . $search['member_id'] . '%'); + } + + if (isset($search['member_msg'])) { + $commentsList = $commentsList->whereHas('member', function ($query) use ($search) { + $query->where('mobile', 'like', '%' . $search['member_msg'] . '%') + ->orwhere('nickname', 'like', '%' . $search['member_msg'] . '%') + ->orwhere('realname', 'like', '%' . $search['member_msg'] . '%'); + }); + } + + if (isset($search['time'])) { + $commentsList = $commentsList->whereBetween('created_at', [$search['time']['start'], $search['time']['end']]); + } + + $commentsList = $commentsList->orderBy('created_at', 'desc')->paginate(); + + $commentsList->getCollection()->transform(function ($model) { + return [ + 'id' => $model->id, + 'uid' => $model->uid, + 'nick_name' => $model->nick_name, + 'head_img_url' => $model->head_img_url, + 'content' => $model->content, + 'video' => [ + 'video_title' => $model->video->title, + 'video_url' => yz_tomedia($model->video->video), + "cover" => yz_tomedia($model->video->cover) + ], + 'created_at' => $model->created_at->format('Y-m-d H:i:s'), + ]; + }); + + return $this->successJson('ok', $commentsList); + } + + public function displayComments() + { + $id = \YunShop::request()->id; + + $finder = VideoShareGoods::uniacid()->find($id); + if (!$finder) { + throw new AppException('不存在的视频'); + } + + return view('Yunshop\VideoShare::comments.view-comments')->render(); + } + + public function getDisplayCommentsList() + { + $id = \YunShop::request()->id; + $num = Comment::uniacid() + ->where('video_id', $id) + ->count(); + + $finder = VideoShareGoods::uniacid()->find($id); + if (!$finder) { + throw new AppException('不存在的视频'); + } + + $commentsList = Comment::uniacid() + ->with(['hasManyReply', 'hasManySupport' => function ($q) { + $q->where(['member_id' => \YunShop::app()->getMemberId(), 'status' => 1]); + }]) + ->where(['video_id' => $id, 'comment_id' => 0]) + ->orderBy('created_at', 'desc') + ->orderBy('id', 'desc') + ->paginate(); + $commentsList->getCollection()->transform(function ($model) { + return [ + 'id' => $model->id, + 'uid' => $model->uid, + 'nick_name' => $model->nick_name, + 'head_img_url' => $model->head_img_url, + 'content' => $model->content, + 'created_at' => $model->created_at->format('Y-m-d H:i:s'), + 'children_comment' => $model->hasManyReply->transform(function ($model) { + return [ + 'id' => $model->id, + 'nick_name' => $model->nick_name, + 'head_img_url' => $model->head_img_url, + 'content' => $model->content, + 'created_at' => $model->created_at->format('Y-m-d H:i:s'), + 'reply_name' => $model->reply_name, + ]; + }) + ]; + }); + + return $this->successJson('ok', [ + 'commentsList' => $commentsList, + 'num' => $num + ]); + } + + public function del() + { + $id = \YunShop::request()->id; + + $comment = Comment::uniacid() + ->where('id', $id) + ->first(); + + + if (!$comment) { + return $this->errorJson('评论不存在'); + } + + if ($comment->comment_id != 0) { + $comment->delete(); + return $this->successJson('评论删除成功'); + } + + if ($comment->comment_id == 0) { + DB::beginTransaction(); + try { + Comment::where('comment_id', $id)->delete(); + $comment->delete(); + DB::commit(); + return $this->successJson('评论删除成功'); + } catch (\Exception $e) { + DB::rollBack(); + return $this->errorJson('评论删除失败'); + } + + }; + } +} \ No newline at end of file diff --git a/plugins/video-share/src/admin/VideoGoodsController.php b/plugins/video-share/src/admin/VideoGoodsController.php new file mode 100644 index 00000000..317e0d22 --- /dev/null +++ b/plugins/video-share/src/admin/VideoGoodsController.php @@ -0,0 +1,320 @@ +search; + $id = request()->id; + $search['id'] = $id ? : $search['id']; + $list = VideoShareGoods::getList($search) + ->orderBy('id', 'desc') + ->paginate(); + $list->map(function ($item) { + // 图片 + $item->goods->thumb = yz_tomedia($item->goods->thumb); + $item->cover = yz_tomedia($item->cover); + $item->status = intval($item->status); + }); + + $category = CategoryModel::uniacid()->get(); + $category = empty($category) ? [] : $category->toArray(); + array_unshift($category,["id"=>0,"name"=>"请选择"]); + return view('Yunshop\VideoShare::videoGoods.list', [ + 'list' => json_encode($list), + 'search' => json_encode($search), + 'category' => json_encode($category) + ])->render(); + } + + public function test() + { + $list = VideoShareGoods::getList([]) + ->orderBy('id', 'desc') + ->paginate(); + + $list->map(function ($item) { + // 图片 + $item->goods->thumb = yz_tomedia($item->goods->thumb); + $item->cover = yz_tomedia($item->cover); + $item->status = intval($item->status); + }); + var_dump($list->first()->status);exit(); + $model = VideoShareGoods::find(20); + echo '
';print_r($model->toArray());exit();
+    }
+
+    //中台短视频更新
+    public function updateYzGoods()
+    {
+        $id = intval(request()->input('id'));
+        $goodsId=intval(request()->input('goods_id'));
+        if (empty($id)||empty($goodsId)) {
+            throw new ShopException('参数错误');
+        }
+        if (!app('plugins')->isEnabled('yz-supply')) {
+            throw new ShopException('更新失败!请先启用供应链插件!');
+        }
+        $video_model=VideoShareGoods::uniacid()->find($id);
+        YzGoodsService::setSet($video_model->mid_ground_config_id);
+        $yzVideoDetail=(new \Yunshop\VideoShare\common\service\CloudRequestService($video_model->mid_ground_config_id))->goodsList(['id'=>$video_model->mid_ground_video_id,'page'=>1])['data']['list'][0]?:[];
+        if(empty($yzVideoDetail)){
+            throw new ShopException('更新失败!获取供应链短视频信息失败!');
+        }
+        $goods_model = \Yunshop\YzSupply\models\Goods::select('id', 'uniacid', 'status')->with('hasOneYzGoods')->find($goodsId);
+        if (!$goods_model && !$goods_model->hasOneYzGoods) {
+            throw new ShopException('关联商品不存在或已被删除');
+        }
+        $updateGoods=0;
+        if($goods_model->hasOneYzGoods->yz_goods_id==$yzVideoDetail['product_id']){
+            $updateGoods=$goods_model->id;
+        }else{
+            $exist=\Yunshop\YzSupply\models\YzGoods::uniacid()->where(['middleground_configuration_id'=>$video_model->mid_ground_config_id,'yz_goods_id'=>$yzVideoDetail['product_id']])->first();
+            if($exist){
+                $updateGoods=$exist->goods_id;
+            }
+        }
+        //商城中已存在的商品调用供应链更新商品方法,不存在的导入
+        if($updateGoods){
+            \Yunshop\YzSupply\services\YzGoodsService::updateGoods($updateGoods, \Yunshop\VideoShare\common\service\YzGoodsService::requestYz($yzVideoDetail['product_id'])['yz_goods']);
+        }else{
+            $errorGoodsIds=GoodsImportService::beforeImport([$yzVideoDetail['product_id']], [], [],$video_model->mid_ground_config_id);
+            if (empty($errorGoodsIds)) {
+                $shopGoods=YzGoods::uniacid()->where(['yz_goods_id'=>$yzVideoDetail['product_id'],'middleground_configuration_id'=>$video_model->mid_ground_config_id])->first();
+                if($shopGoods){
+                    $updateGoods=$shopGoods->goods_id;
+                }
+            }
+        }
+        $video_model->update([
+            'title'=>$yzVideoDetail['title'],
+            'cover'=>$yzVideoDetail['cover_url'],
+            'video'=>$yzVideoDetail['video_url'],
+            'status'=>$yzVideoDetail['is_display'],
+            'goods_id'=>$updateGoods
+        ]);
+        return $this->errorJson('短视频更新成功!');
+
+    }
+
+    // plugin.video-share.admin.video-goods.search
+    public function search()
+    {
+        $search = request()->search;
+        $list = VideoShareGoods::getList($search)
+            ->orderBy('id', 'desc')
+            ->paginate();
+        $list->map(function ($item) {
+            // 图片
+            $item->goods->thumb = yz_tomedia($item->goods->thumb);
+            $item->cover = yz_tomedia($item->cover);
+        });
+
+        return $this->successJson('成功', [
+            'list' => $list
+        ]);
+    }
+
+    // plugin.video-share.admin.video-goods.changeStatus
+    public function changeStatus()
+    {
+        $vid = intval(request()->vid);
+        if (!$vid) {
+            return $this->errorJson('参数错误');
+        }
+        $videoGoods = VideoShareGoods::find($vid);
+        if (!$videoGoods) {
+            return $this->errorJson('未找到数据');
+        }
+        $status = $videoGoods->status == 1? 0 : 1;
+        $videoGoods->status = $status;
+        $videoGoods->save();
+
+        return $this->successJson('成功', []);
+    }
+
+    public function changeRecommend()
+    {
+        $vid = intval(request()->vid);
+        if (!$vid) {
+            return $this->errorJson('参数错误');
+        }
+        $videoGoods = VideoShareGoods::find($vid);
+        if (!$videoGoods) {
+            return $this->errorJson('未找到数据');
+        }
+        $status = $videoGoods->is_recommend == 1? 0 : 1;
+        $videoGoods->is_recommend = $status;
+        $videoGoods->save();
+
+        return $this->successJson('成功', []);
+    }
+
+    public function changeCategory()
+    {
+        $id = intval(request()->id);
+        if (!$id) {
+            return $this->errorJson('参数错误');
+        }
+        $videoGoods = VideoShareGoods::find($id);
+        if (!$videoGoods) {
+            return $this->errorJson('未找到数据');
+        }
+        $category_id = request()->get("category_id");
+        if (!$category_id) {
+            return $this->errorJson('参数错误');
+        }
+        $videoGoods->category_id = $category_id;
+        $videoGoods->save();
+
+        return $this->successJson('成功', []);
+    }
+
+    public function del()
+    {
+        $id = request()->id;
+        //进行文件删除
+        $videoGoods = VideoShareGoods::find($id);
+        if (empty($videoGoods)) {
+            return $this->errorJson('视频不存在或已删除');
+        }
+        if($videoGoods->mid_ground_video_id>0){
+                (new CloudRequestService($videoGoods->mid_ground_config_id))->delVideoStorage([$videoGoods->mid_ground_video_id]);
+        }else{
+            Storage::disk('audios')->delete($videoGoods->file_name);
+        }
+        $result = VideoShareGoods::where('id',$id)->delete();
+
+        if ($result) {
+            return $this->successJson('删除成功');
+        } else {
+            return $this->errorJson('数据异常,删除失败');
+        }
+    }
+
+    public function video()
+    {
+        $id = request()->id;
+
+        $video = VideoShareGoods::uniacid()->find($id);
+
+        if (!$video){
+            return $this->errorJson('找不到该视频');
+        }
+
+        return $this->successJson('查询成功',$video);
+    }
+
+    //修改视频标题
+    public function editTitle()
+    {
+        $data = request()->all();
+        if (!$data['title']){
+            return $this->errorJson('标题不能为空');
+        }
+        $videoShareGoods = VideoShareGoods::uniacid()->find($data['id']);
+
+        if (!$videoShareGoods) {
+            return $this->errorJson('视频不存在');
+        }
+
+        $videoShareGoods->title = $data['title'];
+        if (!$videoShareGoods->save()) {
+            return $this->errorJson('标题修改失败');
+        }
+        return $this->successJson('标题修改成功');
+    }
+
+    //获取商品列表
+    public function getGoodList()
+    {
+        $good_list = Goods::uniacid()->select('id','title','thumb')->whereNotIn('plugin_id', [46]);
+
+        if (request()->search) {
+            $good_list = $good_list->where(function ($q) {
+                $q->where('id', 'like', '%' . request()->search . '%')
+                    ->orWhere('title', 'like', '%' . request()->search . '%');
+            });
+
+        }
+        $good_list = $good_list->paginate()->toArray();
+
+        foreach ($good_list['data'] as &$item){
+            $item['thumb'] = yz_tomedia($item['thumb']);
+        }
+        return $this->successJson('ok',$good_list);
+    }
+
+    //更换关联商品
+    public function editGoods()
+    {
+        $res = request()->all();
+
+        if (!isset($res['goods_id']) or !isset($res['video_goods_id'])){
+            return $this->errorJson('参数错误');
+        }
+
+        $videoShareGoods = VideoShareGoods::uniacid()->find($res['video_goods_id']);
+        $videoShareGoods->goods_id = $res['goods_id'];
+        if ($videoShareGoods->save()){
+            return $this->successJson('修改关联商品成功');
+        }
+
+        return $this->errorJson('修改关联商品失败');
+
+    }
+    //上传视频
+    public function uploadAudio()
+    {
+        $id = request()->id;
+        $video_file = request()->input('video_file');
+        $cover_file = request()->input('cover_file');
+        $video_url = request()->input('video_url');
+        $type = request()->input('type');
+        $videoShareGoods = VideoShareGoods::uniacid()->where('id', $id)->first();
+        $update = [];
+        if ($type == 1) {
+            if ($video_file) {
+                $update['video'] = $video_file;
+            }
+            if ($cover_file) {
+                $update['cover'] = $cover_file;
+            }
+        } elseif ($type == 2) {
+            $re = "/^https(.*)[.]mp4$/";
+            if (!preg_match($re, request()->video_url)) {
+                return $this->errorJson('请输入正确的视频地址');
+            }
+            $update['video'] = $video_url;
+
+            if ($cover_file) {
+                $update['cover'] = $cover_file;
+            }
+        }
+        if (empty($update)) {
+            return $this->errorJson('参数不能为空');
+        }
+        if ($videoShareGoods->update($update)) {
+            return $this->successJson('更换视频成功');
+        } else {
+            return $this->errorJson('更换视频失败.');
+        }
+    }
+} 
\ No newline at end of file
diff --git a/plugins/video-share/src/admin/withdrawWidget.php b/plugins/video-share/src/admin/withdrawWidget.php
new file mode 100644
index 00000000..bc5d0259
--- /dev/null
+++ b/plugins/video-share/src/admin/withdrawWidget.php
@@ -0,0 +1,19 @@
+ '', 'poundage_rate' => '']);
+        return view('Yunshop\VideoShare::widget.set', [
+            'set' => $set,
+        ])->render();
+    }
+}
\ No newline at end of file
diff --git a/plugins/video-share/src/common/events/VideoPublishEvent.php b/plugins/video-share/src/common/events/VideoPublishEvent.php
new file mode 100644
index 00000000..cf45c408
--- /dev/null
+++ b/plugins/video-share/src/common/events/VideoPublishEvent.php
@@ -0,0 +1,22 @@
+video = $video;
+    }
+
+    public function getVideo()
+    {
+        return $this->video;
+    }
+}
\ No newline at end of file
diff --git a/plugins/video-share/src/common/events/VideoWatchEvent.php b/plugins/video-share/src/common/events/VideoWatchEvent.php
new file mode 100644
index 00000000..79865f57
--- /dev/null
+++ b/plugins/video-share/src/common/events/VideoWatchEvent.php
@@ -0,0 +1,29 @@
+video_id = $video_id;
+
+        $this->member_id = $member_id;
+    }
+
+    public function getMemberId()
+    {
+        return $this->member_id;
+    }
+
+    public function getVideoId()
+    {
+        return $this->video_id;
+    }
+}
\ No newline at end of file
diff --git a/plugins/video-share/src/common/job/AllImportJob.php b/plugins/video-share/src/common/job/AllImportJob.php
new file mode 100644
index 00000000..28374a5c
--- /dev/null
+++ b/plugins/video-share/src/common/job/AllImportJob.php
@@ -0,0 +1,146 @@
+queue = 'yzsupply';
+        $this->page = $page;
+        $this->search = $search;
+        $this->uniacid = $uniacid;
+        $this->category = $category;
+        $this->extra = $extra;
+        $this->middleground_configuration_id = $middleground_configuration_id;
+        $this->topic = $topic;
+    }
+
+    /**
+     * Execute the job.
+     *
+     * @return bool
+     */
+    public function handle()
+    {
+
+        \YunShop::app()->uniacid = $this->uniacid;
+        \Setting::$uniqueAccountId = $this->uniacid;
+        $videoId=$this->category['video_id'];
+        $memberId=$this->category['member_id'];
+        unset($this->category['video_id']);
+        unset($this->category['member_id']);
+        $redis_key = 'yz_supply_video_import';
+        $redis_import = $this->uniacid.'_video_import';
+        $all_page_import = $this->uniacid.'_video_import_page';
+        $now_page_import = $this->uniacid.'_video_import_now_page';
+        Redis::hset($redis_key,$now_page_import ,$this->page);
+        if ($this->page == Redis::hget($redis_key,$all_page_import)) {
+            Redis::hset($redis_key,$redis_import ,1);
+        }
+        $this->search['page'] = $this->page;
+        $this->search['pageSize'] = 10;
+        \Log::debug('供应链云仓一键导入middleground_configuration_id'.$this->middleground_configuration_id,$this->page);
+        $response =  (new CloudRequestService($this->middleground_configuration_id))->goodsList(['page'=>$this->page]);
+
+        if (empty($response) || $response['code'] > 0 || empty($response['data']['list'])) {
+            //如果没有供应链id 终止检验
+            $response['msg'] = !empty($response['msg']) ? $response['msg'] : 'API返回信息异常';
+            \Log::debug('供应链一键导入报错--API返回信息异常'.$this->middleground_configuration_id,json_encode($response));
+            return true;
+        }
+
+        $list = $response['data']['list'];
+        $all_yz_goods_ids = array_unique(array_column($list,'product_id'));
+        $import_service = new GoodsImportService();
+        $result = array_chunk($all_yz_goods_ids, 30);
+        YzGoodsService::setSet($this->middleground_configuration_id);//设置使用那个供应链
+        $exits_goods = YzGoods::whereIn('yz_goods_id', $all_yz_goods_ids)->where("middleground_configuration_id",YzGoodsService::$config['id'])->pluck('yz_goods_id', 'goods_id')->toArray();
+        foreach ($result as $yz_goods_id) {
+            $res = YzGoodsService::addStorage($yz_goods_id,YzGoodsService::$config['id']);
+            //加入选品库失败 直接跳过
+            if ($res['code'] == 2){
+                \Log::debug('供应链一键导入:加入选品库失败'.$this->middleground_configuration_id,json_encode($res));
+                continue;
+            }
+            $goodsList = YzGoodsService::batchGetAllGoods($yz_goods_id,YzGoodsService::$config['id']);
+            foreach ($goodsList as $goods) {
+                $goods['topic'] = $this->topic;
+                try {
+                    $result = $import_service->import($this->category, $goods, $exits_goods, $this->extra); //todo 查询导入 同步 京东商品数据 到 商城商品表
+                } catch (\Exception $e) {
+                    \Log::debug('供应链一键导入报错'.$this->middleground_configuration_id,json_encode($goods));
+                }
+            }
+        }
+        $set = \Setting::get('plugin.video-share');
+        $memberId=$memberId>0?$memberId:$set['default_member_id'];
+        $shopGoodsIds=YzGoods::uniacid()->whereIn('yz_goods_id',$all_yz_goods_ids)->pluck('goods_id','yz_goods_id')->toArray();
+        $videoData=[];
+        foreach($list as $video){
+            $exist=VideoShareGoods::uniacid()->where(['mid_ground_config_id'=>$this->middleground_configuration_id,'mid_ground_video_id'=>$video['id']])->first();
+            if($exist){
+                $exist->update([
+                    'goods_id' => $shopGoodsIds[$video['product_id']],
+                    'uid' => $memberId,
+                    'title' => $video['title'],
+                    'video' => $video['video_url'] ?: '',
+                    'file_name' => '',
+                    'cover' => $video['cover_url'] ?: '',
+                    'status' => 1,
+                    'category_id' => $videoId?:0,
+                    'updated_at'=>time()
+                ]);
+            }else{
+                $videoData[] = [
+                    'goods_id' => $shopGoodsIds[$video['product_id']],
+                    'uniacid' => \YunShop::app()->uniacid,
+                    'uid' => $memberId,
+                    'title' => $video['title'],
+                    'video' => $video['video_url'] ?: '',
+                    'file_name' => '',
+                    'cover' => $video['cover_url'] ?: '',
+                    'share_num' => 0,
+                    'like_num' => 0,
+                    'order_price' => 0,
+                    'amount_total' => 0,
+                    'status' => 1,
+                    'category_id' => $videoId?:0,
+                    'created_at'=>time(),
+                    'updated_at'=>time(),
+                    'mid_ground_video_id'=>$video['id'],
+                    'mid_ground_config_id'=>$this->middleground_configuration_id
+                ];
+            }
+        }
+        (new CloudRequestService($this->middleground_configuration_id))->addVideoStorage(array_column($list,'id'));
+        if(!empty($videoData)){
+            VideoShareGoods::insert($videoData);
+        }
+
+    }
+}
diff --git a/plugins/video-share/src/common/listeners/OrderCreatedListener.php b/plugins/video-share/src/common/listeners/OrderCreatedListener.php
new file mode 100644
index 00000000..48117a89
--- /dev/null
+++ b/plugins/video-share/src/common/listeners/OrderCreatedListener.php
@@ -0,0 +1,94 @@
+listen(AfterOrderCreatedImmediatelyEvent::class, self::class . '@onCreate');
+    }
+
+    public function onCreate(AfterOrderCreatedImmediatelyEvent $event)
+    {
+        $vid = \YunShop::request()->vid;
+        // 没有发现id
+        if (!$vid) {
+            \Log::debug('视频分享没有vid,订单号:',$event->getOrderModel()->id);
+            return;
+        }
+        $set = \Setting::get('plugin.video-share');
+        // 没开启
+        if (!$set['is_open']) {
+            \Log::debug('视频分享插件没有开启,vid:'.$vid.'订单号:',$event->getOrderModel()->id);
+            return;
+        }
+        // 没有奖励比例
+        if (!$set['percent']) {
+            \Log::debug('视频分享插件没有设置奖励比例,vid:'.$vid.'订单号:',$event->getOrderModel()->id);
+            return;
+        }
+        $order = Order::find($event->getOrderModel()->id);
+
+        $this->handle($order, $set, $vid);
+    }
+
+    // 传参数为了方便测试
+    public function handle($order, $set, $vid)
+    {
+        \Log::debug('视频分享插件订单创建开始,vid:'.$vid.'订单号:',$order->id);
+
+        $vmodel = VideoShareGoods::select()
+            ->where('id', $vid)
+            ->first();
+        if (!$vmodel) {
+            \Log::debug('视频分享插件订单查询视频失败,vid:'.$vid.'订单号:',$order->id);
+            return;
+        }
+
+        if ($set['find_reward'] == 1) {
+            $surplus = bcsub($order->price, $order->cost_amount, 2);
+            $surplus = bccomp($surplus, 0, 2) == 1 ? $surplus : 0;
+            $amount = bcmul($surplus, bcdiv($set['percent'], 100, 4), 2);
+//            $surplus = $order->price-$order->cost_amount;
+//            $surplus = ($surplus<=0) ? 0 : $surplus;
+//            $amount = $surplus * $set['percent'] / 100;
+        } else {
+            $amount = bcmul($order->price, bcdiv($set['percent'], 100, 4), 2);
+//            $amount = $order->price * $set['percent'] / 100;
+        }
+
+        if ($amount <= 0) {
+            \Log::debug('视频分享插件订单计算金额<=0,vid:'.$vid.'订单号:',$order->id);
+            return;
+        }
+
+        Bonus::create([
+            'uniacid' => $order->uniacid,
+            'uid' => $vmodel->uid,
+            'vid' => $vid,
+            'order_id' => $order->id,
+            'ratio' => $set['percent'],
+            'order_price' => $order->price,
+            'amount' => $amount,
+            'status' => 0,
+            'create_month' => date('Y-m')
+        ]);
+
+        $vmodel->order_price = bcadd($vmodel->order_price,$order->price,2);
+        $vmodel->amount_total = bcadd($vmodel->amount_total,$amount,2);
+//        $vmodel->order_price += $order->price;
+//        $vmodel->amount_total += $amount;
+        $vmodel->save();
+
+        \Log::debug('视频分享插件订单创建结束,vid:'.$vid.'订单号:'.$order->id,[$order->price,$amount]);
+    }
+}
diff --git a/plugins/video-share/src/common/listeners/OrderReceiveListener.php b/plugins/video-share/src/common/listeners/OrderReceiveListener.php
new file mode 100644
index 00000000..7db62033
--- /dev/null
+++ b/plugins/video-share/src/common/listeners/OrderReceiveListener.php
@@ -0,0 +1,60 @@
+listen(AfterOrderReceivedImmediatelyEvent::class, self::class . '@onHandle');
+    }
+
+    public function onHandle(AfterOrderReceivedImmediatelyEvent $event)
+    {
+        $order_id = $event->getOrderModel()->id;
+        \Log::debug('视频分享插件收货监听开始',$order_id);
+
+        // file_put_contents(storage_path('logs/pplla.txt'), print_r(date('Ymd His').'视频-订单完成'.PHP_EOL,1), FILE_APPEND);
+        $order = Order::find($order_id);
+
+        $videoBonus = Bonus::select()
+            ->where('order_id', $order->id)
+            ->where('status', 0)
+            ->first();
+        // file_put_contents(storage_path('logs/pplla.txt'), print_r(date('Ymd His').'视频-订单完成orderid:'.$order->id.PHP_EOL,1), FILE_APPEND);
+        if ($videoBonus) {
+            $videoBonus->status = 1;
+            $videoBonus->save();
+            $this->income($videoBonus);
+            \Log::debug('视频分享插件收货监听结束',$order_id);
+            // file_put_contents(storage_path('logs/pplla.txt'), print_r(date('Ymd His').'视频-结算:'.json_encode($videoBonus, 256).PHP_EOL,1), FILE_APPEND);
+        }
+    }
+
+    public function income($videoBonus)
+    {
+        // 收入
+        $store_income_data = [
+            'uniacid'           => $videoBonus->uniacid,
+            'member_id'         => $videoBonus->uid,
+            'incometable_type'  => Bonus::class,
+            'dividend_code'  => IncomeService::VIDEO_SHARE_BONUS,
+            'dividend_table_id'    => $videoBonus->id,
+            'type_name'         => '发现视频奖励',
+            'amount'            => $videoBonus->amount,
+            'status'            => 0,
+            'pay_status'        => 0,
+            'detail'            => '',
+            'create_month'      => date('Y-m', time())
+        ];
+        // file_put_contents(storage_path('logs/pplla.txt'), print_r(date('Ymd His').'视频-收入:'.json_encode($store_income_data, 256).PHP_EOL,1), FILE_APPEND);
+        IncomeService::insertIncome($store_income_data);
+    }
+}
\ No newline at end of file
diff --git a/plugins/video-share/src/common/listeners/VideoPublishListener.php b/plugins/video-share/src/common/listeners/VideoPublishListener.php
new file mode 100644
index 00000000..d00abefe
--- /dev/null
+++ b/plugins/video-share/src/common/listeners/VideoPublishListener.php
@@ -0,0 +1,26 @@
+listen(VideoPublishEvent::class, self::class . '@handle');
+    }
+
+    public function handle(VideoPublishEvent $events)
+    {
+        $video = $events->getVideo();
+        if ($video->status == 1) {
+            return;
+        }
+        //【系统消息通知】
+        (new SystemMsgService())->applyNotice($video,'video-share');
+    }
+}
\ No newline at end of file
diff --git a/plugins/video-share/src/common/member/MemberCenterVideoShare.php b/plugins/video-share/src/common/member/MemberCenterVideoShare.php
new file mode 100644
index 00000000..b9914c1f
--- /dev/null
+++ b/plugins/video-share/src/common/member/MemberCenterVideoShare.php
@@ -0,0 +1,41 @@
+getRedis('member_center_video_share_'.\Yunshop::app()->uniacid);
+        if (is_null($count)) {
+            $count = VideoShareGoods::uniacid()
+                ->where('status', 1)
+                ->count();
+            $this->setRedis('member_center_video_share_'.\Yunshop::app()->uniacid,($count?:0));
+        }
+
+        if ($count > 0) {
+            return true;
+        }
+
+        return false;
+    }
+
+    public function getData()
+    {
+        return [];//本来这里返回数据的,但改为用原来的列表接口
+    }
+}
\ No newline at end of file
diff --git a/plugins/video-share/src/common/member/StoreMemberCenterVideoShare.php b/plugins/video-share/src/common/member/StoreMemberCenterVideoShare.php
new file mode 100644
index 00000000..a86a4d28
--- /dev/null
+++ b/plugins/video-share/src/common/member/StoreMemberCenterVideoShare.php
@@ -0,0 +1,92 @@
+getRedis('store_member_center_video_share');
+        if (is_null($count)) {
+            $count = VideoShareGoods::uniacid()
+                ->where('status', 1)
+                ->where('store_id',$this->request['store_id'])
+                ->count();
+            $this->setRedis('store_member_center_video_share',($count?:0));
+        }
+
+        if ($count > 0) {
+            return true;
+        }
+
+        return false;
+    }
+
+    public function getData()
+    {
+        $uid = \YunShop::app()->getMemberId();
+        $list = VideoShareGoods::uniacid()
+            ->with([
+                'member' => function ($query) {
+                    $query->select('uid','nickname','avatar');
+                },
+            ])
+            ->where('status', 1)
+            ->where('store_id',$this->request['store_id'])
+            ->orderBy('id', 'desc')
+            ->paginate(10)->toArray();
+
+        $businessCard = app('plugins')->isEnabled('business-card');
+
+        foreach ($list['data'] as &$item) {
+            $item['member']['avatar'] = yz_tomedia($item['member']['avatar']);
+            $item['cover'] = yz_tomedia($item['cover']);
+            $item['video'] = yz_tomedia($item['video']);
+            // 会员名片
+            $item['member']['business_card'] = 0;
+            if ($businessCard) {
+                $cardModel = BusinessCardModel::select()
+                    ->where('member_id', $item['member']['uid'])
+                    ->first();
+                if ($cardModel) {
+                    $item['member']['business_card'] = $cardModel->id;
+                }
+            }
+
+            // 会员点赞 默认可以点赞
+            $item['member_like'] = 1;
+            $likeLog = LikeLog::select()
+                ->where('uid', $uid)
+                ->where('vid', $item['id'])
+                ->first();
+            if ($likeLog) {
+                $item['member_like'] = 0;
+            }
+
+            $item['room_id'] = 0;
+
+            //判断是否关注
+            $follow = Follow::uniacid()->where("member_id",$item['uid'])->where("follow_member_id",$uid)->count();
+
+            $item['is_follow'] = ($follow>0) ? 1 : 0;
+        }
+
+        return $list;
+    }
+}
\ No newline at end of file
diff --git a/plugins/video-share/src/common/model/Bonus.php b/plugins/video-share/src/common/model/Bonus.php
new file mode 100644
index 00000000..f5a2cc78
--- /dev/null
+++ b/plugins/video-share/src/common/model/Bonus.php
@@ -0,0 +1,115 @@
+ function ($member) {
+                $member->select(['avatar', 'uid', 'nickname']);
+            },
+            'order' => function ($order) {
+                $order->select(['id', 'price', 'order_sn']);
+            },
+            'video' => function ($video) {
+                $video->select(['id', 'title']);
+            }
+        ])->search($search);
+    }
+
+    public function scopeSearch($query, $search)
+    {
+        if ($search['vid']) {
+            $query->where('vid', $search['vid']);
+        }
+
+        if ($search['uid']) {
+            $query->where('uid', $search['uid']);
+        }
+
+        if ($search['member']) {
+            $query->whereHas('member', function ($member) use ($search) {
+                $member->select('uid', 'nickname', 'realname', 'mobile', 'avatar')
+                    ->where('realname', 'like', '%' . $search['member'] . '%')
+                    ->orWhere('mobile', 'like', '%' . $search['member'] . '%')
+                    ->orWhere('nickname', 'like', '%' . $search['member'] . '%');
+            });
+        }
+
+        if ($search['vtitle']) {
+            $query->whereHas('video', function ($video) use ($search) {
+                $video->select('id', 'title')
+                    ->where('title', 'like', '%' . $search['vtitle'] . '%');
+            });
+        }
+
+        if ($search['vgoods_id']) {
+            $query->whereHas('video', function ($video) use ($search) {
+                $video->select('id', 'title', 'goods_id')
+                    ->where('goods_id', $search['vgoods_id']);
+            });
+        }
+
+        if($search['is_time']){
+            if($search['time']){
+                $range = [$search['start_time'], $search['end_time']];
+                $query->whereBetween('created_at', $range);
+            }
+        }
+
+        return $query;
+    }
+
+    public function getStatusNameAttribute()
+    {
+        $statusName = '待结算';
+        if ($this->status == 1) {
+            $statusName = '已结算';
+        }
+        return $statusName;
+    }
+
+    public function member()
+    {
+        return $this->hasOne(Member::class, 'uid', 'uid');
+    }
+
+    public function order()
+    {
+        return $this->hasOne(Order::class, 'id', 'order_id');
+    }
+
+    public function video()
+    {
+        return $this->hasOne(VideoShareGoods::class, 'id', 'vid');
+    }
+
+    public function bonus()
+    {
+        return $this->hasMany(self::class, 'create_month', 'create_month');
+    }
+
+    public static function boot()
+    {
+        parent::boot();
+        static::addGlobalScope(function (Builder $builder) {
+            $builder->uniacid();
+        });
+    }
+}
\ No newline at end of file
diff --git a/plugins/video-share/src/common/model/CategoryModel.php b/plugins/video-share/src/common/model/CategoryModel.php
new file mode 100644
index 00000000..972484ce
--- /dev/null
+++ b/plugins/video-share/src/common/model/CategoryModel.php
@@ -0,0 +1,25 @@
+uniacid();
+
+        if (!empty($search['keyword'])) {
+            $model->where("id",$search['keyword'])->orWhere("name",$search['keyword']);
+        }
+
+        return $model;
+    }
+}
\ No newline at end of file
diff --git a/plugins/video-share/src/common/model/Comment.php b/plugins/video-share/src/common/model/Comment.php
new file mode 100644
index 00000000..44524384
--- /dev/null
+++ b/plugins/video-share/src/common/model/Comment.php
@@ -0,0 +1,158 @@
+ '评论',
+        self::TYPE_REPLY => '回复',
+        self::TYPE_ADD_COMMENT => '追加评论',
+    ];
+
+    public function getTypeNameAttribute()
+    {
+        return self::$StatusComment[$this->attributes['type']] ?: '追加回复';
+    }
+
+    public function getCommentImagesAttribute()
+    {
+        if($this->attributes['images'])
+        {
+           $images = unserialize($this->attributes['images']);
+           foreach ($images as &$image)
+           {
+               $image = yz_tomedia($image);
+           }
+           return $images;
+        }else{
+            return [];
+        }
+    }
+
+    public function getHeadImageAttribute()
+    {
+        if($this->attributes['head_img_url'])
+        {
+            return yz_tomedia($this->attributes['head_img_url']);
+        }else{
+            return '';
+        }
+    }
+
+    public static function getComments($search){
+        $merModel=self::uniacid();
+
+        if ($search['video_id']) {
+           $merModel->where('video_id',$search['video_id']);
+        }
+
+
+        if ($search['is_time']) {
+            if ($search['time']) {
+                $range = [strtotime($search['time']['start']), strtotime($search['time']['end'])];
+                $merModel->whereBetween('created_at', $range);
+            }
+        }
+
+        $merModel->with(['member' => function ($query) {
+            $query->select('uid', 'nickname', 'avatar');
+        }]);
+        $merModel->orderBy('created_at', 'desc')->orderBy('id', 'desc');
+
+        return $merModel;
+
+    }
+
+    /**
+     * @param $id
+     * @return mixed
+     */
+    public static function getComment($id)
+    {
+        return self::with(['hasManyReply'=>function ($query) {
+            return $query->where('type', 2)
+                ->orderBy('created_at', 'asc');
+        },'video' => function($q2){
+            return $q2->select('id','title');
+        },'member' => function ($query) {
+        $query->select('uid', 'nickname', 'avatar');
+    }])
+            ->with(['hasManyAppend' => function ($query) {
+                return $query->where('type', 3)
+                    ->orderBy('created_at', 'asc');
+            }])
+            ->where('id', $id);
+    }
+
+    public function member()
+    {
+        return $this->belongsTo(Member::class, 'uid', 'uid');
+    }
+
+    public function video()
+    {
+        return $this->belongsTo(VideoShareGoods::class, 'video_id', 'id');
+    }
+
+    public function hasManySupport()
+    {
+        return $this->hasMany(Support::class,'comment_id','id');
+    }
+
+    public function hasManyReply()
+    {
+        return $this->hasMany(self::class);
+    }
+
+    public function hasManyAppend()
+    {
+        return $this->hasMany(self::class);
+    }
+
+    /**
+     *  定义字段名
+     * 可使
+     * @return array
+     */
+    public function atributeNames()
+    {
+        return [
+            'video_id' => '视频ID',
+            'content' => '评论内容',
+        ];
+    }
+
+    /**
+     * 字段规则
+     * @return array
+     */
+    public function rules()
+    {
+        return [
+            'video_id' => 'required',
+            'content' => 'required'
+        ];
+    }
+}
\ No newline at end of file
diff --git a/plugins/video-share/src/common/model/Follow.php b/plugins/video-share/src/common/model/Follow.php
new file mode 100644
index 00000000..e9c661e4
--- /dev/null
+++ b/plugins/video-share/src/common/model/Follow.php
@@ -0,0 +1,15 @@
+pushAppends(['min_price']);
+    }
+
+}
\ No newline at end of file
diff --git a/plugins/video-share/src/common/model/LikeLog.php b/plugins/video-share/src/common/model/LikeLog.php
new file mode 100644
index 00000000..0d9dddbb
--- /dev/null
+++ b/plugins/video-share/src/common/model/LikeLog.php
@@ -0,0 +1,23 @@
+uniacid();
+        });
+    }
+}
\ No newline at end of file
diff --git a/plugins/video-share/src/common/model/Support.php b/plugins/video-share/src/common/model/Support.php
new file mode 100644
index 00000000..479ee0f8
--- /dev/null
+++ b/plugins/video-share/src/common/model/Support.php
@@ -0,0 +1,17 @@
+with([
+                'member' => function ($member) {
+                    $member->select(['avatar', 'uid', 'nickname']);
+                },
+                'goods' => function ($goods) {
+                    $goods->select(['id', 'title', 'price', 'market_price', 'thumb','has_option']);
+                }
+            ])
+            ->search($search);
+    }
+
+    public function scopeSearch($query, $search)
+    {
+        // 视频id
+        if ($search['id']) {
+            $query->where('id', $search['id']);
+        }
+        // 会员id
+        if ($search['uid']) {
+            $query->where('uid', $search['uid']);
+        }
+        //会员搜索
+        if ($search['member']) {
+            $query->whereHas('member', function ($member) use ($search) {
+                $member->select('uid', 'nickname', 'realname', 'mobile', 'avatar')
+                    ->where('realname', 'like', '%' . $search['member'] . '%')
+                    ->orWhere('mobile', 'like', '%' . $search['member'] . '%')
+                    ->orWhere('nickname', 'like', '%' . $search['member'] . '%');
+            });
+        }
+        // 标题
+        if ($search['title']) {
+            $query->where('title', 'like', '%' . $search['title'] . '%');
+        }
+
+        if ($search['goods_id']) {
+            $query->where('goods_id', $search['goods_id']);
+        }
+
+        if ($search['category_id']) {
+            $query->where("category_id",$search['category_id']);
+        }
+
+        if ($search['is_recommend']) {
+            $query->where("is_recommend",$search['is_recommend']);
+        }
+
+        //关注
+        if ($search['is_follow']) {
+            $member_id = \YunShop::app()->getMemberId();
+            $uids = Follow::uniacid()->where("follow_member_id",$member_id)->pluck("member_id");
+            $query->whereIn("uid",$uids);
+        }
+
+        // 时间搜索
+        if($search['is_time']){
+            if($search['time']){
+                $range = [$search['start_time'], $search['end_time']];
+                $query->whereBetween('created_at', $range);
+            }
+        }
+        return $query;
+    }
+
+    public function myVideo ($uid)
+    {
+        return self::uniacid()
+            ->with([
+                'member' => function ($member) {
+                    $member->select(['avatar', 'uid', 'nickname']);
+                },
+                'goods' => function ($goods) {
+                    $goods->select(['id', 'title', 'price', 'market_price', 'thumb']);
+                }
+            ])->where(['uid' => $uid]);
+    }
+
+    public function member()
+    {
+        return $this->hasOne(Member::class, 'uid', 'uid');
+    }
+
+    public function goods()
+    {
+        return $this->hasOne(\Yunshop\VideoShare\common\model\Goods::class, 'id', 'goods_id');
+    }
+
+    public static function boot()
+    {
+        parent::boot();
+        static::addGlobalScope(function (Builder $builder) {
+            $builder->uniacid();
+        });
+    }
+
+    public function getVideoSrcAttribute()
+    {
+        return $this->video?yz_tomedia($this->video):'';
+    }
+    public function getCommentSumAttribute()
+    {
+        $sum = Comment::where('video_id',$this->id)
+            ->get()
+            ->count();
+
+        return $sum;
+    }
+}
\ No newline at end of file
diff --git a/plugins/video-share/src/common/model/VideoShareWatchRecord.php b/plugins/video-share/src/common/model/VideoShareWatchRecord.php
new file mode 100644
index 00000000..c1561d1e
--- /dev/null
+++ b/plugins/video-share/src/common/model/VideoShareWatchRecord.php
@@ -0,0 +1,18 @@
+pluginId()->where('level',1)->where('name',$yz_goods['category_1']['name'])->value('id');
+			//没有一级分类,直接创建三级
+			if (empty($first_id)) {
+				if ($yz_goods['category_1']['name']) {
+
+					$first_id = Category::insertGetId([
+						'uniacid' => \YunShop::app()->uniacid,
+						'name' => $yz_goods['category_1']['name'],
+						'parent_id' => 0,
+						'level' => 1,
+						'thumb' => $yz_goods['category_1']['image'],
+						'enabled' => 1,
+						'created_at' => time(),
+						'updated_at' => time()
+					]);
+					if ($yz_goods['category_2']['name']) {
+						$second_id = Category::insertGetId([
+							'uniacid' => \YunShop::app()->uniacid,
+							'name' => $yz_goods['category_2']['name'],
+							'parent_id' => $first_id,
+							'level' => 2,
+                            'thumb' => $yz_goods['category_2']['image'],
+							'enabled' => 1,
+							'created_at' => time(),
+							'updated_at' => time()
+						]);
+						if (\Setting::get('shop.category')['cat_level'] == 3 && $yz_goods['category_3']['name']) {
+							$third_id = Category::insertGetId([
+								'uniacid' => \YunShop::app()->uniacid,
+								'name' => $yz_goods['category_3']['name'],
+								'parent_id' => $second_id,
+								'level' => 3,
+                                'thumb' => $yz_goods['category_3']['image'],
+								'enabled' => 1,
+								'created_at' => time(),
+								'updated_at' => time()
+							]);
+						}
+					}
+				}
+			} else {
+				//有一级,没有二级。直接创建二级、三级
+				$second_id = Category::uniacid()->pluginId()->where('parent_id',$first_id)->where('level',2)->where('name',$yz_goods['category_2']['name'])->value('id');
+				if (empty($second_id)) {
+					if ($yz_goods['category_2']['name']) {
+						$second_id = Category::insertGetId([
+							'uniacid' => \YunShop::app()->uniacid,
+							'name' => $yz_goods['category_2']['name'],
+							'parent_id' => $first_id,
+							'level' => 2,
+                            'thumb' => $yz_goods['category_2']['image'],
+							'enabled' => 1,
+							'created_at' => time(),
+							'updated_at' => time()
+						]);
+						if (\Setting::get('shop.category')['cat_level'] == 3 && $yz_goods['category_3']['name']) {
+							$third_id = Category::insertGetId([
+								'uniacid' => \YunShop::app()->uniacid,
+								'name' => $yz_goods['category_3']['name'],
+								'parent_id' => $second_id,
+								'level' => 3,
+                                'thumb' => $yz_goods['category_3']['image'],
+								'enabled' => 1,
+								'created_at' => time(),
+								'updated_at' => time()
+							]);
+						}
+					}
+				} else {
+					if (\Setting::get('shop.category')['cat_level'] == 3 && $yz_goods['category_3']['name']) {
+						//有一级、二级,没有三级,创建三级
+						$third_id = Category::uniacid()->pluginId()->where('parent_id',$second_id)->where('level',3)->where('name',$yz_goods['category_3']['name'])->value('id');
+						if (empty($third_id)) {
+							$third_id = Category::insertGetId([
+								'uniacid' => \YunShop::app()->uniacid,
+								'name' => $yz_goods['category_3']['name'],
+								'parent_id' => $second_id,
+								'level' => 3,
+                                'thumb' => $yz_goods['category_3']['image'],
+								'enabled' => 1,
+								'created_at' => time(),
+								'updated_at' => time()
+							]);
+						}
+					}
+				}
+			}
+			if ($first_id) {
+				$yz_goods['local_category']['parentid'][] = $first_id;
+			}
+			if (isset($second_id)) {
+				$yz_goods['local_category']['childid'][] = $second_id;
+			}
+			if (isset($third_id)) {
+				$yz_goods['local_category']['thirdid'][] = $third_id;
+			}
+		}
+
+		//属于导入或者有分类数据
+		if ($goods_model instanceof  Goods || $yz_goods['local_category']) {
+			GoodsService::saveGoodsMultiCategory($goods_model, $yz_goods['local_category'], \Setting::get('shop.category'));
+		}
+		return $next($yz_goods);
+	}
+
+}
\ No newline at end of file
diff --git a/plugins/video-share/src/common/service/CloudRequestService.php b/plugins/video-share/src/common/service/CloudRequestService.php
new file mode 100644
index 00000000..f8b0a66f
--- /dev/null
+++ b/plugins/video-share/src/common/service/CloudRequestService.php
@@ -0,0 +1,109 @@
+YzNewClient($this->goodsList, $search, 'post');
+        if ($result['code']) {
+            \Log::debug('中台短视频接口异常:', $result);
+        } else {
+            if ($isSplit) {
+                foreach ($result['data']['list'] as $key => $val) {
+                    $result['data']['list'][$key]['origin_title'] = $val['title'];
+                    $result['data']['list'][$key]['title'] = $this->titleSpilt($val['title']);
+                    $result['data']['list'][$key]['product']['title'] = $this->titleSpilt($val['product']['title'],7);
+                }
+            }
+            $result['data']['total_page'] = (int)ceil($result['data']['total'] / $result['data']['pageSize']);
+        }
+        if(!count($result['data']['list'])){
+            $result['data']=['list'=>[]];
+        }
+        return $result;
+    }
+
+    public function goodsDetail($data)
+    {
+        $result = $this->YzNewClient($this->goodsDetail, ['ids' => $data], 'post');
+        if ($result['code']) {
+            \Log::debug('中台短视频接口异常:', $result);
+        }
+        return $result['data'];
+    }
+
+    public function addVideoStorage($data)
+    {
+        foreach ($data as $id) {
+            $result = $this->YzNewClient($this->addVideoStorage, ['product_id' => $id]);
+            if ($result['code']) {
+                \Log::debug('中台短视频接口异常:', $result);
+            }
+        }
+    }
+
+    public function delVideoStorage($data)
+    {
+        $result = $this->YzNewClient($this->delVideoStorage, ['ids' => $data]);
+        if ($result['code']) {
+            \Log::debug('中台短视频接口异常:', $result);
+        }
+    }
+
+    //标题三行显示,超出部分用省略号代替
+    private function titleSpilt($string, $limit = 15)
+    {
+        $result = [];
+        $len = mb_strlen($string);
+        $row = $len / $limit;
+        if ($row > 1) {
+            $result[] = mb_substr($string, 0, $limit);
+            if ($row <= 2) {
+                $result[] = mb_substr($string, $limit);
+            }
+        }
+        if ($row > 2) {
+            $result[] = mb_substr($string, $limit, $limit);
+            if ($row <= 3) {
+                $result[] = mb_substr($string, 2 * $limit);
+            }
+        }
+        if ($row > 3) {
+            $result[] = mb_substr($string, 2 * $limit, $limit) . '...';
+        }
+        if ($row < 1) {
+            $result = [$string];
+        }
+        return $result;
+    }
+
+}
\ No newline at end of file
diff --git a/plugins/video-share/src/common/service/GoodsImportService.php b/plugins/video-share/src/common/service/GoodsImportService.php
new file mode 100644
index 00000000..d8181421
--- /dev/null
+++ b/plugins/video-share/src/common/service/GoodsImportService.php
@@ -0,0 +1,22 @@
+itemModel = $this->getItemModel();
+    }
+
+
+    /**
+     * 对应收入唯一标示
+     *
+     * return string
+     */
+    public function getMark()
+    {
+        return 'icon-reward_record';
+    }
+
+    /**
+     * 系统设置是否显示
+     *
+     * @return bool
+     */
+    public function isShow()
+    {
+        return \Setting::get('plugin.video-share.is_open') ? true : false;
+    }
+
+
+    /**
+     * 是否可用状态(属于更多权限或可用权限)
+     *
+     * @return bool
+     */
+    public function isAvailable()
+    {
+        return $this->itemModel ? true : false;
+    }
+
+
+    /**
+     * 对应收入名称
+     *
+     * @return string
+     */
+    public function getTitle()
+    {
+        return '发现视频';
+    }
+
+
+    /**
+     * 对应收入图标
+     * @return string
+     */
+    public function getIcon()
+    {
+        return 'icon-reward_record';
+    }
+
+
+    /**
+     * 对应收入 type 字段 value 值
+     * @return string
+     */
+    public function getTypeValue()
+    {
+        $uid = \YunShop::app()->getMemberId();
+        $amountTotal = Bonus::select()
+            ->where('uid', $uid)
+            ->where('status', 1)
+            ->sum('amount');
+
+        return round($amountTotal, 2);
+    }
+
+
+    /**
+     * 对应收入 等级
+     * @return string
+     */
+    public function getLevel()
+    {
+        return '';
+    }
+
+
+    //app 访问url
+    public function getAppUrl()
+    {
+        return 'VideoReward';
+    }
+
+    /**
+     * @return string
+     */
+    public function getMiniUrl()
+    {
+        return '/packageC/video_goods/VideoReward/VideoReward';
+    }
+
+
+    /**
+     * 是否需要验证是推客,true 需要,false 不需要
+     * @return bool
+     */
+    public function needIsAgent()
+    {
+        return false;
+    }
+
+
+    /**
+     * 是否需要验证开启关系链,true 需要,false 不需要
+     * @return bool
+     */
+    public function needIsRelation()
+    {
+        return false;
+    }
+
+
+    /**
+     * @return mixed
+     */
+    private function getItemModel()
+    {
+        $uid = \YunShop::app()->getMemberId();
+
+        $model = Bonus::select()
+            ->where('uid', $uid)
+            ->first();
+
+        if ($model) {
+            return $model;
+        }
+        return false;
+    }
+}
\ No newline at end of file
diff --git a/plugins/video-share/src/common/service/MemberCenterService.php b/plugins/video-share/src/common/service/MemberCenterService.php
new file mode 100644
index 00000000..8c05e5f0
--- /dev/null
+++ b/plugins/video-share/src/common/service/MemberCenterService.php
@@ -0,0 +1,49 @@
+ 'video-share',
+                'title' => '发现视频',
+                'class' => 'icon-extension_video',
+                'url' => $set['list_style'] == 2 ? 'VideoDetail' : 'VideoList',
+                'image' => 'member_a(73).png',
+                'mini_url' => $set['list_style'] == 2 ? '/packageC/video_goods/VideoDetail/VideoDetail' : '/packageC/video_goods/VideoList/VideoList',
+                'type_1' => 'interactive',
+                'type_2' => 'market',
+                'weight_1' => 4600,
+                'weight_2' => 8600,
+                'default_weight' => 7
+            ];
+        }
+        return $data;
+    }
+
+    public function getPluginData(): array
+    {
+        return [
+            [
+                'code' => 'videoShare',
+                'diy_code' => 'video-share',
+                'name' => '发现视频',
+                'sort' => 5,
+                'class' => __CLASS__
+            ]
+        ];
+    }
+
+    public function videoShare()
+    {
+        return (new VideoController())->getList()->getData()->data;
+    }
+}
\ No newline at end of file
diff --git a/plugins/video-share/src/common/service/PermissionService.php b/plugins/video-share/src/common/service/PermissionService.php
new file mode 100644
index 00000000..5452b7af
--- /dev/null
+++ b/plugins/video-share/src/common/service/PermissionService.php
@@ -0,0 +1,122 @@
+uid = $uid;
+        $this->_int();
+    }
+
+    private function _int()
+    {
+        $set = \Setting::get('plugin.video-share');
+
+        foreach ($set['releaser'] as $funcName) {
+            $func = Str::camel(preg_replace("/\\d+/",'', $funcName));
+            $ret = $this->$func();
+            if ($ret) {
+                $this->ret = $ret;
+                break;
+            }
+        }
+    }
+
+    private function member()
+    {
+        return true;
+    }
+
+    private function agent()
+    {
+        $agent = MemberShopInfo::select()
+            ->where('member_id', $this->uid)
+            ->first();
+        if ($agent->is_agent == 1) {
+            return true;
+        }
+        return false;
+    }
+
+    private function teamDividend()
+    {
+        $teamDividend = app('plugins')->isEnabled('team-dividend');
+        if (!$teamDividend) {
+            return false;
+        }
+        $dividend = TeamDividendAgencyModel::select()
+            ->where('uid', $this->uid)
+            ->first();
+        if ($dividend) {
+            return true;
+        }
+        return false;
+    }
+
+    private function store()
+    {
+        $storePlugin = app('plugins')->isEnabled('store-cashier');
+        if (!$storePlugin) {
+            return false;
+        }
+        $store = Store::select()
+            ->where('uid', $this->uid)
+            ->first();
+        if ($store) {
+            return true;
+        }
+        return false;
+    }
+
+    private function hotel()
+    {
+        $hotelPlugin = app('plugins')->isEnabled('hotel');
+        if (!$hotelPlugin) {
+            return false;
+        }
+        $hotel = Hotel::select()
+            ->where('uid', $this->uid)
+            ->first();
+        if ($hotel) {
+            return true;
+        }
+        return false;
+    }
+
+    private function supplier()
+    {
+        $supplierPlugin = app('plugins')->isEnabled('supplier');
+        if (!$supplierPlugin) {
+            return false;
+        }
+        $supplier = Supplier::select()
+            ->where('member_id', $this->uid)
+            ->first();
+        if ($supplier) {
+            return true;
+        }
+        return false;
+    }
+
+    private function appointMember()
+    {
+        $memberUid = \Setting::get('plugin.video-share.releaserMember');
+        if(!empty($memberUid) && in_array($this->uid, $memberUid)){
+            return true;
+        }
+        return false;
+    }
+}
\ No newline at end of file
diff --git a/plugins/video-share/src/common/service/ShopService.php b/plugins/video-share/src/common/service/ShopService.php
new file mode 100644
index 00000000..cc5ef50c
--- /dev/null
+++ b/plugins/video-share/src/common/service/ShopService.php
@@ -0,0 +1,20 @@
+first();
+        if($finder) return true;
+        return false;
+    }
+}
\ No newline at end of file
diff --git a/plugins/video-share/src/common/service/TimedTaskImportService.php b/plugins/video-share/src/common/service/TimedTaskImportService.php
new file mode 100644
index 00000000..b539d627
--- /dev/null
+++ b/plugins/video-share/src/common/service/TimedTaskImportService.php
@@ -0,0 +1,142 @@
+isEnabled('yz-supply')){
+            \Log::debug('没有开启供应链插件,不导入中台短视频');
+            return false;
+        }
+
+        date_default_timezone_set('PRC');
+        $uniAccount = UniAccount::getEnable();
+        foreach ($uniAccount as $u) {
+            \YunShop::app()->uniacid = $u->uniacid;
+            $this->preAction($u->uniacid);
+        }
+        return true;
+    }
+
+    public function preAction($uniacid){
+        \YunShop::app()->uniacid = $uniacid;
+        Setting::$uniqueAccountId = $uniacid;
+        $set = \Setting::get('plugin.video-share');
+        if(!$set['auto_sync_mid_ground_video']||!$set['mid_ground_cate']||empty($set['mid_ground_source'])){
+
+            return false;
+        }
+        $categorySearch['video_id']=$set['mid_ground_cate'];
+        try {
+            $actvieMidGround=MiddlegroundConfiguration::uniacid()->whereIn('id',$set['mid_ground_source'])->where('status',1)->get()->toArray();
+            foreach($actvieMidGround as $val){
+                $this->updateVideo($val['id'],$set);
+            }
+        } catch (\Exception $e) {
+            \Log::debug('每日更新中台短视频任务异常', $e->getMessage());
+        }
+    }
+
+    private function updateVideo($configId,$set)
+    {
+        $search=['goods_import'=>1];
+        $list =  (new CloudRequestService($configId))->goodsList($search);
+        $count = $list['data']['total'];
+        $pageSize=20;
+        if($count>10000) $count = 10000;//固定最大值2000
+        $all_page = (int)ceil($count / $pageSize);
+        $search['pageSize']=20;
+        for ($page = 1; $page <= $all_page; $page++) {
+            $search['page']=$page;
+            $response =  (new CloudRequestService($configId))->goodsList($search);
+            if (empty($response) || $response['code'] > 0 || empty($response['data']['list'])) {
+                //如果没有供应链id 终止检验
+                $response['msg'] = !empty($response['msg']) ? $response['msg'] : 'API返回信息异常';
+                \Log::debug('供应链一键导入报错--API返回信息异常' . $configId, json_encode($response));
+                return true;
+            }
+            $list = $response['data']['list'];
+            $this->goodsImport($configId,$list);
+            $this->videoImport($configId,$list,$set);
+        }
+    }
+
+
+    //短视频关联商品导入商城
+    private function goodsImport($configId,$list){
+        $all_yz_goods_ids = array_unique(array_column($list, 'product_id'));
+        $import_service = new GoodsImportService();
+        $result = array_chunk($all_yz_goods_ids, 30);
+        YzGoodsService::setSet($configId);//设置使用那个供应链
+        //
+        $exits_goods = YzGoods::whereIn('yz_goods_id', $all_yz_goods_ids)->where("middleground_configuration_id", YzGoodsService::$config['id'])->pluck('yz_goods_id', 'goods_id')->toArray();
+        foreach ($result as $yz_goods_id) {
+            $res = YzGoodsService::addStorage($yz_goods_id, YzGoodsService::$config['id']);
+            //加入选品库失败 直接跳过
+            if ($res['code'] == 2) {
+                \Log::debug('供应链一键导入:加入选品库失败' . $configId, json_encode($res));
+                continue;
+            }
+            $goodsList = YzGoodsService::batchGetAllGoods($yz_goods_id, YzGoodsService::$config['id']);
+            foreach ($goodsList as $goods) {
+                try {
+                    $result = $import_service->import([], $goods, $exits_goods, []); //todo 查询导入 同步 京东商品数据 到 商城商品表
+                } catch (\Exception $e) {
+                    \Log::debug('供应链一键导入报错' . $configId, json_encode($goods));
+                }
+            }
+        }
+    }
+
+    //短视频数据导入
+    private function videoImport($configId,$list,$set){
+        $videoId=$set['mid_ground_cate'];
+        $memberId=$set['default_member_id'];
+        $all_yz_goods_ids = array_unique(array_column($list, 'product_id'));
+        $shopGoodsIds = YzGoods::uniacid()->whereIn('yz_goods_id', $all_yz_goods_ids)->pluck('goods_id', 'yz_goods_id')->toArray();
+        $videoData = [];
+        foreach ($list as $video) {
+            $videoData[] = [
+                'goods_id' => $shopGoodsIds[$video['product_id']],
+                'uniacid' => \YunShop::app()->uniacid,
+                'uid' => $memberId,
+                'title' => $video['title'],
+                'video' => $video['video_url'] ?: '',
+                'file_name' => '',
+                'cover' => $video['cover_url'] ?: '',
+                'share_num' => 0,
+                'like_num' => 0,
+                'order_price' => 0,
+                'amount_total' => 0,
+                'status' => 1,
+                'category_id' => $videoId ?: 0,
+                'created_at' => time(),
+                'updated_at' => time(),
+                'mid_ground_video_id' => $video['id'],
+                'mid_ground_config_id' => $configId
+            ];
+        }
+        if (!empty($videoData)) {
+            (new CloudRequestService($configId))->addVideoStorage(array_column($list, 'id'));
+            VideoShareGoods::insert($videoData);
+        }
+    }
+
+
+
+}
\ No newline at end of file
diff --git a/plugins/video-share/src/common/service/TimedTaskService.php b/plugins/video-share/src/common/service/TimedTaskService.php
new file mode 100644
index 00000000..3b5e17ca
--- /dev/null
+++ b/plugins/video-share/src/common/service/TimedTaskService.php
@@ -0,0 +1,92 @@
+isEnabled('yz-supply')){
+            \Log::debug('没有开启供应链插件,不更新中台短视频');
+            return false;
+        }
+        date_default_timezone_set('PRC');
+        $uniAccount = UniAccount::getEnable();
+        foreach ($uniAccount as $u) {
+            \YunShop::app()->uniacid = $u->uniacid;
+            $this->updateVideo($u->uniacid);
+        }
+        return true;
+    }
+
+    private function updateVideo($uniacid)
+    {
+        \YunShop::app()->uniacid = $uniacid;
+        Setting::$uniqueAccountId = $uniacid;
+        try {
+            $videoList=VideoShareGoods::uniacid()
+                ->where([['mid_ground_video_id','>',0],['deleted_at','=',null]])
+                ->select(['mid_ground_video_id','mid_ground_config_id','id','goods_id'])
+                ->get();
+            $videoList=$videoList->groupBy('mid_ground_config_id')->toArray();
+            foreach($videoList as $key=>$val){
+                $service=(new CloudRequestService($key));
+                YzGoodsService::setSet($key);
+                foreach($val as $k=>$v){
+                    $yzVideoDetail=$service->goodsDetail([$v['mid_ground_video_id']]);
+                    $goods_model = \Yunshop\YzSupply\models\Goods::select('id', 'uniacid', 'status')->with('hasOneYzGoods')->find($v['goods_id']);
+                    if (!$goods_model && !$goods_model->hasOneYzGoods) {
+                        throw new ShopException('商品不存在或已被删除');
+                    }
+                    $updateGoods=0;
+                    if($goods_model->hasOneYzGoods->yz_goods_id==$yzVideoDetail['product_id']){
+                        $updateGoods=$goods_model->id;
+                    }else{
+                        $exist=\Yunshop\YzSupply\models\YzGoods::uniacid()->where(['middleground_configuration_id'=>$v['mid_ground_config_id'],'yz_goods_id'=>$yzVideoDetail['product_id']])->first();
+                        if($exist){
+                            $updateGoods=$exist->goods_id;
+                        }
+                    }
+                    //商城中已存在的商品调用供应链更新商品方法,不存在的导入
+                    if($updateGoods){
+                        \Yunshop\YzSupply\services\YzGoodsService::updateGoods($updateGoods, \Yunshop\VideoShare\common\service\YzGoodsService::requestYz($yzVideoDetail['product_id'])['yz_goods']);
+                    }else{
+                        $errorGoodsIds=GoodsImportService::beforeImport([$yzVideoDetail['product_id']], [], [],$v['mid_ground_config_id']);
+                        if (empty($errorGoodsIds)) {
+                            $shopGoods=\Yunshop\YzSupply\models\YzGoods::uniacid()->where(['yz_goods_id'=>$yzVideoDetail['product_id'],'middleground_configuration_id'=>$v['mid_ground_config_id']])->first();
+                            if($shopGoods){
+                                $updateGoods=$shopGoods->goods_id;
+                            }
+                        }
+                    }
+                    VideoShareGoods::where('id',$v['id'])->update([
+                        'title'=>$yzVideoDetail['title'],
+                        'cover'=>$yzVideoDetail['cover_url'],
+                        'video'=>$yzVideoDetail['video_url'],
+                        'status'=>$yzVideoDetail['is_display'],
+                        'goods_id'=>$updateGoods
+                    ]);
+                }
+
+            }
+
+
+        } catch (\Exception $e) {
+            \Log::debug('每日更新中台短视频任务异常', $e->getMessage());
+        }
+
+    }
+
+
+}
\ No newline at end of file
diff --git a/plugins/video-share/src/common/service/YzGoodsService.php b/plugins/video-share/src/common/service/YzGoodsService.php
new file mode 100644
index 00000000..f09dc283
--- /dev/null
+++ b/plugins/video-share/src/common/service/YzGoodsService.php
@@ -0,0 +1,81 @@
+send($yz_goods)
+			->through($pipes)
+			->then(function () {
+				return true;
+			});
+    }
+
+
+    public static function requestYz($yz_goods_id)
+    {
+        $YzGoodsModel = YzGoods::where('yz_goods_id', $yz_goods_id)->first();
+        if (!$YzGoodsModel) {
+            return false;
+        }
+        if (empty($YzGoodsModel['middleground_configuration_id'])) {
+            throw new ShopException('商品没有绑定供应链');
+        }
+
+        $data['ids'] = [$yz_goods_id];
+
+        $data['ids'] = array_map('intval', $data['ids']);
+
+        $data = (new CloudRequestService($YzGoodsModel['middleground_configuration_id']))->getProductDetail($data);
+
+        $yz_goods = $data['data']['list'][0];
+        if (empty($data) || $data['code'] > 0) {
+            return false;
+        }
+        if (empty($yz_goods)){
+            $delete = $yz_goods_id;
+        }
+        return [
+            'goods_id' => $YzGoodsModel->goods_id,
+            'yz_goods' => $yz_goods,
+            'delete'=>$delete,
+        ];
+    }
+
+
+}
\ No newline at end of file
diff --git a/plugins/video-share/src/frontend/BonusController.php b/plugins/video-share/src/frontend/BonusController.php
new file mode 100644
index 00000000..6895f47a
--- /dev/null
+++ b/plugins/video-share/src/frontend/BonusController.php
@@ -0,0 +1,87 @@
+getMemberId();
+        // $uid = 68;
+
+        $member = Member::select(['avatar', 'uid', 'nickname'])
+            ->where('uid', $uid)
+            ->first();
+
+        $videoTotal = VideoShareGoods::select()
+            ->where('uid', $uid)
+            ->count();
+
+        $finishAmount = Bonus::select()
+            ->where('uid', $uid)
+            ->where('status', 1)
+            ->sum('amount');
+
+        $waitAmount = Bonus::select()
+            ->where('uid', $uid)
+            ->where('status', 0)
+            ->sum('amount');
+
+        return $this->successJson('成功', [
+            'member' => $member,
+            'video_total' => $videoTotal,
+            'finish_amount' => $finishAmount,
+            'wait_amount' => $waitAmount
+        ]);
+    }
+
+    // plugin.video-share.frontend.bonus.getList
+    public function getList()
+    {
+        $uid = \YunShop::app()->getMemberId();
+
+        $list = Bonus::select('create_month')
+            ->groupBy('create_month')
+            ->where('uid', $uid)
+            ->orderBy('create_month', 'desc')->paginate();
+        if(empty($list)){
+            return $this->errorJson('暂无数据');
+        }
+        foreach($list as $key => $value){
+            $data = Bonus::uniacid()
+                ->with([
+                    'member' => function ($member) {
+                        $member->select(['avatar', 'uid', 'nickname']);
+                    },
+                    'order' => function ($order) {
+                        $order->select(['id', 'price', 'order_sn']);
+                    },
+                    'video' => function ($video) {
+                        $video->select(['id', 'title']);
+                    },
+                ])
+                ->where('create_month',$value['create_month'])
+                ->orderBy('id', 'desc')
+                ->where('uid',$uid)
+                ->get();
+            if(empty($data)){
+                continue;
+            }
+            $list[$key]['bonus'] = $data;
+        }
+        return $this->successJson('成功', [
+            'list' => $list
+        ]);
+    }
+
+
+}
\ No newline at end of file
diff --git a/plugins/video-share/src/frontend/CommentController.php b/plugins/video-share/src/frontend/CommentController.php
new file mode 100644
index 00000000..e7123169
--- /dev/null
+++ b/plugins/video-share/src/frontend/CommentController.php
@@ -0,0 +1,329 @@
+video_id;
+        $num = Comment::uniacid()
+            ->where(['video_id' => $video_id, 'comment_id' => 0])
+            ->count();
+
+        $finder = VideoShareGoods::uniacid()->find($video_id);
+        if(!$finder)
+        {
+            throw new AppException('不存在的视频');
+        }
+
+        $model = Comment::uniacid()
+            ->with(['hasManyReply', 'hasManySupport' => function ($q) {
+                $q->where(['member_id' => \YunShop::app()->getMemberId(), 'status' => 1]);
+            }])
+            ->where(['video_id' => $video_id, 'comment_id' => 0])
+            ->orderBy('created_at', 'desc')
+            ->orderBy('id', 'desc')
+            ->paginate('', ['*'], '', (int)request()->page ?: 1);
+        $model = $model->toArray();
+        $model['data'] = collect($model['data'])->map(function ($item) use ($finder){
+            $num = count($item['has_many_reply']);
+            unset($item['has_many_reply']);
+            $is_support = 0;
+            if($item['has_many_support'])
+            {
+                $is_support = 1;
+            }
+
+            $can_del = 0;
+            if($finder->uid == \YunShop::app()->getMemberId() || $item['uid'] == \YunShop::app()->getMemberId()){
+                $can_del = 1;
+            }
+
+            $collection = collect($item)
+                ->put('reply_num', $num)
+                ->put('append_arr',[])
+                ->put('can_del',$can_del)
+                ->put('is_support',$is_support);
+
+            return $collection;
+        });
+        $member = Member::where('uid', \YunShop::app()->getMemberId())
+            ->select(['uid', 'avatar', 'nickname'])->first();
+        return $this->successJson('ok', ['list' => $model, 'member' => $member, 'num' => $num]);
+    }
+
+    public function getVideoType()
+    {
+        $video_type = Setting::get('plugin.video-share')['video_type'] ?? 2;
+        return $this->successJson('ok', $video_type);
+    }
+
+    /**
+     * @return \Illuminate\Http\JsonResponse
+     * 查看回复
+     */
+    public function getReplys()
+    {
+        $comment_id = \YunShop::request()->comment_id;
+        $comment = Comment::uniacid()->find($comment_id);
+        if (!$comment || $comment->comment_id != 0) {
+            return $this->errorJson('未检测到数据!');
+        }
+
+        $finder = VideoShareGoods::uniacid()->find($comment->video_id);
+        if(!$finder)
+        {
+            throw new AppException('不存在的视频');
+        }
+
+        $model = Comment::uniacid()
+            ->where('comment_id', $comment_id)
+            ->with(['hasManySupport' => function ($q) {
+                $q->where(['member_id' => \YunShop::app()->getMemberId(), 'status' => 1]);
+            }])
+            ->orderBy('created_at', 'desc')
+            ->orderBy('id', 'desc')
+            ->paginate(5, ['*'], '', (int)request()->page ?: 1);
+        $model = $model->toArray();
+        $model['data'] = collect($model['data'])->map(function ($item) use ($finder){
+            $is_support = 0;
+            if($item['has_many_support'])
+            {
+                $is_support = 1;
+            }
+
+            $can_del = 0;
+            if($finder->uid == \YunShop::app()->getMemberId() || $item['uid'] == \YunShop::app()->getMemberId()){
+                $can_del = 1;
+            }
+
+            $collection = collect($item)
+                ->put('can_del',$can_del)
+                ->put('is_support',$is_support);
+            return $collection;
+        });
+        return $this->successJson('ok', $model);
+    }
+
+    public function createComment()
+    {
+        $commentModel = new Comment();
+        $ingress = request()->ingress;
+        $member = Member::getUserInfos(\YunShop::app()->getMemberId())->first();
+        if (!$member) {
+            return $this->errorJson('评论失败!未检测到会员数据!');
+        }
+        $commentStatus = '1';
+
+        $comment = [
+            'video_id' => \YunShop::request()->video_id,
+            'content' => \YunShop::request()->content,
+        ];
+
+        if ($ingress && !empty($comment['content'])) {
+            $check_result = (new MiniFileLimitService())->checkMsg($comment['content']);
+            if ($check_result['errcode'] != 0) {
+                return $this->errorJson('输入信息含有违法违规内容');
+            }
+        }
+
+        if (!$comment['video_id']) {
+            return $this->errorJson('评论失败!未检测到文章ID!');
+        }
+        if (!$comment['content']) {
+            return $this->errorJson('评论失败!未检测到评论内容!');
+        }
+
+        if (\YunShop::request()->images) {
+            $comment['images'] = json_decode(\YunShop::request()->images);
+            if (is_array($comment['images'])) {
+                if (count($comment['images']) > 5) {
+                    return $this->errorJson('追加评论失败!评论图片不能多于5张!');
+                }
+                $comment['images'] = serialize($comment['images']);
+            } else {
+                return $this->errorJson('追加评论失败!评论图片数据不正确!');
+            }
+        } else {
+            $comment['images'] = serialize([]);
+        }
+
+        $commentModel->setRawAttributes($comment);
+        $commentModel->uniacid = \YunShop::app()->uniacid;
+
+        $commentModel->nick_name = $member->nickname;
+
+        $commentModel->uid = $member->uid;
+        $commentModel->head_img_url = $member->avatar;
+        $commentModel->type = '1';
+        $res = $this->insertComment($commentModel, $commentStatus);
+
+        return $res;
+    }
+
+    public function replyComment()
+    {
+        $commentModel = new Comment();
+        $member = Member::getUserInfos(\YunShop::app()->getMemberId())->first();
+        if (!$member) {
+            return $this->errorJson('回复评论失败!未检测到会员数据!');
+        }
+
+        $id = \YunShop::request()->comment_id;
+        $reply = $commentModel::uniacid()->find($id);
+        if (!$reply) {
+            return $this->errorJson('回复评论失败!未检测到评论数据!');
+        }
+
+        $comment = [
+            'video_id' => $reply->video_id,
+            'content' => \YunShop::request()->content,
+            'comment_id' => $reply->comment_id ? $reply->comment_id : $reply->id,
+        ];
+        if (!$comment['content']) {
+            return $this->errorJson('回复评论失败!未检测到评论内容!');
+        }
+
+        if (\YunShop::request()->images) {
+            $comment['images'] = json_decode(\YunShop::request()->images);
+            if (is_array($comment['images'])) {
+                if (count($comment['images']) > 5) {
+                    return $this->errorJson('追加评论失败!评论图片不能多于5张!');
+                }
+                $comment['images'] = serialize($comment['images']);
+            } else {
+                return $this->errorJson('追加评论失败!评论图片数据不正确!');
+            }
+        } else {
+            $comment['images'] = serialize([]);
+        }
+
+        $commentModel->setRawAttributes($comment);
+
+        $commentModel->uniacid = \YunShop::app()->uniacid;
+        $commentModel->uid = $member->uid;
+        $commentModel->nick_name = $member->nickname;
+        $commentModel->head_img_url = $member->avatar;
+        if ($reply->comment_id) {
+            $commentModel->reply_id = $reply->uid;
+            $commentModel->reply_name = $reply->nick_name;
+        } else {
+            $commentModel->reply_id = 0;
+            $commentModel->reply_name = null;
+        }
+        $commentModel->reply_comment_id = $id;
+        $commentModel->type = '2';
+        return $this->insertComment($commentModel);
+
+    }
+
+    public function del()
+    {
+        //主评论不关联删除子评论。没人有权删除别人的评论,一直存在
+        $id = \YunShop::request()->comment_id;
+        $comment = Comment::uniacid()->find($id);
+        $video = VideoShareGoods::uniacid()->find($comment->video_id);
+        if (!$comment || !$video) {
+            return $this->errorJson('评论不存在');
+        }
+        if($comment->uid != \YunShop::app()->getMemberId() && $video->uid != \YunShop::app()->getMemberId())
+        {
+            return $this->errorJson('无删除权限');
+        }
+        $comment->delete();
+        return $this->successJson('ok', '删除成功');
+    }
+
+    public function support()
+    {
+        $comment_id = \YunShop::request()->comment_id;
+        $ReliableModel = Support::uniacid()->where(['comment_id' => $comment_id, 'member_id' => \YunShop::app()->getMemberId()])->first();
+        DB::beginTransaction();
+        try {
+            if ($ReliableModel) {
+                if ($ReliableModel->status == Support::STATUS_SUCCESS) {
+                    $ReliableModel->status = Support::STATUS_FAIL;
+                    $ReliableModel->save();
+                    $this->changeSupport($comment_id, -1);
+                } elseif ($ReliableModel->status == Support::STATUS_FAIL) {
+                    $ReliableModel->status = Support::STATUS_SUCCESS;
+                    $ReliableModel->save();
+                    $this->changeSupport($comment_id, 1);
+                }
+            } else {
+                $arr = [
+                    'uniacid' => \YunShop::app()->uniacid,
+                    'comment_id' => $comment_id,
+                    'member_id' => \YunShop::app()->getMemberId(),
+                    'status' => Support::STATUS_SUCCESS
+                ];
+                $model = new Support;
+                $model->fill($arr);
+                $model->save();
+                $this->changeSupport($comment_id, 1);
+            }
+            DB::commit();
+            return $this->successJson('ok', '成功');
+        } catch (\Exception $e) {
+            DB::rollBack();
+            return $this->errorJson($e->getMessage());
+        }
+    }
+
+    private function insertComment($commentModel, $commentStatus = '')
+    {
+        $validator = $commentModel->validator($commentModel->getAttributes());
+        if ($validator->fails()) {
+            //检测失败
+            return $this->errorJson($validator->messages());
+        } else {
+            //数据保存
+            if ($commentModel->save()) {
+                return $this->successJson('评论成功!', $commentModel);
+            } else {
+                return $this->errorJson('评论失败!');
+            }
+        }
+    }
+
+    private function changeSupport($comment_id, $num)
+    {
+        $comment = Comment::uniacid()->find($comment_id);
+        if ($comment) {
+            $res = bcadd($comment->support_num, $num);
+            if($res < 0)
+            {
+                return;
+            }
+            $comment->support_num = $res;
+            $comment->save();
+        }
+    }
+}
diff --git a/plugins/video-share/src/frontend/GoodsController.php b/plugins/video-share/src/frontend/GoodsController.php
new file mode 100644
index 00000000..6c9238b2
--- /dev/null
+++ b/plugins/video-share/src/frontend/GoodsController.php
@@ -0,0 +1,96 @@
+keyword;
+        if (!$keyword) {
+            return $this->errorJson('请输入关键词');
+        }
+
+        $goods_model = Goods::uniacid()->select('id', 'title', 'thumb', 'market_price', 'price','has_option')
+            ->where('title', 'like', '%' . $keyword . '%')
+            ->where('status', 1)
+            ->whereIn('plugin_id', [0,32,33,44,92,57,58,101,120,154]);
+
+        //隐藏不显示门店的商品
+        if(app('plugins')->isEnabled('store-cashier')){
+            $store_ids = Store::uniacid()->where('is_hide', 1)->has('hasManyGoods')->pluck('id');
+            if($store_ids){
+                $store_goods_ids = GoodsStore::whereIn('store_id',$store_ids)->pluck('goods_id');
+                if($store_goods_ids){
+                    $goods_model->whereNotIn('id', $store_goods_ids);
+                }
+            }
+        }
+
+        $list = $goods_model->paginate();
+        $list->map(function ($item) {
+            $thumb = yz_tomedia($item->thumb);
+            $item->thumb = $thumb;
+            if ($item->has_option && $item->hasManyOptions) {
+                $item->price = $item->hasManyOptions->min('product_price');
+            }
+        });
+
+        return $this->successJson('成功', [
+            'list' => $list
+        ]);
+    }
+
+    // plugin.video-share.frontend.goods.getRecommendGoods
+    //120供应链,57应用市场,58应用市场子平台,140卡券商品,71聚合CPS品牌券商品,101门店预约商品,103电子合同,113多门店核销商品,130分时预约商品,154周边游商品
+    public function getRecommendGoods()
+    {
+        $list = \app\frontend\modules\goods\models\Goods::uniacid()
+            ->select('id', 'id as goods_id', 'title', 'thumb', 'price', 'market_price','has_option')
+            ->where('is_recommand', '1')
+            ->whereIn('plugin_id', [0,32,33,44,92,57,58,120,140,71,101,103,113,130,154])
+            ->whereStatus('1')
+            ->orderBy('id', 'desc')
+            ->paginate();
+
+        $list->map(function ($item) {
+            $thumb = yz_tomedia($item->thumb);
+            $item->thumb = $thumb;
+            if ($item->has_option && $item->hasManyOptions) {
+                $item->price = $item->hasManyOptions->min('product_price');
+            }
+        });
+
+        return $this->successJson('获取推荐商品成功', [
+            'list' => $list
+        ]);
+    }
+
+    // 发布-选择商品后 回显
+    // plugin.video-share.frontend.goods.getGoodsById
+    public function getGoodsById()
+    {
+        $goodsId = intval(request()->goods_id);
+        if (!$goodsId) {
+            return $this->errorJson('参数错误[goods_id=null]');
+        }
+        $goods = Goods::uniacid()->select('id', 'title', 'thumb', 'market_price', 'price','has_option')
+            ->find($goodsId);
+        $goods->thumb = yz_tomedia($goods->thumb);
+
+        $goods->append('min_price');
+
+        return $this->successJson('成功', [
+            'goods' => $goods
+        ]);
+    }
+}
diff --git a/plugins/video-share/src/frontend/PermissionController.php b/plugins/video-share/src/frontend/PermissionController.php
new file mode 100644
index 00000000..1432a620
--- /dev/null
+++ b/plugins/video-share/src/frontend/PermissionController.php
@@ -0,0 +1,29 @@
+getMemberId();
+        $permissionService = new PermissionService($uid);
+
+        if ($permissionService->ret) {
+            $msg = '权限通过';
+        } else {
+            $msg = '您没有权限发布小视频';
+        }
+
+        return $this->successJson($msg, [
+            'ret' => $permissionService->ret
+        ]);
+    }
+}
\ No newline at end of file
diff --git a/plugins/video-share/src/frontend/SetController.php b/plugins/video-share/src/frontend/SetController.php
new file mode 100644
index 00000000..1d1afdf5
--- /dev/null
+++ b/plugins/video-share/src/frontend/SetController.php
@@ -0,0 +1,78 @@
+successJson('成功', [
+            'limit' => $set['limit'],
+            'select_goods' => !isset($set['select_goods'])?1:$set['select_goods'],
+            'is_show_cate' => empty($set['is_show_cate']) ? 0 : $set['is_show_cate'],
+            'default_title' => $set['default_title']?true:false,
+            'default_cate' => $set['default_cate']?true:false,
+            'must_video'   => $set['must_video'] == 1?true:false,
+            'upload_button' => $set['upload_button'] ?: '确认发布',
+            'notice' => $set['notice'],
+            'diy_title' => $set['diy_title'] ?: '用户协议'
+        ]);
+    }
+
+    // 获取协议
+    // plugin.video-share.frontend.set.getAgreement
+    public function getAgreement()
+    {
+        $set = \Setting::get('plugin.video-share');
+
+        return $this->successJson('成功', [
+            'agreement' => html_entity_decode($set['content'])
+        ]);
+    }
+
+    // 获取背景
+    public function getBackground()
+    {
+        $set = \Setting::get('plugin.video-share');
+
+        return $this->successJson('成功', [
+            'background' => yz_tomedia($set['bgImg'])
+        ]);
+    }
+
+    // 获取幻灯片
+    public function getSlide()
+    {
+        $set = \Setting::get('plugin.video-share');
+
+        return $this->successJson('成功', [
+            'slide' => [
+                [
+                    'img' => yz_tomedia($set['banOne']),
+                    'url' => $set['linkOne'],
+                    'wxUrl' => $set['proOne'],
+                ],
+                [
+                    'img' => yz_tomedia($set['banTwo']),
+                    'url' => $set['linkTwo'],
+                    'wxUrl' => $set['proTwo'],
+                ],
+                [
+                    'img' => yz_tomedia($set['banThree']),
+                    'url' => $set['linkThree'],
+                    'wxUrl' => $set['proThree'],
+                ]
+            ],
+            'is_rotation'  => $set['is_rotation']
+        ]);
+    }
+}
\ No newline at end of file
diff --git a/plugins/video-share/src/frontend/UploadController.php b/plugins/video-share/src/frontend/UploadController.php
new file mode 100644
index 00000000..4a3bb2a4
--- /dev/null
+++ b/plugins/video-share/src/frontend/UploadController.php
@@ -0,0 +1,144 @@
+file('file');
+
+        if (!$file) {
+            return $this->errorJson('请传入正确参数');
+        }
+
+        if (!$file->isValid()) {
+            return $this->errorJson('上传失败.');
+        }
+
+        // 获取文件相关信息
+        $originalName = $file->getClientOriginalName(); // 文件原名
+        $realPath = $file->getRealPath();   //临时文件的绝对路径
+        $ext = $file->getClientOriginalExtension();
+
+        $defaultImgType = [
+            'jpg', 'bmp', 'eps', 'gif', 'mif', 'miff', 'png', 'tif',
+            'tiff', 'svg', 'wmf', 'jpe', 'jpeg', 'dib', 'ico', 'tga', 'cut', 'pic'
+        ];
+
+        $defaultAudioType = ['avi', 'asf', 'wmv', 'avs', 'flv', 'mkv', 'mov', '3gp', 'mp4',
+            'mpg', 'mpeg', 'dat', 'ogm', 'vob', 'rm', 'rmvb', 'ts', 'tp', 'ifo', 'nsv'
+        ];
+
+        $defaultVideoType = [
+            'mp3', 'aac', 'wav', 'wma', 'cda', 'flac', 'm4a', 'mid', 'mka', 'mp2',
+            'mpa', 'mpc', 'ape', 'ofr', 'ogg', 'ra', 'wv', 'tta', 'ac3', 'dts'
+        ];
+
+        $merge_ext = array_merge($defaultImgType, $defaultAudioType, $defaultVideoType);
+        if (!in_array(strtolower($ext), $merge_ext)) {
+            return $this->errorJson('非规定类型的文件格式');
+        }
+
+        $newOriginalName = md5($originalName . str_random(6)) . '.' . $ext;
+
+        if (config('app.framework') == 'platform') {
+            $remote = SystemSetting::settingLoad('remote', 'system_remote');
+            //本地上传
+            $result = \Storage::disk('newimages')->put($newOriginalName, file_get_contents($realPath));
+            if (!$result){
+                return $this->successJson('上传失败');
+            }
+
+            $url = \Storage::disk('newimages')->url($newOriginalName);
+
+            //图片审核
+            if(app('plugins')->isEnabled('upload-verification')){
+                    $uploadReuslt = do_upload_verificaton(yz_tomedia($url), 'video');
+                    if(0 === $uploadReuslt[0]['status']){
+                        return $this->errorJson($uploadReuslt[0]['msg']);
+                    }
+            }
+
+            //远程上传
+            if ($remote['type'] != 0) {
+                file_remote_upload_new($url, true, $remote);
+            }
+
+            return $this->successJson('上传成功', [
+                'file_name' => $newOriginalName,
+                'audio' => $url,
+                'audio_url' => yz_tomedia($url)
+            ]);
+        } else {
+            //全局配置
+            global $_W;
+
+            //公众号独立配置信息 优先使用公众号独立配置
+            $uni_setting = app('WqUniSetting')->get()->toArray();
+            if (!empty($uni_setting['remote']) && iunserializer($uni_setting['remote'])['type'] != 0) {
+                $setting['remote'] = iunserializer($uni_setting['remote']);
+                $remote = $setting['remote'];
+            } else {
+                $remote = $_W['setting']['remote'];
+            }
+            //本地上传
+            $result = \Storage::disk('image')->put($newOriginalName, file_get_contents($realPath));
+            if (!$result) {
+                return $this->errorJson('上传失败');
+            }
+
+            $audio = \Storage::disk('image')->url($newOriginalName);
+
+            //图片审核
+            if(app('plugins')->isEnabled('upload-verification')){
+                $uploadReuslt = do_upload_verificaton(yz_tomedia($audio), 'video');
+                if(0 === $uploadReuslt[0]['status']){
+                    return $this->errorJson($uploadReuslt[0]['msg']);
+                }
+            }
+            //远程上传
+            if ($remote['type'] != 0) {
+                file_remote_upload_wq($audio, true, $remote, true);
+            }
+
+            return $this->successJson('上传成功', [
+                'file_name' => $newOriginalName,
+                'audio' => $audio,
+                'audio_url' => yz_tomedia($audio)
+            ]);
+        }
+    }
+
+    public function upload()
+    {
+        $file = request()->file('file');
+
+        if (!$file) {
+            return $this->errorJson('请传入正确参数');
+        }
+
+        if ($file->isValid()) {
+            // 获取文件相关信息
+            $originalName = $file->getClientOriginalName(); // 文件原名
+            $realPath = $file->getRealPath();   //临时文件的绝对路径
+            $ext = $file->getClientOriginalExtension();
+            $newOriginalName = md5($originalName . str_random(6)) . '.' . 'png';
+
+            \Storage::disk('image')->put($newOriginalName, file_get_contents($realPath));
+
+            return $this->successJson('上传成功', [
+                'img'    => \Storage::disk('image')->url($newOriginalName),
+                'img_url' => upload_image_local(\Storage::disk('image')->url($newOriginalName)),
+            ]);
+
+        }
+    }
+}
\ No newline at end of file
diff --git a/plugins/video-share/src/frontend/VideoController.php b/plugins/video-share/src/frontend/VideoController.php
new file mode 100644
index 00000000..38294678
--- /dev/null
+++ b/plugins/video-share/src/frontend/VideoController.php
@@ -0,0 +1,584 @@
+getMemberId();
+        $search = request()->search;
+        //兼容APP请求
+        if (!is_array($search)) {
+            $search =[$search => 1];
+        }
+        $list = VideoShareGoods::getList($search)
+            ->where('status', 1)
+            ->orderBy('id', 'desc')
+            ->paginate();
+
+        $businessCard = app('plugins')->isEnabled('business-card');
+
+        $list->map(function ($item) use ($businessCard, $uid) {
+            // 图片
+            $item->goods->thumb = yz_tomedia($item->goods->thumb);
+            if ($item->goods->has_option) {
+                $item->goods->price = $item->goods->hasManyOptions->min('product_price');
+            }
+            $item->member->avatar = yz_tomedia($item->member->avatar);
+            $item->cover = yz_tomedia($item->cover);
+            $item->video = yz_tomedia($item->video);
+            // 会员名片
+            $item->member->business_card = 0;
+            if ($businessCard) {
+                $cardModel = BusinessCardModel::select()
+                    ->where('member_id', $item->member->uid)
+                    ->first();
+                if ($cardModel) {
+                    $item->member->business_card = $cardModel->id;
+                }
+            }
+
+            // 会员点赞 默认可以点赞
+            $item->member_like = 1;
+            $likeLog = LikeLog::select()
+                ->where('uid', $uid)
+                ->where('vid', $item->id)
+                ->first();
+            if ($likeLog) {
+                $item->member_like = 0;
+            }
+
+            $item->room_id = 0;
+
+            //判断是否关注
+            $follow = Follow::uniacid()->where("member_id",$item->uid)->where("follow_member_id",$uid)->count();
+
+            $item->is_follow = ($follow>0) ? 1 : 0;
+
+            //评论
+            $comment_num = Comment::uniacid()
+                ->where(['video_id' => $item->id, 'comment_id' => 0])
+                ->count();
+            $item->comment_num = $comment_num;
+
+            //判断当前会员是否在直播
+            $item ->is_live = 0;
+            if (app('plugins')->isEnabled('room')) {
+                $anchor = \Yunshop\Room\models\Anchor::uniacid()->where("member_id",$item->uid)->first();
+                if ($anchor) {
+                    $item->is_live = $anchor['status'];
+                }
+
+                $item->room_id = \Yunshop\Room\models\Room::uniacid()->where("status",3)->value("id");
+            }
+
+            //投放广告视频插件-观看赚/投放广告按钮
+            $item->ad_serving_button_status = [];
+            if (app('plugins')->isEnabled('ad-serving')) {
+                $item->ad_serving_button_status = \Yunshop\AdServing\services\PrivilegeValidateService::checkButton($item->id,2);
+            }
+
+            // 统计会员持有视频总数
+            $item->member_video_num = count(VideoShareGoods::where('uid', $item->uid)->whereNotNull('video')->get());
+        });
+
+        $video_redpack=['is_open'=>0,'data'=>[]];
+        if (app('plugins')->isEnabled('video-redpack')){
+            $video_redpack['is_open'] = 1;
+            $video_redpack['data']=\Yunshop\VideoRedpack\services\ActivityService::getActiviyForFrontend();
+        }
+        $set = \Setting::get('plugin.video-share');
+
+        return $this->successJson('成功', [
+            'list' => $list,
+            'is_plugins'       => app('plugins')->isEnabled('answer-reward'),
+            'points_plugin'    => app('plugins')->isEnabled('video-share-points'),
+            'video_redpack'=>$video_redpack,
+            'comment_open' => $set['is_open_comment']?:0
+        ]);
+    }
+
+    //获取基础设置
+    public function getBasicSet()
+    {
+        $set = \Setting::get('plugin.video-share');
+        $setting['is_show_cate'] = $set['is_show_cate'];
+        $setting['is_show_own_follow'] = $set['is_show_own_follow'];
+        $setting['is_show_recommend'] = $set['is_show_recommend'];
+        $setting['is_show_live'] = $set['is_show_live'];
+        $setting['topLike'] = $set['topLike'] ?: "";
+        $setting['topSmileLike'] = $set['topSmileLike'];
+        $setting['customIcon'] = empty($set['customIcon']) ? "" : yz_tomedia($set['customIcon']);
+        $setting['icon_name'] = $set['icon_name'];
+        $setting['iconLink'] = $set['iconLink'] ?: "";
+        $setting['iconSmileLink'] = $set['iconSmileLink'];
+        $setting['is_show_name'] = $set['is_show_name']?:0;
+        $setting['is_member_enter'] = isset($set['is_member_enter']) ? $set['is_member_enter']: 1;
+        $setting['is_show_video_progress'] = $set['is_show_video_progress']?1:0;
+
+        return $this->successJson("",['set' => $setting]);
+    }
+
+    //获取分类
+    public function getCategory()
+    {
+        $set = \Setting::get('plugin.video-share');
+
+        $data = [];
+
+        if ($set['is_show_cate'] != 1) {
+            return $this->successJson("",$data);
+        }
+        $is_select = request()->is_select;
+        if ($set['is_show_hide'] == 1 && $is_select == 1) {
+            $category = CategoryModel::uniacid()->select("id","name")->orderBy('sort','desc')->get();
+        } else {
+            $category = CategoryModel::uniacid()->select("id","name")->where("is_show",1)->orderBy('sort','desc')->get();
+        }
+
+        $category = empty($category) ? [] : $category->toArray();
+
+        return $this->successJson("",$category);
+
+    }
+
+    //关注/取消关注
+    public function editFollow()
+    {
+        $uid = request()->get("member_id");
+
+        $type = Request()->get("follow_type");
+
+        $member_id = \YunShop::app()->getMemberId();
+
+        if ($type == 1) {
+            //关注
+            $exist = Follow::uniacid()->where("member_id",$uid)->where("follow_member_id",$member_id)->count();
+
+            if ($exist>0) {
+                return $this->errorJson("已关注");
+            }
+
+            $follow_data = [
+                "uniacid" => \YunShop::app()->uniacid,
+                "member_id" => $uid,
+                "follow_member_id" => $member_id,
+                "created_at" => time(),
+                "updated_at" => time()
+            ];
+
+            if (Follow::insert($follow_data)) {
+                return $this->successJson("成功");
+            }
+
+            return $this->errorJson("失败");
+
+        } elseif ($type == 2) {
+            //取消关注
+            //关注
+            $follow = Follow::uniacid()->where("member_id",$uid)->where("follow_member_id",$member_id)->first();
+
+            if (!$follow) {
+                return $this->errorJson("数据错误");
+            }
+
+            $follow->deleted_at = time();
+
+            if($follow->save()) {
+                return $this->successJson("成功");
+            }
+
+            return  $this->errorJson("失败");
+        } else {
+            return $this->errorJson("数据错误");
+        }
+
+    }
+
+    //添加观看记录
+    public function addRecord(){
+        $uid = \YunShop::app()->getMemberId();
+        $videoId = request()->video_id;
+        $result = VideoShareWatchRecord::create(['member_id' => $uid, 'video_id' => $videoId]);
+        $this->addBrowseFootprintRedis($videoId);
+        return $this->successJson('成功', $result);
+    }
+
+
+    protected static function addBrowseFootprintRedis($videoId)
+    {
+        if (app('plugins')->isEnabled('browse-footprint')){
+            $page_type = '/videoDetail';
+            $fullUrl = yzAppFullUrl('/videoDetail',['vid' => $videoId]);
+            if (request()->type == 2) {
+                $page_type = 'packageC/video_goods/VideoDetail/VideoDetail';
+                $fullUrl = 'packageC/video_goods/VideoDetail/VideoDetail?vid' . $videoId;
+            }
+
+            $temporary_data = [
+                'member_id' => \YunShop::app()->getMemberId(),//会员id
+                'page_type' => $page_type,//页面类型
+                'page_type_id' => $videoId,//页面类型ID
+                'port_type' => request()->type,//端口类型
+                'pc' => request()->input('pc') ?: 0,//参数为1 & type=5 为PC端
+                'ip' => Utils::getClientIp() ?: 0,
+                'ip_name' => '未知',//TODO 需要引库
+                'i' => \YunShop::app()->uniacid,
+                'cookie' => substr(md5(request()->header()['cookie'][0]), 8, 16),
+                'full-url' => $fullUrl ?: '',//完整URL链接
+                'mid' => (int)request()->mid ?: 0,//完整URL链接
+                'created_at' => time()
+            ];
+
+            $json = json_encode($temporary_data);
+            Redis::lpush('plugin-browse_footprint:middleware', $json);
+        }
+    }
+
+    // 发布 plugin.video-share.frontend.video.sub
+    public function sub()
+    {
+        $uid = \YunShop::app()->getMemberId();
+        $goodsId = intval(request()->goods_id);
+        $title = request()->title;
+        $video = request()->video;
+        $file_name = request()->file_name;
+        $cover = request()->cover;
+        $ingress = request()->ingress;
+        $category_id = request()->category_id;
+
+        $set = \Setting::get('plugin.video-share');
+        if($set['default_title']) $title = $set['default_title'];
+        if($set['default_cate']) $category_id = $set['default_cate'];
+
+        if (!$title) {
+            return $this->errorJson('标题参数错误');
+        }
+        if (!$video && $set['must_video'] == 1) {
+            return $this->errorJson('视频参数错误');
+        }
+        if (!$cover) {
+            return $this->errorJson('封面参数错误');
+        }
+
+        if(!isset($set['select_goods']) || $set['select_goods']){
+            //需要选择商品(todo 未设置信息的时候默认需要选择商品)
+            if (!$goodsId) {
+                return $this->errorJson('请选择商品');
+            }
+        }else{//已关闭选择商品
+            $goodsId = 0;
+        }
+
+        if (!$set['is_review']){//判断是否开启审核
+            $status = 1;
+        }else{
+            $status = 0;
+        }
+
+        if ($ingress) {
+            $check_result = (new MiniFileLimitService())->checkMsg($title);
+            if ($check_result['errcode'] != 0) {
+                return $this->errorJson('输入信息含有违法违规内容');
+            }
+        }
+
+        $data = [
+            'goods_id' => $goodsId,
+            'uniacid' => \YunShop::app()->uniacid,
+            'uid' => $uid,
+            'title' => $title,
+            'video' => $video?:'',
+            'file_name' => $file_name?:'',
+            'cover' => $cover,
+            'share_num' => 0,
+            'like_num' => 0,
+            'order_price' => 0,
+            'amount_total' => 0,
+            'status' => $status,
+            'category_id'=>empty($category_id) ? 0 : $category_id
+        ];
+
+        if (request()->is_crm) {
+            $data['is_crm'] = 1;
+        }
+
+        $video = VideoShareGoods::create($data);
+
+        event(new VideoPublishEvent($video));
+
+        return $this->successJson('成功', [
+            'style_type' => $set['list_style'] == 2 ? '2' : '1' //前端列表样式
+        ]);
+    }
+
+    // 保存视频 暂时不用
+    public function upload()
+    {
+        $file = request()->file('file');
+        if (!$file) {
+            return $this->errorJson('请传入正确参数.');
+        }
+        if ($file->isValid()) {
+            // 获取文件相关信息
+            $originalName = $file->getClientOriginalName(); // 文件原名
+            $realPath = $file->getRealPath();   //临时文件的绝对路径
+            $ext = $file->getClientOriginalExtension();
+            $newOriginalName = md5($originalName . str_random(6)) . '.' . $ext;
+
+            \Storage::disk('image')->put($newOriginalName, file_get_contents($realPath));
+
+            return $this->successJson('上传成功', [
+                'img' => \Storage::disk('image')->url($newOriginalName),
+            ]);
+        }
+
+    }
+
+    // 查看
+    public function getVideoGoods()
+    {
+        $uid = \YunShop::app()->getMemberId();
+        $videoGoodsId = intval(request()->video_goods_id);
+        if (!$videoGoodsId) {
+            return $this->errorJson('参数错误[video_goods_id=null]');
+        }
+        $videoGoods = VideoShareGoods::with([
+                'member' => function ($member) {
+                    $member->select(['avatar', 'uid', 'nickname']);
+                },
+                'goods' => function ($goods) {
+                    $goods->select(['id', 'title', 'price', 'market_price', 'thumb','has_option']);
+                }
+            ])->where('status', 1)
+            ->find($videoGoodsId);
+        if (!$videoGoods) {
+            return $this->errorJson('未找到信息');
+        }
+        $businessCard = app('plugins')->isEnabled('business-card');
+        $videoGoods->member->business_card = 0;
+        if ($businessCard) {
+            $cardModel = BusinessCardModel::select()
+                ->where('member_id', $videoGoods->member->uid)
+                ->first();
+            if ($cardModel) {
+                $videoGoods->member->business_card = $cardModel->id;
+            }
+        }
+        $videoGoods->goods->thumb = yz_tomedia($videoGoods->goods->thumb);
+        $videoGoods->cover = yz_tomedia($videoGoods->cover);
+        $videoGoods->video = yz_tomedia($videoGoods->video);
+        $videoGoods->member_video_num = count(VideoShareGoods::where('uid', $videoGoods->member->uid)->whereNotNull('video')->get());
+        $videoGoods->comment_num = Comment::where('video_id',$videoGoodsId)->count();
+
+        // 会员点赞 默认可以点赞
+        $videoGoods->member_like = 1;
+        $likeLog = LikeLog::select()
+            ->where('uid', $uid)
+            ->where('vid', $videoGoodsId)
+            ->first();
+        if ($likeLog) {
+            $videoGoods->member_like = 0;
+        }
+
+        //投放广告视频插件-观看赚/投放广告按钮
+        $videoGoods->ad_serving_button_status = [];
+        if (app('plugins')->isEnabled('ad-serving')) {
+            $videoGoods->ad_serving_button_status = \Yunshop\AdServing\services\PrivilegeValidateService::checkButton(request()->video_goods_id,2);
+        }
+
+        //判断当前会员是否在直播
+        $is_live = 0;
+        if (app('plugins')->isEnabled('room')) {
+            $member_id = \YunShop::app()->getMemberId();
+            $anchor = \Yunshop\Room\models\Anchor::uniacid()->where("member_id",$member_id)->first();
+            if ($anchor) {
+                $is_live = $anchor['status'];
+            }
+        }
+
+        //判断是否关注
+        $follow = Follow::uniacid()->where("member_id",$videoGoods->uid)->where("follow_member_id",$uid)->count();
+
+        return $this->successJson('成功', [
+            'video_goods' => $videoGoods,
+            'is_live' => $is_live,
+            'is_follow' => ($follow>0) ? 1 : 0
+        ]);
+    }
+
+    // 增加分享次数 plugin.video-share.frontend.video.share
+    public function share()
+    {
+        $videoGoodsId = intval(request()->video_goods_id);
+        if (!$videoGoodsId) {
+            return $this->errorJson('参数错误[video_goods_id=null]');
+        }
+        $videoGoods = VideoShareGoods::find($videoGoodsId);
+        if (!$videoGoods) {
+            return $this->errorJson('未找到信息');
+        }
+        $videoGoods->share_num += 1;
+        $videoGoods->save();
+
+        return $this->successJson('分享次数增加成功',$videoGoods->share_num);
+    }
+
+    // 增加点赞次数
+    public function like()
+    {
+        $uid = \YunShop::app()->getMemberId();
+        $videoGoodsId = intval(request()->video_goods_id);
+        if (!$videoGoodsId) {
+            return $this->errorJson('参数错误[video_goods_id=null]');
+        }
+
+        $videoGoods = VideoShareGoods::find($videoGoodsId);
+        if (!$videoGoods) {
+            return $this->errorJson('未找到信息');
+        }
+
+        $likeLog = LikeLog::select()
+            ->where('uid', $uid)
+            ->where('vid', $videoGoodsId)
+            ->first();
+
+        if ($likeLog) {
+            $videoGoods->like_num -= 1;
+
+            $likeLog->delete();
+
+            $msg = '点赞取消成功';
+        } else {
+            $videoGoods->like_num += 1;
+
+            LikeLog::create([
+                'uniacid' => \YunShop::app()->uniacid,
+                'uid' => $uid,
+                'vid' => $videoGoodsId
+            ]);
+
+            $msg = '点赞成功';
+        }
+
+        $videoGoods->save();
+
+        return $this->successJson($msg, [
+
+        ]);
+    }
+
+    /**
+     * 会员发布的视频列表
+     */
+    public function myVideo()
+    {
+        $status = request()->status;
+        $uid = request()->v_uid ?: \Yunshop::app()->getMemberId();
+//        $set = \Setting::get('plugin.video-share');
+
+        $videos = VideoShareGoods::myVideo($uid)->where(['status' => $status])
+            ->orderBy('id', 'desc')
+            ->paginate(20);
+
+        foreach ($videos as &$item){
+            $item['goods']['thumb'] = yz_tomedia($item['goods']['thumb']);
+            $item['cover'] = yz_tomedia($item['cover']);
+            $item['video'] = yz_tomedia($item['video']);
+
+            // 会员点赞 默认可以点赞
+            $item->member_like = 1;
+            $likeLog = LikeLog::select()
+                ->where('uid', $uid)
+                ->where('vid', $item->id)
+                ->first();
+            if ($likeLog) {
+                $item->member_like = 0;
+            }
+
+            //视频数量
+            $item->member_video_num = count(VideoShareGoods::where('uid', $uid)->whereNotNull('video')->get());
+
+            //评论数量
+            $item->comment_num = Comment::uniacid()->where(['video_id' => $item->id, 'comment_id' => 0])->count();
+        }
+
+        $release = VideoShareGoods::myVideo($uid)->where('status',1)->count();//发布总数
+        $review = VideoShareGoods::myVideo($uid)->where('status',0)->count();//审核总数
+
+        $member = Member::uniacid()->select('uid', 'avatar', 'nickname')->where('uid',$uid)->first();
+
+        return $this->successJson('成功', [
+            'video'         => $videos,
+            'member'        => $member,
+            'release'       => $release,
+            'review'        => $review,
+            'is_open'       => \Setting::get('plugin.video-share')['is_review'] ?: 0
+        ]);
+    }
+
+    public function del()
+    {
+        $id = request()->id;
+        $member_id = \Yunshop::app()->getMemberId();
+        //进行文件删除
+        $videoGoods = VideoShareGoods::where('id', $id)->where('uid', $member_id)->first();
+
+        if (empty($videoGoods)) {
+            return $this->errorJson('视频不存在或已删除');
+        }
+
+        Storage::disk('audios')->delete($videoGoods->file_name);
+
+        $result = VideoShareGoods::where('id',$id)->delete();
+
+        if ($result) {
+            return $this->successJson('删除成功');
+        } else {
+            return $this->errorJson('数据异常,删除失败');
+        }
+    }
+
+    public function watchVideo()
+    {
+        $video_id = request()->video_id;
+
+        $video = VideoShareGoods::uniacid()->where('id', $video_id)->first();
+
+        //触发观看视频事件
+        //event((new VideoWatchEvent($video_id, \Yunshop::app()->getMemberId())));
+
+        if (!$video || !app('plugins')->isEnabled('video-share-points')) {
+            return $this->successJson('ok', ['is_show' => false]);
+        }
+
+        //观看奖励
+        $res = (new \Yunshop\VideoSharePoints\common\services\VideoWatchService)->handle(\Yunshop::app()->getMemberId(), $video_id);
+        if ($res['judge'] && $res['points'] > 0) {
+            return $this->successJson('ok', ['is_show' => true, 'points' => $res['points'], 'point_name' => $res['name'], 'days' => $res['days'] ?: 0]);
+        } else {
+            return $this->successJson('ok', ['is_show' => false]);
+        }
+    }
+}
\ No newline at end of file
diff --git a/plugins/video-share/src/widgets/WithdrawWidget.php b/plugins/video-share/src/widgets/WithdrawWidget.php
new file mode 100644
index 00000000..9c63e0dc
--- /dev/null
+++ b/plugins/video-share/src/widgets/WithdrawWidget.php
@@ -0,0 +1,16 @@
+ '', 'poundage_rate' => '']);
+        return view('Yunshop\VideoShare::withdraw.index', [
+            'set' => $set,
+        ])->render();
+    }
+}
\ No newline at end of file
diff --git a/plugins/video-share/views/bonus/list.blade.php b/plugins/video-share/views/bonus/list.blade.php
new file mode 100644
index 00000000..e2fe7789
--- /dev/null
+++ b/plugins/video-share/views/bonus/list.blade.php
@@ -0,0 +1,190 @@
+@extends('layouts.base')
+@section('title', '分红记录')
+@section('content')
+
+    
+
+
+ 分红记录 +
+ +
+
+ +@endsection diff --git a/plugins/video-share/views/category/edit.blade.php b/plugins/video-share/views/category/edit.blade.php new file mode 100644 index 00000000..30e7b658 --- /dev/null +++ b/plugins/video-share/views/category/edit.blade.php @@ -0,0 +1,122 @@ +@extends('layouts.base') +@section('content') + +
+
+
+
+
分类编辑
+ + + + + + + + + + +
+
+
+ 提交 +
+
+
+ +@endsection diff --git a/plugins/video-share/views/category/list.blade.php b/plugins/video-share/views/category/list.blade.php new file mode 100644 index 00000000..0a17331c --- /dev/null +++ b/plugins/video-share/views/category/list.blade.php @@ -0,0 +1,181 @@ +@extends('layouts.base') +@section('title', '发现管理') +@section('content') + +
+
+
+ 发现管理 +
+ + +
+ + + + + +
+
+ +@endsection \ No newline at end of file diff --git a/plugins/video-share/views/center/index.blade.php b/plugins/video-share/views/center/index.blade.php new file mode 100644 index 00000000..ae567a6f --- /dev/null +++ b/plugins/video-share/views/center/index.blade.php @@ -0,0 +1,1456 @@ +@extends('layouts.base') +@section('content') +@section('title', trans('短视频中心')) + + + + + +
+ + + +
+
+
+
+   +
+
+ +
+
+
+
短视频中心 +
+
+
+
+
+
+
+ 短视频来源 +
+ + + + +
+
+
+ 短视频ID +
+ +
+
+
+ 短视频标题 +
+ +
+
+
+ 关联商品 +
+ + +
+ + +
+
+ 导入状态 +
+ + + + +
+
+ + 搜索 + +
+
+ +
+ +
+
+
+
+
+
+
短视频列表 +
+
+
+
+
+ + + + + + + + + + + + + + + + + + + + + + +
+
+ +
+ + + {{-- --}} + {{-- --}} +
+
+
+
选择导入短视频分类
+ + + + +
选择导入商品分类
+ + + + + + + + + +
选择关联会员
+ + +
+ [[current_member]] + + + + 导入短视频[[changeTotal==0?"":"("+changeTotal+")"]] + + + 导入全部短视频([[total>=2000?total_str:total]]) + +
+
+
+
+
+ +
+
+ +
+ + 搜索 +
+ + + + + + + + + + + + 取 消 + + +
+ + + + 共计短视频数为[[total_str]]个,因条件限制该操作只能导入前2000款短视频 + + 导入短视频总数:[[all_import.import_total]] + + 已导入短视频数:[[all_import.import_exits]] + + F + 总进度约:[[all_import.import_process]]% + + + 取 消 + 确认导入 + + + +
+ +
+
+ +
+
+
+
+
+ +@include('public.admin.tinymceee') + + +@endsection('content') \ No newline at end of file diff --git a/plugins/video-share/views/comments/comments-category.blade.php b/plugins/video-share/views/comments/comments-category.blade.php new file mode 100644 index 00000000..3341a179 --- /dev/null +++ b/plugins/video-share/views/comments/comments-category.blade.php @@ -0,0 +1,141 @@ +@extends('layouts.base') +@section('title', '评论管理') +@section('content') + +
+
+
+ 评论管理 ([[total]]条) +
+ + + + + + + + + + + + + + + 搜索 + + + + + + + + + + + + + + + + + + + +
+ + + + + +
+ +
+ +
+
+
+ + @endsection \ No newline at end of file diff --git a/plugins/video-share/views/comments/view-comments.blade.php b/plugins/video-share/views/comments/view-comments.blade.php new file mode 100644 index 00000000..81eaf6e3 --- /dev/null +++ b/plugins/video-share/views/comments/view-comments.blade.php @@ -0,0 +1,145 @@ +@extends('layouts.base') +@section('title', '查看评论') +@section('content') + +
+
+
+ 查看评论 ([[num]]) + 展开子评论 + 收起子评论 + 返回列表 +
+
+
+
+ +
+ + [[item.nick_name]] + + +
[[item.created_at]]
+
[[item.content]]
+
+ 展开更多回复 + +
+
+
+
+ +
+ + [[sonItem.nick_name]] + + +
[[sonItem.created_at]]
+
回复 [[sonItem.reply_name]]  [[sonItem.content]]
+
+ 收起 + +
+
+
+
+
+ +
+ + + + + +
+
+ + @endsection \ No newline at end of file diff --git a/plugins/video-share/views/componemts/videoCard.blade.php b/plugins/video-share/views/componemts/videoCard.blade.php new file mode 100644 index 00000000..0aa45b5c --- /dev/null +++ b/plugins/video-share/views/componemts/videoCard.blade.php @@ -0,0 +1,214 @@ + + + + + \ No newline at end of file diff --git a/plugins/video-share/views/set/index.blade.php b/plugins/video-share/views/set/index.blade.php new file mode 100644 index 00000000..8fef116f --- /dev/null +++ b/plugins/video-share/views/set/index.blade.php @@ -0,0 +1,1560 @@ +@extends('layouts.base') +@section('title', '发现基础设置') +@section('content') + + + + + +
+ +
+
+
+
+
+
+
+ + 基础设置 +
+
+
+ 发现插件开启 + +
+ + +
+ H5聚合页链接 + + 复制 +
+ +
+ 小程序聚合页链接 + + 复制 +
+
+
+
+
+
+ + 短视频中心管理 +
+
+
+ 短视频中心默认会员 + + +
+ + 搜索 +
+ + + + + + + + + + + + 取 消 + + +
+
+
+ 自动同步短视频 + +
+
开启供应链中台新增短视频的,自动导入商城分享视频。
+
+ 自动同步短视频导入分类 + + + +
+
+ 支持自动导入的短视频来源 + +
+
支持多选,勾选后中台新增短视频自动同步导入指定的分类中。
+
+
+
+
+
+ + 发布设置 +
+
+
+ 发布是否需要审核 + +
+
+ 是否强制发布视频 + +
+
用户没发布过视频的,不能访问主页和其它页面。开启后与发布权限有冲突,发布权限建议选择全部。
+
+ 发布视频是否必传视频 + +
+
+ 是否开启选择商品 + +
+
+
+ *发布权限 + +
+
+ + 只有开启的角色才能发布视频。 +
+
+ 选择会员 + + + 选择角色 + 清除选择 +
+
+ +
[[item.nickname]]
+ +
+
+
+ +
+ *视频长度限制 + + +
+
+ 设置默认标题 + +
+
为空则不设置默认标题,设置了默认标题,前端则不显示标题
+
+ 是否显示分类 + +
+
+ 设置默认分类 + + + +
+
设置后前端发布视频不显示分类
+
+ 是否显示已隐藏分类 + +
+
开启后用户发布视频时可选择隐藏分类。
+
+ 上传按钮 + +
+
默认为确认发布
+
+ 温馨提示 + +
+
在发布视频页面显示,默认为视频时长不应超过xxx秒,封面图尽量和视频高度一致
+
+ 是否显示我的关注 + +
+ + + + +
+ *发布页背景 + + 选择图片 +
+ +
+ + + +
+
+ + (请上传375*375px方形图片) +
+
+ + +
+
+ 用户协议自定义名称 + +
+
+
+
+ *用户协议 + +
+
+ +
+
+
+
+
+ + 显示设置 +
+
+
+
+ 列表样式 + +
+
+ 是否显示我的关注 + +
+ +
+ 是否显示推荐 + +
+ +
+ 是否显示正在直播按钮 + +
+ + {{--
--}} + {{--是否显示发布会员昵称--}} + {{--开启--}} + {{--关闭--}} + {{----}} + {{--
--}} + +
+ 是否开启评论 + +
+
+ 显示会员中心入口 + + +
+
开启后在短视频详情页面显示会员中心入口
+
+ cps播放方式 + +
+ +
+ 显示视频观看进度条 + + +
+
开启后在短视频详情页面显示视频观看进度条
+ + + + + +
+ + + +
+
+ + 建议尺寸:100*100 +
+ + + + + +
+
+
+
+
+
+ + 幻灯片设置 +
+
+
+
+ 发现首页幻灯片显示 + +
+ + +
+ + + +
+
+ + (请上传640*300px方形图片) +
+ + + + +
+ + + +
+
+ + (请上传640*300px方形图片) +
+ +
+ 小程序跳转 + + 选择页面 +
+ +
+ + + +
+
+ + (请上传640*300px方形图片) +
+ +
+ 小程序跳转 + + 选择页面 +
+
+ +
+
+ + +
+
+
+ + 发现奖励设置 +
+
+
+ +
+ 发现奖励计算方式 + +
+ +
+ *购买奖励 + + % +
+ +
+
+ +
+ 保存 +
+ + + + + +
+ +
+ +
+ +
+
+
+ + + + +
+ + 不限 + [[item]]年 + +
+ +
+ + 不限 + 1月 + 2月 + 3月 + 4月 + 5月 + 6月 + 7月 + 8月 + 9月 + 10月 + 11月 + 12月 + +
+ +
+
+ + +
+
+ + + +
+
+ + 取 消 + 确 定 + +
+ +
+ + + 搜索 + + + + + + + + + + + + + + +
+ + 取 消 + 确 定 + +
+
+
+ +
+
+ @include('public.admin.pop') + @include('public.admin.program') + + + +@endsection diff --git a/plugins/video-share/views/videoGoods/image.blade.php b/plugins/video-share/views/videoGoods/image.blade.php new file mode 100644 index 00000000..8ed390b2 --- /dev/null +++ b/plugins/video-share/views/videoGoods/image.blade.php @@ -0,0 +1,62 @@ +@extends('layouts.base') +@section('title', '发现管理') +@section('content') + +
+ +@endsection \ No newline at end of file diff --git a/plugins/video-share/views/videoGoods/list.blade.php b/plugins/video-share/views/videoGoods/list.blade.php new file mode 100644 index 00000000..f896313e --- /dev/null +++ b/plugins/video-share/views/videoGoods/list.blade.php @@ -0,0 +1,601 @@ +@extends('layouts.base') +@section('title', '发现管理') +@section('content') + +
+
+
+ 发现管理 +
+ + +
+@include('Yunshop\VideoShare::componemts.videoCard') +@include('public.admin.uploadMultimediaImg') + +@endsection \ No newline at end of file diff --git a/plugins/video-share/views/widget/set.blade.php b/plugins/video-share/views/widget/set.blade.php new file mode 100644 index 00000000..ce97a32e --- /dev/null +++ b/plugins/video-share/views/widget/set.blade.php @@ -0,0 +1,61 @@ +
+
+ +
+ + 当前代理的佣金达到此额度时才能提现 +
+
+ +
+ +
+
+ + +
+
+
+
+ +
+
+ +
+
+
+
+ diff --git a/plugins/video-share/views/withdraw/index.blade.php b/plugins/video-share/views/withdraw/index.blade.php new file mode 100644 index 00000000..33ed6244 --- /dev/null +++ b/plugins/video-share/views/withdraw/index.blade.php @@ -0,0 +1,61 @@ +
+
+ +
+ + 奖励金额达到此额度时才能提现 +
+
+ +
+ +
+
+ + +
+
+
+
+ +
+
+ +
+
+
+
+