网友真实露脸自拍10p,成人国产精品秘?久久久按摩,国产精品久久久久久无码不卡,成人免费区一区二区三区

小程序模板網(wǎng)

微信小程序錨點定位樓層跳躍

發(fā)布時間:2018-04-18 10:57 所屬欄目:小程序開發(fā)教程

微信小程序?qū)崿F(xiàn)樓層錨點跳躍,點擊不同的錨點進行位置跳躍: 
利用:scroll-into-view 來實現(xiàn)

效果圖如下:

 

WXML:

 

				
  1. [html] view plain copy print?在CODE上查看代碼片派生到我的代碼片
  2. <scroll-view class="content" scroll-into-view="{{toView}}" scroll-y="true" scroll-with-animation="true">
  3. <view wx:for="{{act_addList}}">
  4. <view class="address_top" id="{{ 'inToView'+item.id}}">{{item.region}}</view>
  5. <view wx:for="{{item.city}}">
  6. <view class="address_bottom">{{item.name}}</view>
  7. </view>
  8. </view>
  9. </scroll-view>
  10.  
  11. <view class="orientation_region">
  12. <view class="orientation">自動定位</view>
  13. <block wx:for="{{orientationList}}" >
  14. <view class="orientation_city" bindtap="scrollToViewFn" data-id="{{item.id}}">{{item.region}}</view>
  15. </block>
  16. </view>
 

WXSS:

 

				
  1. [css] view plain copy print?在CODE上查看代碼片派生到我的代碼片
  2. page{ height: 100%;}
  3. .content{padding-bottom: 20rpx; box-sizing: border-box; height: 100%;}
  4. .location{width: 100%;}
  5. .location_top{height: 76rpx;line-height: 76rpx; background: #f4f4f4;color: #606660;font-size: 28rpx;padding: 0 20rpx;}
  6. .location_bottom{height: 140rpx;line-height: 140rpx;color: #d91f16;font-size: 28rpx;border-top: 2rpx #ebebeb solid; border-bottom: 2rpx #ebebeb solid;padding: 0 20rpx; align-items: center;display: -webkit-flex;}
  7. .address_top{height: 76rpx;line-height: 76rpx; background: #f4f4f4;color: #999999;font-size: 28rpx;padding: 0 20rpx;}
  8. .address_bottom{height: 88rpx;line-height: 88rpx; background: #fff;color: #000000;font-size: 32rpx;padding: 0 20rpx; border-bottom: 2rpx #ebebeb solid;margin-left: 20rpx;margin-right: 50rpx; }
  9. .location_img{width: 48rpx;height: 48rpx;position: absolute;right: 20rpx;top: 125rpx;}
  10. .add_city{width: 228rpx;height: 60rpx;line-height: 60rpx; text-align: center; border: 2rpx solid #ebebeb; color: #000000;margin-right: 20rpx; }
  11. .add_citying{width: 228rpx;height: 60rpx;line-height: 60rpx; text-align: center; border: 2rpx solid #09bb07; color: #09bb07;margin-right: 20rpx;}
  12. .orientation{white-space:normal;display: inline-block; width: 55rpx;height:58rpx; color: #999; text-align: center;}
  13. .orientation_region{ width: 55rpx;font-size: 20rpx;position: fixed;top: 220rpx; right: 0rpx;}
  14. .orientation_city{height: 50rpx; line-height: 50rpx;color: #000;text-align: center;}
 

JS:

 

				
  1. [javascript] view plain copy print?在CODE上查看代碼片派生到我的代碼片
  2. Page({
  3.  
  4. /**
  5. * 頁面的初始數(shù)據(jù)
  6. */
  7. data: {
  8. orientationList: [
  9. { id: "01", region: "東北" },
  10. { id: "02", region: "華北" },
  11. { id: "03", region: "華東" },
  12. { id: "04", region: "華南" },
  13. { id: "05", region: "華中" },
  14. { id: "06", region: "西北" },
  15. { id: "07", region: "西南" }
  16. ],
  17. act_addList: [
  18. {
  19. id: "01", region: "東北地區(qū)",
  20. city: [{ id: "0101", name: "白山江源" },
  21. { id: "0102", name: "白山市" },
  22. { id: "0103", name: "賓縣" },
  23. { id: "0104", name: "大慶" },
  24. { id: "0105", name: "測試1" },
  25. { id: "0106", name: "測試2" },
  26. { id: "0107", name: "測試3" },
  27. { id: "0108", name: "測試4" },
  28. { id: "0109", name: "測試5" },
  29. {


易優(yōu)小程序(企業(yè)版)+靈活api+前后代碼開源 碼云倉庫:starfork
本文地址:http://www.xiuhaier.com/wxmini/doc/course/23680.html 復(fù)制鏈接 如需定制請聯(lián)系易優(yōu)客服咨詢:800182392 點擊咨詢
QQ在線咨詢
AI智能客服 ×