-
+
{{ $slot }}
diff --git a/resources/beike/admin/views/pages/design/builder/component/rich_text_i18n.blade.php b/resources/beike/admin/views/pages/design/builder/component/rich_text_i18n.blade.php
index 14454d7b..0f4b89c1 100644
--- a/resources/beike/admin/views/pages/design/builder/component/rich_text_i18n.blade.php
+++ b/resources/beike/admin/views/pages/design/builder/component/rich_text_i18n.blade.php
@@ -107,19 +107,18 @@ Vue.component('rich-text-i18n', {
fontsize_formats: "10px 12px 14px 18px 24px 36px 48px 56px 72px 96px",
lineheight_formats: "1 1.1 1.2 1.3 1.4 1.5 1.7 2.4 3 4",
relative_urls : true,
- // init_instance_callback: function (ed) {
- // let code = ed.getElement().dataset.code
- // ed.setContent(self.value[code])
- // },
setup: function(ed) {
ed.ui.registry.addButton('toolbarImageButton', {
- // text: '',
icon: 'image',
onAction:function() {
bk.fileManagerIframe(images => {
if (images.length) {
images.forEach(e => {
- ed.insertContent(`

`);
+ if (e.mime == 'video/mp4') {
+ ed.insertContent(`
`);
+ } else {
+ ed.insertContent(`

`);
+ }
});
}
})
diff --git a/resources/beike/admin/views/pages/file_manager/index.blade.php b/resources/beike/admin/views/pages/file_manager/index.blade.php
index ca8d5972..22e770df 100644
--- a/resources/beike/admin/views/pages/file_manager/index.blade.php
+++ b/resources/beike/admin/views/pages/file_manager/index.blade.php
@@ -73,8 +73,8 @@
{{ __('admin/builder.modules_choose') }}
-
{{ __('admin/file_manager.download') }}
+
{{ __('common.view') }}
{{ __('common.delete') }}
-
+
+
+
![]()
+
@{{ file.name }}
@@ -143,7 +146,6 @@
@else
{{ __('admin/file_manager.show_pc') }}
-
@endif
@{{ index + 1 }}. @{{ image.name }}
- {{ __('admin/file_manager.finish') }}
+ {{ __('admin/file_manager.finish') }}
+ {{ __('admin/file_manager.upload_fail') }}
{{ __('admin/file_manager.uploading') }}
-
+
+
@@ -186,13 +190,10 @@
paneLengthPercent: 26,
triggerLength: 10,
isShift: false,
-
- ssss: [],
+ mime: @json(request('mime')),
loading: false,
isBatchSelect: false,
-
selectImageIndex: [],
-
filter: {
sort: 'created',
order: 'desc'
@@ -330,12 +331,16 @@
let index = this.uploadFileDialog.images.length - 1;
- $http.post('file_manager/upload', formData).then((res) => {
+ $http.post('file_manager/upload', formData, {hmsg: true}).then((res) => {
this.uploadFileDialog.images[index].status = 'complete';
this.uploadFileDialog.images[index].progre = 100;
+ }).catch((err) => {
+ this.uploadFileDialog.images[index].status = 'fail';
+ this.uploadFileDialog.images[index].progre = 80;
+ this.uploadFileDialog.images[index].fail_text = err.response.data.message;
}).finally(() => {
index += 1
- })
+ });
},
handleUploadChange(e) {
@@ -442,6 +447,20 @@
fileChecked() {
let typedFiles = this.images.filter(e => e.selected)
+ if (this.mime) {
+ // 判断 typedFiles 数组内 mime 是否有不是 image 开头的
+ if (this.mime == 'image' && typedFiles.some(e => !e.mime.startsWith('image'))) {
+ layer.msg('{{ __('admin/file_manager.verify_select_image') }}', () => {});
+ return;
+ }
+
+ // 判断 typedFiles 数组内 mime 是否有不是 video 开头的
+ if (this.mime == 'video' && typedFiles.some(e => !e.mime.startsWith('video'))) {
+ layer.msg('{{ __('admin/file_manager.verify_select_video') }}', () => {});
+ return;
+ }
+ }
+
if (callback !== null) {
callback(typedFiles);
}
@@ -513,6 +532,13 @@
});
},
+ viewImages() {
+ const selectedImages = this.images.filter(e => e.selected);
+ selectedImages.forEach(e => {
+ window.open(e.origin_url);
+ });
+ },
+
openInputBox(type, node, data) {
let fileSuffix, fileName = '';
diff --git a/resources/beike/admin/views/pages/products/form/form.blade.php b/resources/beike/admin/views/pages/products/form/form.blade.php
index cb956c25..36611219 100644
--- a/resources/beike/admin/views/pages/products/form/form.blade.php
+++ b/resources/beike/admin/views/pages/products/form/form.blade.php
@@ -79,7 +79,19 @@
{{ __('admin/product.image_help') }}
- {{--
--}}
+
+
+
+ {{ __('admin/product.video_help') }}
+
+
@@ -516,6 +528,10 @@
form: {
attributes: @json(old('pickups', $product_attributes) ?? []),
images: @json(old('images', $product->images) ?? []),
+ video: {
+ path: @json(old('video', $product->video ?? '')),
+ url: @json(image_origin(old('video', $product->video ?? ''))),
+ },
model: @json($product->skus[0]['model'] ?? ''),
price: @json($product->skus[0]['price'] ?? ''),
quantity: @json($product->skus[0]['quantity'] ?? ''),
@@ -678,7 +694,13 @@
return;
}
this.form.images.push(...images.map(e => e.path))
- })
+ }, {mime: 'image'})
+ },
+
+ addProductVideo() {
+ bk.fileManagerIframe(images => {
+ this.form.video = {path: images[0].path, url: images[0].url}
+ }, {mime: 'video'})
},
removeImages(index) {
diff --git a/resources/beike/shop/default/css/global.scss b/resources/beike/shop/default/css/global.scss
index bc3345a0..ad0be39f 100644
--- a/resources/beike/shop/default/css/global.scss
+++ b/resources/beike/shop/default/css/global.scss
@@ -322,4 +322,25 @@ img {
padding-top: .8rem;
padding-bottom: .8rem;
}
-}
\ No newline at end of file
+}
+
+// 溢出隐藏 显示省略号
+.text-ellipsis {
+ overflow: hidden;
+ text-overflow: ellipsis;
+ white-space: nowrap;
+ // 加一个 line
+ &.line-2 {
+ white-space: normal;
+ display: -webkit-box;
+ -webkit-box-orient: vertical;
+ -webkit-line-clamp: 2;
+ }
+
+ &.line-3 {
+ white-space: normal;
+ display: -webkit-box;
+ -webkit-box-orient: vertical;
+ -webkit-line-clamp: 3;
+ }
+}
diff --git a/resources/beike/shop/default/css/page-product.scss b/resources/beike/shop/default/css/page-product.scss
index d17e935e..983ee672 100644
--- a/resources/beike/shop/default/css/page-product.scss
+++ b/resources/beike/shop/default/css/page-product.scss
@@ -23,6 +23,8 @@ body.page-product {
}
.product-image {
+ position: relative;
+
#swiper {
height: 250px;
@media (min-width: 480px) {
@@ -117,6 +119,68 @@ body.page-product {
.right {
border: 1px solid #eee;
+ position: relative;
+ }
+
+ #product-video {
+ position: absolute;
+ width: 100%;
+ height: 100%;
+ top: 0;
+ left: 0;
+ z-index: 99;
+ display: none;
+ }
+
+ .open-video {
+ position: absolute;
+ bottom: 10px;
+ z-index: 99;
+ line-height: 1;
+ cursor: pointer;
+
+ @media (min-width: 768px) {
+ transform: translateX(-50%);
+ left: 50%;
+ }
+
+ @media (max-width: 768px) {
+ right: 10px;
+ }
+
+ &:hover {
+ i {
+ color: #fff;
+ background-color: rgba(0, 0, 0, 0.648);
+ }
+ }
+
+ i {
+ font-size: 3.5rem;
+ line-height: 1;
+ border-radius: 50%;
+ font-weight: 400;
+ display: inline-block;
+ color: rgba(255, 255, 255, 0.948);
+ background-color: rgba(0, 0, 0, 0.348);
+
+ @media (max-width: 768px) {
+ font-size: 2.5rem;
+ }
+ }
+ }
+
+ .close-video {
+ position: absolute;
+ top: 6px;
+ right: 10px;
+ z-index: 9999;
+ color: #aaa;
+ font-size: 30px;
+ cursor: pointer;
+ &:hover {
+ color: #fff;
+ }
}
}
diff --git a/resources/lang/en/admin/file_manager.php b/resources/lang/en/admin/file_manager.php
index 796774f1..11356b90 100644
--- a/resources/lang/en/admin/file_manager.php
+++ b/resources/lang/en/admin/file_manager.php
@@ -33,6 +33,8 @@ return [
'no_file' => 'No File',
'picture_space' => 'Picture Space',
'show_pc' => 'Please go to the PC side to operate',
+ 'verify_select_image' => 'Please select a picture',
+ 'verify_select_video' => 'Please select video',
'confirm_delete_file' => 'Do you want to delete the selected file',
'confirm_delete_folder' => 'The folder deletion operation is in progress, all files in the folder will be deleted, do you want to confirm?',
@@ -40,5 +42,6 @@ return [
'can_empty' => 'Can not be empty',
'finish' => 'Finish',
'uploading' => 'loading...',
+ 'upload_fail' => 'Upload failed',
'file_manager' => 'File Manager',
];
diff --git a/resources/lang/en/admin/product.php b/resources/lang/en/admin/product.php
index f1a9280a..db5493d5 100644
--- a/resources/lang/en/admin/product.php
+++ b/resources/lang/en/admin/product.php
@@ -36,6 +36,7 @@ return [
'quantity' => 'Quantity',
'enable_multi_spec' => 'Enable multi-spec',
'image_help' => 'The first picture will be used as the main picture of the product, and multiple pictures can be uploaded at the same time, and the position of multiple pictures can be adjusted at will',
+ 'video_help' => 'If the prompt exceeds the system size limit, please modify the php.ini parameter post_max_size',
'add_variable' => 'Add Specs',
'add_variable_value' => 'Add Specification Value',
'add_variable_image' => 'Add Spec Image',
diff --git a/resources/lang/en/product.php b/resources/lang/en/product.php
index 862f1cb1..384b29a2 100644
--- a/resources/lang/en/product.php
+++ b/resources/lang/en/product.php
@@ -23,6 +23,7 @@ return [
'g' => 'Gram',
'oz' => 'Ounce',
'lb' => 'Pound',
+ 'video' => 'Video',
'active' => 'Active',
'inactive' => 'Inactive',
diff --git a/resources/lang/en/shop/carts.php b/resources/lang/en/shop/carts.php
index 097e17d2..2e6e1d7a 100644
--- a/resources/lang/en/shop/carts.php
+++ b/resources/lang/en/shop/carts.php
@@ -13,7 +13,7 @@ return [
'index' => 'Cart',
'added_to_cart' => 'Added To Cart',
'select_all' => 'Select All',
- 'commodity' => 'Commodity',
+ 'commodity' => 'Product',
'quantity' => 'Quantity',
'subtotal' => 'Subtotal',
'product_total' => 'Product Total',
diff --git a/resources/lang/zh_cn/admin/file_manager.php b/resources/lang/zh_cn/admin/file_manager.php
index 04383af9..42ab1da5 100644
--- a/resources/lang/zh_cn/admin/file_manager.php
+++ b/resources/lang/zh_cn/admin/file_manager.php
@@ -33,12 +33,15 @@ return [
'no_file' => '没有文件',
'picture_space' => '图片空间',
'show_pc' => '请到PC端操作',
+ 'verify_select_image' => '请选择图片',
+ 'verify_select_video' => '请选择视频',
- 'confirm_delete_file' => '是否要删除选中文件',
- 'confirm_delete_folder' => '正在进行删除文件夹操作,文件夹内所有文件都将被删除,是否确认?',
- 'new_folder' => '新建文件夹',
- 'can_empty' => '不能为空',
- 'finish' => '完成',
- 'uploading' => '上传中',
- 'file_manager' => '图片管理器',
+ 'confirm_delete_file' => '是否要删除选中文件',
+ 'confirm_delete_folder' => '正在进行删除文件夹操作,文件夹内所有文件都将被删除,是否确认?',
+ 'new_folder' => '新建文件夹',
+ 'can_empty' => '不能为空',
+ 'finish' => '完成',
+ 'uploading' => '上传中',
+ 'upload_fail' => '上传失败',
+ 'file_manager' => '图片管理器',
];
diff --git a/resources/lang/zh_cn/admin/product.php b/resources/lang/zh_cn/admin/product.php
index 7c9eb6e6..3bb6fa37 100644
--- a/resources/lang/zh_cn/admin/product.php
+++ b/resources/lang/zh_cn/admin/product.php
@@ -36,6 +36,7 @@ return [
'quantity' => '数量',
'enable_multi_spec' => '启用多规格',
'image_help' => '第一张图片将作为商品主图,支持同时上传多张图片,多张图片之间可随意调整位置',
+ 'video_help' => '如果提示超出系统大小限制,请修改 php.ini 参数 post_max_size',
'add_variable' => '添加规格',
'add_variable_value' => '添加规格值',
'add_variable_image' => '添加规格图片',
diff --git a/resources/lang/zh_cn/product.php b/resources/lang/zh_cn/product.php
index 71901492..60c8f58b 100644
--- a/resources/lang/zh_cn/product.php
+++ b/resources/lang/zh_cn/product.php
@@ -24,6 +24,7 @@ return [
'g' => '克',
'oz' => '盎司',
'lb' => '磅',
+ 'video' => '视频',
'active' => '上架',
'inactive' => '下架',
diff --git a/themes/default/account/rmas/index.blade.php b/themes/default/account/rmas/index.blade.php
index b6bec57d..8bc6e9fb 100644
--- a/themes/default/account/rmas/index.blade.php
+++ b/themes/default/account/rmas/index.blade.php
@@ -14,40 +14,41 @@
{{ __('shop/account.rma.index') }}