当前位置: 首页 > news >正文

移动开发的现状和前景百度推广优化排名

移动开发的现状和前景,百度推广优化排名,设计网站软件开发,无锡比较大的互联网公司文章目录 1. 实现效果2. App.vue3. pages.json 配置自定义4. 顶部导航栏 使用 微信小程序自定义 navigationBar 顶部导航栏,兼容适配所有机型 1. 实现效果 2. App.vue 在App.vue 中,设置获取的 StatusBar,CustomBar 高度(实现适配…

文章目录

  • 1. 实现效果
  • 2. App.vue
  • 3. pages.json 配置自定义
  • 4. 顶部导航栏 使用

微信小程序自定义 navigationBar 顶部导航栏,兼容适配所有机型

1. 实现效果

在这里插入图片描述

2. App.vue

  1. 在App.vue 中,设置获取的 StatusBarCustomBar 高度(实现适配高度写法)
  2. uni.getSystemInfo 获取可视区域的高度
  3. wx.getMenuButtonBoundingClientRect() 胶囊按钮位置信息
<script>import Vue from 'vue'export default {onLaunch: function() {uni.getSystemInfo({success: function(e) {// #ifndef MPVue.prototype.StatusBar = e.statusBarHeight;if (e.platform == 'android') {Vue.prototype.CustomBar = e.statusBarHeight + 50;} else {Vue.prototype.CustomBar = e.statusBarHeight + 45;};// #endif// #ifdef MP-WEIXINVue.prototype.StatusBar = e.statusBarHeight;let custom = wx.getMenuButtonBoundingClientRect();Vue.prototype.Custom = custom;Vue.prototype.CustomBar = custom.bottom + custom.top - e.statusBarHeight + 4;// #endif		// #ifdef MP-ALIPAYVue.prototype.StatusBar = e.statusBarHeight;Vue.prototype.CustomBar = e.statusBarHeight + e.titleBarHeight;// #endif}});},onShow: function() {console.log('App Show')},onHide: function() {console.log('App Hide')}}
</script><style lang="scss">
</style>

3. pages.json 配置自定义

"pages": [{"path": "home","style": {"navigationStyle": "custom"}
}]

4. 顶部导航栏 使用

  1. 组件完整代码(CSS 部分 我使用的是 colorUI ,不懂的可以看看写法)
<template><view><view class="cu-custom" :style="[{height:CustomBar + 'px'}]"><view class="cu-bar fixed" :style="style" :class="[bgImage!=''?'none-bg text-white bg-img':'',bgColor]"><view class="action" @tap="BackPage" v-if="isBack"><text class="cuIcon-back"></text><slot name="backText"></slot></view><view class="content" :style="[{top:StatusBar + 'px'}]"><slot name="content"></slot></view><slot name="right"></slot></view></view></view>
</template><script>export default {data() {return {StatusBar: this.StatusBar,CustomBar: this.CustomBar};},name: 'cu-custom',computed: {style() {var StatusBar = this.StatusBar;var CustomBar = this.CustomBar;var bgImage = this.bgImage;var style = `height:${CustomBar}px;padding-top:${StatusBar}px;`;if (this.bgImage) {style = `${style}background-image:url(${bgImage});`;}return style}},props: {bgColor: {type: String,default: ''},isBack: {type: [Boolean, String],default: false},bgImage: {type: String,default: ''},},methods: {BackPage() {uni.navigateBack({delta: 1});}}}
</script><style lang="scss" scoped>
</style>
  1. main.js 全局注册顶部导航栏组件
// 此处为引用自定义顶部
import cuCustom from './colorui/components/cu-custom.vue'
Vue.component('cu-custom',cuCustom);
  1. 页面使用导航栏组件
<cu-custom class="navBox" bgColor="bg-gradual-blue" :isBack="true"><block slot="backText">返回</block><block slot="content">首页</block>
</cu-custom>
http://www.dinnco.com/news/6729.html

相关文章:

  • 有保障的广州网站建设线上销售平台有哪些
  • 做网站策划用什么软件找培训班一般在什么平台
  • 网站如何接广告国内推广平台有哪些
  • 禹城网站建设电话如何创建个人网页
  • 网站培训费用跨境电商营销推广
  • 网站制作台州企业网站模板设计
  • 武汉网站建设培训域名注册商
  • 做政协网站软件的公司怎么做网络营销推广
  • wordpress 千易网盘seo实战培训费用
  • 网络营销方式优势徐州seo网站推广
  • 平面设计图100张搜狗搜索引擎优化
  • 广告传媒公司简介ppt优化培训内容
  • 杨振峰网站开发seo教程 百度网盘
  • 斗牛app开发公司seo博客大全
  • 网站推广短信seo测试
  • 棋牌网站建设自制网站
  • wordpress分享查看内容网站优化怎么做
  • 武汉网站关键字优化手机百度seo怎么优化
  • jsp做网站用到的软件盘多多网盘资源库
  • 长沙好的网站建设公司排名在线服务器网站
  • 厦门高端网站建设登录注册入口
  • 山东济南报备小程序朔州seo
  • api网站制作河北网站推广公司
  • 电脑做系统ppt下载网站好做互联网项目怎么推广
  • 做申论真题网站百度网页提交入口
  • 西安网站设计怎么在百度发帖
  • 纯html网站开发工具东莞疫情最新消息今天新增病例
  • 网站开发服务费会计处理免费b站在线观看人数在哪儿
  • 做网站 郑州公司有哪些百度搜索引擎入口官网
  • 自贡网站建设在线seo诊断