Files
2025-12-27 09:01:32 +08:00

11 lines
9.1 KiB
JavaScript

(global["webpackJsonp"]=global["webpackJsonp"]||[]).push([["components/diy-components/diy-rubik-cube"],{"0e15":function(t,i,r){"use strict";r.r(i);var e=r("700d"),o=r("6ca0");for(var u in o)["default"].indexOf(u)<0&&function(t){r.d(i,t,(function(){return o[t]}))}(u);r("7bb6");var a=r("828b"),d=Object(a["a"])(o["default"],e["b"],e["c"],!1,null,null,null,!1,e["a"],void 0);i["default"]=d.exports},"6ca0":function(t,i,r){"use strict";r.r(i);var e=r("7d7f"),o=r.n(e);for(var u in e)["default"].indexOf(u)<0&&function(t){r.d(i,t,(function(){return e[t]}))}(u);i["default"]=o.a},"700d":function(t,i,r){"use strict";r.d(i,"b",(function(){return e})),r.d(i,"c",(function(){return o})),r.d(i,"a",(function(){}));var e=function(){var t=this,i=t.$createElement,r=(t._self._c,"custom-rubik-cube"!=t.value.mode&&"row1-lt-of2-rt"==t.value.mode?t.$util.img(t.value.list[0].imageUrl):null),e="custom-rubik-cube"!=t.value.mode&&"row1-lt-of2-rt"==t.value.mode?t.__map(t.list,(function(i,r){var e=t.__get_orig(i),o=r>0?t.$util.img(i.imageUrl):null;return{$orig:e,g1:o}})):null,o="custom-rubik-cube"!=t.value.mode&&"row1-lt-of2-rt"!=t.value.mode&&"row1-lt-of1-tp-of2-bm"==t.value.mode?t.$util.img(t.value.list[0].imageUrl):null,u="custom-rubik-cube"!=t.value.mode&&"row1-lt-of2-rt"!=t.value.mode&&"row1-lt-of1-tp-of2-bm"==t.value.mode?t.$util.img(t.value.list[1].imageUrl):null,a="custom-rubik-cube"!=t.value.mode&&"row1-lt-of2-rt"!=t.value.mode&&"row1-lt-of1-tp-of2-bm"==t.value.mode?t.__map(t.list,(function(i,r){var e=t.__get_orig(i),o=r>1?t.$util.img(i.imageUrl):null;return{$orig:e,g4:o}})):null,d="custom-rubik-cube"!=t.value.mode&&"row1-lt-of2-rt"!=t.value.mode&&"row1-lt-of1-tp-of2-bm"!=t.value.mode?t.__map(t.list,(function(i,r){var e=t.__get_orig(i),o=t.$util.img(i.imageUrl);return{$orig:e,g5:o}})):null;t._isMounted||(t.e0=function(i){return t.$util.diyRedirectTo(t.value.list[0].link)},t.e1=function(i,r){var e=arguments[arguments.length-1].currentTarget.dataset,o=e.eventParams||e["event-params"];r=o.item;return t.$util.diyRedirectTo(r.link)},t.e2=function(i){return t.$util.diyRedirectTo(t.value.list[0].link)},t.e3=function(i){return t.$util.diyRedirectTo(t.value.list[1].link)},t.e4=function(i,r){var e=arguments[arguments.length-1].currentTarget.dataset,o=e.eventParams||e["event-params"];r=o.item;return t.$util.diyRedirectTo(r.link)},t.e5=function(i,r){var e=arguments[arguments.length-1].currentTarget.dataset,o=e.eventParams||e["event-params"];r=o.item;return t.$util.diyRedirectTo(r.link)}),t.$mp.data=Object.assign({},{$root:{g0:r,l0:e,g2:o,g3:u,l1:a,l2:d}})},o=[]},"7bb6":function(t,i,r){"use strict";var e=r("ba9a"),o=r.n(e);o.a},"7d7f":function(t,i,r){"use strict";(function(t){var e=r("47a9");Object.defineProperty(i,"__esModule",{value:!0}),i.default=void 0;var o=e(r("e5ac")),u={name:"diy-rubik-cube",props:{value:{type:Object,default:function(){return{}}}},data:function(){return{customHtml:""}},created:function(){if("custom-rubik-cube"==this.value.mode)this.value.diyHtml=this.value.diyHtml.replace(/&quot;/g,'"'),this.customHtml=(0,o.default)(this.value.diyHtml);else{var i={"row1-of2":{ratio:2,width:"calc((100% - "+t.upx2px(2*this.value.imageGap)+"px) / 2)"},"row1-of3":{ratio:3,width:"calc((100% - "+t.upx2px(4*this.value.imageGap)+"px) / 3)"},"row1-of4":{ratio:4,width:"calc((100% - "+t.upx2px(6*this.value.imageGap)+"px) / 4)"}};i[this.value.mode]?this.calcSingleRow(i[this.value.mode]):"row2-lt-of2-rt"==this.value.mode?this.calcFourSquare():"row1-lt-of2-rt"==this.value.mode?this.calcRowOneLeftOfTwoRight():"row1-tp-of2-bm"==this.value.mode?this.calcRowOneTopOfTwoBottom():"row1-lt-of1-tp-of2-bm"==this.value.mode&&this.calcRowOneLeftOfOneTopOfTwoBottom()}},watch:{componentRefresh:function(t){}},computed:{list:function(){var t=this,i=JSON.parse(JSON.stringify(this.value.list));return i.forEach((function(i,r){i.pageItemStyle=t.countBorderRadius(t.value.mode,r)})),i},rubikCubeWrapCss:function(){var t="";return t+="background-color:"+this.value.componentBgColor+";","round"==this.value.componentAngle&&(t+="border-top-left-radius:"+2*this.value.topAroundRadius+"rpx;",t+="border-top-right-radius:"+2*this.value.topAroundRadius+"rpx;",t+="border-bottom-left-radius:"+2*this.value.bottomAroundRadius+"rpx;",t+="border-bottom-right-radius:"+2*this.value.bottomAroundRadius+"rpx;"),t}},methods:{calcSingleRow:function(i){var r=this;t.getSystemInfo({success:function(e){var o=0;r.list.forEach((function(u,a){var d=u.imgHeight/u.imgWidth,l=e.windowWidth-t.upx2px(2*r.value.margin.both);r.value.imageGap>0&&(l-=t.upx2px(i.ratio*r.value.imageGap*2)),u.imgWidth=l/i.ratio,u.imgHeight=u.imgWidth*d,(0==o||o<u.imgHeight)&&(o=u.imgHeight)})),r.list.forEach((function(t,r){t.widthStyle=i.width,t.imgHeight=o}))}})},calcFourSquare:function(){var i=this;t.getSystemInfo({success:function(r){var e=0,o=0;i.list.forEach((function(u,a){var d=u.imgHeight/u.imgWidth;u.imgWidth=r.windowWidth,u.imgWidth-=t.upx2px(4*i.value.margin.both),i.value.imageGap>0&&(u.imgWidth-=t.upx2px(2*i.value.imageGap)),u.imgWidth=u.imgWidth/2,u.imgHeight=u.imgWidth*d,a<=1?(0==e||e<u.imgHeight)&&(e=u.imgHeight):a>1&&(0==o||o<u.imgHeight)&&(o=u.imgHeight)})),i.list.forEach((function(r,u){r.imgWidth="calc((100% - "+t.upx2px(2*i.value.imageGap)+"px) / 2)",r.widthStyle=r.imgWidth,u<=1?r.imgHeight=e:u>1&&(r.imgHeight=o)}))}})},calcRowOneLeftOfTwoRight:function(){var i=this,r=0;this.list[1].imgWidth,this.list[2].imgWidth,t.getSystemInfo({success:function(e){i.list.forEach((function(o,u){if(0==u){var a=o.imgHeight/o.imgWidth;o.imgWidth=e.windowWidth-t.upx2px(4*i.value.margin.both)-t.upx2px(2*i.value.imageGap),o.imgWidth=o.imgWidth/2,o.imgHeight=o.imgWidth*a,r=(o.imgHeight-t.upx2px(2*i.value.imageGap))/2,o.imgWidth+="px"}else o.imgWidth=i.list[0].imgWidth,o.imgHeight=r}))}})},calcRowOneTopOfTwoBottom:function(){var i=this,r=0;t.getSystemInfo({success:function(e){i.list.forEach((function(o,u){var a=o.imgHeight/o.imgWidth;0==u?o.imgWidth=e.windowWidth-t.upx2px(4*i.value.margin.both):u>0&&(o.imgWidth=e.windowWidth-t.upx2px(4*i.value.margin.both)-t.upx2px(2*i.value.imageGap),o.imgWidth=o.imgWidth/2),o.imgHeight=o.imgWidth*a,u>0&&(0==r||r<o.imgHeight)&&(r=o.imgHeight)})),i.list.forEach((function(t,i){t.imgWidth+="px",t.widthStyle=t.imgWidth,i>0&&(t.imgHeight=r)}))}})},calcRowOneLeftOfOneTopOfTwoBottom:function(){var i=this;t.getSystemInfo({success:function(r){i.list.forEach((function(e,o){if(0==o){var u=e.imgHeight/e.imgWidth;e.imgWidth=r.windowWidth-t.upx2px(4*i.value.margin.both)-t.upx2px(2*i.value.imageGap),e.imgWidth=e.imgWidth/2,e.imgHeight=e.imgWidth*u}else 1==o?(e.imgWidth=i.list[0].imgWidth,e.imgHeight=(i.list[0].imgHeight-t.upx2px(2*i.value.imageGap))/2):o>1&&(e.imgWidth=(i.list[0].imgWidth-t.upx2px(2*i.value.imageGap))/2,e.imgHeight=i.list[1].imgHeight)})),i.list.forEach((function(t,i){t.imgWidth+="px",t.imgHeight}))}})},countBorderRadius:function(t,i){var r=this,e="";if("right"==this.value.elementAngle)return e;return{"row1-lt-of2-rt":[["border-top-right-radius","border-bottom-right-radius"],["border-top-left-radius","border-bottom-left-radius","border-bottom-right-radius"],["border-top-left-radius","border-bottom-left-radius","border-top-right-radius"]],"row1-lt-of1-tp-of2-bm":[["border-top-right-radius","border-bottom-right-radius"],["border-top-left-radius","border-bottom-left-radius","border-bottom-right-radius"],["border-radius"],["border-top-left-radius","border-bottom-left-radius","border-top-right-radius"]],"row1-tp-of2-bm":[["border-bottom-left-radius","border-bottom-right-radius"],["border-top-left-radius","border-bottom-right-radius","border-top-right-radius"],["border-top-left-radius","border-bottom-left-radius","border-top-right-radius"]],"row2-lt-of2-rt":[["border-top-right-radius","border-bottom-left-radius","border-bottom-right-radius"],["border-top-left-radius","border-bottom-right-radius","border-bottom-left-radius"],["border-top-left-radius","border-bottom-right-radius","border-top-right-radius"],["border-top-left-radius","border-bottom-left-radius","border-top-right-radius"]],"row1-of4":[["border-top-right-radius","border-bottom-right-radius"],["border-radius"],["border-radius"],["border-top-left-radius","border-bottom-left-radius"]],"row1-of3":[["border-top-right-radius","border-bottom-right-radius"],["border-radius"],["border-top-left-radius","border-bottom-left-radius"]],"row1-of2":[["border-top-right-radius","border-bottom-right-radius"],["border-top-left-radius","border-bottom-left-radius"]]}[t][i].forEach((function(t,i){e+="border-top-left-radius:"+2*r.value.topElementAroundRadius+"rpx;",e+="border-top-right-radius:"+2*r.value.topElementAroundRadius+"rpx;",e+="border-bottom-left-radius:"+2*r.value.bottomElementAroundRadius+"rpx;",e+="border-bottom-right-radius:"+2*r.value.bottomElementAroundRadius+"rpx;"})),e}}};i.default=u}).call(this,r("df3c")["default"])},ba9a:function(t,i,r){}}]);
;(global["webpackJsonp"] = global["webpackJsonp"] || []).push([
'components/diy-components/diy-rubik-cube-create-component',
{
'components/diy-components/diy-rubik-cube-create-component':(function(module, exports, __webpack_require__){
__webpack_require__('df3c')['createComponent'](__webpack_require__("0e15"))
})
},
[['components/diy-components/diy-rubik-cube-create-component']]
]);