1 |
- (window["webpackJsonp"]=window["webpackJsonp"]||[]).push([["circle-page-circle-index~circle-page-home-index~circle-page-index2-index2~diy-page-index~housewifery~8b083902"],{"0807":function(t,e,n){"use strict";n.d(e,"b",(function(){return i})),n.d(e,"c",(function(){return a})),n.d(e,"a",(function(){}));var i=function(){var t=this,e=t.$createElement,n=t._self._c||e;return n("v-uni-view",{staticClass:"tn-badge-class tn-badge",class:[t.backgroundColorClass,t.fontColorClass,t.badgeClass],style:[t.badgeStyle],on:{click:function(e){arguments[0]=e=t.$handleEvent(e),t.handleClick.apply(void 0,arguments)}}},[t.dot?t._e():t._t("default")],2)},a=[]},"34e5":function(t,e,n){"use strict";n.d(e,"b",(function(){return a})),n.d(e,"c",(function(){return r})),n.d(e,"a",(function(){return i}));var i={tnBadge:n("af4b").default},a=function(){var t=this,e=t.$createElement,n=t._self._c||e;return n("v-uni-view",{staticClass:"tn-tabs-class tn-tabs",class:[t.backgroundColorClass],style:{backgroundColor:t.backgroundColorStyle,marginTop:t.$tn.string.getLengthUnitValue(t.top,"px")}},[n("v-uni-view",{attrs:{id:t.id}},[n("v-uni-scroll-view",{staticClass:"tn-tabs__scroll-view",attrs:{"scroll-x":!0,"scroll-left":t.scrollLeft,"scroll-with-animation":!0}},[n("v-uni-view",{staticClass:"tn-tabs__scroll-view__box",class:{"tn-tabs__scroll-view--flex":!t.isScroll}},[t._l(t.list,(function(e,i){return n("v-uni-view",{key:i,staticClass:"tn-tabs__scroll-view__item tn-text-ellipsis",style:[t.tabItemStyle(i)],attrs:{id:"tn-tabs__scroll-view__item-"+i},on:{click:function(n){arguments[0]=n=t.$handleEvent(n),t.clickTab(i,e)}}},[e[t.count]||e["count"]?n("tn-badge",{attrs:{backgroundColor:"tn-bg-red",fontColor:"#FFFFFF",absolute:!0,top:t.badgeOffset[0]||0,right:t.badgeOffset[1]||0}},[t._v(t._s(e[t.count]||e["count"]))]):t._e(),t._v(t._s(e[t.name]||e["name"])),t.diyIfBar&&i==t.current?n("v-uni-view",{staticClass:"bottom-aft",style:[t.bardiyStyle]}):t._e()],1)})),t.showBar?n("v-uni-view",{staticClass:"tn-tabs__bar",style:[t.tabBarStyle]}):t._e()],2)],1)],1)],1)},r=[]},"37fc":function(t,e,n){"use strict";n.r(e);var i=n("34e5"),a=n("c6a7");for(var r in a)["default"].indexOf(r)<0&&function(t){n.d(e,t,(function(){return a[t]}))}(r);n("5fde");var o=n("828b"),s=Object(o["a"])(a["default"],i["b"],i["c"],!1,null,"4705433d",null,!1,i["a"],void 0);e["default"]=s.exports},5253:function(t,e,n){var i=n("7018");i.__esModule&&(i=i.default),"string"===typeof i&&(i=[[t.i,i,""]]),i.locals&&(t.exports=i.locals);var a=n("967d").default;a("69e65a42",i,!0,{sourceMap:!1,shadowMode:!1})},5328:function(t,e,n){"use strict";n("6a54");var i=n("f5bd").default;Object.defineProperty(e,"__esModule",{value:!0}),e.default=void 0,n("64aa");var a=i(n("74ff")),r={mixins:[a.default],name:"tn-badge",props:{index:{type:[Number,String],default:"0"},radius:{type:Number,default:0},padding:{type:String,default:""},margin:{type:String,default:""},dot:{type:Boolean,default:!1},absolute:{type:Boolean,default:!1},top:{type:[String,Number],default:""},right:{type:[String,Number],default:""},translateCenter:{type:Boolean,default:!0}},computed:{badgeClass:function(){var t="";return this.dot&&(t+=" tn-badge--dot"),this.absolute&&(t+=" tn-badge--absolute",this.translateCenter&&(t+=" tn-badge--center-position")),t},badgeStyle:function(){var t={};return 0!==this.radius&&(t.width=this.radius+"rpx",t.height=this.radius+"rpx",t.lineHeight=this.radius+"rpx"),this.padding&&(t.padding=this.padding),this.margin&&(t.margin=this.margin),this.fontColorStyle&&(t.color=this.fontColorStyle),this.fontSize&&(t.fontSize=this.fontSize+this.fontUnit),this.backgroundColorStyle&&(t.backgroundColor=this.backgroundColorStyle),this.top&&(t.top=this.$tn.string.getLengthUnitValue(this.top)),this.right&&(t.right=this.$tn.string.getLengthUnitValue(this.right)),t}},data:function(){return{}},methods:{handleClick:function(){this.$emit("click",{index:Number(this.index)}),this.$emit("tap",{index:Number(this.index)})}}};e.default=r},5852:function(t,e,n){"use strict";var i=n("703c"),a=n.n(i);a.a},"5fde":function(t,e,n){"use strict";var i=n("5253"),a=n.n(i);a.a},"6b78":function(t,e,n){var i=n("c86c");e=i(!1),e.push([t.i,'@charset "UTF-8";\n/**\n * 下方引入的为Tuniao UI的集成样式文件,为scss预处理器,其中包含了一些"tn-"开头的自定义变量\n * 使用的时候,请将下面的一行复制到您的uniapp项目根目录的uni.scss中即可\n * Tuniao UI自定义的css类名和scss变量,均以"tn-"开头,不会造成冲突,请放心使用 \n */.tn-badge[data-v-24d7672c]{width:auto;height:auto;box-sizing:border-box;display:flex;align-items:center;justify-content:center;z-index:10;font-size:%?20?%;background-color:#fff;border-radius:%?100?%;padding:%?4?% %?8?%;line-height:normal}.tn-badge--dot[data-v-24d7672c]{width:%?8?%;height:%?8?%;border-radius:50%;padding:0}.tn-badge--absolute[data-v-24d7672c]{position:absolute;top:0;right:0}.tn-badge--center-position[data-v-24d7672c]{-webkit-transform:translate(50%,-50%);transform:translate(50%,-50%)}',""]),t.exports=e},7018:function(t,e,n){var i=n("c86c");e=i(!1),e.push([t.i,'@charset "UTF-8";\n/**\n * 下方引入的为Tuniao UI的集成样式文件,为scss预处理器,其中包含了一些"tn-"开头的自定义变量\n * 使用的时候,请将下面的一行复制到您的uniapp项目根目录的uni.scss中即可\n * Tuniao UI自定义的css类名和scss变量,均以"tn-"开头,不会造成冲突,请放心使用 \n */[data-v-4705433d]::-webkit-scrollbar{display:none;width:0!important;height:0!important;-webkit-appearance:none;background:transparent}uni-scroll-view[data-v-4705433d] ::-webkit-scrollbar{display:none;width:0!important;height:0!important;-webkit-appearance:none;background:transparent}.tn-tabs__scroll-view[data-v-4705433d]{position:relative;width:100%;white-space:nowrap}.tn-tabs__scroll-view__box[data-v-4705433d]{position:relative}.tn-tabs__scroll-view__item[data-v-4705433d]{position:relative;display:inline-block;text-align:center;transition-property:background-color,color}.tn-tabs__scroll-view__item .bottom-aft[data-v-4705433d]{position:absolute;left:50%;bottom:0;margin-top:%?15?%;width:20%;height:%?8?%;background-color:#000;-webkit-transform:translate(-50%);transform:translate(-50%)}.tn-tabs__scroll-view--flex[data-v-4705433d]{display:flex;flex-direction:row;justify-content:space-between}.tn-tabs__bar[data-v-4705433d]{position:absolute;bottom:0}',""]),t.exports=e},"703c":function(t,e,n){var i=n("6b78");i.__esModule&&(i=i.default),"string"===typeof i&&(i=[[t.i,i,""]]),i.locals&&(t.exports=i.locals);var a=n("967d").default;a("7f7eeb16",i,!0,{sourceMap:!1,shadowMode:!1})},af4b:function(t,e,n){"use strict";n.r(e);var i=n("0807"),a=n("b718");for(var r in a)["default"].indexOf(r)<0&&function(t){n.d(e,t,(function(){return a[t]}))}(r);n("5852");var o=n("828b"),s=Object(o["a"])(a["default"],i["b"],i["c"],!1,null,"24d7672c",null,!1,i["a"],void 0);e["default"]=s.exports},b718:function(t,e,n){"use strict";n.r(e);var i=n("5328"),a=n.n(i);for(var r in i)["default"].indexOf(r)<0&&function(t){n.d(e,t,(function(){return i[t]}))}(r);e["default"]=a.a},c5b3:function(t,e,n){"use strict";n("6a54");var i=n("f5bd").default;Object.defineProperty(e,"__esModule",{value:!0}),e.default=void 0;var a=i(n("2634")),r=i(n("2fdc"));n("64aa"),n("5c47");var o=i(n("74ff")),s={mixins:[o.default],name:"tn-tabs",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"},duration:{type:Number,default:.3},activeColor:{type:String,default:"#01BEFF"},inactiveColor:{type:String,default:"#080808"},activeItemStyle:{type:Object,default:function(){return{}}},inactiveItemStyle:{type:Object,default:function(){return{}}},showBar:{type:Boolean,default:!0},diyIfBar:{type:Boolean,default:!1},barWidth:{type:Number,default:40},barHeight:{type:Number,default:6},barBgColor:{type:String,default:"#000"},barStyle:{type:Object,default:function(){return{}}},bardiyStyle:{type:Object,default:function(){return{}}},gutter:{type:Number,default:30},badgeOffset:{type:Array,default:function(){return[20,22]}},bold:{type:Boolean,default:!1}},data:function(){return{id:this.$tn.uuid(),scrollLeft:0,tabQueryInfo:[],componentWidth:0,scrollBarLeft:0,componentLeft:0,currentIndex:this.current,barMoveFirst:!0,isInitialized:!1}},computed:{tabBarStyle:function(){var t={width:this.$tn.string.getLengthUnitValue(this.barWidth),height:this.$tn.string.getLengthUnitValue(this.barHeight),borderRadius:"".concat(this.barHeight/2,"rpx"),backgroundColor:this.activeColor,opacity:this.barMoveFirst?0:1,transform:"translate(".concat(this.scrollBarLeft,"px, -100%)"),transitionDuration:this.barMoveFirst?"0s":"".concat(this.duration,"s")};return Object.assign(t,this.barStyle),t},tabItemStyle:function(){var t=this;return function(e){var n={width:t.$tn.string.getLengthUnitValue(t.itemWidth),height:t.$tn.string.getLengthUnitValue(t.height),lineHeight:t.$tn.string.getLengthUnitValue(t.height),fontSize:t.fontSizeStyle||"28rpx",padding:t.isScroll?"0 ".concat(t.gutter,"rpx"):"",flex:t.isScroll?"auto":"1",transitionDuration:"".concat(t.duration,"s")};return e===t.current?(t.bold&&(n.fontWeight="bold"),n.color=t.activeColor,Object.assign(n,t.activeItemStyle)):(n.color=t.inactiveColor,Object.assign(n,t.inactiveItemStyle)),n}}},watch:{list:function(t,e){var n=this;this.isInitialized?(t.length!==e.length&&(this.currentIndex=0),this.$nextTick((function(){n.init()}))):this.isInitialized=!0},current:{handler:function(t){var e=this;this.currentIndex=t,this.$nextTick((function(){e.scrollByIndex()}))},immediate:!0},scrollBarLeft:{handler:function(t){console.log("val",t)},immediate:!0}},mounted:function(){this.init()},methods:{init:function(){var t=this;return(0,r.default)((0,a.default)().mark((function e(){var n;return(0,a.default)().wrap((function(e){while(1)switch(e.prev=e.next){case 0:return e.next=2,t._tGetRect("#"+t.id);case 2:n=e.sent,t.componentLeft=n.left,t.componentWidth=n.width,t.getTabRect();case 6:case"end":return e.stop()}}),e)})))()},clickTab:function(t,e){t===this.currentIndex&&"更多订单"!=e.name||(this.currentIndex=t,this.$emit("change",t))},getTabRect:function(){for(var t=this,e=uni.createSelectorQuery().in(this),n=0;n<this.list.length;n++)e.select("#tn-tabs__scroll-view__item-".concat(n)).fields({size:!0,rect:!0});e.exec((function(e){t.tabQueryInfo=e,t.scrollByIndex()}))},scrollByIndex:function(){var t=this,e=this.tabQueryInfo[this.currentIndex];if(e){var n=e.width,i=e.left-this.componentLeft,a=i-(this.componentWidth-n)/2;this.scrollLeft=a<0?0:a;var r=e.left+e.width/2-this.componentLeft;this.scrollBarLeft=r-uni.upx2px(this.barWidth)/2,this.barMoveFirst&&setTimeout((function(){t.barMoveFirst=!1}),100)}}}};e.default=s},c6a7:function(t,e,n){"use strict";n.r(e);var i=n("c5b3"),a=n.n(i);for(var r in i)["default"].indexOf(r)<0&&function(t){n.d(e,t,(function(){return i[t]}))}(r);e["default"]=a.a}}]);
|