(global["webpackJsonp"]=global["webpackJsonp"]||[]).push([["tuniao-ui/components/tn-tabs-swiper/tn-tabs-swiper"],{276:function(t,e,n){"use strict";n.r(e);var i=n(277),r=n(279);for(var o in r)["default"].indexOf(o)<0&&function(t){n.d(e,t,(function(){return r[t]}))}(o);n(281);var a,s=n(36),u=Object(s["default"])(r["default"],i["render"],i["staticRenderFns"],!1,null,"1b37d63c",null,!1,i["components"],a);u.options.__file="tuniao-ui/components/tn-tabs-swiper/tn-tabs-swiper.vue",e["default"]=u.exports},277:function(t,e,n){"use strict";n.r(e);var i=n(278);n.d(e,"render",(function(){return i["render"]})),n.d(e,"staticRenderFns",(function(){return i["staticRenderFns"]})),n.d(e,"recyclableRender",(function(){return i["recyclableRender"]})),n.d(e,"components",(function(){return i["components"]}))},278:function(t,e,n){"use strict";var i;n.r(e),n.d(e,"render",(function(){return r})),n.d(e,"staticRenderFns",(function(){return a})),n.d(e,"recyclableRender",(function(){return o})),n.d(e,"components",(function(){return i}));try{i={tnBadge:function(){return Promise.all([n.e("common/vendor"),n.e("tuniao-ui/components/tn-badge/tn-badge")]).then(n.bind(null,452))}}}catch(s){if(-1===s.message.indexOf("Cannot find module")||-1===s.message.indexOf(".vue"))throw s;console.error(s.message),console.error("1. 排查组件名称拼写是否正确"),console.error("2. 排查组件是否符合 easycom 规范,文档:https://uniapp.dcloud.net.cn/collocation/pages?id=easycom"),console.error("3. 若组件不符合 easycom 规范,需手动引入,并在 components 中注册该组件")}var r=function(){var t=this,e=t.$createElement,n=(t._self._c,t.$t.string.getLengthUnitValue(t.top,"px")),i=t.__map(t.list,(function(e,n){var i=t.__get_orig(e),r=t.__get_style([t.tabItemStyle(n)]);return{$orig:i,s0:r}})),r=t.showBar?t.__get_style([t.tabBarStyle]):null;t.$mp.data=Object.assign({},{$root:{g0:n,l0:i,s1:r}})},o=!1,a=[];r._withStripped=!0},279:function(t,e,n){"use strict";n.r(e);var i=n(280),r=n.n(i);for(var o in i)["default"].indexOf(o)<0&&function(t){n.d(e,t,(function(){return i[t]}))}(o);e["default"]=r.a},280:function(t,e,n){"use strict";(function(t){var i=n(4);Object.defineProperty(e,"__esModule",{value:!0}),e.default=void 0;var r=i(n(58)),o=i(n(60)),a=i(n(209)),s=t.getSystemInfoSync(),u=s.windowWidth,c={mixins:[a.default],name:"tn-tabs-swiper",props:{list:{type:Array,default:function(){return[]}},name:{type:String,default:"name"},count:{type:String,default:"count"},current:{type:Number,default:0},isScroll:{type:Boolean,default:!0},height:{type:Number,default:80},top:{type:Number,default:0},itemWidth:{type:[String,Number],default:"auto"},swiperWidth:{type:Number,default:750},activeColor:{type:String,default:"#01BEFF"},inactiveColor:{type:String,default:"#080808"},activeItemStyle:{type:Object,default:function(){return{}}},showBar:{type:Boolean,default:!0},barWidth:{type:Number,default:40},barHeight:{type:Number,default:6},barStyle:{type:Object,default:function(){return{}}},gutter:{type:Number,default:30},badgeOffset:{type:Array,default:function(){return[20,22]}},bold:{type:Boolean,default:!1},autoCenterMode:{type:String,default:"window"},zIndex:{type:Number,default:1}},computed:{currentIndex:function(){var t=Number(this.current);return t>this.list.length-1?this.list.length-1:t<0?0:t},scrollBarLeft:function(){return Number(this.tabLineDx)+Number(this.tabLineAddDx)},barWidthPx:function(){return t.upx2px(this.barWidth)},swiperWidthPx:function(){return t.upx2px(this.swiperWidth)},tabItemStyle:function(){var t=this;return function(e){var n={height:t.$t.string.getLengthUnitValue(t.height),lineHeight:t.$t.string.getLengthUnitValue(t.height),fontSize:t.fontSizeStyle||"28rpx",color:t.tabsInfo.length>0?t.tabsInfo[e]?t.tabsInfo[e].color:t.activeColor:t.inactiveColor,padding:t.isScroll?"0 ".concat(t.gutter,"rpx"):"",flex:t.isScroll?"auto":"1",zIndex:t.zIndex+2};return e===t.currentIndex&&(t.bold&&(n.fontWeight="bold"),Object.assign(n,t.activeItemStyle)),n}},tabBarStyle:function(){var t={width:this.$t.string.getLengthUnitValue(this.barWidth),height:this.$t.string.getLengthUnitValue(this.barHeight),borderRadius:"".concat(this.barHeight/2,"rpx"),backgroundColor:this.activeColor,left:this.scrollBarLeft+"px"};return Object.assign(t,this.barStyle),t}},data:function(){return{scrollLeft:0,tabsInfo:[],windowWidth:0,animationFinishCurrent:this.current,componentsWidth:0,tabLineAddDx:0,tabLineDx:0,colorGradientArr:[],colorStep:100}},watch:{current:function(t){this.change(t),this.setFinishCurrent(t)},list:function(){var t=this;this.$nextTick((function(){t.init()}))}},mounted:function(){this.init()},methods:{init:function(){var t=this;return(0,o.default)(r.default.mark((function e(){return r.default.wrap((function(e){while(1)switch(e.prev=e.next){case 0:return e.next=2,t.getTabsInfo();case 2:t.countLine3Dx(),t.getQuery((function(){t.setScrollViewToCenter()})),t.colorGradientArr=t.$t.color.colorGradient(t.inactiveColor,t.activeColor,t.colorStep);case 5:case"end":return e.stop()}}),e)})))()},emit:function(t){this.$emit("change",t)},change:function(){this.setScrollViewToCenter()},getTabsInfo:function(){var e=this;return new Promise((function(n,i){for(var r=t.createSelectorQuery().in(e),o=0;o0?this.animationFinishCurrent+1:this.animationFinishCurrent-1;e=e<=0?0:e,e=e>=this.list.length?this.list.length-1:e;var n=this.tabsInfo[this.animationFinishCurrent],i=n.left+n.width/2,r=this.tabsInfo[e],o=r.left+r.width/2,a=Math.abs(o-i);this.tabLineAddDx=t/this.swiperWidthPx*a,this.setTabColor(this.animationFinishCurrent,e,t)},setTabColor:function(t,e,n){var i=Math.ceil(Math.abs(n/this.swiperWidthPx));Math.abs(n)>this.swiperWidthPx&&(n=n>0?n-this.swiperWidthPx*(i-1):n+this.swiperWidthPx*(i-1));var r=Math.abs(Math.ceil(n/this.swiperWidthPx*100)),o=this.colorGradientArr.length;r=r>=o?o-1:r<=0?0:r,i>1?n>0?(this.tabsInfo[e+(i-1)>this.tabsInfo.length-1?this.tabsInfo.length-1:e+(i-1)].color=this.colorGradientArr[r],this.tabsInfo[e+(i-2)>this.tabsInfo.length-1?this.tabsInfo.length-1:e+(i-2)].color=this.colorGradientArr[o-1-r]):(this.tabsInfo[e-(i-1)<0?0:e-(i-1)].color=this.colorGradientArr[r],this.tabsInfo[e-(i-2)<0?0:e-(i-2)].color=this.colorGradientArr[o-1-r]):(this.tabsInfo[e].color=this.colorGradientArr[r],this.tabsInfo[t].color=this.colorGradientArr[o-1-r])},setFinishCurrent:function(t){var e=this;this.tabsInfo.map((function(n,i){return n.color=t==i?e.activeColor:e.inactiveColor,n})),this.tabLineAddDx=0,this.animationFinishCurrent=t,this.countLine3Dx()}}};e.default=c}).call(this,n(2)["default"])},281:function(t,e,n){"use strict";n.r(e);var i=n(282),r=n.n(i);for(var o in i)["default"].indexOf(o)<0&&function(t){n.d(e,t,(function(){return i[t]}))}(o);e["default"]=r.a},282:function(t,e,n){}}]); //# sourceMappingURL=../../../../.sourcemap/mp-weixin/tuniao-ui/components/tn-tabs-swiper/tn-tabs-swiper.js.map ;(global["webpackJsonp"] = global["webpackJsonp"] || []).push([ 'tuniao-ui/components/tn-tabs-swiper/tn-tabs-swiper-create-component', { 'tuniao-ui/components/tn-tabs-swiper/tn-tabs-swiper-create-component':(function(module, exports, __webpack_require__){ __webpack_require__('2')['createComponent'](__webpack_require__(276)) }) }, [['tuniao-ui/components/tn-tabs-swiper/tn-tabs-swiper-create-component']] ]);