微信小程序尝试--写一个简单的tabbar和首页

这是尝试写一个微信小程序

推荐多看官方文档

微信小程序不支持大图,这里上传图片来使用

在这里插入图片描述
在这里插入图片描述
在这里插入图片描述
在这里插入图片描述
在这里插入图片描述

先放上简单的首页效果

推荐使用iPhone6调试,然后单位使用rpx, 1px=2rpx,这是微信小程序的单位会自适应不同的屏幕:
在这里插入图片描述

app.json文件内容

{
   
  "pages": [
    "pages/index/index",
    "pages/publish/publish",
    "pages/detail/detail",
    "pages/share/share",
    "pages/login/login",
    "pages/info/info",
    "pages/select_city/select_city",
    "pages/mypage/mypage",
    "pages/info_collect/info_collect",
    "pages/new_built/new_built"
  ],
  "window": {
   
    "backgroundTextStyle": "light",
    "navigationBarBackgroundColor": "#3a4861",
    "navigationBarTitleText": "Hermt",
    "navigationBarTextStyle": "white",
    "enablePullDownRefresh": false,
    "onReachBottomDistance": 50
  },
  "tabBar": {
   
    "list": [
      {
   
        "pagePath": "pages/index/index",
        "text": "主页",
        "iconPath": "/icons/home.png",
        "selectedIconPath": "/icons/home-active.png"
      },
      {
   
        "pagePath": "pages/publish/publish",
        "text": "新建",
        "iconPath": "/icons/add.png",
        "selectedIconPath": "/icons/add_active.png"
      },
      {
   
        "pagePath": "pages/mypage/mypage",
        "text": "我的",
        "iconPath": "/icons/profile.png",
        "selectedIconPath": "/icons/profile-active.png"
      }
    ]
  },
  "sitemapLocation": "sitemap.json"
}

index.wxml

<!--index.wxml-->
<!-- 头部视图,地址选择和搜索框 -->
<view class='head_view'>
  <navigator url='/pages/select_city/select_city' id='select_addr'>杭州
  <image src="/icons/down.png" class='down_png'></image></navigator>
  <input type='text' class='search_bar'></input> 
  <image src='/icons/search.png' class='search_icon'></image>
</view>
<!-- 头部图片区 -->
<view class='head_image_area'></view>
 <!-- 筛选功能区 -->
<view class='page_sort_area'>
  <view class='sorted_item'>类型
    <image src='/icons/down_sorted.png
  • 0
    点赞
  • 1
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值