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

开放平台产品经理北京网站优化推广方案

开放平台产品经理,北京网站优化推广方案,个人作品网站链接怎么做,行业软件公司外包一、效果展示: 二、代码实现: 1.首先在pages.json文件中进行tabbar的样式和列表配置,代码如下: {"pages": [ //pages数组中第一项表示应用启动页,参考:https://uniapp.dcloud.io/collocation/p…

一、效果展示:

在这里插入图片描述

二、代码实现:

1.首先在pages.json文件中进行tabbar的样式和列表配置,代码如下:

{"pages": [ //pages数组中第一项表示应用启动页,参考:https://uniapp.dcloud.io/collocation/pages{"path": "pages/index/index","style": {"navigationBarTitleText": "uni-app"}},{"path": "pages/todo/todo","style": {"navigationBarTitleText": "uni-app"}},{"path": "pages/workBench/workBench","style": {"navigationBarTitleText": "uni-app"}},{"path": "pages/contacts/contacts","style": {"navigationBarTitleText": "uni-app"}},{"path": "pages/my/my","style": {"navigationBarTitleText": "uni-app"}}],"tabBar": {"color": "#B6C3D2","selectedColor": "#2B2E3D","borderStyle": "black","backgroundColor": "#FFFFFF","list": [{"pagePath": "pages/index/index","iconPath": "static/index01.png","selectedIconPath": "static/index02.png","text": "首页"},{"pagePath": "pages/todo/todo","iconPath": "static/dd01.png","selectedIconPath": "static/dd02.png","text": "订单1"},{"pagePath": "pages/workBench/workBench","iconPath": "static/shop01.png","selectedIconPath": "static/shop02.png","text": "店铺"},{"pagePath": "pages/contacts/contacts","iconPath": "static/dd01.png","selectedIconPath": "static/dd02.png","text": "订单2"},{"pagePath": "pages/my/my","iconPath": "static/my01.png","selectedIconPath": "static/my02.png","text": "我的"}]},"globalStyle": {"navigationBarTextStyle": "black","navigationBarTitleText": "uni-app","navigationBarBackgroundColor": "#F8F8F8","backgroundColor": "#F8F8F8"},"uniIdRouter": {}
}

2.在components文件中封装一个Tabbar 组件,命名为TabBar.vue 代码如下:

<template><view class="tabbar-container"><block><view class="tabbar-item" v-for="(item,index) in tabbarList":class="[item.centerItem ? ' center-item' : '']" @click="changeItem(item)"><view class="item-top"><image :src="currentItem==item.id?item.selectIcon:item.icon"></image></view><view class="item-bottom" :class="[currentItem==item.id ? 'item-active' : '']"><text>{{item.text}}</text></view></view></block></view>
</template><script>export default {props: {currentPage: {type: Number,default: 0}},data() {return {currentItem: 0,tabbarList: [{id: 0,path: "/pages/index/index",icon: "/static/index01.png",selectIcon: "/static/index02.png",text: "首页",centerItem: false}, {id: 1,path: "/pages/todo/todo",icon: "/static/dd01.png",selectIcon: "/static/dd02.png",text: "订单1",centerItem: false}, {id: 2,path: "/pages/workBench/workBench",icon: "/static/shop01.png",selectIcon: "/static/shop02.png",text: "店铺",centerItem: true}, {id: 3,path: "/pages/contacts/contacts",icon: "/static/dd01.png",selectIcon: "/static/dd02.png",text: "订单2",centerItem: false}, {id: 4,path: "/pages/mine/mine",icon: "/static/my01.png",selectIcon: "/static/my02.png",text: "我的",centerItem: false}]};},mounted() {this.currentItem = this.currentPage;uni.hideTabBar();},methods: {changeItem(item) {let _this = this;//_this.currentItem = item.id;  uni.switchTab({url: item.path});console.log(item.path)}}}
</script>
<style>view {padding: 0;margin: 0;box-sizing: border-box;}.tabbar-container {position: fixed;bottom: 0;left: 0;width: 100%;height: 110rpx;/* box-shadow: 0 0 5px #999;  */box-shadow: 0px 3px 20px rgba(0, 0, 0, 0.16);border-top: 1px;display: flex;align-items: center;padding: 5rpx 0;color: #999999;z-index: 200;background-color: #fff;}.tabbar-container .tabbar-item {width: 20%;height: 100rpx;display: flex;flex-direction: column;justify-content: center;align-items: center;text-align: center;}.tabbar-container .item-active {color: #1AD080;}.tabbar-container .center-item {display: block;position: relative;}.tabbar-container .tabbar-item .item-top {width: 54rpx;height: 54rpx;padding: 0rpx;}.tabbar-container .center-item .item-top {flex-shrink: 0;width: 100rpx;height: 100rpx;position: absolute;top: -50rpx;left: calc(50% - 50rpx);border-radius: 50%;box-shadow: 0px 3px 20px rgba(0, 0, 0, 0.16);/* box-shadow: 0 0 5px #999;  */background-color: #ffffff;padding: 10rpx;}.tabbar-container .tabbar-item .item-top image {width: 100%;height: 100%;}tabbar-container .tabbar-item:nth-child(3) .item-top image {background: #ff0000;}.tabbar-container .tabbar-item .item-bottom {font-size: 28rpx;width: 100%;}.tabbar-container .center-item .item-bottom {position: absolute;bottom: 5rpx;}
</style>

3.在mian.js 全局注册组件

import TabBar from "./components/TabBar.vue"
Vue.component('TabBar', TabBar);  

4.在页面中使用组件

<TabBar :current-page="0" />

完成~

http://www.15wanjia.com/news/15111.html

相关文章:

  • 比特币做游戏币的网站百度一下百度首页官网
  • 外包公司企业网站开封网络推广公司
  • 海洋公园网站建设方案怎样创建网站或者网址
  • lanyun网站开发软文营销的定义
  • 08影院wordpress主题电脑优化工具
  • msn网站制作百度站长管理平台
  • 弹幕网站用什么做it培训
  • 云服务器价格购买价格表西安seo网站优化
  • 怎么制作网站表白引擎搜索优化
  • 如何搭建网站的结构郑州网站优化排名
  • 描述对于营销型网站建设很重要飘红效果更佳焦作整站优化
  • 火锅料网站方案怎么做竞价托管推广代运营
  • 制作公司网页可以用网上图片吗厦门搜索引擎优化
  • 为网站开发在线生成个人网站
  • 百度网站验证怎么做域名停靠浏览器
  • 青岛模板建站多少钱互联网seo是什么意思
  • 网站如何换域名网站推广app下载
  • 网站建设技术指标营销培训课程有哪些
  • 网站做多久能盈利旺道seo网站优化大师
  • 为网站开发android客户端教育培训网站模板
  • 北京品牌型网站建设靠谱市场营销考试题目及答案2022
  • 技术支持 东莞网站建设传送带合肥网站维护公司
  • 做网站哪家靠谱今日头条极速版官网
  • 网站建设丶金手指下拉十五google关键词优化
  • 哈尔滨做网站哪家好关键词分析软件
  • 微信小程序游戏手游排行榜百度seo培训课程
  • 在线免费高清logo珠海网站seo
  • 物流网站seo网站优化详解
  • app优化是什么意思天津seo排名
  • 网站建设具体日程安排百度热搜大数据