小程序 movable-area movable-view 在苹果系列手机上会出现横向滚动条。会超屏幕,即使把page设置了
page{
background: #F7F7F7;
overflow-x: hidden!important;
}
也没有效果。
具体参看录制的视频:https://www.bilibili.com/video/av54251261/(视频传不上来。。。)
< view class = 'u-wrp-secKill tl-margin-t20' > < movable-area style = 'width:auto;pointer-events: none;' > < movable-view animation scroll-x style = 'height:220rpx;min-width:2668rpx;margin-left: 30rpx;pointer-events: auto;' direction = 'horizontal' inertia = 'true' out-of-bounds> < block wx:for = '{{skItems}}' > < view class = 'u-img-skimgs' > < view class = "tl-w175" > < view class = "font-60-b tl-color-blue line-h-45" >< text class = "tl-color-blue font-23-b" >¥</ text > 50</ view > < view class = "tl-left" >< text class = "tl-colo-l-blue font-18-5" >(仅橱窗可用)</ text ></ view > </ view > < view class = "tl-w175-r" > < view class = "font-26-b tl-color-333" >优惠劵名字</ view > < view class = "font-16-5 tl-color-333 tl-t-b" >有效期:19/05/11-19/05/15</ view > < view class = "tl-btn-120 font-20-b tl-color-fff" >立即领取</ view > </ view > </ view > </ block > </ movable-view > </ movable-area > </ view > |
初始数据:
"skItems" : [{ "pic" : "https://file.snailpet.cn/wxApplet/home_%E5%8A%B5%E8%83%8C%E6%99%AF.png" , "pOld" : "999" , "pNew" : "666" }, { "pic" : "https://file.snailpet.cn/72/6c/726c4798188b1edb0f8acc95c942043d.png" , "pOld" : "999" , "pNew" : "666" }, { "pic" : "https://file.snailpet.cn/7c/9a/7c9a25946b5dc29e85ff23e94e5d94f9.png" , "pOld" : "999" , "pNew" : "666" }, { "pic" : "https://file.snailpet.cn/c7/04/c7047572652c846c0d3d59fca25c91be.png" , "pOld" : "999" , "pNew" : "666" }, { "pic" : "https://file.snailpet.cn/72/6c/726c4798188b1edb0f8acc95c942043d.png" , "pOld" : "999" , "pNew" : "666" }, { "pic" : "https://file.snailpet.cn/7c/9a/7c9a25946b5dc29e85ff23e94e5d94f9.png" , "pOld" : "999" , "pNew" : "666" }] |
css
/*优惠券横向滑动样式 start*/ .u-wrp-secKill { display : block ; position : relative ; width : 100 vw; height : 247 rpx; background : #fff ; } .u-wrp-secKillHead { display : block ; position : relative ; width : inherit; height : 60 rpx; border-bottom : 1px solid #f0f0f0 ; } .u-txt-skTitle { line-height : 60 rpx; font-size : 28 rpx; color : #f00 ; padding : 0 20 rpx; display : inline- block ; position : relative ; font-weight : bold ; } .u-txt-sktime { line-height : 60 rpx; font-size : 24 rpx; color : #333 ; padding : 0 20 rpx; display : inline- block ; position : relative ; font-weight : bold ; } .u-img-skimgs { position : relative ; width : 412 rpx; height : 220 rpx; display : inline- block ; background : url ( "https://file.snailpet.cn/wxApplet/home_%E5%8A%B5%E8%83%8C%E6%99%AF.png" ) no-repeat 0 41 rpx; background- size : 100% auto ; float : left ; text-align : center ; margin-left : 30 rpx; padding-top : 41 rpx; } .u-img-skimgItem { width : 412 rpx; height : 166 rpx; } .u-txt-sktxtItem 1 { display : block ; color : #f00 ; font-size : 24 rpx; } .u-txt-sktxtItem 2 { display : block ; color : #999 ; font-size : 24 rpx; text-decoration : line-through ; } /*优惠券横向滑动样式 end*/ |
请问楼主这个问题解决了么?
https://developers.weixin.qq.com/miniprogram/dev/component/movable-area.html
.u-wrp-secKill {
display
:
block
;
position
:
relative
;
width
:
100
vw;
height
:
247
rpx;
background
:
#fff
;
}
这块就是控制的宽度和高度的嘛。
整理成代码片段(https://developers.weixin.qq.com/miniprogram/dev/devtools/minicode.html),我们看下