- wxss模板样式: rpx单位 @import导入
- 小程序窗口组成部分: navigationBar 导航栏 ,头部,设置退出标题等按钮 background 下拉刷新的背景区域 wxml中设置页面布局
- 小程序数据接口请求: (1)https类型接口 (2)必须将接口域名添加到信任名单里(在官方文档中添加,注意一个月只能修改5次)
- 发起post,get请求
wx:request({
url:"url",
method:"get",
data:"name:'zs'",
success (res) {
console.log(res)
}
})
- 页面导航跳转:
<navigator url="/pages/home/home" open-type="switchTab>必须设置open-type属性的值</navigator>
- 非tabBar页面跳转:设置open-type的值为navigate(可省略)
- 后退导航:open-type的值必须为navigateBack,以及delta的值为数字(表示要后退的层级,为1时可以省略)【不可跳转tabBar页面】
- 编程式导航:导航到tabBar页面,调用wx.switchTab(Object,Object)方法,则可以跳转到tabBar页面.
url: 需要跳转的tabBar页面,不能带参数
success: 成功执行
fail: 失败执行
complete: 都会执行
<button bindtap="youJump"></button>
// js 部分
youJump(