1234567891011121314151617181920212223242526272829303132333435363738 |
- <view class="i-index i-class">
- <scroll-view
- scroll-y
- style="{{parse.setScrollStyle(height)}}"
- bindscroll="handlerScroll"
- scroll-top="{{scrollTop}}">
- <slot></slot>
- <view class="i-index-fixed"
- catchtouchstart="handlerTouchMove"
- catchtouchmove="handlerTouchMove"
- catchtouchend="handlerTouchEnd">
- <view class="i-index-fixed-item"
- wx:for="{{fixedData}}"
- wx:key="{{index}}"
- data-index="{{index}}"
- catchtap="handlerFixedTap">
- {{item}}
- </view>
- </view>
- <view class="i-index-tooltip" style="{{ isTouches ? 'display:block' : 'display:none' }}">{{currentName}}</view>
- </scroll-view>
- </view>
- <wxs module="parse">
- module.exports = {
- setScrollStyle : function(height){
- var units = ['%','px','rem','rpx','em','rem'];
- var hasUnits = false;
- for( var i = 0; i < units.length;i++ ){
- var u = units[i];
- if( height.indexOf( u ) > -1 ){
- hasUnits = true;
- break;
- }
- }
- return 'height:'+ ( hasUnits ? height : height+'px' );
- }
- }
- </wxs>
|