微信小程序开发之——个人中心-框架搭建(3)

一 概述

  • 框架搭建——配置底部切换tabBar
  • 框架搭建——新建首页及个人中心页面

二 配置底部切换tabBar

2.1 tarBar配置文件

app.json

2.2 tarBar添加按钮

"tabBar": {
    "list": [
      {
        "pagePath": "pages/index/index",
        "iconPath": "images/home.png",
        "selectedIconPath": "images/home_select.png",
        "text": "首页"
      },
      {
        "pagePath": "pages/person/person",
        "iconPath": "images/me.png",
        "selectedIconPath": "images/me_select.png",
        "text": "个人中心"
      }
    ]
  },

说明:

属性说明
listtabBar下的tab标签列表
pagePath页面路径
iconPath默认图标
selectedIconPath选中图标选项
texttab显示文字

2.3 tabBar选中和未选中文字颜色

"tabBar": {
    "color": "#000",
    "selectedColor": "#f7982a",
    "backgroundColor": "#f6f6f6",
    "borderStyle": "white"
  },

说明:

属性说明
colortabBar的默认字体颜色
selectedColortabBar的字体选中颜色
backgroundColortabBar的背景

2.4 windows样式

"window": {
    "backgroundTextStyle": "light",
    "navigationBarBackgroundColor": "#f7982a",
    "navigationBarTitleText": "个人中心",
    "navigationBarTextStyle": "white"
  },

三 新建首页及个人中心页面

3.1 新建页面

  • 右键pages,建立对应的文件夹如(address文件夹)

  • 在文件夹上,右键——>新建page(包含以下文件)

    address.js
    address.json
    address.wxml
    address.wxss
    
  • 同理,新建其他页面

    页面page
    首页index
    个人中心person
    收货地址address
    订单物流查询页面order
    个人详情页detail
    个人资料修改页modify

3.2 app.js页面配置

"pages": [
    "pages/index/index",
    "pages/person/person",
    "pages/address/address",
    "pages/order/order",
    "pages/detail/detail",
    "pages/modify/modify"
  ],

四 源码

  • 1
    点赞
  • 8
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值