微信小程序简单页面开发案例

1.组件照片组合
<view>示例一</view>
<view class="menu">
    <view class="item">
    	<text>精品</text>
   		<image src="/.../.../xxx.jpg"></image>
    </view>
    <view class="item">
    	<text>精品</text>
   		<image src="/.../.../xxx.jpg"></image>
    </view>
    <view class="item">
    	<text>精品</text>
   		<image src="/.../.../xxx.jpg"></image>
    </view><view class="item">
    	<text>精品</text>
   		<image src="/.../.../xxx.jpg"></image>
    </view>
</view>

<view>示例二</view>
<view class="action">
    <view class="item">
         <view class="title">第一场拍卖吃的东西</view>
         <view class="tips">
         <view class="status">2020-01-01</view>
               <view class="count">111观围</view>
         </view>
         <view class="big">
             <image src="/../xxx.jpg"></image>
         </view>
        <view class="small">
        	<image src="/../xxx.jpg"></image>
            <image src="/../xxx.jpg"></image>
            <image src="/../xxx.jpg"></image>
            <image src="/../xxx.jpg"></image>
            <image src="/../xxx.jpg"></image>
        </view>
     </view>
</view>
    
  • flex布局

    /*示例一样式*/
    image{
        width:100rpx;
        height:100rpx
        border-radius:50rpx;
    }
    .menu{
        display:flex;
        /*在水平方向排列   row规定主轴的方向为水平*/
        flex-direction:row;
        /*在水平方向排列  在主轴方向如何让排列center space-around space-between flex-start*/
        justify-content:center;//居中
        
        /*在副轴方向如何让排列* flex-begin flex-end*/
        align-items:center;
    }
    .menu .item{
         display:flex;
         flex-direction:column;
        
    }
    
    /*示例二样式*/
    .ation .item .title{
        font-size:50rpx;
        font-weight:600;
    }
    .ation .item .tips{
        display:flex;
        flex-direction:row;
        justify-content:space-between;//居中
        font-size:30rpx;
        color:pink;
    }
    .ation .item .big{
        height:400rpx;
        overflow:hidden;
    }
    .ation .item .big image{
        width:100%;
        heigit:100%;
    }
    .ation .item .small{
        display:flex;
        justify-content:flax-start;//居中
    }
    .ation .item .small image{
        height:100rpx;
        width:100rpx;
        padding-right:20rpx;
    }
    
  • 一种常用方便的布局方式

2.小程序里边特殊的样式
  • px
  • rpx 自适应排列 宽度:750rpx
3.实战页面
  • 首页
  • 拍卖页面
  • 消息页面
  • 个人页面
    • 不需要写二级页面只需要写一级页面
4.tabBar导航
{
  "pages": ["pages/index/index", "pages/logs/index"],
  "window": {
    "navigationBarTitleText": "Demo"
  },
  "tabBar": {
    "list": [
      {
        "pagePath": "pages/index/index",
        "text": "首页"
      },
      {
        "pagePath": "pages/logs/logs",
        "text": "日志"
      }
    ]
  },
  "networkTimeout": {
    "request": 10000,
    "downloadFile": 10000
  },
  "debug": true,
}
5.全局配置
{
  "window": {
    "navigationBarBackgroundColor": "#ffffff",
    "navigationBarTextStyle": "black",
    "navigationBarTitleText": "微信接口功能演示",
    "backgroundColor": "#eeeeee",
    "backgroundTextStyle": "light"
  }
}
属性类型必填描述最低版本
entryPagePathstring小程序默认启动首页
pagesstring[]页面路径列表
windowObject全局的默认窗口表现
tabBarObject底部 tab 栏的表现
networkTimeoutObject网络超时时间
debugboolean是否开启 debug 模式,默认关闭
functionalPagesboolean是否启用插件功能页,默认关闭2.1.0
subpackagesObject[]分包结构配置1.7.3
workersstringWorker 代码放置的目录1.9.90
requiredBackgroundModesstring[]需要在后台使用的能力,如「音乐播放」
pluginsObject使用到的插件1.9.6
preloadRuleObject分包预下载规则2.3.0
resizablebooleanPC 小程序是否支持用户任意改变窗口大小(包括最大化窗口);iPad 小程序是否支持屏幕旋转。默认关闭2.3.0
usingComponentsObject全局自定义组件配置开发者工具 1.02.1810190
permissionObject小程序接口权限相关设置微信客户端 7.0.0
sitemapLocationstring指明 sitemap.json 的位置
stylestring指定使用升级后的weui样式2.8.0
useExtendedLibObject指定需要引用的扩展库2.2.1
entranceDeclareObject微信消息用小程序打开微信客户端7.0.9
darkmodeboolean小程序支持 DarkMode2.11.0
themeLocationstring指明 theme.json 的位置,darkmode为true为必填开发者工具 1.03.2004271
lazyCodeLoadingstring配置自定义组件代码按需注入2.11.1
singlePageObject单页模式相关配置2.12.0
  • 全局配置 网址:https://developers.weixin.qq.com/miniprogram/dev/reference/configuration/app.html
  • tabBer网址:https://developers.weixin.qq.com/miniprogram/dev/reference/configuration/app.html#tabBar
  • 0
    点赞
  • 1
    收藏
    觉得还不错? 一键收藏
  • 打赏
    打赏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包

打赏作者

大白菜程序猿

你的鼓励将是我创作的最大动力

¥1 ¥2 ¥4 ¥6 ¥10 ¥20
扫码支付:¥1
获取中
扫码支付

您的余额不足,请更换扫码支付或充值

打赏作者

实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

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

余额充值