小程序相关

1.右侧胶囊宽度,胶囊和文本重合问题

javascript 复制代码
// #ifdef MP-WEIXIN
// 获取胶囊左边界坐标
const { left } = uni.getMenuButtonBoundingClientRect()
this.rightSafeArea = left + 'px'
// #endif

//给到你的内容宽度
<view :style="{'max-width':rightSafeArea}">

2.在uview组件上修改样式不会生效,需要在外面套view

或者是在小程序开发工具中看下没有生效的view样式类名,用::v-deep写样式,h5和小程序用条件编译

3.顶部导航栏

顶部为搜索栏,可以获取胶囊信息设置

javascript 复制代码
const { height, top } = uni.getMenuButtonBoundingClientRect()
let statusBarHeight
uni.getSystemInfo({
	success: (e) => {
        statusBarHeight=e.statusBarHeight
    }
})
this.height= height + (top - statusBarHeight) * 2;

顶部为左侧返回按钮,中间为文本

javascript 复制代码
statusBar = e.statusBarHeight
const custom = wx.getMenuButtonBoundingClientRect()
customBar = custom.bottom + custom.top - e.statusBarHeight
//整个导航栏高度
:style="{'height':customBar+'px'}"
//标题内容
:style="{'line-height':statusBar+'px','margin-top':(customBar/2)+'px'}"

4.小程序底部占位

底部安全距离padding-bottom: env(safe-area-inset-bottom);

相关推荐
万岳科技系统开发6 小时前
外卖系统选型与源码与 SaaS 实践的思考
数据库·小程序
bug总结9 小时前
小程序云函数 vs 传统前后端分离(阿里云)原理解析
阿里云·小程序·云计算
2501_933907219 小时前
如何通过上海本凡科技获得优质的小程序开发服务?
科技·微信小程序·小程序
a17798877121 天前
小程序上传图像失败
小程序·c#
花卷HJ1 天前
微信小程序国际化完整方案
微信小程序·小程序·notepad++
2501_916008891 天前
2026 iOS 证书管理,告别钥匙串依赖,构建可复制的签名环境
android·ios·小程序·https·uni-app·iphone·webview
土土哥V_araolin1 天前
十二星商城小公排系统开发
小程序·个人开发·零售
hashiqimiya1 天前
微信小程序--动态切换登录注册标签页
微信小程序·小程序
hashiqimiya1 天前
微信小程序--获取验证码设计倒计时灰白色
微信小程序·小程序
weixin_lynhgworld1 天前
电商营销新风口,淘宝扭蛋机小程序引爆流量与转化
小程序