小程序相关

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);

相关推荐
多看书少吃饭9 小时前
小程序支持HTTP POST 流式接口吗?
网络协议·http·小程序
询问QQ:48773927812 小时前
CDB文件第0x2C位置存放温度阈值
小程序
vx_vxbs6612 小时前
【SSM高校普法系统】(免费领源码+演示录像)|可做计算机毕设Java、Python、PHP、小程序APP、C#、爬虫大数据、单片机、文案
android·java·python·mysql·小程序·php·idea
duansamve16 小时前
支付宝小程序开发工具中如何模拟给页面传参?
小程序·支付宝小程序
低代码布道师17 小时前
医疗预约小程序原型设计
低代码·小程序
星光一影17 小时前
同城派送系统源码,支持小程序,h5,app
mysql·小程序·php·uniapp
说私域17 小时前
基于链动2+1模式AI智能名片S2B2C商城小程序的微商运营内容研究
大数据·人工智能·小程序
云起SAAS19 小时前
计算器抖音快手微信小程序看广告流量主开源
微信小程序·小程序·ai编程·计算器·看广告变现轻
蒲公英源码20 小时前
AI智能办公系统:一体化OA解决方案,支持PC/公众号/H5/App/小程序
人工智能·小程序