当前位置:   article > 正文

微信小程序将页面按钮悬浮固定在底部_微信小程序 button页面底部

微信小程序 button页面底部

效果图如下所示:

   ps: 悬浮固定在页面的底部,并且背景有白色层将页面底部文字的显示遮罩,一面影响显示观感。且不受页面下拉上提的影响。

wxml代码如下:

  1. <!--底部按钮的背景层-->
  2. <view class="baise"></view>
  3. <!--底部按钮-->
  4. <view class="anniu">
  5. <button formType="submit" class="btn-normal btbdstk" bindtap="resetSalaryBtnClick" >
  6. <view class="bdstk" >
  7. <text >重置条件</text>
  8. </view>
  9. </button>
  10. <button formType="submit" disabled="{{disabled}}" class="btn-normal btbdstk" >
  11. <view class="sqdzk">
  12. <text>确认查询</text>
  13. </view>
  14. </button>
  15. </view>

 

wxss样式如下:

  1. /* 底部按钮 */
  2. .baise{
  3. background:#FFFFFF;
  4. display:flex;
  5. position:fixed;
  6. width:100%;
  7. height:150rpx;
  8. z-index:665;
  9. bottom:0rpx;
  10. }
  11. .anniu{
  12. display:flex;
  13. position:fixed;
  14. width:95%;
  15. z-index:666;
  16. bottom:55rpx;
  17. }
  18. .btbdstk{
  19. margin-left:30rpx;
  20. width:50%;
  21. }
  22. .bdstk{
  23. font-size:30rpx;
  24. color:#ffffff;
  25. width:100%;
  26. border:2rpx solid #ffffff;
  27. border-radius:15rpx;
  28. background:#78B8FD;
  29. height: 95rpx;
  30. text-align: center;
  31. line-height:95rpx;
  32. }
  33. .sqdzk{
  34. font-size:30rpx;
  35. color:#ffffff;
  36. width:100%;
  37. border:2rpx solid #ffffff;
  38. border-radius:15rpx;
  39. background:#FF7178;
  40. height: 95rpx;
  41. text-align: center;
  42. line-height:95rpx;
  43. }

 

声明:本文内容由网友自发贡献,不代表【wpsshop博客】立场,版权归原作者所有,本站不承担相应法律责任。如您发现有侵权的内容,请联系我们。转载请注明出处:https://www.wpsshop.cn/w/Guff_9hys/article/detail/1019968
推荐阅读
相关标签