1 wxml

<view class="fixed-bottom-btn">
  <view class="button" bindtap="goYuding">马上预定</view>
</view>

 

2 wxss

/* 固定在底部的按钮容器 */
.fixed-bottom-btn {
  position: fixed;
  bottom: 0;
  left: 0;
  width: 100%;
  padding: 20rpx;
  box-sizing: border-box;
  background-color: #f5f5f5;
  display: flex;
  justify-content: center;
  align-items: center;
}

 .button {
  height: 100rpx;
  line-height: 100rpx;
  text-align: center;
  border-radius: 20rpx;
  color: #fff;
  font-size: 38rpx;
  background: linear-gradient(to right, #d8c9b2, #dbbb7e);
  position: fixed; /* 固定定位 */
  bottom: 0; /* 紧贴底部 */
  width: 100%;
  border-radius: 50rpx; /* 圆角 */
}

 

3 效果

  上下滑动,按钮为止不便

image