12345678910 |
- (global["webpackJsonp"]=global["webpackJsonp"]||[]).push([["components/maramlee-waterfalls-flow/maramlee-waterfalls-flow"],{"10eb":function(t,e,r){"use strict";var o=r("5aa5"),n=r.n(o);n.a},"4e58":function(t,e,r){"use strict";r.d(e,"b",(function(){return o})),r.d(e,"c",(function(){return n})),r.d(e,"a",(function(){}));var o=function(){var t=this.$createElement;this._self._c},n=[]},"5aa5":function(t,e,r){},"7c97":function(t,e,r){"use strict";r.r(e);var o=r("4e58"),n=r("cd0d");for(var i in n)["default"].indexOf(i)<0&&function(t){r.d(e,t,(function(){return n[t]}))}(i);r("10eb");var a=r("f0c5"),u=Object(a["a"])(n["default"],o["b"],o["c"],!1,null,"199d02a8",null,!1,o["a"],void 0);e["default"]=u.exports},cd0d:function(t,e,r){"use strict";r.r(e);var o=r("ff7d"),n=r.n(o);for(var i in o)["default"].indexOf(i)<0&&function(t){r.d(e,t,(function(){return o[t]}))}(i);e["default"]=n.a},ff7d:function(t,e,r){"use strict";(function(t){var o=r("4ea4");Object.defineProperty(e,"__esModule",{value:!0}),e.default=void 0;var n=o(r("448a")),i=o(r("9523")),a=(o(r("8396")),r("f8b7")),u=r("26cb");function s(t,e){var r=Object.keys(t);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(t);e&&(o=o.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),r.push.apply(r,o)}return r}function c(t){for(var e=1;e<arguments.length;e++){var r=null!=arguments[e]?arguments[e]:{};e%2?s(Object(r),!0).forEach((function(e){(0,i.default)(t,e,r[e])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(r)):s(Object(r)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(r,e))}))}return t}var f={props:{list:{type:Array,required:!0},offset:{type:Number,default:10},idKey:{type:String,default:"id"},imageSrcKey:{type:String,default:"image"},cols:{type:Number,default:2,validator:function(t){return t>=2}},imageStyle:{type:Object},single:{type:Boolean,default:!1}},data:function(){return{topArr:[],allPositionArr:[],allHeightArr:[],height:0,oldNum:0,num:0,updateCount:0,product_video_status:!1}},watch:{list:{handler:function(e,r){var o=this;e.length&&this.$nextTick((function(){o.updateCount++,o.product_video_status&&t.getNetworkType({success:function(e){if(["wifi","unknown"].includes(e.networkType)&&o.observeVideo(),["2g","3g","4g","5g"].includes(e.networkType)){if(!o.$store.state.app.autoplay){if(1!=o.updateCount)return;return t.showModal({content:"当前使用移动网络,是否继续播放视频?",success:function(t){t.confirm&&(o.SET_AUTOPLAY(!0),o.observeVideo())}})}o.observeVideo()}}})}))},immediate:!0}},created:function(){this.refresh();var e=null;try{e=JSON.parse(t.getStorageSync("product_video_status"))}catch(r){}"boolean"==typeof e?this.product_video_status=e:this.getdiyProduct()},methods:c(c({},(0,u.mapMutations)(["SET_AUTOPLAY"])),{},{observeVideo:function(){var e=this,r=t.createIntersectionObserver(this,{observeAll:!0});r.relativeToViewport().observe(".video",(function(r){r.intersectionRatio?setTimeout((function(){t.createVideoContext(r.id,e).play()}),200):setTimeout((function(){t.createVideoContext(r.id,e).pause()}),200)})),this.$once("hook:beforeDestroy",(function(){r.disconnect()}))},getdiyProduct:function(){var e=this;(0,a.diyProduct)().then((function(r){t.setStorageSync("product_video_status",JSON.stringify(r.data.product_video_status)),e.product_video_status=r.data.product_video_status}))},imageLoadHandle:function(e){var r=this;if(this.list.length){var o="waterfalls-list-id-"+this.list[e][this.idKey],i=t.createSelectorQuery().in(this);i.select("#"+o).fields({size:!0},(function(t){if(r.num++,r.$set(r.allHeightArr,e,t.height),r.num===r.list.length){for(var o=r.oldNum;o<r.num;o++){var i=function(){var t=(0,n.default)(r.topArr).sort((function(t,e){return t-e}));return{shorterIndex:r.topArr.indexOf(t[0]),shorterValue:t[0],longerIndex:r.topArr.indexOf(t[r.cols-1]),longerValue:t[r.cols-1]}},a=i(),u=a.shorterIndex,s=a.shorterValue,c={top:s+"px",left:(t.width+r.offset)*u+"px"};r.$set(r.allPositionArr,o,c),r.topArr[u]=s+r.allHeightArr[o]+r.offset,r.height=i().longerValue-r.offset}r.oldNum=r.num,r.$emit("image-load")}})).exec()}},refresh:function(){for(var t=[],e=0;e<this.cols;e++)t.push(0);this.topArr=t,this.num=0,this.oldNum=0,this.height=0}})};e.default=f}).call(this,r("543d")["default"])}}]);
- ;(global["webpackJsonp"] = global["webpackJsonp"] || []).push([
- 'components/maramlee-waterfalls-flow/maramlee-waterfalls-flow-create-component',
- {
- 'components/maramlee-waterfalls-flow/maramlee-waterfalls-flow-create-component':(function(module, exports, __webpack_require__){
- __webpack_require__('543d')['createComponent'](__webpack_require__("7c97"))
- })
- },
- [['components/maramlee-waterfalls-flow/maramlee-waterfalls-flow-create-component']]
- ]);
|