在做这个的时候,在论坛找了两个相关的的例子,体验不很好,所有就直接写了一个demo
提升体验的第一步就是要用scroll-view 标签 把他们包裹起来不让他们可以滚动,当你在右侧上下摩擦的时候,发现左侧在滚动,是多么的不开心
还有一定使用左右结构,不能直接把字母定位在页面右侧
还有一个最重要的也就是困扰楼主一会儿,就是一定要给 scroll-view 设置高,或许聪明的你们 不会像楼主一样 傻不拉几的找不到为什么设置了 scroll-into-view 的值却不滚动。

好了直接上代码
-
<scroll-view class="flex-wrap">
-
-
<scroll-view class="flex-left" scroll-y="true" scroll-into-view="{{scrollIntoId}}">
-
-
<view wx:for="{{groups}}" wx:key="zimu" wx:for-item="zimu">
-
-
<view class="item item-a" id="{{zimu.groupName}}">{{zimu.groupName}}</view>
-
-
<view class="item" wx:for="{{zimu.users}}" wx:key="user" wx:for-item="user">{{user.name}}</view>
-
-
</view>
-
-
<navigator url="../project/projectlist" open-type="switchTab">go</navigator>
-
-
</scroll-view>
-
-
<view class="flex-right">
-
-
<view class="zimulist" bindtouchmove="touchmovefn" bindtouchstart="touchstartfn">
-
-
<view class="zimu" wx:for="{{zimu}}" wx:key="ABC" data-id="{{item}}">{{item}}</view>
-
-
</view>
-
-
</view>
-
-
</scroll-view>
-
page{
-
-
height: 100%;
-
-
}
-
-
.zimu{
-
-
width: 50rpx;
-
-
height: 20px;
-
-
line-height: 20px;
-
-
}
-
-
.zimulist{
-
-
position: fixed;
-
-
top: 0;
-
-
right: 0;
-
-
bottom:0;
-
-
width: 50rpx;
-
-
z-index: 999999999999;
-
-
background-color: #fff;
-
-
text-align: center;
-
-
}
-
-
.item{
-
-
height: 88rpx;
-
-
line-height: 88rpx;
-
-
border-bottom: solid 1rpx #f0f1f2;
|