微信小程序修改van-popup的背景颜色

效果图:
van-popup背景颜色渐变

使用深度修改样式不生效,直接在 custom-style里面修改即可;

javascript 复制代码
<van-popup   
  position="bottom"
  custom-style="height:25%;background:linear-gradient(95deg, #F8FCFF -0.03%, #EDF5FF 
64.44%, #F8FCFF 133.06%);"   在这里设置渐变背景
  round 
  show="{{ showLogin }}" 
  bind:close="onLoginClose">
  <button  
   open-type="getPhoneNumber"  open-type是微信原生自带
    class="wx-login-btn wx-btn" 
   bindgetphonenumber="wxLogin">手机号快捷登录</button>
  <checkbox-group class="certificate" style="width: 90%;margin:24rpx 40rpx;">
    <checkbox checked="{{isagree}}" class="checkbox" value="{{sms}}"></checkbox>
     <view class="certificate-txt">阅读并同意<text class="txt" bindtap="openUrl" data-num='lending006'>《用户信息授权书》</text>、<text class="txt" bindtap="openUrl" data-num='lending008'>《卖家云SaaS系统服务协议》</text></view>
      </checkbox-group>
</van-popup>

样式代码,包括同意协议勾选前后的样式,

javascript 复制代码
.herad .wx-login-btn {
  margin: 80rpx 0 64rpx 0;
  height: 96rpx;
  line-height: 96rpx;
  font-size: 30rpx;
  border-radius: 6rpx;
  width: 90%;
  color: #fff;
  right: 0;
  display: flex;
  justify-content: center;
  align-items: center;
  position: flex;
  bottom: 0;
  left: 0;
  padding: 0;
  margin-left: 5%;
  text-align: center;
  /* padding-left: -5rpx; */
  border-top-left-radius: 50rpx;
  border-bottom-left-radius: 50rpx;
  border-top-right-radius: 50rpx;
  border-bottom-right-radius: 50rpx;
  letter-spacing: 3rpx;
}

.wx-btn {
  background: var(--blue, linear-gradient(90deg, #1463FF 0%, #7214FF 100%));
  box-shadow: 0rpx 8rpx 20rpx 0rpx rgba(20, 72, 255, 0.20);
}
.wx-btn:hover{
  box-shadow: 10rpx 10rpx 32rpx #91c9f4;
}
.certificate {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  margin-top: 24rpx;
  font-size: 30rpx;
  color: #666666;
}
.checkbox .wx-checkbox-input {
  border-radius: 10rpx;
  /* 圆角 */
  width: 40rpx;
  /* 背景的宽 */
  height: 40rpx;
  border: none;
}
.checkbox .wx-checkbox-input {
  background:#E7E7E7
}
.checkbox .wx-checkbox-input.wx-checkbox-input-checked {
  background:#E7E7E7
}
.checkbox .wx-checkbox-input.wx-checkbox-input-checked::before {
  width: 40rpx;
  height: 40rpx;
  line-height: 40rpx;
  text-align: center;
  font-size: 20rpx;
  color: #7B7B7B;
  background: transparent;
  transform: translate(-50%, -50%) scale(1);
  -webkit-transform: translate(-50%, -50%) scale(1);
}
.certificate-txt{
  color: #222;
  font-size: 24rpx;

}
.txt {
  color: #1F6DF2;
  font-size: 24rpx;
}
相关推荐
孚亭15 小时前
Swift添加字体到项目中
开发语言·ios·swift
hweiyu0015 小时前
Go、DevOps运维开发实战(视频教程)
开发语言·golang·运维开发
mm-q291522272915 小时前
Python+Requests零基础系统掌握接口自动化测试
开发语言·python
小李小李不讲道理15 小时前
「Ant Design 组件库探索」五:Tabs组件
前端·react.js·ant design
毕设十刻15 小时前
基于Vue的学分预警系统98k51(程序 + 源码 + 数据库 + 调试部署 + 开发环境配置),配套论文文档字数达万字以上,文末可获取,系统界面展示置于文末
前端·数据库·vue.js
星星火柴93615 小时前
笔记 | C++面向对象高级开发
开发语言·c++·笔记·学习
码界奇点15 小时前
Rust 性能优化全流程从 flamegraph 定位瓶颈到 unsafe 与 SIMD 加速响应快
开发语言·性能优化·rust·simulated annealing
2501_9159090615 小时前
WebView 调试工具全解析,解决“看不见的移动端问题”
android·ios·小程序·https·uni-app·iphone·webview
mapbar_front16 小时前
在职场生存中如何做个不好惹的人
前端
牧杉-惊蛰16 小时前
纯flex布局来写瀑布流
前端·javascript·css