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>

上方代碼直接賦值可運行 有些頭部哪個我沒有弄進來
哪個很簡單


總結

目前感覺還是很簡單的可以自己也可以在優化一下

本文來自互聯網用戶投稿,該文觀點僅代表作者本人,不代表本站立場。本站僅提供信息存儲空間服務,不擁有所有權,不承擔相關法律責任。
如若轉載,請注明出處:http://www.pswp.cn/web/24481.shtml
繁體地址,請注明出處:http://hk.pswp.cn/web/24481.shtml
英文地址,請注明出處:http://en.pswp.cn/web/24481.shtml

如若內容造成侵權/違法違規/事實不符,請聯系多彩編程網進行投訴反饋email:809451989@qq.com,一經查實,立即刪除!

相關文章

職場十大法則:與大家共勉

現在的社會很浮躁&#xff0c;在職的我們也都很浮躁&#xff0c;總是這山望著那山高&#xff0c;都是在為薪資而努力奮斗&#xff08;甚至跳槽&#xff09;。以下是關于職場法則的一些主要內容和建議&#xff0c;與大家共勉&#xff1a; 職場法則一&#xff1a;主動與積極&…

Elasticsearch 認證模擬題 - 12

一、題目 在集群上有 task2 索引&#xff0c;請重建它到 task2_new 索引上&#xff0c;并滿足以下要求&#xff1a; task2 索引的 a 字段包含有關鍵字 Yoo-Hoo 和 YooHoo&#xff0c;不管搜索 Yoo-Hoo 還是YooHoo 它們的結果應該一樣task2_new 和 task2 的 mapping 應該一樣 …

軟件架構x86 、 x86_64、 arm64、aarch64

看系統信息: 大多數Linux發行版都提供如 uname -a命令 arch命令用于顯示當前主機的硬件架構類型。 例如 下面的是Kylin Linux Advanced Server for Kunpeng V10 操作系統 (鯤鵬處理器是華為在2019年1月向業界發布的高性能數據中心處理器 ) 下面這個是 ubuntu 18.04.6 …

CMakeLists如何多行注釋

在使用Visual Studio編寫CMakeLists的時候你可能會遇到需要多行注釋的情況&#xff0c;可又不知道快捷鍵是什么。。。 其實你只需要敲個 #[[ 就行了&#xff0c;另外一般方括號VS會自動幫你補全&#xff0c;之后將需要注釋的內容放在第二個方括號與第三個方括號之間就完成注釋…

1-8 C語言分支循環語句

C語言的語句分為 5 類 1&#xff1a;表達式語句2&#xff1a;函數調用語句3&#xff1a;控制語句4&#xff1a;復合語句5&#xff1a;空語句 控制語句&#xff1a;用于控制程序的執行流程&#xff0c;以實現程序的各種結構方式&#xff0c;它們由特定的語句定義符組成&#x…

Python 機器學習 基礎 之 【實戰案例】中藥數據分析項目實戰

Python 機器學習 基礎 之 【實戰案例】中藥數據分析項目實戰 目錄 Python 機器學習 基礎 之 【實戰案例】中藥數據分析項目實戰 一、簡單介紹 二、中藥數據分析項目實戰 三、數據處理與分析實戰 1、數據讀取 2、中藥材數據集的數據處理與分析 2.1數據清洗 2.2、 提取別…

針對AlGaN/GaN高電子遷移率晶體管的顯式表面電勢計算和緊湊電流模型

來源&#xff1a;An Explicit Surface Potential Calculation and Compact Current Model for AlGaN/GaN HEMTs&#xff08;EDL 15年&#xff09; 摘要 在本文中,我們提出了一種新的緊湊模型,用于基于費米能級和表面電位的顯式解來描述AlGaN/GaN高電子遷移率晶體管。該模型計算…

臺灣合泰原裝BS66F360 封裝LQFP-44 電容觸摸按鍵 AD+LED增強型觸控

BS66F360是一款由Holtek Semiconductor Inc.生產的微控制器&#xff08;microcontroller&#xff09;&#xff0c;具有觸摸檢測和LED驅動功能。其應用領域廣泛&#xff0c;包括但不限于以下幾個方面&#xff1a; 1. 觸摸按鍵應用&#xff1a;BS66F360內置了觸摸按鍵檢測功能&am…

華為云耀云服務器L實例規則配置教程(親自實操經驗)

我剛買了這個最基礎的36&#xffe5;的L實例的云服務器&#xff0c;這個實例是自帶公網ip的&#xff0c;不需要額外購買。我準備先配置好&#xff0c;能夠通過公網ip訪問&#xff0c;以便之后上傳javaweb項目可以直接訪問&#xff0c;不過中途遇到了點問題&#xff0c;但是已解…

富格林:曝光糾正出金虧損陋習

富格林悉知&#xff0c;雖然現貨黃金市場看似變化無常&#xff0c;在操作方向上依舊是有跡可循的&#xff0c;投資者需要了解曝光的專業經驗糾正陋習阻止出金虧損。要獲得優質的黃金投資出金效果&#xff0c;就需要在明確現貨黃金操作技巧的前提下&#xff0c;只有規范遵循已曝…

Ansible——script模塊

目錄 特點 參數總結 使用 ansible 命令 1. 基本示例 2. 傳遞參數 3. 使用 creates 參數 4. 使用 removes 參數 示例 Playbook 文件 基本語法 1. 基本使用 2. 傳遞參數 3. 使用 creates 參數 4. 使用 removes 參數 5. 使用 register 捕獲輸出 6. 使用 args 指定參數…

【Vue】sync修飾符

文章目錄 一、介紹二、語法三、代碼示例 一、介紹 作用&#xff1a;可以實現 子組件 與 父組件數據 的 雙向綁定&#xff0c;簡化代碼 簡單理解&#xff1a;子組件可以修改父組件傳過來的props值 特點&#xff1a;prop屬性名&#xff0c;可以自定義&#xff0c;非固定為valu…

如何安裝 CleanMyMac X 4.15.3破解版

CleanMyMac X 4.15.3破解版是一款專業的Mac系統清理軟件&#xff0c;可一鍵智能掃描清理mac系統日志緩存磁盤垃圾和多余語言安裝包&#xff0c;快速釋放電腦內存&#xff0c;輕松管理和升級Mac上的應用。同時CleanMyMac X 破解版可以強力卸載惡意軟件&#xff0c;修復系統漏洞&…

仿今日頭條的新聞資訊系統

軟件簡介 新聞資訊系統&#xff0c;前端基于 Uniapp、Uview&#xff0c;后端基于Ruoyi系統&#xff0c;代碼易讀易懂、界面簡潔美觀。一套前端代碼&#xff0c;同時支持微信小程序、Android、Ios應用等多種應用。 平臺簡介 新聞資訊系統&#xff0c;主要包括首頁、行業資訊、…

Adobe Illustrator 矢量圖設計軟件下載安裝,Illustrator 輕松創建各種矢量圖形

Adobe Illustrator&#xff0c;它不僅僅是一個簡單的圖形編輯工具&#xff0c;更是一個擁有豐富功能和強大性能的設計利器。 在這款軟件中&#xff0c;用戶可以通過各種精心設計的工具&#xff0c;輕松創建和編輯基于矢量路徑的圖形文件。這些矢量圖形不僅具有高度的可編輯性&a…

高中數學:數列-基礎概念

一、什么是數列&#xff1f; 一般地&#xff0c;我們把按照確定的順序排列的一列數稱為數列&#xff0c;數列中的每一個數叫做這個數列的項&#xff0c;數列的第一項稱為首項。 項數有限個的數列叫做有窮數列&#xff0c;項數無限個的數列叫做無窮數列。 二、一般形式 數列和…

Ubuntu20.04-SLAM軟件安裝

目錄 安裝環境安裝問題1.Ubuntu20.04在T440p上的安裝問題1.1 安裝后提示"x86/cpu:VMX(outside TXT) disabled by BIOS"1.2 ACPI Error:Needed type[Reference],found [Integer] 等錯誤1.3 ima: Error Communicating to TPM chip 2.中文輸入法-google pinyin3. gcc/cm…

計算機二級Access操作題總結——簡單應用

查詢設計 創建一個查詢&#xff0c;能夠在客人每次結賬時根據客人的姓名提示統計這個客人已住天數和應交金額&#xff0c;并顯示“姓名”、“房間號”、“已住天數”和“應交金額”&#xff0c;所建查詢命名為“qT2”。 注&#xff1a;輸入姓名時應提示“請輸入姓名”。已住天…

SpringBoot: 可執行jar的特殊邏輯

這一篇我們來看看Java代碼怎么操作zip文件(jar文件)&#xff0c;然后SpringBoot的特殊處理&#xff0c;文章分為2部分 Zip API解釋&#xff0c;看看我們工具箱里有哪些工具能用SpringBoot的特殊處理&#xff0c;看看SpringBoot Jar和普通Jar的不同 1. Zip API解釋 1. ZipFil…

深度學習論文: Emerging Properties in Self-Supervised Vision Transformers

深度學習論文: Emerging Properties in Self-Supervised Vision Transformers Emerging Properties in Self-Supervised Vision Transformers PDF: https://arxiv.org/pdf/2104.14294v1 PyTorch代碼: https://github.com/shanglianlm0525/CvPytorch PyTorch代碼: https://githu…