From 39bc33d4535f6c008f8178d4e7e1332d25405383 Mon Sep 17 00:00:00 2001 From: pushuo <229102104@qq.com> Date: Mon, 11 Jul 2022 13:57:38 +0800 Subject: [PATCH] =?UTF-8?q?=E9=A6=96=E9=A1=B5=E7=BC=96=E8=BE=91=E5=99=A8?= =?UTF-8?q?=E4=BC=98=E5=8C=96?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../View/DesignBuilders/SlideShow/Editor.php | 2 +- public/build/beike/shop/default/css/app.css | 70 +++ .../beike/shop/default/css/design/app.css | 166 ++++++- public/vendor/vue/Sortable.min.js | 2 + public/vendor/vue/vuedraggable.js | 407 ++++++++++++++++++ resources/beike/shop/default/css/app.scss | 1 + .../beike/shop/default/css/design/app.scss | 194 ++++++++- resources/beike/shop/default/css/home.scss | 94 ++++ .../builder/component/link_selector.blade.php | 0 themes/default/design/builder/index.blade.php | 27 +- .../design/module/slideshow/editor/icon.png | Bin 2903 -> 0 bytes .../module/slideshow/editor/index.blade.php | 70 ++- .../module/slideshow/render/index.blade.php | 14 +- themes/default/home.blade.php | 7 + themes/default/product.blade.php | 6 +- 15 files changed, 1046 insertions(+), 14 deletions(-) create mode 100644 public/vendor/vue/Sortable.min.js create mode 100644 public/vendor/vue/vuedraggable.js create mode 100644 resources/beike/shop/default/css/home.scss create mode 100644 themes/default/design/builder/component/link_selector.blade.php delete mode 100644 themes/default/design/module/slideshow/editor/icon.png diff --git a/beike/Shop/View/DesignBuilders/SlideShow/Editor.php b/beike/Shop/View/DesignBuilders/SlideShow/Editor.php index e0acc9a6..45da4709 100644 --- a/beike/Shop/View/DesignBuilders/SlideShow/Editor.php +++ b/beike/Shop/View/DesignBuilders/SlideShow/Editor.php @@ -36,7 +36,7 @@ class Editor extends Component 'code' => 'slideshow', 'sort' => 0, 'name' => '幻灯片模块', - 'icon' => '', + 'icon' => '', ]; return view('design.module.slideshow.editor.index', $data); diff --git a/public/build/beike/shop/default/css/app.css b/public/build/beike/shop/default/css/app.css index a0f38f10..847913c5 100644 --- a/public/build/beike/shop/default/css/app.css +++ b/public/build/beike/shop/default/css/app.css @@ -807,3 +807,73 @@ body.page-account-address .addresses-wrap .item .address-bottom, body.page-check body.page-account-address .addresses-wrap .item .address-bottom a, body.page-checkout .addresses-wrap .item .address-bottom a { color: #2d68a8; } + +.module-item { + position: relative; +} +.module-item:hover .module-edit { + display: flex; +} +.module-item:hover:after { + display: block; +} +.module-item:after { + content: ""; + display: none; + position: absolute; + left: 2px; + right: 2px; + top: 2px; + bottom: 2px; + outline: 2px solid #fd560f; +} +.module-item .module-edit { + position: absolute; + top: -22px; + left: 0; + width: 100%; + z-index: 9; + align-items: center; + justify-content: center; + display: none; +} +.module-item .module-edit .edit-wrap { + background-color: #fd560f; + color: #fff; + display: flex; + align-items: center; +} +.module-item .module-edit .edit-wrap > div { + height: 24px; + line-height: 24px; + padding: 0 10px; + cursor: pointer; + position: relative; +} +.module-item .module-edit .edit-wrap > div:first-of-type:after { + content: ""; + position: absolute; + top: 0; + border: solid rgba(0, 0, 0, 0); + border-right: solid #fd560f; + border-width: 24px 10px 0 0; + right: 100%; +} +.module-item .module-edit .edit-wrap > div:first-of-type:hover:after { + border-right-color: #eb4802; +} +.module-item .module-edit .edit-wrap > div:last-of-type:after { + content: ""; + position: absolute; + top: 0; + border: solid rgba(0, 0, 0, 0); + border-left: solid #fd560f; + border-width: 24px 0 0 10px; + left: 100%; +} +.module-item .module-edit .edit-wrap > div:last-of-type:hover:after { + border-left-color: #eb4802; +} +.module-item .module-edit .edit-wrap > div:hover { + background-color: #eb4802; +} diff --git a/public/build/beike/shop/default/css/design/app.css b/public/build/beike/shop/default/css/design/app.css index d1b40b1f..757f4ca8 100644 --- a/public/build/beike/shop/default/css/design/app.css +++ b/public/build/beike/shop/default/css/design/app.css @@ -1,7 +1,23 @@ +@charset "UTF-8"; +@font-face { + font-family: "iconfont"; + src: url("/vendor/iconfont/iconfont.woff") format("woff"), url("/vendor/iconfont/iconfont.ttf") format("truetype"); + /* chrome、firefox、opera、Safari, Android, iOS 4.2+*/ +} +.iconfont { + font-family: "iconfont"; + font-size: 1rem; + font-style: normal; + -webkit-font-smoothing: antialiased; + -webkit-text-stroke-width: 0.2px; + -moz-osx-font-smoothing: grayscale; +} + body.page-design { background-color: #fff; padding: 0; margin: 0; + font-size: 14px; height: 100vh; overflow: hidden; } @@ -9,9 +25,64 @@ body.page-design .design-box { display: flex; height: 100vh; } +body.page-design .design-box .design-head { + display: flex; + align-items: center; + justify-content: space-between; +} +body.page-design .design-box .design-head > div { + flex: 1; + height: 40px; + color: #fff; + cursor: pointer; + display: flex; + align-items: center; + justify-content: center; + background-color: #0072ff; + text-align: center; + font-size: 0.8rem; + transition: all 0.2s ease-in-out; +} +body.page-design .design-box .design-head > div:hover { + background-color: #005bcc; +} body.page-design .design-box .sidebar-edit-wrap { width: 300px; + background-color: #fff; +} +body.page-design .design-box .sidebar-edit-wrap .module-edit { + padding: 0 10px 14px; +} +body.page-design .design-box .sidebar-edit-wrap .module-edit .module-editor-row { + height: 47px; + line-height: 47px; background-color: #f5f5f5; + padding: 0 20px; + margin: 0 -14px 14px; + font-size: 16px; + color: #212121; +} +body.page-design .design-box .sidebar-edit-wrap .module-edit .module-edit-group { + margin-bottom: 20px; +} +body.page-design .design-box .sidebar-edit-wrap .module-edit .module-edit-group:last-of-type { + border-bottom: none; +} +body.page-design .design-box .sidebar-edit-wrap .module-edit .module-edit-group .module-edit-title { + margin-bottom: 10px; + position: relative; + padding-left: 6px; + display: flex; + justify-content: space-between; +} +body.page-design .design-box .sidebar-edit-wrap .module-edit .module-edit-group .module-edit-title:before { + content: ""; + position: absolute; + left: 0; + top: 3px; + width: 2px; + height: 14px; + background: #0072ff; } body.page-design .design-box .sidebar-edit-wrap .modules-list { background: #e6e9ec; @@ -34,7 +105,7 @@ body.page-design .design-box .sidebar-edit-wrap .module-list .module-info:hover box-shadow: 0 6px 23px rgba(0, 0, 0, 0.2); } body.page-design .design-box .sidebar-edit-wrap .module-list .icon { - padding: 7px 0; + padding: 12px 0 7px; width: 36px; height: 36px; display: inline-block; @@ -54,3 +125,96 @@ body.page-design .design-box .sidebar-edit-wrap .module-list .name { body.page-design .design-box .preview-iframe { flex: 1; } +body.page-design .pb-images-selector { + border: 1px solid #eee; + margin-bottom: 10px; + border-radius: 2px; +} +body.page-design .pb-images-selector:hover { + border-color: #ddd; +} +body.page-design .pb-images-selector:hover .selector-head { + background: #eee; +} +body.page-design .pb-images-selector .pb-images-selector-add { + width: 100%; + margin-top: 16px; + padding: 10px 20px; +} +body.page-design .pb-images-selector .selector-head { + display: flex; + align-items: center; + background-color: #f5f5f5; + padding: 4px 10px; + cursor: pointer; + justify-content: space-between; +} +body.page-design .pb-images-selector .selector-head > div.left { + display: flex; + align-items: center; +} +body.page-design .pb-images-selector .selector-head > div.left i { + margin-right: 10px; +} +body.page-design .pb-images-selector .selector-head > div.left img { + width: 24px; +} +body.page-design .pb-images-selector .selector-head > div.right { + display: flex; + align-items: center; +} +body.page-design .pb-images-selector .selector-head > div.right i { + color: #999; + font-size: 20px; +} +body.page-design .pb-images-selector .selector-head > div.right .remove-item { + margin-right: 8px; + padding-right: 8px; + position: relative; +} +body.page-design .pb-images-selector .selector-head > div.right .remove-item:after { + content: ""; + border-right: 1px solid #ccc; + position: absolute; + right: 1px; + top: 20%; + height: 60%; +} +body.page-design .pb-images-selector .selector-head > div.right .remove-item i { + font-size: 15px; +} +body.page-design .pb-images-selector .pb-images-list { + padding: 7px; + padding-bottom: 8px; + position: relative; + display: none; +} +body.page-design .pb-images-selector .pb-images-list.active { + display: block; +} +body.page-design .pb-images-selector .pb-images-list .remove-item { + margin-top: 20px; + background: #ffc8c8; + color: #c70000; + z-index: 9; + height: 20px; + line-height: 20px; + padding: 5px 10px; + text-align: center; + cursor: pointer; +} +body.page-design .pb-images-selector .pb-images-list .remove-item i { + font-size: 14px; +} +body.page-design .pb-images-selector .pb-images-list .pb-image-selector { + cursor: pointer; + min-width: 50px; + min-height: 50px; +} +body.page-design .pb-images-selector .pb-images-list .pb-images-btns button { + margin-left: 0 !important; + padding: 9px 10px; +} +body.page-design .pb-images-selector .pb-images-list .el-input-group__prepend { + padding: 0 10px; +} diff --git a/public/vendor/vue/Sortable.min.js b/public/vendor/vue/Sortable.min.js new file mode 100644 index 00000000..938811fc --- /dev/null +++ b/public/vendor/vue/Sortable.min.js @@ -0,0 +1,2 @@ +/*! Sortable 1.7.0 - MIT | git://github.com/rubaxa/Sortable.git */ +!function(a){"use strict";"function"==typeof define&&define.amd?define(a):"undefined"!=typeof module&&"undefined"!=typeof module.exports?module.exports=a():window.Sortable=a()}(function(){"use strict";function a(b,c){if(!b||!b.nodeType||1!==b.nodeType)throw"Sortable: `el` must be HTMLElement, and not "+{}.toString.call(b);this.el=b,this.options=c=t({},c),b[V]=this;var d={group:Math.random(),sort:!0,disabled:!1,store:null,handle:null,scroll:!0,scrollSensitivity:30,scrollSpeed:10,draggable:/[uo]l/i.test(b.nodeName)?"li":">*",ghostClass:"sortable-ghost",chosenClass:"sortable-chosen",dragClass:"sortable-drag",ignore:"a, img",filter:null,preventOnFilter:!0,animation:0,setData:function(a,b){a.setData("Text",b.textContent)},dropBubble:!1,dragoverBubble:!1,dataIdAttr:"data-id",delay:0,forceFallback:!1,fallbackClass:"sortable-fallback",fallbackOnBody:!1,fallbackTolerance:0,fallbackOffset:{x:0,y:0},supportPointer:a.supportPointer!==!1};for(var e in d)!(e in c)&&(c[e]=d[e]);ka(c);for(var g in this)"_"===g.charAt(0)&&"function"==typeof this[g]&&(this[g]=this[g].bind(this));this.nativeDraggable=!c.forceFallback&&ca,f(b,"mousedown",this._onTapStart),f(b,"touchstart",this._onTapStart),c.supportPointer&&f(b,"pointerdown",this._onTapStart),this.nativeDraggable&&(f(b,"dragover",this),f(b,"dragenter",this)),ia.push(this._onDragOver),c.store&&this.sort(c.store.get(this))}function b(a,b){"clone"!==a.lastPullMode&&(b=!0),B&&B.state!==b&&(i(B,"display",b?"none":""),b||B.state&&(a.options.group.revertClone?(C.insertBefore(B,D),a._animate(y,B)):C.insertBefore(B,y)),B.state=b)}function c(a,b,c){if(a){c=c||X;do if(">*"===b&&a.parentNode===c||r(a,b))return a;while(a=d(a))}return null}function d(a){var b=a.host;return b&&b.nodeType?b:a.parentNode}function e(a){a.dataTransfer&&(a.dataTransfer.dropEffect="move"),a.preventDefault()}function f(a,b,c){a.addEventListener(b,c,aa)}function g(a,b,c){a.removeEventListener(b,c,aa)}function h(a,b,c){if(a)if(a.classList)a.classList[c?"add":"remove"](b);else{var d=(" "+a.className+" ").replace(T," ").replace(" "+b+" "," ");a.className=(d+(c?" "+b:"")).replace(T," ")}}function i(a,b,c){var d=a&&a.style;if(d){if(void 0===c)return X.defaultView&&X.defaultView.getComputedStyle?c=X.defaultView.getComputedStyle(a,""):a.currentStyle&&(c=a.currentStyle),void 0===b?c:c[b];b in d||(b="-webkit-"+b),d[b]=c+("string"==typeof c?"":"px")}}function j(a,b,c){if(a){var d=a.getElementsByTagName(b),e=0,f=d.length;if(c)for(;e5||b.clientX-(d.left+d.width)>5}function p(a){for(var b=a.tagName+a.className+a.src+a.href+a.textContent,c=b.length,d=0;c--;)d+=b.charCodeAt(c);return d.toString(36)}function q(a,b){var c=0;if(!a||!a.parentNode)return-1;for(;a&&(a=a.previousElementSibling);)"TEMPLATE"===a.nodeName.toUpperCase()||">*"!==b&&!r(a,b)||c++;return c}function r(a,b){if(a){b=b.split(".");var c=b.shift().toUpperCase(),d=new RegExp("\\s("+b.join("|")+")(?=\\s)","g");return!(""!==c&&a.nodeName.toUpperCase()!=c||b.length&&((" "+a.className+" ").match(d)||[]).length!=b.length)}return!1}function s(a,b){var c,d;return function(){void 0===c&&(c=arguments,d=this,Z(function(){1===c.length?a.call(d,c[0]):a.apply(d,c),c=void 0},b))}}function t(a,b){if(a&&b)for(var c in b)b.hasOwnProperty(c)&&(a[c]=b[c]);return a}function u(a){return _&&_.dom?_.dom(a).cloneNode(!0):$?$(a).clone(!0)[0]:a.cloneNode(!0)}function v(a){for(var b=a.getElementsByTagName("input"),c=b.length;c--;){var d=b[c];d.checked&&ha.push(d)}}function w(a){return Z(a,0)}function x(a){return clearTimeout(a)}if("undefined"==typeof window||!window.document)return function(){throw new Error("Sortable.js requires a window with a document")};var y,z,A,B,C,D,E,F,G,H,I,J,K,L,M,N,O,P,Q,R,S={},T=/\s+/g,U=/left|right|inline/,V="Sortable"+(new Date).getTime(),W=window,X=W.document,Y=W.parseInt,Z=W.setTimeout,$=W.jQuery||W.Zepto,_=W.Polymer,aa=!1,ba=!1,ca="draggable"in X.createElement("div"),da=function(a){return!navigator.userAgent.match(/(?:Trident.*rv[ :]?11\.|msie)/i)&&(a=X.createElement("x"),a.style.cssText="pointer-events:auto","auto"===a.style.pointerEvents)}(),ea=!1,fa=Math.abs,ga=Math.min,ha=[],ia=[],ja=s(function(a,b,c){if(c&&b.scroll){var d,e,f,g,h,i,j=c[V],k=b.scrollSensitivity,l=b.scrollSpeed,m=a.clientX,n=a.clientY,o=window.innerWidth,p=window.innerHeight;if(G!==c&&(F=b.scroll,G=c,H=b.scrollFn,F===!0)){F=c;do if(F.offsetWidth-1:e==a)}}var c={},d=a.group;d&&"object"==typeof d||(d={name:d}),c.name=d.name,c.checkPull=b(d.pull,!0),c.checkPut=b(d.put),c.revertClone=d.revertClone,a.group=c};try{window.addEventListener("test",null,Object.defineProperty({},"passive",{get:function(){ba=!1,aa={capture:!1,passive:ba}}}))}catch(a){}return a.prototype={constructor:a,_onTapStart:function(a){var b,d=this,e=this.el,f=this.options,g=f.preventOnFilter,h=a.type,i=a.touches&&a.touches[0],j=(i||a).target,l=a.target.shadowRoot&&a.path&&a.path[0]||j,m=f.filter;if(v(e),!y&&!(/mousedown|pointerdown/.test(h)&&0!==a.button||f.disabled)&&!l.isContentEditable&&(j=c(j,f.draggable,e),j&&E!==j)){if(b=q(j,f.draggable),"function"==typeof m){if(m.call(this,a,j,this))return k(d,l,"filter",j,e,e,b),void(g&&a.preventDefault())}else if(m&&(m=m.split(",").some(function(a){if(a=c(l,a.trim(),e))return k(d,a,"filter",j,e,e,b),!0})))return void(g&&a.preventDefault());f.handle&&!c(l,f.handle,e)||this._prepareDragStart(a,i,j,b)}},_prepareDragStart:function(a,b,c,d){var e,g=this,i=g.el,l=g.options,n=i.ownerDocument;c&&!y&&c.parentNode===i&&(P=a,C=i,y=c,z=y.parentNode,D=y.nextSibling,E=c,N=l.group,L=d,this._lastX=(b||a).clientX,this._lastY=(b||a).clientY,y.style["will-change"]="all",e=function(){g._disableDelayedDrag(),y.draggable=g.nativeDraggable,h(y,l.chosenClass,!0),g._triggerDragStart(a,b),k(g,C,"choose",y,C,C,L)},l.ignore.split(",").forEach(function(a){j(y,a.trim(),m)}),f(n,"mouseup",g._onDrop),f(n,"touchend",g._onDrop),f(n,"touchcancel",g._onDrop),f(n,"selectstart",g),l.supportPointer&&f(n,"pointercancel",g._onDrop),l.delay?(f(n,"mouseup",g._disableDelayedDrag),f(n,"touchend",g._disableDelayedDrag),f(n,"touchcancel",g._disableDelayedDrag),f(n,"mousemove",g._disableDelayedDrag),f(n,"touchmove",g._disableDelayedDrag),l.supportPointer&&f(n,"pointermove",g._disableDelayedDrag),g._dragStartTimer=Z(e,l.delay)):e())},_disableDelayedDrag:function(){var a=this.el.ownerDocument;clearTimeout(this._dragStartTimer),g(a,"mouseup",this._disableDelayedDrag),g(a,"touchend",this._disableDelayedDrag),g(a,"touchcancel",this._disableDelayedDrag),g(a,"mousemove",this._disableDelayedDrag),g(a,"touchmove",this._disableDelayedDrag),g(a,"pointermove",this._disableDelayedDrag)},_triggerDragStart:function(a,b){b=b||("touch"==a.pointerType?a:null),b?(P={target:y,clientX:b.clientX,clientY:b.clientY},this._onDragStart(P,"touch")):this.nativeDraggable?(f(y,"dragend",this),f(C,"dragstart",this._onDragStart)):this._onDragStart(P,!0);try{X.selection?w(function(){X.selection.empty()}):window.getSelection().removeAllRanges()}catch(a){}},_dragStarted:function(){if(C&&y){var b=this.options;h(y,b.ghostClass,!0),h(y,b.dragClass,!1),a.active=this,k(this,C,"start",y,C,C,L)}else this._nulling()},_emulateDragOver:function(){if(Q){if(this._lastX===Q.clientX&&this._lastY===Q.clientY)return;this._lastX=Q.clientX,this._lastY=Q.clientY,da||i(A,"display","none");var a=X.elementFromPoint(Q.clientX,Q.clientY),b=a,c=ia.length;if(a&&a.shadowRoot&&(a=a.shadowRoot.elementFromPoint(Q.clientX,Q.clientY),b=a),b)do{if(b[V]){for(;c--;)ia[c]({clientX:Q.clientX,clientY:Q.clientY,target:a,rootEl:b});break}a=b}while(b=b.parentNode);da||i(A,"display","")}},_onTouchMove:function(b){if(P){var c=this.options,d=c.fallbackTolerance,e=c.fallbackOffset,f=b.touches?b.touches[0]:b,g=f.clientX-P.clientX+e.x,h=f.clientY-P.clientY+e.y,j=b.touches?"translate3d("+g+"px,"+h+"px,0)":"translate("+g+"px,"+h+"px)";if(!a.active){if(d&&ga(fa(f.clientX-this._lastX),fa(f.clientY-this._lastY))y.offsetWidth,x=e.offsetHeight>y.offsetHeight,E=(v?(d.clientX-g.left)/t:(d.clientY-g.top)/u)>.5,F=e.nextElementSibling,G=!1;if(v){var H=y.offsetTop,L=e.offsetTop;G=H===L?e.previousElementSibling===y&&!w||E&&w:e.previousElementSibling===y||y.previousElementSibling===e?(d.clientY-g.top)/u>.5:L>H}else r||(G=F!==y&&!x||E&&x);var M=l(C,j,y,f,e,g,d,G);M!==!1&&(1!==M&&M!==-1||(G=1===M),ea=!0,Z(n,30),b(p,q),y.contains(j)||(G&&!F?j.appendChild(y):e.parentNode.insertBefore(y,G?F:e)),z=y.parentNode,this._animate(f,y),this._animate(g,e))}}},_animate:function(a,b){var c=this.options.animation;if(c){var d=b.getBoundingClientRect();1===a.nodeType&&(a=a.getBoundingClientRect()),i(b,"transition","none"),i(b,"transform","translate3d("+(a.left-d.left)+"px,"+(a.top-d.top)+"px,0)"),b.offsetWidth,i(b,"transition","all "+c+"ms"),i(b,"transform","translate3d(0,0,0)"),clearTimeout(b.animated),b.animated=Z(function(){i(b,"transition",""),i(b,"transform",""),b.animated=!1},c)}},_offUpEvents:function(){var a=this.el.ownerDocument;g(X,"touchmove",this._onTouchMove),g(X,"pointermove",this._onTouchMove),g(a,"mouseup",this._onDrop),g(a,"touchend",this._onDrop),g(a,"pointerup",this._onDrop),g(a,"touchcancel",this._onDrop),g(a,"pointercancel",this._onDrop),g(a,"selectstart",this)},_onDrop:function(b){var c=this.el,d=this.options;clearInterval(this._loopId),clearInterval(S.pid),clearTimeout(this._dragStartTimer),x(this._cloneId),x(this._dragStartId),g(X,"mouseover",this),g(X,"mousemove",this._onTouchMove),this.nativeDraggable&&(g(X,"drop",this),g(c,"dragstart",this._onDragStart)),this._offUpEvents(),b&&(R&&(b.preventDefault(),!d.dropBubble&&b.stopPropagation()),A&&A.parentNode&&A.parentNode.removeChild(A),C!==z&&"clone"===a.active.lastPullMode||B&&B.parentNode&&B.parentNode.removeChild(B),y&&(this.nativeDraggable&&g(y,"dragend",this),m(y),y.style["will-change"]="",h(y,this.options.ghostClass,!1),h(y,this.options.chosenClass,!1),k(this,C,"unchoose",y,z,C,L),C!==z?(M=q(y,d.draggable),M>=0&&(k(null,z,"add",y,z,C,L,M),k(this,C,"remove",y,z,C,L,M),k(null,z,"sort",y,z,C,L,M),k(this,C,"sort",y,z,C,L,M))):y.nextSibling!==D&&(M=q(y,d.draggable),M>=0&&(k(this,C,"update",y,z,C,L,M),k(this,C,"sort",y,z,C,L,M))),a.active&&(null!=M&&M!==-1||(M=L),k(this,C,"end",y,z,C,L,M),this.save()))),this._nulling()},_nulling:function(){C=y=z=A=D=B=E=F=G=P=Q=R=M=I=J=O=N=a.active=null,ha.forEach(function(a){a.checked=!0}),ha.length=0},handleEvent:function(a){switch(a.type){case"drop":case"dragend":this._onDrop(a);break;case"dragover":case"dragenter":y&&(this._onDragOver(a),e(a));break;case"mouseover":this._onDrop(a);break;case"selectstart":a.preventDefault()}},toArray:function(){for(var a,b=[],d=this.el.children,e=0,f=d.length,g=this.options;e numberIndexes - 1 ? numberIndexes : indexes[domIndex]; + }, + getComponent: function getComponent() { + return this.$slots.default[0].componentInstance; + }, + resetTransitionData: function resetTransitionData(index) { + if (!this.noTransitionOnDrag || !this.transitionMode) { + return; + } + var nodes = this.getChildrenNodes(); + nodes[index].data = null; + var transitionContainer = this.getComponent(); + transitionContainer.children = []; + transitionContainer.kept = undefined; + }, + onDragStart: function onDragStart(evt) { + this.context = this.getUnderlyingVm(evt.item); + evt.item._underlying_vm_ = this.clone(this.context.element); + draggingElement = evt.item; + }, + onDragAdd: function onDragAdd(evt) { + var element = evt.item._underlying_vm_; + if (element === undefined) { + return; + } + removeNode(evt.item); + var newIndex = this.getVmIndex(evt.newIndex); + this.spliceList(newIndex, 0, element); + this.computeIndexes(); + var added = { element: element, newIndex: newIndex }; + this.emitChanges({ added: added }); + }, + onDragRemove: function onDragRemove(evt) { + insertNodeAt(this.rootContainer, evt.item, evt.oldIndex); + if (this.isCloning) { + removeNode(evt.clone); + return; + } + var oldIndex = this.context.index; + this.spliceList(oldIndex, 1); + var removed = { element: this.context.element, oldIndex: oldIndex }; + this.resetTransitionData(oldIndex); + this.emitChanges({ removed: removed }); + }, + onDragUpdate: function onDragUpdate(evt) { + removeNode(evt.item); + insertNodeAt(evt.from, evt.item, evt.oldIndex); + var oldIndex = this.context.index; + var newIndex = this.getVmIndex(evt.newIndex); + this.updatePosition(oldIndex, newIndex); + var moved = { element: this.context.element, oldIndex: oldIndex, newIndex: newIndex }; + this.emitChanges({ moved: moved }); + }, + computeFutureIndex: function computeFutureIndex(relatedContext, evt) { + if (!relatedContext.element) { + return 0; + } + var domChildren = [].concat(_toConsumableArray(evt.to.children)).filter(function (el) { + return el.style['display'] !== 'none'; + }); + var currentDOMIndex = domChildren.indexOf(evt.related); + var currentIndex = relatedContext.component.getVmIndex(currentDOMIndex); + var draggedInList = domChildren.indexOf(draggingElement) != -1; + return draggedInList || !evt.willInsertAfter ? currentIndex : currentIndex + 1; + }, + onDragMove: function onDragMove(evt, originalEvent) { + var onMove = this.move; + if (!onMove || !this.realList) { + return true; + } + + var relatedContext = this.getRelatedContextFromMoveEvent(evt); + var draggedContext = this.context; + var futureIndex = this.computeFutureIndex(relatedContext, evt); + _extends(draggedContext, { futureIndex: futureIndex }); + _extends(evt, { relatedContext: relatedContext, draggedContext: draggedContext }); + return onMove(evt, originalEvent); + }, + onDragEnd: function onDragEnd(evt) { + this.computeIndexes(); + draggingElement = null; + } + } + }; + return draggableComponent; + } + + if (typeof exports == "object") { + var Sortable = require("sortablejs"); + module.exports = buildDraggable(Sortable); + } else if (typeof define == "function" && define.amd) { + define(['sortablejs'], function (Sortable) { + return buildDraggable(Sortable); + }); + } else if (window && window.Vue && window.Sortable) { + var draggable = buildDraggable(window.Sortable); + Vue.component('draggable', draggable); + } +})(); \ No newline at end of file diff --git a/resources/beike/shop/default/css/app.scss b/resources/beike/shop/default/css/app.scss index 56e25a29..7a862250 100644 --- a/resources/beike/shop/default/css/app.scss +++ b/resources/beike/shop/default/css/app.scss @@ -20,3 +20,4 @@ $primary: #fd560f; @import './order-success'; @import './page-account-order'; @import './page-account-address'; +@import './home'; diff --git a/resources/beike/shop/default/css/design/app.scss b/resources/beike/shop/default/css/design/app.scss index 6804e957..5ea210ea 100644 --- a/resources/beike/shop/default/css/design/app.scss +++ b/resources/beike/shop/default/css/design/app.scss @@ -1,7 +1,12 @@ +@import '../iconfont'; + +$main_color: #0072ff; + body.page-design { background-color: #fff; padding: 0; margin: 0; + font-size: 14px; height: 100vh; overflow: hidden; @@ -9,10 +14,78 @@ body.page-design { display: flex; height: 100vh; + .design-head { + display: flex; + align-items: center; // flex-start | center + justify-content: space-between; // flex-end | center | space-between + // flex-wrap: wrap; + > div { + flex: 1; + height: 40px; + color: #fff; + cursor: pointer; + display: flex; + align-items: center; + justify-content: center; + background-color: $main_color; + text-align: center; + font-size: .8rem; + transition: all .2s ease-in-out; + + &:hover { + background-color: darken($main_color, 10%); + } + } + } + .sidebar-edit-wrap { // flex: 1; width: 300px; - background-color: #f5f5f5; + background-color: #fff; + + .module-edit { + padding: 0 10px 14px; + + .module-editor-row { + height: 47px; + line-height: 47px; + background-color: #f5f5f5; + padding: 0 20px; + margin: 0 -14px 14px; + font-size: 16px; + color: #212121; + } + + .module-edit-group { + margin-bottom: 20px; + + &:last-of-type { + border-bottom: none; + } + + .module-edit-title { + margin-bottom: 10px; + position: relative; + padding-left: 6px; + display: flex; + justify-content: space-between; + + &:before { + content: ''; + position: absolute; + left: 0; + top: 3px; + width: 2px; + height: 14px; + background: #0072ff; + } + } + + .module-edit-sub-title { + + } + } + } .modules-list { background: #e6e9ec; @@ -38,7 +111,7 @@ body.page-design { } .icon { - padding: 7px 0; + padding: 12px 0 7px; width: 36px; height: 36px; display: inline-block; @@ -64,4 +137,121 @@ body.page-design { flex: 1; } } + + + .pb-images-selector { + border: 1px solid #eee; + margin-bottom: 10px; + border-radius: 2px; + // overflow: hidden; + &:hover { + border-color: #ddd; + + .selector-head { + background: #eee; + } + } + + .pb-images-selector-add { + width: 100%; + margin-top: 16px; + padding: 10px 20px; + } + + .selector-head { + display: flex; + align-items: center; + background-color: #f5f5f5; + padding: 4px 10px; + cursor: pointer; + justify-content: space-between; + + > div.left { + display: flex; + align-items: center; + + i { + margin-right: 10px; + } + + img { + width: 24px; + } + } + + > div.right { + display: flex; + align-items: center; + + i { + color: #999; + font-size: 20px; + } + + .remove-item { + margin-right: 8px; + padding-right: 8px; + position: relative; + + &:after { + content: ''; + border-right: 1px solid #ccc; + position: absolute; + right: 1px; + top: 20%; + height: 60%; + } + + i { + font-size: 15px; + } + } + } + } + + .pb-images-list { + padding: 7px; + padding-bottom: 8px; + position: relative; + display: none; + + &.active { + display: block; + } + + .pb-image-selector { + } + + .remove-item { + margin-top: 20px; + background: #ffc8c8; + color: #c70000; + z-index: 9; + height: 20px; + line-height: 20px; + padding: 5px 10px; + text-align: center; + cursor: pointer; + + i { + font-size: 14px; + } + } + + .pb-image-selector { + cursor: pointer; + min-width: 50px; + min-height: 50px; + // background: #f5f5f5; + } + + .pb-images-btns button { + margin-left: 0 !important; + padding: 9px 10px; + } + .el-input-group__prepend { + padding: 0 10px; + } + } + } } \ No newline at end of file diff --git a/resources/beike/shop/default/css/home.scss b/resources/beike/shop/default/css/home.scss new file mode 100644 index 00000000..14a030bd --- /dev/null +++ b/resources/beike/shop/default/css/home.scss @@ -0,0 +1,94 @@ +@charset "UTF-8"; + +.module-item { + position: relative; + + &:hover { + .module-edit { + display: flex; + } + + &:after { + display: block; + } + } + + &:after { + content: ''; + display: none; + position: absolute; + left: 2px; + right: 2px; + top: 2px; + bottom: 2px; + outline: 2px solid $primary; + } + + + .module-edit { + // position: relative; + position: absolute; + top: -22px; + left: 0; + width: 100%; + z-index: 9; + // display: flex; + align-items: center; // flex-start | center + justify-content: center; // flex-end | center | space-between + display: none; + + .edit-wrap { + background-color: $primary; + color: #fff; + display: flex; + align-items: center; + + > div { + height: 24px; + line-height: 24px; + padding: 0 10px; + cursor: pointer; + position: relative; + + &:first-of-type { + &:after { + content: ""; + position: absolute; + top: 0; + border: solid #0000; + border-right: solid $primary; + border-width: 24px 10px 0 0; + right: 100%; + } + &:hover { + &:after { + border-right-color: darken($primary, 6%); + } + } + } + + &:last-of-type { + &:after { + content: ""; + position: absolute; + top: 0; + border: solid #0000; + border-left: solid $primary; + border-width: 24px 0 0 10px; + left: 100%; + } + &:hover { + &:after { + border-left-color: darken($primary, 6%); + } + } + } + + &:hover { + background-color: darken($primary, 6%); + } + } + // flex-wrap: wrap; + } + } +} \ No newline at end of file diff --git a/themes/default/design/builder/component/link_selector.blade.php b/themes/default/design/builder/component/link_selector.blade.php new file mode 100644 index 00000000..e69de29b diff --git a/themes/default/design/builder/index.blade.php b/themes/default/design/builder/index.blade.php index 1426dbe7..ec9d9815 100644 --- a/themes/default/design/builder/index.blade.php +++ b/themes/default/design/builder/index.blade.php @@ -12,6 +12,8 @@ + + @@ -21,6 +23,10 @@