diff --git a/resources/beike/admin/views/components/alert.blade.php b/resources/beike/admin/views/components/alert.blade.php index 0fe2eae1..2fe66976 100644 --- a/resources/beike/admin/views/components/alert.blade.php +++ b/resources/beike/admin/views/components/alert.blade.php @@ -1,5 +1,5 @@
- {{ $msg }} + {!! $msg !!}
\ No newline at end of file diff --git a/resources/beike/admin/views/pages/design/builder/component/image_selector.blade.php b/resources/beike/admin/views/pages/design/builder/component/image_selector.blade.php index 46c14afa..c0b424a1 100644 --- a/resources/beike/admin/views/pages/design/builder/component/image_selector.blade.php +++ b/resources/beike/admin/views/pages/design/builder/component/image_selector.blade.php @@ -93,7 +93,11 @@ methods: { removeImage() { - this.src = ''; + if (this.isLanguage) { + this.src[this.tabActiveId] = ''; + } else { + this.src = ''; + } }, tabClick(e) { diff --git a/resources/beike/admin/views/pages/design/builder/index.blade.php b/resources/beike/admin/views/pages/design/builder/index.blade.php index 1492cdd6..57faa28f 100644 --- a/resources/beike/admin/views/pages/design/builder/index.blade.php +++ b/resources/beike/admin/views/pages/design/builder/index.blade.php @@ -199,7 +199,8 @@ watch: {}, // 组件方法 methods: { - moduleUpdated: bk.debounce(function() { + moduleUpdated: bk.debounce(function(val) { + this.form.modules[this.design.editingModuleIndex].content = val; const data = this.form.modules[this.design.editingModuleIndex] $http.post('design/builder/preview?design=1', data, {hload: true}).then((res) => { @@ -266,7 +267,7 @@ } }, created () { - this.form = @json($design_settings) + this.form = @json($design_settings ?: ['modules' => []]) }, mounted () { }, diff --git a/resources/beike/admin/views/pages/design/module/brand.blade.php b/resources/beike/admin/views/pages/design/module/brand.blade.php index ac51adf9..5503e3c8 100644 --- a/resources/beike/admin/views/pages/design/module/brand.blade.php +++ b/resources/beike/admin/views/pages/design/module/brand.blade.php @@ -3,7 +3,7 @@
{{ __('admin/builder.text_set_up') }}
{{ __('admin/builder.text_module_title') }}
- +
{{ __('admin/builder.modules_content') }}
@@ -54,12 +54,13 @@ Vue.component('module-editor-brand', { return { loading: null, brands: [], + form: null, keyword: '', } }, watch: { - module: { + form: { handler: function (val) { this.$emit('on-changed', val); }, @@ -68,8 +69,10 @@ Vue.component('module-editor-brand', { }, created: function () { - if (!this.module.brands.length) return; - const ids = this.module.brands.join(','); + this.form = JSON.parse(JSON.stringify(this.module)); + if (!this.form.brands.length) return; + + const ids = this.form.brands.join(','); this.loading = true; $http.get(`brands/names?ids=${ids}`, null, {hload:true}).then((res) => { this.brands = res.data @@ -88,8 +91,8 @@ Vue.component('module-editor-brand', { }, handleSelect(item) { - if (!this.module.brands.find(v => v == item.id)) { - this.module.brands.push(item.id * 1); + if (!this.form.brands.find(v => v == item.id)) { + this.form.brands.push(item.id * 1); this.brands.push(item); } this.keyword = "" @@ -97,11 +100,11 @@ Vue.component('module-editor-brand', { removeProduct(index) { this.brands.splice(index, 1) - this.module.brands.splice(index, 1); + this.form.brands.splice(index, 1); }, itemChange(evt) { - this.module.brands = this.brands.map(e => e.id * 1); + this.form.brands = this.brands.map(e => e.id * 1); }, } }); diff --git a/resources/beike/admin/views/pages/design/module/icons.blade.php b/resources/beike/admin/views/pages/design/module/icons.blade.php index 0b3a38ca..bdaa9cae 100644 --- a/resources/beike/admin/views/pages/design/module/icons.blade.php +++ b/resources/beike/admin/views/pages/design/module/icons.blade.php @@ -3,11 +3,11 @@
{{ __('admin/builder.text_set_up') }}
{{ __('admin/builder.text_module_title') }}
- +
{{ __('admin/builder.text_add_pictures') }}
-
+
@@ -46,12 +46,12 @@ Vue.component('module-editor-icons', { data: function () { return { - // + form: null } }, watch: { - module: { + form: { handler: function (val) { this.$emit('on-changed', val); }, @@ -60,17 +60,17 @@ Vue.component('module-editor-icons', { }, created: function () { - // + this.form = JSON.parse(JSON.stringify(this.module)); }, methods: { itemShow(index) { - this.module.images.find((e, key) => {if (index != key) return e.show = false}); - this.module.images[index].show = !this.module.images[index].show; + this.form.images.find((e, key) => {if (index != key) return e.show = false}); + this.form.images[index].show = !this.form.images[index].show; }, addItems() { - this.module.images.push({ + this.form.images.push({ image: '', link: { type: 'product', @@ -81,11 +81,11 @@ Vue.component('module-editor-icons', { show: true }) - this.module.images.find((e, key) => {if (this.module.images.length - 1 != key) return e.show = false}); + this.form.images.find((e, key) => {if (this.form.images.length - 1 != key) return e.show = false}); }, removeItem(index) { - this.module.images.splice(index, 1); + this.form.images.splice(index, 1); } } }); diff --git a/resources/beike/admin/views/pages/design/module/image100.blade.php b/resources/beike/admin/views/pages/design/module/image100.blade.php index c0fcc4a6..4120ebf1 100644 --- a/resources/beike/admin/views/pages/design/module/image100.blade.php +++ b/resources/beike/admin/views/pages/design/module/image100.blade.php @@ -3,17 +3,17 @@
设置
是否全屏
- +
内容
选择图片
- +
建议尺寸: 1920 x 500
- +
@@ -27,12 +27,12 @@ Vue.component('module-editor-image100', { data: function () { return { - // + form: null } }, watch: { - module: { + form: { handler: function (val) { this.$emit('on-changed', val); }, @@ -41,7 +41,7 @@ Vue.component('module-editor-image100', { }, created: function () { - // + this.form = JSON.parse(JSON.stringify(this.module)); }, methods: { diff --git a/resources/beike/admin/views/pages/design/module/image200.blade.php b/resources/beike/admin/views/pages/design/module/image200.blade.php index 7c1f2df4..b1a70f2f 100644 --- a/resources/beike/admin/views/pages/design/module/image200.blade.php +++ b/resources/beike/admin/views/pages/design/module/image200.blade.php @@ -3,7 +3,7 @@
{{ __('admin/builder.text_set_up') }}
{{ __('admin/builder.text_add_pictures') }}
-
+
@@ -34,12 +34,12 @@ Vue.component('module-editor-image200', { data: function () { return { - // + form: null } }, watch: { - module: { + form: { handler: function (val) { this.$emit('on-changed', val); }, @@ -48,13 +48,13 @@ Vue.component('module-editor-image200', { }, created: function () { - // + this.form = JSON.parse(JSON.stringify(this.module)); }, methods: { itemShow(index) { - this.module.images.find((e, key) => {if (index != key) return e.show = false}); - this.module.images[index].show = !this.module.images[index].show; + this.form.images.find((e, key) => {if (index != key) return e.show = false}); + this.form.images[index].show = !this.form.images[index].show; }, } }); diff --git a/resources/beike/admin/views/pages/design/module/image300.blade.php b/resources/beike/admin/views/pages/design/module/image300.blade.php index c44e0f7d..ba67199c 100644 --- a/resources/beike/admin/views/pages/design/module/image300.blade.php +++ b/resources/beike/admin/views/pages/design/module/image300.blade.php @@ -3,7 +3,7 @@
{{ __('admin/builder.text_set_up') }}
{{ __('admin/builder.text_add_pictures') }}
-
+
@@ -34,12 +34,12 @@ Vue.component('module-editor-image300', { data: function () { return { - // + form: null } }, watch: { - module: { + form: { handler: function (val) { this.$emit('on-changed', val); }, @@ -48,13 +48,13 @@ Vue.component('module-editor-image300', { }, created: function () { - // + this.form = JSON.parse(JSON.stringify(this.module)); }, methods: { itemShow(index) { - this.module.images.find((e, key) => {if (index != key) return e.show = false}); - this.module.images[index].show = !this.module.images[index].show; + this.form.images.find((e, key) => {if (index != key) return e.show = false}); + this.form.images[index].show = !this.form.images[index].show; }, } }); diff --git a/resources/beike/admin/views/pages/design/module/image401.blade.php b/resources/beike/admin/views/pages/design/module/image401.blade.php index 1a6bff9a..a274b627 100644 --- a/resources/beike/admin/views/pages/design/module/image401.blade.php +++ b/resources/beike/admin/views/pages/design/module/image401.blade.php @@ -3,7 +3,7 @@
{{ __('admin/builder.text_set_up') }}
{{ __('admin/builder.text_add_pictures') }}
-
+
@@ -36,12 +36,12 @@ Vue.component('module-editor-image401', { data: function () { return { - // + form: null } }, watch: { - module: { + form: { handler: function (val) { this.$emit('on-changed', val); }, @@ -50,13 +50,13 @@ Vue.component('module-editor-image401', { }, created: function () { - // + this.form = JSON.parse(JSON.stringify(this.module)); }, methods: { itemShow(index) { - this.module.images.find((e, key) => {if (index != key) return e.show = false}); - this.module.images[index].show = !this.module.images[index].show; + this.form.images.find((e, key) => {if (index != key) return e.show = false}); + this.form.images[index].show = !this.form.images[index].show; }, } }); diff --git a/resources/beike/admin/views/pages/design/module/product.blade.php b/resources/beike/admin/views/pages/design/module/product.blade.php index 72cd9d9d..4e1b2659 100644 --- a/resources/beike/admin/views/pages/design/module/product.blade.php +++ b/resources/beike/admin/views/pages/design/module/product.blade.php @@ -3,7 +3,7 @@
{{ __('admin/builder.text_set_up') }}
{{ __('admin/builder.text_module_title') }}
- +
{{ __('admin/builder.modules_content') }}
@@ -59,11 +59,12 @@ Vue.component('module-editor-product', { keyword: '', productData: [], loading: null, + form: null } }, watch: { - module: { + form: { handler: function (val) { this.$emit('on-changed', val); }, @@ -72,6 +73,7 @@ Vue.component('module-editor-product', { }, created: function () { + this.form = JSON.parse(JSON.stringify(this.module)); this.tabsValueProductData(); }, @@ -86,10 +88,10 @@ Vue.component('module-editor-product', { tabsValueProductData() { var that = this; - if (!this.module.products.length) return; + if (!this.form.products.length) return; this.loading = true; - $http.get('products/names?product_ids='+this.module.products.join(','), {hload: true}).then((res) => { + $http.get('products/names?product_ids='+this.form.products.join(','), {hload: true}).then((res) => { this.loading = false; that.productData = res.data; }) @@ -102,20 +104,20 @@ Vue.component('module-editor-product', { }, handleSelect(item) { - if (!this.module.products.find(v => v == item.id)) { - this.module.products.push(item.id * 1); + if (!this.form.products.find(v => v == item.id)) { + this.form.products.push(item.id * 1); this.productData.push(item); } this.keyword = "" }, itemChange(evt) { - this.module.products = this.productData.map(e => e.id * 1); + this.form.products = this.productData.map(e => e.id * 1); }, removeProduct(index) { this.productData.splice(index, 1) - this.module.products.splice(index, 1); + this.form.products.splice(index, 1); }, } }); diff --git a/resources/beike/admin/views/pages/design/module/rich_text.blade.php b/resources/beike/admin/views/pages/design/module/rich_text.blade.php index 06e3eb32..e2998d7f 100644 --- a/resources/beike/admin/views/pages/design/module/rich_text.blade.php +++ b/resources/beike/admin/views/pages/design/module/rich_text.blade.php @@ -3,7 +3,7 @@
{{ __('admin/builder.text_set_up') }}
{{ __('admin/builder.modules_content') }}
- +
@@ -16,12 +16,12 @@ Vue.component('module-editor-rich-text', { data: function () { return { - // + form: null } }, watch: { - module: { + form: { handler: function (val) { this.$emit('on-changed', val); }, @@ -30,7 +30,7 @@ Vue.component('module-editor-rich-text', { }, created: function () { - // + this.form = JSON.parse(JSON.stringify(this.module)); }, methods: { diff --git a/resources/beike/admin/views/pages/design/module/slideshow.blade.php b/resources/beike/admin/views/pages/design/module/slideshow.blade.php index e3f86213..3dbdfb3c 100644 --- a/resources/beike/admin/views/pages/design/module/slideshow.blade.php +++ b/resources/beike/admin/views/pages/design/module/slideshow.blade.php @@ -3,7 +3,7 @@
{{ __('admin/builder.text_set_up') }}
{{ __('admin/builder.modules_full_screen') }}
- +
{{ __('admin/builder.modules_content') }}
@@ -11,10 +11,10 @@
{{ __('admin/builder.modules_select_image') }}
-
+
@@ -57,15 +57,13 @@ Vue.component('module-editor-slideshow', { data: function () { return { - // full: true + form: null } }, watch: { - module: { + form: { handler: function (val) { - // console.log(previewWindow) - // $(previewWindow.document).find('.product-description h1').css('font-size', newValue); this.$emit('on-changed', val); }, deep: true, @@ -73,22 +71,22 @@ Vue.component('module-editor-slideshow', { }, created: function () { - // console.log(this.module) + this.form = JSON.parse(JSON.stringify(this.module)); }, methods: { removeImage(index) { - this.module.images.splice(index, 1); + this.form.images.splice(index, 1); }, itemShow(index) { - this.module.images.find((e, key) => {if (index != key) return e.show = false}); - this.module.images[index].show = !this.module.images[index].show; + this.form.images.find((e, key) => {if (index != key) return e.show = false}); + this.form.images[index].show = !this.form.images[index].show; }, addImage() { - this.module.images.find(e => e.show = false); - this.module.images.push({image: languagesFill('catalog/demo/banner/banner-4-en.jpg'), show: true, link: {type: 'product', value:''}}); + this.form.images.find(e => e.show = false); + this.form.images.push({image: languagesFill('catalog/demo/banner/banner-4-en.jpg'), show: true, link: {type: 'product', value:''}}); } } }); diff --git a/resources/beike/admin/views/pages/design/module/tab_product.blade.php b/resources/beike/admin/views/pages/design/module/tab_product.blade.php index 19283b04..6cfbe8ef 100644 --- a/resources/beike/admin/views/pages/design/module/tab_product.blade.php +++ b/resources/beike/admin/views/pages/design/module/tab_product.blade.php @@ -3,7 +3,7 @@
{{ __('admin/builder.text_set_up') }}
{{ __('admin/builder.text_module_title') }}
- +
{{ __('admin/builder.modules_content') }}
@@ -11,7 +11,7 @@
{{ __('admin/builder.modules_set_product') }}
{ + $http.get('products/names?product_ids='+this.form.tabs[this.editableTabsValue].products.join(','), {hload: true}).then((res) => { this.loading = false; - this.module.tabs[this.editableTabsValue].products = res.data.map(e => e.id); + this.form.tabs[this.editableTabsValue].products = res.data.map(e => e.id); that.productData = res.data; }) }, @@ -125,35 +127,35 @@ Vue.component('module-editor-tab-product', { }, handleSelect(item) { - if (!this.module.tabs[this.editableTabsValue].products.find(v => v == item.id)) { - this.module.tabs[this.editableTabsValue].products.push(item.id * 1); + if (!this.form.tabs[this.editableTabsValue].products.find(v => v == item.id)) { + this.form.tabs[this.editableTabsValue].products.push(item.id * 1); this.productData.push(item); } this.keyword = "" }, itemChange(evt) { - this.module.tabs[this.editableTabsValue].products = this.productData.map(e => e.id * 1); + this.form.tabs[this.editableTabsValue].products = this.productData.map(e => e.id * 1); }, removeProduct(index) { this.productData.splice(index, 1) - this.module.tabs[this.editableTabsValue].products.splice(index, 1); + this.form.tabs[this.editableTabsValue].products.splice(index, 1); }, handleTabsEdit(targetName, action) { if (action === 'add') { - this.module.tabs.push({title: languagesFill('Tab ' + (this.module.tabs.length + 1)), products: []}); - this.editableTabsValue = this.module.tabs.length - 1 + ''; + this.form.tabs.push({title: languagesFill('Tab ' + (this.form.tabs.length + 1)), products: []}); + this.editableTabsValue = this.form.tabs.length - 1 + ''; } if (action === 'remove') { - let tabs = this.module.tabs; + let tabs = this.form.tabs; tabs.splice(targetName, 1); let activeName = this.editableTabsValue == 0 ? '0' : targetName * 1 - 1 + ''; this.editableTabsValue = activeName; - this.module.tabs = tabs.filter(tab => tab.name !== targetName); + this.form.tabs = tabs.filter(tab => tab.name !== targetName); } } }