小程序--页面跳转

时间:2018-09-24 14:46:42   收藏:0   阅读:188

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");
      }
    })
  }
})

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

  技术分享图片

 

评论(0
© 2014 mamicode.com 版权所有 京ICP备13008772号-2  联系我们:gaon5@hotmail.com
迷上了代码!