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

uniapp自定义的下面导航

uniapp自定义的下面导航

看看效果图片吧
在这里插入图片描述

文章目录

  • uniapp自定义的下面导航
    • ` 看看效果图片吧` ![在这里插入图片描述](https://img-blog.csdnimg.cn/direct/6aa0e964741d4dd3a58f4e86c4bf3247.png)
  • 前言
  • 一、写组件、我这里就没有写组件了直接写了一个页面?
  • 总结


前言


在工作中需要自定定义好看一点的头部和导航栏下面

一、写组件、我这里就没有写组件了直接写了一个页面?

<!-- 内部沟通 -->
<template><view style="display: flex; flex-direction: column; align-items: flex-start; justify-content: center;"><!-- 头部 --><view style="width: 100%; height: 7rem; background-color: #1B3357;"><headassembly @otherMiniProgram="OnOtherMiniProgram":imageSrc="'https://linda-uni.oss-cn-guangzhou.aliyuncs.com/images/workbench_tu/leftarrowgz.svg'":isSubPage="false"></headassembly></view><!-- 中间内容区域 --><view class="content" :key="currentTab"><view v-if="currentTab === 'tab1'"><view style="width: 100%;"><view style="width:100%; background-color: #FFFFFF;border-radius: 5px;margin-top: 1rem;"><view class="top"><image class="avatar_home"src="https://linda-uni.oss-cn-guangzhou.aliyuncs.com/images/workbench_tu/pexels-hannah-nelson-390257-1065084.jpg"mode="aspectFill"></image><view class="text-container"><view class="name-row"><view class="name_home">张莉莉</view><view class="tag">老板</view></view><view class="name_date">2小时前</view></view></view><view class="nie"><view style="width: 100%;"><mp-html :copy-link="true" :tagStyle="md.tagStyle" :markdown="true" :lazy-load="true":selectable="true" :content="html" /></view></view><view class="top_z"><image class="avatar_home_z"src="https://linda-uni.oss-cn-guangzhou.aliyuncs.com/images/workbench_tu/pexels-divinetechygirl-1181686.jpg"mode="aspectFill"></image><view class="text-container_z"><viewstyle="background-color: #EEEEEE;height: 1.8rem;width: 100%;border-radius: 15px;font-size: 12px;color: #B8B8B8;"><view style="padding: 0.4rem;" @click="OnShowComments()">参与评论</view></view></view></view><view class="horizontal-containerBOdy"><view class="horizontal-container"><view class="label">李思思:</view><view class="message">收到</view></view><view class="horizontal-container"><view class="label">杰哥:</view><view class="message">我要去!给我去</view></view><view class="horizontal-container"><view class="label">李白:</view><view class="message">我也要去!</view></view><view class="horizontal-container"><view class="label">悟空:</view><view class="message">俺老孙去打下手</view></view></view><view style="width: 94%; height: height: 76px;"></view></view><!-- 二 --></view></view><view v-if="currentTab === 'tab2'"></view><view v-if="currentTab === 'tab3'"><view style="width: 100%;"><view style="width: 100%; border-radius: 5px; margin-top: 1rem;"><view class="addressbook-container"><view class="person-item" v-for="person in people" :key="person.id"><image :class="['avatar_homeAddressbook', { online: person.online }]":src="person.image" mode="aspectFill"></image><view class="text-containers"><view class="name_homeAddressbook">{{ person.name }}</view><view class="tagAddressbook">{{ person.role }}</view></view></view></view></view></view></view></view><van-popup @close="OnComments" :show="showInputcomments" round position="bottom"><view style="width: 95%; height: 27rem;"><view class="popup-header"><view class="popup-title">发布评论</view><view class="popup-complete" @click="onSubmitComments">完成</view></view><view style="height: 26rem;width: 100%;margin-left: 0.6rem;"><textarea class="comment-textarea" v-model="comment" placeholder="请输入评论..."></textarea></view></view></van-popup><!-- 底部导航栏 --><view class="footer"><view class="icon-container" @click="changeTab('tab1')"><image:src="currentTab === 'tab1' ? 'https://linda-uni.oss-cn-guangzhou.aliyuncs.com/images/workbench_tu/information_1.svg' : 'https://linda-uni.oss-cn-guangzhou.aliyuncs.com/images/workbench_tu/information_0.svg'"class="icon"></image><view class="icon-label">首页</view></view><!-- 发布按钮凹槽 --><view class="publish-container"><view class="publish-button" @click="handlePublishClick"><image:src="currentTab === 'tab2' ? 'https://linda-uni.oss-cn-guangzhou.aliyuncs.com/images/workbench_tu/release_1.svg' : 'https://linda-uni.oss-cn-guangzhou.aliyuncs.com/images/workbench_tu/release_1.svg'"class="icons"></image></view></view><view class="icon-container" @click="changeTab('tab3')"><image:src="currentTab === 'tab3' ? 'https://linda-uni.oss-cn-guangzhou.aliyuncs.com/images/workbench_tu/Addressbook1.svg' : 'https://linda-uni.oss-cn-guangzhou.aliyuncs.com/images/workbench_tu/Addressbook_0.svg'"class="icon"></image><view class="icon-label">通讯录</view></view></view></view>
</template><script>import mpHtml from '@/components/mp-html/mp-html.vue'import md from '@/static/css/md';export default {computed: {md() {return md}},components: {mpHtml},destroyed() {this.mediaQueryOb.disconnect() //组件销毁时停止媒体查询监听this.mediaQueryOb = nullconsole.log('==== destroyed :')},onShow() {console.log("每次查询");},data() {return {show_tu: false,people: [{id: 1,name: '张莉莉',role: '老板',image: 'https://linda-uni.oss-cn-guangzhou.aliyuncs.com/images/workbench_tu/pexels-hannah-nelson-390257-1065084.jpg',online: true},{id: 2,name: '李四',role: '经理',image: 'https://linda-uni.oss-cn-guangzhou.aliyuncs.com/images/workbench_tu/pexels-hannah-nelson-390257-1065084.jpg',online: false},{id: 3,name: '王五',role: '员工',image: 'https://linda-uni.oss-cn-guangzhou.aliyuncs.com/images/workbench_tu/pexels-hannah-nelson-390257-1065084.jpg',online: true},{id: 4,name: '赵六',role: '实习生',image: 'https://linda-uni.oss-cn-guangzhou.aliyuncs.com/images/workbench_tu/pexels-hannah-nelson-390257-1065084.jpg',online: false},// 添加更多的人员信息],comment: '',showInputcomments: false,editorIns: null,readOnly: false,toolbarConfig: {excludeKeys: ['direction', 'date', 'lineHeight', 'letterSpacing', 'listCheck'],iconSize: '20px',iconColumns: 10,icons: [{name: 'save',title: '保存',onClick: () => this.saveContent()},]},mediaQueryOb: null, // 响应式媒体查询show_fab: false,currentTab: 'tab1',isFirstTab2: true,html: `<p> 今天唐僧过来,赶紧安排人去接待! 好家伙了 把他接过来、 念佛、 快点 由世界品牌实验室(World Brand Lab)主办的(第十六届)“世界品牌大会”在北京举行,会上发布了2019年《中国500最具价值品牌》分析报告。在这份基于财务数据、品牌强度和消费者行为分析的年度报告中, </p><p><img src="https://img.yzcdn.cn/vant/cat.jpeg" width="162" style=""> <img src="https://img.yzcdn.cn/vant/cat.jpeg" width="163" style=""></p>`}},methods: {//通讯录OnOtherMiniProgram() {uni.navigateBack();},changeTab(tab) {if (tab !== 'tab2') {this.currentTab = tab;}},handlePublishClick() {console.log('当前已经是 tab2');this.show_fab = truethis.show_tu = falseuni.navigateTo({url: '/pages/internal/postarticle/postarticle'})},OnshowInthe() {this.show_fab = false},saveContent() {this.editorIns.getContents().then((content) => {console.log('保存内容:', content.html);});},//显示输入评论OnShowComments() {this.comment = '';this.showInputcomments = true},OnComments() {this.comment = '';this.showInputcomments = false},onSubmitComments() {console.log("测试了", this.comment);this.showInputcomments = false},}}
</script>
<style src="./styles.css"></style>

上方代码直接赋值可运行 有些头部哪个我没有弄进来
哪个很简单


总结

目前感觉还是很简单的可以自己也可以在优化一下

相关文章:

  • 基于Python的AI动物识别技术研究
  • 酷开科技丨酷开系统重塑家庭娱乐生态,开启家庭生活新体验
  • RAG系统进阶(五)文本分割优化技巧及代码
  • Spring学习笔记
  • Linux基础IO【II】
  • RuoyiAdmin项目搭建及Docker 部署备忘
  • 【FreeRTOS】创建第一个多任务程序
  • Polar Web【简单】upload
  • 苹果WWDC重磅发布的IOS 18、Apple Intelligence背后的技术分析!
  • [消息队列 Kafka] Kafka 架构组件及其特性(二)Producer原理
  • 【通信协议-RTCM】RTCM通信协议常用英文缩写词汇对照表
  • CCNA 0基础入门
  • AOSP12隐藏首页搜索框----隐藏google 搜索栏
  • 高考之后第一张大流量卡应该怎么选?
  • vue3 递归循环展示下级盒子
  • Centos6.8 使用rpm安装mysql5.7
  • Cookie 在前端中的实践
  • ES学习笔记(12)--Symbol
  • Java 实战开发之spring、logback配置及chrome开发神器(六)
  • JavaScript实现分页效果
  • java中具有继承关系的类及其对象初始化顺序
  • JS变量作用域
  • vue自定义指令实现v-tap插件
  • ​Z时代时尚SUV新宠:起亚赛图斯值不值得年轻人买?
  • #QT(串口助手-界面)
  • (1综述)从零开始的嵌入式图像图像处理(PI+QT+OpenCV)实战演练
  • (Redis使用系列) Springboot 使用redis实现接口Api限流 十
  • (二)什么是Vite——Vite 和 Webpack 区别(冷启动)
  • (附源码)springboot工单管理系统 毕业设计 964158
  • (附源码)计算机毕业设计SSM基于java的云顶博客系统
  • (力扣记录)235. 二叉搜索树的最近公共祖先
  • (区间dp) (经典例题) 石子合并
  • (一)appium-desktop定位元素原理
  • (原)本想说脏话,奈何已放下
  • (原創) X61用戶,小心你的上蓋!! (NB) (ThinkPad) (X61)
  • .bat批处理(八):各种形式的变量%0、%i、%%i、var、%var%、!var!的含义和区别
  • .md即markdown文件的基本常用编写语法
  • .net core webapi 大文件上传到wwwroot文件夹
  • .net 打包工具_pyinstaller打包的exe太大?你需要站在巨人的肩膀上-VC++才是王道
  • @converter 只能用mysql吗_python-MySQLConverter对象没有mysql-connector属性’...
  • @WebService和@WebMethod注解的用法
  • []Telit UC864E 拨号上网
  • [Angular 基础] - 数据绑定(databinding)
  • [BJDCTF2020]The mystery of ip
  • [C++] 如何使用Visual Studio 2022 + QT6创建桌面应用
  • [ChromeApp]指南!让你的谷歌浏览器好用十倍!
  • [go] 迭代器模式
  • [hdu 3065] 病毒侵袭持续中 [AC自动机] [病毒特征码匹配]
  • [HNOI2018]排列
  • [iOS开发]事件处理与响应者链
  • [java/jdbc]插入数据时获取自增长主键的值
  • [Java基础]—JDBC
  • [JMS 3] ActiveMQ实现简单的helloworld
  • [leetcode] 66. 加一
  • [leetcode] Longest Palindromic Substring