小程序--页面跳转

wxml页面

<view catchtap='onTapJump' class='journey-container'>
    <text class='journey'>开启小程序之旅</text>
  </view>

wxss页面

.journey-container{
  margin-top: 200rpx;
  border: 1px solid #ea5a3c;
  width: 200rpx;
  height: 80rpx;
  border-radius:5px;
  text-align: center;
}
.journey{
  font-size: 22rpx;
  font-weight: bold;
  line-height: 80rpx;
  color: #ea5a3c;
}
page{
    background-color: #ecc0a8;
}

js页面

Page({
  onTapJump:function(event){
    wx.redirectTo({
      url: '../posts/posts',
      success:function(){
        console.log("jump success");
      },
      file:function(){
        console.log("jump failed");
      },
      complete:function(){
        console.log("jump complete");
      }
    })
  }
})

效果图:(点击跳转到另一个页面)

  

 

posted @ 2018-09-24 13:29  好笑。  阅读(202)  评论(0编辑  收藏  举报