小程序相关

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

相关推荐
全栈软件开发7 小时前
新版点微同城主题源码34.7+全套插件+小程序前后端 源文件
小程序
毕设源码-朱学姐7 小时前
【开题答辩全过程】以 基于java的民宿管理小程序为例,包含答辩的问题和答案
java·开发语言·小程序
shykevin10 小时前
uni-app x开发商城系统,小程序发布,h5发布,安卓打包
android·小程序·uni-app
说私域12 小时前
社群经济下开源链动2+1模式AI智能名片S2B2C商城小程序的信任重构机制研究
人工智能·小程序·重构
说私域21 小时前
开源AI智能名片链动2+1模式S2B2C商城小程序FAQ设计及其意义探究
人工智能·小程序
小小王app小程序开发21 小时前
短剧小程序 2025 核心痛点分析:内容、技术与合规的三重困境
小程序
27669582921 天前
朴朴超市小程序分析
java·python·小程序·node·sign·朴朴超市·sign-v2
低代码布道师1 天前
医疗小程序04添加就诊人
低代码·小程序
Best1 天前
uniapp 微信小程序记录
微信小程序·小程序·uni-app
蒲公英源码1 天前
基于PHP+Vue+小程序快递比价寄件系统
vue.js·小程序·php