Files
2026-04-05 10:48:38 +08:00

11 lines
9.5 KiB
JavaScript
Executable File

(global["webpackJsonp"]=global["webpackJsonp"]||[]).push([["components/diy-components/diy-rubik-cube"],{"48bf":function(t,i,r){"use strict";r.d(i,"b",(function(){return o})),r.d(i,"c",(function(){return u})),r.d(i,"a",(function(){return e}));var e={nsMpHtml:function(){return r.e("components/ns-mp-html/ns-mp-html").then(r.bind(null,"d108"))}},o=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}})},u=[]},"62de":function(t,i,r){},"8c09":function(t,i,r){"use strict";r.r(i);var e=r("48bf"),o=r("e496");for(var u in o)["default"].indexOf(u)<0&&function(t){r.d(i,t,(function(){return o[t]}))}(u);r("dc9c");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},cb02:function(t,i,r){"use strict";(function(t){var e=r("47a9");Object.defineProperty(i,"__esModule",{value:!0}),i.default=void 0;e(r("0817"));var o={name:"diy-rubik-cube",props:{value:{type:Object,default:function(){return{}}}},data:function(){return{customHtml:""}},created:function(){this.init()},watch:{componentRefresh:function(t){this.init()}},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:{calcWidth:function(t){return-1!=t.indexOf("px")?t.substring(0,t.indexOf("px")):t},init:function(){if("custom-rubik-cube"==this.value.mode)this.value.diyHtml=this.value.diyHtml.replace(/&quot;/g,'"'),this.customHtml=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()}this.$forceUpdate()},calcSingleRow:function(i){var r=this;t.getSystemInfo({success:function(e){var o=0;r.list.forEach((function(u,a){var d=u.imgHeight/r.calcWidth(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=-1!=u.imgWidth.indexOf("calc")?(r.windowWidth-24)*(parseInt("100%")-parseInt(t.upx2px(2*i.value.imageGap)+"px"))/2/100:u.imgWidth,l=u.imgHeight/d;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*l,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){var o=0;i.list.forEach((function(u,a){if(0==a){var d=u.imgHeight/i.calcWidth(u.imgWidth);u.imgWidth=e.windowWidth-t.upx2px(4*i.value.margin.both)-t.upx2px(2*i.value.imageGap),u.imgWidth=u.imgWidth/2,o=u.imgWidth,u.imgHeight=u.imgWidth*d,r=(u.imgHeight-t.upx2px(2*i.value.imageGap))/2,u.imgWidth+="px"}else u.imgWidth=o+"px",u.imgHeight=r}))}})},calcRowOneTopOfTwoBottom:function(){var i=this,r=0;t.getSystemInfo({success:function(e){i.list.forEach((function(o,u){var a=o.imgHeight/i.calcWidth(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){var e=0,o=0,u=0;i.list.forEach((function(a,d){if(0==d){var l=a.imgHeight/i.calcWidth(a.imgWidth);a.imgWidth=r.windowWidth-t.upx2px(4*i.value.margin.both)-t.upx2px(2*i.value.imageGap),a.imgWidth=a.imgWidth/2,e=a.imgWidth,a.imgHeight=a.imgWidth*l,o=a.imgHeight}else 1==d?(a.imgWidth=e,a.imgHeight=(o-t.upx2px(2*i.value.imageGap))/2,u=a.imgHeight):d>1&&(a.imgWidth=(e-t.upx2px(2*i.value.imageGap))/2,a.imgHeight=u)})),i.list.forEach((function(t,i){t.imgWidth+="px"}))}})},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=o}).call(this,r("df3c")["default"])},dc9c:function(t,i,r){"use strict";var e=r("62de"),o=r.n(e);o.a},e496:function(t,i,r){"use strict";r.r(i);var e=r("cb02"),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}}]);
;(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__("8c09"))
})
},
[['components/diy-components/diy-rubik-cube-create-component']]
]);