12345678910 |
- (global["webpackJsonp"]=global["webpackJsonp"]||[]).push([["uview-ui/components/u-subsection/u-subsection"],{"202e":function(t,e,i){},"5b50":function(t,e,i){"use strict";(function(t){Object.defineProperty(e,"__esModule",{value:!0}),e.default=void 0;var i={name:"u-subsection",props:{list:{type:Array,default:function(){return[]}},current:{type:[Number,String],default:0},activeColor:{type:String,default:"#303133"},inactiveColor:{type:String,default:"#606266"},mode:{type:String,default:"button"},fontSize:{type:[Number,String],default:28},animation:{type:Boolean,default:!0},height:{type:[Number,String],default:70},bold:{type:Boolean,default:!0},bgColor:{type:String,default:"#eeeeef"},buttonColor:{type:String,default:"#ffffff"},vibrateShort:{type:Boolean,default:!1}},data:function(){return{listInfo:[],itemBgStyle:{width:0,left:0,backgroundColor:"#ffffff",height:"100%",transition:""},currentIndex:this.current,buttonPadding:3,borderRadius:5,firstTimeVibrateShort:!0}},watch:{current:{immediate:!0,handler:function(t){this.currentIndex=t,this.changeSectionStatus(t)}}},created:function(){this.listInfo=this.list.map((function(t,e){if("object"!=typeof t){var i={width:0,name:t};return i}return t.width=0,t}))},computed:{noBorderRight:function(){var t=this;return function(e){if("subsection"==t.mode){var i="";return e<t.list.length-1&&(i+=" u-none-border-right"),0==e&&(i+=" u-item-first"),e==t.list.length-1&&(i+=" u-item-last"),i}}},textStyle:function(){var t=this;return function(e){var i={};return"subsection"==t.mode?e==t.currentIndex?i.color="#ffffff":i.color=t.activeColor:e==t.currentIndex?i.color=t.activeColor:i.color=t.inactiveColor,e==t.currentIndex&&t.bold&&(i.fontWeight="bold"),i.fontSize=t.fontSize+"rpx",i}},itemStyle:function(){var t=this;return function(e){var i={};return"subsection"==t.mode&&(i.borderColor=t.activeColor,i.borderWidth="1px",i.borderStyle="solid"),i}},subsectionStyle:function(){var e={};return e.height=t.upx2px(this.height)+"px","button"==this.mode&&(e.backgroundColor=this.bgColor,e.padding="".concat(this.buttonPadding,"px"),e.borderRadius="".concat(this.borderRadius,"px")),e},itemBarStyle:function(){var e={};return e.backgroundColor=this.activeColor,e.zIndex=1,"button"==this.mode&&(e.backgroundColor=this.buttonColor,e.borderRadius="".concat(this.borderRadius,"px"),e.bottom="".concat(this.buttonPadding,"px"),e.height=t.upx2px(this.height)-2*this.buttonPadding+"px",e.zIndex=0),Object.assign(this.itemBgStyle,e)}},mounted:function(){var t=this;setTimeout((function(){t.getTabsInfo()}),10)},methods:{changeSectionStatus:function(e){var i=this;"subsection"==this.mode&&(e==this.list.length-1&&(this.itemBgStyle.borderRadius="0 ".concat(this.buttonPadding,"px ").concat(this.buttonPadding,"px 0")),0==e&&(this.itemBgStyle.borderRadius="".concat(this.buttonPadding,"px 0 0 ").concat(this.buttonPadding,"px")),e>0&&e<this.list.length-1&&(this.itemBgStyle.borderRadius="0")),setTimeout((function(){i.itemBgLeft()}),10),this.vibrateShort&&!this.firstTimeVibrateShort&&t.vibrateShort(),this.firstTimeVibrateShort=!1},click:function(t){t!=this.currentIndex&&(this.currentIndex=t,this.changeSectionStatus(t),this.$emit("change",Number(t)))},getTabsInfo:function(){for(var e=this,i=t.createSelectorQuery().in(this),n=0;n<this.list.length;n++)i.select(".u-item-"+n).boundingClientRect();i.exec((function(t){t.length||setTimeout((function(){e.getTabsInfo()}),10),t.map((function(t,i){e.listInfo[i].width=t.width})),("subsection"==e.mode||"button"==e.mode)&&(e.itemBgStyle.width=e.listInfo[0].width+"px"),e.itemBgLeft()}))},itemBgLeft:function(){var t=this;this.animation?this.itemBgStyle.transition="all 0.35s":this.itemBgStyle.transition="all 0s";var e=0;this.listInfo.map((function(i,n){n<t.currentIndex&&(e+=i.width)})),"subsection"==this.mode?this.itemBgStyle.left=e+"px":"button"==this.mode&&(this.itemBgStyle.left=e+this.buttonPadding+"px")}}};e.default=i}).call(this,i("543d")["default"])},"69e6":function(t,e,i){"use strict";var n;i.d(e,"b",(function(){return o})),i.d(e,"c",(function(){return r})),i.d(e,"a",(function(){return n}));var o=function(){var t=this,e=t.$createElement,i=(t._self._c,t.__get_style([t.subsectionStyle])),n=t.__map(t.listInfo,(function(e,i){var n=t.__get_orig(e),o=t.__get_style([t.itemStyle(i)]),r=t.noBorderRight(i),u=t.__get_style([t.textStyle(i)]);return{$orig:n,s1:o,m0:r,s2:u}})),o=t.__get_style([t.itemBarStyle]);t.$mp.data=Object.assign({},{$root:{s0:i,l0:n,s3:o}})},r=[]},"7ead":function(t,e,i){"use strict";i.r(e);var n=i("69e6"),o=i("a541");for(var r in o)"default"!==r&&function(t){i.d(e,t,(function(){return o[t]}))}(r);i("ddcc");var u,s=i("f0c5"),a=Object(s["a"])(o["default"],n["b"],n["c"],!1,null,"c5976a02",null,!1,n["a"],u);e["default"]=a.exports},a541:function(t,e,i){"use strict";i.r(e);var n=i("5b50"),o=i.n(n);for(var r in n)"default"!==r&&function(t){i.d(e,t,(function(){return n[t]}))}(r);e["default"]=o.a},ddcc:function(t,e,i){"use strict";var n=i("202e"),o=i.n(n);o.a}}]);
- ;(global["webpackJsonp"] = global["webpackJsonp"] || []).push([
- 'uview-ui/components/u-subsection/u-subsection-create-component',
- {
- 'uview-ui/components/u-subsection/u-subsection-create-component':(function(module, exports, __webpack_require__){
- __webpack_require__('543d')['createComponent'](__webpack_require__("7ead"))
- })
- },
- [['uview-ui/components/u-subsection/u-subsection-create-component']]
- ]);
|